1 2007-01-01 Miguel de Icaza <miguel@novell.com>
3 * Everywhere that called Error_ValueCannotBeConverted: pass a new
6 Exceptions: Null.ConvertImplicitly,
7 Constant.ImplicitConversionRequired as there are too many call
8 sites for passing the ec.
10 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
11 EmitContext, if the value is null, then we do not try to provide
12 the extra information from the error (If a userdefined conversion
13 exists, as UserDefinedConversion requires a non null-EmitContext).
17 2006-12-30 Raja R Harinath <rharinath@novell.com>
19 * flowanalysis.cs (MyBitVector): Document some invariants.
20 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
21 introduced below, and add a couple of others,
23 2006-12-30 Marek Safar <marek.safar@gmail.com>
25 * attribute.cs (GetMethodObsoleteAttribute): Uses new
26 GetPropertyFromAccessor and GetEventFromAccessor.
28 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
29 overrides non-obsolete one.
30 (Indexer.Define): Error message has been moved to the parser.
32 * cs-parser.jay: Better syntax errors handling.
34 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
35 when an invocation has no arguments.
37 * ecore.cs: Removed not used caching.
39 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
42 * report.cs: Add a new warning.
44 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
46 * typemanager.cs (enumeration_type): Removed.
47 (CSharpSignature): Reuses IsSpecialMethod.
48 (IsEqual): Hack for MS BCL.
49 (GetPropertyFromAccessor): New method.
50 (GetEventFromAccessor): New method.
51 (IsSpecialMethod): Fixed to handle more cases.
53 2006-12-30 Marek Safar <marek.safar@gmail.com>
55 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
56 Made white spaces array static.
58 * ecore.cs (RemoveGenericArity): Optimized.
60 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
62 (MyBitVector.initialize_vector): Simplified.
64 2006-12-22 Miguel de Icaza <miguel@novell.com>
66 * ecore.cs: Am not entirely happy with this hack, but it seems to
67 address the issue in 80257 (a small test case for
70 I set the MethodGroupExpr.Type to an internal compiler type
71 (itself in this case) to force the resolution to take place. Why
72 it does not take place with a null is beyond me.
74 2006-12-20 Marek Safar <marek.safar@gmail.com>
77 * expression.cs (ResolveOperator): Consider user defined conversion for
78 logical and operator too.
79 (EmitBranchable): Optimization for logical and when full constant folding
80 could not be applied but one operand is constant.
82 2006-12-19 Marek Safar <marek.safar@gmail.com>
84 * class.cs (GetClassBases): Write 5 times every day, will never use
85 FullName for error reporting.
87 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
89 2006-12-19 Martin Baulig <martin@ximian.com>
91 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
92 the symbol file info here.
94 2006-12-18 Marek Safar <marek.safar@gmail.com>
96 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
97 of `elseif' is taking then following sections are not taking.
98 Fixes an issue reported on mono mailing list.
100 2006-12-18 Marek Safar <marek.safar@gmail.com>
103 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
104 a caller is not taking.
106 2006-12-18 Raja R Harinath <rharinath@novell.com>
108 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
109 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
110 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
111 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
112 * class.cs: Update to changes.
114 2006-12-17 Marek Safar <marek.safar@gmail.com>
117 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
120 * class.cs (ResolveMembers): Register an iterator in current container and
123 2006-12-16 Raja R Harinath <rharinath@novell.com>
126 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
127 satisfy a params annotated parameter.
129 2006-12-16 Marek Safar <marek.safar@gmail.com>
132 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
133 paramters correctly and not rely on hacks in Parameters class.
134 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
136 (Invocation.VerifyArgumentsCompat): Ditto.
137 (Invocation.EmitArguments): Changed to correctly emit params arguments at
140 * parameter.cs (HasParams): Don't assume that params is the last one.
142 * support.cs (ReflectionParameters.ctor): Look for params attribute
144 (ReflectionParameters.ParameterType): Removed hack when we returned last
145 parameter for out of range parameters.
146 (ParameterName, ParameterModifier): Ditto.
148 2006-12-14 Marek Safar <marek.safar@gmail.com>
151 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
152 when assembly is not CLS compliant but type is. I have no idea why is this
155 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
157 2006-12-13 Miguel de Icaza <miguel@novell.com>
159 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
160 in struct constructors, they are basically no-ops.
162 2006-12-12 Marek Safar <marek.safar@gmail.com>
164 * cs-tokenizer.cs (Position): Save preprocessor status too.
166 2006-12-12 Marek Safar <marek.safar@gmail.com>
169 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
171 2006-12-12 Marek Safar <marek.safar@gmail.com>
173 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
175 (pp_expr): Report error for an invalid expression.
176 (handle_preprocessing_directive): Simplified; add more error checking.
178 2006-12-11 Marek Safar <marek.safar@gmail.com>
181 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
184 2006-12-10 Marek Safar <marek.safar@gmail.com>
186 A fix for bugs #80093, and #75984
187 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
188 logic, it seems to me as it worked before "by coincidence".
189 (xtoken): Simplified to use reworked handle_preprocessing_directive.
190 (cleanup): Enabled endif check.
192 2006-12-09 Marek Safar <marek.safar@gmail.com>
195 * statement.cs (CollectionForeach.TryType): Generics and non-generics
196 enumerators are never ambiguous.
198 2006-12-08 Raja R Harinath <rharinath@novell.com>
201 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
203 2006-12-06 Marek Safar <marek.safar@gmail.com>
206 * class.cs (EventProperty.Define): Explicit implementation means
207 that an even is used.
209 2006-12-06 Marek Safar <marek.safar@gmail.com>
211 Fixes the operators implementation (part II)
213 * cfold.cs (DoConstantNumericPromotions): Renamed to
214 DoBinaryNumericPromotions and simplified.
215 (BinaryFold): Couple of conversion fixes; simplified.
217 * constant.cs, ecore.cs, literal.cs
218 (ToType): Renamed to ConvertImplicitly.
219 (Reduce): Renamed to ConvertExplicitly.
221 * class.cs, convert.cs: Updated.
223 * expression.cs: TryReduce doesn't throw an exception.
225 2006-12-01 Marek Safar <marek.safar@gmail.com>
228 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
231 2006-11-30 Marek Safar <marek.safar@gmail.com>
233 Fixes unary operators implementation (part I)
236 * cfold.cs (Error_CompileTimeOverflow): Made internal
238 * const.cs (IConstant): Changed to use reference to constant and
240 Updated IConstant implementations.
242 * constant.cs (CreateConstant): New factory method.
243 Updated IConstant implementation.
245 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
247 * ecore.cs: Updated to use CreateConstantReference.
249 * enum.cs: Reflects IConstant changes.
251 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
253 * literal.cs (NullConstant): Change to be independently usable.
255 2006-11-29 Martin Baulig <martin@ximian.com>
257 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
258 we need to emit the scope initializer before calling the base .ctor.
260 * anonymous.cs: Merged back from the new anonymous methods branch.
261 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
263 * expression.cs (ParameterReference.DoResolveBase): Create a
264 "normal" ScopeInfo when capturing parameters rather than using the
265 root scope; this makes things work with anonymous methods having
269 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
271 2006-11-22 Marek Safar <marek.safar@gmail.com>
274 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
275 check to a base class.
276 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
277 only when assembly has missing attribute.
280 2006-11-21 Marek Safar <marek.safar@gmail.com>
282 * cs-tokenizer.cs: Merged with gmcs version.
284 2006-11-20 Marek Safar <marek.safar@gmail.com>
287 * cs-parser.jay: Better error message when partial keyword is misplaced.
289 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
292 report.cs: CS1058 only applies to 2.0 profile (gmcs).
293 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
294 a RuntimeWrappedException by default.
296 2006-11-18 Marek Safar <marek.safar@gmail.com>
299 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
301 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
303 2006-11-18 Marek Safar <marek.safar@gmail.com>
305 * driver.cs, namespace.cs: Uses faster IndexOf version.
307 2006-11-17 Marek Safar <marek.safar@gmail.com>
310 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
312 (Operator.Define): Implicit/Explicit operator of same type is duplicate
313 even if internal name is different.
314 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
315 (UserDefinedConversion): Simplified as the operators cannot be internal.
316 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
318 (MethodLookup): Replaced EmitContext with parentType.
319 * expression.cs: Updated.
321 2006-11-09 Raja R Harinath <rharinath@novell.com>
323 * driver.cs (BadAssembly): Handle all the ugliness of
324 DefineDynamicAssembly.
326 2006-11-08 Raja R Harinath <rharinath@novell.com>
328 Address parts of #58244 -- most of what's left is in the runtime
329 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
330 CS1509 error checks, and handle them for all assembly loads, not
331 just the first invocation.
332 (LoadModule): Likewise. Move handling of 'adder_method' ...
333 * codegen.cs (AssemblyClass.AddModule): ... here.
335 2006-11-02 Marek Safar <marek.safar@gmail.com>
337 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
338 IEnumerable<T> is ambiguous.
340 2006-10-31 Marek Safar <marek.safar@gmail.com>
343 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
344 GetEnumerator is ambiguous.
346 * report.cs: Add new warning.
348 2006-10-29 Marek Safar <marek.safar@gmail.com>
351 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
352 to protected member can be nested type.
354 2006-10-28 Marek Safar <marek.safar@gmail.com>
357 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
358 to protected member must derive from current type.
360 2006-10-27 Marek Safar <marek.safar@gmail.com>
362 assign.cs: Reuses error method.
364 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
365 instead of type for constants.
366 (Expression.Error_ValueAssignment): Common error method.
368 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
371 2006-10-27 Marek Safar <marek.safar@gmail.com>
374 * expression.cs (MemberAccess.DoResolve): Check nested type
377 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
379 * doc.cs : nested delegates were not handled. Fixed bug #79754.
381 2006-10-26 Marek Safar <marek.safar@gmail.com>
384 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
386 2006-10-26 Marek Safar <marek.safar@gmail.com>
388 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
389 type forwarder of the same type multiple times.
391 2006-10-26 Raja R Harinath <rharinath@novell.com>
394 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
395 instance as an rvalue, even when we later resolve as an lvalue.
397 2006-10-25 Martin Baulig <martin@ximian.com>
399 * anonymous.cs: Fix #79673.
401 2006-10-24 Marek Safar <marek.safar@seznam.cz>
404 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
405 ignored when is optimized (= default value) as its value is already set.
407 2006-10-23 Marek Safar <marek.safar@seznam.cz>
410 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
411 TypeContainer for type lookup.
413 2006-10-23 Marek Safar <marek.safar@seznam.cz>
416 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
417 * expression.cs (OverloadResolve): Always convert type name for
419 (ResolveNamespaceOrType): Don't confuse a nested type with any
422 2006-10-18 Martin Baulig <martin@ximian.com>
424 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
426 2006-10-17 Miguel de Icaza <miguel@novell.com>
428 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
429 an int32, but requesting an int64 from the conversion
431 2006-10-12 Martin Baulig <martin@ximian.com>
434 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
436 2006-10-12 Martin Baulig <martin@ximian.com>
439 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
441 2006-10-11 Miguel de Icaza <miguel@novell.com>
443 * convert.cs: Remove broken code: I was doing the "Existance"
444 tests for Implicit conversions.
446 2006-10-10 Miguel de Icaza <miguel@novell.com>
448 * convert.cs: Added one missing case in
449 ImplicitStandardConversionExists uint64 to intptr.
453 * typemanager.cs (uintptr_type): another core known type.
455 * ecore.cs (OperatorCast): routine used to do cast operations that
456 depend on op_Explicit. We could change some of the Decimal
457 conversions to use this.
459 This one has a probe mechanism that checks both types for an op_
460 which it coudl be used to eliminate two classes: CastToDecimal
463 * convert.cs: Implement the conversions documented in #59800
465 2006-10-10 Martin Baulig <martin@ximian.com>
467 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
468 before RootScope.ResolveMembers().
470 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
471 `CurrentType' if appropriate.
473 2006-10-09 Marek Safar <marek.safar@seznam.cz>
476 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
477 when contains binary operators.
478 * cs-parser.jay: Updated.
480 2006-10-09 Martin Baulig <martin@ximian.com>
483 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
484 moved that into Define() and also do the other type parameter
485 checks there. Fixes #79094. Added gtest-292.cs.
488 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
489 since that doesn't include type parameters; don't use `Ldelema'
490 for type parameters. Fixes #78980. Added gtest-293.cs.
492 2006-10-08 Marek Safar <marek.safar@seznam.cz>
495 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
496 conversion is allowed.
498 2006-10-06 Marek Safar <marek.safar@seznam.cz>
500 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
501 error reporting when no error occurs.
503 2006-10-06 Marek Safar <marek.safar@seznam.cz>
505 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
508 2006-10-06 Raja R Harinath <rharinath@novell.com>
511 * class.cs (DefineTypeBuilder): Check circular dependencies before
512 setting the parent of the TypeBuilder.
513 (CheckRecursiveDefinition): Don't use 'BaseType', since
514 it may not be valid until after DefineTypeBuilder. Use
517 2006-10-04 Martin Baulig <martin@ximian.com>
519 Merged the Anonymous Methods patch.
521 * anonymous.cs, iterators.cs: The new anonymous methods code.
523 * statement.cs (Variable): New public abstract class.
524 (LocalInfo.Variable): New public property.
525 (LocalInfo.ResolveVariable): New public method.
526 (Block.Flags): Add `IsIterator'.
527 (Block.AddVariable): Improved the CS0136 check.
528 (Block.AnonymousChildren): New public property.
529 (Block.AddAnonymousChild): New public method.
530 (ToplevelBlock): Update to use the new anonymous method framework.
531 (ToplevelBlock.ctor): `container' is now a `Block' and not a
532 `ToplevelBlock'; this is required to correctly implement the
534 (Fixed, Using): Use `TemporaryVariable' instead of directly
535 creating the `LocalBuilder'.
537 * parameter.cs (Parameter.ResolveVariable): New public method.
538 (Parameters.ResolveVariable): Likewise.
540 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
542 * class.cs (TypeContainer): Replaced the `iterators' list and
543 corresponding methods with a list of `CompilerGeneratedClass'es.
544 (TypeContainer.ResolveMembers): New public method.
545 (Method): `IIteratorContainer' has been replaced by
548 * expression.cs (VariableReference): New public abstract base
549 class for `LocalVariableReference', `ParameterReference' and
552 * codegen.cs (EmitContext): Removed `capture_context',
553 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
554 (EmitContext.EmitThis): Removed.
556 * cs-parser.jay: Replace `iterator_container' with
559 2006-10-04 Martin Baulig <martin@ximian.com>
561 * generic.cs (GenericMethod): Don't make this abstract.
562 (Constraints.Clone): Added dummy implementation.
564 2006-10-04 Raja R Harinath <harinath@gmail.com>
567 * namespace.cs (LookForAnyGenericType): Avoid nullref on
568 'declspaces'. Avoid allocating arrays willy-nilly.
571 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
572 cases out of the switch.
574 2006-09-28 Marek Safar <marek.safar@seznam.cz>
576 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
577 message when non-generic type is used with the type arguments.
578 * expression.cs: Updated.
580 2006-09-28 Raja R Harinath <rharinath@novell.com>
583 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
584 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
585 Change semantics slightly. Don't insist on having only one
586 temporary EmptyExpression -- just throttle the creation of new ones.
589 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
590 non-interfaces too. If no methods are found, don't try to create
593 2006-09-28 Marek Safar <marek.safar@seznam.cz>
595 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
598 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
599 us produce better error message.
601 2006-09-27 Marek Safar <marek.safar@seznam.cz>
603 * expression.cs (Binary.ResolveOperator): Warn about a side effect
606 * report.cs: A new warning added.
608 2006-09-27 Martin Baulig <martin@ximian.com>
610 * generic.cs (GenericMethod): Don't make this abstract.
612 2006-09-27 Martin Baulig <martin@ximian.com>
615 (InternalErrorException): Added overloaded ctor taking a params array.
617 2006-09-26 Marek Safar <marek.safar@seznam.cz>
619 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
620 Fixed the cases when same error was reported twice.
622 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
623 now report symbol information.
625 2006-09-25 Martin Baulig <martin@ximian.com>
627 * class.cs: Completely unified with the gmcs version.
629 2006-09-25 Martin Baulig <martin@ximian.com>
631 * typemanager.cs (TypeManager.IsNullableType): New public function.
632 (TypeManager.IsNullableTypeOf): Likewise.
633 (TypeManager.IsNullableValueType): Likewise.
635 * class.cs (MethodCore): Added the `GenericMethod' argument from
636 gmcs and also unified all classes derived from `MethodCore' with gmcs.
638 2006-09-24 Raja R Harinath <harinath@gmail.com>
640 * convert.cs: Unify with gmcs version.
642 2006-09-24 Marek Safar <marek.safar@seznam.cz>
644 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
647 * report.cs: New warning.
649 2006-09-24 Marek Safar <marek.safar@seznam.cz>
651 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
652 for anonymous block with out argument.
654 2006-09-24 Marek Safar <marek.safar@seznam.cz>
656 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
657 not used private events only.
659 2006-09-23 Marek Safar <marek.safar@seznam.cz>
661 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
663 * const.cs (Const.Define): Check for constant type.
664 (Const.IsConstantTypeValid): Looks for valid constant types.
666 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
668 * ecore.cs (EmptyConstantCast): New common class for all constant based
671 * expression.cs (Is.DoResolve): Handle null constant especially.
672 (New.DoResolve): Check for new void().
673 (MemberAccess.DoResolve): Cope with all kind of nulls.
675 * literal.cs (NullConstant): Uses EmptyConstantCast.
676 (NullDefault): Based on EmptyConstantCast.
677 (NullLiteral): Uses EmptyConstantCast.
679 * statement.cs (Block.ResolveMeta): Check for constant type.
681 2006-09-22 Martin Baulig <martin@ximian.com>
683 * delegate.cs, attribute.cs: Merged with the gmcs versions.
685 2006-09-22 Raja R Harinath <rharinath@novell.com>
687 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
691 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
692 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
695 2006-09-22 Martin Baulig <martin@ximian.com>
697 * ecore.cs: Merged with the gmcs version.
699 * generic.cs (ConstructedType): New dummy class.
700 (TypeArguments): Don't make this abstract.
703 (TypeManager.IsGenericTypeDefinition): New method.
704 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
706 2006-09-22 Raja R Harinath <rharinath@novell.com>
708 * expression.cs (ComposedCast): Check for arrays of TypedReference
709 before creating the type, not after.
711 2006-09-21 Marek Safar <marek.safar@seznam.cz>
713 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
716 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
717 when constant must be implicitly convertible.
719 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
721 * ecore.cs (NullCast): Derives from NullConstant.
723 * expression.cs (Is.DoResolve): Removed useless variables.
724 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
725 (New.Constantify): Add enum support.
726 (MemberAccess.DoResolve): Add warning when accessing null constant or
729 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
732 * literal.cs (NullConstant): New abstract class with common
733 functionality for all null specializations.
734 (NullDefault): Represents default(X) when result can be
736 (NullLiteral): Updated.
738 * report.cs: Add new warning.
740 2006-09-21 Martin Baulig <martin@ximian.com>
742 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
744 2006-09-21 Martin Baulig <martin@ximian.com>
746 * generic.cs (GenericConstraints): New dummy class.
747 (Constraints): Likewise.
748 (TypeParameter): Likewise.
749 (TypeParameterName): Likewise.
750 (GenericMethod): Likewise.
752 * typemanager.cs (TypeManager.GetGenericArguments): New method.
754 * decl.cs: Merged with the gmcs version.
756 2006-09-21 Raja R Harinath <rharinath@novell.com>
758 * generic.cs (TypeParameter): Implement IMemberContainer.
759 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
761 * rootcontext.cs: Unify with gmcs version.
763 * report.cs: Unify with gmcs version.
764 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
765 from gmcs/generics.cs.
766 * generics.cs (TypeParameter): New dummy class.
768 * support.cs: Unify with gmcs version.
770 2006-09-20 Raja R Harinath <rharinath@novell.com>
772 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
773 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
775 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
776 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
777 * mcs.exe.sources: Add generic.cs.
779 * codegen.cs: Unify with gmcs version.
781 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
782 (EmitContext): Add GenericDeclContainer implementation.
783 * decl.cs (MemberCore, DeclSpace): Likewise.
784 * namespace.cs: Remove #ifdef GMCS_SOURCE.
786 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
787 MCS TypeManager has a corresponding dummy method.
789 2006-09-19 Martin Baulig <martin@ximian.com>
791 * expression.cs: Completely merged with the gmcs version.
793 2006-09-19 Martin Baulig <martin@ximian.com>
795 * expression.cs (Invocation): Merged with the gmcs version.
796 (ArrayAccess.GetStoreOpcode): Likewise.
798 2006-09-19 Martin Baulig <martin@ximian.com>
801 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
802 (TypeManager.IsGenericMethodDefinition): Likewise.
804 2006-09-19 Martin Baulig <martin@ximian.com>
807 (TypeManager.IsEqual): Moved the gmcs implementation here.
808 (TypeManager.DropGenericTypeArguments): Likewise.
809 (TypeManager.DropGenericMethodArguments): Likewise.
810 (TypeManager.GetTypeArguments): Moved here from gmcs.
811 (TypeManager.HasGenericArguments): Likewise.
813 2006-09-19 Martin Baulig <martin@ximian.com>
815 * expression.cs (Binary): Merged with the gmcs version.
817 2006-09-19 Martin Baulig <martin@ximian.com>
819 * expression.cs (Probe, As, Is): Merged with the gmcs version.
821 2006-09-19 Martin Baulig <martin@ximian.com>
823 * typemanager.cs: Merged with the gmcs version.
825 2006-09-16 Raja R Harinath <rharinath@novell.com>
827 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
828 * driver.cs: Likewise.
830 2006-09-16 Marek Safar <marek.safar@seznam.cz>
833 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
834 only if parent type is class.
835 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
838 2006-09-15 Marek Safar <marek.safar@seznam.cz>
841 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
843 * typemanager.cs(CSharpName): Converts NullType to null.
845 2006-09-15 Martin Baulig <martin@ximian.com>
848 (TypeManager.GetMethodName): Added mcs implementation.
849 (TypeManager.IsEqual): Likewise.
852 (SimpleName.RemoveGenericArity): Added dummy implementation.
854 * pending.cs: Merged with the gmcs version.
856 2006-09-15 Martin Baulig <martin@ximian.com>
858 * statement.cs: Merge with the gmcs version.
860 2006-09-15 Martin Baulig <martin@ximian.com>
862 * statement.cs (Switch): Merge with the gmcs implementation
863 (without nullables), which is newer.
865 2006-09-15 Martin Baulig <martin@ximian.com>
867 * statement.cs (Block.Variables): Make this public.
868 (ToplevelBlock.Parameters): Make this a property.
869 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
871 2006-09-15 Martin Baulig <martin@ximian.com>
873 * namespace.cs: Merge with the gmcs version.
875 2006-09-15 Martin Baulig <martin@ximian.com>
877 * decl.cs (MemberName): Minor code cleanups.
879 2006-09-15 Martin Baulig <martin@ximian.com>
881 * parameter.cs: Merge with the gmcs version.
883 2006-09-15 Martin Baulig <martin@ximian.com>
885 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
888 2006-09-15 Martin Baulig <martin@ximian.com>
890 * flowanalysis.cs: Merged from GMCS; added the generics code into
891 a `GMCS_SOURCE' conditional so we can share this file.
893 2006-09-08 Martin Baulig <martin@ximian.com>
895 * typemanager.cs (TypeManager.interlocked_type): New public field.
896 (TypeManager.int_interlocked_compare-exchange): New public field.
897 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
898 enumerator types here and call InitGenericCoreTypes().
899 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
900 after calling InitEnumUnderlyingTypes().
903 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
904 `classes_second_stage'.
906 2006-09-14 Marek Safar <marek.safar@seznam.cz>
908 * assign.cs, ecore.cs, expression.cs: Share error message text.
909 * class.cs (FieldMember.Define): Check for varible of static type.
910 * driver.cs (LoadAssembly): Uses error output for errors.
911 * statement.cs: Updated.
913 2006-09-08 Marek Safar <marek.safar@seznam.cz>
915 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
918 2006-09-07 Martin Baulig <martin@ximian.com>
921 (MainDriver): Revert r62663 from Marek; see #70506 for details.
923 2006-08-29 Miguel de Icaza <miguel@novell.com>
925 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
927 2006-08-17 Miguel de Icaza <miguel@novell.com>
929 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
930 #52019 and #79064, the use of the \uXXXX sequence in source code
931 to represent unicode characters.
933 2006-08-15 Marek Safar <marek.safar@seznam.cz>
935 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
937 * class.cs, ecore.cs, statement.cs: Merged to one error message.
939 2006-08-13 Miguel de Icaza <miguel@novell.com>
941 * assign.cs: Catch attempts to assign to a method groups in += and
944 2006-08-13 Marek Safar <marek.safar@seznam.cz>
947 * cs-parser.jay: Don't destroy current array type by typeof of array's.
949 2006-08-12 Marek Safar <marek.safar@seznam.cz>
951 * class.cs (Method.Define): Issue a warning when generic method looks like
953 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
956 2006-08-09 Marek Safar <marek.safar@seznam.cz>
958 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
960 * decl.cs (MemberCache.FindMembers): When container is interface we need to
961 search all base interfaces as a member can be ambiguous.
962 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
963 Constructor member type filter.
964 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
965 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
966 reporting for returned memberinfos.
967 * report.cs: Updated.
968 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
969 version to work on all runtimes.
970 (TypeManager.RealMemberLookup): Removed members filtering.
972 2006-08-08 Raja R Harinath <rharinath@novell.com>
974 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
975 (PropertyExpr.EmitAssign): Likewise.
976 * expression.cs (Indirection.EmitAssign): Likewise.
977 (LocalVariableReference.EmitAssign): Likewise.
978 (ParameterReference.EmitAssign): Likewise.
979 (Invocation.EmitArguments): Likewise.
980 (ArrayAccess.EmitAssign): Likewise.
981 (IndexerAccess.EmitAssign): Likewise.
982 (This.EmitAssign): Likewise.
983 (ConditionalLogicalOperator.Emit): Likewise.
986 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
987 instead of ArrayList. If the hashtable has a LocalBuilder, don't
988 leave it in after returning it.
989 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
991 2006-08-06 Marek Safar <marek.safar@seznam.cz>
993 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
996 2006-08-03 Raja R Harinath <rharinath@novell.com>
998 Fix cs0146-3.cs and cs0146-4.cs.
999 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
1000 enclosing types don't depend on the current type.
1002 2006-08-02 Raja R Harinath <rharinath@novell.com>
1005 * class.cs (TypeContainer.DoDefineMembers): Use
1006 FindBaseMemberWithSameName on Parent, since we're interested in
1007 whether we hide inherited members or not.
1008 (FindBaseMemberWithSameName): Make slightly more robust.
1010 Fix the non-generic testcase from #77396
1011 * decl.cs (DeclSpace.DeclContainer): Remove override.
1013 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
1014 declspaces for doppelgangers too.
1015 (UsingEntry): Implement IResolveContext.
1016 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
1017 'this' as the resolve context.
1018 (LocalAliasEntry): Likewise.
1020 Implement parts of #77403
1021 * roottypes.cs (RootDeclSpace): New. Used to represent the
1022 toplevel declaration space. Each namespace declaration introduces
1023 a "partial" root declaretion space.
1024 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
1025 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
1026 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
1027 from 'current_namespace.SlaveDeclSpace'.
1028 (namespace_declaration): Likewise.
1029 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
1030 check. It can't happen now.
1031 * decl.cs (DeclSpace.LookupType): Likewise.
1032 * driver.cs (MainDriver): Sanity check.
1034 2006-08-01 Raja R Harinath <rharinath@novell.com>
1036 * decl.cs (DeclSpace.FindNestedType): Remove.
1037 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
1038 LookupTypeContainer to get the container of the nested type.
1039 * class.cs (TypeContainer.FindNestedType): Make non-override.
1041 2006-07-31 Raja R Harinath <rharinath@novell.com>
1043 * decl.cs (DeclSpace.PartialContainer): Move field from ...
1044 * class.cs (TypeContainer.PartialContainer): ... here.
1045 (TypeContainer.AddBasesForPart): New helper.
1046 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
1048 * cs-parser.jay (current_class): Convert to DeclSpace.
1049 (struct_declaration, interface_declaration, class_declaration):
1050 Use AddBasesForPart instead of .Bases directly.
1051 * const.cs, iterators.cs: Update to changes.
1053 2006-07-28 Raja R Harinath <rharinath@novell.com>
1055 * class.cs (TypeContainer.AddMemberType): Rename from
1057 (TypeContainer.AddMember): Rename from AddToMemberContainer.
1058 (AddTypeContainer): New. Combine AddClassOrStruct and
1060 (AddPartial): Update. Add 'is_partial' argument.
1061 * roottypes.cs: Update to changes.
1062 * cs-parser.jay (push_current_class): New helper for handling
1063 current_container and current_class.
1064 (struct_declaration, interface_declaration, class_declaration):
1067 2006-07-26 Raja R Harinath <rharinath@novell.com>
1069 * roottypes.cs: Rename from tree.cs.
1071 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
1072 * tree.cs (Tree, ITreeDump): Remove types.
1073 * rootcontext.cs (tree, Tree): Remove fields.
1074 (root, ToplevelTypes): New.
1075 * *.cs: Update to rename.
1077 * tree.cs (Tree.RecordDecl): Remove.
1078 (RootTypes.AddToTypeContainer): Record the toplevel type in its
1080 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
1082 2006-07-23 Raja R Harinath <harinath@gmail.com>
1084 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
1085 DoFlowAnalysis and OmitStructFlowAnalysis here.
1086 (ec.With): Rename from WithUnsafe and generalize.
1087 (ec.WithCheckState): Remove. All users can be handled by 'With'.
1088 (ec.WithFlowAnalyis): New.
1089 * ecore.cs, expression.cs, statement.cs: Update.
1091 2006-07-22 Raja R Harinath <harinath@gmail.com>
1093 * statement.cs (Block.ResolveMeta): Simplify slightly.
1095 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
1096 multiple boolean fields. Convert InUnsafe, constant_check_state,
1097 check_state to flags.
1098 (CheckState, ConstantCheckState): Update.
1099 (InUnsafe): New read-only property.
1100 (FlagsHandle): Rename from CheckStateHandle and convert to handle
1102 (WithUnsafe): New helper similar to WithCheckState.
1103 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
1104 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
1106 2006-07-21 Raja R Harinath <rharinath@novell.com>
1108 Make comparisons use the same IL irrespective of whether they're
1109 in a 'checked' or 'unchecked' context: one of the issues in #78899
1110 * codegen.cs (EmitContext.CheckState): Make read-only property.
1111 (EmitContext.ConstantCheckState): Likewise.
1112 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
1113 helper that implement a save/restore stack for CheckState
1114 values. This is the only way to change check-state.
1115 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
1116 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
1117 (CheckedExpr.EmitBranchable): New forwarding method.
1118 (UnCheckedExpr): Likewise.
1119 * statement.cs (Block.ResolveMeta): Use WithCheckState.
1120 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
1121 (Checked.Resolve, checked.DoEmit): Likewise.
1123 2006-07-20 Miguel de Icaza <miguel@novell.com>
1125 * anonymous.cs: Cache the resolved anonymous delegate, and return
1126 this so that the ResolveTopBlock is only triggered once, not
1129 Currently we trigger ResolvetopBlock twice due to a first pass of
1130 argument check compatibility, and a second pass that does the
1133 2006-07-15 Marek Safar <marek.safar@seznam.cz>
1135 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
1137 * rootcontext.cs (Reset): Add helper_classes.
1139 2006-07-15 Marek Safar <marek.safar@seznam.cz>
1142 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
1145 2006-07-13 Miguel de Icaza <miguel@novell.com>
1147 * statement.cs (Lock): Handle expressions of type
1148 TypeManager.null_type specially. Fixes #78770
1150 2006-07-08 Marek Safar <marek.safar@seznam.cz>
1152 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
1155 2006-07-08 Marek Safar <marek.safar@seznam.cz>
1157 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
1158 for accessors as well.
1159 * ecore.cs (EventExpr): Add AccessorTable.
1161 2006-07-01 Marek Safar <marek.safar@seznam.cz>
1164 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
1165 for CS0122 where appropriate.
1166 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
1168 (Filter): Assembly can be null in the case of top level attributes.
1170 2006-06-25 Marek Safar <marek.safar@seznam.cz>
1174 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
1175 is done at global level.
1177 2006-06-24 Marek Safar <marek.safar@seznam.cz>
1179 A fix for #77002, Implemented TypeForwarder support.
1181 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
1182 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
1183 * typemanager.cs (): Add type_forwarder_attr_type.
1185 2006-06-24 Marek Safar <marek.safar@seznam.cz>
1187 * report.cs: Add CS0469 warning.
1189 2006-06-21 Martin Baulig <martin@ximian.com>
1191 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
1192 the `try'-block, so we also report CS0016 etc. there.
1194 2006-06-21 Martin Baulig <martin@ximian.com>
1197 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
1199 2006-06-21 Martin Baulig <martin@ximian.com>
1201 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
1202 also report CS1686 for parameters.
1204 2006-06-21 Martin Baulig <martin@ximian.com>
1206 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
1207 instead of an error if the value is not implicitly convertible to
1208 the switch types; fixes #77964.
1210 2006-06-21 Raja R Harinath <rharinath@novell.com>
1213 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
1214 FieldBuilder is null.
1217 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
1218 'left' and 'right' before error-checking.
1220 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
1222 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
1224 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
1225 (FieldExpr.DoResolve): likewise.
1226 (PropertyExpr.InstanceResolve): likewise.
1227 (EventExpr.InstanceResolve): likewise.
1229 2006-06-04 Marek Safar <marek.safar@seznam.cz>
1231 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
1232 attribute applicable tests for attribute argument.
1234 2006-06-02 Raja R Harinath <rharinath@novell.com>
1237 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
1238 (Binary.OverloadResolve_PredefinedIntegral): New.
1239 (Binary.OverloadResolve_PredefinedFloating): New.
1240 (Binary.OverloadResolve_PredefinedString): New.
1241 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
1242 Follow the standard more closely, and treat numeric promotions in
1243 terms of overload resolution.
1244 (Binary.CheckShiftArguments): Simplify.
1246 2006-06-01 Raja R Harinath <rharinath@novell.com>
1248 * flowanalysis.cs (MyBitVector): Simplify representation.
1249 (MyBitVector.Clone): Avoid allocating BitArray.
1250 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
1251 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
1252 (*): Update. Change all references to MyBitVector.And and
1253 MyBitVector.Or to &= and |=.
1255 2006-05-29 Raja R Harinath <rharinath@novell.com>
1258 * cs-parser.jay (formal_parameter_list): Extend the pattern below
1259 to param arguments too.
1261 2006-05-26 Miguel de Icaza <miguel@novell.com>
1263 * cs-parser.jay: Catch another parsing form for arglist being
1264 followed by other arguments. Fixes #78313.
1266 2006-05-24 Raja R Harinath <rharinath@novell.com>
1268 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1269 checking of out parameters to ...
1270 (FlowBranchingToplevel.Merge): ... here.
1271 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1272 set, propagate the origin upward, and only complain if there was
1274 (FlowBranchingException.AddContinueOrigin): Likewise.
1275 (FlowBranchingException.AddReturnOrigin): Likewise.
1276 (FlowBranchingException.AddGotoOrigin): Likewise.
1278 2006-05-23 Raja R Harinath <rharinath@novell.com>
1280 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1281 unreachable, skip it.
1282 (FlowBranchingException.Merge): Always propagate jumps, even if
1283 the finally block renders subsequent code unreachable.
1285 2006-05-18 Raja R Harinath <rharinath@novell.com>
1288 * statement.cs (Goto.Resolve): Move responsibility for resolving
1289 'goto' to FlowBranching.AddGotoOrigin.
1290 (Goto.SetResolvedTarget): New. Callback to set the
1291 LabeledStatement that's the target of the goto.
1292 (Goto.DoEmit): Use Leave instead of Br when crossing an
1293 unwind-protect boundary.
1294 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1295 LookupLabel and adjust to new semantics.
1296 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1297 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1298 Goto.SetResolvedTarget to update target.
1299 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1300 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1301 AddBreakOrigin & co. Delay propagation until ...
1302 (FlowBranchingException.Merge): ... this.
1304 * statement.cs (Block.Resolve): Always depend on flow-branching to
1305 determine unreachability. Kill workaround that originally emitted
1306 only one statement after an "unreachable" label (see infloop in
1309 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1310 This is still "wrong", but anything better would probably need a
1311 multi-pass algorithm.
1312 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1313 usage vector. Force current usage vector to be reachable, to
1314 optimistically signify backward jumps.
1315 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1317 (FlowBranchingLabeled.Merge): New. If no backward jump was
1318 detected, return the original salted-away usage vector instead,
1319 updated with appropriate changes. Print unreachable warning if
1321 * statement.cs (Block.Resolve): Don't print unreachable warning on
1322 a labeled statement.
1324 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
1326 * driver.cs: Pass filename without path to AssemblyBuilder's
1327 AddResourceFile. Fixes bug #78407.
1329 2006-05-17 Raja R Harinath <rharinath@novell.com>
1331 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1332 * flowanalysis.cs (FlowBranchingLabeled): ... here.
1333 (FlowBranching.MergeChild): Overwrite
1334 reachability information from Labeled branchings too.
1336 2006-05-16 Raja R Harinath <rharinath@novell.com>
1338 * statement.cs (Goto.Resolve): Merge jump origins here ...
1339 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1341 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1342 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
1343 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
1344 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1346 * statement.cs (Goto.Resolve): ... not here.
1347 (Goto.Emit): Remove CS1632 check.
1349 2006-05-14 Marek Safar <marek.safar@seznam.cz>
1351 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1354 2006-05-11 Raja R Harinath <rharinath@novell.com>
1356 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1357 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1358 (FlowBranchingException.Label): Likewise.
1360 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
1362 (MyBitVector.Or): Use it to avoid losing information (Count).
1363 (FlowBranching.MergeOrigins): Likewise.
1365 * flowanalysis.cs (UsageVector.IsDirty): Remove.
1366 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1367 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1368 (UsageVector.ToString): Simplify.
1369 (UsageVector.MergeSiblings): Move here from ...
1370 (FlowBranching.Merge): ... here.
1371 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1374 2006-05-10 Raja R Harinath <rharinath@novell.com>
1376 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1377 null bitvector is treated as all-true.
1379 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1380 (MyBitVector): Rationalize invariants. 'vector != null' implies
1381 that we have our own copy of the bitvector. Otherwise,
1382 'InheritsFrom == null' implies all inherited bits are true.
1384 2006-05-09 Marek Safar <marek.safar@seznam.cz>
1386 * statement.cs (LocalInfo): Add IsConstant.
1387 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1388 local variable for constants.
1390 2006-05-09 Raja R Harinath <rharinath@novell.com>
1392 * flowanalysis.cs (MyBitVector.Empty): New.
1393 (MyBitVector): Don't allow InheritedFrom to be null.
1394 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1395 (UsageVector, FlowBranching): Update to changes.
1397 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1398 recursion. The 'Parent == null' condition isn't sufficient for
1400 (FlowBranching.AddBreakOrigin): Likewise.
1401 (FlowBranching.AddContinueOrigin): Likewise.
1402 (FlowBranching.AddReturnOrigin): Likewise.
1403 (FlowBranching.StealFinallyClauses): Likewise.
1404 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1405 (FlowBranching.CheckOutParameters): Likewise.
1406 (FlowBranchingToplevel): Terminate all the above recursions here.
1407 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1408 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1410 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
1412 (FlowBranchingToplevel): New. Empty for now.
1413 (FlowBranching.MergeTopBlock): Update.
1414 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1415 branching for the anonymous delegate.
1416 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1418 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1419 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1420 information at the start of the merge. Reorganize.
1422 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1424 * class.cs (MethodData.Define): Method cannot implement interface accessor.
1426 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1428 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1429 to newly introduced ctor.
1431 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1432 message to one place.
1433 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1436 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1438 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1440 * ecore.cs (Expression.ResolveAsConstant): Updated.
1442 * statement.cs (ResolveMeta): Updated.
1444 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1446 * cs-parser.jay: __arglist cannot be used in initializer.
1448 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1451 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1454 2006-05-05 Raja R Harinath <rharinath@novell.com>
1456 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1457 (LabeledStatement): Add 'name' parameter.
1458 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1459 (Block.AddLabel): Update to changes.
1460 * cs-parser.jay (labeled_statement): Likewise.
1462 * flowanalysis.cs (BranchingType.Labeled): New.
1463 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1464 (FlowBranchingLabeled): New. Does nothing for now, but will
1465 eventually handle 'goto' flows.
1466 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1467 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1468 that's terminated ...
1469 (Block.Resolve): ... here.
1471 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1472 (UsageVector.MergeFinallyOrigins): Likewise.
1473 (FlowBranching.InTryOrCatch): Likewise.
1474 (FlowBranching.AddFinallyVector): Likewise.
1475 (FlowBranchingException): Update to changes.
1478 * statement.cs (Return.Resolve): Move error checking to ...
1479 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1480 (FlowBranchingException): Handle return origins like break and
1482 (FlowBranching.UsageVector.CheckOutParameters): Remove.
1484 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1487 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1490 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1493 * class.cs (MethodData.Define): Do public accessor check only when method
1494 implements an interface.
1496 2006-05-04 Raja R Harinath <rharinath@novell.com>
1498 Remove special handling of 'break'
1499 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1500 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
1501 (UsageVector.Break): Remove.
1502 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1504 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1506 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1507 UsageVector.Breaks (). Don't set NeedsReturnLabel.
1509 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1512 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1513 be the interface member.
1515 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1518 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1519 for emitting small (int) values.
1521 2006-05-03 Raja R Harinath <rharinath@novell.com>
1524 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1525 control-flow passes through the 'finally' after merging-in all the
1526 control-flows from 'try' and the 'catch' clauses.
1528 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1529 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
1530 always true at the only non-recursive entry point.
1531 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1532 FlowBranchingBreakable.
1533 (FlowBranchingLoop): Remove.
1534 * statement.cs (Return.DoResolve): Update to changes.
1537 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1538 (FlowBranching.CreateBranching): Handle it: create a
1539 FlowBranchingContinuable.
1540 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1541 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1542 except that it handles the 'continue' command.
1543 (FlowBranching.UsageVector.MergeOrigins): Rename from
1545 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1546 except that it overrides AddContinueOrigin.
1547 (FlowBranchingException): Override AddContinueOrigin, similar to
1549 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1550 Create a new branching around the embedded statement.
1551 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
1552 control flow after the embedded statement.
1553 (Continue.Resolve): Move all error checking to AddContinueOrigin.
1555 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1556 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1557 FlowBranchingBreakable.
1558 (FlowBranchingSwitch): Remove.
1561 * statement.cs (Break.Resolve): Simplify. Move responsibility for
1562 error reporting to ...
1563 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1564 Rename from 'AddBreakVector'. Add new location argument. Return
1565 a bool indicating whether the 'break' crosses an unwind-protect.
1566 (FlowBranchingException.AddBreakOrigin): Add.
1567 (FlowBranchingException.Merge): Propagate 'break's to surrounding
1568 flowbranching after updating with the effects of the 'finally'
1570 (FlowBranchingBreakable): New common base class for
1571 FlowBranchingLoop and FlowBranchingSwitch.
1573 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1575 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1577 2006-05-02 Raja R Harinath <rharinath@novell.com>
1579 * statement.cs (Do.Resolve): If the loop is infinite, set the
1581 (While.Resolve, For.Resolve): Set a barrier after the embedded
1582 statement. There's no direct control flow that goes from the end
1583 of the embedded statement to the end of the loop.
1584 * flowanalysis.cs (FlowBranching.Infinite): Remove.
1585 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
1586 above ensure that the reachability is correctly computed.
1588 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1589 (UsageVector.MergeBreakOrigins): If the current path is
1590 unreachable, treat it as if all parameters/locals are initialized.
1591 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
1592 infinite loops before merging-in break origins.
1594 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1595 (Reachability.Reachable): Split part into ...
1596 (Reachability.Unreachable): ... this. Simplify.
1597 (Reachability.IsUnreachable): Use 'Unreachable' instead.
1599 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1600 (Reachability.SetThrowsSometimes): Likewise.
1601 (FlowBranchingBlock.MergeTopBlock): Don't compare against
1602 TriState.Always, use corresponding property.
1603 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1604 (Block.Resolve): Likewise. Remove some redundant checks.
1606 2006-05-02 Raja R Harinath <harinath@gmail.com>
1608 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1609 (Reachability.Meet): Don't bother checking AlwaysThrows --
1610 barrier is always set.
1611 (FlowBranchingBlock.Merge): Likewise.
1613 2006-05-01 Raja R Harinath <harinath@gmail.com>
1615 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1616 checks for unreachable.
1618 2006-05-01 Marek Safar <marek.safar@seznam.cz>
1621 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1623 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1624 whether field is really assigned.
1626 2006-04-30 Raja R Harinath <harinath@gmail.com>
1628 * flowanalysis.cs (Reachability): Make 4-argument constructor
1630 (Reachability.Meet): Rename from 'And'. Remove static variant.
1631 (Reachability.Always): Rename from the highly misleading
1632 'Reachability.Never'.
1633 (FlowBranching.Merge): Update to changes. Mark an impossible
1634 situation with a 'throw'.
1635 (*): Update to changes.
1637 2006-04-29 Raja R Harinath <harinath@gmail.com>
1639 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1641 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1642 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1643 (*): Update to changes.
1644 * statement.cs: Update to changes.
1646 2006-04-28 Marek Safar <marek.safar@seznam.cz>
1649 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1651 2006-04-28 Raja R Harinath <harinath@gmail.com>
1653 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1656 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1657 argument to two arguments: an usage-vector and a bool. Move call
1658 to FlowBranching.Merge () ...
1659 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1661 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1662 handling of loop and switch reachability to ...
1663 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1665 2006-04-27 Raja R Harinath <harinath@gmail.com>
1667 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1668 handling to FlowBranchingLoop.InLoop.
1669 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1671 2006-04-26 Marek Safar <marek.safar@seznam.cz>
1674 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1675 anonymous method is allowed from AnonymousContainer here.
1677 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1679 2006-04-24 Raja R Harinath <rharinath@novell.com>
1682 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1684 2006-04-23 Marek Safar <marek.safar@seznam.cz>
1687 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1688 (DoubleConstant.Reduce): Ditto.
1690 2006-04-23 Raja R Harinath <rharinath@novell.com>
1692 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1693 Remove 'lvalue_right_side' argument. Move parts to ...
1694 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1695 (LocalVariable.DoResolveLValue): ... these.
1697 2006-04-21 Raja R Harinath <rharinath@novell.com>
1700 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1701 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1702 (LocalVariableReference.DoResolveBase): Use it to implement new
1704 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1705 (Argument.Resolve): Simplify. Move CS1510 check ...
1706 * ecore.cs (Expression.ResolveLValue): ... here.
1707 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1708 (PropertyExpr.DoResolveLValue): Likewise.
1709 (FieldExpr.Report_AssignToReadonly): Likewise.
1710 (FieldExpr.DoResolve): Add 'out_access' argument. Use
1711 LValueMemberAccess or LValueMemberOutAccess on instance depending
1713 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1714 DoResolve as appropriate.
1716 2006-04-20 Raja R Harinath <rharinath@novell.com>
1719 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1720 implicit conversions on 'out' and 'ref' arguments.
1722 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1723 improve clarity. Remove dead code.
1726 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1727 (Catch.Resolve): Resolve VarBlock if it exists.
1729 2006-04-19 Miguel de Icaza <miguel@novell.com>
1731 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1732 twice, this was some residual code, the enumerator was emitted
1733 properly in the two branche of if later.
1735 2006-04-19 Raja R Harinath <rharinath@novell.com>
1737 * expression.cs (Cast.ResolveLValue): Remove. The result of a
1738 cast is never an lvalue.
1739 (Cast.DoResolve, Cast.ResolveRest): Combine.
1740 (Argument.Emit): Simplify slightly. Move 'Expr is
1741 IMemoryLocation' check ...
1742 (Argument.Resolve): ... here.
1743 (Argument.Error_LValueRequired): Remove. Inline into only user.
1745 Simplifications. Fix cs0191-2.cs
1746 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1747 CS1649 and CS1651 to ...
1748 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
1749 the actual selection of the error code and message to a lookup
1750 table. Add a dummy return value to simplify callsites.
1751 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1752 readonly fields of other instances of the same type. Move CS0197
1754 * expression.cs (Argument.Resolve): ... here. Simplify code.
1755 Ensure that ec.InRefOutArgumentResolving is only set during LValue
1756 resolution of an out or ref argument. The code simplification
1757 above uses this invariant.
1759 2006-04-18 Raja R Harinath <rharinath@novell.com>
1761 Possibly fix #77752. Fix cs1690-[4-7].cs.
1762 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1763 CheckMarshallByRefAccess. Drop parameter.
1764 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
1766 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1768 * report.cs (AllWarnings): Add CS1690.
1769 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1771 (LocalVariableReference.DoResolveBase): Update.
1773 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1775 * class.cs (MethodOrOperator): Moved common parts from method class.
1776 detect obsolete attributes.
1777 (Method.Define): Simplified as it reuses code from base.
1778 (Constructor.ValidAttributeTargets): Fixed issue found during
1780 (Destructor.ValidAttributeTargets): Fixed issue found during
1782 (Operator): Finished refactoring set off by #78020. Operator class is now
1783 ordinary method class.
1785 * anonymous.cs: Updated.
1787 * decl.cs (DeclSpace): Add IsGeneric
1789 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1791 * class.cs (Constructor.Emit): Don't emit the attributes twice.
1793 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1795 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1796 detect obsolete attributes.
1797 (Method.CreateEmitContext): Moved to MethodOrOperator.
1799 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1802 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1803 customized exception to make crash detection easier.
1804 (MethodOrOperator): Started to work on new base class for methods and
1806 (Method): Derives from MethodOrOperator.
1807 (Constructor.Emit): Emits its own attributes.
1808 (AbstractPropertyEventMethod.Emit): Ditto.
1809 (Operator): Derives from MethodOrOperator, will refactor fully in extra
1811 (Operator.Emit): It's temporary more tricky than should be.
1813 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1815 * report.cs (InternalErrorException): Add ctor with inner exception.
1817 2006-04-08 Marek Safar <marek.safar@seznam.cz>
1820 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1823 2006-04-07 Marek Safar <marek.safar@seznam.cz>
1826 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1829 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1831 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1832 attribute is present and Guid not.
1833 (Interface.ApplyAttributeBuilder): Ditto.
1835 * attribute.cs: Add error message.
1837 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1841 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1842 sources (it's composite) so hold them in extra array as they are used in
1843 Emit phase only. It worked in the previous versions by mistake.
1844 (Attribute.Emit): Emit attribute for more owners when exist.
1846 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1847 it has now different behaviour.
1849 2006-04-04 Marek Safar <marek.safar@seznam.cz>
1851 * constant.cs (Constant.IsDefaultInitializer): New method.
1853 * class.cs: Updated.
1855 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1856 re-initialize default values. It saves KBs almost for every assembly.
1857 Thanks Zoltan for the idea.
1858 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1859 (ArrayCreation.DoResolve): Resolve only once.
1860 (ArrayCreation.Emit): Emit static initializer only when it is faster.
1861 (ArrayCreation.GetAttributableValue): Cope with optimized values.
1863 2006-04-03 Zoltan Varga <vargaz@gmail.com>
1865 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1868 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1870 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1871 in an embedded statement too.
1873 2006-04-01 Raja R Harinath <rharinath@novell.com>
1876 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1878 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1882 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1885 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1887 2006-03-31 Marek Safar <marek.safar@seznam.cz>
1889 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1892 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1893 LocalTemporary change.
1895 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1897 (ClassOrStruct.DefineFieldInitializers): Implemented static field
1898 initializers optimization.
1899 (ClassOrStruct.TypeAttr): Moved from modifiers.
1900 (Constructor.CheckBase): Don't crash when static ctor has parameters.
1901 (FieldBase.ResolveInitializer): Resolves initializer.
1902 (FieldBase.HasDefaultInitializer): New property.
1904 * cs-parser.jay: Removed message.
1906 * expression.cs (CompilerGeneratedThis): New specialization.
1908 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1910 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1912 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1914 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1916 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1917 be now EnumConstants only.
1919 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1921 * attribute.cs, driver.cs: Reset more caches.
1923 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1925 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1927 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1929 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1930 for easier reuse. Updated all overrides.
1931 (IntegralConstant): New base class for all integral constants.
1932 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1933 of the constant range, report custom error.
1934 (UIntConstant.Reduce): Fixed uint conversion.
1936 * ecore.cs, literal.cs: Reduce updates.
1938 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1942 * class.cs (Constructor.Define): Removed extra if for default ctors.
1943 A patch from Atsushi Enomoto.
1945 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1947 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1948 GetAttributableValue.
1950 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1953 * convert.cs (ImplicitConversionRequired): Error message moved to
1956 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1957 automatic implicit conversion of an output value.
1958 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1960 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1962 (TypeOf.GetAttributableValue): Add extra handling for object type.
1964 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1965 special error message.
1967 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1969 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1971 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1972 compatible with MS runtime.
1974 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1976 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1977 attribute arguments here.
1979 * class.cs (Indexer.Define): The check was moved to attribute class.
1981 2006-03-22 Marek Safar <marek.safar@seznam.cz>
1983 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1984 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1987 2006-03-22 Raja R Harinath <rharinath@novell.com>
1989 Support ParameterDefaultValueAttribute in gmcs. Also applied to
1990 mcs to keep code differences small.
1991 * attribute.cs (Attribute.GetParameterDefaultValue): New.
1992 * typemanager.cs (parameter_default_value_attribute_type): New.
1993 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
1996 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1998 * expression.cs (StringConcat.Append): Reverted back to no warning state.
2000 2006-03-21 Marek Safar <marek.safar@seznam.cz>
2002 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
2004 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
2007 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
2009 * doc-bootstrap.cs : fix build.
2011 2006-03-20 Marek Safar <marek.safar@seznam.cz>
2013 * expression.cs (StringConcat.Append): Issue a warning when empty string
2016 2006-03-20 Marek Safar <marek.safar@seznam.cz>
2018 * assign.cs (CompoundAssign.ResolveSource): Removed.
2020 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
2023 * class.cs (TypeContainer.FindMethods): Removed.
2024 (TypeContainer.CheckMemberUsage): Made static.
2026 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
2028 * constant.cs (CheckRange): Removed unused type argument.
2029 (CheckUnsigned): Removed unused type argument.
2031 * cs-parser.jay: Updated after MemberAccess clean up.
2032 Uses Length for empty string test.
2034 * cs-tokenizer.cs: Uses Length for empty string test.
2035 (IsCastToken): Made static.
2036 (is_hex): Made static.
2037 (real_type_suffix): Made static.
2039 * decl.cs (SetupCache): Made static.
2040 (OnGenerateDocComment): Removed unused ds argument.
2042 * delegate.cs (VerifyDelegate): Removed unused argument.
2044 * doc.cs: Uses Length for empty string test.
2046 * driver.cs: Uses Length for empty string test.
2048 * enum.cs (IsValidEnumType): Made static
2050 * expression.cs (EnumLiftUp): Removed unused argument.
2051 (ResolveMethodGroup): Ditto.
2052 (BetterConversion): Ditto.
2053 (GetVarargsTypes): Ditto.
2054 (UpdateIndices): Ditto.
2055 (ValidateInitializers): Ditto.
2056 (MemberAccess.ctor): Ditto.
2057 (GetIndexersForType): Ditto.
2059 * flowanalysis.cs: (MergeFinally): Removed unused argument.
2061 * iterators.cs: Updated after MemberAccess clean up.
2063 * location.cs: Uses Length for empty string test.
2065 * namespace.cs: Uses Length for empty string test.
2067 * report.cs (CheckWarningCode): Made static.
2069 * statement.cs (LabeledStatement): Removed unused argument.
2071 * typemanager.cs (FilterNone): Removed.
2073 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2075 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
2078 * class.cs: Updated.
2080 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2082 * cs-parser.jay.cs: __arglist is not allowed for delegates.
2084 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2088 * expression.cs (VerifyArgumentsCompat): Reverted to double error
2089 reporting, it's more tricky than I thought.
2091 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2095 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
2097 (AnonymousMethod.ImplicitStandardConversionExists): New method.
2098 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
2099 Add more error reporting; Fixed issue with params.
2101 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
2103 * cs-parser.jay: AnonymousMethod requires host container.
2105 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
2107 2006-03-18 Raja R Harinath <harinath@gmail.com>
2109 * class.cs: Change 'TypeContainer ds' constructor argument to
2110 'DeclSpace parent'. Some classes were missed below due to
2111 different naming convention.
2113 * class.cs (MemberCore.Parent): Delete. This makes the
2114 ParentContainer changes below enforceable by the compiler.
2116 Treat pointers to enclosing declaration space as 'DeclSpace', not
2118 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
2119 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
2121 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
2123 (Block.AddThisVariable): Likewise.
2124 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
2125 (AbstractPropertyEventMethod.Emit): Likewise.
2126 (AbstractPropertyEventMethod.EmitMethod): Likewise.
2127 (GetMethod.Define, SetMethod.Define): Likewise.
2128 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
2129 (DelegateMethod.EmitMethod): Likewise.
2131 Fix regression test-partial-13.cs.
2132 Rationalize use of PartialContainer. Ensure that the partial
2133 class semantics can be tied to type-correctness, i.e., any
2134 violation will cause a compile error.
2135 * class.cs, const.cs: Access all fields that belong to class
2136 TypeContainer via ParentContainer. Arguments of EmitContexts and
2137 Resolve()-like functions still use 'Parent'.
2139 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
2140 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
2141 (PropertyMethod.CheckModifiers): Remove unused argument.
2142 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
2145 2006-03-17 Raja R Harinath <harinath@gmail.com>
2147 Make semantics of PartialContainer simpler.
2148 * decl.cs (DeclSpace.IsPartial): Remove.
2149 * class.cs (TypeContainer.IsPartial): Likewise.
2150 (TypeContainer..ctor): Set PartialContainer to point to self.
2151 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
2152 (TypeContainer.FindNestedType): Likewise.
2153 (MemberCore.ParentContainer): Simplify. Remove deprecation.
2155 2006-03-17 Marek Safar <marek.safar@seznam.cz>
2157 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2159 2006-03-15 Marek Safar <marek.safar@seznam.cz>
2161 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
2164 2006-03-15 Marek Safar <marek.safar@seznam.cz>
2166 * class.cs (Operator.Define): An error for base conversion was not
2169 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
2171 * iterator.cs : yield break is allowed in try statement which has
2172 catch clauses. Fixed bug #77767.
2174 2006-03-13 Marek Safar <marek.safar@seznam.cz>
2176 A fix for #77593, #77574.
2178 * class.cs (MethodCore.CheckBase): Another if for operator.
2180 2006-03-09 Marek Safar <marek.safar@seznam.cz>
2182 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
2185 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
2186 (DelegateCreation.ImplicitStandardConversionExists): New method for just
2189 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
2192 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
2193 Updated after another emitcontext usage was clean up. It should help us to
2194 synchronize with gmcs easier.
2196 2006-03-04 Marek Safar <marek.safar@seznam.cz>
2200 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
2201 (Event.Define): ditto
2202 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
2204 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
2205 Removed redundant code and set NewSlot for Invoke method too.
2207 * parameter.cs (Parameters.ctor): Add custom, type ctor.
2208 (Parameters.MergeGenerated): New method. Use this method when you merge
2209 compiler generated argument with user arguments.
2211 2006-03-03 Marek Safar <marek.safar@seznam.cz>
2213 * attribute.cs (ResolveAsTypeTerminal): Removed.
2215 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
2216 specialization for predefined types; 30% speed up.
2217 Finally placed obsolete check to right place.
2218 (Expression.ResolveType): Removed.
2220 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
2221 Updated after ResolveType was removed.
2223 * expression.cs (Cast.ctor): Check void cast.
2224 (Binary.ResolveAsTypeTerminal): Is never type.
2225 (Conditional.ResolveAsTypeTerminal): Is never type.
2227 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
2229 2006-03-01 Raja R Harinath <rharinath@novell.com>
2232 * expression.cs (ParameterReference.DoResolveBase): Change return
2234 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2238 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2241 * typemanager.cs (GetFullNameSignature): Don't nullref on
2242 protected accessors.
2244 2006-02-27 Marek Safar <marek.safar@seznam.cz>
2246 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
2247 these two separated members to simplify the code.
2248 (Attribute.Resolve): Refactored to use new fields and methods.
2249 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
2250 implemented obsolete attribute checking.
2251 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2252 implemented obsolete checking again. It look line never ending quest ;-)
2253 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2255 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2257 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2259 *class.cs (Property.Define): Add RegisterProperty call.
2261 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2262 argument groups (only 2).
2264 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2265 encoding expression to arguments.
2266 (Expression.ExprClassToResolveFlags): Just turned to property.
2268 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2269 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2270 optimized as well as implemented support for zero-length attributes.
2272 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2273 Add caching of PropertyInfo's.
2275 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2277 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2278 error multiple times.
2280 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2282 New partial class implementation.
2283 A fix for #77027, #77029, #77403
2285 * attribute.cs (Attributable): Made attributes protected.
2287 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2288 the replacements of ClassPart and PartialContainer.
2289 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2290 (TypeContainer.AddInterface): Ditto.
2291 (TypeContainer.AddPartial): The main method for partial classes. It checks
2292 for errors and merges ModFlags and attributes. At the end class is added to
2294 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2296 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2297 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2298 from the rest of partial classes.
2299 (TypeContainer.GetClassBases): Simplified.
2300 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2302 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2303 (TypeContainer.HasExplicitLayout): Uses Flags now.
2304 (PartialContainer): Removed.
2305 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2306 (StaticClass): Was merged with Class.
2307 (Class.GetClassBases): class and static class bases are verified here.
2308 (Class.TypeAttr): Added static attributes when class is static.
2309 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2310 (MemberBase): In some cases we need to call parent container for partial
2311 class. It should be eliminated but it's not easy now.
2313 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2315 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2316 partial classed to accumulate class comments.
2317 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2319 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2321 * driver.cs (MainDriver): Tree.GetDecl was removed.
2323 * modifiers.cs (Modifiers): Add partial modifier.
2325 * tree.cs (Tree.decl): Removed.
2326 (RootTypes): Started to use this class more often for root types
2329 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2333 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2334 external interface does not have an attribute.
2336 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2338 Another prerequisites for new partial classs implementation.
2340 * attribute.cs (Attribute.Equal): Implemented.
2341 (Attribute.Emit): Changed as attributes can be applied more than twice.
2342 (Attributes.Emit): Check for duplicate attributes here.
2344 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2345 as a parameter, clean-up.
2347 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2351 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2352 contains obsolete attribute check which can in some cases look for base
2353 type of current class which is not initialized yet.
2354 (TypeContainer.BaseType): Replacement of ptype.
2356 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2358 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2360 First of prerequisites for new partial classs implemention.
2362 * attribute.cs (Attributable): Extended by ResolveContext;
2363 Attributes finally have correct context for resolving in all cases.
2364 (AttachTo): Attribute owner is assigned here.
2366 * codegen.cs (IResolveContext): Introduce new interface to hold
2367 all information needed in resolving phase.
2368 (EmitContext): Implements IResolveContext; more clean-up needed here.
2370 * decl.cs (MemberCore): Implemented IResolveContext.
2372 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2373 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2374 parameter.cs, statement.cs, tree.cs, typemanager.cs:
2375 Refactored to use new IResolveContext instead of EmitContext; cleanup
2377 2006-02-06 Miguel de Icaza <miguel@novell.com>
2379 * codegen.cs (EmitScopeInitFromBlock): check here the
2380 capture_context, there is no need to make two calls to the
2383 * anonymous.cs: Add some debugging messages that might help me
2384 track other instances of this problem in the future (the
2385 regression of test 467).
2387 * cs-parser.jay: track the variable block, as we need to initalize
2388 any captured variables declared in this block for the "catch"
2389 portion of the "Try" statement.
2391 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2392 scope initialization for captured variables.
2394 Also, move the emit for the variables after the block location has
2397 2006-02-06 Marek Safar <marek.safar@seznam.cz>
2399 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2401 2006-02-02 Miguel de Icaza <miguel@novell.com>
2403 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2404 commit yesterday, the initialization for the roots is necessary.
2405 What is not necessary is the scope activation.
2407 2006-02-02 Raja R Harinath <rharinath@novell.com>
2409 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2410 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2412 (Argument.Resolve): Remove CS0206 checks.
2414 2006-02-01 Miguel de Icaza <miguel@novell.com>
2416 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2417 scopes for all the roots, the scopes will now be emitted when the
2418 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2420 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2421 code. This reduces a lot of existing cruft.
2423 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2424 that the ScopeInfo is generated as we enter the scope, not at the
2425 time of use, which is what we used to do before.
2427 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2428 every time a Block is about to be emitted if we have a
2431 2006-02-01 Raja R Harinath <rharinath@novell.com>
2433 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2435 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2437 * typemanager.cs (cons_param_array_attribute): Make private.
2438 (Reset): Set it to null.
2439 (InitCoreHelpers): Don't initialize it.
2440 (ConsParamArrayAttribute): New. Initialize it as needed.
2441 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2443 2006-01-31 Miguel de Icaza <miguel@novell.com>
2445 * expression.cs: There might be errors reported during the
2446 selection of applicable methods. If there are errors, do not
2447 continue execution as it will lead the compiler to crash.
2449 2006-01-30 Miguel de Icaza <miguel@novell.com>
2451 * expression.cs: Member access is not allowed on anonymous
2452 methods. Fixes #77402.
2454 2006-01-30 Raja R Harinath <rharinath@novell.com>
2457 * cs-parser.jay (VariableDeclaration): Don't set
2458 current_array_type to null.
2459 (field_declaration, event_declaration, declaration_statement):
2460 Set it to null here.
2462 2006-01-28 Raja R Harinath <harinath@gmail.com>
2464 * typemanager.cs (GenericParameterPosition): New.
2467 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
2469 * doc.cs : To process "include" elements, first we should create
2470 another list than XmlNodeList, because it could result in node
2471 removal, which could result in that the XmlNodeList gives up
2474 (Also made code identical to gmcs again.)
2476 2006-01-25 Miguel de Icaza <miguel@novell.com>
2478 * ecore.cs: Introduce an error report that we were not catching
2479 before, if not silent, we must report the error. Gonzalo ran into
2482 2006-01-23 Miguel de Icaza <miguel@novell.com>
2484 A fix for bug: #76957
2486 * iterators.cs (MoveNextMethod.CreateMethodHost): call
2487 ComputeMethodHost before creating the method, this is a new
2490 * anonymous.cs (AnonymousContainer): Now we track all the scopes
2491 that this method references (RegisterScope). The actual scope
2492 where the method is hosted is computed with the ComputeMethodHost
2493 before we create the method.
2495 Moved the Deepest routine here.
2497 (AnonymousContainer.ComputeMethodHost): New routine used to
2498 compute the proper ScopeInfo that will host the anonymous method.
2500 (ScopeInfo): Deal with multiple roots. The problem was that we
2501 did not have a unique root where all ScopeInfos could be hanged
2502 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
2505 Remove AdjustMethodScope which is now computed at the end. Remove
2506 LinkScope which did a partial link, instead link all ScopeInfos
2507 before code generation from the new "LinkScopes" routine.
2509 Simplify all the Add* routines as they no longer need to maintain
2510 the tree, they just need to record that they are using variables
2513 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2514 routines to produce the forest of ScopeInfo trees.
2516 * class.cs (TypeContainer.AppendMethod): This is just like
2517 AddMethod, but ensures that an interface implementation method
2518 (IEnumerable.XXX) is not inserted at the beginning of the queue of
2519 methods, but at the end.
2521 We use this functionality to ensure that the generated MoveNext
2522 method in the iterator class is resolved/emitted before the
2523 enumerator methods created.
2525 This is required because the MoveNext method computes the right
2526 ScopeInfo for the method. And the other methods will eventually
2527 need to resolve and fetch information computed from the anonymous
2530 2006-01-21 Raja R Harinath <harinath@gmail.com>
2531 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2534 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2536 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2537 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2539 2006-01-18 Raja R Harinath <rharinath@novell.com>
2541 Fix #76656, cs0231-2.cs.
2542 * cs-parser.jay (formal_parameter_list): Make error case catch
2544 (parenthesized_expression_0): Add CS1026 check.
2545 (invocation_expression): Remove unused { $$ = lexer.Location }.
2547 2006-01-17 Raja R Harinath <rharinath@novell.com>
2550 * cs-parser.jay (statement_expression): Don't list out the
2551 individual statement-expressions. Convert syntax error into
2554 2006-01-16 Raja R Harinath <rharinath@novell.com>
2557 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2558 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
2559 CheckIntermediateModification.
2560 (FieldExpr.DoResolve): Add new two-argument version that
2561 allows us to resolve the InstanceExpression as an lvalue.
2562 The one-argument variant is now just a wrapper.
2563 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2564 Resolve the lhs as an lvalue if the it has a value type.
2565 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2566 from Assign.DoResolve.
2567 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2568 resolved as an lvalue.
2569 (PropertyExpr.DoResolve): Update.
2570 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2571 has a value type. Move CS1612 check here from
2572 CheckIntermediateModification.
2573 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2574 * expression.cs (EmptyExpression.OutAccess): New. Used as the
2575 'right_side' of a ResolveLValue on an 'out' argument.
2576 (EmptyExpression.LValueMemberAccess): New. Used as the
2577 'right_side' of a propagated ResolveLValue on a value type.
2578 (LocalVariableReference.DoResolveBase): Recognize
2579 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2581 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2582 EmptyExpression.Null.
2584 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
2586 * typemanager.cs : added IsGenericParameter(). In mcs it always
2588 * doc.cs : for generic parameters, use GenericParameterPosition,
2591 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
2593 * expression.cs: Fix Console.WriteLine ((this = x).foo);
2595 2006-01-12 Miguel de Icaza <miguel@novell.com>
2597 This fixes the problem where we used ldfld instead of ldflda to
2598 load the "THIS" pointer on captured parameters, when THIS is a
2599 value type. See bug #77205.
2601 * iterators.cs (CapturedThisReference.Emit): Pass false to
2602 EmitThis (we do not need the address).
2604 * codegen.cs (EmitThis): it needs to know whether we need the
2605 address of `this' or not. This is used by value types.
2607 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2608 every other call passes false.
2610 2006-01-12 Raja R Harinath <rharinath@novell.com>
2613 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2615 * expression.cs (Invocation.OverloadResolve): Update.
2616 (Invocation.DoResolve): Avoid double resolution of invocation.
2618 2006-01-11 Raja R Harinath <rharinath@novell.com>
2621 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2622 unary negation of floating point types as 0-expr; negation cannot
2623 overflow in floating point types.
2626 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2627 on operands of 'void' type.
2630 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2631 and ExclusiveOr for boolean constants too.
2633 2006-01-09 Raja R Harinath <rharinath@novell.com>
2636 * expression.cs (Invocation.OverloadResolve): Replace reflected
2637 override methods with their base virtual methods, rather than
2639 * typemanager.cs (TypeManager.GetOverride): New.
2641 2006-01-05 Jb Evain <jbevain@gmail.com>
2643 * class.cs (Property.Define, Indexer.Define): do not tag the
2644 properties as SpecialName | RTSpecialName.
2646 2006-01-04 Miguel de Icaza <miguel@novell.com>
2648 * class.cs (MethodCore.IsDuplicateImplementation): This method was
2649 doing a low-level comparission of parameter types. It was lacking
2650 a check for __argslist.
2652 2005-12-30 Miguel de Icaza <miguel@novell.com>
2654 * expression.cs (ParameterReference.DoResolveBase): Allow
2655 reference parameters if they are local to this block.
2657 This allows the ref and out parameters of a delegate to be used in
2658 an anonymous method, for example:
2660 delegate void set (out int x);
2662 set s = delegate (out int x){
2666 This is used by functionality introduced late in the C# language.
2668 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2669 method that take ref and out parameters.
2671 Fixes #77119 which was a late change in the spec.
2673 2005-12-23 Miguel de Icaza <miguel@novell.com>
2675 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2676 parent if its the same scope. Fixes #77060.
2678 2005-12-21 Miguel de Icaza <miguel@novell.com>
2680 * driver.cs: Report the case of no source files and no -out:
2683 2005-12-20 Raja R Harinath <rharinath@novell.com>
2686 * expression.cs (ComposedCast.GetSignatureForError): Define.
2688 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2692 * namespace.cs (NamespaceEntry): Add extern_aliases as a
2693 ListDictionary, to contain the ExternAliasEntry entries (in
2694 addition to the NamespaceEntry.aliases hashtable). This field is
2695 shared between the original entry and its doppelganger (bodyless
2697 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2698 extern_aliases field.
2699 (NamespaceEntry.Lookup): Move the IsImplicit check after the
2700 lookup in extern_aliases.
2702 2005-12-16 Raja R Harinath <rharinath@novell.com>
2705 * class.cs (TypeContainer.Mark_HasEquals): New.
2706 (TypeContainer.Mark_HasGetHashCode): New.
2707 (ClassPart): Override them.
2708 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2711 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2712 'parent' argument to the base constructor.
2714 Remove all mention of TypeContainer from decl.cs.
2715 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2716 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2717 (DeclSpace.DeclSpace): Likewise.
2718 (DeclSpace.DefineMembers): Remove unused argument.
2719 * cs-parser.jay (pop_current_class): Update to changes. Simplify
2720 debugging check -- we don't care if the debug code throws an
2721 InvalidCastException instead of an InternalErrorException.
2722 * class.cs (TypeContainer.DefineMembers): Update to changes.
2723 (TypeContainer.DoDefineMembers): Likewise.
2724 (TypeContainer.GetMethods): Likewise.
2725 (PropertyMember.Define): Likewise.
2726 (MemberBase.Parent): New property that forwards to
2727 MemberCore.Parent, but ensures that we get a TypeContainer.
2728 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2729 (RootContext.PopulateTypes): Likewise. Remove special case code
2730 for !RootContext.StdLib: DefineMembers is idempotent.
2732 2005-12-14 Miguel de Icaza <miguel@novell.com>
2734 * convert.cs (ExplicitConversionCore): Check the return value from
2735 ExplicitConversionCore which can return null on failure. Fixes #76914
2737 2005-12-13 Marek Safar <marek.safar@seznam.cz>
2739 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2741 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
2743 * doc.cs : The search for referenced namespace was insufficient to
2744 get global one as it used to do. Fixed bug #76965.
2746 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
2748 * doc.cs : check name in cref in the last phase that whether it is
2751 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2753 * cs-tokenizer.cs : reverted the latest change: it somehow broke
2756 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2758 * doc.cs : so it turned out that we cannot skip override check for
2759 interface members. Fixed bug #76954.
2761 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2763 * cs-tokenizer.cs : fixed bug #75984:
2764 - #warning and #error should not be handled when the source line
2766 - #line is not checked strictly when the source line is disabled.
2767 - #define and #undef is on the other hand checked strictly at any
2770 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
2772 * cs-tokenizer.cs : missing Location (actually, filename) in one of
2775 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2777 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2779 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2781 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2782 (FieldBase.Initializer): Initializer is now optional.
2783 (EventField.Define): Only event field can have initializer.
2785 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2787 * const.cs (Const): Reuse initializer.
2789 * cs-parser.jay: Updated after FieldBase changes.
2790 Added current_array_type to simplify array initializers.
2792 * ecore.cs (NullCast.IsDefaultValue): Implemented.
2794 * expression.cs, iterators.cs: Updated.
2796 * namespace.cs (NamespaceEntry): Made UsingFound private.
2798 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2800 * parameterCollection.cs: Obsolete, removed.
2801 * parser.cs: Obsolete, removed.
2803 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2806 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2808 * enum.cs (Enum.Define): Set obsolete context here.
2810 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2813 - FindDocumentedMember() now expects 1) paramList as null
2814 when "we don't have to check the number of parameters" and
2815 2) Type.EmptyTypes when "there is no arguments".
2816 - Introduced FoundMember struct to hold the exact type which was
2817 used to find the documented member (the above change broke
2818 test-xml-044; it might be better just to use DeclaringType than
2819 what MS does, like this change does, but it depends on usage.)
2821 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2823 * doc.cs : documented member might be from DeclaringType for nested
2824 types. Fixed bug #76782.
2826 2005-12-03 Ben Maurer <bmaurer@ximian.com>
2828 * anonymous.cs: Have the param code handle leaving copies on the
2829 stack etc. Allows anonymous params to take part in the assignment
2830 code (++, +=, etc). Fixes bug #76550
2832 * expression.cs: Handle the prepare_for_load/leave_copy by passing
2833 it down to the anon code.
2835 * iterators.cs: Use dummy var here
2837 * codegen.cs: Handle new vars
2839 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2842 * class.cs (MethodData.Define): Set proper Obsolete context.
2844 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2846 (FieldExpr.DoResolve): Ditto.
2848 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2851 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2852 parent is not obsolete.
2854 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
2856 * doc.cs : (FindDocumentedMember) find parameterless members first
2857 and get CS0419 in the early stage. Fixed first case of bug #76727.
2859 2005-11-30 Marek Safar <marek.safar@seznam.cz>
2862 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2863 no error was reported.
2865 *expression.cs (Binary.DoResolve): left can be null.
2867 2005-11-22 Marek Safar <marek.safar@seznam.cz>
2870 * class.cs (MethodData.Emit): Parameters should be labeled first.
2872 2005-11-21 Marek Safar <marek.safar@seznam.cz>
2875 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2877 2005-11-18 Marek Safar <marek.safar@seznam.cz>
2879 * attribute.cs (AreParametersCompliant): Moved to Parameter.
2881 * class.cs (MethodCore): Parameter clean up.
2882 (IMethodData): Added ParameterInfo.
2883 (MethodData): Parameter clean up.
2884 (Indexer.Define): Parameter clean up.
2896 * typemanager.cs: Parameter clean up.
2898 * delegate.cs (Define): Get rid of duplicated code.
2900 * expression.cs (ParameterReference): Removed useless parameters
2902 (Invocation): Ditto.
2904 * parameter.cs (ParamsParameter): New class, params specialization.
2905 (ArglistParameter): Attemp to separate arglist.
2906 (Parameter): Refactored to be reusable and faster.
2907 (Parameter.Modifier): Made understandable.
2908 (Parameters): Changed to be used as a class for `this' assembly
2909 parameters. Refactored to use new specialized classes.
2911 * support.cs (ParameterData): Added Types property.
2912 (InternalParameters): Deleted.
2914 2005-08-20 Martin Baulig <martin@ximian.com>
2916 Merging this patch from GMCS to fix #75867.
2918 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2919 scope if we don't already have it.
2921 2005-11-17 Martin Baulig <martin@ximian.com>
2924 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2925 inherit the scope from our parent. Fixes #76653.
2927 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2929 * doc.cs : the previous patch does not actually fix the bug.
2930 PropertyInfo override check is now implemented and really fixed it.
2931 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2933 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2935 * doc.cs : apply "override filter" also to properties.
2938 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2940 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2941 no need to check overrides. For classes, omit those results from
2942 interfaces since they must exist in the class. Fixed bug #76726.
2944 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2946 * typemanager.cs : (GetFullNameSignature) differentiate indexers
2947 with different parameters. Fixed the second problem in #76685.
2949 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2951 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2952 get expected 'protected' access in CheckValidFamilyAccess()).
2955 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2957 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2958 Fixed bug #76705. CS1569 was incorrectly commented out.
2960 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2962 * doc.cs : use Invocation.IsOverride() to do real override check.
2963 * expression.cs : made Invocation.IsOverride() internal.
2965 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2967 * doc.cs : use TypeManager.FindMembers() instead of (possible)
2968 TypeBuilder.FindMembers() and filter overriden base members out.
2971 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2973 * doc.cs : ref/out parameters are represented as '@' (instead of
2974 '&' in type FullName). Fixed bug #76630 (additionally crefs).
2976 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2978 * doc.cs : when there was no '.' in cref to methods in doc comment,
2979 then parameters were missing in the output. Fixed bug #76691.
2981 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2983 * driver.cs : don't output docs when there is an error.
2986 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2989 Now it should detect indexers. Fixed primary concern in bug #76685.
2990 Fixed CS0419 message to not show the identical member signature in
2993 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2995 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2996 instead of Type.FindMembers() since it does not handle events.
2999 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
3001 * codegen.cs: Fixed typo (speficied -> specified).
3003 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3006 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3008 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3010 * attribute.cs: Changed error message.
3012 * cs-tokenizer.cs: One more check.
3014 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3016 * statement.cs (Block.Resolve): Ignore empty statement.
3018 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3020 * report.cs: Made error/warning methods more strict to avoid
3023 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3024 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3025 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3026 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3028 2005-11-08 Marek Safar <marek.safar@seznam.cz>
3030 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3031 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3033 * class.cs (TypeContainer.IsComImport): New property.
3034 (Constructor.Define): Create proper ctor for ComImport types.
3036 * expression.cs (New.CheckComImport): Fixed.
3038 2005-11-07 Miguel de Icaza <miguel@novell.com>
3040 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3041 that a parameter has been captured does not mean that we do not
3042 have to do the rest of the processing. This fixes the second part
3043 of #76592. If there was another anonymous method capturing
3044 values in the past, the Scope would never be set for the second
3045 method that captured the same parameter.
3047 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3048 properly manipulate the stack. Second part of fix for #76592.
3050 * expression.cs (New): Add support for invoking "new" on
3051 interfaces that have been flagged with the ComImport attribute and
3052 the CoClass. Fixes #76637
3054 * statement.cs (Try.DoEmit): When a variable is captured, do not
3055 try to emit the vi.LocalBuilder variable as it has been captured.
3056 Create a temporary variable and store the results on the
3057 FieldBuilder. Fixes #76642
3059 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3061 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3063 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3065 * expression.cs (Binary.DoResolve): Added && optimalization.
3067 * typemanager.cs (AddUserType): Removed useless argument.
3069 2005-11-04 Marek Safar <marek.safar@seznam.cz>
3071 * statement.cs (Block.variables): Uses ListDictionary.
3073 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3076 * class.cs (PartialContainer.EmitType): Customized to emit
3077 security attributes.
3078 (ClassPart.ApplyAttributeBuilder): Transform security attribute
3079 for partial classes.
3081 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3084 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3085 access has to be fixed.
3087 * typemanager.cs (IsUnmanagedType): Wrong common field type.
3089 2005-11-01 Marek Safar <marek.safar@seznam.cz>
3092 * ecore.cs (NullCast.Reduce): Implemented.
3094 * expression.cs (ArrayCreation.CheckIndices): Correcly check
3097 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3099 (Foreach.Resolve): Catch null properly.
3101 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3103 * cs-tokenizer.cs: Warning text fix.
3105 * driver.cs: AllWarningNumbers exposed on public interface.
3107 * report.cs (): Reviewed warning numbers.
3108 (IsValidWarning): Use binary search.
3110 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3112 * driver.cs: Implemeted resource visibility.
3113 (Resources): New class for code sharing between /res: and
3116 2005-10-28 Marek Safar <marek.safar@seznam.cz>
3119 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3122 * convert (Convert.ImplicitReferenceConversion): NullCast holds
3125 * ecore.cs (NullCast): Child is contant only.
3127 * literal.cs (NullLiteral.Reduce): null can be converted to any
3130 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
3132 * driver.cs: Use Encoding.Default as default code page instead
3135 2005-10-27 Raja R Harinath <rharinath@novell.com>
3138 * expression.cs (Invocation.Error_InvalidArguments): Handle
3139 __arglist parameters.
3140 (Invocation.VerifyArgumentsCompat): Likewise.
3141 * support.cs (ReflectionParameters.GetSignatureForError): Print
3142 __arglist parameters.
3143 (InternalParamters.GetSignatureForError): Likewise.
3144 * parameter.cs (Parameters.GetSignatureForError): Likewise.
3146 2005-10-26 Marek Safar <marek.safar@seznam.cz>
3148 * attribute.cs (GetPropertyValue): Made public.
3150 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3152 Add new property WrapNonExceptionThrows to handle 2.0 assembly
3154 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3157 * driver.cs: Reflect method name change.
3159 * statement.cs (Try.Resolve): Warn when try has both general
3162 * typemanager.cs: runtime_compatibility_attr_type new predefined
3165 2005-10-26 Raja R Harinath <harinath@gmail.com>
3168 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3169 treat it as an empty parameter list.
3171 2005-10-26 Raja R Harinath <rharinath@novell.com>
3174 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
3175 ResolveAsTypeStep silent.
3176 * statement.cs (Block.AddConstant): Mark block as used.
3177 (Block.ResolveMeta): Avoid piling on error messages
3178 if a constant initializer resolution fails.
3180 2005-10-25 Raja R Harinath <rharinath@novell.com>
3182 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3184 (NamespaceEntry.VerifyAllUsing): New.
3185 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
3186 behaviour. Delegates actual resolution of alias to ...
3187 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
3188 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3190 * driver.cs (Driver.MainDriver): Update.
3192 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3193 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3195 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3197 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3198 RootNamespace.DefineNamespacesForAll.
3200 2005-10-24 Raja R Harinath <harinath@gmail.com>
3202 * typemanager.cs (assemblies, external_aliases, modules)
3203 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3204 (ComputeNamespaces, GetRootNamespace): Remove extra staging
3205 overhead. Move resposibility ...
3206 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
3207 * driver.cs, attribute.cs, codegen.cs: Update to changes.
3209 2005-10-23 Raja R Harinath <harinath@gmail.com>
3211 * namespace.cs (RootNamespace.all_namespaces): Renamed from
3212 cached_namespaces. Improve usage.
3213 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3214 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3215 Move from GlobalRootNamespace and simplify.
3216 (RootNamespace.Global): Make instance variable.
3217 (RootNamespace.RootNamespace): Add "alias name" parameter.
3218 (GlobalRootNamespace): Simplify drastically.
3219 (Namespace.Lookup): Don't use GetNamespace.
3220 * typemanager.cs (GetRootNamespace): Rename from
3221 ComputeNamespaceForAlias.
3222 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3224 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3226 * anonymous.cs (AnonymousContainer): Don't crash when container
3229 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3231 * expression.cs (Binary.DoResolve): Warn when comparing same
3234 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3237 * expression.cs (Binary.DoResolve): It looks like there are no
3238 convetsion rules in enum context.
3240 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3242 Add support for extern alias qualifiers.
3243 * typemanager.cs: Move some LookupTypeReflection code
3244 to namespace.cs, to have cleaner code. Added some methods
3245 to help us keep track of the extern aliased references.
3246 * driver.cs: Add suport for extern alias assemblies on command
3247 line and check for their warnings/errors. Also keep track of the
3248 extern aliased assemblies.
3249 * namespace.cs: Move the global functionality of Namespace
3250 to GlobalRootNamespace/RootNamespace. Now the global namespace
3251 is GlobalRootNamespace.Globa. Also the code moved from
3252 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
3253 Finally added LocalAliasEntry (AliasEntry before) and
3254 ExternAliasEntry, to handle alias statements.
3255 * cs-parser.jay: Add support in the grammar for extern alias
3257 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
3258 Update callings to Namespace (now in GlobalRootNamespace).
3260 2005-10-18 Raja R Harinath <rharinath@novell.com>
3263 * class.cs (TypeContainer.DefineType): Move updating of
3264 topological sort earlier in the code.
3265 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3267 2005-10-18 Marek Safar <marek.safar@seznam.cz>
3270 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3272 * constant.cs (Constant.TryReduce): Moved from Cast class.
3273 (Reduce): Made little bit more OO and fixed missing conversions.
3275 * ecore.cs (Reduce): Implemented.
3276 (Binary.EnumLiftUp): New method to upgrade values to enum values.
3278 * literal.cs (Reduce): Implemented.
3280 * class.cs: Reverted Miguel's wrong commit.
3282 2005-10-14 Miguel de Icaza <miguel@novell.com>
3284 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3286 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
3288 * cs-parser.jay, expression.cs : CS0214 was missing error location
3289 for constants. Fixed bug #76404.
3291 2005-10-11 Marek Safar <marek.safar@seznam.cz>
3294 * convert.cs (ExplicitConversionCore): Fixed object->enum
3297 2005-10-10 Raja R Harinath <rharinath@novell.com>
3299 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3301 (PropertyExpr.EmitCall): Likewise.
3302 * expression.cs (Invocation.EmitArguments): Handle case where
3304 (Invocation.EmitCall): Avoid allocating temporary variable if
3305 there are no arguments.
3307 2005-10-07 Raja R Harinath <rharinath@novell.com>
3310 * convert.cs (ImplicitConversionStandard): Move conversion of
3311 void* to arbitrary pointer types ...
3312 (ExplicitConversionStandard): .. here.
3313 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3314 error to always print typenames.
3316 2005-10-07 Raja R Harinath <rharinath@novell.com>
3318 * convert.cs (GetConversionOperator): Rename from
3319 GetConversionOperators. Move operator selection code from ...
3320 (UserDefinedConversion): ... here.
3322 2005-10-06 Marek Safar <marek.safar@seznam.cz>
3324 * convert.cs (ExplicitConversionCore): Removed duplicate enum
3327 2005-10-05 Marek Safar <marek.safar@seznam.cz>
3329 * assign.cs (Assign.DoResolve): Error method changed.
3331 * cfold.cs (DoConstantNumericPromotions): Error method changed.
3333 * const.cs (ResolveValue): Reset in_transit immediately.
3335 * constant.cs: Error method changed.
3337 * convert.cs: Removed useless location parameter.
3338 (ExplicitNumericConversion): Don't do double enum check.
3339 (ExplicitConversionCore): Renamed from ExplicitConversion.
3340 (ExplicitUnsafe): Extracted from ExplicitConversion.
3341 (ExplicitConversion): Uses for error reporting.
3343 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3345 (ResolveBoolean): Uses common error method.
3346 (CastToDecimal): Get rid of ec.
3347 (CastFromDecimal): Optimized.
3348 (ConvCast): Get rid of ec.
3350 * enum.cs (ResolveValue): Reset in_transit immediately.
3351 (Emit): Return after first error.
3353 * expression.cs: Convert changes.
3355 * literal.cs: Error method changed.
3357 * statement.cs: Error method changed.
3359 2005-10-03 Raja R Harinath <rharinath@novell.com>
3361 * support.cs (SeekableStreamReader.Position): Don't error out when
3362 the requested position is just beyond the end of the current
3365 2005-09-28 Raja R Harinath <rharinath@novell.com>
3367 * support.cs (SeekableStreamReader): Simplify drastically. Don't
3368 try to keep in sync with the byte count of the underlying Stream.
3369 However, this limits us to a window size of 2048 characters: i.e.,
3370 the maximum lookahead of our lexer/parser can be 2048 characters.
3372 2005-09-28 Marek Safar <marek.safar@seznam.cz>
3375 * driver.cs: Fix compilation files with full root path.
3377 2005-09-25 Miguel de Icaza <miguel@novell.com>
3379 * report.cs (SymbolRelatedToPreviousError): Format the output so
3380 it does not use an open parenthesis that is never closed.
3382 * driver.cs: Follow coding guidelines
3384 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3387 * const.cs (Const.ResolveValue): Check for assigning non-null
3388 value to reference type.
3390 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3392 * anonymous.cs: Implemented ExprClassName.
3394 * assign.cs (Assign.DoResolve): Don't chrash when type is not
3397 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3400 * class.cs (StaticClass.DefineContainerMembers): Report protected
3403 * codegen.cs: if(ed) PRODUCTION.
3405 * convert.cs (Error_CannotImplicitConversion): Better error
3408 * cs-parser.jay: More error checks.
3410 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3412 * driver.cs (CSCParseOption): Enabled wrong option check.
3414 * ecore.cs (Expression.ExprClassName): Turned to property.
3415 (MemberExpr.CheckIntermediateModification): For checking boxed
3416 value types modification.
3418 * statement.cs (Fixed.Resolve): Expression type must be
3419 convertible to fixed type.
3420 (CollectionForeach.GetEnumeratorFilter,TryType):
3421 Small refactoring for easier error checking.
3423 2005-09-26 Marek Safar <marek.safar@seznam.cz>
3425 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3428 * class.cs (GeneratedBaseInitializer): New class for customization
3429 compiler generated initializers.
3430 (MemberBase.DoDefine): Check Obsolete attribute here.
3431 (FieldMember.DoDefine): Ditto.
3433 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3436 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3437 (MemberCore.GetObsoleteAttribute): Removed argument.
3438 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3439 (MemberCore.CheckObsoleteType): New helper.
3443 * statement.cs: Updates after MemberCore changes.
3445 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3446 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3448 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3449 obsolete attribute for compiler construct.
3450 (As.DoResolve): Cache result.
3452 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3454 2005-09-26 Raja R Harinath <rharinath@novell.com>
3457 * expression.cs (This.VerifyFixed): In a value type T, the type of
3458 'this' is T&, iow, 'this' is either an out or ref parameter. In a
3459 value type R, 'this' is treated as a value parameter.
3461 2005-09-22 Miguel de Icaza <miguel@novell.com>
3463 * statement.cs (Lock): Use the TemporaryVariable class instead of
3464 manually using local variables as those do not work when variables
3467 * ecore.cs: Moved the TemporaryVariable class from being a nested
3468 class inside Foreach to be a public class that can be employed in
3471 2005-09-19 Marek Safar <marek.safar@seznam.cz>
3473 * cs-parser.jay: interface_accessors replaced by
3474 accessor_declarations.
3476 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3479 * statement.cs (GotoCase.Resolve): Convert null constant to
3481 (SwitchLabel.ResolveAndReduce): Ditto.
3482 (SwitchLabel.NullStringCase): Custom null stamp.
3483 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3485 typemanager.cs (CSharpSignature): Don't skip first argument
3488 2005-09-18 Miguel de Icaza <miguel@novell.com>
3490 * driver.cs: Set InEmacs based on the environment variable EMACS.
3492 * location.cs (InEmacs): in this mode, do not report column
3493 location as it confuses Emacs.
3495 2005-09-16 Marek Safar <marek.safar@seznam.cz>
3497 * cfold.cs, constant.cs, convert.cs, ecore.cs,
3498 expression.cs, iterators.cs, literal.cs: Store constants and
3501 * class.cs (MemberBase.ShortName): Pass location.
3503 * cs-parser.jay: Some location fixes.
3505 * ecore.cs (Expression.Location): Made virtual.
3507 2005-09-05 Miguel de Icaza <miguel@novell.com>
3509 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3510 if the underlying types are the same, otherwise we need to produce
3511 code that will do the proper cast.
3513 This was exposed by Marek's constant rewrite which produced
3514 invalid code for the call site:
3517 void Method (X v) {}
3521 This fixes test-49.cs
3523 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3525 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3526 Type/Object should be allowed as well. Fixed bug #75968.
3528 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3530 * expression.cs : (Binary.DoResolve): when one is enum constant and
3531 another is constant 0, then return enum one *as enum type*.
3534 2005-09-02 Raja R Harinath <rharinath@novell.com>
3536 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3540 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3541 flow-branching for LocalVariableReferences in case we were invoked
3542 from a MemberAccess.
3543 * expression.cs (LocalVariableReference.VerifyAssigned): New.
3545 (LocalVariableReference.DoResolveBase): ... this.
3546 (MemberAccess.Resolve): Do the check that was disabled during
3549 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3552 (PartialContainer.Create): check abstract/sealed/static strictly
3553 but abstract/sealed can exist only at one side. Fixed bug #75883.
3555 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
3558 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3559 specified, don't default to UnmanagedType.I4.
3561 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3563 * expression.cs : conditional operator should check possibly
3564 incorrect assign expression. Fixed bug #75946.
3566 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
3568 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
3569 Reverting the change. gmcs is much complex than mcs on this matter.
3571 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
3573 * cs-tokenizer.cs : To read another token ahead of the actual
3574 consumption, use new SavedToken and cache token instead of moving
3575 back the stream with SeekableStreamReader (it seemed problematic).
3577 driver.cs : Thus use StreamReader directly.
3578 * support.cs : Thus removed SeekableStreamReader.
3580 2005-08-30 Raja R Harinath <rharinath@novell.com>
3583 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3584 (ScopeInfo.EmitScopeType): Use it to construct field names from
3585 names of captured locals.
3588 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3589 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3590 Pass 'target_type' to BoxedCast. Don't default to 'object'.
3591 (ExplicitConversion): Remove enum cases already handled by
3592 implicit conversion. Move implicit conversion check to the beginning.
3593 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3594 * expression.cs (ArrayCreation.EmitDynamicInitializers):
3595 Don't treat System.Enum as a struct.
3597 2005-08-30 Jb Evain <jbevain@gmail.com>
3599 * attribute.cs: handles as expression in parameters.
3601 2005-08-30 Raja R Harinath <rharinath@novell.com>
3604 * class.cs (TypeContainer.VerifyClsName): Don't use a
3605 PartialContainer when verifying CLS compliance.
3606 (AbstractPropertyEventMethod): Set Parent here, ...
3607 (PropertyMethod): ... not here.
3609 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
3611 * attribute.cs : escaped attribute name should not be allowed to be
3612 resolved (e.g. @class as classAttribute). Fixed bug #75930.
3614 2005-08-29 Raja R Harinath <rharinath@novell.com>
3617 * convert.cs (ImplicitStandardConversionExists): Allow zero also
3618 when converting a long constant to unsigned long.
3619 * expression.cs (Invocation.OverloadResolve): Add sanity check to
3620 detect where IsApplicable and VerifyArgumentsCompat disagree.
3622 2005-08-29 Raja R Harinath <rharinath@novell.com>
3623 and Carlos Alberto Cortez <carlos@unixmexico.org>
3626 * class.cs (TypeContainer.CanElideInitializer): New helper.
3627 (TypeContainer.EmitFieldInitializers): Use it to determine if we
3628 can safely emitting the initializer of a field.
3630 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3632 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3633 allowed inside a switch (without loop). Fixed bug #75433.
3635 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3637 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3638 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3640 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3642 * driver.cs : kinda reverting the default encoding changes (not exact
3643 revert since I noticed that "codepage:reset" might not work fine).
3645 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3647 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3648 Location. Now getter and setter store location correctly.
3649 (errors/cs0111-12.cs now reports the expected location.)
3651 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3653 * driver.cs : Use default encoding on the environment.
3654 Removed (now that) extra parameter for SeekableStreamReader.
3655 * support.cs : (SeekableStreamReader) third .ctor() argument for
3656 StreamReader is not required (always true). preamble size could
3657 be acquired in simpler and safe way.
3659 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
3661 * cs-parser.jay: report CS0642 at warning level 3
3662 and report CS0642 for an if else statement also
3663 fixes bug #74745. Patch by John Luke (and a bit
3665 Removed extra CS0642 warning check for "while",
3667 * statement.cs: In Block.Resolve(), CS0642 check
3668 is reimplemented to check a sequence of an empty
3669 statement and a block.
3671 Both fix bug #66777.
3673 2005-08-24 Marek Safar <marek.safar@seznam.cz>
3675 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3676 detection until I fix it.
3678 * cs-tokenizer.cs: Changed error message.
3680 * cs-parser.jay: Fixed 2 error locations.
3682 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3683 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3686 * enum.cs (GetSignatureForError): Fixed.
3688 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3692 * typemanager.cs (RegisterProperty): Removed.
3694 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3696 2005-08-24 Raja R Harinath <rharinath@novell.com>
3699 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3700 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3702 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3704 * expression.cs : tiny fix is required for not warning positive ulong.
3707 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3709 * expression.cs : add CS0652 check for constant and integral
3710 expression. Fixed bug #53974.
3712 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3714 * expression.cs : in DoNumericPromotions(), check if there is implicit
3715 conversion overload for string (to check CS0034). Fixed bug #52492.
3717 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3719 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3721 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3723 * ecore.cs : report location when it is *not* Null.
3725 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3731 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3732 correctly. Fixed bug #75721.
3734 2005-08-23 Raja R Harinath <rharinath@novell.com>
3736 * support.cs (SeekableStreamReader.Position): Avoid an expensive
3737 loop that performs 'min (pos, char_count)'.
3740 * expression.cs (Unary.ResolveOperator): Don't discard implicit
3741 converted value in Operator.OnesComplement.
3743 2005-08-22 Ben Maurer <bmaurer@ximian.com>
3745 * anonymous.cs: If the anon method is pulled into a helper class,
3746 it needs to be `internal' not `private'. Fixes runtime behavior on
3749 2005-08-20 Martin Baulig <martin@ximian.com>
3751 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3752 scope if we don't already have it.
3754 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3755 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3758 2005-08-17 Marek Safar <marek.safar@seznam.cz>
3761 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3764 2005-08-16 Marek Safar <marek.safar@seznam.cz>
3766 The big constants rewrite
3767 Fix #75746, #75685 and more
3768 As a side effect saved 1MB for MWF ;-)
3770 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3771 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3772 enum based for corlib compilation.
3774 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3777 * class.cs (FixedField.Define): Use ResolveAsConstant.
3779 * const.cs (IConstant): Interface constants and enums.
3780 (Const.ResolveValue): New method for constant resolvning.
3781 (ExternalConstant): Constants from imported assemblies.
3783 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3784 conversion; like enums.
3785 (Constant.ToType): Converts this constant to different type.
3786 (Constant.Increment): Adds 1.
3788 * convert.cs (ImplicitConversionRequired): Simplified.
3790 * cs-parser.jay: Create EnumMember directly.
3792 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3794 * doc.cs (GenerateEnumDocComment): Removed.
3796 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3797 (ConvertIntLiteral): Removed.
3798 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3800 * enum.cs (EnumMember): Implement IConstant.
3801 (Enum.IsValidEnumConstant): Removed.
3802 (Enum.GetNextDefaultValue): Removed.
3803 (Enum.FindMembers): Updated.
3804 (Enum.GenerateDocComment): Iterate enum members.
3806 * expression.cs (Cast.TryReduce): Handle enums correctly.
3807 (New.Constantify): Made public.
3808 (MemberAccess.DoResolve): Removed contant specific if(s).
3810 * literal.cs (NullLiteral): Implement new abstract methods.
3812 * statement.cs (GotoCase.Resolve): Use new constant methods.
3813 (SwitchLabel.ResolveAndReduce): Use new constant methods.
3815 * typemanager.cs (LookupEnum): Removed.
3816 (IsEnumType): Fixed to work with corlib.
3817 (RegisterConstant): Removed.
3818 (LookupConstant): Removed.
3819 (GetConstant): Changed to work with IConstant.
3821 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
3823 * location.cs : Fixed overflown (>255) column number.
3825 2005-08-03 Raja R Harinath <rharinath@novell.com>
3827 First cut of the qualified-alias-member feature.
3828 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3830 * cs-parser.jay (DOUBLE_COLON): New token.
3831 (namespace_or_type_name): Add rule for recognizing
3832 qualified-alias-members.
3833 (primary_expression): Likewise.
3834 (element_access): Allow QualifiedAliasMember as a possible
3835 type-bearing expression.
3836 (local_variable_type, local_variable_pointer_type): Likewise.
3837 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
3838 aliases in the current and enclosing namespace declarations.
3839 (NamespaceEntry.UsingAlias): Add CS0440 warning.
3840 * decl.cs (MemberName.is_double_colon): New.
3841 (MemberName.MemberName): Add new constructor for alias-member.
3842 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3843 * expression.cs (QualifiedAliasMember): New expression type.
3845 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3847 * location.cs : it borked when no argument was specified.
3849 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3851 * location.cs : tiny ToString() format fix.
3853 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3855 * statement.cs : oops, it was missing.
3857 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3859 A set of fixes for precise line/column location.
3862 "token" field now holds a file/line "delta", a line number offset
3863 from the segment, and a column number. See also:
3864 http://lists.ximian.com/pipermail/mono-devel-list/2004-
3865 December/009508.html
3866 Removed static IsNull. Use instance IsNull property instead.
3868 For some tokens it stores Location. For Identifier it stores
3869 LocatedToken which is a pair of string name and location.
3870 Column numbers are adjusted only at getChar().
3872 Use Location.ToString() for reporting (it now contains column).
3874 Largely modified to use LocatedToken instead of
3875 string (IDENTIFIER), and to acquire Location from some tokens.
3876 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3877 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3879 Now MemberName holds Location. DeclSpace.ctor() receives Location
3880 as a parameter. Removed extra parameters to all derived classes.
3881 Replaced Location.IsNull() with instance property.
3882 * assign.cs, expression.cs :
3883 Added .ctor() overload that omits Location.
3885 Added "nameEscaped" flag that indicates the identifier was escaped
3886 in the source file. This fixes bug #57047.
3888 2005-08-02 Marek Safar <marek.safar@seznam.cz>
3890 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3891 New method, looking for lo-case imported cls type.
3893 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3896 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3898 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3900 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3902 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3904 Optimized to save 3.5 MB for SWF compilation.
3906 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3908 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3909 (PartialContainer.Create): Moved logic AddToContainer.
3910 (PartialContainer.MarkForDuplicationCheck): Shares name.
3912 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3915 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3917 (Namespace.GetSignatureForError): New method.
3919 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3920 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3922 2005-08-01 Raja R Harinath <rharinath@novell.com>
3925 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3926 member lookup rather than qualifier_type, since qualifier_type can
3929 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3931 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3934 2005-07-31 Miguel de Icaza <miguel@novell.com>
3936 * statement.cs: Copy the local exception into the exception
3937 captured local. Fixes 75674
3939 2005-07-31 Raja R Harinath <harinath@gmail.com>
3942 * expression.cs (Invocation.OverloadResolve): Don't report error
3943 CS1501 if error CS1502 has been reported.
3944 (New.DoResolve): Delegate CS1501 reporting to
3945 Invocation.OverloadResolve.
3948 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3949 invariant-meaning-in-block property in an enclosing block if
3952 2005-07-29 Marek Safar <marek.safar@seznam.cz>
3954 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3955 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3956 (Switch.CheckSwitch): Just save 50kb for SWF.
3958 2005-07-27 Martin Baulig <martin@ximian.com>
3960 * anonymous.cs (CaptureContext.AddField): Added
3961 `AnonymousContainer am' argument; compute its toplevel scope if
3962 it's not already computed. Fixes #75649.
3964 2005-07-26 Raja R Harinath <rharinath@novell.com>
3967 * class.cs (Constructor.Emit): Reset block to null if the block
3970 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3972 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3974 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3976 * class.cs (MethodData.Define): Check whether accessor implementing
3977 interface is public.
3979 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3981 2005-07-22 Marek Safar <marek.safar@seznam.cz>
3984 * namespace.cs (LookupType): Moved same type check to...
3986 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3989 2005-07-21 Raja R Harinath <rharinath@novell.com>
3991 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3992 already found a typebuilder.
3993 * class.cs (MethodCore.IsDuplicateImplementation): Compare
3994 MemberNames, not strings.
3996 * const.cs (Error_ExpressionMustBeConst):
3997 Rename from Error_EpressionMustBeConst.
3998 * const.cs, class.cs, statement.cd: Update.
4000 2005-07-21 Marek Safar <marek.safar@seznam.cz>
4004 * const.cs (Const.LookupConstantValue): Report missing contant expression
4006 (Error_EpressionMustBeConstant): Only one error method.
4008 * class.cs, statement.c: Updated.
4010 2005-07-20 Raja R Harinath <rharinath@novell.com>
4012 * statement.cs (Block.Flags): Add back HasVarargs.
4013 (Block.flags): Make protected.
4014 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4016 * typemanager.cs (types, typecontainers, user_types): Remove.
4017 (UserTypes, TypeContainers): Likewise.
4018 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4019 (CleanUp, Reset): Update.
4020 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
4021 (GetNestedType): Use Type.GetNestedType.
4022 (CoreLookupType): Take two arguments, the namespace and the
4023 basename of the type. Update to use the Namespace.Lookup
4025 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4026 (RealMemberLookup): Use IsNestedChildOf instead of playing with
4027 string concatenation and substring matches.
4028 * class.cs, enum.cs, delegate.cs: Update to changes.
4030 2005-07-20 Marek Safar <marek.safar@seznam.cz>
4032 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4033 Expression and made virtual.
4035 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4036 (ImplicitStandardConversionExists): Fixed `byte' typo ?
4038 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4040 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4043 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4046 2005-07-18 Marek Safar <marek.safar@seznam.cz>
4049 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4050 AssemblyCultureAttribute is not used on executable.
4053 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4055 2005-07-16 Raja R Harinath <rharinath@novell.com>
4058 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4059 New. Reports CS0252/CS0253.
4060 Mostly taken from preliminary patch by Duncak Mak.
4061 (Binary.DoResolveOperator): Store results of operator lookup.
4062 Use them to detect if we need to warn about unintended reference
4065 2005-07-15 Raja R Harinath <rharinath@novell.com>
4068 * namespace.cs (Namespace.Lookup): Add back location parameter.
4069 (Namespace.LookupType): Add CS0436 report. Add location parameter.
4070 * delegate.cs, ecore.cs, expression.cs: Update to changes.
4072 * codegen.cs (EmitContext.DeclSpace): Make readonly.
4073 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4074 (Namespace.LookupType): ... this.
4075 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4077 * typemanager.cs (LookupTypeReflection): Remove buggy code that
4078 purported to handle pointers.
4079 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4082 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4084 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4087 2005-07-15 Raja R Harinath <rharinath@novell.com>
4089 * namespace.cs (Namespace.Lookup): Drop location parameter.
4090 (NamespaceEntry.LookupAlias): Remove. Merge into ...
4091 (NamespaceEntry.Lookup): ... this.
4092 (NamespaceEntry.Error_AmbiguousTypeReference):
4093 Move here from DeclSpace.
4094 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4096 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4097 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4098 Move to NamespaceEntry.
4099 * delegate.cs, expression.cs: Update to changes.
4101 2005-07-14 Marek Safar <marek.safar@seznam.cz>
4103 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4104 CheckAttributeType and refactored.
4105 (Attribute.ResolvePossibleAttributeType): Changed to reuse
4106 ResolveAsTypeTerminal error handling.
4107 (ResolveAsTypeTerminal): Introduced because of global attributes extra
4109 (GetSignatureForError): Print errors in same way.
4112 * codegen.cs: Reflect attribute GetSignatureForError change.
4115 * expression.cs: Add silent parameter to ResolveAsTypeStep.
4117 * namespace.cs (UsingEntry): Refactored to make fields private.
4120 statement.cs: Error_UnexpectedKind has extra parameter.
4122 2005-07-14 Raja R Harinath <rharinath@novell.com>
4124 * ecore.cs (IAlias): Remove.
4125 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
4126 that implement the interface.
4127 * namespace.cs (Namespace): Likewise.
4128 (Namespace.declspaces): Renamed from 'defined_names'.
4129 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
4130 DeclSpace instead of an IAlias.
4131 * tree.cs (Tree.AddDecl): Update.
4133 2005-07-12 Raja R Harinath <rharinath@novell.com>
4135 * statement.cs (Block.Flags); Remove HasVarargs.
4136 (Block.HasVarargs): Move to ToplevelBlock.
4137 (Block.ThisVariable, Block.AddThisVariable): Likewise.
4138 (Block.Variables): Make protected. Initialize variable hashtable
4140 (Block.AddVariable): Update.
4141 (Block.Resolve): Update to changes.
4142 (ToplevelBlock.HasVarargs): New boolean.
4143 (ToplevelBlock.ThisVariable): Move here from Block.
4144 (ToplevelBlock.AddThisVariable): Likewise.
4145 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
4146 * expression.cs (This.ResolveBase): Update to changes.
4147 (ArglistAccess.DoResolve): Likewise.
4149 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4152 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4154 * class.cs (TypeContainer.VerifyMembers): Distinguish between
4155 not used and not used & assigned.
4156 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4158 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4161 * expression.cs (Is.DoResolve): null is never provided type.
4163 2005-07-08 Marek Safar <marek.safar@seznam.cz>
4166 * cs-parser.jay: Less strict event error rule to catch more errors.
4168 2005-07-08 Martin Baulig <martin@ximian.com>
4170 Fix test-iter-10.cs - distinguish whether we `yield' in a property
4171 gettter (allowed) or setter (not allowed).
4173 * class.cs (Accessor): Implement IIteratorContainer.
4174 (Accessor.Yields): New public field.
4175 (PropertyBase.PropertyMethod.Define): Handle iterators on a
4179 (get_accessor_declaration, set_accessor_declaration): Set the
4180 `yields' flag on the accessor, not the property.
4181 (property_declaration): Do the iterators check on a per-accessor
4182 basis and not for the whole property.
4184 2005-07-08 Martin Baulig <martin@ximian.com>
4186 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4187 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4189 2005-07-07 Marek Safar <marek.safar@seznam.cz>
4192 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4193 (ExtractSecurityPermissionSet): Cope with self referencing security
4194 attributes properly.
4196 * driver.cs (SetOutputFile): Made public property OutputFile.
4198 2005-07-07 Raja R Harinath <rharinath@novell.com>
4201 * class.cs (TypeContainer.first_nonstatic_field): Rename from
4202 has_nonstatic_fields. Make into a FieldBase pointer.
4203 (TypeContainer.AddField): Add CS0282 check.
4204 (TypeContainer.EmitType): Update.
4206 2005-07-06 Miguel de Icaza <miguel@novell.com>
4208 * cs-tokenizer.cs (consume_identifier): Do not create strings to
4209 compare if they start with __.
4211 2005-07-06 Raja R Harinath <rharinath@novell.com>
4213 * statement.cs (Switch.SwitchGoverningType): Only look at
4214 UserCasts that don't need implicit standard conversions to one of
4215 the allowed switch types (Fixes test-322.cs).
4216 (LocalInfo.Resolve): Re-enable sanity-test.
4218 2005-07-06 Marek Safar <marek.safar@seznam.cz>
4220 * cs-tokenizer.cs (consume_identifier): Detect double undescores
4222 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4224 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4226 2005-07-06 Raja R Harinath <rharinath@novell.com>
4229 * ecore.cs (SimpleName.GetSignatureForError): Add.
4230 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4231 (MemberAccess.GetSignatureForError): Add.
4233 2005-07-05 Marek Safar <marek.safar@seznam.cz>
4235 The big error and warning messages review.
4265 * typemanager.cs: Updated.
4267 * class.cs: (MethodCore.SetYields): Moved here to share.
4268 (PropertyMethod.Define): Moved iterator setup here.
4270 * iterators.cs: Add orig_method to have full access to parent
4273 2005-07-05 Raja R Harinath <rharinath@novell.com>
4275 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4276 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4277 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4278 variable of struct type.
4279 * expression.cs (Unary.ResolveOperator): Update to change.
4280 (Indirection.VerifyFixed): Likewise.
4281 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4282 (ParameterReference.VerifyFixed): Value parameters are fixed.
4283 (This.VerifyFixed): Treat 'this' as a value parameter.
4284 * statement.cs (LocalInfo.IsFixed): Remove.
4286 2005-07-01 Martin Baulig <martin@ximian.com>
4288 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4289 `ec.EmitThis ()' to get the correct scope.
4291 2005-07-01 Martin Baulig <martin@ximian.com>
4293 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4294 instance is a ParameterReference; fixes #75299.
4296 2005-07-01 Martin Baulig <martin@ximian.com>
4298 Reverted Marek's latest patch (r46725):
4299 - it contains structural changes which are neither mentioned in
4300 the ChangeLog nor explained anywhere; for example the additional
4301 argument of EmitContext's and Iterator's .ctor's and the
4302 TypeContainer.DefineMembers() change.
4303 - structural changes like this should go in in seperate patches
4304 and not be hidden in a huge patch which just seems to affect
4305 warnings and errors.
4306 a big and hard to understand patch.
4307 - it breaks iterators and causes regressions, for instance in
4310 2005-06-30 Raja R Harinath <rharinath@novell.com>
4313 * expression.cs (Indexers.map): Remove.
4314 (Indexers.Append): Filter out inaccessible setters and getters.
4315 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4318 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
4320 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4321 (FieldExpr.Emit, PropertyExpr.Emit): Update.
4322 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4323 * expression.cs (Invocation.EmitCall): Add CS0120 check.
4325 2005-06-30 Marek Safar <marek.safar@seznam.cz>
4328 * class.cs (FieldBase.GetInitializerExpression): One more field
4331 2005-06-28 Miguel de Icaza <miguel@novell.com>
4333 * pending.cs: Do not define a proxy if the base method is virtual,
4334 it will be picked up by the runtime (bug 75270).
4336 2005-06-08 Martin Baulig <martin@ximian.com>
4338 The big Iterators rewrite :-)
4340 * iterators.cs: Rewrite this to use the anonymous methods framework.
4342 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4343 before the TypeContainers; see 2test-21.cs.
4346 (TypeContainer.DefineType): Don't create a new EmitContext if we
4347 already have one (this only happens if we're an Iterator).
4348 (TypeContainer.Define): Also call Define() on all our iterators.
4349 (Method.CreateEmitContext): Added support for iterators.
4352 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4353 (AnonymousContainer.CreateMethodHost): Moved here from
4354 AnonymousMethod and made abstract.
4355 (AnonymousContainer.CreateScopeType): New abstract method.
4356 (AnonymousContainer.IsIterator): New public property.
4357 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4358 get the ScopeTypeBuilder rather than manually defining it here.
4359 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4362 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4363 before RootContext.DefineTypes().
4365 * codegen.cs (EmitContext.RemapToProxy): Removed.
4366 (EmitContext.CurrentAnonymousMethod): Changed type from
4367 AnonymousMethod -> AnonymousContainer.
4368 (EmitContext.ResolveTopBlock): Protect from being called twice.
4369 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4370 (EmitContext.EmitThis): Removed the iterators hacks; use the
4371 anonymous methods framework for that.
4374 (ToplevelBlock.Container): Make this a property, not a field.
4375 (ToplevelBlock.ReParent): New public method; move the
4376 ToplevelBlock into a new container.
4377 (Foreach.TemporaryVariable): Simplify.
4379 2005-06-05 Martin Baulig <martin@ximian.com>
4381 * statement.cs (LocalInfo.CompilerGenerated): New flag.
4382 (Block.AddTemporaryVariable): New public method; creates a new
4383 `LocalInfo' for a temporary variable.
4384 (Block.EmitMeta): Create the LocalBuilders for all the temporary
4386 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4387 non-iterator variables.
4389 2005-06-05 Martin Baulig <martin@ximian.com>
4391 * statement.cs (Foreach.TemporaryVariable): Create the
4392 LocalBuilder in the Emit phase and not in Resolve since in some
4393 situations, we don't have an ILGenerator during Resolve; see
4394 2test-19.cs for an example.
4396 2005-06-04 Martin Baulig <martin@ximian.com>
4398 **** Merged r45395 from GCS ****
4400 The big Foreach rewrite - Part II.
4402 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4403 with `PropertyInfo ienumerator_getcurrent'.
4405 * codegen.cs (VariableStorage): Removed.
4408 (Foreach): Derive from Statement, not ExceptionStatement.
4409 (Foreach.CollectionForeach): New nested class. Moved all the code
4410 dealing with collection foreach here.
4411 (Foreach.ForeachHelperMethods): Removed.
4412 (Foreach.TemporaryVariable): Implement IMemoryLocation.
4414 2005-05-23 Martin Baulig <martin@ximian.com>
4416 * statement.cs (Try.DoResolve): Don't create a `finally' if we
4417 don't need to. Fix #75014.
4419 2005-05-20 Martin Baulig <martin@ximian.com>
4421 Merged r44808 from GMCS.
4423 * class.cs (TypeContainer.CircularDepException): Removed.
4424 (TypeContainer.DefineType): Removed the `InTransit' stuff.
4425 (TypeContainer.CheckRecursiveDefinition): Check for circular class
4426 (CS0146) and interface (CS0529) dependencies here.
4428 2005-06-21 Raja R Harinath <rharinath@novell.com>
4430 * expression.cs (Invocation.EmitCall): Fix initialization
4431 'this_call' to reflect current behaviour. Fix indentation.
4433 * convert.cs (FindMostEncompassedType): Add two trivial special
4434 cases (number_of_types == 0 || number_of_types == 1).
4435 (FindMostEncompasingType): Likewise.
4437 2005-06-17 Raja R Harinath <rharinath@novell.com>
4439 Some cleanups preparing for the fix of #75283.
4440 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4442 (EventExpr.InstanceResolve): Likewise.
4443 (EventExpr.DoResolve): Remove redundant checks.
4445 2005-06-10 Duncan Mak <duncan@novell.com>
4447 * cs-tokenizer.cs (process_directives): New flag for controlling
4448 the processing of preprocessor directives.
4449 (x_token): After seeing a '#', return Token.NONE instead of going
4450 to handle_preprocessing_directive() when not processing
4451 directives. This avoids unnecessary processing during the token peek in
4456 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
4457 the existing error reporting methods instead of Report.Error.
4459 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
4460 after Raja's rewrite.
4462 2005-06-08 Miguel de Icaza <miguel@novell.com>
4464 * class.cs: Small fix.
4466 2005-06-08 Raja R Harinath <rharinath@novell.com>
4469 * class.cs (GetPartialBases): Fix return value check of
4472 2005-06-07 Raja R Harinath <rharinath@novell.com>
4474 Ensure that partial classes are registered in their enclosing
4475 namespace. Initial part of fix of #75160.
4476 * tree.cs (Tree.RecordDecl): Add new namespace argument.
4477 Register declspace with namespace here, not in
4478 DeclSpace.RecordDecl.
4479 * cs-parser.jay: Pass namespace to RecordDecl.
4480 * class.cs (PartialContainer.Create): Likewise.
4481 (ClassPart.DefineType): New sanity-check. Throws an exception if
4483 * decl.cs (Declspace.RecordDecl): Remove.
4484 * namespace.cs (NamespaceEntry.DefineName): Remove.
4486 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4488 * rootcontext.cs: Reset TargetExt as well.
4490 2005-06-03 Raja R Harinath <rharinath@novell.com>
4492 * ecore.cs (Expression.Resolve): Emit CS0654 error when
4495 2005-06-02 Raja R Harinath <rharinath@novell.com>
4497 Fix #75080, cs0119.cs.
4498 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
4500 (Expression.Resolve): ... this. Use it. Remove bogus code
4501 allowing ExprClass.Type and ExprClass.Namespace for
4502 ResolveFlags.VariableOrValue.
4503 (Expression.Resolve) [1-argument variant]: Change default resolve
4504 flags based on language version.
4505 (Expression.Error_UnexpectedKind): Use a simple string array
4506 rather than an ArrayList.
4507 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4509 (TypeOfVoid.DoResolve): Likewise.
4510 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
4511 flags argument -- it always has the same value.
4513 2005-05-31 Raja R Harinath <rharinath@novell.com>
4516 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4517 Use it in the error message.
4518 * assign.cs, expression.cs, statement.cs: Update.
4520 2005-05-30 Raja R Harinath <rharinath@novell.com>
4523 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4524 the "almostMatchedMember" case too.
4525 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4526 that failed the accessibility checks to 'almost_match'.
4528 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
4530 * attribute.cs: Use internal MethodBuilder methods to set
4531 ExactSpelling and SetLastError on PInvoke methods, instead
4532 of passing them via charset. Fixes #75060.
4534 2005-05-27 Raja R Harinath <rharinath@novell.com>
4536 * parameter.cs (Parameter): Remove TODO comment.
4537 (Parameter.DefineParameter): Remove Location parameter.
4538 (Parameters.LabelParameters): Likewise.
4539 * class.cs (Constructor.Emit): Update to change.
4540 (MethodData.Emit): Likewise.
4541 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
4542 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4544 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
4547 Removed Parameters.Location and added Parameter.Location instead.
4548 Removed Location parameter from Emit() and GetSignature().
4555 Modified all related calls.
4557 2005-05-26 Raja R Harinath <rharinath@novell.com>
4559 Improve user-defined conversion handling.
4560 * convert.cs (GetConversionOperators): Rewrite. Return only the
4561 applicable operators.
4562 (AddConversionOperators): New. Helper for GetConversionOperators.
4563 (FindMostEncompassedType, FindMostEncompassingType): Verify that
4564 there is only one most encompassed/encompassing type.
4565 (FindMostSpecificSource, FindMostSpecificTarget): Remove
4566 "applicable operator" handling.
4567 (UserConversion): Move cache here from GetConversionOperators.
4568 Directly cache the chosen operator, rather than the whole
4570 (ExplicitNumericConversion): Fix buggy implementation of Decimal
4571 case. Allow conversion of decimal to sbyte and byte too.
4572 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4573 New static methods. Used to avoid allocating EmptyExpressions in
4576 2005-05-24 Duncan Mak <duncan@novell.com>
4578 * ecore.cs (CastFromDecimal): New class for casting a decimal to
4579 another class, used in Convert.ExplicitNumericConversion.
4580 (CastToDecimal): New class, similar to above, but casts to
4581 System.Decimal, used in Convert.ImplicitNumericConversion and also
4582 in explicit convesion from double/float to decimal.
4584 * convert.cs (ImplicitNumericConversion): Handle implicit
4585 conversions to System.Decimal.
4586 (ExplicitNumericConversion): handle explicit conversions to
4591 2005-05-20 Miguel de Icaza <miguel@novell.com>
4593 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
4594 know the type at this stage, just break through. Fixes #75008
4596 2005-05-19 Martin Baulig <martin@ximian.com>
4599 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4600 to disable error reporting.
4602 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4603 here since we don't want to report an error; see the new test-336.cs.
4605 2005-05-19 Raja R Harinath <rharinath@novell.com>
4607 * statement.cs (ToplevelBlock.GetParameterReference)
4608 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4609 Move here from class Block.
4610 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4611 * expression.cs (ParameterReference.DoResolveBase): Likewise.
4613 2005-05-18 Martin Baulig <martin@ximian.com>
4618 (FlowBranching.Reachability): Add non-static public And() and Or()
4620 (FlowBranchingSwitch): New class; do the `break_origins' thing
4621 like in FlowBranchingLoop.
4622 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4623 reachability, not just locals and parameters.
4624 (FlowBranching.MergeChild): Remove some of the hacks for loop and
4625 switch; MergeBreakOrigins() now takes care of that.
4627 2005-05-18 Martin Baulig <martin@ximian.com>
4629 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4630 a loop and may leave it, reset the barrier; fixes #74974.
4632 2005-05-17 Marek Safar <marek.safar@seznam.cz>
4634 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4637 * cs-parser.jay: Catch more lexical errors.
4639 * report.cs: Add one more Error method.
4642 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4644 2005-05-17 Martin Baulig <martin@ximian.com>
4646 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4649 2005-05-16 Raja R Harinath <rharinath@novell.com>
4651 Fix test-382.cs. Emit values of decimal constants.
4652 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4654 (TypeContainer.AddField): ... this.
4655 (TypeContainer.EmitFieldInitializers): Allow the list of fields
4656 with initializers to include 'Const's.
4657 (ClassPart.RegisterFieldForInitialization): Forward to
4659 * const.cs (Const.Const): Pass initializer to base class.
4660 (Const.Define): In case of decimal constants, register them for
4661 initialization in a static constructor.
4663 2005-05-14 Martin Baulig <martin@ximian.com>
4665 * statement.cs (Block.Resolve): Correctly handle unreachable code;
4666 do not call ResolveUnreachable() on unreachable statements in
4667 here, see the comment in the source code.
4669 2005-05-13 Raja R Harinath <rharinath@novell.com>
4672 * expression.cs (BinaryResolveOperator): If one of the operands of
4673 an equality comparison is 'null' and the other is a pointer type,
4674 convert the null to a NullPointer.
4675 * convert.cs (ImplicitReferenceConversion): If the expression is a
4676 NullLiteral and the target type is a pointer type, return a
4677 NullPointer instead.
4678 (ImplicitConversionStandard): Likewise.
4680 2005-05-13 Marek Safar <marek.safar@seznam.cz>
4682 * cs-parser.jay: Set readonly context based on special constructs.
4684 * expression.cs (LocalVariableReference.DoResolveBase): Improved
4685 readonly variable error handling.
4687 * rootcontext.cs (EmitCode): Don't verify members when error
4690 * statement.cs (LocalInfo): Add reaodnly context information.
4691 (SetReadOnlyContext, GetReadOnlyContext): New methods.
4693 2005-05-13 Raja R Harinath <rharinath@novell.com>
4695 * statement.cs (Block.Resolve): Revert change below. Modify fix
4696 for #74041 to initialize 'resolved' to false only for explicit
4697 blocks. Fixes #74873.
4699 2005-05-12 Raja R Harinath <harinath@gmail.com>
4702 * typemanager.cs (unmanaged_enclosing_types): New.
4703 (IsUnmanagedType): Avoid infloops by using
4704 'unmanaged_enclosing_types' to talk with recursive invocations.
4706 2005-05-13 Martin Baulig <martin@ximian.com>
4708 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4709 instance variable, not a local. Fix #74873.
4710 (Block.ResolveUnreachable): Set it to true here.
4712 2005-05-11 Duncan Mak <duncan@novell.com>
4714 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4715 continuing to process for 'arg'.
4716 (handle_preprocessing_directive): Check the argument of the #endif
4717 directive and report error CS1025 if there are any trailing
4720 According to the C# spec, having even whitespace after the #endif
4721 directive is illegal; however, because we call arg.TrimEnd ()
4722 beforehand, we have the same behavior as csc, allowing whitespace
4723 after the directive.
4727 2005-05-11 Marek Safar <marek.safar@seznam.cz>
4731 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4732 (Constructor.GetObsoleteAttribute): Implemented correctly.
4734 2005-05-10 Martin Baulig <martin@ximian.com>
4736 * support.cs (ReflectionParameters.ParameterModifier): Use
4737 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4738 and `ParameterAttributes.In'. Fixes #74884.
4740 2005-05-10 Marek Safar <marek.safar@seznam.cz>
4742 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4744 * expression.cs (Argument.GetParameterModifier): Turned to property.
4745 (Invocation.Error_InvalidArguments): Add more descriptive errors.
4747 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4750 2005-05-09 Raja R Harinath <rharinath@novell.com>
4753 * decl.cs (MemberCache.AddMethods): Register override methods,
4754 rather than non-override methods.
4755 * typemanager.cs (RegisterOverride): New.
4756 (IsOverride): Update.
4758 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4762 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4763 recursive declaration.
4765 * statement.cs (Block.ResolveMeta): Report any error in resolving.
4767 2005-05-06 Marek Safar <marek.safar@seznam.cz>
4769 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4771 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4773 2005-05-05 Raja R Harinath <rharinath@novell.com>
4776 * decl.cs (DeclSpace.FamilyAccessible):
4777 Use TypeManager.IsNestedFamilyAccessible.
4779 Fix reopened #64812.
4780 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4783 2005-05-04 Raja R Harinath <rharinath@novell.com>
4784 Abin Thomas <projectmonokochi@rediffmail.com>
4785 Anoob V E <projectmonokochi@rediffmail.com>
4786 Harilal P R <projectmonokochi@rediffmail.com>
4789 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4790 allow access to all static members.
4792 2005-05-04 Martin Baulig <martin@ximian.com>
4794 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4796 2005-05-04 Martin Baulig <martin@ximian.com>
4800 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4801 section at the end; make things work if `default' is not the last
4804 2005-05-04 Martin Baulig <martin@ximian.com>
4808 * statement.cs (Switch): Replaced the `got_default' field with a
4809 `default_section' one.
4810 (Switch.CheckSwitch): Set `default_section' here.
4811 (Switch.Resolve): If we're a constant switch and the constant is
4812 not found, use the default section.
4814 2005-05-03 Martin Baulig <martin@ximian.com>
4816 * expression.cs (ArrayAccess.EmitGetLength): New public method.
4818 * statement.cs (Foreach.ArrayForeach): New nested class.
4819 (Foreach.TemporaryVariable): New nested class.
4820 (Foreach.EmitArrayForeach): Removed; this is now in the new
4823 2005-05-03 Raja R Harinath <rharinath@novell.com>
4825 * pending.cs (BaseImplements): Move the #74773 fix here. This is
4827 (VerifyPendingMethods): Revert change below.
4829 * typemanager.cs (IsOverride, RegisterNonOverride): New.
4830 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4831 that used to trigger warning -28. Remove warning -28.
4832 * expression.cs (Invocation.OverloadResolve): Use
4833 TypeManager.IsOverride to distinguish override methods.
4836 * pending.cs (VerifyPendingMethods): If a base type implements the
4837 requested interface, don't bother checking individual methods of
4838 the base type. As a side-effect, this prevents the creation of
4839 unnecessary proxies.
4841 2005-05-02 Martin Baulig <martin@ximian.com>
4845 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4846 Also `And' the locals if the old vector is null.
4847 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4848 null; in this case we basically reset all the variables.
4850 2005-05-02 Martin Baulig <martin@ximian.com>
4854 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4855 Added `FlowBranching branching' argument; always `and' the
4856 variables instead of `or'ing them unless we're an infinite loop.
4858 * statement.cs (While.Resolve): Create a new sibling unless we're
4861 2005-05-02 Martin Baulig <martin@ximian.com>
4865 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4866 arguments; use it instead of creating a new TopLevelBlock.
4867 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4868 our ConstructorInitializer.
4871 (TopLevelBlock.TopLevelBranching): New public property.
4872 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4873 and create our `TopLevelBranching'.
4875 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4876 anonymous method host, use `block.TopLevelBranching' rather than
4877 creating a new branching.
4879 2005-04-20 Miguel de Icaza <miguel@novell.com>
4881 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4882 a ScopeInfo, if any of the current children is a child of the new
4883 entry, move those children there.
4885 2005-04-30 Martin Baulig <martin@ximian.com>
4887 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4888 at the beginning of a SwitchSection. Fix #73335.
4890 2005-04-27 Marek Safar <marek.safar@seznam.cz>
4893 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4895 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4896 (FieldExpr.DoResolve): Obsolete members are ignored for field
4899 2005-04-26 Marek Safar <marek.safar@seznam.cz>
4901 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4902 of arrays detection.
4904 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4906 (Field.VerifyClsCompliance): Volatile fields are not compliant.
4908 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4911 2005-04-25 Ben Maurer <bmaurer@ximian.com>
4913 * cs-parser.jay: Use the prefered version of -unsafe in error
4916 2005-04-22 Marek Safar <marek.safar@seznam.cz>
4918 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4921 2005-04-20 John Luke <john.luke@gmail.com>
4923 * driver.cs: fix typo in error message, --outout to --output
4925 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4927 * codegen.cs (InRefOutArgumentResolving): New field.
4929 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4930 fields outside contructor.
4932 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4934 2005-04-19 Miguel de Icaza <miguel@novell.com>
4936 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4937 parameter code was not completed ever, so it was not as up-to-date
4938 as local variables. Must finish it.
4940 The bug fix was to compare the Toplevel of the block, not the
4941 current block. Thanks for Ben for pointing this out.
4943 2005-04-19 Raja R Harinath <rharinath@novell.com>
4945 * decl.cs (AddMethods): Use the declaring type of the problem
4946 method to determine if we want to squash a warning.
4948 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4950 * attribute.cs: Removed debug output.
4952 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4954 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4957 2005-04-18 Raja R Harinath <rharinath@novell.com>
4960 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4961 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4962 all null comparisons against reference types.
4964 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4967 * class.cs (TypeContainer.CircularDepException) New nested
4969 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4970 (TypeContainer.DefineType): Removed error, reset InTransit before
4972 (Class.DefineType): Throw exception when is in Transit.
4973 Catch exception and report error.
4974 (Struct.DefineType): Throw exception when is in Transit.
4975 Catch exception and report error.
4976 (Interface.DefineType): Throw exception when is in Transit.
4977 Catch exception and report error.
4979 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4980 handle nested exception handlers.
4982 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4985 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4986 InFinally and InCatch storage.
4988 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4989 (Catch.Resolve): Set and Restore ec.InCatch.
4990 (Try.Resolve): Set and Restore ec.InFinally.
4991 (Try.HasCatch): True when try has catch.
4993 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4995 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4996 for the same event member, so exclude such cases from warning 419.
4999 2005-04-16 Miguel de Icaza <miguel@novell.com>
5001 * expression.cs (Binary.ResolveOperator): Apply patch from John
5002 Luke to fix bug 59864: operators &, | and ^ on enumerations
5003 require that the same enum type on both sides.
5005 * driver.cs: Add warnings to old flag usage, this is to assist
5006 people who produce Makefiles and hope that the Makefiles will be
5009 * class.cs (TypeContainer.EmitType): Moved the definition of the
5010 special $PRIVATE$ field from the resolve phase to the Emit phase.
5011 During resolve we do not know if we are a struct with
5012 HasExplicitLayout, we know this only after the attributes for the
5015 Set the FieldOffset to zero on the dummy field that we create for
5016 the class. Fixes 74590.
5018 2005-04-16 Raja R Harinath <rharinath@novell.com>
5021 * ecore.cs (PropertyExpr.resolved): New.
5022 (DoResolve): Use it to handle a case of double resolution here.
5023 Handle a case of identical-name-and-type-name.
5024 * expression.cs (ArrayCreation.CheckIndices): Avoid double
5025 resolution by storing the results of expression resolution back
5026 into the "probes" array.
5028 2005-04-15 Raja R Harinath <rharinath@novell.com>
5030 Fix cs0208-7.cs and cs0208-8.cs.
5031 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5032 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
5033 error reporting to point out the reason a struct is not unmanaged.
5035 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5037 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
5038 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5040 2005-04-13 Raja R Harinath <rharinath@novell.com>
5043 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5044 IdenticalNameAndTypeName here.
5045 (EventExpr.InstanceResolve): Likewise.
5047 2005-04-13 Marek Safar <marek.safar@seznam.cz>
5049 C# 2.0 DefaultCharSetAttribute implementation
5051 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5052 which allows us to set GlobalNamespace for every resolve.
5053 (Attribute.ResolveArguments): Cut from Resolve.
5054 (Attribute.GetCharSetValue): Returns CharSet named argument.
5055 (Attribute.DefinePInvokeMethod): Gets default charset from
5057 (GlobalAttribute.ResolveAsTypeStep): Override.
5058 (GlobalAttribute.ResolveArguments): Override.
5060 * class.cs (TypeAttr): Is protected.
5062 * codegen.cs (ModuleClass.DefaultCharSet): New member.
5063 (ModuleClass.DefaultCharSetType): New memeber.
5064 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5066 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5067 charset from module.
5069 * delegate.cs (TypeAttr): Override.
5070 (Delegate.DefineType): Use this TypeAttr.
5072 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5073 at very early stage (before types are defined) to resolve model
5074 module attributes. It will probably not work with corlib but it
5077 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5078 charset from module.
5080 * typemanager.cs (default_charset_type): New type.
5082 2005-04-13 Raja R Harinath <rharinath@novell.com>
5084 * decl.cs (MemberCache.AddMethods): Don't warn if
5085 System.Object.Finalize has buggy MethodAttributes.
5087 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5090 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5092 * doc.cs : detect ambiguous reference to overloaded members.
5093 Fixed bug #71603. MS 1.1 csc does not detect it.
5095 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5097 * doc.cs : delegates must not be referenced with parameters.
5100 2005-04-12 Miguel de Icaza <miguel@novell.com>
5102 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5104 2005-04-10 Miguel de Icaza <miguel@novell.com>
5106 * driver.cs (MainDriver): Stop processing if the CLS stage found
5109 (CompilerCallableEntryPoint.InvokeCompiler): Always
5110 reset after execution; Take a TextWriter argument for the
5113 * report.cs: Use the error stream instead of hardcoding stderr.
5115 2005-04-09 Miguel de Icaza <miguel@novell.com>
5117 * class.cs: Reduce code paths to test, too small of an
5118 optimization to make it worth the extra testing. Always perform
5121 2005-04-08 Raja R Harinath <rharinath@novell.com>
5124 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5125 operators that had errors reported on them.
5127 2005-04-08 Marek Safar <marek.safar@seznam.cz>
5129 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5131 (Attribute.Resolve): Add named argument type checking.
5133 * class.cs (FixedField.Define): Use IsPrimitiveType
5135 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5137 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5138 unsafe parameter types.
5140 * statement.cs (Using.ResolveExpression): Add better error description.
5142 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5144 2005-04-08 Raja R Harinath <rharinath@novell.com>
5147 * attribute.cs (Attribute.GetAttributeUsage): Resolve
5148 AttributeUsageAttribute in the emitcontext of the attribute class,
5149 not in the emitcontext of the attributable entity it was attached to.
5150 * cs-parser.jay: Use 'current_class', not 'current_container',
5151 when creating a GlobalAttribute.
5153 2005-04-08 Alp Toker <alp@atoker.com>
5155 * pending.cs: The fix to #58413 failed to compile methods implementing
5156 interfaces with/without params modifiers and vice versa, even though
5157 params modifiers aren't part of the signature. Make the modifier check
5158 less strict as in csc.
5160 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
5161 Anoob V E <projectmonokochi@rediffmail.com>
5162 Harilal P R <projectmonokochi@rediffmail.com>
5165 * pending.cs (TypeAndMethods.mods): New. Store the parameter
5166 modifiers of pending methods.
5167 (PendingImplementation.PendingImplementation): Initialize it.
5168 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5169 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5170 with ParameterData. Add check for modifiers.
5171 * class.cs (MethodData.Define): Update to changes.
5173 2005-04-07 Raja R Harinath <rharinath@novell.com>
5175 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5177 2005-04-07 Marek Safar <marek.safar@seznam.cz>
5179 * class.cs (PropertyMethod.Define): Check private accessor in abstract
5182 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5185 * typemanager.cs: Registered RequiredAttributeAttribute.
5187 2005-04-06 Marek Safar <marek.safar@seznam.cz>
5189 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5190 Warning CS0169 is back at level 3.
5191 (IMethodData.SetMemberIsUsed): New method.
5193 * decl.cs (IsUsed): New value; moved from FieldBase.Status
5194 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5196 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5198 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5200 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5203 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5206 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5207 to avoid the problems with nested types.
5209 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
5210 Anoob V.E <projectmonokochi@rediffmail.com>
5211 Harilal P.R <projectmonokochi@rediffmail.com>
5212 Raja R Harinath <rharinath@novell.com>
5215 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5217 * typemanager (GetConstructor): Make public.
5219 2005-04-05 John Luke <john.luke@gmail.com>
5220 Raja R Harinath <rharinath@novell.com>
5223 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5224 struct too. Return false quicker in a few cases.
5225 (VerifyUnManaged): Use it.
5227 2005-04-05 Raja R Harinath <rharinath@novell.com>
5230 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5231 not 'unreachable_seen'.
5233 2005-04-04 Marek Safar <marek.safar@seznam.cz>
5235 * attribute.cs (Attribute.GetValue): Removed unused.
5237 * codegen.cs (CodeGen.TrimExt): Removed unused.
5239 * cs-parser.jay (output): Removed unused.
5241 * cs-tokenizer.cs (hex_digits): Removed unused.
5243 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5245 * expression.cs (Indirection.LoadExprValue): Removed unused.
5246 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5248 * iterators.cs (Iterator.param_types): Removed unused.
5250 * statement.cs (Goto.block): Removed unused.
5251 (ToplevelBlock.did): Removed unused.
5252 (Switch.ResolveConstantSwitch): Removed unused.
5254 2005-04-01 Ben Maurer <bmaurer@ximian.com>
5256 * rootcontext.cs: Allow mcs to bootstrap with the compilation
5259 2005-04-01 Raja R Harinath <rharinath@novell.com>
5261 Fix #74232 and cs0208-3.cs.
5262 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5263 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5264 unmanaged type. Don't use FieldBuilders when 't' is a
5265 TypeBuilder. Use ModFlags and MemberType fields.
5266 * class.cs (MemberBase.member_type): Rename from MemberType.
5267 (MemberBase.MemberType): New property. Determines member_type on
5269 (MemberBase.DoDefine): Don't initialize MemberType here.
5270 (FieldMember.Define): Likewise.
5272 2005-04-01 Marek Safar <marek.safar@seznam.cz>
5275 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5276 Attributes are emitted there.
5278 2005-04-01 Raja R Harinath <rharinath@novell.com>
5280 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5281 keyword in 'partial enum' too.
5282 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5284 Report from Kamil Skalski <nazgul@omega.pl>.
5287 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5288 have partial containers too.
5290 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5291 in block' checks to Block.CheckInvariantMeaningInBlock.
5292 * statement.cs (Block.GetKnownVariableInfo): Make private.
5293 (Block.IsVariableUsedInChildBlock): Remove.
5294 (Block.IsVariableUsedInBlock): Likewise.
5295 (Block.CheckInvariantMeaningInBlock): New. Show location of
5296 conflicting declaration.
5297 (Block.AddVariable): Make error messages less long-winded and more
5298 specific. Show location of conflicting declaration.
5299 * parameter.cs (Parameters.Location): New readonly property.
5301 2005-03-31 Raja R Harinath <rharinath@novell.com>
5303 Clean up semantics of invoking ResolveMemberAccess.
5304 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5305 can have an instance, ensure that we pass in a non-TypeExpression
5306 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
5307 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5308 argument. Update to changes and simplify.
5309 (FieldExpr.Emitinstance): Remove CS0120 check.
5310 (PropertyExpr.EmitInstance): Likewise.
5311 * expression.cs (Argument.Resolve): Likewise.
5312 (Invocation.DoResolve): Update to changes in semantics of
5315 2005-03-31 Marek Safar <marek.safar@seznam.cz>
5318 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5321 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5323 2005-03-31 Raja R Harinath <rharinath@novell.com>
5325 Fix difference in behaviour with commandline invocation.
5326 * driver.cs (Driver.Reset): New.
5327 (CompilerCallableEntryPoint): Call it.
5329 * statement.cs (If.Resolve): Avoid spurious "uninitialized
5330 variable" warnings if the boolean expression failed to resolve.
5332 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
5334 * attribute.cs: Fix the union of several permissions when some of them
5335 are unrestricted (so the result isn't an unrestricted permission set).
5338 2005-03-30 Raja R Harinath <rharinath@novell.com>
5340 * ecore.cs (MemberExpr): New class. Convert from interface
5342 (MemberExpr.ResolveMemberAccess): Refactor and move here from
5343 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
5345 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5346 (MethodGroupExpr.IsExplicitImpl): Remove.
5347 (Expression.GetFieldFromEvent): Remove.
5348 (SimpleName.MemberStaticCheck): Remove.
5349 (SimpleName.DoSimpleNameResolve): Update to changes.
5350 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5351 (MemberAccess.IdenticalNameAndTypeName): Remove.
5352 (MemberAccess.error176): Move to MemberExpr.
5353 (MemberAccess.DoResolve): Update to changes.
5354 (BaseAccess.DoResolve): Likewise.
5356 2005-03-30 Marek Safar <marek.safar@seznam.cz>
5358 C# 2.0 Conditional attribute class implementation
5360 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5361 Analyzes class whether it has attribute which has ConditionalAttribute
5362 and its condition is not defined.
5364 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5365 (Class.IsExcluded): New method. Search for at least one defined
5366 condition in ConditionalAttribute of attribute class.
5368 2005-03-30 Raja R Harinath <rharinath@novell.com>
5370 * ecore.cs (PropertyExpr): Derive from Expression, not
5371 ExpressionStatement.
5372 (PropertyExpr.EmitStatement): Remove.
5374 2005-03-29 Raja R Harinath <rharinath@novell.com>
5377 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5378 internal field "value__" of an enum be private. The examples for
5379 "value__" that I found on MSDN all used FieldAttributes.Private.
5381 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5382 Don't mention IL method attribute names.
5384 Fix #47991. Remove a TODO.
5385 * statement.cs (Block.Toplevel): Make into a field.
5386 (Block.Parameters): Move into ToplevelBlock.
5387 (Block.known_variables): Rename from child_variable_names.
5388 (Block.Block): Remove variants that take Parameters. Initialize
5389 'Toplevel' with the immediately surrounding toplevel block.
5390 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
5391 LocalInfo parameter.
5392 (Block.GetKnownVariableInfo): New.
5393 (Block.IsVariableNameUsedInChildBlock): Update.
5394 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
5395 the block, even though it may not be in scope.
5396 (Block.AddVariable): Remove Parameters parameter. Use
5397 Toplevel.Parameters instead.
5398 (Block.AddConstant): Remove Parameters parameter.
5399 (Block.GetParameterReference): Update to use Toplevel.Parameters.
5400 (Block.IsParamaterReference): Likewise.
5401 (Block.IsLocalParameter): Likewise. Simplify a lot.
5402 (ToplevelBlock.Parameters): New. Moved from Block.
5403 (ToplevelBlock.ToplevelBlock): Update to changes. Always
5404 initialize Parameters to a non-null value.
5405 * cs-parser.jay: Update to changes.
5406 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5407 simple names that mean different things in the same block. Use
5408 Block.IsVariableNameUsedInBlock.
5410 2005-03-28 Raja R Harinath <rharinath@novell.com>
5412 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5413 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5414 GetTypeHandle. It is possible for a reflected type to derive from
5415 a TypeBuilder (e.g., int[] derives from the TypeBuilder
5416 System.Array during mscorlib compilation).
5417 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5418 contain a method_hash, don't create one either. Don't create a
5419 deep copy of the base cache's method_hash.
5420 (MemberCache.SetupCache): Rename back from DeepCopy.
5421 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5422 already initialized. If we see an override function, add its
5423 underlying base virtual function to the member_hash too.
5425 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5427 2005-03-26 Raja R Harinath <harinath@acm.org>
5430 * assign.cs (Assign.DoResolve): When the RHS of an assignment
5431 fails to resolve, ensure that the LHS is still resolved as an
5434 2005-03-25 Raja R Harinath <harinath@acm.org>
5436 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5438 (Enum.current_ec): Remove.
5439 (Enum.LookupEnumValue): Remove EmitContext argument.
5440 Just uses the one created during DefineType.
5441 (Enum.FindMembers): Update.
5442 * expression.cs (MemberAccess.DoResolve): Update.
5444 2005-03-22 Marek Safar <marek.safar@seznam.cz>
5446 * assign.cs (Assign.DoResolve): Check for CS1717 when
5447 source and target are same (uses Equals).
5449 * expression.cs (LocalVariableReference, ParameterReference,
5450 This): Implemented Equals, GetHashCode.
5452 * statement.cs (Block.GetParameterReference): Removed useless
5455 2005-03-22 Raja R Harinath <rharinath@novell.com>
5458 * statement.cs (Block.AddVariable): Ensure that we skip implicit
5459 blocks before deciding whether the error is cs0136 or cs0128.
5461 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5462 (using_alias_directive, using_namespace_directive): Pass
5463 MemberName, not an expression to Namespace.UsingAlias and
5465 (MakeName): Use the MemberName of the namespace.
5466 * namespace.cs (Namespace.MemberName): New.
5467 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5468 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5470 * decl.cs (MemberName.Name): Make readonly.
5471 (MemberName.FromDotted): New "constructor".
5472 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5473 (MemberCore.Name): Compute from MemberName on demand.
5474 (MemberCore.SetMemberName): Provide a way to change the
5476 (MemberCore.AddToContainer): Don't take a fullname parameter.
5477 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5478 fully qualified name of the container to the member name.
5479 (TypeContainer.AddToTypeContainer): Use a fully qualified name
5480 only if the type is a member of the root container.
5481 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5482 MemberName.Left rather than searching for an embedded ".".
5483 (PartialContainer.CreatePart): Update to changes in RootContext.
5484 (MemberBase.ShortName): Turn into a property. Use
5485 MemberCore.SetMemberName.
5486 (MemberBase.ExplicitInterfaceName): Remove.
5487 (MemberBase.UpdateMemberName): Remove.
5488 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5489 (PropertyBase.SetMemberName): New override.
5490 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5491 (Tree.GetDecl): New.
5492 (Tree.AllDecls): Rename from Decls.
5493 * attribute.cs, enum.cs, report.cs: Update to changes.
5494 * driver.cs (MainDriver): Use MemberName.FromDotted on
5495 RootContext.MainClass.
5497 2005-03-21 Marek Safar <marek.safar@seznam.cz>
5499 * class.cs (FixedField.Define): Check for CS1664 and more sanity
5502 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5504 2005-03-18 Marek Safar <marek.safar@seznam.cz>
5506 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5507 property accessor modifiers.
5509 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5510 fixed buffer attribute (CS1716).
5511 (PropertyMethod.HasCustomAccessModifier): When property accessor
5512 has custom modifier.
5514 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5516 (PropertyExpr.DoResolveLValue): Add CS0272.
5518 2005-03-17 Miguel de Icaza <miguel@novell.com>
5520 * convert.cs: When converting to a pointer, use the proper Conv.U
5521 or Conv.I depending on the source data type.
5523 * cs-tokenizer.cs: Make the size for large decimal constants,
5526 2005-03-17 Martin Baulig <martin@ximian.com>
5528 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5529 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5531 2005-03-17 Martin Baulig <martin@ximian.com>
5533 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5534 to bool so we can return an error condition.
5535 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5538 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
5540 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5543 2005-03-16 Raja R Harinath <rharinath@novell.com>
5545 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5546 Refactor to avoid traversing the list of assemblies, and to avoid
5547 string concatenation.
5548 * typemanager.cs (guid_attr_type): Remove.
5549 (negative_hits, pointers, references): Remove hashes.
5551 (GetConstructedType): New. Uses type_hash to handle constructed
5552 types (arrays, references, pointers).
5553 (GetReferenceType, GetPointerType): Use it.
5554 (GetNestedType): New. Uses type_hash to handle nested types of
5556 (LookupType, LookupTypeDirect): Remove.
5557 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
5558 'types' hash and LookupTypeReflection directly.
5559 (params_string, params_object): Use GetConstructedType.
5560 * namespace.cs (Namespace.cached_types): New. Cache of reflected
5562 (Namespace.Lookup): Use cached_types.
5563 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5564 provided by old TypeManager.LookupType.
5565 * rootcontext.cs (MakeFQN): Remove.
5566 * decl.cs (DeclSpace.MakeFQN): Likewise.
5567 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5568 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5569 TypeManager.GetConstructedType.
5570 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5572 2005-03-15 Marek Safar <marek.safar@seznam.cz>
5574 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
5577 * cs-parser.jay: Reports CS1527 for any namespace element.
5579 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5582 * expression.cs (ParameterReference.IsAssigned): Changed error to
5584 (Error_WrongNumArguments): Moved CS0245 detection here.
5586 * statement.cs (Return.Resolve): Add CS1622 report.
5588 2005-03-11 Marek Safar <marek.safar@seznam.cz>
5590 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5592 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
5594 * attribute.cs expression.cs: Get rid of some allocations.
5596 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
5598 * doc.cs : just eliminate the latest change.
5600 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5602 * doc.cs : commented out the latest change. It breaks xml-030.cs
5604 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5606 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5607 fail. So invoke CreateType() in FindDocumentedType().
5609 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5611 * cs-tokenizer.cs : added IsKeyword().
5612 * doc.cs : Detect keyword incorrectly used as identifier.
5613 Allow identifiers prefixed by @.
5615 2005-03-10 Marek Safar <marek.safar@seznam.cz>
5617 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5618 It caused exception in namespace resolving (again!).
5620 * class.cs (Class.ctor): Removed exit.
5621 (PropertyMethod.ctor): ditto.
5623 * codegen.cs (Codegen.Reset): Reset static data.
5624 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5626 * cs-tokenizer.cs (Cleanup): Removed.
5628 * driver.cs (GetSystemDir): Rewrote to one line command.
5629 It caused problem with unloaded dynamic modules.
5630 (UnixParseOption): Removed Exit.
5631 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5632 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5633 Now can be mcs used as library.
5635 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5638 * location.cs (Reset): Reset static data.
5640 * namespace.cs (Reset): Reset static data.
5642 * report.cs (Report.Reset): Reset static data.
5644 * rootcontext.cs (RootContext.Reset): Reset static data.
5646 * tree.cs (RootTypes.ctor): Use Location.Null
5648 * typemanager.cs (TypeManager.Reset): Reset static data.
5649 (CoreLookupType): Removed Exit.
5650 (TypeHandle.Reset): Reset static data.
5652 2005-03-10 Raja R Harinath <rharinath@novell.com>
5655 * typemanager.cs (ComputeNamespaces): Import namespaces from
5656 referenced modules too.
5658 2005-03-09 Raja R Harinath <rharinath@novell.com>
5660 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5663 2005-03-09 Raja R Harinath <rharinath@novell.com>
5665 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5666 enclosing DeclSpace. This ensures that a name-lookup populates
5667 more caches and there are fewer 'TypeExpression's. Carve out
5668 nested type lookup into ...
5669 (LookupNestedTypeInHierarchy): ... this.
5671 2005-03-09 Raja R Harinath <rharinath@novell.com>
5673 Clean up a few partial-class semantics.
5674 Fixes test-357.cs and cs1618-2.cs.
5675 * cs-parser.jay (struct_declaration): Use 'current_class' as
5676 parent of newly-created struct. Remove call to Register ().
5677 Use 'pop_current_class' to complete handing the current struct.
5678 (interface_declaration): Likewise.
5679 (class_declaration): Likewise.
5680 (enum_declaration): Use 'current_class' as parent of newly created
5682 (delegate_declaration): Likewise.
5683 (pop_current_class): New function. This is used to handle closing
5684 up the 'current_class' and 'current_container', and pointing them
5685 to the enclosing class/container.
5686 (CSharpParser): Initialize 'current_class' too.
5687 * decl.cs (MemberCore): Add check for invariant: a partial
5688 container is not a parsed entity, and thus does not enclose any
5690 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5691 (DeclSpace.BaseTypeExpr): Use it.
5692 (DeclSpace.LookupType): Add check for invariant.
5693 * class.cs (TypeContainer): Add check for invariant: a nested
5694 class should have the same NamespaceEntry as its enclosing class.
5695 (TypeContainer.EmitFieldInitializers): Make virtual.
5696 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5698 (TypeContainer.Register): Remove.
5699 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5700 null. Use TypeResolveEmitContext for resolving base types and
5701 interfaces. Move initialization of Parts.TypeBuilder here from
5703 (TypeContainer.DefineNestedTypes): ... here.
5704 (PartialContainer): Take a Namespace not a NamespaceEntry.
5705 (PartialContainer.Create): Don't use Register. Call the
5706 appropriate Add... function directly.
5707 (ClassPart): Take both the PartialContainer and the enclosing
5708 class as constructor arguments.
5709 (ClassPart.EmitFieldInitializers): Override.
5710 (ClassPart.PartFindNestedTypes): Remove.
5711 (FieldBase.GetInitializerExpression): Resolve the initializer
5712 expression in the emit context of the enclosing class.
5713 * tree.cs (RootTypes): Remove Register ().
5715 2005-03-08 Marek Safar <marek.safar@seznam.cz>
5717 * cs-parser.jay: Removed CS0134.
5719 * driver.cs: Removed CS1901.
5721 * expression.cs (SizeOf.DoResolve): Don't report CS0233
5722 for predefined types.
5724 2005-03-07 Duncan Mak <duncan@novell.com>
5726 * codegen.cs (Save): Catch UnauthorizedAccessException as
5727 well. Fixes bug #73454.
5729 2005-03-07 Marek Safar <marek.safar@seznam.cz>
5731 * cs-tokenizer.cs (xtoken): Add CS1035.
5733 * class.cs (MethodData.Define): Add CS0683.
5734 (FieldMember.ctor): Add CS0681.
5736 2005-03-07 Raja R Harinath <rharinath@novell.com>
5738 * ecore.cs (SimpleName.DoResolve): Rename from
5739 SimpleName.DoResolveAllowStatic.
5740 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5741 Pass 'intermediate' flag to MemberStaticCheck.
5742 (SimpleName.MemberStaticCheck): Skip "static check" only in case
5743 of "intermediate" lookups via MemberAccess.
5744 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
5745 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5747 2005-03-07 Raja R Harinath <rharinath@novell.com>
5750 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5751 slipped in because of variable names that are identical to a
5752 builtin type's BCL equivalent ('string String;', 'int Int32;').
5753 (PropertyExpr.EmitInstance): Likewise.
5755 2005-03-04 Marek Safar <marek.safar@seznam.cz>
5757 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5759 * report.cs (warning_ignore_table): Made public.
5761 2005-03-04 Raja R Harinath <rharinath@novell.com>
5764 * class.cs (MethodData.Emit): Pass 'container' to
5765 container.GetObsoleteAttribute instead of 'container.Parent'.
5767 2005-03-03 Marek Safar <marek.safar@seznam.cz>
5769 * cs-parser.jay: Add 1534 error test.
5771 * iterators.cs (Yield.CheckContext): Add error 1629.
5772 (Iterator.ctor): Save unsafe modifier.
5773 (MoveNextMethod.DoEmit): Restore unsafe context.
5775 * namespace.cs (UsingAlias): Better error message.
5777 2005-03-03 Dan Winship <danw@novell.com>
5779 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5780 the warning message [#73219]
5782 2005-03-03 Raja R Harinath <rharinath@novell.com>
5784 Fix compile with MCS 1.0.0.0.
5785 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5786 w_restore to not depend on string constant folding.
5788 2005-03-03 Raja R Harinath <rharinath@novell.com>
5790 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
5791 CS0246 check to users who passed 'silent = false'.
5792 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5794 (SimpleName.SimpleNameResolve): Update.
5795 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5796 (MemberAccess.IdenticalNameAndTypeName): Update.
5797 * doc.cs (FindDocumentedTypeNonArray): Update.
5799 2005-03-03 Raja R Harinath <rharinath@novell.com>
5801 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5802 * parameters.cs (ComputeAndDefineParameters): Remove.
5803 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5804 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5805 Use GetParameterInfo.
5807 2005-03-02 Marek Safar <marek.safar@seznam.cz>
5809 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5811 2005-03-02 Raja R Harinath <rharinath@novell.com>
5813 Unify DeclSpace.LookupType and DeclSpace.FindType.
5814 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
5815 is in charge of defining nested types on demand.
5816 (DeclSpace.LookupType): Use it when the current_type is a
5817 TypeBuilder. Use LookupTypeDirect for reflected types.
5818 (DeclSpace.FindType): Remove.
5819 (DeclSpace.LookupInterfaceOrClass): Likewise.
5820 (DeclSpace.DefineTypeAndParents): Likewise.
5821 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5822 DeclSpace.LookupType.
5823 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5824 * typemanager.cs (LookupType): Simplify.
5825 (AddUserType): Remove type from negative_hits.
5826 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5827 * class.cs (TypeContainer.FindMembers): Move handling of nested
5829 (TypeContainer.FindMembers_NestedTypes): ... here.
5830 (TypeContainer.FindNestedType): Implement override.
5831 (ClassPart.FindNestedType): Delegate to PartialContainer.
5832 (ClassPart.PartFindNestedType): Looks up the nested types of the
5835 2005-03-02 Martin Baulig <martin@ximian.com>
5837 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5838 static constructor in static classes.
5840 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
5842 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5843 sizeParamIndex is not specified.
5845 2005-03-01 Marek Safar <marek.safar@seznam.cz>
5848 * report.cs (WarningMessage.IsEnabled): Missing null check.
5850 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5852 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5853 in the fields and not in the properties.
5855 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
5857 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
5860 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5862 * attribute.cs: Small refactoring (improved robustness).
5863 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5864 (ValidateGuid): Removed.
5865 (Resolve): Removed referenced to above mentioned.
5866 (GetAttributeUsage): Made private and changed to work without
5868 (GetIndexerAttributeValue): Don't crash.
5869 (GetConditionalAttributeValue): Ditto.
5870 (GetClsCompliantAttributeValue): Ditto.
5871 (ExtractSecurityPermissionSet): All attributes exceptions are
5873 (GetPropertyValue): New helper.
5874 (GetMethodImplOptions): New method.
5875 (DefinePInvokeMethod): Reuse common code. Implemented handling of
5876 some missing properties.
5878 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5879 (Method.ApplyAttributeBuilder): Updated.
5881 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5884 2005-02-28 Raja R Harinath <rharinath@novell.com>
5887 * report.cs (Report.SymbolRelatedToPreviousError): Handle
5888 non-simple types (array, pointer, reference).
5890 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5892 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5894 * class.cs (MethodCore.IsDuplicateImplementation): Special error
5896 (Method.CheckBase): Catch wrong destructor here.
5897 (MethodData.Define): Add errors 550, 668.
5899 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5901 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5903 * pending.cs (VerifyPendingMethods): Add error 551.
5905 * typemanager.cs (CSharpName): Next error report helper.
5907 2005-02-25 Marek Safar <marek.safar@seznam.cz>
5909 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5910 attributes. Removed useless attribute double check.
5911 It saves almost 2MBs for corlib.
5913 2005-02-25 Raja R Harinath <rharinath@novell.com>
5916 * statement.cs (ExpressionStatement.Resolve): Make robust to being
5917 called twice in case of error.
5919 2005-02-23 Chris Toshok <toshok@ximian.com>
5921 Fix compiler portions of #72827.
5922 * statement.cs (Block.Emit): call Begin/EndScope on the
5923 EmitContext instead of the ILGenerator.
5925 * codegen.cs (EmitContext.BeginScope): new method, call
5926 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5928 (EmitContext.BeginScope): same, but EndScope and CloseScope
5930 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5931 offset and call the superclass's OpenScope(int) with it.
5932 (SymbolWriter.CloseScope): get the current il
5933 offset and call superclass's CloseScope(int) with it.
5935 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5937 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5938 CS1677 for out and ref as well.
5940 * class.cs (Method.Define): Add error CS1599 detection.
5942 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5944 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5946 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5948 * support.cs.cs (ModifierDesc): New helper method.
5950 2005-02-23 Raja R Harinath <rharinath@novell.com>
5951 Abin Thomas <projectmonokochi@rediffmail.com>
5952 Anoob V E <projectmonokochi@rediffmail.com>
5953 Harilal P R <projectmonokochi@rediffmail.com>
5956 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5957 MemberLookup (used for error reporting) actually returns a result.
5958 Fix error report number (122, not 112).
5960 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5961 Anoob V E <projectmonokochi@rediffmail.com>
5962 Harilal P R <projectmonokochi@rediffmail.com>
5965 * pending.cs (PendingImplementation.GetAbstractMethods):
5966 Find NonPublic members too.
5968 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5970 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5973 * class.cs (MethodCore.CheckMethodAgainstBase):
5974 Add error 239 report.
5976 2005-02-21 Raja R Harinath <rharinath@novell.com>
5979 * expression.cs (Invocation.IsApplicable): Make public.
5980 (Invocation.IsParamsMethodApplicable): Likewise.
5981 * delegate.cs (Delegate.VerifyApplicability): Don't use
5982 Invocation.VerifyArgumentCompat for parameter applicability
5983 testing. Use Invocation.IsApplicable and
5984 Invocation.IsParamsMethodApplicable.
5986 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5988 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5990 * class.cs (Operator.Define): Add error 217 report.
5992 2005-02-21 Raja R Harinath <rharinath@novell.com>
5994 * namespace.cs (UsingEntry.Resolve): Undo change below.
5996 2005-02-21 Raja R Harinath <rharinath@novell.com>
5999 * ecore.cs (Expression.MemberLookupFailed): Add argument to
6000 disable the error message when the extended MemberLookup also
6002 (Expression.MemberLookupFinal): Update.
6003 (SimpleName.DoSimpleNameResolve): Update.
6004 * expression.cs (MemberAccess.ResolveNamespaceOrType):
6005 Don't use MemberLookupFinal.
6006 (New.DoResolve): Update.
6007 (BaseAccess.CommonResolve): Update.
6009 2005-02-21 Raja R Harinath <rharinath@novell.com>
6012 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6013 occured previously, don't resolve again.
6015 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6018 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6019 argument. Call ResolveAttributeUsage for unresolved.
6020 when types doesn't match ctor arguments.
6022 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6023 for nested attribute classes.
6024 (Class.attribute_usage): Removed.
6025 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6026 for attribute class.
6028 * ecore.cs (IsAttribute): Removed.
6030 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6032 * rootcontext.cs (RegisterAttribute): Removed, attributes are
6034 (attribute_types): Removed.
6035 (EmitCode): Global attributes are emited as the latest.
6037 2005-02-18 Marek Safar <marek.safar@seznam.cz>
6039 * class.cs (EmitFieldInitializers): Don't emit field initializer
6040 for default values when optimilization is on.
6042 * constant.cs (Constant.IsDefaultValue): New property.
6044 * driver.cs: Add /optimize handling.
6048 * literal.cs: Implement new IsDefaultValue property.
6050 * rootcontext.cs (Optimize): New field, holds /optimize option.
6052 2005-02-18 Raja R Harinath <rharinath@novell.com>
6054 Fix crasher in re-opened #72347.
6055 * namespace.cs (Namespace.Lookup): Return null if
6056 DeclSpace.DefineType returns null.
6059 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6061 2005-02-18 Raja R Harinath <rharinath@novell.com>
6063 Fix remainder of #63202. Change semantics of DoResolveLValue: it
6064 now returns null if it cannot resolve to an lvalue.
6065 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6066 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6067 returned null. Remove check for SimpleName.
6068 (EventExpr.DoResolveLValue): New.
6069 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6070 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
6072 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
6074 (Unary.ResolveOperator): Move CS0211 check ...
6075 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
6077 (Unary.DoResolveLValue): Simplify.
6078 (AddressOf.DoResolveLValue): New.
6079 (ArrayAccess.DoResolveLValue): New.
6081 2005-02-16 Marek Safar <marek.safar@seznam.cz>
6083 * attribute.cs (Attribute.Resolve): Add arguments casting for
6084 when types doesn't match ctor arguments.
6086 2005-02-16 Raja R Harinath <rharinath@novell.com>
6088 Fix parts of #63202.
6089 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6090 lookup of operator in base type. Ensure that all checks happen
6091 when the operator resolves to an "op_..." method.
6093 2005-02-15 Raja R Harinath <rharinath@novell.com>
6096 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6097 'ignore_cs0104' parameter. Pass it to ...
6098 (NamespaceEntry.Lookup): ... this.
6099 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6100 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6101 (TypeLookupExpression.DoResolveAsTypeStep): Update.
6102 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6103 Update. Request that cs0104 errors be ignored.
6104 (ComposedCast.ResolveAsTypeStep): Update.
6106 2005-02-14 Raja R Harinath <rharinath@novell.com>
6109 * expression.cs (Invocation.BetterFunction): Remove support for
6110 comparing virtual functions and their overrides.
6111 (Invocation.IsOverride): New.
6112 (Invocation.OverloadResolve): Don't consider 'override' functions
6113 during candidate selection. Store them in a lookaside list.
6114 If the selected method is a 'virtual' function, use the list to
6115 find any overrides that are closer to the LHS type.
6117 2005-02-14 Marek Safar <marek.safar@seznam.cz>
6119 * expression.cs (New.DoResolve): Add complex core type reduction.
6120 (New.Constantify): Converts complex core type syntax like 'new int ()'
6123 2005-02-14 Raja R Harinath <rharinath@novell.com>
6125 * decl.cs (EntryType.EntryType): New constructor to create an
6126 updated copy of a cache entry.
6127 (MemberCache.AddMethods): Use it.
6128 (MemberCache.ClearDeclaredOnly): Remove.
6129 (MemberCache.MemberCache): Update.
6131 2005-02-11 Miguel de Icaza <miguel@novell.com>
6133 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6134 variable. This one is represents the actual low-level declaration
6135 of the method, as opposed to the semantic level `IsStatic'.
6137 An anonymous method which is hosted into a static method might be
6138 actually an instance method. IsStatic would reflect the
6139 container, while MethodIsStatic represents the actual code
6142 * expression.cs (ParameterReference): Use the new MethodIsStatic
6143 instead of IsStatic.
6145 * anonymous.cs (AnonymousMethod.Compatible): Pass the
6146 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6147 set on the current EmitContext.
6149 * expression.cs (Cast): Overload DoResolveLValue so we can pass
6150 resolve our casted expression as an LValue. This triggers the
6151 proper LValue processing that is later required by Assign.
6155 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6157 2005-02-11 Marek Safar <marek.safar@seznam.cz>
6159 C# 2.0 Fixed buffer implementation
6161 * anonymous.cs: Update after RegisterHelperClass renaming.
6163 * attribute.cs (AttributeTester.fixed_buffer_cache):
6164 Cache of external fixed buffers.
6165 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6166 implementation if field is fixed buffer else null.
6169 (TypeContainer.AddField): Accept FieldMember instead of Field.
6170 (FieldBase.IsFieldClsCompliant): Extracted code from
6171 VerifyClsCompliance descendant customization.
6172 (FixedField): New class handles fixed buffer fields.
6173 (FixedFieldExternal): Keeps information about imported fixed
6175 (IFixedField): Make access to internal or external fixed buffer
6178 * cs-parser.jay: Add fixed buffer parsing.
6180 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6183 * expression.cs (Indirection): Extended implementation to accept
6185 (PointerArithmetic.Emit): Get element from fixed buffer as well.
6186 (ElementAccess.MakePointerAccess): Get type as parameter.
6187 (DoResolve): Add fixed buffer field expression conversion.
6188 (DoResolveLValue): Ditto.
6189 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6190 (ArrayPtr): Derives from FixedBufferPtr.
6191 (ArrayPtr.Emit): Add extra emit for array elements.
6193 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6195 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6196 for compiler generated types.
6197 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6199 * statement.cs (Fixed): Refactored to be easier add fixed buffer
6200 and consume less memory.
6201 (Fixed.Resolve): Add fixed buffer case.
6203 * typemanager.cs (compiler_generated_attr_ctor,
6204 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6205 (HasElementType): Add our own implementation to work on every
6208 2005-02-11 Miguel de Icaza <miguel@novell.com>
6210 * anonymous.cs (CaptureContext): Track whether `this' has been
6213 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
6214 only captured `this' if it was implicitly done (instance
6215 methods/variables were used).
6217 * codegen.cs (EmitContext.CaptureThis): New method to flag that
6218 `this' must be captured.
6220 2005-01-30 Miguel de Icaza <miguel@novell.com>
6222 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6223 is null it means that there has been no need to capture anything,
6224 so we just create a sibling.
6226 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6228 Just a partial fix. The other half is fairly elusive.
6230 2005-02-10 Raja R Harinath <rharinath@novell.com>
6232 Fix #52586, cs0121-4.cs.
6233 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
6234 and return a hashtable.
6235 (MemberCache.ClearDeclaredOnly): New.
6236 (MemberCache.MemberCache): Update to change. Make a deep copy of
6237 the method_hash of a base type too.
6238 (MemberCache.AddMethods): Adapt to having a deep copy of the base
6239 type methods. Overwrite entries with the same MethodHandle so
6240 that the ReflectedType is correct. The process leaves in base
6241 virtual functions and their overrides as distinct entries.
6242 (CacheEntry): Now a class instead of a struct. It shouldn't alter
6243 matters since it was boxed in a ArrayList before.
6244 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6246 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
6247 case of a virtual function and its override (choose the overload
6249 (Invocation.OverloadResolve): Avoid 'override' members during
6250 'applicable_type' calculation.
6252 2005-02-09 Raja R Harinath <rharinath@novell.com>
6254 Combine two near-redundant caches.
6255 * typemanager.cs (method_params): Rename from method_internal_params.
6256 (TypeManager.GetParameterData): New. Replace
6257 Invocation.GetParameterData.
6258 (TypeManager.LookupParametersByBuilder): Remove.
6259 * expression.cs (Invocation.method_parameter_cache): Remove.
6260 (Invocation.GetParameterData): Remove.
6262 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6265 2005-02-08 Raja R Harinath <rharinath@novell.com>
6268 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6269 TypeManager.multicast_delegate_type is null, resolve it by looking
6270 up "System.MulticastDelegate".
6271 * rootcontext.cs (RootContext.ResolveCore): Simplify.
6273 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
6274 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
6275 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
6278 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6279 (LabeledStatement.AddReference): New. Set 'referenced'.
6280 (Goto.Resolve): Use it.
6282 2005-02-05 John Luke <john.luke@gmail.com>
6284 * driver.cs: remove duplicate -doc line in Usage ()
6286 2005-02-04 Raja R Harinath <rharinath@novell.com>
6288 * location.cs (Location.AddFile): Fix CS2002 error report.
6290 2005-02-02 Martin Baulig <martin@ximian.com>
6292 * delegate.cs (Delegate.DefineType): Report an internal error if
6293 TypeManager.multicast_delegate_type is null. See bug #72015 for
6296 2005-02-02 Raja R Harinath <rharinath@novell.com>
6298 Fix a crasher in a variant of #31984.
6299 * const.cs (Constant.CheckBase): New override that defers the
6300 new-or-override check in case the base type hasn't been populated
6302 (Constant.Define): Ensure the new-or-override check is performed.
6304 2005-02-01 Duncan Mak <duncan@ximian.com>
6306 * const.cs (LookupConstantValue): Check that `ce' is not null
6307 before calling GetValue ().
6309 2005-02-01 Raja R Harinath <rharinath@novell.com>
6311 Fix test-334.cs (#69519).
6312 * cs-parser.jay (using_alias_directive): Pass in an expression to
6313 NamespaceEntry.UsingAlias.
6314 (using_namespace_directive): Pass in an expression to
6315 NamespaceEntry.Using.
6316 (namespace_name): Don't flatten to a string.
6317 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6318 (NamespaceEntry.AliasEntry.Resolve): Lookup using
6320 (NamespaceEntry.UsingEntry): Likewise.
6321 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6323 (NamespaceEntry.LookupForUsing): Remove.
6324 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6326 (NamespaceEntry.Lookup): Remove support for dotted names.
6328 2005-02-01 Raja R Harinath <rharinath@novell.com>
6330 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6332 (NamespaceEntry.ImplicitParent): Compute on demand.
6333 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6334 parallels the current.
6335 (NamespaceEntry.LookupForUsing): Use it.
6336 (NamespaceEntry.Lookup): If the current namespace-entry is
6337 implicit, don't search aliases and using tables.
6339 2005-02-01 Raja R Harinath <rharinath@novell.com>
6342 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6344 (TypeContainer.BaseCache): Compute on demand.
6345 (TypeContainer.FindMembers): Define constants and types if they're
6346 not already created.
6347 (FieldMember.Define): Move resetting of ec.InUnsafe before error
6349 * const.cs (Constant.Define): Make idempotent.
6351 2005-01-29 Miguel de Icaza <miguel@novell.com>
6353 * pending.cs: Produce better code (no nops produced by using Ldarg
6356 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6357 i - 1' it should be arg + 1.
6361 2005-01-28 Raja R Harinath <rharinath@novell.com>
6363 * attribute.cs (Attribute.CheckAttributeType): Make private
6365 (Attribute.ResolveType): Make virtual.
6366 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6367 handling of RootContext.Tree.Types.
6369 2005-01-27 Raja R Harinath <rharinath@novell.com>
6371 Update attribute-handling to use the SimpleName/MemberAccess
6373 * cs-parser.jay (attribute): Pass in an expression to the
6374 constructors of Attribute and GlobalAttribute.
6375 * attribute.cs (Attribute): Take an expression for the name.
6376 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
6377 passed in attribute name expression.
6378 (Attribute.CheckAttributeType): Use it.
6379 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6380 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6381 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
6382 argument to prevent error messages if the lookup fails.
6384 2005-01-27 Marek Safar <marek.safar@seznam.cz>
6386 * expression.cs (Indirection): Implemented IVariable interface
6387 to support indirection in AddressOf operator.
6388 (PointerArithmetic.Emit): Add optimalization for case where
6389 result can be precomputed.
6391 2005-01-26 Martin Baulig <martin@ximian.com>
6393 * class.cs (TypeContainer.AttributeTargets): Return the correct
6394 AttributeTargets depending on our `Kind' instead of throwing an
6395 exception; fixes #71632.
6397 2005-01-26 Marek Safar <marek.safar@seznam.cz>
6400 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6403 2005-01-25 Raja R Harinath <rharinath@novell.com>
6406 * expression.cs (MemberAccess.DoResolve): Don't complain with
6407 cs0572 when the LHS of a member access has identical name and type
6410 2005-01-25 Marek Safar <marek.safar@seznam.cz>
6413 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6415 Create custom PermissionSet only for PermissionSetAttribute.
6417 2005-01-24 Marek Safar <marek.safar@seznam.cz>
6420 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6421 delegates in static class.
6423 2005-01-24 Martin Baulig <martin@ximian.com>
6425 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6426 merging an implicit block, just use its reachability.
6428 * statement.cs (Block.Resolve): Make the unreachable code check
6429 work wrt. implicit blocks; see test-337 from #63842.
6431 2005-01-21 Alp Toker <alp@atoker.com>
6433 * cs-parser.jay: destructor_declaration's container is PartialContainer
6434 not Class when partial types are used, so use Kind prop instead of
6437 2005-01-22 Miguel de Icaza <miguel@ximian.com>
6439 * cs-parser.jay: Improve error reporting when an interface
6442 2005-01-20 Dick Porter <dick@ximian.com>
6444 * support.cs: SeekableStreamReader fix from Sandor Dobos
6445 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6446 chars are read. Fixes bug 70369.
6448 2005-01-20 Raja R Harinath <rharinath@novell.com>
6450 * cs-parser.jay (catch_clause): Simplify current_block handling
6453 2005-01-17 Miguel de Icaza <miguel@ximian.com>
6455 * convert.cs (ImplicitStandardConversionExists): Synchronize the
6456 code with ImplicitStandardConversion to handle the implicit
6457 conversion of method groups into valid delegate invocations.
6459 The problem is that in parameter handling we were using this code
6460 path. Fixes bug #64698
6462 2005-01-19 Raja R Harinath <rharinath@novell.com>
6464 * cs-parser.jay: Fix several infelicities.
6465 - Avoid assigning to the parser value stack. Code like
6466 '$3 = null' is unclean. Synthesize a value for the code block
6468 - Avoid using oob_stack for storing location information. Use ...
6469 (_mark_): ... this. New (empty) rule. Saves the current location
6471 (foreach_statement): Avoid using oob_stack for current_block
6472 handling. Use technique used in for_statement and
6473 using_statement. Synthesize a value for the code block to store
6474 additional intermediate information.
6476 2005-01-13 Miguel de Icaza <miguel@ximian.com>
6478 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6479 of a different type is only allowed to private fields of a
6480 containing type, not on fields of a base class.
6482 See test-174.cs and error cs0122-9.cs
6484 2005-01-13 Raja R Harinath <rharinath@novell.com>
6486 Fix test-335.cs (bug #58126).
6487 * cs-parser.jay (argument): Split out non-expression parts of the
6488 rule into 'non_simple_argument'.
6489 (invocation_expression): Support parenthesized invocations with
6490 multiple arguments, and with single non-simple arguments.
6492 2005-01-13 Raja R Harinath <rharinath@novell.com>
6494 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6497 2005-01-12 Raja R Harinath <rharinath@novell.com>
6499 Fix cs0038-1.cs, cs1640-6.cs.
6500 * ecore.cs (Expression.Resolve): Remove special-case for
6501 SimpleName in error-handling.
6502 (Expression.almostMatchedMembers): Relax access permission to
6504 (Expression.MemberLookupFailed): Handle duplicates in
6505 almostMatchedMembers list.
6506 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6507 * expression.cs (New.DoResolve): Report CS1540 for more cases.
6508 * typemanager.cs (GetFullNameSignature): Use the MethodBase
6509 overload if the passed in MemberInfo is a MethodBase.
6511 2005-01-12 Marek Safar <marek.safar@seznam.cz>
6514 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6515 for non-CAS & merge permission sets properly.
6517 2005-01-11 Raja R Harinath <rharinath@novell.com>
6519 Improve standard-compliance of simple name and member access
6520 resolution. Fixes bugs #52697, #57200, #67520, #69519.
6521 * ecore.cs (FullNamedExpression): New abstract base class
6522 for Namespaces and TypeExpressions.
6523 (ResolveFlags.SimpleName): Remove.
6524 (SimpleName): Remove support for dotted names.
6525 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
6526 DeclSpace.FindType and DeclSpace.LookupType.
6527 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6528 (Expression.ExprClassName): Make member function.
6529 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6530 a namespace. Remove creation of dotted "SimpleName"s.
6531 (MemberAccess.DoResolve): Likewise.
6532 * decl.cs (DeclSpace.Cache): Make private.
6533 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6534 (DeclSpace.FindType): Update.
6535 (DeclSpace.LookupType): Move here from RootContext. Return a
6536 FullNamedExpression.
6537 * namespace.cs (Namespace): Derive from FullNamedExpression
6538 so that it can be part of expression resolution.
6539 (Namespace.Lookup): Return an FullNamedExpression.
6540 (NamespaceEntry.LookupAlias): Lookup aliases only in current
6542 * rootcontext.cs (NamespaceLookup): Remove.
6543 (LookupType): Move to DeclSpace.
6544 * attribute.cs (CheckAttributeType): Update.
6545 * doc.cs (FindDocumentedType): Remove allowAlias argument.
6546 (FindDocumentedTypeNonArray): Likewise.
6548 2005-01-11 Raja R Harinath <rharinath@novell.com>
6550 Fix cs0509.cs, cs1632.cs.
6551 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6552 is the same as IsInterface.
6553 (TypeContainer.GetClassBases): Likewise.
6554 * statement.cs (LabeledStatement.ig): New field.
6555 (LabeledStatement.LabelTarget): Save ILGenerator which created the
6557 (LabeledStatement.DoEmit): Check that the label was created with
6558 the same ILGenerator.
6560 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6563 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6564 accessors to its properties.
6566 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6567 from accessors to property.
6569 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6572 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6575 2005-01-08 Miguel de Icaza <miguel@ximian.com>
6577 * attribute.cs: Check for null and empty strings.
6579 I have lost another battle to Paolo.
6581 2005-01-07 Marek Safar <marek.safar@seznam.cz>
6584 * class.cs (PropertyMethod): Set Parent field in ctors.
6585 (SetMethod.InternalParameters): Add unsafe switch hack.
6586 Override MarkForDuplicationCheck where it is appropriate.
6588 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6589 It says whether container allows members with the same name.
6591 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6592 Removed is_method parameter.
6594 2005-01-06 Duncan Mak <duncan@ximian.com>
6596 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6597 because the previous change led to incorrect reporting of CS1032
6598 ("Cannot define/undefine preprocessor symbols after first token in
6599 file"). Instead of using `tokens_seen' as the only flag that
6600 triggers CS1040, introduce `comments_seen'. This new flag is used
6601 to signify having seen comments on the current line, so it is
6602 unset after a newline.
6604 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6606 * doc.cs : When searching for a type, find nested type too.
6607 This fixes bug #71040.
6609 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6612 - Warn missing member comment on those classes which also does not
6613 have doc comments. Fixed bug #71041.
6614 - Don't warn missing doc comment on default constructor.
6617 2005-01-06 Duncan Mak <duncan@ximian.com>
6619 * cs-tokenizer.cs (xtoken): After handling traditional C-style
6620 comments, set `tokens_seen' to true. This allows us to detect
6621 misplaced preprocessor directives (i.e. not at the beginning of
6622 the a line, nor after whitespaces). In that case, report error
6623 CS1040. This fixes bug #56460.
6625 * cs-parser.jay (interface_member_declaration): Add checks for
6626 IsExplicitImpl, and report CS0541 error if an interface member is
6627 defined as an explicit interface declaration.
6629 2005-01-06 Marek Safar <marek.safar@seznam.cz>
6632 * class.cs (PropertyMethod): Set Parent field in ctors.
6633 (SetMethod.InternalParameters): Add unsafe switch hack.
6635 * decl.cs (MemberCore.Parent): Cannot be readonly.
6637 2005-01-06 Raja R Harinath <rharinath@novell.com>
6639 * decl.cs (DeclSpace.ResolveType): Remove.
6640 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6641 Merge in code from ...
6642 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
6643 * class.cs, enum.cs: Update to changes.
6645 2005-01-06 Miguel de Icaza <miguel@ximian.com>
6647 * anonymous.cs: Ensure that we init the scope of our parent if it
6648 has not been initialized yet.
6650 2004-12-30 Duncan Mak <duncan@ximian.com>
6652 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6653 if field.FieldBuilder is null. Fixes #70758.
6655 * convert.cs: Fixed some typos and updated some of the comments.
6656 (ImplicitStandardConversionExists):
6657 (TryImplicitIntConversion): If `target_type' is an interface and
6658 the type of `ic' implements this interface, return true or a new
6659 BoxedCast instead of null. This fixes #70468.
6661 2004-12-29 Duncan Mak <duncan@ximian.com>
6663 * expression.cs (Argument.Emit): Check that Expr is
6664 IMemoryLocation before casting to it, and report CS1510 otherwise.
6668 2004-12-21 Ben Maurer <bmaurer@ximian.com>
6670 * statement.cs (Block.ThisVariable): remove the recursion here, to
6671 make the --profile more sane.
6673 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
6675 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6676 assembly, by JB Evain.
6678 2004-12-17 Raja R Harinath <rharinath@novell.com>
6680 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
6681 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6682 "parent" refers to enclosing type/class. "base" refers to superclass.
6684 2004-12-17 Raja R Harinath <rharinath@novell.com>
6686 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6687 Ensure that we only have GlobalAttributes.
6688 * attribute.cs (Attribute.Emit): Make non-virtual.
6689 (GlobalAttribute.Emit): Remove.
6690 (Attribute.Resolve): Make virtual.
6691 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
6692 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6693 the argument. Don't create one.
6694 (Attribute.GetObsoleteAttribute): Likewise.
6695 (Attribute.GetClsCompliantAttributeValue): Likewise.
6696 * class.cs, decl.cs: Update to changes.
6698 2004-12-17 Marek Safar <marek.safar@seznam.cz>
6700 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6702 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6704 * statement.cs (Foreach.Resolve): Add error 186 report.
6706 2004-12-16 Marek Safar <marek.safar@seznam.cz>
6708 * expression.cs (Conditional.DoResolve): Add warning 429.
6710 * statement.cs (If.Resolve): Add warning 665.
6712 2004-12-16 Raja R Harinath <rharinath@novell.com>
6714 New invariant: RootContext.Tree.Types.NamespaceEntry == null
6715 except when in the parser, and in GlobalAttribute.
6716 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6717 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6718 RootContext.Tree.Types.NamespaceEntry once work is done.
6719 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
6720 and resets RootContext.Tree.Types.NamespaceEntry.
6722 2004-12-15 Marek Safar <marek.safar@seznam.cz>
6724 * cs-parser.jay: Don't create a block for every variable.
6726 2004-12-14 Miguel de Icaza <miguel@ximian.com>
6728 * location.cs: Provide extra information.
6730 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6731 variables from the captured environment, it is the ldarg_0.
6733 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6735 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6738 * class.cs: Changed warning level for 169 to avoid developer
6739 displeasure from warning flooding. It will be changed back when they
6740 fix most of current BCL warnings.
6742 * RootContext.cs: Pushed default WarningLevel to 3.
6744 * statement.cs: Removed unused variable.
6746 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6748 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6749 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6750 Add error 502 report.
6751 (StaticClass.DefineType): Add error 441 report.
6752 (Class.AllowedModifiersProp): New virtual property as temporary
6753 extension to AllowedModifiers.
6754 (Class.DefineType): Add error 418 report. Moved ModFlags check here
6755 to share implementation with StaticClass and don't call virtual
6758 * driver.cs (MainDriver): Add error 1558 test.
6760 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6761 report. Moved error 36 test here.
6763 * statement.cs (Throw.Resolve): Add error 724 report.
6765 * typemanager.cs: Add out_attribute_type core type.
6767 2004-12-13 Marek Safar <marek.safar@seznam.cz>
6769 * class.cs (TypeContainer.VerifyClsCompliance): Add error
6771 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6773 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6776 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6778 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
6779 Add error 3023 report.
6780 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6782 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6785 2004-12-12 John Luke <john.luke@gmail.com>
6787 * driver.cs (AddArgs): take -- into account when
6788 adding arguments, fixes bug 65710
6790 2004-12-12 Martin Baulig <martin@ximian.com>
6792 * expression.cs (Unary.TryReduceNegative): Added support for
6793 SByteConstant and ByteConstant.
6794 (Unary.Reduce): Check error values from TryReduceNegative().
6796 2004-12-10 Marek Safar <marek.safar@seznam.cz>
6798 * attributes.cs (Attribute.Resolve): Avoid multiple error report
6799 and report exception as error 182.
6801 2004-12-10 Raja R Harinath <rharinath@novell.com>
6803 * driver.cs (Main): Fix message when there are warnings.
6805 2004-12-09 Miguel de Icaza <miguel@ximian.com>
6807 * delegate.cs: Fixed my fix from yesterday, sorry about that.
6809 2004-12-09 Marek Safar <marek.safar@seznam.cz>
6811 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
6812 Reduced number of warnings.
6814 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6816 2004-12-08 Miguel de Icaza <miguel@ximian.com>
6818 * driver.cs: Removed message.
6820 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6822 2004-12-08 <vargaz@freemail.hu>
6824 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6826 2004-12-08 Martin Baulig <martin@ximian.com>
6828 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6829 instead of a CS3002 for properties and indexer.
6831 2004-12-08 Martin Baulig <martin@ximian.com>
6833 * decl.cs (MemberName.ToString): Make this work again.
6835 2004-12-08 Marek Safar <marek.safar@seznam.cz>
6837 * attribute.cs (Resolve): Add error 591 detection.
6839 * class.cs (FieldMember.Define): Add error 1547 detection.
6840 (Indexer.Define): Add error 620 detection.
6841 (Operator.Define): Add error 590 detection.
6843 * ecore.cs: Missing argument for error 79.
6845 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6848 2004-12-07 Marek Safar <marek.safar@seznam.cz>
6851 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6854 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6856 * cs-parser.jay : handle doc comments on implicit/explicit operators.
6857 Some operator comments were suppressed.
6858 * doc.cs : Implicit/explicit operator name in doc comments are like
6859 "op_Explicit(type)~returnType", so added suffix handling.
6861 2004-12-07 Martin Baulig <martin@ximian.com>
6864 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6865 (MemberCore.GetClsCompliantAttributeValue): Likewise.
6866 (DeclSpace.ec): New protected field; store the EmitContext here.
6867 (DeclSpace.EmitContext): New public property; moved here from
6869 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6872 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6873 (Enum.Emit): Don't create a new EmitContext.
6875 * delegate.cs (Delegate.DefineType): Always create the
6878 * iterators.cs (Iterators.DefineIterator): Create a new
6879 EmitContext and store it in `ec'.
6881 2004-08-24 Martin Baulig <martin@ximian.com>
6884 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6885 this for accessibility checks.
6886 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6887 IsNestedFamilyAccessible.
6888 (TypeManager.IsSubclassOf): New method, do what the name actually
6891 2004-12-06 Raja R Harinath <rharinath@novell.com>
6893 Fix crash on cs0657-17.cs.
6894 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6895 Use RootContext.Tree.Types, not 'new RootTypes ()'.
6896 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6897 the case where the NamespaceEntry gets overwritten.
6899 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6901 Fixed #69195, #56821
6902 * ecore.cs (ResolveBoolean): Tiny refactoring.
6904 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6905 of right expression resolving when left is false constant and
6906 operator is LogicalAnd OR true constant and operator is LogicalOr.
6908 * statement.cs (ResolveUnreachable): Always reports warning.
6910 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6912 * class.cs: Distinguish between 1721 and 1722 (just a little help
6913 for the programmer).
6915 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6917 * delegate.cs: Only allow this on new versions of the language.
6919 2004-12-02 Duncan Mak <duncan@ximian.com>
6921 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6923 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6924 here as a static method. Take an additional bool out parameter
6925 `must_do_cs1540_check' for signaling to InstanceResolve.
6926 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6927 member field from PropertyExpr class and made it an argument of
6929 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6930 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6931 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6932 and `remove_accessor' as well as InstanceResolve: report CS0122
6937 2004-12-03 Raja R Harinath <rharinath@novell.com>
6939 Fix test-327.cs, test-328.cs, and put in early infrastructure
6940 for eventually fixing #52697.
6941 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6942 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6944 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6945 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6946 (VerifyUsing, error246): Update.
6947 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6948 'NamespaceEntry.LookupNamespaceOrType'.
6950 2004-12-03 Martin Baulig <martin@ximian.com>
6952 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6953 method as our child, call AnonymousMethod.Compatible() on it.
6955 2004-12-03 Raja R Harinath <rharinath@novell.com>
6957 Disable XML documentation support in 'basic' profile.
6958 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6959 Redirect XmlElement to System.Object.
6960 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6961 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6962 * mcs.exe.sources: Add doc-bootstrap.cs.
6963 * doc-bootstrap.cs: New file. Contains empty stub implementation
6966 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6968 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6969 comments are allowed.
6971 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6973 * delegate.cs: Add checks for subtypes in paramaters and return values
6974 in VerifyMethod () to add support for Covariance/Contravariance
6977 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6979 * report.cs: Remove extra closing parenthesis.
6981 * convert.cs (Error_CannotImplicitConversion): If the name of the
6982 types are the same, provide some extra information.
6984 * class.cs (FieldBase): Use an unused bit field from the field to
6985 encode the `has_offset' property from the FieldMember. This saves
6986 a couple of Ks on bootstrap compilation.
6988 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6989 method as our child, return the AnonymousMethod resolved
6992 * expression.cs (New.DoResolve): Allow return values from
6993 NewDelegate to also include AnonymousMethods.
6997 2004-12-02 Marek Safar <marek.safar@seznam.cz>
7000 * attribute.cs (Resolve): Improved implementation of params
7001 attribute arguments.
7003 * support.cs (ParameterData): Add HasParams to be faster.
7005 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
7007 all things are for /doc support:
7009 * doc.cs: new file that supports XML documentation generation.
7010 * mcs.exe.sources: added doc.cs.
7012 Handle /doc command line option.
7013 Report error 2006 instead of 5 for missing file name for /doc.
7014 Generate XML documentation when required, after type resolution.
7016 Added support for picking up documentation (/// and /** ... */),
7017 including a new XmlCommentState enumeration.
7019 Added lines to fill Documentation element for field, constant,
7020 property, indexer, method, constructor, destructor, operator, event
7021 and class, struct, interface, delegate, enum.
7022 Added lines to warn incorrect comment.
7024 Added Documentation field (passed only when /doc was specified).
7026 Added DocComment, DocCommentHeader, GenerateDocComment() and
7027 OnGenerateDocComment() and some supporting private members for
7028 /doc feature to MemberCore.
7030 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7032 Added overriden DocCommentHeader.
7034 Added overriden DocCommentHeader and GenerateDocComment().
7036 2004-12-01 Miguel de Icaza <miguel@ximian.com>
7038 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7039 unwrapping the enumeration values, chain to
7040 DoConstantNumericPromotions again, so we can promote things to the
7041 fundamental types (takes care of enums that are bytes, sbytes).
7045 2004-12-01 Raja R Harinath <rharinath@novell.com>
7047 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7048 Fix long-standing bug in type-lookup. Use FindType instead of
7049 LookupType when ec.ResolvingTypeTree.
7050 (Attribute.ResolveType, Attribute.Resolve)
7051 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7053 (Attributes.Search): Remove internal version. Update.
7054 (Attributes.SearchMulti): Update.
7055 (Attributes.GetClsCompliantAttribute): Remove.
7056 (Attributes.GetIndexerNameAttribute): Remove.
7057 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7058 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7059 * class.cs (Indexer.Define): Likewise.
7061 2004-12-01 Marek Safar <marek.safar@seznam.cz>
7064 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7065 MarshallByReference members access.
7067 * expression.cs: Use CheckMarshallByRefAccess;
7068 Better error CS0197 message.
7070 * report.cs: Print whole related error message.
7072 2004-11-30 Raja R Harinath <rharinath@novell.com>
7074 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
7075 the current directory to help debugging.
7077 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7079 * class (GetClassBases): Better error 60 report.
7080 (EventProperty): Disabled warning 67 detection.
7082 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7085 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7087 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7090 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7093 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7095 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7097 2004-11-26 Miguel de Icaza <miguel@ximian.com>
7099 * attribute.cs (Attribute.Resolve): Refine error reporting and
7100 report a cs0117 if the identifier does not exist, to distinguish
7101 from 0617 which is a miss-use of the actual identifier.
7103 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7104 between cs0070 and cs0079.
7106 * class.cs (MemberBase.DoDefine): When reporting a wrong
7107 accessibility level, we use MethodCore to compare instead of
7108 Method (this was a regression in some refactoring effort).
7110 So now we correctly report cs0056 again.
7112 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7113 testing the target_type (which was known to be object_type) and
7114 not the source type (which is anonymous_method).
7116 Fixed reporting of error cs1660.
7118 * expression.cs (UserCast.Source): Expose the underlying cast.
7120 * statement.cs (Switch.SwitchGoverningType): Sort the list of
7121 allowed types to find a match to int32 first (most common).
7123 In addition, it ignores any ImplicitUserConversions that did an
7124 internal implicit conversion (as the switch statement allows only
7125 one integral conversion to exist).
7127 * class.cs (PartialContainer.Create): rename `name' to
7128 `member_name' for clarity. Then replace the string calls with a
7129 call to MemberName.GetPartialName, as now using
7130 MemberName.ToString is an error (this is due to the side effects
7131 it had, that were fixed in the past).
7133 This will restore the error reporting on a number of partial class
7134 errors that were missusing this (and getting an exception as a
7135 results, which is now just a plain textual warning, because
7136 yyparse debug output would crash otherwise).
7138 2004-11-26 Raja R Harinath <rharinath@novell.com>
7140 * Makefile (PROGRAM_INSTALL_DIR): Remove.
7142 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7144 * rootcontext.cs (LookupType): Make sure to cache lookups that
7145 don't give us a negative result. This saves about 5% of corlib
7148 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7150 * report.cs (AbstractMessage.Print): messages are sent to stderr
7152 * class.cs (TypeContainer.GetClassBases): It is an error to have a
7153 non-interface in the list of interfaces (at this point, either
7154 parent was properly set, or a base class is being listed in the
7155 interfaces section).
7157 This flags error 1722, and resolves the crash from bug 69259.
7159 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7161 * statement.cs (Using.EmitExpressionFinally): make this work right
7162 for valuetypes. Fixes 69926.
7164 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7166 * const.cs (Const.ChangeType): Cope with the "0 literal can be
7167 converted to an enum" here, before we try to change the underlying
7168 type. This code exists, but it is a different code path than the
7169 one used while encoding constants.
7171 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7172 old bug: when converting from the null literal to a pointer,
7173 return an EmptyCast, not the NullLiteral.
7175 This fixes #69921, the recent null_type changes probably made this
7178 (ImplicitReferenceConversionExists): In addition, resynchronized
7179 the code here, so it matches the same code in
7180 ImplicitReferenceConversionExists for the `from any class-type S
7181 to any interface-type T'.
7184 2004-11-25 Marek Safar <marek.safar@seznam.cz>
7186 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7188 2004-11-24 Miguel de Icaza <miguel@ximian.com>
7190 * cs-parser.jay: Use verbosity accordingly.
7192 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7194 * expression.cs (Unary.ResolveOperator): Do not report warning;
7195 AddressOf reads from variable.
7197 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7199 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7203 * attribute.cs (Attributable): Removed CheckTargets.
7204 (Attributes.Emit): Explicit attribute targets are tested here.
7206 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7207 not enabled for interfaces.
7209 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7210 (GetAssemblyName): Ouch next bug there.
7212 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7214 * expression.cs: Error 275 added.
7216 2004-11-23 Marek Safar <marek.safar@seznam.cz>
7218 Fix bug #69177 (Implemented decimal constant support)
7220 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7221 (BinaryFold): Add DecimalConstant.
7223 * const.cs (Define): Decimal constant
7225 (ChangeType): Add decimal type handling.
7226 (LookupConstantValue): Don't set value for decimal type but
7227 emit DecimalConstantAttribute. Needed for constant optimization.
7229 * constant.cs (ToDecimal): New method.
7230 (ConvertToDecimal): New method.
7231 (IntConstant): Implemented ConvertToDecimal.
7232 (DecimalConstant.Emit): Emit optimized version for decimals in
7235 * expression.cs (ResolveOperator): Changed order of constant
7236 reduction to work correctly with native types which have
7237 overloaded operators.
7238 (ResolveMemberAccess): Extract constant value from attribute
7241 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7243 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7244 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7245 (ChangeType): Decimal is special.
7246 (TypeToCoreType): Add decimal type.
7248 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7250 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7253 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7255 * class.cs (EventField.ApplyAttributeBuilder): Fix error
7258 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7260 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7262 * pending.cs (PendingImplementation): Grab only interfaces.
7264 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7266 * statement.cs (ForeachHelperMethods): Add location member and
7267 error 202 detection.
7269 2004-11-19 Raja R Harinath <rharinath@novell.com>
7271 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
7272 automatically handled by executable.make.
7273 (PROGRAM): Make profile-specific.
7275 2004-11-18 Marek Safar <marek.safar@seznam.cz>
7277 * expression.cs (DoResolveBase): Fixed wrong warning for out
7280 2004-11-18 Martin Baulig <martin@ximian.com>
7282 Merged latest changes into gmcs. Please keep this comment in
7283 here, it makes it easier for me to see what changed in MCS since
7284 the last time I merged.
7286 2004-11-17 Raja R Harinath <rharinath@novell.com>
7288 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7289 (TypeHandle.GetMemberCache): New.
7290 (TypeHandle.TypeHandle): Update.
7291 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7292 (TypeManager.LookupParentInterfacesCache):
7293 Rename from LookupInterfaceCache. Optimize slightly.
7294 (TypeManager.MemberLookup_FindMembers): Update.
7295 * decl.cs (MemberCache.MemberCache): Set Container to null in the
7297 (AddCacheContents): Rename from AddHashtable.
7298 * class.cs (TypeContainer.parent_container): Remove.
7299 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7300 (TypeContainer.DoDefineMembers): Don't initialize it.
7301 Update to name changes.
7303 2004-11-17 Miguel de Icaza <miguel@ximian.com>
7305 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7306 that factors the code to check access modifiers on override.
7308 (PropertyBase): Use the code here.
7310 Patch from Lluis S'anchez, fixes bug #69361.
7312 2004-11-15 Miguel de Icaza <miguel@ximian.com>
7314 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7315 routine that is used to report the use of a captured variable
7316 whose address has been taken.
7318 There are two checks: one when variables are being captured and
7319 the other check is when the address of a variable is taken.
7321 (because an anonymous methods might be resolved before *or* after
7322 the address has been taken) and
7324 * expression.cs (Conditional.DoResolve): Remove the special
7325 casing that Martin added to trueExpr and falseExpr being both
7326 NullLiteral. We get the right behavior now just by introducing
7327 the null_type into the compiler.
7329 * convert.cs (ExplicitConversion): Change the code to use
7330 null_type instead of testing `expr is NullLiteral'.
7331 (ImplicitConversionStandard): use null_type too.
7332 (ImplicitReferenceConversionExists): use null_type too.
7333 (ImplicitReferenceConversion): use null_type too.
7335 * literal.cs: The type of `NullLiteral' is now null_type instead
7337 (Resolve): Set the type here.
7339 * typemanager.cs: Introduce null_type.
7341 2004-11-17 Martin Baulig <martin@ximian.com>
7343 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7344 direction, like FindMembers() does. Fixes #69546, testcase is in
7347 2004-11-16 Martin Baulig <martin@ximian.com>
7349 This is based on a patch from Marek Safar, see bug #69082.
7350 Fixes bugs #63705 and #67130.
7352 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7353 method; create a MemberCache for an interface type and cache the
7356 * decl.cs (IMemberContainer.ParentContainer): Removed.
7357 (IMemberContainer.ParentCache): New property.
7358 (MemberCache.SetupCacheForInterface): Removed.
7359 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7360 to create a cache for an interface's "parent".
7362 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7365 2004-11-16 Martin Baulig <martin@ximian.com>
7367 Merged back from gmcs; these changes already went into gmcs a
7368 couple of weeks ago.
7371 (TypeManager.AddUserType): Removed the `ifaces' argument.
7372 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
7374 (TypeManager.AddUserInterface): Removed.
7375 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
7377 (TypeManager.GetInterfaces): Likewise.
7378 (TypeManager.GetExplicitInterfaces): Likewise.
7380 * ecore.cs (TypeExpr.GetInterfaces): Removed.
7382 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
7383 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
7385 2004-11-14 Ben Maurer <bmaurer@ximian.com>
7387 * statement.cs: Avoid adding bools to a hashtable.
7389 2004-11-07 Miguel de Icaza <miguel@ximian.com>
7391 * expression.cs (Invocation.OverloadResolve): Flag error if we are
7392 calling an unsafe method from a safe location.
7394 2004-11-06 Marek Safar <marek.safar@seznam.cz>
7397 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7399 2004-11-06 Miguel de Icaza <miguel@ximian.com>
7401 * namespace.cs (VerifyUsing): use GetPartialName instead of
7404 2004-11-05 Miguel de Icaza <miguel@ximian.com>
7406 * statement.cs (Return.Resolve): Fix regression in typo: if
7407 `in_exc', we have to request a NeedReturnLabel, this was a typo
7408 introduced in the anonymous method check-in. Fixes #69131.
7410 * Indexers were using the ShortName when defining themselves,
7411 causing a regression in the compiler bootstrap when applying the
7412 patch from 2004-11-02 (first part), now they use their full name
7413 and the bug is gone.
7415 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
7417 * driver.cs: Strip the path from the names of embedded resources. Fixes
7420 2004-11-04 Raja R Harinath <rharinath@novell.com>
7422 Fix error message regression: cs0104-2.cs.
7423 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7424 (AliasEntry.Resolve): Update.
7425 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
7427 (RootContext.LookupType): Update.
7429 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
7431 * cs-parser.jay: Add support for handling accessor modifiers
7432 * class: Add support port accessor modifiers and error checking,
7433 define PropertyMethod.Define as virtual (not abstract anymore)
7434 * ecore.cs: Add checking for proeprties access with access modifiers
7435 * iterators.cs: Modify Accessor constructor call based in the modified
7437 2004-11-02 Ben Maurer <bmaurer@ximian.com>
7439 * expression.cs (StringConcat): Handle being called twice,
7440 as when we have a concat in a field init with more than two
7443 2004-11-02 Miguel de Icaza <miguel@ximian.com>
7445 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7446 special case explicit implementations, we should always produce
7447 the .property or .event declaration.
7449 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7450 since it will not return correct data if people use this
7451 unresolved in the presence of using statements (see test-313).
7453 * class.cs (MethodData.Define): If we are an explicit interface
7454 implementation, set the method name to the full name of the
7455 interface plus the name of the method.
7457 Notice that using the method.MethodName.GetFullName() does not
7458 work, as it will only contain the name as declared on the source
7459 file (it can be a shorthand in the presence of using statements)
7460 and not the fully qualifed type name, for example:
7464 class D : ICloneable {
7465 object ICloneable.Clone () {
7469 Would produce a method called `ICloneable.Clone' instead of
7470 `System.ICloneable.Clone'.
7472 * namespace.cs (Alias.Resolve): Use GetPartialName.
7474 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7476 * cs-parser.jay: Add error 1055 report.
7478 2004-11-01 Miguel de Icaza <miguel@ximian.com>
7480 * assign.cs (Assign.DoResolve): Only do the transform of
7481 assignment into a New if the types are compatible, if not, fall
7482 through and let the implicit code deal with the errors and with
7483 the necessary conversions.
7485 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7487 * cs-parser.jay: Add error 1031 report.
7489 * cs-tokenizer.cs: Add location for error 1038.
7491 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7493 * cs-parser.jay: Add error 1016 report.
7495 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7497 * cs-parser.jay: Add errors 1575,1611 report.
7499 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7501 * cs-parser.jay: Add error 1001 report.
7503 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7506 * attribute.cs (GetMarshal): Add method argument for
7507 caller identification.
7509 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7510 agument for GetMarshal and RuntimeMissingSupport.
7512 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7514 * attribute.cs (ExtractSecurityPermissionSet): Removed
7515 TypeManager.code_access_permission_type.
7517 * typemanager.cs: Removed TypeManager.code_access_permission_type.
7519 2004-10-27 Miguel de Icaza <miguel@ximian.com>
7521 * expression.cs (LocalVariableReference.DoResolveLValue): Check
7522 for obsolete use of a variable here. Fixes regression on errors
7523 cs0619-25 and cs0619-26.
7525 2004-10-27 Marek Safar <marek.safar@seznam.cz>
7527 Fix #62358, implemented security attribute encoding.
7529 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7530 Tests permitted SecurityAction for assembly or other types.
7531 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7532 data from SecurityPermissionAttribute to PermisionSet class.
7534 * class.cs (ApplyAttributeBuilder): Added special handling
7535 for System.Security.Permissions.SecurityAttribute based types.
7537 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7538 special handling for System.Security.Permissions.SecurityAttribute
7541 * enum.cs (ApplyAttributeBuilder): Added special handling
7542 for System.Security.Permissions.SecurityAttribute based types.
7544 * parameter.cs (ApplyAttributeBuilder): Added special handling
7545 for System.Security.Permissions.SecurityAttribute based types.
7547 * rootcontext.cs: Next 2 core types.
7549 * typemanager.cs (TypeManager.security_permission_attr_type):
7550 Built in type for the SecurityPermission Attribute.
7551 (code_access_permission_type): Build in type.
7553 2004-10-17 Miguel de Icaza <miguel@ximian.com>
7555 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7556 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7557 all of this information into
7558 EmitContext.EmitCapturedVariableInstance.
7560 * codegen.cs (EmitCapturedVariableInstance): move here the
7561 funcionality of emitting an ldarg.0 in the presence of a
7562 remapping. This centralizes the instance emit code.
7564 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7565 then emit a load of this: it means that we have reached the
7566 topmost ScopeInfo: the one that contains the pointer to the
7567 instance of the class hosting the anonymous method.
7569 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7570 captures to the topmost CaptureContext.
7572 2004-10-12 Miguel de Icaza <miguel@ximian.com>
7574 * expression.cs (LocalVariableReference): Move the knowledge about
7575 the iterators into codegen's EmitCapturedVariableInstance.
7577 2004-10-11 Miguel de Icaza <miguel@ximian.com>
7579 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7580 all code paths return a value from an anonymous method (it is the
7581 same as the 161 error, but for anonymous methods).
7583 2004-10-08 Miguel de Icaza <miguel@ximian.com>
7585 The introduction of anonymous methods in the compiler changed
7586 various ways of doing things in the compiler. The most
7587 significant one is the hard split between the resolution phase
7588 and the emission phases of the compiler.
7590 For instance, routines that referenced local variables no
7591 longer can safely create temporary variables during the
7592 resolution phase: they must do so from the emission phase,
7593 since the variable might have been "captured", hence access to
7594 it can not be done with the local-variable operations from the runtime.
7598 (Block.Flags): New flag `IsTopLevel' to indicate that this block
7599 is a toplevel block.
7601 (ToplevelBlock): A new kind of Block, these are the blocks that
7602 are created by the parser for all toplevel method bodies. These
7603 include methods, accessors and anonymous methods.
7605 These contain some extra information not found in regular blocks:
7606 A pointer to an optional CaptureContext (for tracking captured
7607 local variables and parameters). A pointer to the parent
7610 (Return.Resolve): Catch missmatches when returning a value from an
7611 anonymous method (error 1662).
7612 Invoke NeedReturnLabel from the Resolve phase instead of the emit
7615 (Break.Resolve): ditto.
7617 (SwitchLabel): instead of defining the labels during the
7618 resolution phase, we now turned the public ILLabel and ILLabelCode
7619 labels into methods called GetILLabelCode() and GetILLabel() that
7620 only define the label during the Emit phase.
7622 (GotoCase): Track the SwitchLabel instead of the computed label
7623 (its contained therein). Emit the code by using
7624 SwitchLabel.GetILLabelCode ().
7626 (LocalInfo.Flags.Captured): A new flag has been introduce to track
7627 whether the Local has been captured or not.
7629 (LocalInfo.IsCaptured): New property, used to tell whether the
7630 local has been captured.
7632 * anonymous.cs: Vastly updated to contain the anonymous method
7635 The main classes here are: CaptureContext which tracks any
7636 captured information for a toplevel block and ScopeInfo used to
7637 track the activation frames for various local variables.
7639 Each toplevel block has an optional capture context associated
7640 with it. When a method contains an anonymous method both the
7641 toplevel method and the anonymous method will create a capture
7642 context. When variables or parameters are captured, they are
7643 recorded on the CaptureContext that owns them, for example:
7647 MyDelegate d = delegate {
7652 Here `a' will be recorded as captured on the toplevel
7653 CapturedContext, the inner captured context will not have anything
7654 (it will only have data if local variables or parameters from it
7655 are captured in a nested anonymous method.
7657 The ScopeInfo is used to track the activation frames for local
7658 variables, for example:
7660 for (int i = 0; i < 10; i++)
7661 for (int j = 0; j < 10; j++){
7662 MyDelegate d = delegate {
7667 At runtime this captures a single captured variable `i', but it
7668 captures 10 different versions of the variable `j'. The variable
7669 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7670 recorded on a child.
7672 The toplevel ScopeInfo will also track information like the `this'
7673 pointer if instance variables were referenced (this is necessary
7674 as the anonymous method lives inside a nested class in the host
7675 type of the method).
7677 (AnonymousMethod): Expanded to track the Toplevel, implement
7678 `AnonymousMethod.Compatible' to tell whether an anonymous method
7679 can be converted to a target delegate type.
7681 The routine now also produces the anonymous method content
7683 (AnonymousDelegate): A helper class that derives from
7684 DelegateCreation, this is used to generate the code necessary to
7685 produce the delegate for the anonymous method that was created.
7687 * assign.cs: API adjustments for new changes in
7688 Convert.ImplicitStandardConversionExists.
7690 * class.cs: Adjustments to cope with the fact that now toplevel
7691 blocks are of type `ToplevelBlock'.
7693 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7694 insteda of standard blocks.
7696 Flag errors if params arguments are passed to anonymous methods.
7698 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7699 `CurrentAnonymousMethod' which points to the current Anonymous
7700 Method. The variable points to the AnonymousMethod class that
7701 holds the code being compiled. It is set in the new EmitContext
7702 created for the anonymous method.
7704 (EmitContext.Phase): Introduce a variable and an enumeration to
7705 assist in enforcing some rules about when and where we are allowed
7706 to invoke certain methods (EmitContext.NeedsReturnLabel is the
7707 only one that enfonces this right now).
7709 (EmitContext.HaveCaptureInfo): new helper method that returns
7710 whether we have a CapturedContext initialized.
7712 (EmitContext.CaptureVariable): New method used to register that a
7713 LocalInfo must be flagged for capturing.
7715 (EmitContext.CapturedParameter): New method used to register that a
7716 parameters must be flagged for capturing.
7718 (EmitContext.CapturedField): New method used to register that a
7719 field must be flagged for capturing.
7721 (EmitContext.HaveCapturedVariables,
7722 EmitContext.HaveCapturedFields): Return whether there are captured
7723 variables or fields.
7725 (EmitContext.EmitMethodHostInstance): This is used to emit the
7726 instance for the anonymous method. The instance might be null
7727 (static methods), this (for anonymous methods that capture nothing
7728 and happen to live side-by-side with the current method body) or a
7729 more complicated expression if the method has a CaptureContext.
7731 (EmitContext.EmitTopBlock): Routine that drives the emission of
7732 code: it will first resolve the top block, then emit any metadata
7733 and then emit the code. The split is done so that we can extract
7734 any anonymous methods and flag any captured variables/parameters.
7736 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7737 during this phase, the ILGenerator should not be used as labels
7738 and local variables declared here might not be accessible to any
7739 code that is part of an anonymous method.
7741 Exceptions to this include the temporary variables that are
7742 created by some statements internally for holding temporary
7745 (EmitContext.EmitMeta): New routine, in charge of emitting all the
7748 (EmitContext.TemporaryReturn): This method is typically called
7749 from the Emit phase, and its the only place where we allow the
7750 ReturnLabel to be defined other than the EmitMeta. The reason is
7751 that otherwise we would have to duplicate a lot of logic in the
7752 Resolve phases of various methods that today is on the Emit
7755 (EmitContext.NeedReturnLabel): This no longer creates the label,
7756 as the ILGenerator is not valid during the resolve phase.
7758 (EmitContext.EmitThis): Extended the knowledge in this class to
7759 work in anonymous methods in addition to iterators.
7761 (EmitContext.EmitCapturedVariableInstance): This emits whatever
7762 code is necessary on the stack to access the instance to a local
7763 variable (the variable will be accessed as a field).
7765 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7766 EmitContext.EmitAddressOfParameter): Routines to support
7767 parameters (not completed at this point).
7769 Removals: Removed RemapLocal and RemapLocalLValue. We probably
7770 will also remove the parameters.
7772 * convert.cs (Convert): Define a `ConstantEC' which points to a
7773 null. This is just to prefity some code that uses
7774 ImplicitStandardConversion code and do not have an EmitContext
7777 The idea is to flag explicitly that at that point in time, it is
7778 known that the conversion will not trigger the delegate checking
7779 code in implicit conversions (which requires a valid
7782 Everywhere: pass new EmitContext parameter since
7783 ImplicitStandardConversionExists now requires it to check for
7784 anonymous method conversions.
7786 (Convert.ImplicitStandardConversionExists): If the type of an
7787 expression is the anonymous_method_type, and the type is a
7788 delegate, we invoke the AnonymousMethod.Compatible method to check
7789 whether an implicit conversion is possible.
7791 (Convert.ImplicitConversionStandard): Only do implicit method
7792 group conversions if the language level is not ISO_1.
7794 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7795 MethodInfo for the Invoke method. used by Delegate and
7798 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7799 method conversions if the target type is a delegate.
7801 Removed extra debugging nops.
7803 (LocalVariableReference): Turn the `local_info' into a public
7806 Add `prepared' field, the same hack used for FieldExprs to cope
7807 with composed assignments, as Local variables do not necessarily
7808 operate purely on the stack as they used to: they can be captured
7811 Add `temp' for a temporary result, like fields.
7813 Refactor DoResolve and DoResolveLValue into DoResolveBase.
7815 It now copes with Local variables that are captured and emits the
7816 proper instance variable to load it from a field in the captured
7819 (ParameterReference.DoResolveBase): During the resolve phase,
7820 capture parameters if we are in an anonymous method.
7822 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7823 anonymous method, use the EmitContext helper routines to emit the
7824 parameter reference.
7826 * iterators.cs: Set RemapToProxy to true/false during the
7829 * parameters.cs (GetParameterByName): New helper method.
7831 * typemanager.cs (anonymous_method_type) a new type that
7832 represents an anonyous method. This is always an internal type,
7833 used as a fencepost to test against the anonymous-methodness of an
7836 2004-10-20 Marek Safar <marek.safar@seznam.cz>
7838 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7840 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7842 2004-10-18 Martin Baulig <martin@ximian.com>
7844 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7845 `Type' directly, but call ResolveType() on it.
7846 (Catch.Resolve): Likewise.
7847 (Foreach.Resolve): Likewise.
7849 2004-10-18 Martin Baulig <martin@ximian.com>
7851 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7852 `Type' directly, but call ResolveType() on it.
7853 (Probe.DoResolve): Likewise.
7854 (ArrayCreation.LookupType): Likewise.
7855 (TypeOf.DoResolve): Likewise.
7856 (SizeOf.DoResolve): Likewise.
7858 2004-10-18 Martin Baulig <martin@ximian.com>
7860 * expression.cs (Invocation.BetterFunction): Put back
7861 TypeManager.TypeToCoreType().
7863 2004-10-18 Raja R Harinath <rharinath@novell.com>
7865 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7868 2004-10-18 Martin Baulig <martin@ximian.com>
7870 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
7871 `Type' directly, but call ResolveType() on it.
7873 2004-10-18 Martin Baulig <martin@ximian.com>
7875 * class.cs (FieldMember.Define): Don't access the TypeExpr's
7876 `Type' directly, but call ResolveType() on it.
7877 (MemberBase.DoDefine): Likewise.
7879 * expression.cs (New.DoResolve): Don't access the TypeExpr's
7880 `Type' directly, but call ResolveType() on it.
7881 (ComposedCast.DoResolveAsTypeStep): Likewise.
7883 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7884 `Type' directly, but call ResolveType() on it.
7886 2004-10-17 John Luke <john.luke@gmail.com>
7888 * class.cs (Operator.GetSignatureForError): use CSharpName
7890 * parameter.cs (Parameter.GetSignatureForError): Returns
7891 correct name even if was not defined.
7893 2004-10-13 Raja R Harinath <rharinath@novell.com>
7896 * class.cs (TypeContainer.EmitContext): New property.
7897 (DefineNestedTypes): Create an emitcontext for each part.
7898 (MethodCore.DoDefineParameters): Use container's emitcontext.
7899 Pass type array to InternalParameters.
7900 (MemberBase.DoDefine): Use container's emitcontext.
7901 (FieldMember.Define): Likewise.
7902 (Event.Define): Likewise.
7903 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7904 Pass type array to InternalParameters.
7905 (SetIndexerMethod.GetParameterInfo): Likewise.
7906 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7907 * delegate.cs (Define): Pass emitcontext to
7908 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7909 array to InternalParameters.
7910 * expression.cs (ParameterReference.DoResolveBase): Pass
7911 emitcontext to GetParameterInfo.
7912 (ComposedCast.DoResolveAsTypeStep): Remove check on
7913 ec.ResolvingTypeTree.
7914 * parameter.cs (Parameter.Resolve): Change argument to
7915 EmitContext. Use ResolveAsTypeTerminal.
7916 (Parameter.GetSignature): Change argument to EmitContext.
7917 (Parameters.ComputeSignature): Likewise.
7918 (Parameters.ComputeParameterTypes): Likewise.
7919 (Parameters.GetParameterInfo): Likewise.
7920 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7921 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7922 * support.cs (InternalParameters..ctor): Remove variant that takes
7924 * typemanager.cs (system_intptr_expr): New.
7925 (InitExpressionTypes): Initialize it.
7927 2004-10-12 Chris Toshok <toshok@ximian.com>
7929 * cs-parser.jay: fix location for try_statement and catch_clause.
7931 2004-10-11 Martin Baulig <martin@ximian.com>
7933 * report.cs: Don't make --fatal abort on warnings, we have
7934 -warnaserror for that.
7936 2004-10-07 Raja R Harinath <rharinath@novell.com>
7938 More DeclSpace.ResolveType avoidance.
7939 * decl.cs (MemberCore.InUnsafe): New property.
7940 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7941 with newly created EmitContext.
7942 (FieldMember.Define): Likewise.
7943 * delegate.cs (Delegate.Define): Likewise.
7944 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7945 only if normal name-lookup fails.
7946 (TypeExpr.DoResolve): Enable error-checking.
7947 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7948 (SizeOf.DoResolve): Likewise.
7949 (ComposedCast.DoResolveAsTypeStep): Likewise.
7950 (StackAlloc.DoResolve): Likewise.
7951 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7952 (Block.Unsafe): New property.
7953 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7954 (Unsafe): Set 'unsafe' flag of contained block.
7955 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7956 (Fixed.Resolve): Likewise.
7957 (Catch.Resolve): Likewise.
7958 (Using.ResolveLocalVariableDecls): Likewise.
7959 (Foreach.Resolve): Likewise.
7961 2004-10-05 John Luke <john.luke@gmail.com>
7963 * cs-parser.jay: add location to error CS0175
7965 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7967 * ecore.cs (Expression.Constantity): Add support for turning null
7970 * const.cs (Const.Define): Allow constants to be reference types
7971 as long as the value is Null.
7973 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7975 * namespace.cs (NamespaceEntry.Using): No matter which warning
7976 level is set, check if this namespace name has already been added.
7978 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7980 * expression.cs: reftype [!=]= null should always use br[true,false].
7983 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7986 * attribute.cs: Enum conversion moved to
7987 GetAttributeArgumentExpression to be applied to the all
7990 2004-10-01 Raja R Harinath <rharinath@novell.com>
7992 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7993 * class.c (TypeContainer.DefineType): Flag error if
7994 base types aren't accessible due to access permissions.
7995 * decl.cs (DeclSpace.ResolveType): Move logic to
7996 Expression.ResolveAsTypeTerminal.
7997 (DeclSpace.ResolveTypeExpr): Thin layer over
7998 Expression.ResolveAsTypeTerminal.
7999 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8000 Refactor code into NestedAccess. Use it.
8001 (DeclSpace.NestedAccess): New.
8002 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8003 argument to silence errors. Check access permissions.
8004 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8005 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8006 (Cast.DoResolve): Likewise.
8007 (New.DoResolve): Likewise.
8008 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8009 (TypeOf.DoResolve): Likewise.
8011 * expression.cs (Invocation.BetterConversion): Return the Type of
8012 the better conversion. Implement section 14.4.2.3 more faithfully.
8013 (Invocation.BetterFunction): Make boolean. Make correspondence to
8014 section 14.4.2.2 explicit.
8015 (Invocation.OverloadResolve): Update.
8016 (Invocation): Remove is_base field.
8017 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
8018 (Invocation.Emit): Likewise.
8020 2004-09-27 Raja R Harinath <rharinath@novell.com>
8022 * README: Update to changes.
8024 2004-09-24 Marek Safar <marek.safar@seznam.cz>
8026 * cs-parser.jay: Reverted 642 warning fix.
8028 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8031 * decl.cs (FindMemberWithSameName): Indexer can have more than
8034 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8036 * expression.cs (LocalVariableReference.DoResolveLValue):
8037 Do not report warning 219 for out values.
8038 (EmptyExpression.Null): New member to avoid extra allocations.
8040 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8042 * cs-parser.jay: Fix wrong warning 642 report.
8044 * cs-tokenizer.cs (CheckNextToken): New helper;
8045 Inspect next character if is same as expected.
8047 2004-09-23 Martin Baulig <martin@ximian.com>
8049 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8050 (Convert.ImplicitReferenceConversionExists): Likewise.
8052 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8054 * class.cs (Operator.Define): Add error 448 and 559 report.
8056 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8058 * class.cs (MemberBase.IsTypePermitted): New protected
8059 method for checking error CS0610.
8061 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8063 * class.cs (TypeContainer.HasExplicitLayout): New property
8064 Returns whether container has StructLayout attribute set Explicit.
8065 (FieldMember): New abstract class for consts and fields.
8066 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8067 (Field): Reuse FieldMember.
8069 * const.cs (Const): Reuse FieldMember.
8071 * rootcontext.cs: EmitConstants call moved to class.
8073 2004-09-22 Martin Baulig <martin@ximian.com>
8075 Thanks to Peter Sestoft for this bug report.
8077 * expression.cs (Conditional): If both the `trueExpr' and the
8078 `falseExpr' is a NullLiteral, return a NullLiteral.
8080 2004-09-22 Martin Baulig <martin@ximian.com>
8082 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8083 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8084 for the "get_Current" call.
8086 2004-09-22 Martin Baulig <martin@ximian.com>
8088 Marek and me just fixed one of our oldest bugs: #28562 :-)
8090 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8092 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8093 we're an EnumConstant, just return that.
8094 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8095 an EnumConstant. In this case, we need to use GetValueAsEnumType()
8096 to get the value which'll actually be written into the attribute.
8097 However, we have to use GetValue() to access the attribute's value
8100 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8102 * constant.cs (Constant.IsNegative): New abstract property
8105 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8106 (StackAlloc.DoResolve): Reused IsNegative.
8108 2004-09-21 Martin Baulig <martin@ximian.com>
8110 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
8111 if we're used in an iterator, we may be called from different
8114 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
8115 we actually have an exception block.
8117 2004-09-20 John Luke <jluke@cfl.rr.com>
8119 * class.cs, cs-parser.jay: Improve the error report for 1520:
8120 report the actual line where the error happens, not where the
8123 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
8124 Pass location information that was available elsewhere.
8126 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
8128 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
8129 runtime to delay sign assemblies.
8131 2004-09-19 Miguel de Icaza <miguel@ximian.com>
8133 * cs-parser.jay: Do not report the stack trace, this is barely
8136 2004-08-22 John Luke <john.luke@gmail.com>
8138 * driver.cs : check that a resource id is not already used
8139 before adding it, report CS1508 if it is, bug #63637
8141 2004-09-19 Miguel de Icaza <miguel@ximian.com>
8143 * ecore.cs: Removed dead code.
8145 2004-09-18 Marek Safar <marek.safar@seznam.cz>
8147 * class.cs: Do not report warning CS0067 on the interfaces.
8149 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8151 * cs-parser.jay: Add error 504 report.
8153 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8155 * rootcontext.cs: WarningLevel is 4 by default now.
8157 * statement.cs (Fixed.Resolve): Do not null
8160 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8163 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
8164 deep search when property is not virtual.
8165 (PropertyExpr.ResolveAccessors): Make one call for both
8168 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8171 * statement.cs: Error 152 report constains also location.
8173 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8176 * const.cs: Explicitly set constant as static.
8178 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8181 * cs-parser.jay: Add error 1017 report.
8183 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8185 Fixed bug #59980, #64224
8186 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
8188 * typemanager.cs (IsSpecialMethod): Simplified
8190 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8192 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
8193 condition with better params.
8195 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8198 * attribute.cs (Resolve): Property has to have both
8201 2004-09-14 Martin Baulig <martin@ximian.com>
8203 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8205 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8208 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8209 called and is obsolete then this member suppress message
8210 when call is inside next [Obsolete] method or type.
8212 * expression.cs: Use TestObsoleteMethodUsage member.
8214 2004-09-14 Martin Baulig <martin@ximian.com>
8216 * cs-parser.jay: Sync a bit with the GMCS version.
8218 2004-09-14 Martin Baulig <martin@ximian.com>
8220 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
8221 (CSharpParser.yacc_verbose_flag): New public field.
8223 * genericparser.cs: Removed.
8225 2004-09-14 Raja R Harinath <rharinath@novell.com>
8227 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
8229 2004-09-13 Marek Safar <marek.safar@seznam.cz>
8231 * class.cs (MethodCore.CheckBase): Fix bug #65757.
8233 2004-09-10 Martin Baulig <martin@ximian.com>
8235 Backported my MemberName changes from GMCS into MCS.
8237 - we are now using a special `MemberName' class instead of using
8238 strings; in GMCS, the `MemberName' also contains the type
8241 - changed the grammar rules a bit:
8242 * the old `member_name' is now a `namespace_or_type_name':
8243 The rule is that we use `namespace_or_type_name' everywhere
8244 where we expect either a "member name" (GetEnumerator) or a
8245 "member name" with an explicit interface name
8246 (IEnumerable.GetEnumerator).
8247 In GMCS, the explicit interface name may include type arguments
8248 (IEnumerable<T>.GetEnumerator).
8249 * we use `member_name' instead of just `IDENTIFIER' for
8251 The rule is that we use `member_name' wherever a member may
8252 have type parameters in GMCS.
8254 * decl.cs (MemberName): New public class.
8255 (MemberCore.MemberName): New public readonly field.
8256 (MemberCore.ctor): Take a `MemberName' argument, not a string.
8257 (DeclSpace): Likewise.
8259 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
8260 * enum.cs (Enum.ctor): Likewise.
8262 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
8264 (AliasEntry.ctor): Take a MemberName, not an Expression.
8265 (AliasEntry.UsingAlias): Likewise.
8267 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
8268 (IMethodData.MemberName): Changed type from string to MemberName.
8269 (MemberBase.ExplicitInterfaceName): Likewise.
8270 (AbstractPropertyEventMethod.SetupName): Make this private.
8271 (AbstractPropertyEventMethod.ctor): Added `string prefix'
8272 argument; compute the member name here.
8273 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
8274 on the `member.MemberName' and the `prefix'.
8276 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
8278 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
8279 thus, we get a `MemberName' instead of a `string'. These
8280 declarations may have type parameters in GMCS.
8281 (interface_method_declaration, delegate_declaration): Likewise.
8282 (class_declaration, interface_declaration): Likewise.
8283 (method_header): Use `namespace_or_type_name' instead of
8284 `member_name'. We may be an explicit interface implementation.
8285 (property_declaration, event_declaration): Likewise.
8286 (member_name): This is now just an `IDENTIFIER', not a
8287 `namespace_or_type_name'.
8288 (type_name, interface_type): Removed.
8289 (namespace_or_type_name): Return a MemberName, not an Expression.
8290 (primary_expression): Use `member_name' instead of `IDENTIFIER';
8291 call GetTypeExpression() on the MemberName to get an expression.
8292 (IndexerDeclaration.interface_type): Changed type from string to
8294 (MakeName): Operate on MemberName's instead of string's.
8296 2004-09-13 Raja R Harinath <rharinath@novell.com>
8299 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
8300 (NamespaceEntry.Lookup): Add new argument to flag if we want the
8301 lookup to avoid symbols introduced by 'using'.
8302 * rootcontext.cs (NamespaceLookup): Update.
8304 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8306 * class.cs (TypeContainer.DoDefineMembers): Do not call
8307 DefineDefaultConstructor for static classes.
8309 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8311 * attribute.cs (Attribute.Resolve): Add error 653 report.
8313 * class.cs (Class.ApplyAttributeBuilder): Add error 641
8315 (Method.ApplyAttributeBuilder): Add error 685 report.
8316 (Operator.Define): Add error 564 report.
8318 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8320 * expression.cs (Invocation.DoResolve): Add error
8323 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8326 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8328 * class.cs (ConstructorInitializer.Resolve):
8329 Wrong error number (515->516).
8331 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8333 * class.cs (Indexer.Define): Add error 631 report.
8335 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8337 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8339 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8341 * expression.cs (Probe.DoResolve): Add error CS0241 report.
8343 2004-09-10 Marek Safar <marek.safar@seznam.cz>
8345 * cs-parser.jay: Added error CS0241 report.
8347 2004-09-10 Raja R Harinath <rharinath@novell.com>
8349 * cs-parser.jay (fixed_statement): Introduce a scope for the
8350 declaration in the 'fixed' statement.
8352 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8354 * cs-parser.jay: Added CS0230 error report.
8356 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8358 * cs-parser.jay: Added errors CS0231 and CS0257 report.
8360 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8362 * expression.cs (Argument.Resolve): Added error CS0192 and
8365 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8367 C# 2.0 #pragma warning feature
8369 * cs-tokenizer.cs (PreProcessPragma): New method;
8370 Handles #pragma directive.
8372 * report.cs (WarningRegions): New class; Support
8373 class for #pragma warning directive. It tests whether
8374 warning is enabled for a given line.
8376 2004-09-08 Miguel de Icaza <miguel@ximian.com>
8378 * const.cs: Add more descriptive error report, tahnks to
8381 2004-09-08 Marek Safar <marek.safar@seznam.cz>
8383 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8385 2004-09-07 Miguel de Icaza <miguel@ximian.com>
8387 * expression.cs: Apply patch from Ben: Remove dead code from
8388 ArrayCreation, and remove the TurnintoConstant call in const.cs,
8389 as that code just threw an exception anwyays.
8391 * const.cs: Remove the call to the turnintoconstant, for details
8394 * literal.cs: The type of the null-literal is the null type; So
8395 we use a placeholder type (literal.cs:System.Null, defined here)
8398 * expression.cs (Conditional.DoResolve): Remove some old code that
8399 is no longer needed, conversions have been fixed.
8401 (ArrayCreationExpression.DoResolve): Return false if we fail to
8402 resolve the inner expression.
8404 2004-09-07 Raja R Harinath <rharinath@novell.com>
8407 * cs-parser.jay (delegate_declaration): Record a delegate
8408 declaration as a type declaration.
8409 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8411 2004-09-06 Miguel de Icaza <miguel@ximian.com>
8413 * parameter.cs: Do not crash if the type can not be resolved.
8415 * expression.cs: Report errors with unsafe pointers, fixes #64896
8417 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
8419 * expression.cs: Pointer arith always needs to do a conv.i
8420 if the operand is a long. fix 65320
8422 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8424 Fixed cs0619-37.cs, cs0619-38.cs
8426 * enum.cs (GetObsoleteAttribute): Removed.
8428 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8429 on Enum member is double staged. The first is tested member
8432 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8434 Fixed #56986, #63631, #65231
8436 * class.cs: (TypeContainer.AddToMemberContainer): New method,
8437 adds member to name container.
8438 (TypeContainer.AddToTypeContainer): New method, adds type to
8440 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8441 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8442 AddOperator): Simplified by reusing AddToMemberContainer.
8443 (TypeContainer.UserDefinedStaticConstructor): Changed to property
8445 (Method.CheckForDuplications): Fixed implementation to test all
8447 (MemberBase): Detection whether member is explicit interface
8448 implementation is now in constructor.
8449 (MemberBase.UpdateMemberName): Handles IndexerName.
8450 (Accessor): Changed to keep also location information.
8451 (AbstractPropertyEventMethod): Is derived from MemberCore.
8452 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8453 will be emited or not.
8454 (PropertyBase.AreAccessorsDuplicateImplementation):
8455 Tests whether accessors are not in collision with some method.
8456 (Operator): Is derived from MethodCore to simplify common
8459 * decl.cs (Flags.TestMethodDuplication): Test for duplication
8461 (DeclSpace.AddToContainer): Adds the member to defined_names
8462 table. It tests for duplications and enclosing name conflicts.
8464 * enum.cs (EnumMember): Clean up to reuse the base structures
8466 2004-09-03 Martin Baulig <martin@ximian.com>
8468 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8469 into TypeContainer, to make partial classes work again.
8471 2004-09-03 Martin Baulig <martin@ximian.com>
8473 * rootcontext.cs (RootContext.V2): Removed.
8475 2004-03-23 Martin Baulig <martin@ximian.com>
8477 * expression.cs (Invocation.OverloadResolve): Added `bool
8478 may_fail' argument and use it instead of the Location.IsNull() hack.
8480 2004-09-03 Martin Baulig <martin@ximian.com>
8482 Merged latest changes into gmcs. Please keep this comment in
8483 here, it makes it easier for me to see what changed in MCS since
8484 the last time I merged.
8486 2004-09-03 Raja R Harinath <rharinath@novell.com>
8489 * expression.cs (BetterConversion): Don't allow either conversion
8490 to be null. Remove redundant implicit conversion test when 'q ==
8491 null' -- when this function is invoked, we already know that the
8492 implicit conversion exists.
8493 (BetterFunction): Assume that 'best' is non-null. Remove
8494 redundant reimplementation of IsApplicable when 'best' is null.
8495 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8496 number of arguments.
8497 (IsAncestralType): Extract from OverloadResolve.
8498 (OverloadResolve): Make robust to the MethodGroupExpr being
8499 unsorted. Implement all the logic of Section 14.5.5.1, and
8500 support overloading of methods from multiple applicable types.
8501 Clean up logic somewhat. Don't pass null methods to BetterFunction.
8503 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8504 (RealError, Warning): Append type of report to related symbol.
8506 2004-09-03 Marek Safar <marek.safar@seznam.cz>
8508 * enum.cs: Fixed CLS-Compliance checks for enum members.
8509 Error tests cs3008-8.cs, cs3014-8.cs
8511 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8513 Fixed bug #62342, #63102
8514 * class.cs: ImplementIndexer uses member.IsExplicitImpl
8515 like ImplementMethod.
8517 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8519 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8522 2004-09-02 Martin Baulig <martin@ximian.com>
8524 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8525 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8528 2004-09-01 Marek Safar <marek.safar@seznam.cz>
8530 C# 2.0 Static classes implemented
8532 * class.cs (TypeContainer): instance_constructors,
8533 initialized_fields, initialized_static_fields,
8534 default_constructor, base_inteface_types are protected to be
8535 accessible from StaticClass.
8536 (TypeContainer.DefineDefaultConstructor): New virtual method
8537 for custom default constructor generating
8538 (StaticClass): New class to handle "Static classes" feature.
8540 * cs-parser.jay: Handle static keyword on class like instance
8543 * driver.cs: Added "/langversion" command line switch with two
8544 options (iso-1, default).
8546 2004-08-31 Marek Safar <marek.safar@seznam.cz>
8548 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8550 2004-08-31 Miguel de Icaza <miguel@ximian.com>
8552 * delegate.cs: Style.
8554 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
8556 * delegate.cs: Add seperate instance expr field for miguel.
8558 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8560 * PointerArithmetic (Resolve): make sure we are not doing
8561 pointer arith on void*. Also, make sure we are resolved
8562 by not setting eclass until resolve.
8564 All callers: Make sure that PointerArithmetic gets resolved.
8566 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8568 * ArrayCreation (LookupType): If the type does not resolve
8569 to an array, give an error.
8571 2004-08-27 Marek Safar <marek.safar@seznam.cz>
8573 * statement.cs (Try.Resolve): Fixed bug #64222
8575 2004-08-27 Martin Baulig <martin@ximian.com>
8578 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8581 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8583 * ecore.cs (Constantify): Get underlying type via
8584 System.Enum.GetUnderlyingType to avoid StackOverflow on the
8585 Windows in special cases.
8587 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8589 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8590 for obtaining also private methods.
8591 (GetRemoveMethod): Used GetRemoveMethod (true)
8592 for obtaining also private methods.
8594 2004-08-24 Martin Baulig <martin@ximian.com>
8596 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8597 MethodAttributes.HideBySig for operators.
8599 2004-08-23 Martin Baulig <martin@ximian.com>
8601 Back to the old error reporting system :-)
8603 * report.cs (Message): Removed.
8604 (Report.MessageData, ErrorData, WarningData): Removed.
8605 (Report.Error, Warning): Back to the old system.
8607 2004-08-23 Martin Baulig <martin@ximian.com>
8609 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8611 * class.cs (TypeContainer.ParentContainer): New public virtual
8612 method; replaces the explicit interface implementation.
8613 (ClassPart.ParentContainer): Override.
8615 2004-08-23 Martin Baulig <martin@ximian.com>
8617 * statement.cs (Switch): Added support for constant switches; see
8618 #59428 or test-285.cs.
8620 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8623 * statement.cs (GetEnumeratorFilter): Removed useless
8624 logic because C# specs is strict. GetEnumerator must be
8627 2004-08-22 Martin Baulig <martin@ximian.com>
8629 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8630 a switch and may break, reset the barrier. Fixes #59867.
8632 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8634 CLS-Compliance speed up (~5% for corlib)
8636 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8637 New method. Tests container for CLS-Compliant names
8639 * class.cs (TypeContainer.VerifyClsName): New method.
8640 Checks whether container name is CLS Compliant.
8641 (Constructor): Implements IMethodData.
8643 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8644 low-case table for CLS Compliance test.
8645 (MemberCache.VerifyClsParameterConflict): New method.
8646 Checks method parameters for CS3006 error.
8648 * enum.cs (EnumMember): Is derived from MemberCore.
8649 (Enum.VerifyClsName): Optimized for better performance.
8651 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8653 * report.cs: Renamed Error_T to Error and changed all
8656 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8658 * class.cs (TypeContainer.IndexerArrayList): New inner class
8659 container for indexers.
8660 (TypeContainer.DefaultIndexerName): New constant for default
8661 indexer name. Replaced all "Item" with this constant.
8662 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8664 * typemanager.cs (TypeManager.default_member_ctor): Cache here
8665 DefaultMemberAttribute constructor.
8667 2004-08-05 Martin Baulig <martin@ximian.com>
8669 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8672 2004-08-05 Marek Safar <marek.safar@seznam.cz>
8674 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8675 multi platforms problem.
8677 * compiler.csproj: Included shared files.
8679 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8681 Fix bug 60333, 55971 in the more general way
8682 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8683 Added arg_type argument for constant conversion.
8684 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8686 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8689 * class.cs (TypeContainer ): New inner classes MethodArrayList,
8690 OperatorArrayList, MethodCoreArrayList for typecontainer
8691 containers. Changed class member types to these new types.
8692 (MethodArrayList.DefineMembers): Added test for CS0659.
8694 2004-08-04 Miguel de Icaza <miguel@ximian.com>
8696 * cfold.cs: Synchronize the folding with the code in expression.cs
8697 Binary.DoNumericPromotions for uint operands.
8699 * attribute.cs: Revert patch from Raja, it introduced a regression
8700 while building Blam-1.2.1 (hard to isolate a test case).
8702 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8706 (TypeContainer.Define): Renamed to DefineContainerMembers because of
8708 (MethodCore.parent_method): New member. The method we're overriding
8709 if this is an override method.
8710 (MethodCore.CheckBase): Moved from Method class and made common.
8711 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8713 (MethodCore.CheckForDuplications): New abstract method. For custom
8714 member duplication search in a container
8715 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8716 method and its return type.
8717 (Event.conflict_symbol): New member. Symbol with same name in the
8721 (MemberCache.FindMemberWithSameName): New method. The method
8722 is looking for conflict with inherited symbols.
8724 2004-08-04 Martin Baulig <martin@ximian.com>
8726 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8728 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8730 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8732 * report.cs (Message): New enum for better error, warning reference in
8734 (MessageData): New inner abstract class. It generally handles printing of
8735 error and warning messages.
8736 Removed unused Error, Warning, Message methods.
8738 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8740 Fix for cs0592-8.cs test
8742 (Attributable.ValidAttributeTargets): Made public.
8743 (Attribute.ExplicitTarget): New member for explicit target value.
8744 (Attribute.CheckTargets): Now we translate explicit attribute
8745 target to Target here.
8747 2004-08-03 Ben Maurer <bmaurer@ximian.com>
8749 * ecore.cs (MethodGroupExpr): new IsBase property.
8751 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8753 * delegate.cs (DelegateCreation): store a MethodGroupExpr
8754 rather than an instance expr.
8756 (DelegateCreation.Emit): Use the method group rather than
8757 the instance expression. Also, if you have base.Foo as the
8758 method for a delegate, make sure to emit ldftn, not ldftnvirt.
8760 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
8762 (NewDelegate.DoResolve): Only check for the existance of Invoke
8763 if the method is going to be needed. Use MethodGroupExpr.
8765 (NewDelegate.Emit): Remove, DelegateCreation implements this.
8767 * expression.cs: For pointer arith., make sure to use
8768 the size of the type, not the size of the pointer to
8771 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8774 * class.cs (Class): Added error CS0502 test.
8776 2004-08-03 John Luke <jluke@cfl.rr.com>
8777 Raja R Harinath <rharinath@novell.com>
8780 * attribute.cs (Attribute.complained_before): New flag.
8781 (Attribute.ResolveType, Attribute.Resolve),
8782 (Attribute.DefinePInvokeMethod): Set it.
8783 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8785 2004-08-03 Martin Baulig <martin@ximian.com>
8787 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8788 use a user-defined operator; we still need to do numeric
8789 promotions in case one argument is a builtin type and the other
8790 one has an implicit conversion to that type. Fixes #62322.
8792 2004-08-02 Martin Baulig <martin@ximian.com>
8794 * statement.cs (LocalInfo.Flags): Added `IsThis'.
8795 (LocalInfo.IsThis): New public property.
8796 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8798 2004-08-01 Martin Baulig <martin@ximian.com>
8800 * class.cs (TypeContainer.GetClassBases): Don't set the default
8801 here since we may get called from GetPartialBases().
8802 (TypeContainer.DefineType): If GetClassBases() didn't return a
8803 parent, use the default one.
8805 2004-07-30 Duncan Mak <duncan@ximian.com>
8807 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
8809 2004-07-30 Martin Baulig <martin@ximian.com>
8811 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8813 * class.cs (SourceMethod): New public class, derive from the
8814 symbol writer's ISourceMethod.
8815 (Method): Use the new symbol writer API.
8817 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8818 as argument and use the new symbol writer.
8821 (SourceFile): Implement the symbol writer's ISourceFile.
8822 (Location.SymbolDocument): Removed.
8823 (Location.SourceFile): New public property.
8825 * symbolwriter.cs: Use the new symbol writer API.
8827 2004-07-30 Raja R Harinath <rharinath@novell.com>
8829 * Makefile (install-local): Remove. Functionality moved to
8832 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8834 * Makefile: Install mcs.exe.config file together with mcs.exe.
8835 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8836 correct runtime version.
8838 2004-07-25 Martin Baulig <martin@ximian.com>
8841 (TypeContainer.RegisterOrder): Removed, this was unused.
8842 (TypeContainer, interface_order): Removed.
8843 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8844 TypeContainer as argument since we can also be called with a
8845 `PartialContainer' for a partial class/struct/interface.
8846 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8847 of checking whether we're an `Interface' - we could be a
8849 (PartialContainer.Register): Override; call
8850 AddClass()/AddStruct()/AddInterface() on our parent.
8852 * cs-parser.jay (interface_member_declaration): Add things to the
8853 `current_container', not the `current_class'.
8855 * rootcontext.cs (RegisterOrder): The overloaded version which
8856 takes an `Interface' was unused, removed.
8858 * typemanager.cs (TypeManager.LookupInterface): Return a
8859 `TypeContainer', not an `Interface'.
8860 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8861 contain a `PartialContainer' for an interface, so check it's
8862 `Kind' to figure out what it is.
8864 2004-07-25 Martin Baulig <martin@ximian.com>
8866 * class.cs (Class.DefaultTypeAttributes): New public constant.
8867 (Struct.DefaultTypeAttributes): Likewise.
8868 (Interface.DefaultTypeAttributes): Likewise.
8869 (PartialContainer.TypeAttr): Override this and add the
8870 DefaultTypeAttributes.
8872 2004-07-25 Martin Baulig <martin@ximian.com>
8874 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8875 we can just use the `Parent' field instead.
8877 2004-07-25 Martin Baulig <martin@ximian.com>
8879 * class.cs (TypeContainer.Emit): Renamed to EmitType().
8881 2004-07-25 Martin Baulig <martin@ximian.com>
8883 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8884 our parts before defining any methods.
8885 (TypeContainer.VerifyImplements): Make this virtual.
8886 (ClassPart.VerifyImplements): Override and call VerifyImplements()
8887 on our PartialContainer.
8889 2004-07-25 Martin Baulig <martin@ximian.com>
8891 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8893 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8894 argument, we can just use the `Parent' field instead.
8897 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
8898 (MemberBase.DoDefine): Likewise.
8900 2004-07-24 Martin Baulig <martin@ximian.com>
8902 * decl.cs (MemberCore.Parent): New public field.
8903 (DeclSpace.Parent): Moved to MemberCore.
8905 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8906 (MemberBase.ctor): Added TypeContainer argument, pass it to our
8908 (FieldBase, Field, Operator): Likewise.
8909 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8910 (EventField, Event): Likewise.
8912 2004-07-23 Martin Baulig <martin@ximian.com>
8914 * class.cs (PartialContainer): New public class.
8915 (ClassPart): New public class.
8916 (TypeContainer): Added support for partial classes.
8917 (TypeContainer.GetClassBases): Splitted some of the functionality
8918 out into GetNormalBases() and GetPartialBases().
8920 * cs-tokenizer.cs (Token.PARTIAL): New token.
8921 (Tokenizer.consume_identifier): Added some hacks to recognize
8922 `partial', but only if it's immediately followed by `class',
8923 `struct' or `interface'.
8925 * cs-parser.jay: Added support for partial clases.
8927 2004-07-23 Martin Baulig <martin@ximian.com>
8929 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8930 a `DeclSpace' and also made it readonly.
8931 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8932 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8933 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8935 * cs-parser.jay: Pass the `current_class', not the
8936 `current_container' (at the moment, this is still the same thing)
8937 to a new Method, Property, Event, Indexer or Constructor.
8939 2004-07-23 Martin Baulig <martin@ximian.com>
8941 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8942 and removed the `current_interface' one.
8943 (struct_declaration, class_declaration, interface_declaration):
8944 Set `current_class' to the newly created class/struct/interface;
8945 set their `Bases' and call Register() before parsing their body.
8947 2004-07-23 Martin Baulig <martin@ximian.com>
8949 * class.cs (Kind): New public enum.
8950 (TypeContainer): Made this class abstract.
8951 (TypeContainer.Kind): New public readonly field.
8952 (TypeContainer.CheckDef): New public method; moved here from
8954 (TypeContainer.Register): New public abstract method.
8955 (TypeContainer.GetPendingImplementations): New public abstract
8957 (TypeContainer.GetClassBases): Removed the `is_class' and
8958 `is_iface' parameters.
8959 (TypeContainer.DefineNestedTypes): Formerly known as
8961 (ClassOrStruct): Made this class abstract.
8963 * tree.cs (RootTypes): New public type.
8965 2004-07-20 Martin Baulig <martin@ximian.com>
8967 * tree.cs (Tree.RecordNamespace): Removed.
8968 (Tree.Namespaces): Removed.
8970 * rootcontext.cs (RootContext.IsNamespace): Removed.
8972 * cs-parser.jay (namespace_declaration): Just create a new
8973 NamespaceEntry here.
8975 2004-07-20 Martin Baulig <martin@ximian.com>
8977 * statement.cs (ExceptionStatement): New abstract class. This is
8978 now used as a base class for everyone who's using `finally'.
8979 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8980 our local variables before using them.
8982 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8983 virtual method. This is used by Yield.Resolve() to "steal" an
8984 outer block's `finally' clauses.
8985 (FlowBranchingException): The .ctor now takes an ExceptionStatement
8988 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8989 version which takes an ExceptionStatement. This version must be
8990 used to create exception branchings.
8993 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8994 (Iterator.EmitMoveNext): Added exception support; protect the
8995 block with a `fault' clause, properly handle 'finally' clauses.
8996 (Iterator.EmitDispose): Run all the `finally' clauses here.
8998 2004-07-20 Martin Baulig <martin@ximian.com>
9000 * iterator.cs: This is the first of a set of changes in the
9001 iterator code. Match the spec more closely: if we're an
9002 IEnumerable, then GetEnumerator() must be called. The first time
9003 GetEnumerator() is called, it returns the current instance; all
9004 subsequent invocations (if any) must create a copy.
9006 2004-07-19 Miguel de Icaza <miguel@ximian.com>
9008 * expression.cs: Resolve the constant expression before returning
9011 2004-07-19 Martin Baulig <martin@ximian.com>
9013 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
9014 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
9015 the return type of the new EmitContext.
9017 2004-07-18 Martin Baulig <martin@ximian.com>
9019 * class.cs (Property.Define): Fix iterators.
9021 * iterators.cs (Iterator.Define): Moved the
9022 `container.AddInterator (this)' call here from the .ctor; only do
9023 it if we resolved successfully.
9025 2004-07-17 Miguel de Icaza <miguel@ximian.com>
9027 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
9028 `true' for preprocessing directives that we parse. The return
9029 value indicates whether we should return to regular tokenizing or
9030 not, not whether it was parsed successfully.
9032 In the past if we were in: #if false ... #line #endif, we would
9033 resume parsing after `#line'. See bug 61604.
9035 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
9036 building: IsEnumType should return true only for enums, not for
9037 enums or System.Enum itself. This fixes #61593.
9039 Likely what happened is that corlib was wrong: mcs depended on
9040 this bug in some places. The bug got fixed, we had to add the
9041 hack, which caused bug 61593.
9043 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
9044 that was a workaround for the older conditions.
9046 2004-07-16 Ben Maurer <bmaurer@ximian.com>
9048 * assign.cs: IAssignMethod has a new interface, as documented
9049 inline. All assignment code now uses this new api.
9051 * ecore.cs, expression.cs: All classes which implement
9052 IAssignMethod now use the new interface.
9054 * expression.cs (Invocation): add a hack to EmitCall so that
9055 IndexerAccess can be the target of a compound assignment without
9056 evaluating its arguments twice.
9058 * statement.cs: Handle changes in Invocation api.
9060 2004-07-16 Martin Baulig <martin@ximian.com>
9062 * iterators.cs: Rewrote this. We're now using one single Proxy
9063 class for both the IEnumerable and the IEnumerator interface and
9064 `Iterator' derives from Class so we can use the high-level API.
9066 * class.cs (TypeContainer.AddIterator): New method.
9067 (TypeContainer.DoDefineType): New protected virtual method, which
9068 is called from DefineType().
9069 (TypeContainer.DoDefineMembers): Call DefineType() and
9070 DefineMembers() on all our iterators.
9071 (TypeContainer.Emit): Call Emit() on all our iterators.
9072 (TypeContainer.CloseType): Call CloseType() on all our iterators.
9074 * codegen.cs (EmitContext.CurrentIterator): New public field.
9076 2004-07-15 Martin Baulig <martin@ximian.com>
9079 (TypeManager.not_supported_exception_type): New type.
9081 2004-07-14 Martin Baulig <martin@ximian.com>
9083 * iterators.cs: Use real error numbers.
9085 2004-07-14 Martin Baulig <martin@ximian.com>
9087 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9088 requires this to be a System.Collection.IEnumerable and not a
9089 class implementing that interface.
9090 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
9092 2004-07-13 Marek Safar <marek.safar@seznam.cz>
9094 * class.cs: Fixed previous fix, it broke some error tests.
9096 2004-07-12 Martin Baulig <martin@ximian.com>
9098 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9101 2004-07-09 Miguel de Icaza <miguel@ximian.com>
9103 * assign.cs (LocalTemporary): Add new argument: is_address,If
9104 `is_address' is true, then the value that we store is the address
9105 to the real value, and not the value itself.
9107 * ecore.cs (PropertyExpr): use the new local temporary
9108 stuff to allow us to handle X.Y += z (where X is a struct)
9110 2004-07-08 Martin Baulig <martin@ximian.com>
9112 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9113 not always return, just like we're doing in Using.Resolve().
9115 2004-07-07 Miguel de Icaza <miguel@ximian.com>
9117 * cs-parser.jay (fixed_statement): flag this as Pinned.
9119 2004-07-06 Miguel de Icaza <miguel@ximian.com>
9121 * typemanager.cs (TypeManager): Removed MakePinned method, this
9122 mechanism is replaced with the .NET 2.x compatible mechanism of
9123 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9125 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
9126 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9127 `IsFixed' property which has a different meaning.
9129 2004-07-02 Raja R Harinath <rharinath@novell.com>
9131 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9132 visible from inside a nested class, not just the names of the
9133 immediately enclosing class.
9136 2004-06-24 Raja R Harinath <rharinath@novell.com>
9138 * expression.cs (BetterConversion): Remove buggy special-case
9139 handling of "implicit constant expression conversions". At this
9140 point, we already know that the conversion is possible -- we're
9141 only checking to see which is better.
9143 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9145 * cs-parser.jay: Added error CS0210 test.
9147 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9149 * cs-parser.jay: Added error CS0134 test.
9151 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9154 * cs-parser.jay: Added error CS0145 test.
9156 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9158 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9160 2004-06-23 Ben Maurer <bmaurer@ximian.com>
9162 * expression.cs (StackAlloc.Resolve): The argument may not
9163 be a constant; deal with this case.
9165 2004-06-23 Marek Safar <marek.safar@seznam.cz>
9167 * attribute.cs (IndexerName_GetIndexerName): Renamed to
9168 GetIndexerAttributeValue.
9169 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9171 * class.cs (Indexer.Define): Added error tests for CS0415,
9174 2004-06-23 Miguel de Icaza <miguel@ximian.com>
9176 * attribute.cs (Attribute.Resolve): Keep field code in sync with
9179 2004-06-23 Martin Baulig <martin@ximian.com>
9181 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9182 neither return nor throw, reset the barrier as well. Fixes #60457.
9184 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
9186 * class.cs : EventAttributes is now set to None by default.
9187 This fixes bug #60459.
9189 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9192 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9193 Don't throw exception but return null (it's sufficient now).
9195 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9197 * typemanager.cs (GetArgumentTypes): Faster implementation.
9199 2004-06-18 Martin Baulig <martin@ximian.com>
9201 * attribute.cs (Attribute.Resolve): Check whether we're an
9202 EmptyCast which a Constant child. Fixes #60333.
9204 2004-06-17 Ben Maurer <bmaurer@ximian.com>
9206 * statement.cs (EmitCollectionForeach): Account for the fact that
9207 not all valuetypes are in areas which we can take the address of.
9208 For these variables, we store to a temporary variable. Also, make
9209 sure that we dont emit a `callvirt' on a valuetype method.
9211 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9213 * expression.cs (StackAlloc.DoReSolve): Added test for
9214 negative parameter (CS0247).
9216 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9219 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9221 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9224 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9227 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9229 Fix bug #58254 & cs1555.cs, cs1556.cs
9230 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9232 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9234 * cs-parser.jay: Added error CS1669 test for indexers.
9236 2004-06-11 Martin Baulig <martin@ximian.com>
9238 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9239 call this twice: for params and varargs methods.
9241 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9244 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9246 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9248 * attribute.cs (Attribute.GetValidTargets): Made public.
9251 (AbstractPropertyEventMethod): New class for better code sharing.
9252 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9254 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9256 2004-06-11 Raja R Harinath <rharinath@novell.com>
9259 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
9260 that the call to Resolve is part of a MemberAccess.
9261 (Expression.Resolve): Use it for SimpleName resolution.
9262 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
9263 Add 'intermediate' boolean argument.
9264 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
9265 error message when the SimpleName can be resolved ambiguously
9266 between an expression and a type.
9267 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
9269 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
9270 call on the left-side.
9272 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9275 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
9277 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9279 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
9281 2004-06-11 Martin Baulig <martin@ximian.com>
9283 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
9284 varargs methods if applicable.
9286 2004-06-11 Martin Baulig <martin@ximian.com>
9288 * expression.cs (Invocation.EmitCall): Don't use
9289 `method.CallingConvention == CallingConventions.VarArgs' since the
9290 method could also have `CallingConventions.HasThis'.
9292 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9294 * class.cs (Event.GetSignatureForError): Implemented.
9295 Fixed crash in error test cs3010.cs
9297 2004-06-10 Miguel de Icaza <miguel@ximian.com>
9299 * cs-tokenizer.cs: Change the way we track __arglist to be
9300 consistent with the other keywords.
9302 2004-06-09 Miguel de Icaza <miguel@ximian.com>
9304 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
9307 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
9309 * codegen.cs: Check that all referenced assemblies have a strongname
9310 before strongnaming the compiled assembly. If not report error CS1577.
9311 Fix bug #56563. Patch by Jackson Harper.
9312 * typemanager.cs: Added a method to return all referenced assemblies.
9313 Fix bug #56563. Patch by Jackson Harper.
9315 2004-06-08 Marek Safar <marek.safar@seznam.cz>
9318 (Method.ApplyAttributeBuilder): Moved and added conditional
9319 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
9322 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
9324 2004-06-08 Marek Safar <marek.safar@seznam.cz>
9327 * class.cs: (EventField.attribute_targets): Changed default target.
9329 2004-06-08 Martin Baulig <martin@ximian.com>
9331 * expression.cs (Invocation.EmitCall): Enable varargs methods.
9333 2004-06-08 Martin Baulig <martin@ximian.com>
9335 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
9337 2004-06-07 Martin Baulig <martin@ximian.com>
9339 Added support for varargs methods.
9341 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
9344 * cs-parser.jay: Added support for `__arglist'.
9346 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
9348 * expression.cs (Argument.AType): Added `ArgList'.
9349 (Invocation): Added support for varargs methods.
9350 (ArglistAccess): New public class.
9351 (Arglist): New public class.
9353 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
9355 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
9356 a method's top-level block if the method has varargs.
9358 * support.cs (ReflectionParameters, InternalParameters): Added
9359 support for varargs methods.
9361 2004-06-07 Miguel de Icaza <miguel@ximian.com>
9363 * class.cs: Provide location in indexer error report.
9365 * driver.cs: Use standard names.
9367 * namespace.cs: Catch the use of using after a namespace has been
9368 declared also on using aliases.
9370 2004-06-03 Raja R Harinath <rharinath@novell.com>
9373 * typemanager.cs (closure_private_ok, closure_invocation_type)
9374 (closure_qualifier_type, closure_invocation_assembly)
9375 (FilterWithClosure): Move to ...
9376 (Closure): New internal nested class.
9377 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
9378 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
9379 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
9380 (MemberLookup, MemberLookupFailed): Use it.
9381 * expression.cs (New.DoResolve): Treat the lookup for the
9382 constructor as being qualified by the 'new'ed type.
9383 (Indexers.GetIndexersForTypeOrInterface): Update.
9385 2004-06-03 Marek Safar <marek.safar@seznam.cz>
9388 (GetConditionalAttributeValue): New method. Returns
9389 condition of ConditionalAttribute.
9390 (SearchMulti): New method. Returns all attributes of type 't'.
9391 Use it when attribute is AllowMultiple = true.
9392 (IsConditionalMethodExcluded): New method.
9395 (Method.IsExcluded): Implemented. Returns true if method has conditional
9396 attribute and the conditions is not defined (method is excluded).
9397 (IMethodData): Extended interface for ConditionalAttribute support.
9398 (PropertyMethod.IsExcluded): Implemented.
9401 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
9404 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
9407 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
9409 * expression.cs (ArrayCreationExpression): Make this just an
9410 `expression'. It can't be a statement, so the code here was
9413 2004-06-02 Marek Safar <marek.safar@seznam.cz>
9416 * typemanager.cs (GetFullNameSignature): New method for
9419 2004-06-02 Marek Safar <marek.safar@seznam.cz>
9422 * class.cs (MemberBase.GetSignatureForError): New virtual method.
9423 Use this method when MethodBuilder is null.
9424 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
9425 Added test for error CS0626 (MONO reports error for this situation).
9426 (IMethodData.GetSignatureForError): Extended interface.
9428 2004-06-01 Marek Safar <marek.safar@seznam.cz>
9431 (AttributeTester.GetObsoleteAttribute): Returns instance of
9432 ObsoleteAttribute when type is obsolete.
9435 (TypeContainer.VerifyObsoleteAttribute): Override.
9436 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9437 (MethodCode.VerifyObsoleteAttribute): Override.
9438 (MemberBase.VerifyObsoleteAttribute): Override.
9441 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9442 and report proper error.
9445 Delegate.VerifyObsoleteAttribute): Override.
9448 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9449 and report proper error.
9450 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9453 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9457 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9458 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9459 Added test for ObsoleteAttribute.
9462 (Catch): Derived from Statement.
9464 2004-06-01 Marek Safar <marek.safar@seznam.cz>
9466 Fixed bug #59071 & cs0160.cs
9468 * statement.cs (Try.Resolve): Check here whether order of catch
9469 clauses matches their dependencies.
9471 2004-05-31 Miguel de Icaza <miguel@ximian.com>
9473 * Reverted patch to namespace.cs (Use lookuptypedirect). This
9474 caused a regression: #59343. Referencing nested classes from an
9475 assembly stopped working.
9477 2004-05-31 Martin Baulig <martin@ximian.com>
9479 MCS is now frozen for beta 2.
9481 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9483 * convert.cs: add a trivial cache for overload operator resolution.
9485 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9487 * decl.cs: If possible, use lookuptypedirect here. We can only do
9488 this if there is no `.' after the namespace. Avoids using
9489 LookupType, which does lots of slow processing.
9490 (FindNestedType) New method, does what it says :-).
9491 * namespace.cs: use LookupTypeDirect.
9492 * rootcontext.cs: use membercache, if possible.
9493 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9495 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9498 According to the spec,
9500 In a member access of the form E.I, if E is a single identifier,
9501 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9502 field, property, localvariable, or parameter with the same type as
9503 the meaning of E as a type-name (§3.8), then both possible
9504 meanings of E are permitted.
9506 We did not check that E as a simple-name had the same type as E as
9509 This trivial check gives us 5-7% on bootstrap time.
9511 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9513 * expression.cs (Invocation.OverloadResolve): Avoid the
9514 use of hashtables and boxing here by allocating on demand.
9516 2004-05-30 Martin Baulig <martin@ximian.com>
9518 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9519 we're doing a silent lookup. Don't try to lookup nested types in
9520 TypeManager.object_type (thanks to Ben Maurer).
9522 2004-05-30 Martin Baulig <martin@ximian.com>
9524 Committing a patch from Ben Maurer.
9526 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9528 2004-05-29 Martin Baulig <martin@ximian.com>
9530 * class.cs (IMethodData.ShouldIgnore): New method.
9532 * typemanager.cs (TypeManager.MethodFlags): Don't take a
9533 `Location' argument, we don't need it anywhere. Use
9534 `IMethodData.ShouldIgnore ()' instead of
9535 `MethodData.GetMethodFlags ()'.
9536 (TypeManager.AddMethod): Removed.
9537 (TypeManager.AddMethod2): Renamed to AddMethod.
9539 2004-05-29 Martin Baulig <martin@ximian.com>
9541 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9543 * convert.cs (Convert.ImplicitReferenceConversion): If we're
9544 converting from a class type S to an interface type and we already
9545 have an object on the stack, don't box it again. Fixes #52578.
9547 2004-05-29 Martin Baulig <martin@ximian.com>
9549 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9550 Added support for `params' parameters. Fixes #59267.
9552 2004-05-29 Martin Baulig <martin@ximian.com>
9554 * literal.cs (NullPointer): Provide a private .ctor which sets
9555 `type' to TypeManager.object_type. Fixes #59048.
9557 2004-05-29 Martin Baulig <martin@ximian.com>
9559 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9560 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
9562 * ecore.cs (EventExpr.instance_expr): Make the field private.
9564 2004-05-26 Marek Safar <marek.safar@seznam.cz>
9566 Fixed bug #50080 & cs0214-2.cs
9567 * expression.cs (Cast.DoResolve): Check unsafe context here.
9569 * statement.cs (Resolve.DoResolve): Likewise.
9571 2004-05-26 Martin Baulig <martin@ximian.com>
9573 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9575 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9576 (RootContext.LookupType): Pass down the `silent' flag.
9578 2004-05-25 Martin Baulig <martin@ximian.com>
9581 (MethodGroupExpr.IdenticalTypeName): New public property.
9582 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9583 expression actually refers to a type.
9585 2004-05-25 Martin Baulig <martin@ximian.com>
9587 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9588 for #56176 and made it actually work.
9590 2004-05-25 Martin Baulig <martin@ximian.com>
9592 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9593 (FieldExpr, PropertyExpr): Override and implement
9594 CacheTemporaries. Fixes #52279.
9596 2004-05-25 Miguel de Icaza <miguel@ximian.com>
9598 * location.cs: In the new compiler listing a file twice is a
9599 warning, not an error.
9601 2004-05-24 Martin Baulig <martin@ximian.com>
9603 * enum.cs (Enum.DefineType): For the `BaseType' to be a
9604 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
9606 2004-05-24 Martin Baulig <martin@ximian.com>
9608 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9609 walking the `using' list. Fixes #53921.
9611 2004-05-24 Martin Baulig <martin@ximian.com>
9613 * const.cs (Const.LookupConstantValue): Added support for
9614 EmptyCast's; fixes #55251.
9616 2004-05-24 Martin Baulig <martin@ximian.com>
9618 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9619 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9620 which does the CS0135 check. The reason is that we first need to
9621 check whether the variable actually exists.
9623 2004-05-24 Martin Baulig <martin@ximian.com>
9625 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9626 than RootContext.LookupType() to find the explicit interface
9629 2004-05-24 Raja R Harinath <rharinath@novell.com>
9631 * Makefile: Simplify. Use executable.make.
9632 * mcs.exe.sources: New file. List of sources of mcs.exe.
9634 2004-05-24 Anders Carlsson <andersca@gnome.org>
9638 Use the invariant culture when doing String.Compare for CLS case
9641 2004-05-23 Martin Baulig <martin@ximian.com>
9643 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9644 don't have any dots. Fixes #52622, added cs0246-8.cs.
9646 * namespace.cs (NamespaceEntry.Lookup): Likewise.
9648 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9650 * class.cs (MemberBase.Define): Reuse MemberType member for
9651 resolved type. Other methods can use it too.
9653 2004-05-23 Martin Baulig <martin@ximian.com>
9655 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9656 the variable also exists in the current block (otherwise, we need
9657 to report a CS0103). Fixes #58670.
9659 2004-05-23 Martin Baulig <martin@ximian.com>
9661 * flowanalysis.cs (Reachability.Reachable): Compute this
9662 on-the-fly rather than storing it as a field.
9664 2004-05-23 Martin Baulig <martin@ximian.com>
9666 * flowanalysis.cs (Reachability.And): Manually compute the
9667 resulting `barrier' from the reachability.
9669 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9672 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9673 instance of ObsoleteAttribute when symbol is obsolete.
9676 (IMethodData): Extended interface for ObsoleteAttribute support.
9678 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9680 * attribute.cs: Fix bug #55970
9682 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9686 (GetObsoleteAttribute): New method. Creates the instance of
9688 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9689 ObsoleteAttribute when member is obsolete.
9690 (AttributeTester.Report_ObsoleteMessage): Common method for
9691 Obsolete error/warning reporting.
9694 (TypeContainer.base_classs_type): New member for storing parent type.
9697 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9698 for this MemberCore.
9700 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9702 * attribute.cs, const.cs: Fix bug #58590
9704 2004-05-21 Martin Baulig <martin@ximian.com>
9706 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9707 out parameters if the end of the method is unreachable. Fixes
9710 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9712 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9713 Hari was right, why extra method.
9715 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9717 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9719 2004-05-20 Martin Baulig <martin@ximian.com>
9721 Merged this back from gmcs to keep the differences to a minumum.
9723 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
9724 instead of a Declspace.
9725 (Attribute.ResolveType): Likewise.
9726 (Attributes.Search): Likewise.
9727 (Attributes.Contains): Likewise.
9728 (Attributes.GetClsCompliantAttribute): Likewise.
9730 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
9732 (MethodData.ApplyAttributes): Take an EmitContext instead of a
9735 2004-05-19 Marek Safar <marek.safar@seznam.cz>
9737 Fix bug #58688 (MCS does not report error when the same attribute
9740 * attribute.cs (Attribute.Emit): Distinction between null and default.
9742 2004-05-19 Raja R Harinath <rharinath@novell.com>
9744 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9745 of a top-level attribute without an attribute target.
9746 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
9748 (Attribute.Conditional_GetConditionName),
9749 (Attribute.Obsolete_GetObsoleteMessage): Update.
9750 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
9751 part of ScanForIndexerName.
9752 (Attribute.CanIgnoreInvalidAttribute): New function.
9753 (Attribute.ScanForIndexerName): Move to ...
9754 (Attributes.ScanForIndexerName): ... here.
9755 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9756 (Attributes.Search): New internal variant that can choose not to
9757 complain if types aren't resolved. The original signature now
9759 (Attributes.GetClsCompliantAttribute): Use internal variant, with
9760 complaints suppressed.
9761 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9762 only if it not useful.
9763 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9764 top-level for attributes that are shared between the assembly
9765 and a top-level class.
9766 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9767 * class.cs: Update to reflect changes.
9768 (DefineIndexers): Fuse loops.
9769 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
9770 a couple more variants of attribute names.
9772 2004-05-18 Marek Safar <marek.safar@seznam.cz>
9774 Fix bug #52585 (Implemented explicit attribute declaration)
9777 (Attributable.ValidAttributeTargets): New abstract method. It gets
9778 list of valid attribute targets for explicit target declaration.
9779 (Attribute.Target): It holds target itself.
9780 (AttributeSection): Removed.
9781 (Attribute.CheckTargets): New method. It checks whether attribute
9782 target is valid for the current element.
9785 (EventProperty): New class. For events that are declared like
9786 property (with add and remove accessors).
9787 (EventField): New class. For events that are declared like field.
9790 * cs-parser.jay: Implemented explicit attribute target declaration.
9792 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
9793 Override ValidAttributeTargets.
9796 (ReturnParameter): Class for applying custom attributes on
9798 (ParameterAtribute): New class. Class for applying custom
9799 attributes on the parameter type.
9801 2004-05-17 Miguel de Icaza <miguel@ximian.com>
9803 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9806 (Method): Allow UNSAFE here.
9808 * modifiers.cs: Support unsafe reporting.
9810 2004-05-17 Marek Safar <marek.safar@seznam.cz>
9812 * decl.cs: Fix bug #58478.
9814 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9816 * statement.cs: When checking for unreachable code on an EmptyStatement,
9817 set the location. Fixes bug #58488.
9819 2004-05-13 Miguel de Icaza <miguel@ximian.com>
9821 * driver.cs: Add -pkg handling.
9823 From Gonzalo: UseShelLExecute=false
9825 2004-05-12 Marek Safar <marek.safar@seznam.cz>
9828 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9830 (Attribute.IsClsCompliaceRequired): Moved to base for better
9832 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9833 when attribute is AttributeUsageAttribute.
9834 (Attribute.GetValidTargets): Simplified.
9835 (Attribute.GetAttributeUsage): New method returns AttributeUsage
9836 attribute for this type.
9837 (Attribute.ApplyAttributes): Method renamed to Emit and make
9839 (GlobalAttributeSection): New class for special handling of global
9840 attributes (assembly, module).
9841 (AttributeSection.Emit): New method.
9843 * class.cs: Implemented Attributable abstract methods.
9844 (MethodCore.LabelParameters): Moved to Parameter class.
9845 (Accessor): Is back simple class.
9846 (PropertyMethod): Implemented Attributable abstract class.
9847 (DelegateMethod): Implemented Attributable abstract class.
9848 (Event): New constructor for disctintion between normal Event
9849 and Event with accessors.
9851 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9853 * codegen.cs, const.cs, decl.cs, delegate.cs:
9854 (CommonAssemblyModulClass): Implemented Attributable abstract class
9857 * enum.cs: Implement IAttributeSupport interface.
9858 (EnumMember): New class for emum members. Implemented Attributable
9862 (ParameterBase): Is abstract.
9863 (ReturnParameter): New class for easier [return:] attribute handling.
9865 * typemanager.cs: Removed builder_to_attr.
9867 2004-05-11 Raja R Harinath <rharinath@novell.com>
9870 * attribute.cs (Attribute.GetPositionalValue): New function.
9871 * class.cs (TypeContainer.VerifyMembers): New function.
9872 (TypeContainer.Emit): Use it.
9873 (ClassOrStruct): New base class for Class and Struct.
9874 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
9875 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9877 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9878 then each non-static field should have a FieldOffset attribute.
9879 Otherwise, none of the fields should have a FieldOffset attribute.
9880 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
9881 and FieldOffset attributes.
9882 * typemanager.cs (TypeManager.struct_layout_attribute_type)
9883 (TypeManager.field_offset_attribute_type): New core types.
9884 (TypeManager.InitCoreTypes): Initialize them.
9886 2004-05-11 Michal Moskal <malekith@pld-linux.org>
9888 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9889 Return correct type.
9892 2004-05-09 Miguel de Icaza <miguel@ximian.com>
9894 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9895 be implicitly converted to ulong.
9897 * expression.cs: The logic for allowing operator &, | and ^ worked
9898 was wrong, it worked before because we did not report an error in
9899 an else branch. Fixes 57895.
9901 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9902 allow volatile fields to be reference types.
9904 2004-05-07 Miguel de Icaza <miguel@ximian.com>
9906 * driver.cs: Add support for /debug-
9908 2004-05-07 Raja R Harinath <rharinath@novell.com>
9910 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
9911 Add a 'complain' parameter to silence errors.
9912 (Attribute.Resolve): Update to changes. Put in sanity check to catch
9913 silently overlooked type-resolutions.
9914 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9916 (Attributes.Search): New function.
9917 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9918 (Attributes.GetAttributeFullName): Remove hack.
9919 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9920 Update to reflect changes.
9921 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9922 Use Attributes.Search instead of nested loops.
9924 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9927 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9928 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9929 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9931 * report.cs: (Report.Warning): Renamed to Warning_T because of
9932 parameter collision.
9934 2004-05-05 Raja R Harinath <rharinath@novell.com>
9936 * expression.cs (MemberAccess.ResolveMemberAccess):
9937 Exit with non-zero status after Report.Error.
9938 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9940 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9942 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9944 * support.cs: Don't hang when the file is empty.
9946 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9948 * support.cs: In SeekableStreamReader, compute the preamble size of the
9949 underlying stream. Position changes should take into account that initial
9952 2004-05-03 Todd Berman <tberman@sevenl.net>
9954 * driver.cs: remove unused GetSysVersion function.
9956 2004-05-03 Todd Berman <tberman@sevenl.net>
9958 * driver.cs: Remove the hack from saturday, as well as the hack
9959 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9960 link_paths to get that bit proper.
9962 2004-05-01 Todd Berman <tberman@sevenl.net>
9964 * driver.cs: Try a LoadFrom before a Load, this checks the current
9965 path. This is currently a bug in mono that is be fixed, however, this
9966 provides a workaround for now. This will be removed when the bug
9969 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9971 * CryptoConvert.cs: Updated to latest version. Fix issue with
9972 incomplete key pairs (#57941).
9974 2004-05-01 Todd Berman <tberman@sevenl.net>
9976 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9979 2004-04-30 Jackson Harper <jackson@ximian.com>
9981 * codegen.cs: Open keys readonly.
9983 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9985 * typemanager.cs: don't report cyclic struct layout when a struct
9986 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9987 which has 2 Pango.Rectangle fields.
9989 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9991 * expression.cs: Handle IntPtr comparisons with IL code
9992 rather than a method call.
9994 2004-04-29 Martin Baulig <martin@ximian.com>
9996 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9997 the list of PropertyInfo's in class hierarchy and find the
9998 accessor. Fixes #56013.
10000 2004-04-29 Martin Baulig <martin@ximian.com>
10002 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10004 2004-04-29 Martin Baulig <martin@ximian.com>
10006 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10008 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10010 2004-04-29 Martin Baulig <martin@ximian.com>
10012 * class.cs (ConstructorInitializer.Resolve): Check whether the
10013 parent .ctor is accessible. Fixes #52146.
10015 2004-04-29 Martin Baulig <martin@ximian.com>
10017 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10019 * statement.cs (Using.EmitLocalVariableDecls): Use
10020 TypeManager.idisposable_type, not typeof (IDisposable).
10021 (Foreach.EmitCollectionForeach): Added support for valuetypes.
10023 2004-04-29 Martin Baulig <martin@ximian.com>
10025 * class.cs (Event.Define): Don't emit the field and don't set
10026 RTSpecialName and SpecialName for events on interfaces. Fixes
10029 2004-04-29 Raja R Harinath <rharinath@novell.com>
10031 Refactor Attribute.ApplyAttributes.
10032 * attribute.cs (Attributable): New base class for objects that can
10033 have Attributes applied on them.
10034 (Attribute): Make AttributeUsage fields public.
10035 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10036 (Attribute.IsInternalCall): New property.
10037 (Attribute.UsageAttr): Convert to a public read-only property.
10038 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10039 (Attribute.ResolveType, Attribute.Resolve)
10040 (Attribute.ScanForIndexerName): Update to reflect changes.
10041 (Attribute.CheckAttributeTarget): Re-format.
10042 (Attribute.ApplyAttributes): Refactor, to various
10043 Attributable.ApplyAttributeBuilder methods.
10044 * decl.cs (MemberCore): Make Attributable.
10045 * class.cs (Accessor): Make Attributable.
10046 (MethodData.ApplyAttributes): Use proper attribute types, not
10048 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10049 (TypeContainer.ApplyAttributeBuilder)
10050 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10051 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
10052 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10053 (Operator.ApplyAttributeBuilder): New factored-out methods.
10054 * const.cs (Const.ApplyAttributeBuilder): Likewise.
10055 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10056 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10057 * parameter.cs (ParameterBase): New Attributable base class
10058 that can also represent Return types.
10059 (Parameter): Update to the changes.
10061 2004-04-29 Jackson Harper <jackson@ximian.com>
10063 * driver.cs: Prefer the corlib system version when looking for
10064 assemblies in the GAC. This is still a hack, but its a better hack
10067 2004-04-29 Marek Safar <marek.safar@seznam.cz>
10069 * decl.cs, enum.cs: Improved error 3005 reporting.
10071 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10072 (related_symbols): New private member for list of symbols
10073 related to reported error/warning.
10075 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10077 2004-04-29 Martin Baulig <martin@ximian.com>
10079 * ecore.cs (Expression.Constantify): If we're an enum and
10080 TypeManager.TypeToCoreType() doesn't give us another type, use
10081 t.UnderlyingSystemType. Fixes #56178.
10083 2004-04-29 Martin Baulig <martin@ximian.com>
10085 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10086 interfaces and for each interface, only add members directly
10087 declared in that interface. Fixes #53255.
10089 2004-04-28 Martin Baulig <martin@ximian.com>
10091 * expression.cs (ConditionalLogicalOperator): Use a temporary
10092 variable for `left' to avoid that we evaluate it more than once;
10095 2004-04-28 Martin Baulig <martin@ximian.com>
10097 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10100 2004-04-28 Martin Baulig <martin@ximian.com>
10102 * statement.cs (LocalInfo.Resolve): Check whether the type is not
10105 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10106 whether the type is not void (CS1547).
10108 2004-04-28 Martin Baulig <martin@ximian.com>
10110 * expression.cs (Unary.DoResolveLValue): Override this and report
10111 CS0131 for anything but Operator.Indirection.
10113 2004-04-28 Martin Baulig <martin@ximian.com>
10115 Committing a patch from Ben Maurer; see bug #50820.
10117 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10120 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10123 2004-04-28 Martin Baulig <martin@ximian.com>
10125 Committing a patch from Ben Maurer; see bug #50820.
10127 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10130 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10133 2004-04-28 Martin Baulig <martin@ximian.com>
10135 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10136 (Block.AddLabel): Call DoLookupLabel() to only search in the
10139 2004-04-28 Martin Baulig <martin@ximian.com>
10141 * cfold.cs (ConstantFold.BinaryFold): Added special support for
10142 comparing StringConstants and NullLiterals in Equality and Inequality.
10144 2004-04-28 Jackson Harper <jackson@ximian.com>
10146 * driver.cs: Attempt to load referenced assemblies from the
10147 GAC. This is the quick and dirty version of this method that
10148 doesnt take into account versions and just takes the first
10149 canidate found. Will be good enough for now as we will not have more
10150 then one version installed into the GAC until I update this method.
10152 2004-04-28 Martin Baulig <martin@ximian.com>
10154 * typemanager.cs (TypeManager.CheckStructCycles): New public
10155 static method to check for cycles in the struct layout.
10157 * rootcontext.cs (RootContext.PopulateTypes): Call
10158 TypeManager.CheckStructCycles() for each TypeContainer.
10159 [Note: We only need to visit each type once.]
10161 2004-04-28 Martin Baulig <martin@ximian.com>
10163 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10165 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10166 success and added `out object value'. Use a `bool resolved' field
10167 to check whether we've already been called rather than
10168 `ConstantValue != null' since this breaks for NullLiterals.
10170 2004-04-28 Raja R Harinath <rharinath@novell.com>
10172 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10173 setting of this flag, since the 'set' method may be non-public.
10175 2004-04-28 Raja R Harinath <rharinath@novell.com>
10177 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10178 check on current_vector.Block.
10180 2004-04-27 Martin Baulig <martin@ximian.com>
10182 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10183 a field initializer. Fixes #56459.
10185 2004-04-27 Martin Baulig <martin@ximian.com>
10187 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10188 we're not attempting to use an indexer. Fixes #52154.
10190 2004-04-27 Martin Baulig <martin@ximian.com>
10192 * statement.cs (Return): Don't create a return label if we don't
10193 need it; reverts my change from January 20th. Thanks to Ben
10196 2004-04-27 Martin Baulig <martin@ximian.com>
10198 According to the spec, `goto' can only leave a nested scope, but
10201 * statement.cs (Block.LookupLabel): Only lookup in the current
10202 block, don't recurse into parent or child blocks.
10203 (Block.AddLabel): Check in parent and child blocks, report
10204 CS0140/CS0158 if we find a duplicate.
10205 (Block): Removed this indexer for label lookups.
10206 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10207 this already does the error reporting for us.
10210 (FlowBranching.UsageVector.Block): New public variable; may be null.
10211 (FlowBranching.CreateSibling): Added `Block' argument.
10212 (FlowBranching.LookupLabel): New public virtual method. Lookup a
10213 label for the target of a `goto' and check whether we're not
10214 leaving a `finally'.
10216 2004-04-27 Martin Baulig <martin@ximian.com>
10218 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10219 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10222 2004-04-27 Martin Baulig <martin@ximian.com>
10224 * statement.cs (Block.AddLabel): Also check for implicit blocks
10225 and added a CS0158 check.
10227 2004-04-27 Martin Baulig <martin@ximian.com>
10229 * flowanalysis.cs (FlowBranchingLoop): New class.
10230 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10231 UsageVector's instead of an ArrayList.
10232 (FlowBranching.Label): Likewise.
10233 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10234 (FlowBranching.AddBreakVector): New method.
10236 2004-04-27 Miguel de Icaza <miguel@ximian.com>
10238 * attribute.cs: Small regression fix: only convert the type if we
10239 the type is different, fixes System.Drawing build.
10241 2004-04-27 Martin Baulig <martin@ximian.com>
10243 * attribute.cs (Attribute.Resolve): If we have a constant value
10244 for a named field or property, implicity convert it to the correct
10247 2004-04-27 Raja R Harinath <rharinath@novell.com>
10249 * statement.cs (Block.Block): Implicit blocks share
10250 'child_variable_names' fields with parent blocks.
10251 (Block.AddChildVariableNames): Remove.
10252 (Block.AddVariable): Mark variable as "used by a child block" in
10253 every surrounding block.
10254 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10255 been used in a child block, complain about violation of "Invariant
10256 meaning in blocks" rule.
10257 * cs-parser.jay (declare_local_variables): Don't use
10258 AddChildVariableNames.
10259 (foreach_statement): Don't create an implicit block: 'foreach'
10260 introduces a scope.
10262 2004-04-23 Miguel de Icaza <miguel@ximian.com>
10264 * convert.cs (ImplicitNumericConversion): 0 is also positive when
10265 converting from 0L to ulong. Fixes 57522.
10267 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10269 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10270 derived class hides via 'new' keyword field from base class (test-242.cs).
10271 TODO: Handle this in the more general way.
10273 * class.cs (CheckBase): Ditto.
10275 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10277 * decl.cs (caching_flags): New member for storing cached values
10279 (MemberCore.Flags): New enum where bit flags for caching_flags
10281 (MemberCore.cls_compliance): Moved to caching_flags.
10282 (DeclSpace.Created): Moved to caching_flags.
10284 * class.cs: Use caching_flags instead of DeclSpace.Created
10286 2004-04-21 Miguel de Icaza <miguel@ximian.com>
10288 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10289 if we are only a derived class, not a nested class.
10291 * typemanager.cs: Same as above, but do this at the MemberLookup
10292 level (used by field and methods, properties are handled in
10293 PropertyExpr). Allow for the qualified access if we are a nested
10296 2004-04-21 Marek Safar <marek.safar@seznam.cz>
10298 * class.cs: Refactoring.
10299 (IMethodData): New inteface; Holds links to parent members
10300 to avoid member duplication (reduced memory allocation).
10301 (Method): Implemented IMethodData interface.
10302 (PropertyBase): New inner classes for get/set methods.
10303 (PropertyBase.PropertyMethod): Implemented IMethodData interface
10304 (Event): New inner classes for add/remove methods.
10305 (Event.DelegateMethod): Implemented IMethodData interface.
10307 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10308 EmitContext (related to class.cs refactoring).
10310 2004-04-21 Raja R Harinath <rharinath@novell.com>
10312 * delegate.cs (Delegate.VerifyApplicability): If the number of
10313 arguments are the same as the number of parameters, first try to
10314 verify applicability ignoring any 'params' modifier on the last
10318 2004-04-16 Raja R Harinath <rharinath@novell.com>
10320 * class.cs (TypeContainer.AddIndexer): Use
10321 'ExplicitInterfaceName' to determine if interface name was
10322 explicitly specified. 'InterfaceType' is not initialized at this time.
10323 (TypeContainer.DefineIndexers): Remove use of temporary list. The
10324 Indexers array is already in the required order. Initialize
10325 'IndexerName' only if there are normal indexers.
10326 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10327 (TypeContainer.Emit): Emit DefaultMember attribute only if
10328 IndexerName is initialized.
10331 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
10333 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10336 2004-04-15 Raja R Harinath <rharinath@novell.com>
10338 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10342 * attribute.cs (Attribute.Resolve): Check for duplicate named
10346 2004-04-15 Miguel de Icaza <miguel@ximian.com>
10348 * iterators.cs (MarkYield): track whether we are in an exception,
10349 and generate code accordingly. Use a temporary value to store the
10350 result for our state.
10352 I had ignored a bit the interaction of try/catch with iterators
10353 since their behavior was not entirely obvious, but now it is
10354 possible to verify that our behavior is the same as MS .NET 2.0
10358 2004-04-14 Miguel de Icaza <miguel@ximian.com>
10360 * iterators.cs: Avoid creating temporaries if there is no work to
10363 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10364 Enumerations, use TypeManager.EnumToUnderlying and call
10367 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10370 (This.Emit): Use EmitContext.EmitThis to emit our
10373 (This.EmitAssign): Ditto.
10375 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10376 codepaths, we will move all the functionality into
10379 (FieldExpr.EmitAssign): Ditto.
10381 This fixes several hidden bugs that I uncovered while doing a code
10382 review of this today.
10384 * codegen.cs (EmitThis): reworked so the semantics are more clear
10385 and also support value types "this" instances.
10387 * iterators.cs: Changed so that for iterators in value types, we
10388 do not pass the value type as a parameter.
10390 Initialization of the enumerator helpers is now done in the caller
10391 instead of passing the parameters to the constructors and having
10392 the constructor set the fields.
10394 The fields have now `assembly' visibility instead of private.
10396 2004-04-11 Miguel de Icaza <miguel@ximian.com>
10398 * expression.cs (Argument.Resolve): Check if fields passed as ref
10399 or out are contained in a MarshalByRefObject.
10401 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10402 another compiler type.
10404 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
10406 * class.cs (Indexer.Define): use the new name checking method.
10407 Also, return false on an error.
10408 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10409 (is_identifier_[start/part]_character): make static.
10411 2004-04-10 Miguel de Icaza <miguel@ximian.com>
10413 * expression.cs (Binary.ResolveOperator): Do no append strings
10414 twice: since we can be invoked more than once (array evaluation)
10415 on the same concatenation, take care of this here. Based on a fix
10416 from Ben (bug #56454)
10418 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10420 * codegen.cs: Fix another case where CS1548 must be reported (when
10421 delay-sign isn't specified and no private is available #56564). Fix
10422 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10423 error when MCS is used on the MS runtime and we need to delay-sign
10424 (which seems unsupported by AssemblyBuilder - see #56621).
10426 2004-04-08 Marek Safar <marek.safar@seznam.cz>
10428 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10429 (TypeManager.ComputeNamespaces): Faster implementation for
10432 * compiler.csproj: Updated AssemblyName to mcs.
10434 2004-04-07 Miguel de Icaza <miguel@ximian.com>
10436 * rootcontext.cs: Add new types to the boot resolution.
10438 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10439 MulticastDelegate is not allowed.
10441 * typemanager.cs: Add new types to lookup: System.TypedReference
10444 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10445 check for TypedReference or ArgIterator, they are not allowed.
10447 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10448 makes us properly catch 1510 in some conditions (see bug 56016 for
10451 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
10453 * CryptoConvert.cs: update from corlib version
10456 2004-04-05 Miguel de Icaza <miguel@ximian.com>
10458 * class.cs (Indexer.Define): Check indexername declaration
10460 2004-04-05 Marek Safar <marek.safar@seznam.cz>
10462 * attribute.cs (IsClsCompliant): Fixed problem with handling
10463 all three states (compliant, not-compliant, undetected).
10465 2004-03-30 Marek Safar <marek.safar@seznam.cz>
10467 * attribute.cs (Attribute): Location is now public.
10468 (Resolve): Store resolved arguments (pos_values) in attribute class.
10469 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10470 (GetClsCompliantAttributeValue): New method that gets
10471 CLSCompliantAttribute value.
10472 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10473 if exists else null.
10474 (AttributeTester): New class for CLS-Compliant verification routines.
10476 * class.cs (Emit): Add CLS-Compliant verification.
10477 (Method.GetSignatureForError): Implemented.
10478 (Constructor.GetSignatureForError): Implemented
10479 (Constructor.HasCompliantArgs): Returns if constructor has
10480 CLS-Compliant arguments.
10481 (Constructor.Emit): Override.
10482 (Construcor.IsIdentifierClsCompliant): New method; For constructors
10483 is needed to test only parameters.
10484 (FieldBase.GetSignatureForError): Implemented.
10485 (TypeContainer): New member for storing base interfaces.
10486 (TypeContainer.FindMembers): Search in base interfaces too.
10488 * codegen.cs (GetClsComplianceAttribute): New method that gets
10489 assembly or module CLSCompliantAttribute value.
10490 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10492 (ModuleClass.Emit): Add error 3012 test.
10494 * const.cs (Emit): Override and call base for CLS-Compliant tests.
10496 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10497 state for all decl types.
10498 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10499 if CLS-Compliant tests are required.
10500 (IsClsCompliaceRequired): New method. Analyze whether code
10501 must be CLS-Compliant.
10502 (IsExposedFromAssembly): New method. Returns true when MemberCore
10503 is exposed from assembly.
10504 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10505 value or gets cached value.
10506 (HasClsCompliantAttribute): New method. Returns true if MemberCore
10507 is explicitly marked with CLSCompliantAttribute.
10508 (IsIdentifierClsCompliant): New abstract method. This method is
10509 used to testing error 3005.
10510 (IsIdentifierAndParamClsCompliant): New method. Common helper method
10511 for identifier and parameters CLS-Compliant testing.
10512 (VerifyClsCompliance): New method. The main virtual method for
10513 CLS-Compliant verifications.
10514 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10515 null. I don't know why is null (too many public members !).
10516 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10517 and get value of first CLSCompliantAttribute that found.
10519 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10520 (VerifyClsCompliance): Override and add extra tests.
10522 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10523 clscheck- disable CLS-Compliant verification event if assembly is has
10524 CLSCompliantAttribute(true).
10526 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10527 ApllyAttribute is now called in emit section as in the other cases.
10528 Possible future Emit integration.
10529 (IsIdentifierClsCompliant): New override.
10530 (VerifyClsCompliance): New override.
10531 (GetEnumeratorName): Returns full enum name.
10533 * parameter.cs (GetSignatureForError): Implemented.
10535 * report.cs (WarningData): New struct for Warning message information.
10536 (LocationOfPreviousError): New method.
10537 (Warning): New method. Reports warning based on the warning table.
10538 (Error_T): New method. Reports error based on the error table.
10540 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10541 verifications are done here.
10543 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10545 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10546 CLSCompliantAttribute.
10547 (all_imported_types): New member holds all imported types from other
10549 (LoadAllImportedTypes): New method fills static table with exported types
10550 from all referenced assemblies.
10551 (Modules): New property returns all assembly modules.
10553 2004-03-30 Miguel de Icaza <miguel@ximian.com>
10555 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10556 throwing a parser error.
10558 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10559 which removes the hardcoded get_/set_ prefixes for properties, as
10560 IL allows for the properties to be named something else.
10564 * expression.cs: Do not override operand before we know if it is
10565 non-null. Fix 56207
10567 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10569 * typemanager.cs: support for pinned variables.
10571 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10573 * decl.cs, typemanager.cs: Avoid using an arraylist
10574 as a buffer if there is only one result set.
10576 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10578 * expression.cs: Make sure you cant call a static method
10579 with an instance expression, bug #56174.
10581 2004-03-29 Miguel de Icaza <miguel@ximian.com>
10583 * class.cs (IsDuplicateImplementation): Improve error reporting to
10584 flag 663 (method only differs in parameter modifier).
10586 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10587 in preprocessor directives.
10589 * location.cs (LookupFile): Allow for the empty path.
10591 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
10592 better approach for some of that patch, but its failing with the
10593 CharSet enumeration. For now try/catch will do.
10595 * typemanager.cs: Do not crash if a struct does not have fields.
10598 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10600 * expression.cs: cs0213, cant fix a fixed expression.
10603 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10605 * cs-parser.jay: detect invalid embeded statements gracefully.
10608 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10610 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10613 the invocation type may not be a subclass of the tye of the item/
10614 The type of the item must be a subclass of the invocation item.
10619 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
10621 * attribute.cs: Added methods to get a string and a bool from an
10622 attribute. Required to information from AssemblyKeyFileAttribute,
10623 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10624 * codegen.cs: Modified AssemblyName creation to include support for
10625 strongnames. Catch additional exceptions to report them as CS1548.
10626 * compiler.csproj: Updated include CryptoConvert.cs.
10627 * compiler.csproj.user: Removed file - user specific configuration.
10628 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
10629 Mono.Security assembly. The original class is maintained and tested in
10630 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10631 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10632 like CSC 8.0 (C# v2) supports.
10633 * Makefile: Added CryptoConvert.cs to mcs sources.
10634 * rootcontext.cs: Added new options for strongnames.
10636 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
10638 * driver.cs: For --expect-error, report error code `2'
10639 if the program compiled with no errors, error code `1' if
10640 it compiled with an error other than the one expected.
10642 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
10644 * compiler.csproj: Updated for Visual Studio .NET 2003.
10645 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10646 * compiler.sln: Updated for Visual Studio .NET 2003.
10648 2004-03-24 Ravi Pratap M <ravi@ximian.com>
10650 * expression.cs: Fix bug #47234. We basically need to apply the
10651 rule that we prefer the conversion of null to a reference type
10652 when faced with a conversion to 'object' (csc behaviour).
10654 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10656 * statement.cs: Shorter form for foreach, eliminates
10657 a local variable. r=Martin.
10659 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10661 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10662 checks if we can use brtrue/brfalse to test for 0.
10663 * expression.cs: use the above in the test for using brtrue/brfalse.
10664 cleanup code a bit.
10666 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10668 * expression.cs: Rewrite string concat stuff. Benefits:
10670 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10671 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10672 rather than a concat chain.
10674 * typemanager.cs: Add lookups for more concat overloads.
10676 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10678 * expression.cs: Emit shorter il code for array init.
10695 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
10697 * statement.cs: Before, two switch blocks would be merged if the
10698 total size of the blocks (end_item - begin_item + 1) was less than
10699 two times the combined sizes of the blocks.
10701 Now, it will only merge if after the merge at least half of the
10706 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
10708 * class.cs : csc build fix for GetMethods(). See bug #52503.
10710 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
10712 * expression.cs: Make sure fp comparisons work with NaN.
10713 This fixes bug #54303. Mig approved this patch a long
10714 time ago, but we were not able to test b/c the runtime
10717 2004-03-19 Miguel de Icaza <miguel@ximian.com>
10719 * ecore.cs (TypExpr.GetHashCode): implement this overload.
10721 2004-03-19 Martin Baulig <martin@ximian.com>
10723 * class.cs (MemberCore.IsDuplicateImplementation): Report the
10724 error here and not in our caller.
10726 2004-03-19 Martin Baulig <martin@ximian.com>
10728 * interface.cs: Completely killed this file.
10729 (Interface): We're now a TypeContainer and live in class.cs.
10731 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10732 argument; we're now also called for interfaces.
10733 (TypeContainer.DefineMembers): Allow this method being called
10735 (TypeContainer.GetMethods): New public method; formerly known as
10736 Interface.GetMethod(). This is used by PendingImplementation.
10737 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10738 it's now private and non-static.
10739 (Interface): Moved this here; it's now implemented similar to
10741 (Method, Property, Event, Indexer): Added `bool is_interface'
10742 argument to their .ctor's.
10743 (MemberBase.IsInterface): New public field.
10745 * cs-parser.jay: Create normal Method, Property, Event, Indexer
10746 instances instead of InterfaceMethod, InterfaceProperty, etc.
10747 (opt_interface_base): Removed; we now use `opt_class_base' instead.
10748 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10750 2004-03-19 Martin Baulig <martin@ximian.com>
10752 * class.cs (MethodCore.IsDuplicateImplementation): New private
10753 method which does the CS0111 checking.
10754 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10755 Use IsDuplicateImplementation().
10757 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
10759 * decl.cs (FindMemberToOverride): New method to find the correct
10760 method or property to override in the base class.
10762 - Make Method/Property use the above method to find the
10763 version in the base class.
10764 - Remove the InheritableMemberSignatureCompare as it is now
10767 This patch makes large code bases much faster to compile, as it is
10768 O(n) rather than O(n^2) to do this validation.
10770 Also, it fixes bug 52458 which is that nested classes are not
10771 taken into account when finding the base class member.
10773 Reviewed/Approved by Martin.
10775 2004-03-17 Marek Safar <marek.safar@seznam.cz>
10777 * interface.cs: In all interface classes removed redundant
10778 member initialization.
10780 2004-03-16 Martin Baulig <martin@ximian.com>
10782 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10784 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10786 * decl.cs (DefineTypeAndParents): New helper method to define a
10787 type's containers before the type itself is defined; This is a
10788 bug exposed by the recent changes to Windows.Forms when an
10789 implemented interface was defined inside a class that had not been
10792 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10794 (Check): Loop correctly to report errors modifiers
10795 (UNSAFE was not in the loop, since it was the same as TOP).
10797 * interface.cs: Every interface member now takes a ModFlags,
10798 instead of a "is_new" bool, which we set on the base MemberCore.
10800 Every place where we called "UnsafeOk" in the interface, now we
10801 call the proper member (InterfaceMethod.UnsafeOK) instead to get
10802 the unsafe settings from the member declaration instead of the
10803 container interface.
10805 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
10807 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10808 `set_indexer_name' to the pending bits (one per type).
10810 We fixed a bug today that was picking the wrong method to
10811 override, since for properties the existing InterfaceMethod code
10812 basically ignored the method name. Now we make sure that the
10813 method name is one of the valid indexer names.
10815 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
10817 * support.cs (SeekableStreamReader): Keep track of stream byte
10818 positions and don't mix them with character offsets to the buffer.
10820 Patch from Gustavo Giráldez
10822 2004-03-15 Marek Safar <marek.safar@seznam.cz>
10824 * interface.cs (InterfaceSetGetBase): Removed double member
10825 initialization, base class does it as well.
10827 2004-03-13 Martin Baulig <martin@ximian.com>
10829 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10830 when compiling corlib.
10832 2004-03-13 Miguel de Icaza <miguel@ximian.com>
10834 * convert.cs (ExplicitConversion): We were reporting an error on
10835 certain conversions (object_type source to a value type, when the
10836 expression was `null') before we had a chance to pass it through
10837 the user defined conversions.
10839 * driver.cs: Replace / and \ in resource specifications to dots.
10842 * class.cs: Add check for duplicate operators. Fixes 52477
10844 2004-03-11 Miguel de Icaza <miguel@ximian.com>
10846 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10847 that are in the middle of the statements, not only at the end.
10850 * class.cs (TypeContainer.AddField): No longer set the
10851 `HaveStaticConstructor' flag, now we call it
10852 `UserDefineStaticConstructor' to diferentiate the slightly
10853 semantic difference.
10855 The situation is that we were not adding BeforeFieldInit (from
10856 Modifiers.TypeAttr) to classes that could have it.
10857 BeforeFieldInit should be set to classes that have no static
10862 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10864 And most importantly Zoltan's comment:
10866 http://bugzilla.ximian.com/show_bug.cgi?id=44229
10868 "I think beforefieldinit means 'it's ok to initialize the type sometime
10869 before its static fields are used', i.e. initialization does not need
10870 to be triggered by the first access to the type. Setting this flag
10871 helps the JIT to compile better code, since it can run the static
10872 constructor at JIT time, and does not need to generate code to call it
10873 (possibly lots of times) at runtime. Unfortunately, mcs does not set
10874 this flag for lots of classes like String.
10876 csc sets this flag if the type does not have an explicit static
10877 constructor. The reasoning seems to be that if there are only static
10878 initalizers for a type, and no static constructor, then the programmer
10879 does not care when this initialization happens, so beforefieldinit
10882 This bug prevents the AOT compiler from being usable, since it
10883 generates so many calls to mono_runtime_class_init that the AOT code
10884 is much slower than the JITted code. The JITted code is faster,
10885 because it does not generate these calls if the vtable is type is
10886 already initialized, which is true in the majority of cases. But the
10887 AOT compiler can't do this."
10889 2004-03-10 Miguel de Icaza <miguel@ximian.com>
10891 * class.cs (MethodData.Emit): Refactor the code so symbolic
10892 information is generated for destructors; For some reasons we
10893 were taking a code path that did not generate symbolic information
10896 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
10898 * class.cs: Create a Constructor.CheckBase method that
10899 takes care of all validation type code. The method
10900 contains some code that was moved from Define.
10902 It also includes new code that checks for duplicate ctors.
10903 This fixes bug #55148.
10905 2004-03-09 Joshua Tauberer <tauberer@for.net>
10907 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10908 a { ... }-style array creation invokes EmitStaticInitializers
10909 which is not good for reference-type arrays. String, decimal
10910 and now null constants (NullCast) are not counted toward
10911 static initializers.
10913 2004-03-05 Martin Baulig <martin@ximian.com>
10915 * location.cs (SourceFile.HasLineDirective): New public field;
10916 specifies whether the file contains or is referenced by a "#line"
10918 (Location.DefineSymbolDocuments): Ignore source files which
10919 either contain or are referenced by a "#line" directive.
10921 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
10923 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10924 direct access to our parent, so check the method inline there.
10926 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
10928 * expression.cs (Invocation.EmitCall): Miguel's last commit
10929 caused a regression. If you had:
10934 In Foo the implict this would be null.
10936 2004-02-27 Miguel de Icaza <miguel@ximian.com>
10938 * expression.cs (Invocation.EmitCall): If the method is not
10939 virtual, do not emit a CallVirt to it, use Call.
10941 * typemanager.cs (GetFullNameSignature): Improve the method to
10942 cope with ".ctor" and replace it with the type name.
10944 * class.cs (ConstructorInitializer.Resolve): Now the method takes
10945 as an argument the ConstructorBuilder where it is being defined,
10946 to catch the recursive constructor invocations.
10948 2004-02-26 Miguel de Icaza <miguel@ximian.com>
10950 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10951 routines to check if a type is an enumerable/enumerator allow
10952 classes that implement the IEnumerable or IEnumerator interfaces.
10954 * class.cs (Property, Operator): Implement IIteratorContainer, and
10955 implement SetYields.
10957 (Property.Define): Do the block swapping for get_methods in the
10958 context of iterators. We need to check if Properties also
10959 include indexers or not.
10961 (Operator): Assign the Block before invoking the
10962 OperatorMethod.Define, so we can trigger the Iterator code
10965 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
10966 Property and Operator classes are not created when we parse the
10967 declarator but until we have the block completed, so we use a
10968 singleton SimpleIteratorContainer.Simple to flag whether the
10969 SetYields has been invoked.
10971 We propagate this setting then to the Property or the Operator to
10972 allow the `yield' to function.
10974 2004-02-25 Marek Safar <marek.safar@seznam.cz>
10976 * codegen.cs: Implemented attribute support for modules.
10977 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10978 Assembly/Module functionality.
10980 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10981 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10982 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10984 2004-02-16 Marek Safar <marek.safar@seznam.cz>
10986 * interface.cs (FindMembers): The operation is performed on all base
10987 interfaces and not only on the first. It is required for future CLS Compliance patch.
10989 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
10991 * statement.cs, codegen.cs:
10992 This patch deals with patterns such as:
10994 public class List : IEnumerable {
10996 public MyEnumerator GetEnumerator () {
10997 return new MyEnumerator(this);
11000 IEnumerator IEnumerable.GetEnumerator () {
11004 public struct MyEnumerator : IEnumerator {
11009 Before, there were a few things we did wrong:
11010 1) we would emit callvirt on a struct, which is illegal
11011 2) we emited ldarg when we needed to emit ldarga
11012 3) we would mistakenly call the interface methods on an enumerator
11013 type that derived from IEnumerator and was in another assembly. For example:
11015 public class MyEnumerator : IEnumerator
11017 Would have the interface methods called, even if there were public impls of the
11018 method. In a struct, this lead to invalid IL code.
11020 2004-02-11 Marek Safar <marek.safar@seznam.cz>
11022 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11025 * delegate.cs (Define): Fixed crash when delegate type is undefined.
11027 2004-02-11 Miguel de Icaza <miguel@ximian.com>
11029 * cs-parser.jay: Fix small regression: we were not testing V2
11030 compiler features correctly.
11032 * interface.cs: If the emit context is null, then create one
11034 2004-02-09 Marek Safar <marek.safar@seznam.cz>
11036 * decl.cs (GetSignatureForError): New virtual method to get full name
11037 for error messages.
11039 * attribute.cs (IAttributeSupport): New interface for attribute setting.
11040 Now it is possible to rewrite ApplyAttributes method to be less if/else.
11042 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11043 Duplicated members and code in these classes has been removed.
11044 Better encapsulation in these classes.
11046 2004-02-07 Miguel de Icaza <miguel@ximian.com>
11048 * assign.cs (Assign.DoResolve): When dealing with compound
11049 assignments, there is a new rule in ECMA C# 2.4 (might have been
11050 there before, but it is documented here) that states that in:
11054 If b is of type int, and the `op' is a shift-operator, then the
11055 above is evaluated as:
11059 * expression.cs (Binary.ResolveOperator): Instead of testing for
11060 int/uint/long/ulong, try to implicitly convert to any of those
11061 types and use that in pointer arithmetic.
11063 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11064 method to print information for from the type, not from the
11065 null-method we were given.
11067 2004-02-01 Duncan Mak <duncan@ximian.com>
11069 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11070 parsing for cmd, fixes bug #53694.
11072 2004-02-04 Marek Safar <marek.safar@seznam.cz>
11074 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11075 in the member name duplication tests. Property and operator name duplication
11076 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11078 2004-02-03 Marek Safar <marek.safar@seznam.cz>
11080 * interface.cs (PopulateMethod): Fixed crash when interface method
11081 returns not existing type (error test cs0246-3.cs).
11083 2004-02-02 Ravi Pratap M <ravi@ximian.com>
11085 * cs-parser.jay (interface_accessors): Re-write actions to also
11086 store attributes attached to get and set methods. Fix spelling
11089 (inteface_property_declaration): Modify accordingly.
11091 (InterfaceAccessorInfo): New helper class to store information to pass
11092 around between rules that use interface_accessors.
11094 * interface.cs (Emit): Apply attributes on the get and set
11095 accessors of properties and indexers too.
11097 * attribute.cs (ApplyAttributes): Modify accordingly to use the
11098 right MethodBuilder when applying attributes to the get and set accessors.
11100 2004-01-31 Miguel de Icaza <miguel@ximian.com>
11102 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11104 2004-01-26 Miguel de Icaza <miguel@ximian.com>
11106 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11108 2004-01-25 Miguel de Icaza <miguel@ximian.com>
11110 * cs-parser.jay: Remove YIELD token, instead use the new grammar
11111 changes that treat `yield' specially when present before `break'
11112 or `return' tokens.
11114 * cs-tokenizer.cs: yield is no longer a keyword.
11116 2004-01-23 Marek Safar <marek.safar@seznam.cz>
11118 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11119 setting for default constructors.
11120 For default constructors are almost every time set wrong Modifier. The
11121 generated IL code has been alright. But inside mcs this values was
11122 wrong and this was reason why several of my CLS Compliance tests
11125 2004-01-22 Martin Baulig <martin@ximian.com>
11127 * cs-parser.jay (namespace_or_type_name): Return an Expression,
11128 not a QualifiedIdentifier. This is what `type_name_expression'
11129 was previously doing.
11130 (type_name_expression): Removed; the code is now in
11131 `namespace_or_type_name'.
11132 (qualified_identifier): Removed, use `namespace_or_type_name'
11134 (QualifiedIdentifier): Removed this class.
11136 2004-01-22 Martin Baulig <martin@ximian.com>
11138 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11139 not a string as alias name.
11141 2004-01-21 Miguel de Icaza <miguel@ximian.com>
11143 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11144 #52730 bug, and instead compute correctly the need to use a
11145 temporary variable when requesting an address based on the
11146 static/instace modified of the field and the constructor.
11148 2004-01-21 Martin Baulig <martin@ximian.com>
11150 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11151 class and namespace before looking up aliases. Fixes #52517.
11153 2004-01-21 Martin Baulig <martin@ximian.com>
11155 * flowanalysis.cs (UsageVector.Merge): Allow variables being
11156 assinged in a 'try'; fixes exception4.cs.
11158 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11159 * class.cs : Implemented parameter-less constructor for TypeContainer
11161 * decl.cs: Attributes are now stored here. New property OptAttributes
11163 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11165 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11167 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11169 * typemanager.cs (CSharpSignature): Now reports also inner class name.
11170 (CSharpSignature): New method for indexer and property signature.
11172 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11174 * pending.cs (IsVirtualFilter): Faster implementation.
11176 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11178 * typemanager.cs: Avoid inclusion of same assembly more than once.
11180 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11182 * cs-parser.jay: Fixed problem where the last assembly attribute
11183 has been applied also to following declaration (class, struct, etc.)
11185 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11187 * class.cs: Added error CS0538, CS0539 reporting.
11188 Fixed crash on Microsoft runtime when field type is void.
11190 * cs-parser.jay: Added error CS0537 reporting.
11192 * pending.cs: Added error CS0535 reporting.
11193 Improved error report for errors CS0536, CS0534.
11195 2004-01-20 Miguel de Icaza <miguel@ximian.com>
11197 Merge a few bits from the Anonymous Method MCS tree.
11199 * statement.cs (ToplevelBlock): New class for toplevel methods,
11200 will hold anonymous methods, lifted variables.
11202 * cs-parser.jay: Create toplevel blocks for delegates and for
11203 regular blocks of code.
11205 2004-01-20 Martin Baulig <martin@ximian.com>
11207 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11208 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11209 and `NeedExplicitReturn'; added `IsLastStatement'.
11210 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11211 have a `ReturnLabel' or we're not unreachable.
11213 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11214 child's reachability; don't just override ours with it. Fixes
11215 #58058 (lluis's example).
11216 (FlowBranching): Added public InTryOrCatch(), InCatch(),
11217 InFinally(), InLoop(), InSwitch() and
11218 BreakCrossesTryCatchBoundary() methods.
11220 * statement.cs (Return): Do all error checking in Resolve().
11221 Unless we are the last statement in a top-level block, always
11222 create a return label and jump to it.
11223 (Break, Continue): Do all error checking in Resolve(); also make
11224 sure we aren't leaving a `finally'.
11225 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11226 statement in a top-level block.
11227 (Block.Flags): Added `IsDestructor'.
11228 (Block.IsDestructor): New public property.
11230 2004-01-20 Martin Baulig <martin@ximian.com>
11232 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11234 2004-01-20 Martin Baulig <martin@ximian.com>
11236 * statement.cs (Statement.ResolveUnreachable): New public method.
11237 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11238 (Block.Resolve): Resolve unreachable statements.
11240 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11242 * expression.cs: We need to fix the case where we do
11243 not have a temp variable here.
11245 * assign.cs: Only expression compound assignments need
11246 temporary variables.
11248 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11250 * flowanalysis.cs: Reduce memory allocation in a few ways:
11251 - A block with no variables should not allocate a bit
11253 - A method with no out parameters does not need any tracking
11254 for assignment of the parameters, so we need not allocate
11257 public readonly Type[] VariableTypes;
11258 public readonly string[] VariableNames;
11259 Are redundant. The data is already stored in the variable
11260 map, so we need not allocate another array for it.
11261 - We need to add alot of checks for if (params | locals) == null
11262 due to the first two changes.
11264 2004-01-18 Miguel de Icaza <miguel@ximian.com>
11266 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11267 implement IMemoryLocation, we store a copy on a local variable and
11268 take the address of it. Patch from Benjamin Jemlich
11270 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11271 to use a special "type_name_expression" rule which reduces the
11272 number of "QualifiedIdentifier" classes created, and instead
11273 directly creates MemberAccess expressions.
11275 2004-01-17 Miguel de Icaza <miguel@ximian.com>
11277 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11278 that fixes #52853. Null literal assignment to ValueType
11280 * class.cs (MethodData.Emit): Instead of checking the name of the
11281 method to determine if its a destructor, create a new derived
11282 class from Method called Destructor, and test for that.
11284 * cs-parser.jay: Create a Destructor object instead of a Method.
11286 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11290 2004-01-16 Miguel de Icaza <miguel@ximian.com>
11292 * expression.cs (Binary.ResolveOperator): Perform an implicit
11293 conversion from MethodGroups to their delegate types on the
11294 Addition operation.
11296 * delegate.cs: Introduce a new class DelegateCreation that is the
11297 base class for `NewDelegate' and `ImplicitDelegateCreation',
11298 factor some code in here.
11300 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11301 conversion from MethodGroups to compatible delegate types.
11303 * ecore.cs (Expression.Resolve): Do not flag error 654
11304 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11305 we allow conversions from MethodGroups to delegate types now.
11307 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11308 assignments in v2 either.
11310 2004-01-10 Miguel de Icaza <miguel@ximian.com>
11312 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11313 static read-only fields in ctors.
11315 Applied patch from Benjamin Jemlich
11317 * expression.cs (UnaryMutator): Avoid leaking local variables.
11319 2004-01-09 Miguel de Icaza <miguel@ximian.com>
11321 * cs-tokenizer.cs (IsCastToken): Allow the various native types
11322 here to return true, as they can be used like this:
11324 (XXX) int.MEMBER ()
11326 Fixed 49836 and all the other dups
11328 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
11330 * driver.cs: Implement /win32res and /win32icon.
11332 2004-01-08 Miguel de Icaza <miguel@ximian.com>
11334 * cs-parser.jay: Add a rule to improve error handling for the
11335 common mistake of placing modifiers after the type.
11337 2004-01-07 Miguel de Icaza <miguel@ximian.com>
11339 * cs-parser.jay (interface_event_declaration): Catch
11340 initialization of events on interfaces, and report cs0068
11342 * cs-parser.jay (interface_event_declaration): Catch
11343 initialization of events.
11345 * ecore.cs: Better report missing constructors.
11347 * expression.cs (Binary.ResolveOperator): My previous bug fix had
11348 the error reporting done in the wrong place. Fix.
11350 * expression.cs (Binary.ResolveOperator): Catch the
11351 operator + (E x, E y) error earlier, and later allow for implicit
11352 conversions in operator +/- (E e, U x) from U to the underlying
11355 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11356 52596, if the container class is abstract, the default constructor
11357 is protected otherwise its public (before, we were always public).
11359 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11362 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11363 Jemlich that fixes bug #52597, MCS was generating invalid code for
11364 idisposable structs. Thanks to Ben for following up with this
11367 2004-01-06 Miguel de Icaza <miguel@ximian.com>
11369 * driver.cs: Allow assemblies without code to be generated, fixes
11372 2004-01-07 Nick Drochak <ndrochak@gol.com>
11374 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11376 2004-01-05 Miguel de Icaza <miguel@ximian.com>
11378 * cs-parser.jay: Add rules to improve error reporting if fields or
11379 methods are declared at the namespace level (error 116)
11381 * Add rules to catch event add/remove
11383 2004-01-04 David Sheldon <dave-mono@earth.li>
11385 * expression.cs: Added matching ")" to error message for
11388 2004-01-03 Todd Berman <tberman@gentoo.org>
11390 * ecore.cs, attribute.cs:
11391 Applying fix from #52429.
11393 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11395 * ecore.cs, expression.cs, statement.cs:
11396 Total rewrite of how we handle branching. We
11397 now handle complex boolean expressions with fewer
11398 jumps. As well if (x == 0) no longer emits a ceq.
11400 if (x is Foo) is much faster now, because we generate
11403 Overall, we get a pretty big improvement on our benchmark
11404 tests. The code we generate is smaller and more readable.
11406 I did a full two-stage bootstrap. The patch was reviewed
11407 by Martin and Miguel.
11409 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11411 * cs-parser.jay: Make primary_expression not take a QI.
11412 we dont need this because the member_access rule covers
11413 us here. So we replace the rule with just IDENTIFIER.
11415 This has two good effects. First, we remove a s/r conflict.
11416 Second, we allocate many fewer QualifiedIdentifier objects.
11418 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11420 * attribute.cs: Handle MarshalAs attributes as pseudo, and
11421 set the correct information via SRE. This prevents
11422 hanging on the MS runtime. Fixes #29374.
11424 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11426 * convert.cs: correctly handle conversions to value types
11427 from Enum and ValueType as unboxing conversions.
11429 Fixes bug #52569. Patch by Benjamin Jemlich.
11431 2004-01-02 Ravi Pratap <ravi@ximian.com>
11433 * expression.cs (BetterConversion): Prefer int -> uint
11434 over int -> ulong (csc's behaviour). This fixed bug #52046.
11436 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
11438 * decl.cs (MemberCache.FindMembers): now returns a
11441 * typemanager.cs: In general, go with with ^^.
11442 (CopyNewMethods): take an IList.
11443 (RealMemberLookup): Only allocate an arraylist
11444 if we copy from two sets of methods.
11446 This change basically does two things:
11447 1) Fewer array lists allocated due to CopyNewMethods.
11448 2) the explicit cast in MemberList costed ALOT.
11450 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
11452 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11453 a hashtable to avoid needless string allocations when an identifier is
11454 used more than once (the common case).
11456 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11458 * pending.cs: MS's TypeBuilder.GetInterfaces ()
11459 is broken, it will not return anything. So, we
11460 have to use the information we have in mcs to
11463 * typemanager.cs: Add a cache for GetInterfaces,
11464 since this will now be used more often (due to ^^)
11466 (GetExplicitInterfaces) New method that gets the
11467 declared, not effective, interfaces on a type
11468 builder (eg, if you have interface IFoo, interface
11469 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11472 This patch makes MCS able to bootstrap itself on
11475 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11477 * expression.cs: Remove the Nop's that Miguel put
11480 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11482 * report.cs, codegen.cs: Give the real stack trace to
11483 the error when an exception is thrown.
11485 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11487 * decl.cs: only allocate hashtables for ifaces if
11490 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11492 * expression.cs: fix the error from cs0121-2.cs
11493 (a parent interface has two child interfaces that
11494 have a function with the same name and 0 params
11495 and the function is called through the parent).
11497 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
11499 * class.cs, rootcontext.cs, typmanager.cs: do not
11502 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
11504 * codegen.cs: remove stack for the ec flow branching.
11505 It is already a linked list, so no need.
11507 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
11509 * Makefile: Allow custom profiler here.
11511 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11513 * typemanager.cs (LookupType):
11514 - Use a static char [], because split takes
11515 a param array for args, so it was allocating
11517 - Do not store true in a hashtable, it boxes.
11519 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11521 * flowanalysis.cs: bytify common enums.
11523 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11525 * modifiers.cs: Add a new set of flags for the
11526 flags allowed on explicit interface impls.
11527 * cs-parser.jay: catch the use of modifiers in
11528 interfaces correctly.
11529 * class.cs: catch private void IFoo.Blah ().
11531 All related to bug #50572.
11533 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11535 * decl.cs: Rewrite the consistant accessability checking.
11536 Accessability is not linear, it must be implemented in
11537 a tableish way. Fixes #49704.
11539 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11541 * expression.cs: Handle negation in a checked context.
11542 We must use subtraction from zero. Fixes #38674.
11544 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11546 * class.cs: Ignore static void main in DLLs.
11547 * rootcontext.cs: Handle the target type here,
11548 since we are have to access it from class.cs
11549 * driver.cs: account for the above.
11551 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11553 * report.cs: Give line numbers and files if available.
11555 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
11557 * driver.cs: Implement /addmodule.
11559 * typemanager.cs: Change 'modules' field so it now contains Modules not
11562 2003-12-20 Martin Baulig <martin@ximian.com>
11564 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11565 (FieldBase.IsAssigned): Removed this field.
11566 (FieldBase.SetAssigned): New public method.
11567 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11569 2003-12-20 Martin Baulig <martin@ximian.com>
11571 * expression.cs (LocalVariableReference.DoResolve): Don't set
11572 `vi.Used' if we're called from DoResolveLValue().
11574 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11575 returns the usage vector it just merged into the current one -
11576 pass this one to UsageWarning().
11577 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11578 of the `EmitContext', don't call this recursively on our children.
11580 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
11582 * driver.cs: Implement /target:module.
11584 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
11586 * support.cs (CharArrayHashtable): New helper class.
11588 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
11589 char arrays, not strings, so we can avoid creating a string in
11590 consume_identifier if the identifier is a keyword.
11592 2003-12-16 Martin Baulig <martin@ximian.com>
11594 * statement.cs (LocalInfo.Assigned): Removed this property.
11595 (LocalInfo.Flags): Removed `Assigned'.
11596 (LocalInfo.IsAssigned): New public method; takes the EmitContext
11597 and uses flow analysis.
11598 (Block.UsageWarning): Made this method private.
11599 (Block.Resolve): Call UsageWarning() if appropriate.
11601 * expression.cs (LocalVariableReference.DoResolve): Always set
11602 LocalInfo.Used here.
11604 2003-12-13 Martin Baulig <martin@ximian.com>
11606 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11607 any value here; we're now using flow analysis to figure out
11608 whether a statement/block returns a value.
11610 2003-12-13 Martin Baulig <martin@ximian.com>
11612 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11614 (FlowBranching.MergeFinally): Don't call
11615 `branching.CheckOutParameters()' here, this is called in
11617 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11618 when adding the `finally' vector.
11620 2003-12-13 Martin Baulig <martin@ximian.com>
11623 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11624 actually work and also fix #48962.
11626 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
11628 * decl.cs: Do not check System.Object for nested types,
11629 since we know it does not have any. Big bang for buck:
11632 Run 1: 8.35 seconds
11633 Run 2: 8.32 seconds
11634 corlib: 17.99 seconds
11636 Run 1: 8.17 seconds
11637 Run 2: 8.17 seconds
11638 corlib: 17.39 seconds
11640 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
11642 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11643 time we are returning 0 members, so we save alot here.
11645 2003-12-11 Martin Baulig <martin@ximian.com>
11647 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11648 `MergeChild()', also just take the `FlowBranching' as argument;
11649 call Merge() on it and return the result.
11650 (FlowBranching.Merge): We don't need to do anything if we just
11653 2003-12-11 Martin Baulig <martin@ximian.com>
11655 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11656 them in an `ArrayList' to reduce memory usage. Thanks to Ben
11657 Maurer for this idea.
11659 2003-12-11 Martin Baulig <martin@ximian.com>
11661 * flowanalysis.cs (MergeResult): This class is now gone; we now
11662 use the `UsageVector' for this. The reason for this is that if a
11663 branching just has one sibling, we don't need to "merge" them at
11664 all - that's the next step to do.
11665 (FlowBranching.Merge): We now return a `UsageVector' instead of a
11668 2003-12-11 Martin Baulig <martin@ximian.com>
11670 Reworked flow analyis and made it more precise and bug-free. The
11671 most important change is that we're now using a special `Reachability'
11672 class instead of having "magic" meanings of `FlowReturns'. I'll
11673 do some more cleanups and optimizations and also add some more
11674 documentation this week.
11676 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11677 largely reworked this class.
11678 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11679 the new `Reachability' class instead of having "magic" values here.
11680 (FlowBranching): We're now using an instance of `Reachability'
11681 instead of having separate `Returns', `Breaks' etc. fields.
11683 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11684 based on flow analysis; ignore the return value of block.Emit ().
11686 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
11688 * driver.cs typemanager.cs: Find the mono extensions to corlib even
11689 if they are private.
11691 2003-12-09 Martin Baulig <martin@ximian.com>
11693 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11694 call them directly on the UsageVector.
11696 2003-12-09 Martin Baulig <martin@ximian.com>
11698 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11699 Changed return type from `FlowReturns' to `Reachability'.
11701 2003-12-09 Martin Baulig <martin@ximian.com>
11703 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11704 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11705 `Reachable' fields with a single `Reachability' one.
11707 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11709 * class.cs (FindMembers): Remove foreach's.
11714 Run 1: 8.74 seconds
11715 Run 2: 8.71 seconds
11718 Run 1: 8.64 seconds
11719 Run 2: 8.58 seconds
11722 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11727 This patch does a few things:
11728 1. EmptyStatement is now a singleton, so it is never reallocated.
11729 2. All blah is EmptyStatement constructs have been changed to
11730 blah == EmptyStatement.Value, which is much faster and valid
11731 now that EmptyStatement is a singleton.
11732 3. When resolving a block, rather than allocating a new array for
11733 the non-empty statements, empty statements are replaced with
11734 EmptyStatement.Value
11735 4. Some recursive functions have been made non-recursive.
11736 Mainly the performance impact is from (3), however (1) and (2) are needed for
11737 this to work. (4) does not make a big difference in normal situations, however
11738 it makes the profile look saner.
11743 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11744 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11745 Total memory allocated: 56397 KB
11748 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11749 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11750 Total memory allocated: 55666 KB
11752 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11754 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11755 than the hashtable in a hashtable version
11757 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11758 we always end up concating a string. This results in a huge perf
11759 loss, because many strings have to be tracked by the GC. In this
11760 patch, we first use a hashtable that works with two keys, so that
11761 the strings do not need to be concat'ed.
11765 Run 1: 8.74 seconds
11766 Run 2: 8.71 seconds
11769 Run 1: 8.65 seconds
11770 Run 2: 8.56 seconds
11772 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11774 * Makefile: Add a new target `do-time' that does a quick and simple
11775 profile, leaving easy to parse output.
11777 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
11779 * codegen.cs (Init): Create the dynamic assembly with
11780 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11782 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
11784 * support.cs: Make the PtrHashtable use only one
11785 instance of its comparer.
11787 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
11789 * typemanager.cs: Fix lookup of GetNamespaces.
11791 2003-11-29 Miguel de Icaza <miguel@ximian.com>
11793 * expression.cs: Removed redundant line.
11795 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11796 ArrayLists, use for loops with bounds.
11798 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11801 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11802 arraylists, use for loop with bounds.
11804 The above three changes give us a 0.071 second performance
11805 improvement out of 3.294 seconds down to 3.223. On my machine
11806 the above changes reduced the memory usage by 1,387 KB during
11807 compiler bootstrap.
11809 * cs-parser.jay (QualifiedIdentifier): New class used to represent
11810 QualifiedIdentifiers. Before we created a new string through
11811 concatenation, and mostly later on, the result would be
11812 manipulated by DecomposeQI through string manipulation.
11814 This reduced the compiler memory usage for bootstrapping from
11815 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11816 compile times in 0.05 seconds.
11818 2003-11-28 Dick Porter <dick@ximian.com>
11820 * support.cs: Do string compares with the Invariant culture.
11828 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11829 the comparison is done with the Invariant culture.
11831 2003-11-27 Miguel de Icaza <miguel@ximian.com>
11833 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11834 GetEnumerator method.
11836 (ProbeCollectionType): Iterate starting at the most specific type
11837 upwards looking for a GetEnumerator
11839 * expression.cs: Shift count can be up to 31 for int/uint and 63
11842 2003-11-26 Miguel de Icaza <miguel@ximian.com>
11844 * statement.cs (Block.LookupLabel): Also look for the label on the
11845 children blocks. Use a hash table to keep track of visited
11848 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11849 we actually did transform the other operand, otherwise fall back
11850 to the common codepath that casts to long.
11852 * cs-tokenizer.cs: Use the same code pattern as the int case.
11853 Maybe I should do the parsing myself, and avoid depending on the
11854 Parse routines to get this done.
11856 2003-11-25 Miguel de Icaza <miguel@ximian.com>
11858 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11859 which fixes bug 51347. This time test it.
11861 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11862 attributes for example can not tell the difference between these.
11863 The difference was only a syntax feature of the language.
11865 * attribute.cs: Apply attributes to delegates.
11867 * delegate.cs: Call the apply attributes method.
11869 2003-11-24 Miguel de Icaza <miguel@ximian.com>
11871 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11872 comparing 0 vs Byte.MinValue, not the value
11874 (ImplicitConversionRequired): When reporting a conversion error,
11875 use error 31 to print out the constant error instead of the
11878 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11879 which fixes bug 51347.
11881 2003-11-22 Miguel de Icaza <miguel@ximian.com>
11883 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
11884 which fixes the -warnaserror command line option.
11886 2003-11-21 Miguel de Icaza <miguel@ximian.com>
11888 * cfold.cs (DoNumericPromotions): During constant folding of
11889 additions on UIntConstant, special case intconstants with
11890 IntConstants like we do on the expression binary operator.
11892 2003-11-12 Miguel de Icaza <miguel@ximian.com>
11894 * convert.cs (ImplicitReferenceConversion): We were missing a case
11895 (System.Enum are not value types or class types, so we need to
11896 classify them separatedly).
11898 * driver.cs: We do not support error 2007.
11900 2003-11-12 Jackson Harper <jackson@ximian.com>
11902 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11903 system directory. Also use the full file name so users can
11904 libraries names mscorlib-o-tron.dll in a non system dir.
11906 2003-11-10 Martin Baulig <martin@ximian.com>
11908 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11909 (TypeManager.InitCoreTypes): Initialize them here, but instead of
11910 calling `ResolveType()' on them, directly assign their `Type'.
11912 2003-11-08 Martin Baulig <martin@ximian.com>
11914 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11915 return value and the `out parent' parameter.
11916 (TypeContainer.DefineType): Moved the CS0644 check into
11917 GetClassBases(). Don't pass the interface types to the
11918 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11919 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11921 * ecore.cs (TypeExpr.IsAttribute): New property.
11922 (TypeExpr.GetInterfaces): New method.
11924 * interface.cs (Interface.GetInterfaceTypeByName): Return a
11925 TypeExpr instead of a Type.
11926 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11927 (Interface.DefineType): Don't pass the interface types to the
11928 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11929 them later and then call `TypeBulider.AddInterfaceImplementation()'.
11931 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11932 instead of a `Type[]'.
11933 (TypeManager.RegisterBuilder): Likewise.
11934 (TypeManager.AddUserInterface): Likewise.
11935 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11936 `Type[]' and also return a `TypeExpr[]'.
11937 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11939 2003-11-08 Martin Baulig <martin@ximian.com>
11941 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11944 2003-11-08 Martin Baulig <martin@ximian.com>
11946 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11947 TypeManager.ResolveExpressionTypes().
11949 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11950 instead of an Expression.
11951 (TypeExpr): This is now an abstract base class for `TypeExpression'.
11952 (TypeExpression): New public class; formerly known as `TypeExpr'.
11954 * expression.cs (ComposedCast): Derive from TypeExpr.
11956 * typemanager.cs (TypeManager.system_*_expr): These are now
11957 TypExpr's instead of Expression's.
11958 (TypeManager.ResolveExpressionTypes): New public static function;
11959 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11962 2003-11-06 Miguel de Icaza <miguel@ximian.com>
11964 * expression.cs (New.DoResolve): Do not dereference value that
11965 might be a null return.
11967 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11968 sure that the constant value has the right type. Fixes an
11969 unreported bug, similar to 50425.
11971 * const.cs (Const.LookupConstantValue): Call
11972 ImplicitStandardConversionExists before doing a conversion to
11973 avoid havng the TypeManager.ChangeType do conversions.
11975 Reduced the number of casts used
11977 (Const.ChangeType): New routine to enable reuse of the constant
11978 type changing code from statement.
11980 * typemanager.cs (ChangeType): Move common initialization to
11981 static global variables.
11985 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11986 every value type to go through, even if it was void. Fix that.
11988 * cs-tokenizer.cs: Use is_identifier_start_character on the start
11989 character of the define, and the is_identifier_part_character for
11990 the rest of the string.
11992 2003-11-05 Miguel de Icaza <miguel@ximian.com>
11994 * expression.cs (UnaryMutator.EmitCode): When I updated
11995 LocalVariableReference.DoResolve, I overdid it, and dropped an
11996 optimization done on local variable references.
11998 2003-11-04 Miguel de Icaza <miguel@ximian.com>
12000 * ecore.cs: Convert the return from Ldlen into an int.
12002 2003-10-20 Miguel de Icaza <miguel@ximian.com>
12004 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12005 the accessibility, this is a special case for toplevel non-public
12006 classes (internal for instance).
12008 2003-10-20 Nick Drochak <ndrochak@gol.com>
12010 * ecore.cs: Fix typo and build. Needed another right paren.
12012 2003-10-19 Miguel de Icaza <miguel@ximian.com>
12014 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
12015 `internal' case regular and protected, but not allowing protected
12016 to be evaluated later. Bug 49840
12018 2003-10-15 Miguel de Icaza <miguel@ximian.com>
12020 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12021 to kb.Nlast, and not the kb.nFirst to isolate the switch
12024 Extract the underlying type, so enumerations of long/ulong are
12025 treated like long/ulong.
12027 2003-10-14 Miguel de Icaza <miguel@ximian.com>
12029 * expression.cs (New): Overload the meaning of RequestedType to
12030 track the possible creation of the NewDelegate type, since
12031 DoResolve is invoked more than once for new constructors on field
12034 See bugs: #48800 and #37014
12036 * cs-parser.jay (declare_local_constants): Take an arraylist
12037 instead of a single constant.
12039 (local_constant_declaration): It should take a
12040 constant_declarators, not a constant_declarator. Fixes 49487
12042 * convert.cs: Fix error report.
12044 2003-10-13 Jackson Harper <jackson@ximian.com>
12046 * typemanager.cs (TypeToCoreType): Add float and double this fixes
12049 2003-10-09 Martin Baulig <martin@ximian.com>
12051 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12053 (MethodCore.DoDefineParameters): Removed the TypeContainer
12054 argument; use the DeclSpace which was passed to the .ctor instead.
12055 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12056 TypeContainer; we only need a DeclSpace here.
12058 2003-10-09 Martin Baulig <martin@ximian.com>
12060 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12062 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12063 EmitContext's .ctor.
12065 2003-10-09 Martin Baulig <martin@ximian.com>
12067 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12068 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12069 AsAccessible(), moved them as well.
12071 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12073 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12075 * cs-parser.jay : Renamed yyName to yyNames related to jay.
12077 2003-10-07 Miguel de Icaza <miguel@ximian.com>
12079 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12080 generation for >=, as spotted by Paolo, bug 48679.
12081 Patch from David Waite.
12083 * cs-tokenizer.cs: Add handling for #pragma.
12085 * cs-parser.jay: Allow for both yield and yield return in the
12086 syntax. The anti-cobolization of C# fight will go on!
12088 * class.cs (TypeBuilder.DefineType): Catch error condition here
12089 (Parent.DefineType erroring out and returning null).
12091 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12092 coping with enumerations variables, we were mistakenly processing
12093 them as a regular value type instead of built-in types. Fixes the
12096 * typemanager.cs (IsBuiltinOrEnum): New method.
12098 2003-09-30 Miguel de Icaza <miguel@ximian.com>
12100 * cs-parser.jay: Upgrade: yield now needs the return clause.
12102 2003-09-19 Martin Baulig <martin@ximian.com>
12104 * decl.cs (MemberCache.SetupCacheForInterface): Take a
12105 `MemberCache parent' argument. Normally, an interface doesn't
12106 have a parent type except System.Object, but we use this in gmcs
12107 for generic type parameters.
12109 2003-09-18 Martin Baulig <martin@ximian.com>
12111 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12112 on `type.IsInterface'; don't check whether the type has a parent
12113 to determine whether it's an interface.
12115 2003-09-15 Martin Baulig <martin@ximian.com>
12117 * class.cs (TypeContainer.DefineType): Added an error flag to
12118 avoid reporting duplicate CS0146's ("class definition is
12121 * driver.cs (Driver.MainDriver): Abort if
12122 RootContext.ResolveTree() reported any errors.
12124 2003-09-07 Martin Baulig <martin@ximian.com>
12126 * report.cs (Error, Warning): Added overloaded versions which take
12127 a `params object[] args' and call String.Format().
12129 2003-09-07 Martin Baulig <martin@ximian.com>
12131 * decl.cs (DeclSpace..ctor): Don't call
12132 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12133 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
12134 (DeclSpace.RecordDecl): New method.
12136 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12138 2003-09-02 Ravi Pratap <ravi@ximian.com>
12140 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12141 value attributes to be applied to ParameterBuilders.
12143 * class.cs (MethodCore.LabelParameters): Make static and more
12144 generic so that it can be used from other places - like interface
12145 methods, for instance.
12147 * interface.cs (Interface.Emit): Call LabelParameters before
12148 emitting attributes on the InterfaceMethod.
12150 2003-08-26 Martin Baulig <martin@ximian.com>
12152 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12153 resolving aliases; fixes #47927.
12155 2003-08-26 Martin Baulig <martin@ximian.com>
12157 * statement.cs (Using.DoResolve): This is internally emitting a
12158 try/finally clause, so we need to set ec.NeedExplicitReturn if we
12159 do not always return. Fixes #47681.
12161 2003-08-26 Martin Baulig <martin@ximian.com>
12163 * decl.cs (MemberCore): Moved WarningNotHiding(),
12164 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12166 (AdditionResult): Make this nested in DeclSpace.
12167 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12168 argument; call NamespaceEntry.Define() unless we're nested in a
12171 * namespace.cs (Namespace.DefineName): New public function. This
12172 is called from DeclSpace's .ctor to add
12173 (Namespace.Lookup): Include DeclSpaces in the lookup.
12175 * class.cs (Operator): Derive from MemberBase, not MemberCore.
12177 * const.cs (Const): Derive from MemberBase, not MemberCore.
12179 2003-08-25 Martin Baulig <martin@ximian.com>
12181 * convert.cs (Convert.ExplicitReferenceConversion): When
12182 converting from an interface type to a class, unbox if the target
12183 type is a struct type. Fixes #47822.
12185 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12187 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12190 2003-08-22 Martin Baulig <martin@ximian.com>
12192 * class.cs (TypeManager.DefineType): When defining a nested type,
12193 call DefineType() on our parent; fixes #47801.
12195 2003-08-22 Martin Baulig <martin@ximian.com>
12197 * class.cs (MethodData.Define): While checking if a method is an
12198 interface implementation, improve the test a bit more to fix #47654.
12200 2003-08-22 Martin Baulig <martin@ximian.com>
12202 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12203 correctly; fixes #47722.
12205 2003-08-22 Martin Baulig <martin@ximian.com>
12207 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12208 LocalVariableReference, ensure it's not read-only. Fixes #47536.
12210 * statement.cs (Fixed.DoResolve): Make all variables read-only.
12212 2003-08-22 Martin Baulig <martin@ximian.com>
12214 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12215 can only be assigned in static constructors. Fixes #47161.
12217 2003-08-22 Martin Baulig <martin@ximian.com>
12219 Rewrote and improved the flow analysis code.
12221 * flowbranching.cs (FlowBranching): Make this class abstract.
12222 (FlowBranching.CreateBranching): New static function to create a
12223 new flow branching.
12224 (FlowBranchingBlock, FlowBranchingException): New classes.
12225 (FlowBranching.UsageVector.Type): New public readonly field.
12226 (FlowBranching.UsageVector.Breaks): Removed the setter.
12227 (FlowBranching.UsageVector.Returns): Removed the setter.
12228 (FlowBranching.UsageVector): Added Break(), Return(),
12229 NeverReachable() and Throw() methods to modify the reachability.
12230 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12231 done by FlowBranching.Merge().
12232 (FlowBranching.UsageVector.MergeChild): New method; merges the
12233 merge result into the current vector.
12234 (FlowBranching.Merge): New abstract method to merge a branching.
12236 2003-08-12 Martin Baulig <martin@ximian.com>
12238 * expression.cs (Indirection.CacheTemporaries): Create the
12239 LocalTemporary with the pointer type, not its element type.
12241 2003-08-10 Miguel de Icaza <miguel@ximian.com>
12243 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12244 token was a keyword or not.
12246 Add `error' options where an IDENTIFIER was expected; Provide
12247 CheckToken and CheckIdentifierToken convenience error reporting
12250 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12252 * decl.cs: Rename `NamespaceEntry Namespace' public field into
12253 NameSpaceEntry NameSpaceEntry.
12255 (LookupInterfaceOrClass): Avoid creating a full qualified name
12256 from namespace and name: avoid doing lookups when we know the
12257 namespace is non-existant. Use new Tree.LookupByNamespace which
12258 looks up DeclSpaces based on their namespace, name pair.
12260 * driver.cs: Provide a new `parser verbose' to display the
12261 exception thrown during parsing. This is turned off by default
12262 now, so the output of a failure from mcs is more graceful.
12264 * namespace.cs: Track all the namespaces defined in a hashtable
12267 (IsNamespace): New method
12269 2003-08-09 Miguel de Icaza <miguel@ximian.com>
12271 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
12272 we know that we need to concatenate (full typename can never be
12277 * statement.cs: Use a bitfield; Do not initialize to null things
12278 which are done by the constructor by default.
12280 * cs-parser.jay: bug fix, parameter was 4, not 3.
12282 * expression.cs: Just use the property;
12284 * statement.cs: No need for GetVariableInfo method.
12286 2003-08-08 Martin Baulig <martin@ximian.com>
12288 * flowanalysis.cs (FlowReturns): This is now nested in the
12289 `FlowBranching' class.
12290 (MyBitVector): Moved this here from statement.cs.
12291 (FlowBranching.SiblingType): New enum type.
12292 (FlowBranching.CreateSibling): Added `SiblingType' argument.
12294 2003-08-07 Martin Baulig <martin@ximian.com>
12296 * flowanalysis.cs (FlowBranchingType): This is now nested in the
12297 `FlowBranching' class and called `BranchingType'.
12299 2003-08-07 Martin Baulig <martin@ximian.com>
12301 * flowanalysis.cs: Moved all the control flow analysis code into
12304 2003-08-07 Martin Baulig <martin@ximian.com>
12306 * assign.cs (Assign.DoResolve): `target' must either be an
12307 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
12310 2003-08-07 Miguel de Icaza <miguel@ximian.com>
12312 * expression.cs (BinaryMethod): This kind of expression is created by the
12313 Binary class if it determines that the operator has to be handled
12316 (BinaryDelegate): This kind of expression is created if we are
12317 dealing with a + or - operator on delegates.
12319 (Binary): remove method, argumetns, and DelegateOperator: when
12320 dealing with methods,
12322 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12324 * statement.cs (Block): use bitfields for the three extra booleans
12325 we had in use. Remove unused topblock parameter.
12327 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12329 * assign.cs: Drop extra unneeded tests.
12331 2003-08-06 Miguel de Icaza <miguel@ximian.com>
12333 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12335 * statement.cs (Foreach): Use VariableStorage instead of
12338 * codegen.cs (VariableStorage): New class used by clients that
12339 require a variable stored: locals or fields for variables that
12340 need to live across yield.
12342 Maybe provide a convenience api for EmitThis+EmitLoad?
12344 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12347 2003-08-05 Miguel de Icaza <miguel@ximian.com>
12349 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12350 RemapParameterLValue): New methods that are used to turn a
12351 precomputed FieldInfo into an expression like this:
12355 The idea is to use this instead of making LocalVariableReference
12356 have more than one meaning.
12358 * cs-parser.jay: Add error production to BASE.
12360 * ecore.cs: Deal with TypeManager.GetField returning null, which
12361 is now a valid return value.
12363 (FieldExprNoAddress): New expression for Fields whose address can
12366 * expression.cs (LocalVariableReference): During the resolve
12367 phases, create new expressions if we are in a remapping context.
12368 Remove code that dealt with remapping here.
12370 (ParameterReference): same.
12372 (ProxyInstance): New expression, like the `This' expression, but
12373 it is born fully resolved. We know what we are doing, so remove
12374 the errors that are targeted to user-provided uses of `this'.
12376 * statement.cs (Foreach): our variable is now stored as an
12377 Expression; During resolution, follow the protocol, dont just
12378 assume it will return this.
12380 2003-08-06 Martin Baulig <martin@ximian.com>
12382 * support.cs (SeekableStreamReader.cs): New public class.
12384 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12385 SeekableStreamReader instead of the normal StreamReader.
12387 2003-08-04 Martin Baulig <martin@ximian.com>
12389 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12390 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12391 deambiguate casts and delegate invocations.
12392 (parenthesized_expression): Use the new tokens to ensure this is
12393 not a cast of method invocation.
12395 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12396 when reading a `)' and Deambiguate_CloseParens () was previously
12399 * expression.cs (ParenthesizedExpression): New class. This is
12400 just used for the CS0075 test.
12401 (Binary.DoResolve): Check for CS0075.
12403 2003-07-29 Ravi Pratap <ravi@ximian.com>
12405 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12406 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12407 reference comparison.
12409 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12410 examine the ReturnType for equality - this is necessary in the
12411 cases of implicit and explicit operators whose signature also
12412 includes the return type.
12414 2003-07-26 Miguel de Icaza <miguel@ximian.com>
12416 * namespace.cs: Cache the result of the namespace computation,
12417 instead of computing it every time.
12419 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12421 * decl.cs: Use a global arraylist that we reuse over invocations
12422 to avoid excesive memory consumption. Reduces memory usage on an
12423 mcs compile by one meg (45 average).
12425 * typemanager.cs (LookupTypeReflection): In .NET pointers are
12426 private, work around that.
12428 2003-07-23 Miguel de Icaza <miguel@ximian.com>
12430 * literal.cs (IntLiteral): Define Zero and One static literals.
12432 * cs-parser.jay (integer_literal): use static literals to reduce
12433 memory usage for the most used literals (0, 1 and -1). 211kb
12434 reduced in memory usage.
12436 Replace all calls to `new ArrayList' with `new
12437 ArrayList(4)' which is a good average number for most allocations,
12438 and also requires only 16 bytes of memory for its buffer by
12441 This reduced MCS memory usage in seven megabytes for the RSS after
12444 2003-07-28 Ravi Pratap <ravi@ximian.com>
12446 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12447 handle params methods the correct way by forming only one
12448 applicable set with params and normal methods in them. Earlier we
12449 were looking at params methods only if we found no normal methods
12450 which was not the correct thing to do.
12452 (Invocation.BetterFunction): Take separate arguments indicating
12453 when candidate and the best method are params methods in their
12456 This fixes bugs #43367 and #46199.
12458 * attribute.cs: Documentation updates.
12460 (CheckAttribute): Rename to CheckAttributeTarget.
12461 (GetValidPlaces): Rename to GetValidTargets.
12463 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12464 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12468 2003-07-28 Martin Baulig <martin@ximian.com>
12470 * class.cs (TypeContainer.DefineMembers): Use the base type's full
12471 name when looking up the base class of a nested class. Fixes #46977.
12473 2003-07-26 Martin Baulig <martin@ximian.com>
12475 * expression.cs (Indexers.Indexer): New nested struct; contains
12476 getter, setter and the indexer's type.
12477 (Indexers.Properties): This is now an ArrayList of
12478 Indexers.Indexer's.
12479 (IndexerAccess.DoResolveLValue): Correctly set the type if the
12480 indexer doesn't have any getters.
12482 * assign.cs (Assign.DoResolve): Also do the implicit conversions
12483 for embedded property and indexer assignments.
12485 2003-07-26 Martin Baulig <martin@ximian.com>
12487 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
12488 preprocessor directive is not the first non-whitespace character
12491 2003-07-26 Martin Baulig <martin@ximian.com>
12493 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
12494 namespace parsing, follow the spec more closely.
12496 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
12497 NamespaceEntry.Lookup().
12499 2003-07-25 Martin Baulig <martin@ximian.com>
12501 * MethodCore.cs (OverridesSomething): New public field; it's set
12502 from TypeContainer.DefineMembers if this method overrides
12503 something (which doesn't need to be a method). Fix #39462.
12505 2003-07-25 Ravi Pratap <ravi@ximian.com>
12507 * typemanager.cs (GetMembers): Ensure that the list of members is
12508 reversed. This keeps things in sync.
12510 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
12511 find an AttributeUsage attribute.
12513 * expression.cs (Invocation.OverloadResolve): Perform the check
12514 which disallows Invoke to be directly called on a Delegate.
12516 (Error_InvokeOnDelegate): Report error cs1533.
12518 2003-07-25 Martin Baulig <martin@ximian.com>
12520 * expression.cs (Indexers.GetIndexersForType): Only look in the
12521 interface hierarchy if the requested type is already an
12522 interface. Fixes #46788 while keeping #46502 fixed.
12524 2003-07-25 Martin Baulig <martin@ximian.com>
12526 * class.cs (TypeContainer.DefineMembers): Check whether all
12527 readonly fields have been assigned and report warning CS0649 if
12530 * statement.cs (LocalInfo.IsFixed): Always return true if this is
12533 2003-07-24 Ravi Pratap <ravi@ximian.com>
12535 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
12536 returned from GetMethods to make things consistent with the
12537 assumptions MCS makes about ordering of methods.
12539 This should comprehensively fix bug #45127 and it does :-)
12541 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
12542 ordering is actually reverse.
12544 * Clean up some debug messages I left lying around.
12546 * interface.cs (Populate*): Get rid of code which emits attributes
12547 since the stage in which we emit attributes is the 'Emit' stage,
12548 not the define stage.
12550 (Emit): Move attribute emission for interface members here.
12552 2003-07-22 Ravi Pratap <ravi@ximian.com>
12554 * expression.cs (Invocation.OverloadResolve): Follow the spec more
12555 closely: we eliminate methods in base types when we have an
12556 applicable method in a top-level type.
12558 Please see section 14.5.5.1 for an exact description of what goes
12561 This fixes bug #45127 and a host of other related to corlib compilation.
12563 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12564 array is the method corresponding to the top-level type (this is
12565 because of the changes made to icall.c) so we change this
12568 (MethodGroupExpr.Name): This too.
12570 * typemanager.cs (GetElementType): New method which does the right
12571 thing when compiling corlib.
12573 * everywhere: Make use of the above in the relevant places.
12575 2003-07-22 Martin Baulig <martin@ximian.com>
12577 * cs-parser.jay (invocation_expression): Moved
12578 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12579 `cast_expression', but create a InvocationOrCast which later
12580 resolves to either an Invocation or a Cast.
12582 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12583 method; call this before EmitStatement() to make sure that this
12584 expression can be used as a statement.
12586 * expression.cs (InvocationOrCast): New class; resolves to either
12587 an Invocation or a Cast.
12589 * statement.cs (StatementExpression): Call ResolveStatement() on
12590 the ExpressionStatement before emitting it.
12592 2003-07-21 Martin Baulig <martin@ximian.com>
12594 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12595 `ref' and `out' attributes match; fixes #46220.
12596 (MemberAccess.ResolveMemberAccess): You can't reference a type
12597 through an expression; fixes #33180.
12598 (Indexers.GetIndexersForType): Don't return the indexers from
12599 interfaces the class implements; fixes #46502.
12601 2003-07-21 Martin Baulig <martin@ximian.com>
12603 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12604 CS0661 checks; fixes bug #30442.
12606 2003-07-21 Martin Baulig <martin@ximian.com>
12608 * decl.cs (AdditionResult): Added `Error'.
12610 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12612 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
12613 makes cs0031.cs actually work.
12615 2003-07-20 Martin Baulig <martin@ximian.com>
12617 * namespace.cs: Fixed that bug which caused a crash when compiling
12618 the debugger's GUI.
12620 2003-07-20 Miguel de Icaza <miguel@ximian.com>
12622 * typemanager.cs (LookupTypeReflection): Never expose types which
12623 are NotPublic, NestedPrivate, NestedAssembly, or
12624 NestedFamANDAssem. We used to return these, and later do a check
12625 that would report a meaningful error, but the problem is that we
12626 would not get the real match, if there was a name override.
12628 2003-07-18 Miguel de Icaza <miguel@ximian.com>
12630 * namespace.cs (Namespace, Name): Do not compute the namespace
12631 name dynamically, compute it in the constructor. This reduced
12632 memory usage by 1697 KB.
12634 * driver.cs: Use --pause to pause at the end.
12636 2003-07-17 Peter Williams <peter@newton.cx>
12638 * Makefile: Change the name of the test target so that it doesn't
12639 conflict with the recursive test target.
12641 2003-07-17 Miguel de Icaza <miguel@ximian.com>
12643 * expression.cs (LocalVariableReference.Emit, EmitAssign,
12644 AddressOf): Do not use EmitThis, that was wrong, use the actual
12647 2003-07-15 Miguel de Icaza <miguel@ximian.com>
12649 * class.cs (MethodData.Define): While checking if a method is an
12650 interface implementation, improve the test: If we are not public
12651 (use new test here: use the computed MethodAttributes directly,
12652 instead of the parsed modifier flags) check if the `implementing'
12653 method comes from an interface or not.
12655 * pending.cs (VerifyPendingMethods): Slightly better error
12658 * makefile: add test target that does the mcs bootstrap.
12660 2003-07-16 Ravi Pratap <ravi@ximian.com>
12662 * interface.cs (Define): Do nothing here since there are no
12663 members to populate etc. Move the attribute emission out of here
12664 since this was just totally the wrong place to put it. Attribute
12665 application happens during the 'Emit' phase, not in the 'Define'
12668 (Emit): Add this method and move the attribute emission here
12670 * rootcontext.cs (EmitCode): Call the Emit method on interface
12673 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12675 * expression.cs (OverloadResolve): Report error only if Location
12676 is not 'Null' which means that there was a probe going on.
12678 2003-07-14 Martin Baulig <martin@ximian.com>
12680 * expression.cs (ConditionalLogicalOperator): New public class to
12681 implement user defined conditional logical operators.
12682 This is section 14.11.2 in the spec and bug #40505.
12684 2003-07-14 Martin Baulig <martin@ximian.com>
12686 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12688 2003-07-14 Martin Baulig <martin@ximian.com>
12690 * codegen.cs (EmitContext.InFixedInitializer): New public field.
12692 * ecore.cs (IVariable.VerifyFixed): New interface method.
12694 * expression.cs (Unary.ResolveOperator): When resolving the `&'
12695 operator, check whether the variable is actually fixed. Fixes bug
12696 #36055. Set a variable definitely assigned when taking its
12697 address as required by the spec.
12699 * statement.cs (LocalInfo.IsFixed): New field.
12700 (LocalInfo.MakePinned): Set `IsFixed' to true.
12702 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12704 * attribute.cs (Attribute.Resolve): While doing a Member lookup
12705 for .ctors, ensure that we only ask for members declared in the
12706 attribute type (BindingFlags.DeclaredOnly).
12710 * expression.cs (Error_WrongNumArguments): Report error 1501
12711 correctly the way CSC does.
12713 2003-07-13 Martin Baulig <martin@ximian.com>
12715 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12716 lookup on the fully qualified name, to make things like "X.X" work
12717 where "X.X" is a fully qualified type name, but we also have a
12718 namespace "X" in the using list. Fixes #41975.
12720 2003-07-13 Martin Baulig <martin@ximian.com>
12722 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12723 function. If we're a CompoundAssign, we need to create an embedded
12724 CompoundAssign, not an embedded Assign.
12725 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12728 2003-07-13 Martin Baulig <martin@ximian.com>
12730 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12731 work to fix bug #46088.
12733 2003-07-13 Ravi Pratap <ravi@ximian.com>
12735 * class.cs (Operator.Emit): Do not emit attributes here - it is
12736 taken care of by the Method class that we delegate too. This takes
12737 care of bug #45876.
12739 2003-07-10 Martin Baulig <martin@ximian.com>
12741 * expression.cs (TypeOfVoid): New class.
12742 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
12744 2003-07-10 Martin Baulig <martin@ximian.com>
12746 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12749 2003-07-10 Martin Baulig <martin@ximian.com>
12751 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12752 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12754 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12756 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12758 2003-07-10 Martin Baulig <martin@ximian.com>
12760 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12761 of decimal. Fixes #42850.
12763 NOTE: I also fixed the created byte blob, but this doesn't work on
12764 the MS runtime and csc never produces any byte blobs for decimal
12767 2003-07-10 Martin Baulig <martin@ximian.com>
12769 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12770 structs; fixes #32068.
12771 (Block.AddChildVariableNames): Fixed #44302.
12773 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12775 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12777 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12779 * attribute.cs: And this test is onger needed.
12781 2003-07-08 Martin Baulig <martin@ximian.com>
12783 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12784 inaccessible types. Fixes #36313.
12786 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12788 * namespace.cs (NamespaceEntry): Create implicit entries for all
12789 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12790 implicit entries for N1.N2 and N1.
12792 2003-07-08 Martin Baulig <martin@ximian.com>
12794 Rewrote the handling of namespaces to fix a lot of the issues
12795 wrt. `using' aliases etc.
12797 * namespace.cs (Namespace): Splitted this class into a
12798 per-assembly `Namespace' and a per-file `NamespaceEntry'.
12800 * typemanager.cs (TypeManager.IsNamespace): Removed.
12801 (TypeManager.ComputeNamespaces): Only compute namespaces from
12802 loaded assemblies here, not the namespaces from the assembly we're
12803 currently compiling.
12805 2003-07-08 Martin Baulig <martin@ximian.com>
12807 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12809 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12811 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12814 I thought about the memory savings here, but LookupTypeReflection
12815 is used under already very constrained scenarios. Compiling
12816 corlib or mcs only exposes one hit, so it would not really reduce
12817 any memory consumption.
12819 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12821 * typemanager.cs: fixes bug #45889 by only adding public types from
12822 other assemblies to the list of known types.
12824 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12826 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12827 on the type we resolved.
12829 2003-07-05 Martin Baulig <martin@ximian.com>
12831 * pending.cs (PendingImplementation.ParentImplements): Don't
12832 create the proxy if the parent is abstract.
12834 * class.cs (TypeContainer.DefineIndexers): Process explicit
12835 interface implementations first. Fixes #37714.
12837 2003-07-04 Miguel de Icaza <miguel@ximian.com>
12839 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12840 defined recursively; but since we modify the input parameters
12841 (left is set to `this' temporarily), we reset this value if the
12842 left_is_explicit is false, which gives the original semantics to
12845 * literal.cs (NullPointer): new class used to represent a null
12846 literal in a pointer context.
12848 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12849 type is a pointer, use a NullPointer object instead of a
12850 NullLiteral. Closes 43687
12852 (ExplicitConversion): Convert pointer values using
12853 the conv opcode to the proper type.
12855 * ecore.cs (New): change ValueTypeVariable property into a method,
12856 that returns whether the valuetype is suitable for being used.
12858 * expression.cs (Binary.DoNumericPromotions): Only return if we
12859 the int constant was a valid uint, and we can return both left and
12860 right as uints. If not, we continue processing, to trigger the
12861 type conversion. This fixes 39018.
12863 * statement.cs (Block.EmitMeta): During constant resolution, set
12864 the CurrentBlock property on the emitcontext, so that we resolve
12865 constants propertly.
12867 2003-07-02 Martin Baulig <martin@ximian.com>
12869 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12870 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12872 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12873 than emitting it here.
12875 * statement.cs: Fixed some more flow analysis bugs.
12877 2003-07-02 Martin Baulig <martin@ximian.com>
12879 * class.cs (MethodData.Define): When implementing interface
12880 methods, set Final unless we're Virtual.
12882 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12883 check work for interface methods.
12885 2003-07-01 Martin Baulig <martin@ximian.com>
12887 * ecore.cs (EmitContext.This): Replaced this property with a
12888 GetThis() method which takes a Location argument. This ensures
12889 that we get the correct error location for a CS0188.
12891 2003-07-01 Miguel de Icaza <miguel@ximian.com>
12893 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12894 ImplicitStandardConversion.
12896 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12898 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
12900 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12903 2003-06-30 Miguel de Icaza <miguel@ximian.com>
12905 * class.cs (Constructor.Define): Turn off initlocals for unsafe
12908 (MethodData.Define): Turn off initlocals for unsafe methods.
12910 2003-06-29 Miguel de Icaza <miguel@ximian.com>
12912 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12913 complete; Fixes #37521.
12915 * delegate.cs: Use Modifiers.TypeAttr to compute the
12916 TypeAttributes, instead of rolling our own. This makes the flags
12917 correct for the delegates.
12919 2003-06-28 Miguel de Icaza <miguel@ximian.com>
12921 * class.cs (Constructor.Define): Set the private flag for static
12922 constructors as well.
12924 * cs-parser.jay (statement_expression): Set the return value to
12925 null, to avoid a crash when we catch an error.
12927 2003-06-24 Miguel de Icaza <miguel@ximian.com>
12929 * cs-parser.jay: Applied patch from Jackson that adds support for
12930 extern and unsafe modifiers to destructor declarations.
12932 * expression.cs: Report error 21 if the user is trying to index a
12935 * driver.cs: Add an error message, suggested by the bug report.
12937 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12938 if we do not have a ": this ()" constructor initializer. Fixes 45149
12940 2003-06-14 Miguel de Icaza <miguel@ximian.com>
12942 * namespace.cs: Add some information to reduce FAQs.
12944 2003-06-13 Miguel de Icaza <miguel@ximian.com>
12946 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12947 underlying enumeration types. Fixes #43915.
12949 * expression.cs: Treat ushort/short as legal values to be used in
12950 bitwise operations.
12952 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12954 * delegate.cs: transfer custom attributes for paramenters from
12955 the delegate declaration to Invoke and BeginInvoke.
12957 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12959 * attribute.cs: handle custom marshalers and emit marshal info
12962 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
12964 * makefile.gnu: Added anonymous.cs to the compiler sources.
12966 2003-05-28 Miguel de Icaza <miguel@ximian.com>
12968 * iterators.cs: Change the name of the proxy class to include two
12971 * cs-parser.jay: Update grammar to include anonymous methods.
12973 * anonymous.cs: new file.
12975 2003-05-27 Miguel de Icaza <miguel@ximian.com>
12977 * class.cs (Field.Define): Add missing test for pointers and
12980 2003-05-27 Ravi Pratap <ravi@ximian.com>
12982 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12983 we use the stobj opcode.
12985 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12986 since it wasn't the correct fix.
12988 It still is puzzling that we are required to use stobj for IntPtr
12989 which seems to be a ValueType.
12991 2003-05-26 Miguel de Icaza <miguel@ximian.com>
12993 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12994 during regular simple name resolution. Now, the trick is that
12995 instead of returning for processing the simplename, we do a
12996 TypeManager.LookupType (ie, a rooted lookup as opposed to a
12997 contextual lookup type). If a match is found, return that, if
12998 not, return for further composition.
13000 This fixes long-standing 30485.
13002 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13003 using the address to initialize an object, do an Stobj instead of
13004 using the regular Stelem.
13006 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13007 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13008 Because if we are a BaseIndexerAccess that value will be true.
13011 * statement.cs (GotoCase.Resolve): Return after reporting an
13012 error, do not attempt to continue.
13014 * expression.cs (PointerArithmetic.Emit): If our operand is a
13015 long, convert our constants to match the operand before
13016 multiplying. Convert to I type before adding. Fixes 43670.
13018 2003-05-14 Ravi Pratap <ravi@ximian.com>
13020 * enum.cs (ImplicitConversionExists) : Rename to
13021 ImplicitEnumConversionExists to remove ambiguity.
13023 * ecore.cs (NullCast): New type of cast expression class which
13024 basically is very similar to EmptyCast with the difference being
13025 it still is a constant since it is used only to cast a null to
13027 (eg. (string) null)
13029 * convert.cs (ImplicitReferenceConversion): When casting a null
13030 literal, we return a NullCast.
13032 * literal.cs (NullLiteralTyped): Remove - I don't see why this
13033 should be around anymore.
13035 The renaming (reported was slightly wrong). Corrections:
13037 ConvertImplicitStandard -> ImplicitConversionStandard
13038 ConvertExplicitStandard -> ExplicitConversionStandard
13040 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13041 before passing them in !
13043 * convert.cs (ImplicitConversionStandard): When comparing for
13044 equal expr and target types, ensure that expr is not a
13047 In general, we must not be checking (expr_type ==
13048 target_type) in the top level conversion methods
13049 (ImplicitConversion, ExplicitConversion etc). This checking is
13050 done in the methods that they delegate to.
13052 2003-05-20 Miguel de Icaza <miguel@ximian.com>
13054 * convert.cs: Move Error_CannotConvertType,
13055 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13056 ImplicitNumericConversion, ImplicitConversionExists,
13057 ImplicitUserConversionExists, StandardConversionExists,
13058 FindMostEncompassedType, FindMostSpecificSource,
13059 FindMostSpecificTarget, ImplicitUserConversion,
13060 ExplicitUserConversion, GetConversionOperators,
13061 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13062 TryImplicitIntConversion, Error_CannotConvertImplicit,
13063 ConvertImplicitRequired, ConvertNumericExplicit,
13064 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13065 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13068 Perform the following renames:
13070 StandardConversionExists -> ImplicitStandardConversionExists
13071 ConvertImplicit -> ImplicitConversion
13072 ConvertImplicitStandard -> ImplicitStandardConversion
13073 TryImplicitIntConversion -> ImplicitIntConversion
13074 ConvertImplicitRequired -> ImplicitConversionRequired
13075 ConvertNumericExplicit -> ExplicitNumericConversion
13076 ConvertReferenceExplicit -> ExplicitReferenceConversion
13077 ConvertExplicit -> ExplicitConversion
13078 ConvertExplicitStandard -> ExplicitStandardConversion
13080 2003-05-19 Martin Baulig <martin@ximian.com>
13082 * statement.cs (TypeInfo.StructInfo): Made this type protected.
13083 (TypeInfo): Added support for structs having structs as fields.
13085 * ecore.cs (FieldExpr): Implement IVariable.
13086 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13087 VariableInfo for the field.
13089 2003-05-18 Martin Baulig <martin@ximian.com>
13091 * expression.cs (This.DoResolve): Report a CS0027 if we're
13092 emitting a field initializer.
13094 2003-05-18 Martin Baulig <martin@ximian.com>
13096 * expression.cs (This.ResolveBase): New public function.
13097 (This.DoResolve): Check for CS0188.
13099 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13102 * ecore.cs (MethodGroupExpr.DoResolve): Set the
13103 `instance_expression' to null if we don't have any non-static
13106 2003-05-18 Martin Baulig <martin@ximian.com>
13108 Reworked the way how local variables and parameters are handled by
13109 the flow analysis code.
13111 * statement.cs (TypeInfo, VariableMap): New public classes.
13112 (VariableInfo): New public class. This is now responsible for
13113 checking whether a variable has been assigned. It is used for
13114 parameters and local variables.
13115 (Block.EmitMeta): Take the InternalParameters as argument; compute
13116 the layout of the flow vectors here.
13117 (Block.LocalMap, Block.ParameterMap): New public properties.
13118 (FlowBranching): The .ctor doesn't get the InternalParameters
13119 anymore since Block.EmitMeta() now computes the layout of the flow
13121 (MyStructInfo): This class is now known as `StructInfo' and nested
13122 in `TypeInfo'; we don't access this directly anymore.
13124 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13125 property and removed IsAssigned(), IsFieldAssigned(),
13126 SetAssigned() and SetFieldAssigned(); we now call them on the
13127 VariableInfo so we don't need to duplicate this code everywhere.
13129 * expression.cs (ParameterReference): Added `Block block' argument
13131 (LocalVariableReference, ParameterReference, This): The new
13132 VariableInfo class is now responsible for all the definite
13135 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13136 IsParameterAssigned, SetParameterAssigned): Removed.
13138 2003-05-18 Martin Baulig <martin@ximian.com>
13140 * typemanager.cs (InitCoreTypes): Try calling
13141 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13142 the 3-args-version. Corlib now also needs our `void_type'.
13143 (GetMethod): Added overloaded version which takes an optional
13144 `bool report_errors' to allow lookups of optional methods.
13146 2003-05-12 Martin Baulig <martin@ximian.com>
13148 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13149 only used for locals and not for parameters.
13151 2003-05-12 Miguel de Icaza <miguel@ximian.com>
13153 * support.cs (InternalParameters.ParameterType): Return the
13154 ExternalType of the parameter.
13156 * parameter.cs (Parameter.ExternalType): drop the two arguments,
13159 2003-05-11 Miguel de Icaza <miguel@ximian.com>
13161 * class.cs (MethodData.Define): Do not set the `newslot' on
13162 interface members, if they are also flagged as "override".
13164 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13165 better code for ++i and i++. This only works for static fields
13166 and local variables.
13168 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13169 want to pull the DeclSpace out of the builder_to_declspace instead
13170 of the TypeBuilder (like in TypeContainer.FindMembers).
13172 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13173 instead of LookupTypeContainer. Fixes the crash on .NET for
13174 looking up interface members.
13176 * const.cs: Create our own emit context during the Definition
13177 stage, so that constants are evaluated in the proper context, when
13178 a recursive definition happens.
13180 2003-05-11 Martin Baulig <martin@ximian.com>
13182 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
13183 new block for a switch section.
13184 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13185 the adding/lookup in the switch block. Fixes #39828.
13187 2003-05-09 Miguel de Icaza <miguel@ximian.com>
13189 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13190 functionality: I needed to convert the data after I had performed
13191 the add/sub operation into the operands type size.
13193 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13194 pass the type for the box operation, otherwise the resulting
13195 object would have been of type object.
13197 (BoxedCast): Add constructor to specify the type to box as.
13199 2003-05-07 Miguel de Icaza <miguel@ximian.com>
13201 * iterators.cs: I was reusing the `count' variable inadvertently,
13202 take steps to not allow this to happen.
13204 2003-05-06 Miguel de Icaza <miguel@ximian.com>
13206 * attribute.cs (Attribute.Resolve): Params attributes are encoded
13207 by creating an array at the point where the params starts and
13208 putting all those arguments there, then adjusting the size of the
13211 2003-05-05 Miguel de Icaza <miguel@ximian.com>
13213 * expression.cs (New.AddressOf): Implement interface
13214 IMemoryLocation. This is used when the `new' operator is used in
13215 the context of an invocation to a method on a value type.
13217 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13220 * namespace.cs: Also check the using aliases here.
13222 * driver.cs: Move the test for using validity after the types have
13223 been entered, so we do a single pass that also includes the using
13226 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13227 in the regular case. CreateSiblingForFinally is doing extra
13230 * attribute.cs (GetAttributeArgumentExpression): Store the result
13231 on an out value, and use the return value to indicate failure
13232 instead of using null (which is a valid return for Constant.GetValue).
13234 * statement.cs: Perform the analysis flow for the increment
13235 portion after the statement, because this will be the real flow of
13236 execution. Fixes #42385
13238 * codegen.cs (EmitContext.EmitArgument,
13239 EmitContext.EmitStoreArgument): New helper functions when the
13240 RemapToProxy flag is set.
13242 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13245 Add support for remapping parameters.
13247 * iterators.cs: Propagate parameter values; Store parameter
13248 values in the proxy classes.
13250 2003-05-04 Miguel de Icaza <miguel@ximian.com>
13252 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
13253 need a proxy reference; I do not know what I was thinking
13255 * cs-parser.jay (constructor_initializer): catch another error,
13256 and display nice message.
13258 (field_declaration): catch void field declaration
13259 to flag a better error.
13261 * class.cs (MemberBase.CheckBase): Report an error instead of a
13262 warning if a new protected member is declared in a struct.
13263 (Field.Define): catch the error of readonly/volatile.
13265 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13267 (FieldExpr.AddressOf): ditto. Catch error where the address of a
13268 volatile variable is taken
13270 2003-05-02 Miguel de Icaza <miguel@ximian.com>
13272 * statement.cs (Fixed.Resolve): Report an error if we are not in
13275 2003-05-01 Miguel de Icaza <miguel@ximian.com>
13277 * typemanager.cs: reuse the code that handles type clashes for
13278 delegates and enumerations.
13280 * class.cs (Report28): Always report.
13282 * expression.cs (EncodeAsAttribute): Allow nulls here.
13284 2003-04-28 Miguel de Icaza <miguel@ximian.com>
13286 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13287 the functionality for testing whether an expression is valid for
13288 an attribute here. Also handle the case of arrays of elements
13291 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13292 encoding a linear array into an array of objects that are suitable
13293 to be passed to an CustomAttributeBuilder.
13295 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13297 * ecore.cs: (FieldExpr): Handle field remapping here.
13299 * iteratators.cs: Pass the instance variable (if the method is an
13300 instance method) to the constructors, so we can access the field
13301 variables on the class.
13303 TODO: Test this with structs. I think the THIS variable on
13304 structs might have to be a pointer, and not a refenrece
13306 2003-04-27 Miguel de Icaza <miguel@ximian.com>
13308 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13309 local variables to fields in a proxy class.
13311 * iterators.cs (PopulateProxy): Rename our internal fields to
13313 Create a <THIS> field if we are an instance method, so we can
13314 reference our parent container variables.
13315 (MapVariable): Called back from the EmitContext code to enter a
13316 new variable to field mapping into the proxy class (we just create
13320 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13321 for using the remapped locals to fields.
13323 I placed the code here, because that gives the same semantics to
13324 local variables, and only changes the Emit code.
13326 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13327 statements inside iterators.
13328 (VariableInfo): Add a FieldBuilder for the cases when we are
13329 remapping local variables to fields in a proxy class
13331 * ecore.cs (SimpleNameResolve): Avoid testing two times for
13332 current_block != null.
13334 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13335 not cope with strings, as it has been moved to the
13336 TableSwitchEmit. Fixed bug in switch generation.
13338 * expression.cs (New.DoResolve): Provide more context for the user
13339 when reporting an error.
13341 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13344 * expression.cs (MemberAccess.DoResolve): When we get a type back,
13345 check the permissions for it. Note than in a type-resolution
13346 context the check was already present in DeclSpace.ResolveType,
13347 but was missing from the MemberAccess.
13349 (ArrayCreation.CheckIndices): warn if the user has
13350 more nested levels of expressions, but there are no more
13351 dimensions specified. Avoids crash on bug 41906.
13353 2003-04-26 Miguel de Icaza <miguel@ximian.com>
13355 * statement.cs (Block): replace Implicit bool, for a generic
13357 New flag: `Unchecked'. This is used during the EmitMeta phase
13358 (which is out-of-line with the regular Resolve/Emit process for a
13359 statement, as this is done ahead of time, but still gets a chance
13360 to call constant resolve).
13362 (Block.Flags): new enum for adding a new flag.
13364 (Block.EmitMeta): track the state of unchecked.
13366 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13367 to enable constant resolution to work there as well.
13369 2003-04-22 Miguel de Icaza <miguel@ximian.com>
13371 * typemanager.cs (ienumerable_type): Also look up
13372 System.Collections.IEnumerable.
13374 2003-04-21 Miguel de Icaza <miguel@ximian.com>
13376 TODO: Test more than one conditional per method.
13378 * class.cs (Indexer.Define): Report the location where the user is
13379 referencing the unsupported feature.
13381 (MethodData): Overload the use of `conditionals' to
13382 minimize the creation of needless ArrayLists. This saves roughly
13383 212kb on my machine.
13385 (Method): Implement the new IIteratorContainer interface.
13386 (Method.SetYields): Implement the method by setting the ModFlags
13387 to contain METHOD_YIELDS.
13389 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13390 which just got set to null.
13392 * iterators.cs: New file.
13394 (Yield, YieldBreak): New statements.
13396 * statement.cs (Return.Resolve): Flag an error if we are used in
13397 an iterator method.
13399 * codegen.cs (InIterator): New flag set if the code is being
13400 compiled in an iterator method.
13402 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
13403 internal modifier, and we just use it to avoid adding extra
13404 fields, as this is seldom used.
13406 * cs-parser.jay: Add yield_statement (yield and yield break).
13408 * driver.cs: New flag -v2 to turn on version 2 features.
13410 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13411 hashtable when v2 is enabled.
13413 2003-04-20 Miguel de Icaza <miguel@ximian.com>
13415 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13416 there is already a namespace defined with this name.
13418 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13419 people upgraded their corlibs.
13421 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13422 always use fully qualified types, no need to use the compiler
13425 (TypeManager.IsNamespace): Use binarysearch.
13427 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13428 AddDelegate): I did not quite use the new IsValid API properly: I
13429 have to pass the short-name and the fullname. I was passing only
13430 the basename instead of the fullname sometimes.
13432 (TypeContainer.DefineType): call NamespaceClash.
13434 * interface.cs (Interface.DefineType): use NamespaceClash before
13437 * delegate.cs (Delegate.DefineType): use NamespaceClash before
13440 * enum.cs: (Enum.DefineType): use NamespaceClash before
13443 * typemanager.cs (: 3-line patch that gives us some tasty 11%
13444 speed increase. First, use the negative_hits cache when we get a
13445 negative. Second, add the type with its full original name
13446 instead of the new . and + encoded name (reflection uses + to
13447 separate type from a nested type). Use LookupTypeReflection
13448 directly which bypasses the type->name hashtable (that we already
13449 know does not contain the type.
13451 * decl.cs (DeclSpace.ResolveTypeExpr): track the
13452 location/container type.
13454 * driver.cs: When passing utf8, use directly the UTF8Encoding.
13456 2003-04-19 Miguel de Icaza <miguel@ximian.com>
13458 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13460 * delegate.cs (NewDelegate.Resolve): Test whether an instance
13461 method is being referenced in the method group from a static
13462 context, and report error 120 if so.
13464 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13467 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13468 is created, we create the A namespace).
13470 * cs-parser.jay: A namespace also introduces a DeclarationFound.
13473 2003-04-18 Miguel de Icaza <miguel@ximian.com>
13475 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13476 invocation to ModuleBuilder.GetType with the same values will
13477 return a new type instance, so we need to cache its return
13480 * expression.cs (Binary.ResolveOperator): Only allow the compare
13481 operators on enums if they are of the same type.
13483 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13484 types of ValueType on their own case. Before we were giving them
13485 the same treatment as objects.
13487 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13488 fullname. Short name is used to compare against container name.
13489 Fullname is used to check against defined namespace names.
13491 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13492 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13494 (Method.CheckBase): Call parent.
13495 (MemberBase.CheckBase): Check for protected members on sealed
13497 (PropertyBase.CheckBase): Call parent.
13498 (Field.Define): Call parent.
13500 * report.cs: Negative error codes are now mapped to 8000 - code,
13501 so that the display is render more nicely.
13503 * typemanager.cs: Do not use try/catch, instead report a regular
13506 (GetPointerType, GetReferenceType): These methods provide
13507 mechanisms to obtain the T* and T& from a T. We had the code
13508 previously scattered around the code base, and it also used
13509 TypeManager.LookupType that would go through plenty of caches.
13510 This one goes directly to the type source.
13512 In some places we did the Type.GetType followed by
13513 ModuleBuilder.GetType, but not in others, so this unifies the
13514 processing as well.
13516 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13517 statements now that we have namespace information.
13519 * typemanager.cs (IsNamespace): New method, returns whether the
13520 string presented is a namespace or not.
13522 (ComputeNamespaces): New public entry point, computes the list of
13523 available namespaces, using the GetNamespaces API call in Mono, or
13524 the slower version in MS.NET.
13526 Now before we start the semantic analysis phase, we have a
13527 complete list of namespaces including everything that the user has
13530 Deleted old code to cache namespaces in .nsc files.
13532 2003-04-17 Miguel de Icaza <miguel@ximian.com>
13534 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13535 class/struct location definition Location for the implicit
13536 constructor location.
13538 (Operator.Define): Use the location of the operator for the
13539 implicit Method definition.
13541 (Constructor.Emit): use the constructor location for the implicit
13542 base initializer constructor.
13544 * ecore.cs: Remove ITypeExpression. This interface is now gone,
13545 and the Expression class now contains two new methods:
13547 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
13548 isolate type lookup from the rest of the resolution process.
13550 Since we use Expressions to hold type definitions due to the way
13551 we parse the input we have historically overloaded Resolve to
13552 perform the Type lookups if a special flag is passed. Now this is
13553 eliminated and two methods take their place.
13555 The differences in the two methods between xStep and xTerminal is
13556 that xStep is involved in our current lookup system that uses
13557 SimpleNames to compose a name, while xTerminal is used just to
13558 catch the case where the simplename lookup failed.
13560 2003-04-16 Miguel de Icaza <miguel@ximian.com>
13562 * expression.cs (ResolveMemberAccess): Remove redundant code.
13563 TypeExpr expressions are always born fully resolved.
13565 * interface.cs (PopulateMethod): Do not lookup the types twice.
13566 We were doing it once during SemanticAnalysis and once during
13569 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13570 in local variable type definitions, were being returned as a
13571 SimpleName (we decomposed everything into a string), that is
13572 because primary_expression was being used instead of a type in the
13573 grammar (reduce/reduce conflicts).
13575 The part that was wrong is that we converted the expression into a
13576 string (an oversimplification in one hand, compounded with primary
13577 expressions doing string concatenation).
13583 Would return "A.B.C[]" as a SimpleName. This stopped things like
13584 using clauses from working on this particular context. And a type
13585 was being matched directly against "A.B.C[]".
13587 We now use the correct approach, and allow for ComposedCast to be
13588 part of the unary expression. So the "A.B.C []" become a composed
13589 cast of "A.B.C" (as a nested group of MemberAccess with a
13590 SimpleName at the end) plus the rank composition "[]".
13594 2003-04-10 Miguel de Icaza <miguel@ximian.com>
13596 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13597 for the access level checking.
13599 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
13600 `TypeContainer container', because I kept getting confused when I
13601 was debugging this code.
13603 * expression.cs (Indexers): Instead of tracking getters/setters,
13604 we now track them in parallel. We create one arraylist less, but
13605 most importantly it is possible now for the LValue code to find a
13606 matching get for a set.
13608 (IndexerAccess.DoResolveLValue): Update the code.
13609 GetIndexersForType has been modified already to extract all the
13610 indexers from a type. The code assumed it did not.
13612 Also make the code set the correct return type for the indexer.
13613 This was fixed a long time ago for properties, but was missing for
13614 indexers. It used to be void_type.
13616 (Binary.Emit): Test first for doubles instead of
13617 floats, as they are more common.
13619 (Binary.EmitBranchable): Use the .un version of the branch opcodes
13620 when dealing with floats and the <=, >= operators. This fixes bug
13623 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13624 to load the array value by emitting a load on the foreach variable
13625 type. This was incorrect.
13627 We now emit the code to load an element using the the array
13628 variable type, and then we emit the conversion operator.
13632 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
13634 * attribute.cs: Avoid allocation of ArrayLists in the common case.
13636 2003-04-09 Miguel de Icaza <miguel@ximian.com>
13638 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13639 test for protection before we test for signatures.
13641 (MethodSignature.ToString): implement.
13643 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13644 to the case where we reduced into a LongConstant.
13646 * decl.cs (CheckAccessLevel): If the type is an array, we can not
13647 depend on whether the information is acurrate, because the
13648 Microsoft runtime will always claim that the array type is public,
13649 regardless of the real state.
13651 If the type is a pointer, another problem happens: the type is
13652 reported as non-public in Microsoft.
13654 In both cases we have to call CheckAccessLevel recursively with
13655 the underlying type as the argument to be tested.
13657 2003-04-08 Miguel de Icaza <miguel@ximian.com>
13659 * assign.cs (Assign.Emit): If we are dealing with a compound
13660 assignment expression, we should use the code path that stores the
13661 intermediate result in a temporary value. This fixes #40903.
13663 *expression.cs (Indirection.ToString): Provide ToString method for
13666 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
13668 * class.cs: Null out fields holding references to Block objects so
13669 they can be garbage collected.
13671 * expression.cs (OverloadResolve): Remove unused local.
13673 2003-04-07 Martin Baulig <martin@ximian.com>
13675 * codegen.cs (EmitContext.CurrentFile): New public field.
13676 (EmitContext.Mark): Use the CurrentFile to check whether the
13677 location is in the correct file.
13678 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13680 2003-04-07 Martin Baulig <martin@ximian.com>
13682 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13684 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13685 location. [FIXME: The location argument which gets passed to this
13686 method is sometimes wrong!]
13688 2003-04-07 Nick Drochak <ndrochak@gol.com>
13690 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13692 2003-04-07 Miguel de Icaza <miguel@ximian.com>
13694 * expression.cs (Indirection.EmitAssign): We were using the
13695 temporary, but returning immediately instead of continuing the
13698 2003-04-06 Martin Baulig <martin@ximian.com>
13700 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13701 if it's a nested child, but also deriving from the outer class.
13704 * typemanager.cs (IsNestedChildOf): Make this work if it's a
13705 nested child, but also deriving from the outer class. See
13707 (FilterWithClosure): We may access private members of the outer
13708 class if we're a nested child and deriving from the outer class.
13709 (RealMemberLookup): Only set `closure_private_ok' if the
13710 `original_bf' contained BindingFlags.NonPublic.
13712 2003-04-05 Martin Baulig <martin@ximian.com>
13714 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
13716 2003-04-02 Miguel de Icaza <miguel@ximian.com>
13718 * class.cs (Event.Define): Do not allow abstract events to have
13721 2003-04-01 Miguel de Icaza <miguel@ximian.com>
13723 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13724 block in event declarations.
13726 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13727 value type, get its address.
13729 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13730 leaving a class on the stack instead of a boolean value (int
13731 0/1). Change the code so we compare against null, and then the
13732 result against zero.
13734 * class.cs (TypeContainer.GetClassBases): We were checking for the
13735 parent class being sealed too late.
13737 * expression.cs (Binary.Emit): For <= and >= when dealing with
13738 floating point values, use cgt.un and clt.un instead of cgt and
13741 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
13743 * statement.cs: Apply the same optimization as MS: skip the
13744 GetEnumerator returning an IEnumerator, and use the one returning a
13745 CharEnumerator instead. This allows us to avoid the try-finally block
13748 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
13750 * cs-parser.jay: Attributes cannot be applied to
13751 namespaces. Fixes #40473
13753 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13756 (Add*): check if the name is valid using the full name for constants,
13757 fields, properties and events.
13759 2003-03-28 Miguel de Icaza <miguel@ximian.com>
13761 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13762 char constants to be part of the enumeration.
13764 * expression.cs (Conditional.DoResolve): Add support for operator
13765 true. Implements the missing functionality from 14.12
13767 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13768 operator true/false as required by the spec.
13770 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13771 implicit conversion to boolean.
13773 * statement.cs (Statement.ResolveBoolean): A boolean expression is
13774 also one where the type implements `operator true'.
13776 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13777 get an expression that will invoke operator true based on an
13780 (GetConversionOperators): Removed the hack that called op_True
13783 (Expression.ResolveBoolean): Move this from Statement.
13785 2003-03-17 Miguel de Icaza <miguel@ximian.com>
13787 * ecore.cs (FieldExpr): do not allow initialization of initonly
13788 fields on derived classes
13790 2003-03-13 Martin Baulig <martin@ximian.com>
13792 * statement.cs (Block.Emit): Call ig.BeginScope() and
13793 ig.EndScope() when compiling with debugging info; call
13794 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13796 2003-03-08 Miguel de Icaza <miguel@ximian.com>
13798 * expression.cs (Indexers): Do not construct immediately, allow
13799 for new members to be appended as we go. Fixes 38143
13801 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13803 * expression.cs: save/restore context when resolving an unchecked
13806 2003-03-05 Miguel de Icaza <miguel@ximian.com>
13808 * cfold.cs: Catch division by zero in modulus operator during
13811 2003-03-03 Miguel de Icaza <miguel@ximian.com>
13813 * interface.cs (Interface.DefineMembers): Avoid defining members
13816 2003-02-27 Miguel de Icaza <miguel@ximian.com>
13818 * driver.cs: handle the +/- options for -noconfig
13820 * statement.cs (Unckeched.Resolve): Also track the state of
13821 unchecked in the Resolve phase.
13823 2003-02-27 Martin Baulig <martin@ximian.com>
13825 * ecore.cs (Expression.MemberLookup): Don't create a
13826 MethodGroupExpr for something which is not a method. Fixes #38291.
13828 2003-02-25 Miguel de Icaza <miguel@ximian.com>
13830 * class.cs (MemberBase.CheckParameters): Also check that the type
13831 is unmanaged if it is a pointer.
13833 * expression.cs (SizeOf.Resolve): Add location information.
13835 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13836 a managed type is declared.
13838 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13839 parameter modifiers as well. Fixes bug 38606
13841 * class.cs: Very sad. Am backing out the speed up changes
13842 introduced by the ArrayList -> Array in the TypeContainer, as they
13843 were not actually that much faster, and introduced a bug (no error
13844 reports on duplicated methods).
13846 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13847 source first, this will guarantee that we have a valid expression
13848 before calling in lower levels functions that will require a
13849 resolved object. Then use this original_source in the
13850 target.ResolveLValue instead of the original source that was
13853 Another change. Use target.Resolve instead of LValueResolve.
13854 Although we are resolving for LValues, we will let the Assign code
13855 take care of that (it will be called again from Resolve). This
13856 basically allows code like this:
13858 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13859 class Y { void A (X x) { x [0] += o; }
13861 The problem was that the indexer was trying to resolve for
13862 set_Item (idx, object o) and never finding one. The real set_Item
13863 was set_Item (idx, X). By delaying the process we get the right
13868 2003-02-23 Martin Baulig <martin@ximian.com>
13870 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13871 while calling DoEmit ().
13873 * codegen.cs (EmitContext.Mark): Don't mark locations in other
13874 source files; if you use the #line directive inside a method, the
13875 compiler stops emitting line numbers for the debugger until it
13876 reaches the end of the method or another #line directive which
13877 restores the original file.
13879 2003-02-23 Martin Baulig <martin@ximian.com>
13881 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13883 2003-02-23 Martin Baulig <martin@ximian.com>
13885 * statement.cs (Block.AddChildVariableNames): We need to call this
13886 recursively, not just for our immediate children.
13888 2003-02-23 Martin Baulig <martin@ximian.com>
13890 * class.cs (Event.Define): Always make the field private, like csc does.
13892 * typemanager.cs (TypeManager.RealMemberLookup): Make events
13893 actually work, fixes bug #37521.
13895 2003-02-23 Miguel de Icaza <miguel@ximian.com>
13897 * delegate.cs: When creating the various temporary "Parameters"
13898 classes, make sure that we call the ComputeAndDefineParameterTypes
13899 on those new parameters (just like we do with the formal ones), to
13900 allow them to be resolved in the context of the DeclSpace.
13902 This fixes the bug that Dick observed in Bugzilla #38530.
13904 2003-02-22 Miguel de Icaza <miguel@ximian.com>
13906 * expression.cs (ResolveMemberAccess): When resolving a constant,
13907 do not attempt to pull a constant if the value was not able to
13908 generate a valid constant.
13910 * const.cs (LookupConstantValue): Do not report more errors than required.
13912 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13914 * expression.cs: fixes bug #38328.
13916 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13918 * class.cs: Changed all the various members that can be part of a
13919 class from being an ArrayList to be an Array of the right type.
13920 During the DefineType type_list, interface_list, delegate_list and
13921 enum_list are turned into types, interfaces, delegates and enums
13924 And during the member population, indexer_list, event_list,
13925 constant_list, field_list, instance_constructor_list, method_list,
13926 operator_list and property_list are turned into their real arrays.
13928 Although we could probably perform this operation earlier, for
13929 good error reporting we need to keep the lists and remove the
13930 lists for longer than required.
13932 This optimization was triggered by Paolo profiling the compiler
13933 speed on the output of `gen-sample-program.pl' perl script.
13935 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13936 not crash in methods like MemberLookupFailed that use this field.
13938 This problem arises when the compiler fails to resolve a type
13939 during interface type definition for example.
13941 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13943 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13944 inherit from System.Object, so we have to stop at null, not only
13945 when reaching System.Object.
13947 2003-02-17 Miguel de Icaza <miguel@ximian.com>
13949 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13950 DeclaredOnly because the parent indexer might have had a different
13951 name, but did not loop until the top of the hierarchy was reached.
13953 The problem this one fixes is 35492: when a class implemented an
13954 indexer from an interface, we were getting the interface method
13955 (which was abstract) and we were flagging an error (can not invoke
13958 This also keeps bug 33089 functioning, and test-148 functioning.
13960 * typemanager.cs (IsSpecialMethod): The correct way of figuring
13961 out if a method is special is to see if it is declared in a
13962 property or event, or whether it is one of the predefined operator
13963 names. This should fix correctly #36804.
13965 2003-02-15 Miguel de Icaza <miguel@ximian.com>
13967 The goal here is to remove the dependency on EmptyCast.Peel ().
13968 Killing it completely.
13970 The problem is that currently in a number of places where
13971 constants are expected, we have to "probe" for an EmptyCast, and
13972 Peel, which is not the correct thing to do, as this will be
13973 repetitive and will likely lead to errors.
13975 The idea is to remove any EmptyCasts that are used in casts that
13976 can be reduced to constants, so we only have to cope with
13979 This bug hunt was triggered by Bug 37363 and the desire to remove
13980 the duplicate pattern where we were "peeling" emptycasts to check
13981 whether they were constants. Now constants will always be
13984 * ecore.cs: Use an enumconstant here instead of wrapping with
13987 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13988 throwing me off. By handling this we can get rid of a few hacks.
13990 * statement.cs (Switch): Removed Peel() code.
13992 2003-02-14 Miguel de Icaza <miguel@ximian.com>
13994 * class.cs: Location information for error 508
13996 * expression.cs (New.DoResolve): Add a guard against double
13997 resolution of an expression.
13999 The New DoResolve might be called twice when initializing field
14000 expressions (see EmitFieldInitializers, the call to
14001 GetInitializerExpression will perform a resolve on the expression,
14002 and later the assign will trigger another resolution
14004 This leads to bugs (#37014)
14006 * delegate.cs: The signature for EndInvoke should contain any ref
14007 or out parameters as well. We were not doing this in the past.
14009 * class.cs (Field.Define): Do not overwrite the type definition
14010 inside the `volatile' group. Turns out that volatile enumerations
14011 were changing the type here to perform a validity test, which
14014 2003-02-12 Miguel de Icaza <miguel@ximian.com>
14016 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14017 and structs, we do not want to load the instance variable
14019 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14020 enum_type has to be handled like an object reference (implicit
14021 conversions exists from this to object), but the regular IsClass
14022 and IsValueType tests will never return true for this one.
14024 Also we use TypeManager.IsValueType instead of type.IsValueType,
14025 just for consistency with the rest of the code (this is only
14026 needed if we ever use the construct exposed by test-180.cs inside
14027 corlib, which we dont today).
14029 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
14031 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14034 2003-02-09 Martin Baulig <martin@ximian.com>
14036 * namespace.cs (Namespace..ctor): Added SourceFile argument.
14037 (Namespace.DefineNamespaces): New static public method; this is
14038 called when we're compiling with debugging to add all namespaces
14039 to the symbol file.
14041 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14042 pass it to the Namespace's .ctor.
14044 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14045 and MethodBase arguments; pass the namespace ID to the symwriter;
14046 pass the MethodBase instead of the token to the symwriter.
14047 (SymbolWriter.DefineNamespace): New method to add a namespace to
14050 2003-02-09 Martin Baulig <martin@ximian.com>
14052 * symbolwriter.cs: New file. This is a wrapper around
14053 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
14054 methods here in near future.
14056 2003-02-09 Martin Baulig <martin@ximian.com>
14058 * codegen.cs (EmitContext.Mark): Just pass the arguments to
14059 ILGenerator.MarkSequencePoint() which are actually used by the
14062 2003-02-09 Martin Baulig <martin@ximian.com>
14064 * location.cs (SourceFile): New public sealed class. This
14065 contains the name and an index which is used in the location's token.
14066 (Location): Reserve an appropriate number of bits in the token for
14067 the source file instead of walking over that list, this gives us a
14068 really huge performance improvement when compiling with debugging.
14070 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14071 `SourceFile' argument instead of a string.
14072 (Driver.ProcessFile): Add all the files via Location.AddFile(),
14073 but don't parse/tokenize here, we need to generate the list of all
14074 source files before we do that.
14075 (Driver.ProcessFiles): New static function. Parses/tokenizes all
14078 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14079 instead of a string.
14081 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14084 2003-02-09 Martin Baulig <martin@ximian.com>
14086 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14087 filename on `#line default'.
14089 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14091 * statement.cs: don't clear the pinned var when the fixed statement
14092 returns from the method (fixes bug#37752).
14094 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14096 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
14099 2003-02-07 Martin Baulig <martin@ximian.com>
14101 * driver.cs: Removed the `--debug-args' command line argument.
14103 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14104 automatically by the AsssemblyBuilder.
14105 (CodeGen.InitializeSymbolWriter): We don't need to call any
14106 initialization function on the symbol writer anymore. This method
14107 doesn't take any arguments.
14109 2003-02-03 Miguel de Icaza <miguel@ximian.com>
14111 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14112 from referenced assemblies as well.
14114 2003-02-02 Martin Baulig <martin@ximian.com>
14116 * class.cs (MethodData.Emit): Generate debugging info for external methods.
14118 2003-02-02 Martin Baulig <martin@ximian.com>
14120 * class.cs (Constructor.Emit): Open the symbol writer before
14121 emitting the constructor initializer.
14122 (ConstructorInitializer.Emit): Call ec.Mark() to allow
14123 single-stepping through constructor initializers.
14125 2003-01-30 Miguel de Icaza <miguel@ximian.com>
14127 * class.cs: Handle error 549: do not allow virtual methods in
14130 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14132 * decl.cs: Check access levels when resolving types
14134 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14136 * statement.cs: Add parameters and locals set in catch blocks that might
14137 return to set vector
14139 2003-01-29 Miguel de Icaza <miguel@ximian.com>
14141 * class.cs (Operator): Set the SpecialName flags for operators.
14143 * expression.cs (Invocation.DoResolve): Only block calls to
14144 accessors and operators on SpecialName methods.
14146 (Cast.TryReduce): Handle conversions from char constants.
14149 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14151 * statement.cs: small memory and time optimization in FlowBranching.
14153 2003-01-28 Pedro Mart <yoros@wanadoo.es>
14155 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14156 problem that the last fix but in the other sid (Set).
14158 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14159 access when there is no indexer in the hierarchy.
14161 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14163 * class.cs: Combine some if statements.
14165 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14167 * driver.cs: fixed bug #37187.
14169 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
14171 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14172 any indexer, it's needed to build a list with all the indexers in the
14173 hierarchy (AllGetters), else we have problems. Fixes #35653.
14175 2003-01-23 Miguel de Icaza <miguel@ximian.com>
14177 * class.cs (MethodData.Define): It is wrong for an interface
14178 implementation to be static in both cases: explicit and implicit.
14179 We were only handling this in one case.
14181 Improve the if situation there to not have negations.
14183 * class.cs (Field.Define): Turns out that we do not need to check
14184 the unsafe bit on field definition, only on usage. Remove the test.
14186 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14188 * driver.cs: use assembly.Location instead of Codebase (the latest
14189 patch made mcs fail when using MS assemblies).
14191 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
14193 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14194 get the path to *corlib.dll.
14196 2003-01-21 Nick Drochak <ndrochak@gol.com>
14200 * typemanager.cs: Remove compiler warnings
14202 2003-01-20 Duncan Mak <duncan@ximian.com>
14204 * AssemblyInfo.cs: Bump the version number to 0.19.
14206 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14208 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14210 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
14212 * class.cs (Constructor::Emit): Emit debugging info for constructors.
14214 2003-01-17 Miguel de Icaza <miguel@ximian.com>
14216 * cs-parser.jay: Small fix: we were not comparing the constructor
14217 name correctly. Thanks to Zoltan for the initial pointer.
14219 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14221 * cs-tokenizer.cs: Set file name when specified with #line
14223 2003-01-15 Miguel de Icaza <miguel@ximian.com>
14225 * cs-parser.jay: Only perform the constructor checks here if we
14226 are named like the class; This will help provider a better
14227 error. The constructor path is taken when a type definition is
14228 not found, but most likely the user forgot to add the type, so
14229 report that rather than the constructor error.
14231 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14233 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14236 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14238 * cs-parser.jay: Add cleanup call.
14240 2003-01-13 Duncan Mak <duncan@ximian.com>
14242 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14243 consistent with other methods.
14245 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14247 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14249 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14251 * attribute.cs: only set GuidAttr to true when we have a
14254 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14258 * typemanager.cs: fixes to allow mcs compile corlib with the new
14259 Type.IsSubclassOf fix.
14261 2003-01-08 Miguel de Icaza <miguel@ximian.com>
14263 * expression.cs (LocalVariableReference.DoResolve): Classify a
14264 constant as a value, not as a variable. Also, set the type for
14267 * cs-parser.jay (fixed_statement): take a type instead of a
14268 pointer_type, so we can produce a better error message later.
14270 * statement.cs (Fixed.Resolve): Flag types that are not pointers
14273 (For.DoEmit): Make inifinite loops have a
14274 non-conditional branch back.
14276 (Fixed.DoEmit): First populate the pinned variables, then emit the
14277 statement, then clear the variables. Before I was emitting the
14278 code once for each fixed piece.
14281 2003-01-08 Martin Baulig <martin@ximian.com>
14283 * statement.cs (FlowBranching.MergeChild): A break in a
14284 SWITCH_SECTION does not leave a loop. Fixes #36155.
14286 2003-01-08 Martin Baulig <martin@ximian.com>
14288 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14289 lives in the same number space than `param_map'. Fixes #36154.
14291 2003-01-07 Miguel de Icaza <miguel@ximian.com>
14293 * cs-parser.jay (constructor_declaration): Set the
14294 Constructor.ModFlags before probing for it. This makes the
14295 compiler report 514, 515 and 132 (the code was there, but got
14298 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14299 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14300 (GotoCase.Resolve): Set `Returns' to ALWAYS.
14302 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14304 * enum.cs: create the enum static fields using the enum type.
14306 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14308 * class.cs: don't try to create the ParamBuilder for the return
14309 type if it's not needed (and handle it breaking for the ms runtime
14312 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14314 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14316 2002-12-29 Miguel de Icaza <miguel@ximian.com>
14318 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14319 the command. This showed up while compiling the JANET source
14320 code, which used \r as its only newline separator.
14322 2002-12-28 Miguel de Icaza <miguel@ximian.com>
14324 * class.cs (Method.Define): If we are an operator (because it
14325 reuses our code), then set the SpecialName and HideBySig. #36128
14327 2002-12-22 Miguel de Icaza <miguel@ximian.com>
14329 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14330 exception, report error 120 `object reference required'.
14332 * driver.cs: Add --pause option, used during to measure the size
14333 of the process as it goes with --timestamp.
14335 * expression.cs (Invocation.DoResolve): Do not allow methods with
14336 SpecialName to be invoked.
14338 2002-12-21 Miguel de Icaza <miguel@ximian.com>
14340 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14341 number before adding it.
14343 2002-12-21 Ravi Pratap <ravi@ximian.com>
14345 * ecore.cs (StandardImplicitConversion): When in an unsafe
14346 context, we allow conversion between void * to any other pointer
14347 type. This fixes bug #35973.
14349 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14351 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14352 is not thrown when extensionless outputs are used
14354 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14356 * rootcontext.cs: fixed compilation of corlib.
14358 2002-12-19 Miguel de Icaza <miguel@ximian.com>
14360 * attribute.cs (Attributes.Contains): Add new method.
14362 * class.cs (MethodCore.LabelParameters): if the parameter is an
14363 `out' parameter, check that no attribute `[In]' has been passed.
14365 * enum.cs: Handle the `value__' name in an enumeration.
14367 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
14369 * decl.cs: Added special case to allow overrides on "protected
14372 2002-12-18 Ravi Pratap <ravi@ximian.com>
14374 * attribute.cs (Attributes.AddAttributeSection): Rename to this
14375 since it makes much more sense.
14377 (Attributes.ctor): Don't require a Location parameter.
14379 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14381 * attribute.cs (ApplyAttributes): Remove extra Location parameters
14382 since we already have that information per attribute.
14384 * everywhere : make appropriate changes.
14386 * class.cs (LabelParameters): Write the code which actually
14387 applies attributes to the return type. We can't do this on the MS
14388 .NET runtime so we flag a warning in the case an exception is
14391 2002-12-18 Miguel de Icaza <miguel@ximian.com>
14393 * const.cs: Handle implicit null conversions here too.
14395 2002-12-17 Ravi Pratap <ravi@ximian.com>
14397 * class.cs (MethodCore.LabelParameters): Remove the extra
14398 Type [] parameter since it is completely unnecessary. Instead
14399 pass in the method's attributes so that we can extract
14400 the "return" attribute.
14402 2002-12-17 Miguel de Icaza <miguel@ximian.com>
14404 * cs-parser.jay (parse): Use Report.Error to flag errors instead
14405 of ignoring it and letting the compile continue.
14407 * typemanager.cs (ChangeType): use an extra argument to return an
14408 error condition instead of throwing an exception.
14410 2002-12-15 Miguel de Icaza <miguel@ximian.com>
14412 * expression.cs (Unary.TryReduce): mimic the code for the regular
14413 code path. Perform an implicit cast in the cases where we can
14414 implicitly convert to one of the integral types, and then reduce
14415 based on that constant. This fixes bug #35483.
14417 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14419 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14421 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14423 * namespace.cs: fixed bug #35489.
14425 2002-12-12 Miguel de Icaza <miguel@ximian.com>
14427 * class.cs: Remove some dead code.
14429 * cs-parser.jay: Estimate the number of methods needed
14430 (RootContext.MethodCount);
14432 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14433 numbers instead of StringBuilders.
14435 * support.cs (PtrHashtable): Add constructor with initial size;
14436 We can now reduce reallocations of the method table.
14438 2002-12-10 Ravi Pratap <ravi@ximian.com>
14440 * attribute.cs (ApplyAttributes): Keep track of the emitted
14441 attributes on a per-target basis. This fixes bug #35413.
14443 2002-12-10 Miguel de Icaza <miguel@ximian.com>
14445 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14446 default to the Windows 1252 encoding.
14448 (UnixParseOption): Support version, thanks to Alp for the missing
14451 * AssemblyInfo.cs: Add nice assembly information.
14453 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14456 * cs-parser.jay: Allow a trailing comma before the close bracked
14457 in the attribute_section production.
14459 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14460 address of the instance was being taken, I will take this out,
14461 because we take the address of the object immediately here.
14463 2002-12-09 Ravi Pratap <ravi@ximian.com>
14465 * typemanager.cs (AreMultipleAllowed): Take care of the most
14466 obvious case where attribute type is not in the current assembly -
14469 2002-12-08 Miguel de Icaza <miguel@ximian.com>
14471 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14472 definitions, instead of doing that afterwards.
14474 Also we use a nice little hack, depending on the constructor, we
14475 know if we are a "composed" name or a simple name. Hence, we
14476 avoid the IndexOf test, and we avoid
14478 * codegen.cs: Add code to assist in a bug reporter to track down
14479 the source of a compiler crash.
14481 2002-12-07 Ravi Pratap <ravi@ximian.com>
14483 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14484 types have been emitted for a given element and flag an error
14485 if something which does not have AllowMultiple set is used more
14488 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14489 attribute types and their corresponding AllowMultiple properties
14491 (AreMultipleAllowed): Check the property for a given type.
14493 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14494 property in the case we have a TypeContainer.
14496 (Attributes.AddAttribute): Detect duplicates and just skip on
14497 adding them. This trivial fix catches a pretty gross error in our
14498 attribute emission - global attributes were being emitted twice!
14500 Bugzilla bug #33187 is now fixed.
14502 2002-12-06 Miguel de Icaza <miguel@ximian.com>
14504 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14505 instead of pp_and).
14507 * expression.cs (Binary.ResolveOperator): I can only use the
14508 Concat (string, string, string) and Concat (string, string,
14509 string, string) if the child is actually a concatenation of
14512 2002-12-04 Miguel de Icaza <miguel@ximian.com>
14514 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14515 context where we need a 2-character lookahead.
14517 * pending.cs (PendingImplementation): Rework so we can keep track
14518 of interface types all the time, and flag those which were
14519 implemented by parents as optional.
14521 2002-12-03 Miguel de Icaza <miguel@ximian.com>
14523 * expression.cs (Binary.ResolveOperator): Use
14524 String.Concat(string,string,string) or
14525 String.Concat(string,string,string,string) when possible.
14527 * typemanager: More helper methods.
14530 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14532 * pending.cs: remove the bogus return from GetMissingInterfaces()
14533 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14535 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14537 * namespace.cs: avoid duplicated 'using xxx' being added to
14538 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14539 when we get more than one 'using' statement for the same namespace.
14540 Report a CS0105 warning for it.
14542 2002-11-30 Miguel de Icaza <miguel@ximian.com>
14544 * cs-tokenizer.cs (consume_identifier): use read directly, instead
14545 of calling getChar/putback, uses internal knowledge of it.
14547 (xtoken): Reorder tokenizer so most common patterns are checked
14548 first. This reduces the compilation time in another 5% (from 8.11s
14549 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14551 The parsing time is 22% of the compilation in mcs, and from that
14552 64% is spent on the tokenization process.
14554 I tried using a binary search for keywords, but this is slower
14555 than the hashtable. Another option would be to do a couple of
14558 * Not use a StringBuilder, instead use an array of chars,
14559 with a set value. Notice that this way we could catch
14560 the 645 error without having to do it *afterwards*.
14562 * We could write a hand-parser to avoid the hashtable
14563 compares altogether.
14565 The identifier consumption process takes 37% of the tokenization
14566 time. Another 15% is spent on is_number. 56% of the time spent
14567 on is_number is spent on Int64.Parse:
14569 * We could probably choose based on the string length to
14570 use Int32.Parse or Int64.Parse and avoid all the 64-bit
14573 Another 3% is spend on wrapping `xtoken' in the `token' function.
14575 Handle 0xa0 as whitespace (#34752)
14577 2002-11-26 Miguel de Icaza <miguel@ximian.com>
14579 * typemanager.cs (IsCLRType): New routine to tell whether a type
14580 is one of the builtin types.
14582 Maybe it needs to use TypeCodes to be faster. Maybe we could use
14583 typecode in more places instead of doing pointer comparissions.
14584 We could leverage some knowledge about the way the typecodes are
14587 New code to cache namespaces in assemblies, it is currently not
14588 invoked, to be used soon.
14590 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14592 * expression.cs (Binary.ResolveOperator): specially handle
14593 strings, and do not perform user-defined operator overloading for
14596 2002-11-24 Miguel de Icaza <miguel@ximian.com>
14598 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14599 internalcall as it is a pretty simple operation; Avoid whenever
14600 possible to call Char.IsLetter.
14602 (consume_identifier): Cut by half the number of
14603 hashtable calls by merging the is_keyword and GetKeyword behavior.
14605 Do not short-circuit, because if we do, we
14606 report errors (ie, #if false && true would produce an invalid
14610 2002-11-24 Martin Baulig <martin@ximian.com>
14612 * expression.cs (Cast.TryReduce): If we're in checked syntax,
14613 check constant ranges and report a CS0221. Fixes #33186.
14615 2002-11-24 Martin Baulig <martin@ximian.com>
14617 * cs-parser.jay: Make this work for uninitialized variable
14618 declarations in the `for' initializer. Fixes #32416.
14620 2002-11-24 Martin Baulig <martin@ximian.com>
14622 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14623 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
14625 2002-11-24 Martin Baulig <martin@ximian.com>
14627 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14628 argument; if true, we also check for user-defined conversions.
14629 This is only needed if both arguments are of a user-defined type.
14630 Fixes #30443, added test-175.cs.
14631 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14633 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14635 2002-11-24 Martin Baulig <martin@ximian.com>
14637 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14638 function to get the store opcode.
14639 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14640 only emit the Ldelema if the store opcode is Stobj. You must run
14641 both test-34 and test-167 to test this. Fixes #34529.
14643 2002-11-23 Martin Baulig <martin@ximian.com>
14645 * ecore.cs (Expression.MemberLookup): Added additional
14646 `qualifier_type' argument which is used when we're being called
14647 from MemberAccess.DoResolve() and null if we're called from a
14649 (Expression.MemberLookupFailed): New method to report errors; this
14650 does the CS1540 check and reports the correct error message.
14652 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14653 argument for the CS1540 check and redone the way how we're dealing
14654 with private members. See the comment in the source code for details.
14655 (FilterWithClosure): Reverted this back to revision 1.197; renamed
14656 `closure_start_type' to `closure_qualifier_type' and check whether
14657 it's not null. It was not this filter being broken, it was just
14658 being called with the wrong arguments.
14660 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14661 and pass it the correct `qualifier_type'; this also does the error
14664 2002-11-22 Miguel de Icaza <miguel@ximian.com>
14666 * expression.cs (Invocation.EmitParams): If the we are dealing
14667 with a non-built-in value type, load its address as well.
14669 (ArrayCreation): Use a a pretty constant instead
14670 of the hardcoded value 2. Use 6 instead of 2 for the number of
14671 static initializers.
14673 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14674 because they are not really value types, just glorified integers.
14676 * driver.cs: Do not append .exe, the CSC compiler does not do it.
14678 * ecore.cs: Remove redundant code for enumerations, make them use
14679 the same code path as everything else, fixes the casting issue
14680 with enumerations in Windows.Forms.
14682 * attribute.cs: Do only cast to string if it is a string, the
14683 validation happens later.
14685 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14686 people upgrade their corlibs.
14688 * ecore.cs: Oops, enumerations were not following the entire code path
14690 2002-11-21 Miguel de Icaza <miguel@ximian.com>
14692 * typemanager.cs (FilterWithClosure): Commented out the test for
14693 1540 in typemanager.cs, as it has problems when accessing
14694 protected methods from a parent class (see test-174.cs).
14696 * attribute.cs (Attribute.ValidateGuid): new method.
14697 (Attribute.Resolve): Use above.
14699 2002-11-19 Miguel de Icaza <miguel@ximian.com>
14701 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14703 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14704 handling for enumerations, as we only needed the TypeContainer
14705 functionality to begin with (this is required for the fix below to
14706 work for enums that reference constants in a container class for
14709 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14711 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14712 a valid TypeBuilder to perform lookups on.o
14714 * class.cs (InheritableMemberSignatureCompare): Use true in the
14715 call to GetGetMethod and GetSetMethod, because we are comparing
14716 the signature, and we need to get the methods *even* if they are
14719 (PropertyBase.CheckBase): ditto.
14721 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14722 GotoCase.Resolve): Use Peel on EmpytCasts.
14724 * ecore.cs (EmptyCast): drop child, add Peel method.
14726 2002-11-17 Martin Baulig <martin@ximian.com>
14728 * ecore.cs (EmptyCast.Child): New public property.
14730 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14731 label resolved to an EmptyCast. Fixes #34162.
14732 (GotoCase.Resolve): Likewise.
14733 (Block.EmitMeta): Likewise.
14735 2002-11-17 Martin Baulig <martin@ximian.com>
14737 * expression.cs (Invocation.BetterConversion): Prefer int over
14738 uint; short over ushort; long over ulong for integer literals.
14739 Use ImplicitConversionExists instead of StandardConversionExists
14740 since we also need to check for user-defined implicit conversions.
14741 Fixes #34165. Added test-173.cs.
14743 2002-11-16 Martin Baulig <martin@ximian.com>
14745 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14746 with the `true' and `false' literals. Fixes #33151.
14748 2002-11-16 Martin Baulig <martin@ximian.com>
14750 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14751 October 22nd; don't do the cs1540 check for static members.
14753 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14754 now using our own filter here and doing the cs1540 check again.
14756 2002-11-16 Martin Baulig <martin@ximian.com>
14758 * support.cs (InternalParameters): Don't crash if we don't have
14759 any fixed parameters. Fixes #33532.
14761 2002-11-16 Martin Baulig <martin@ximian.com>
14763 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14764 when looking up static methods to make this work on Windows.
14767 2002-11-16 Martin Baulig <martin@ximian.com>
14769 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14770 a setter rather than using PropertyInfo.CanWrite.
14772 2002-11-15 Nick Drochak <ndrochak@gol.com>
14774 * class.cs: Allow acces to block member by subclasses. Fixes build
14777 2002-11-14 Martin Baulig <martin@ximian.com>
14779 * class.cs (Constructor.Emit): Added the extern/block check.
14782 2002-11-14 Martin Baulig <martin@ximian.com>
14784 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14785 iteration while looking for indexers, this is needed because the
14786 indexer may have a different name in our base classes. Fixed the
14787 error reporting (no indexers at all, not get accessor, no
14788 overloaded match). Fixes bug #33089.
14789 (IndexerAccess.DoResolveLValue): Likewise.
14791 2002-11-14 Martin Baulig <martin@ximian.com>
14793 * class.cs (PropertyBase.CheckBase): Make this work for multiple
14794 indexers. Fixes the first part of bug #33089.
14795 (MethodSignature.InheritableMemberSignatureCompare): Added support
14798 2002-11-13 Ravi Pratap <ravi@ximian.com>
14800 * attribute.cs (Attribute.Resolve): Catch the
14801 NullReferenceException and report it since it isn't supposed to
14804 2002-11-12 Miguel de Icaza <miguel@ximian.com>
14806 * expression.cs (Binary.EmitBranchable): Also handle the cases for
14807 LogicalOr and LogicalAnd that can benefit from recursively
14808 handling EmitBranchable. The code now should be nice for Paolo.
14810 2002-11-08 Miguel de Icaza <miguel@ximian.com>
14812 * typemanager.cs (LookupType): Added a negative-hit hashtable for
14813 the Type lookups, as we perform quite a number of lookups on
14814 non-Types. This can be removed once we can deterministically tell
14815 whether we have a type or a namespace in advance.
14817 But this might require special hacks from our corlib.
14821 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14822 and double which avoids a conversion from an integer to a double.
14824 * expression.cs: tiny optimization, avoid calling IsConstant,
14825 because it effectively performs the lookup twice.
14827 2002-11-06 Miguel de Icaza <miguel@ximian.com>
14829 But a bogus return here to keep the semantics of the old code
14830 until the Mono runtime is fixed.
14832 * pending.cs (GetMissingInterfaces): New method used to remove all
14833 the interfaces that are already implemented by our parent
14834 classes from the list of pending methods.
14836 * interface.cs: Add checks for calls after ResolveTypeExpr.
14838 2002-11-05 Miguel de Icaza <miguel@ximian.com>
14840 * class.cs (Class.Emit): Report warning 67: event not used if the
14841 warning level is beyond 3.
14843 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14844 being a NullLiteral.
14846 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14849 * class.cs (TypeContainer.GetClassBases): Cover a missing code
14850 path that might fail if a type can not be resolved.
14852 * expression.cs (Binary.Emit): Emit unsigned versions of the
14855 * driver.cs: use error 5.
14857 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14859 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14861 2002-11-01 Miguel de Icaza <miguel@ximian.com>
14863 * cs-parser.jay (switch_section): A beautiful patch from Martin
14864 Baulig that fixed 33094.
14866 2002-10-31 Miguel de Icaza <miguel@ximian.com>
14868 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14869 Check whether the base is abstract and report an error if so.
14871 * expression.cs (IndexerAccess.DoResolveLValue,
14872 IndexerAccess.DoResolve): ditto.
14874 (Invocation.DoResolve): ditto.
14876 (Invocation.FullMethodDesc): Improve the report string.
14878 * statement.cs (Block): Eliminate IsVariableDefined as it is
14879 basically just a wrapper for GetVariableInfo.
14881 * ecore.cs (SimpleName): Use new
14883 * support.cs (ReflectionParamter.ParameterType): We unwrap the
14884 type, as we return the actual parameter ref/unref state on a
14887 2002-10-30 Miguel de Icaza <miguel@ximian.com>
14889 * support.cs: Return proper flags REF/OUT fixing the previous
14892 * expression.cs: Reverted last patch, that was wrong. Is_ref is
14893 not used to mean `ref' but `ref or out' in ParameterReference
14895 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14896 full type signature instead of calling TypeManger.CSharpName
14899 * support.cs (InternalParameters.ParameterDesc): Do not compare
14900 directly to the modflags, because REF/OUT will actually be bitsets
14903 * delegate.cs (VerifyMethod): Check also the modifiers.
14905 * cs-tokenizer.cs: Fix bug where floating point values with an
14906 exponent where a sign was missing was ignored.
14908 * driver.cs: Allow multiple assemblies to be specified in a single
14911 2002-10-28 Miguel de Icaza <miguel@ximian.com>
14913 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
14914 because identifiers after a parenthesis would end up in this kind
14915 of production, and we needed to desamiguate it for having casts
14918 (UserDefinedType *) xxx
14920 2002-10-24 Miguel de Icaza <miguel@ximian.com>
14922 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14923 we should set on the Bindingflags.NonPublic, but not turn on
14924 private_ok. private_ok controls whether a Private member is
14925 returned (this is chekced on the filter routine), while the
14926 BindingFlags.NonPublic just controls whether private/protected
14927 will be allowed. This fixes the problem part of the problem of
14928 private properties being allowed to be used in derived classes.
14930 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14931 so we can call the children DoResolveLValue method (this will
14932 properly signal errors on lvalue assignments to base properties)
14934 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14935 getter are null, and we have a property info, we know that this
14936 happened because the lookup failed, so we report an error 122 for
14937 protection level violation.
14939 We also silently return if setter and getter are null in the
14940 resolve functions, this condition only happens if we have flagged
14941 the error before. This is the other half of the problem.
14943 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14944 not have accessibility information, that is why we were returning
14945 true in the filter function in typemanager.cs.
14947 To properly report 122 (property is inaccessible because of its
14948 protection level) correctly, we report this error in ResolveAccess
14949 by failing if both the setter and the getter are lacking (ie, the
14952 DoResolve and DoLResolve have been modified to check for both
14953 setter/getter being null and returning silently, the reason being
14954 that I did not want to put the knowledge about this error in upper
14957 int old = Report.Errors;
14958 x = new PropertyExpr (...);
14959 if (old != Report.Errors)
14964 So the property expr is returned, but it is invalid, so the error
14965 will be flagged during the resolve process.
14967 * class.cs: Remove InheritablePropertySignatureCompare from the
14968 class, as we no longer depend on the property signature to compute
14969 whether it is possible to implement a method or not.
14971 The reason is that calling PropertyInfo.GetGetMethod will return
14972 null (in .NET, in Mono it works, and we should change this), in
14973 cases where the Get Method does not exist in that particular
14978 class X { public virtual int A { get { return 1; } } }
14980 class Z : Y { public override int A { get { return 2; } } }
14982 Would fail in Z because the parent (Y) would not have the property
14983 defined. So we avoid this completely now (because the alternative
14984 fix was ugly and slow), and we now depend exclusively on the
14987 (PropertyBase.CheckBase): Use a method-base mechanism to find our
14988 reference method, instead of using the property.
14990 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14991 routines are gone now.
14993 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14994 names, they were incorrectly named.
14996 * cs-tokenizer.cs: Return are more gentle token on failure.
14998 * pending.cs (PendingImplementation.InterfaceMethod): This routine
14999 had an out-of-sync index variable, which caused it to remove from
15000 the list of pending methods the wrong method sometimes.
15002 2002-10-22 Miguel de Icaza <miguel@ximian.com>
15004 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15005 CanWrite, because those refer to this particular instance of the
15006 property, and do not take into account the fact that we can
15007 override single members of a property.
15009 Constructor requires an EmitContext. The resolution process does
15010 not happen here, but we need to compute the accessors before,
15011 because the resolution does not always happen for properties.
15013 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15014 subclass, before we did not update this flag, but we did update
15017 (GetAccessors): Drop this routine, as it did not work in the
15018 presence of partially overwritten set/get methods.
15020 Notice that this broke the cs1540 detection, but that will require
15023 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15027 * driver.cs: issue a warning instead of an error if we don't support
15028 debugging for the platform. Also ignore a couple of errors that may
15029 arise when trying to write the symbols. Undo my previous patch.
15031 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15033 * driver.cs: ignore /debug switch except for Unix platforms.
15035 2002-10-23 Nick Drochak <ndrochak@gol.com>
15037 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15039 2002-10-21 Miguel de Icaza <miguel@ximian.com>
15041 * driver.cs: Do not make mcs-debug conditional, so we do not break
15042 builds that use it.
15044 * statement.cs (UsageVector.MergeChildren): I would like Martin to
15045 review this patch. But basically after all the children variables
15046 have been merged, the value of "Breaks" was not being set to
15047 new_breaks for Switch blocks. I think that it should be set after
15048 it has executed. Currently I set this to the value of new_breaks,
15049 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15050 conservative, but I do not understand this code very well.
15052 I did not break anything in the build, so that is good ;-)
15054 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15056 2002-10-20 Mark Crichton <crichton@gimp.org>
15058 * cfold.cs: Fixed compile blocker. Really fixed it this time.
15060 2002-10-20 Nick Drochak <ndrochak@gol.com>
15062 * cfold.cs: Fixed compile blocker.
15064 2002-10-20 Miguel de Icaza <miguel@ximian.com>
15066 * driver.cs: I was chekcing the key, not the file.
15068 2002-10-19 Ravi Pratap <ravi@ximian.com>
15070 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15071 message that we were generating - we just need to silently return
15074 2002-10-19 Miguel de Icaza <miguel@ximian.com>
15076 * class.cs (Event.Define): Change my previous commit, as this
15077 breaks the debugger. This is a temporary hack, as it seems like
15078 the compiler is generating events incorrectly to begin with.
15080 * expression.cs (Binary.ResolveOperator): Added support for
15081 "U operator - (E x, E y)"
15083 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15086 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15087 init-only variables, but this path did not take into account that
15088 there might be also instance readonly variables. Correct this
15091 This fixes bug 32253
15093 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15096 * driver.cs: Change the extension for modules to `netmodule'
15098 * cs-parser.jay: Improved slightly the location tracking for
15099 the debugger symbols.
15101 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15102 modifiers that were specified instead of the hardcoded value
15103 (FamAndAssem). This was basically ignoring the static modifier,
15104 and others. Fixes 32429.
15106 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15107 fixed a bug in the process (32476)
15109 * expression.cs (ArrayAccess.EmitAssign): Patch from
15110 hwang_rob@yahoo.ca that fixes bug 31834.3
15112 2002-10-18 Miguel de Icaza <miguel@ximian.com>
15114 * driver.cs: Make the module extension .netmodule.
15116 2002-10-16 Miguel de Icaza <miguel@ximian.com>
15118 * driver.cs: Report an error if the resource file is not found
15119 instead of crashing.
15121 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15122 false, like Emit does.
15124 2002-10-16 Nick Drochak <ndrochak@gol.com>
15126 * typemanager.cs: Remove unused private member. Also reported mcs
15127 bug to report this as a warning like csc.
15129 2002-10-15 Martin Baulig <martin@gnome.org>
15131 * statement.cs (Statement.Emit): Made this a virtual method; emits
15132 the line number info and calls DoEmit().
15133 (Statement.DoEmit): New protected abstract method, formerly knows
15134 as Statement.Emit().
15136 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15138 2002-10-11 Miguel de Icaza <miguel@ximian.com>
15140 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15141 have fixed a remaining problem: not every AddXXXX was adding a
15142 fully qualified name.
15144 Now everyone registers a fully qualified name in the DeclSpace as
15145 being defined instead of the partial name.
15147 Downsides: we are slower than we need to be due to the excess
15148 copies and the names being registered this way.
15150 The reason for this is that we currently depend (on the corlib
15151 bootstrap for instance) that types are fully qualified, because
15152 we dump all the types in the namespace, and we should really have
15153 types inserted into the proper namespace, so we can only store the
15154 basenames in the defined_names array.
15156 2002-10-10 Martin Baulig <martin@gnome.org>
15158 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15159 from bug #31834, see the bug report for a testcase which is
15162 2002-10-10 Martin Baulig <martin@gnome.org>
15164 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15165 flow analysis code for this.
15167 * statement.cs (Do, While, For): Tell the flow analysis code about
15169 (FlowBranching.UsageVector): Added support for infinite loops.
15170 (Block.Resolve): Moved the dead code elimination here and use flow
15173 2002-10-09 Miguel de Icaza <miguel@ximian.com>
15175 * class.cs (Field.Define): Catch cycles on struct type
15178 * typemanager.cs (IsUnmanagedtype): Do not recursively check
15179 fields if the fields are static. We only need to check instance
15182 * expression.cs (As.DoResolve): Test for reference type.
15184 * statement.cs (Using.ResolveExpression): Use
15185 ConvertImplicitRequired, not ConvertImplicit which reports an
15187 (Using.ResolveLocalVariableDecls): ditto.
15189 * expression.cs (Binary.ResolveOperator): Report errors in a few
15190 places where we had to.
15192 * typemanager.cs (IsUnmanagedtype): Finish implementation.
15194 2002-10-08 Miguel de Icaza <miguel@ximian.com>
15196 * expression.cs: Use StoreFromPtr instead of extracting the type
15197 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
15199 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15200 an enumeration value to a System.Enum, but System.Enum is not a
15201 value type, but an class type, so we need to box.
15203 (Expression.ConvertExplicit): One codepath could return
15204 errors but not flag them. Fix this. Fixes #31853
15206 * parameter.cs (Resolve): Do not allow void as a parameter type.
15208 2002-10-06 Martin Baulig <martin@gnome.org>
15210 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15211 if it's a class type and not a struct. Fixes #31815.
15213 2002-10-06 Martin Baulig <martin@gnome.org>
15215 * statement.cs: Reworked the flow analysis code a bit to make it
15216 usable for dead code elimination.
15218 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15220 * cs-parser.jay: allow empty source files. Fixes bug #31781.
15222 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15224 * expression.cs (ComposedCast.DoResolveType): A quick workaround
15225 to fix the test 165, will investigate deeper.
15227 2002-10-04 Martin Baulig <martin@gnome.org>
15229 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15230 finally blocks actually work.
15231 (Try.Resolve): We don't need to create a sibling for `finally' if
15232 there is no finally block.
15234 2002-10-04 Martin Baulig <martin@gnome.org>
15236 * class.cs (Constructor.Define): The default accessibility for a
15237 non-default constructor is private, not public.
15239 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15241 * class.cs (Constructor): Make AllowedModifiers public, add
15244 * cs-parser.jay: Perform the modifiers test here, as the
15245 constructor for the Constructor class usually receives a zero
15246 because of the way we create it (first we create, later we
15247 customize, and we were never checking the modifiers).
15249 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15250 is a version of LookupTypeReflection that includes the type-name
15251 cache. This can be used as a fast path for functions that know
15252 the fully qualified name and are only calling into *.GetType() to
15253 obtain a composed type.
15255 This is also used by TypeManager.LookupType during its type
15258 (LookupType): We now also track the real type name, as sometimes
15259 we can get a quey for the real type name from things like
15260 ComposedCast. This fixes bug 31422.
15262 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15263 complete type fullname, it does not have to go through the type
15264 resolution system to obtain the composed version of the type (for
15265 obtaining arrays or pointers).
15267 (Conditional.Emit): Use the EmitBoolExpression to
15268 generate nicer code, as requested by Paolo.
15270 (ArrayCreation.CheckIndices): Use the patch from
15271 hwang_rob@yahoo.ca to validate the array initializers.
15273 2002-10-03 Miguel de Icaza <miguel@ximian.com>
15275 * class.cs (ConstructorInitializer.Emit): simplify code by using
15276 Invocation.EmitCall, and at the same time, fix the bugs in calling
15277 parent constructors that took variable arguments.
15279 * ecore.cs (Expression.ConvertNumericExplicit,
15280 Expression.ImplicitNumericConversion): Remove the code that
15281 manually wrapped decimal (InternalTypeConstructor call is now gone
15284 * expression.cs (Cast.TryReduce): Also handle decimal types when
15285 trying to perform a constant fold on the type.
15287 * typemanager.cs (IsUnmanagedtype): Partially implemented.
15289 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15290 that only turned off an error report, and did nothing else.
15292 2002-10-02 Miguel de Icaza <miguel@ximian.com>
15294 * driver.cs: Handle and ignore /fullpaths
15296 2002-10-01 Miguel de Icaza <miguel@ximian.com>
15298 * expression.cs (Binary.ResolveOperator): Catch the case where
15299 DoNumericPromotions returns true,
15301 (Binary.DoNumericPromotions): Simplify the code, and the tests.
15303 2002-09-27 Miguel de Icaza <miguel@ximian.com>
15305 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15308 2002-09-26 Miguel de Icaza <miguel@ximian.com>
15310 * ecore.cs (ConvertNumericExplicit): It is not enough that the
15311 conversion exists, but it is also required that the conversion be
15312 performed. This manifested in "(Type64Enum) 2".
15314 * class.cs (TypeManager.AddMethod): The fix is not to change
15315 AddEnum, because that one was using a fully qualified name (every
15316 DeclSpace derivative does), but to change the AddMethod routine
15317 that was using an un-namespaced name. This now correctly reports
15318 the duplicated name.
15320 Revert patch until I can properly fix it. The issue
15321 is that we have a shared Type space across all namespaces
15322 currently, which is wrong.
15324 Options include making the Namespace a DeclSpace, and merge
15325 current_namespace/current_container in the parser.
15327 2002-09-25 Miguel de Icaza <miguel@ximian.com>
15329 * cs-parser.jay: Improve error reporting when we get a different
15330 kind of expression in local_variable_type and
15331 local_variable_pointer_type.
15333 Propagate this to avoid missleading errors being reported.
15335 * ecore.cs (ImplicitReferenceConversion): treat
15336 TypeManager.value_type as a target just like object_type. As
15341 Is valid, and needs to result in the int 1 being boxed before it
15342 is assigned to the value type v.
15344 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15345 to validate the enumeration name.
15347 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15348 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
15349 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15351 * ecore.cs (TryImplicitIntConversion): When doing an
15352 implicit-enumeration-conversion, check if the type is 64-bits and
15353 perform a conversion before passing to EnumConstant.
15355 2002-09-23 Miguel de Icaza <miguel@ximian.com>
15357 * decl.cs (Error_AmbiguousTypeReference); New routine used to
15358 report ambiguous type references. Unlike the MS version, we
15359 report what the ambiguity is. Innovation at work ;-)
15361 (DeclSpace.FindType): Require a location argument to
15362 display when we display an ambiguous error.
15364 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15366 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15368 * expression.cs (EmitDynamicInitializers): Apply patch from
15369 hwang_rob@yahoo.ca that fixes the order in which we emit our
15372 2002-09-21 Martin Baulig <martin@gnome.org>
15374 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15375 delegate takes no arguments.
15377 2002-09-20 Miguel de Icaza <miguel@ximian.com>
15379 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15382 * expression.cs: Extract the underlying type.
15384 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15386 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15388 2002-09-19 Miguel de Icaza <miguel@ximian.com>
15390 * class.cs (TypeContainer.DefineType): We can not use the nice
15391 PackingSize with the size set to 1 DefineType method, because it
15392 will not allow us to define the interfaces that the struct
15395 This completes the fixing of bug 27287
15397 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15398 means also structs. This fixes part of the problem.
15399 (Expresion.ImplicitReferenceConversionExists): ditto.
15401 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15402 error if there were no errors reported during the type lookup
15403 process, to avoid duplicates or redundant errors. Without this
15404 you would get an ambiguous errors plus a type not found. We have
15405 beaten the user enough with the first error.
15407 (DeclSparce.FindType): Emit a warning if we have an ambiguous
15410 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15411 during the resolution process, stop the lookup, this avoids
15412 repeated error reports (same error twice).
15414 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15416 * typemanager.cs (LookupType): Redo the type lookup code to match
15417 the needs of System.Reflection.
15419 The issue is that System.Reflection requires references to nested
15420 types to begin with a "+" sign instead of a dot. So toplevel
15421 types look like: "NameSpace.TopLevelClass", and nested ones look
15422 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15425 2002-09-19 Martin Baulig <martin@gnome.org>
15427 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15428 says that a method always returns or always throws an exception,
15429 don't report the CS0161.
15431 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15432 set `Returns = new_returns'.
15434 2002-09-19 Martin Baulig <martin@gnome.org>
15436 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15437 to an enum constant, check for a CS0176.
15439 2002-09-18 Miguel de Icaza <miguel@ximian.com>
15441 * class.cs (TypeContainer.CheckPairedOperators): Now we check
15442 for operators that must be in pairs and report errors.
15444 * ecore.cs (SimpleName.DoResolveType): During the initial type
15445 resolution process, when we define types recursively, we must
15446 check first for types in our current scope before we perform
15447 lookups in the enclosing scopes.
15449 * expression.cs (MakeByteBlob): Handle Decimal blobs.
15451 (Invocation.VerifyArgumentsCompat): Call
15452 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15453 I thought we were supposed to always call this, but there are a
15454 few places in the code where we dont do it.
15456 2002-09-17 Miguel de Icaza <miguel@ximian.com>
15458 * driver.cs: Add support in -linkres and -resource to specify the
15459 name of the identifier.
15461 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15463 * ecore.cs (StandardConversionExists): Sync with the conversion
15464 code: allow anything-* to void* conversions.
15466 (FindMostSpecificSource): Use an Expression argument
15467 instead of a Type, because we might be handed over a Literal which
15468 gets a few more implicit conversions that plain types do not. So
15469 this information was being lost.
15471 Also, we drop the temporary type-holder expression when not
15474 2002-09-17 Martin Baulig <martin@gnome.org>
15476 * class.cs (PropertyBase.CheckBase): Don't check the base class if
15477 this is an explicit interface implementation.
15479 2002-09-17 Martin Baulig <martin@gnome.org>
15481 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15482 different `IndexerName' attributes.
15484 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15485 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15486 virtual CommonResolve().
15488 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15490 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15491 and convert that to the UnderlyingType.
15493 * statement.cs (Foreach.Resolve): Indexers are just like variables
15494 or PropertyAccesses.
15496 * cs-tokenizer.cs (consume_string): Track line numbers and columns
15497 inside quoted strings, we were not doing this before.
15499 2002-09-16 Martin Baulig <martin@gnome.org>
15501 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15502 resolve it. This is needed for the definite assignment check of the
15503 instance expression, fixes bug #29846.
15504 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15506 2002-09-16 Nick Drochak <ndrochak@gol.com>
15508 * parameter.cs: Fix compile error. Cannot reference static member
15509 from an instance object. Is this an mcs bug?
15511 2002-09-14 Martin Baulig <martin@gnome.org>
15513 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15514 multiple times. Fixes bug #30295, added test-166.cs.
15516 2002-09-14 Martin Baulig <martin@gnome.org>
15518 * statement.cs (Block.Emit): Don't emit unreachable code.
15519 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15520 `break' statements.
15521 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15523 2002-09-14 Martin Baulig <martin@gnome.org>
15525 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15528 2002-09-14 Martin Baulig <martin@gnome.org>
15530 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15531 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15532 be false on the ms runtime.
15534 2002-09-13 Martin Baulig <martin@gnome.org>
15536 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15537 the CS0038 error message.
15539 2002-09-12 Miguel de Icaza <miguel@ximian.com>
15541 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15542 constant inside, return it.
15544 2002-09-12 Martin Baulig <martin@gnome.org>
15546 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15547 implicit conversion can be done between enum types.
15549 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15550 check whether an implicit conversion to the current enum's UnderlyingType
15551 exists and report an error if not.
15553 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15554 without debugging support.
15556 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15557 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
15559 2002-09-12 Martin Baulig <martin@gnome.org>
15561 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15563 * ecore.cs (IMemberExpr.DeclaringType): New property.
15564 (SimpleName.SimpleNameResolve): Check whether we're accessing a
15565 nonstatic member of an outer type (CS0038).
15567 2002-09-11 Miguel de Icaza <miguel@ximian.com>
15569 * driver.cs: Activate the using-error detector at warning level
15570 4 (at least for MS-compatible APIs).
15572 * namespace.cs (VerifyUsing): Small buglett fix.
15574 * pending.cs (PendingImplementation): pass the container pointer.
15576 * interface.cs (GetMethods): Allow for recursive definition. Long
15577 term, I would like to move every type to support recursive
15578 definitions, not the current ordering mechanism that we have right
15581 The situation is this: Attributes are handled before interfaces,
15582 so we can apply attributes to interfaces. But some attributes
15583 implement interfaces, we will now handle the simple cases
15584 (recursive definitions will just get an error).
15586 * parameter.cs: Only invalidate types at the end if we fail to
15589 2002-09-09 Martin Baulig <martin@gnome.org>
15591 * ecore.cs (PropertyExpr.Emit): Also check for
15592 TypeManager.system_int_array_get_length so this'll also work when
15593 compiling corlib. Fixes #30003.
15595 2002-09-09 Martin Baulig <martin@gnome.org>
15597 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15598 and throw an exception if we can't get the type's size. Fixed #30040,
15601 2002-09-09 Martin Baulig <martin@gnome.org>
15603 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15605 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15606 context. Fixes bug #30027.
15608 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15609 virtual functions. Fixes bug #30043, added test-164.cs.
15611 2002-09-08 Ravi Pratap <ravi@ximian.com>
15613 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15615 2002-09-08 Nick Drochak <ndrochak@gol.com>
15617 * driver.cs: Use an object to get the windows codepage since it's not a
15620 2002-09-08 Miguel de Icaza <miguel@ximian.com>
15622 * statement.cs (For.Emit): for infinite loops (test == null)
15623 return whether there is a break inside, not always "true".
15625 * namespace.cs (UsingEntry): New struct to hold the name of the
15626 using definition, the location where it is defined, and whether it
15627 has been used in a successful type lookup.
15629 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15634 2002-09-06 Ravi Pratap <ravi@ximian.com>
15636 * attribute.cs : Fix incorrect code which relied on catching
15637 a NullReferenceException to detect a null being passed in
15638 where an object was expected.
15640 2002-09-06 Miguel de Icaza <miguel@ximian.com>
15642 * statement.cs (Try): flag the catch variable as assigned
15644 * expression.cs (Cast): Simplified by using ResolveType instead of
15645 manually resolving.
15647 * statement.cs (Catch): Fix bug by using ResolveType.
15649 2002-09-06 Ravi Pratap <ravi@ximian.com>
15651 * expression.cs (BetterConversion): Special case for when we have
15652 a NullLiteral as the argument and we have to choose between string
15653 and object types - we choose string the way csc does.
15655 * attribute.cs (Attribute.Resolve): Catch the
15656 NullReferenceException and report error #182 since the Mono
15657 runtime no more has the bug and having this exception raised means
15658 we tried to select a constructor which takes an object and is
15661 2002-09-05 Ravi Pratap <ravi@ximian.com>
15663 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15664 message (1502, 1503) when we can't locate a method after overload
15665 resolution. This is much more informative and closes the bug
15668 * interface.cs (PopulateMethod): Return if there are no argument
15669 types. Fixes a NullReferenceException bug.
15671 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15672 expressions too. Previously we were checking only in one place for
15673 positional arguments leaving out named arguments.
15675 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15676 type to the enum type is not allowed. Remove code corresponding to
15679 (ConvertNumericExplicit): Allow explicit conversions from
15680 the underlying type to enum type. This precisely follows the spec
15681 and closes a bug filed by Gonzalo.
15683 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15686 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15688 2002-09-03 Miguel de Icaza <miguel@ximian.com>
15690 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15691 it was important that we stored the right value after the
15692 reduction in `converted'.
15694 2002-09-04 Martin Baulig <martin@gnome.org>
15696 * location.cs (Location.SymbolDocument): Use full pathnames for the
15699 2002-08-30 Miguel de Icaza <miguel@ximian.com>
15701 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15702 of the expression resolve mechanism, because that will catch the
15703 SimpleName error failures.
15705 (Conditional): If we can not resolve the
15706 expression, return, do not crash.
15708 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15711 (location): display token name instead of its number.
15713 2002-08-28 Martin Baulig <martin@gnome.org>
15715 * expression.cs (Binary.ResolveOperator): Don't silently return
15716 but return an error if an operator cannot be applied between two
15719 2002-08-28 Martin Baulig <martin@gnome.org>
15721 * class.cs (Constructor.Define): Set the permission attributes
15722 correctly instead of making all constructors public.
15724 2002-08-28 Martin Baulig <martin@gnome.org>
15726 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15727 for private members before reporting a CS0103; if we find anything,
15730 2002-08-28 Martin Baulig <martin@gnome.org>
15732 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15733 to check whether `closure_start_type == closure_invocation_type',
15734 we also need to check whether `m.DeclaringType == closure_invocation_type'
15735 before bypassing the permission checks. We might be accessing
15736 protected/private members from the base class.
15737 (TypeManager.RealMemberLookup): Only set private_ok if private
15738 members were requested via BindingFlags.NonPublic.
15740 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15742 * expression.cs (MemberAccess.ResolveMemberAccess): Set
15743 MethodGroupExpr.IsExplicitImpl if appropriate.
15744 (Invocation.DoResolve): Don't report the CS0120 for explicit
15745 interface implementations.
15747 2002-08-27 Martin Baulig <martin@gnome.org>
15749 * expression.cs (Invocation.DoResolve): If this is a static
15750 method and we don't have an InstanceExpression, we must report
15753 2002-08-25 Martin Baulig <martin@gnome.org>
15755 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15756 `==' between a valuetype and an object.
15758 2002-08-25 Miguel de Icaza <miguel@ximian.com>
15760 * ecore.cs (TypeExpr): Provide a ToString method.
15762 2002-08-24 Martin Baulig <martin@gnome.org>
15764 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15765 now called proggie.dbg and it's a binary file.
15767 2002-08-23 Martin Baulig <martin@gnome.org>
15769 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15771 2002-08-23 Martin Baulig <martin@gnome.org>
15773 * struct.cs (MyStructInfo.ctor): Make this work with empty
15774 structs; it's not allowed to use foreach() on null.
15776 2002-08-23 Martin Baulig <martin@gnome.org>
15778 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15779 writer the full pathname of the generated assembly.
15781 2002-08-23 Martin Baulig <martin@gnome.org>
15783 * statements.cs (FlowBranching.UsageVector.MergeChildren):
15784 A `finally' block never returns or breaks; improved handling of
15787 2002-08-23 Martin Baulig <martin@gnome.org>
15789 * statement.cs (Throw.Resolve): Allow `throw null'.
15791 2002-08-23 Martin Baulig <martin@gnome.org>
15793 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15794 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15795 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
15796 MemberLookup would return a wrong event if this is an explicit
15797 interface implementation and the class has an event with the same
15800 2002-08-23 Martin Baulig <martin@gnome.org>
15802 * statement.cs (Block.AddChildVariableNames): New public method.
15803 (Block.AddChildVariableName): Likewise.
15804 (Block.IsVariableNameUsedInChildBlock): Likewise.
15805 (Block.AddVariable): Check whether a variable name has already
15806 been used in a child block.
15808 * cs-parser.jay (declare_local_variables): Mark all variable names
15809 from the current block as being used in a child block in the
15812 2002-08-23 Martin Baulig <martin@gnome.org>
15814 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15815 find the symbol writer.
15817 * driver.cs: csc also allows the arguments to /define being
15818 separated by commas, not only by semicolons.
15820 2002-08-23 Martin Baulig <martin@gnome.org>
15822 * interface.cs (Interface.GetMembers): Added static check for events.
15824 2002-08-15 Martin Baulig <martin@gnome.org>
15826 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15827 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15829 * ecore.cs (Expression.MemberLookup): Added documentation and explained
15830 why the MethodData.EmitDestructor() change was necessary.
15832 2002-08-20 Martin Baulig <martin@gnome.org>
15834 * class.cs (TypeContainer.FindMembers): Added static check for events.
15836 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15838 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15839 use Type.GetEvents(), not Type.FindMembers().
15841 2002-08-20 Martin Baulig <martin@gnome.org>
15843 * decl.cs (MemberCache): Added a special method cache which will
15844 be used for method-only searched. This ensures that a method
15845 search will return a MethodInfo with the correct ReflectedType for
15848 2002-08-20 Martin Baulig <martin@gnome.org>
15850 * decl.cs (DeclSpace.FindMembers): Made this public.
15852 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15854 * delegate.cs: fixed build on windows.
15855 [FIXME: Filed as bug #29150: MCS must report these errors.]
15857 2002-08-19 Ravi Pratap <ravi@ximian.com>
15859 * ecore.cs (StandardConversionExists): Return a false
15860 if we are trying to convert the void type to anything else
15861 since that is not allowed.
15863 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15864 we flag error 70 in the event an event is trying to be accessed
15865 directly from outside the declaring type.
15867 2002-08-20 Martin Baulig <martin@gnome.org>
15869 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15870 MemberCache from typemanager.cs to decl.cs.
15872 2002-08-19 Martin Baulig <martin@gnome.org>
15874 * class.cs (TypeContainer): Implement IMemberContainer.
15875 (TypeContainer.DefineMembers): Create the MemberCache.
15876 (TypeContainer.FindMembers): Do better BindingFlags checking; only
15877 return public members if BindingFlags.Public was given, check
15878 whether members are static.
15880 2002-08-16 Martin Baulig <martin@gnome.org>
15882 * decl.cs (DeclSpace.Define): Splitted this in Define and
15883 DefineMembers. DefineMembers is called first and initializes the
15886 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
15887 DefineMembers() on all our DeclSpaces.
15889 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15890 but call DefineMembers() on all nested interfaces. We call their
15891 Define() in our new Define() function.
15893 * interface.cs (Interface): Implement IMemberContainer.
15894 (Interface.Define): Moved all code except the attribute stuf to
15896 (Interface.DefineMembers): Initialize the member cache.
15898 * typemanager.cs (IMemberFinder): Removed this interface, we don't
15899 need this anymore since we can use MemberCache.FindMembers directly.
15901 2002-08-19 Martin Baulig <martin@gnome.org>
15903 * typemanager.cs (MemberCache): When creating the cache for an
15904 interface type, add all inherited members.
15905 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15906 to `out bool used_cache' and documented it.
15907 (TypeManager.MemberLookup): If we already used the cache in the first
15908 iteration, we don't need to do the interfaces check.
15910 2002-08-19 Martin Baulig <martin@gnome.org>
15912 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
15913 here from IMemberFinder and don't implement this interface anymore.
15914 (DeclSpace.MemberCache): Moved here from IMemberFinder.
15916 * typemanager.cs (IMemberFinder): This interface is now only used by
15917 classes which actually support the member cache.
15918 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15919 since we only put DeclSpaces into this Hashtable.
15920 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15921 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15923 2002-08-16 Martin Baulig <martin@gnome.org>
15925 * typemanager.cs (ICachingMemberFinder): Removed.
15926 (IMemberFinder.MemberCache): New property.
15927 (TypeManager.FindMembers): Merged this with RealFindMembers().
15928 This function will never be called from TypeManager.MemberLookup()
15929 so we can't use the cache here, just the IMemberFinder.
15930 (TypeManager.MemberLookup_FindMembers): Check whether the
15931 IMemberFinder has a MemberCache and call the cache's FindMembers
15933 (MemberCache): Rewrote larger parts of this yet another time and
15934 cleaned it up a bit.
15936 2002-08-15 Miguel de Icaza <miguel@ximian.com>
15938 * driver.cs (LoadArgs): Support quoting.
15940 (Usage): Show the CSC-like command line arguments.
15942 Improved a few error messages.
15944 2002-08-15 Martin Baulig <martin@gnome.org>
15946 * typemanager.cs (IMemberContainer.Type): New property.
15947 (IMemberContainer.IsInterface): New property.
15949 The following changes are conditional to BROKEN_RUNTIME, which is
15950 defined at the top of the file.
15952 * typemanager.cs (MemberCache.MemberCache): Don't add the base
15953 class'es members, but add all members from TypeHandle.ObjectType
15954 if we're an interface.
15955 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15956 is the current type.
15957 (MemberCache.CacheEntry.Container): Removed this field.
15958 (TypeHandle.GetMembers): Include inherited members.
15960 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15962 * typemanager.cs: fixed compilation and added a comment on a field that
15965 2002-08-15 Martin Baulig <martin@gnome.org>
15967 * class.cs (ConstructorInitializer.Resolve): In the
15968 Expression.MemberLookup call, use the queried_type as
15971 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15972 declared' attribute, it's always true.
15973 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15974 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15975 temporary wrapper for FindMembers which tells MemberLookup whether
15976 members from the base classes are included in the return value.
15977 This will go away soon.
15978 (TypeManager.MemberLookup): Use this temporary hack here; once the
15979 new MemberCache is completed, we don't need to do the DeclaredOnly
15980 looping here anymore since the MemberCache will take care of this.
15981 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15982 (MemberCache): When creating the MemberCache for a class, get
15983 members from the current class and all its base classes.
15984 (MemberCache.CacheEntry.Container): New field. This is a
15985 temporary hack until the Mono runtime is fixed to distinguish
15986 between ReflectedType and DeclaringType. It allows us to use MCS
15987 with both the MS runtime and the unfixed Mono runtime without
15988 problems and without accecting performance.
15989 (MemberCache.SearchMembers): The DeclaredOnly looping from
15990 TypeManager.MemberLookup is now done here.
15992 2002-08-14 Martin Baulig <martin@gnome.org>
15994 * statement.cs (MyStructInfo.MyStructInfo): Don't call
15995 Type.GetFields on dynamic types but get the fields from the
15996 corresponding TypeContainer.
15997 (MyStructInfo.GetStructInfo): Added check for enum types.
15999 * typemanager.cs (MemberList.IsSynchronized): Implemented.
16000 (MemberList.SyncRoot): Implemented.
16001 (TypeManager.FilterWithClosure): No need to check permissions if
16002 closure_start_type == closure_invocation_type, don't crash if
16003 closure_invocation_type is null.
16005 2002-08-13 Martin Baulig <martin@gnome.org>
16007 Rewrote TypeContainer.FindMembers to use a member cache. This
16008 gives us a speed increase of about 35% for the self-hosting MCS
16009 build and of about 15-20% for the class libs (both on GNU/Linux).
16011 * report.cs (Timer): New class to get enhanced profiling. This
16012 whole class is "TIMER" conditional since it remarkably slows down
16015 * class.cs (MemberList): New class. This is an IList wrapper
16016 which we're now using instead of passing MemberInfo[]'s around to
16017 avoid copying this array unnecessarily.
16018 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16019 (ICachingMemberFinder, IMemberContainer): New interface.
16020 (TypeManager.FilterWithClosure): If `criteria' is null, the name
16021 has already been checked, otherwise use it for the name comparision.
16022 (TypeManager.FindMembers): Renamed to RealMemberFinder and
16023 provided wrapper which tries to use ICachingMemberFinder.FindMembers
16024 if possible. Returns a MemberList, not a MemberInfo [].
16025 (TypeHandle): New class, implements IMemberContainer. We create
16026 one instance of this class per type, it contains a MemberCache
16027 which is used to do the member lookups.
16028 (MemberCache): New class. Each instance of this class contains
16029 all members of a type and a name-based hash table.
16030 (MemberCache.FindMembers): This is our new member lookup
16031 function. First, it looks up all members of the requested name in
16032 the hash table. Then, it walks this list and sorts out all
16033 applicable members and returns them.
16035 2002-08-13 Martin Baulig <martin@gnome.org>
16037 In addition to a nice code cleanup, this gives us a performance
16038 increase of about 1.4% on GNU/Linux - not much, but it's already
16039 half a second for the self-hosting MCS compilation.
16041 * typemanager.cs (IMemberFinder): New interface. It is used by
16042 TypeManager.FindMembers to call FindMembers on a TypeContainer,
16043 Enum, Delegate or Interface.
16044 (TypeManager.finder_to_member_finder): New PtrHashtable.
16045 (TypeManager.finder_to_container): Removed.
16046 (TypeManager.finder_to_delegate): Removed.
16047 (TypeManager.finder_to_interface): Removed.
16048 (TypeManager.finder_to_enum): Removed.
16050 * interface.cs (Interface): Implement IMemberFinder.
16052 * delegate.cs (Delegate): Implement IMemberFinder.
16054 * enum.cs (Enum): Implement IMemberFinder.
16056 * class.cs (TypeContainer): Implement IMemberFinder.
16058 2002-08-12 Martin Baulig <martin@gnome.org>
16060 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16062 2002-08-12 Martin Baulig <martin@gnome.org>
16064 * ecore.cs (ITypeExpression): New interface for expressions which
16066 (TypeExpression): Renamed to TypeLookupExpression.
16067 (Expression.DoResolve): If we're doing a types-only lookup, the
16068 expression must implement the ITypeExpression interface and we
16069 call DoResolveType() on it.
16070 (SimpleName): Implement the new ITypeExpression interface.
16071 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16072 hack, the situation that we're only looking up types can't happen
16073 anymore when this method is called. Moved the type lookup code to
16074 DoResolveType() and call it.
16075 (SimpleName.DoResolveType): This ITypeExpression interface method
16076 is now doing the types-only lookup.
16077 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16078 (ResolveFlags): Added MaskExprClass.
16080 * expression.cs (MemberAccess): Implement the ITypeExpression
16082 (MemberAccess.DoResolve): Added support for a types-only lookup
16083 when we're called via ITypeExpression.DoResolveType().
16084 (ComposedCast): Implement the ITypeExpression interface.
16086 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
16087 Expression.Resolve() with ResolveFlags.Type instead.
16089 2002-08-12 Martin Baulig <martin@gnome.org>
16091 * interface.cs (Interface.Define): Apply attributes.
16093 * attribute.cs (Attribute.ApplyAttributes): Added support for
16094 interface attributes.
16096 2002-08-11 Martin Baulig <martin@gnome.org>
16098 * statement.cs (Block.Emit): Only check the "this" variable if we
16099 do not always throw an exception.
16101 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16102 whether the property has a set accessor.
16104 2002-08-11 Martin Baulig <martin@gnome.org>
16106 Added control flow analysis support for structs.
16108 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16109 with control flow analysis turned off.
16110 (IVariable): New interface.
16111 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16112 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16113 (FieldExpr.DoResolve): Resolve the instance expression with flow
16114 analysis turned off and do the definite assignment check after the
16115 resolving when we know what the expression will resolve to.
16117 * expression.cs (LocalVariableReference, ParameterReference):
16118 Implement the new IVariable interface, only call the flow analysis
16119 code if ec.DoFlowAnalysis is true.
16120 (This): Added constructor which takes a Block argument. Implement
16121 the new IVariable interface.
16122 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16123 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16124 This does the definite assignment checks for struct members.
16126 * class.cs (Constructor.Emit): If this is a non-static `struct'
16127 constructor which doesn't have any initializer, call
16128 Block.AddThisVariable() to tell the flow analysis code that all
16129 struct elements must be initialized before control returns from
16132 * statement.cs (MyStructInfo): New public class.
16133 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16134 argument to this indexer. If non-zero, check an individual struct
16135 member, not the whole struct.
16136 (FlowBranching.CheckOutParameters): Check struct members.
16137 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16138 overloaded versions of these methods which take an additional
16139 `int field_idx' argument to check struct members.
16140 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16141 overloaded versions of these methods which take an additional
16142 `string field_name' argument to check struct member.s
16143 (VariableInfo): Implement the IVariable interface.
16144 (VariableInfo.StructInfo): New public property. Returns the
16145 MyStructInfo instance of the variable if it's a struct or null.
16146 (Block.AddThisVariable): New public method. This is called from
16147 Constructor.Emit() for non-static `struct' constructor which do
16148 not have any initializer. It creates a special variable for the
16149 "this" instance variable which will be checked by the flow
16150 analysis code to ensure that all of the struct's fields are
16151 initialized before control returns from the constructor.
16152 (UsageVector): Added support for struct members. If a
16153 variable/parameter is a struct with N members, we reserve a slot
16154 in the usage vector for each member. A struct is considered fully
16155 initialized if either the struct itself (slot 0) or all its
16156 members are initialized.
16158 2002-08-08 Martin Baulig <martin@gnome.org>
16160 * driver.cs (Driver.MainDriver): Only report an error CS5001
16161 if there were no compilation errors.
16163 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16164 `UnsafeContext' property to determine whether the parent is in
16165 unsafe context rather than checking the parent's ModFlags:
16166 classes nested in an unsafe class are unsafe as well.
16168 2002-08-08 Martin Baulig <martin@gnome.org>
16170 * statement.cs (UsageVector.MergeChildren): Distinguish between
16171 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16172 we return. Added test17() and test18() to test-154.cs.
16174 2002-08-08 Martin Baulig <martin@gnome.org>
16176 * typemanager.cs (TypeManager.FilterWithClosure): If we have
16177 Family access, make sure the invoking type isn't a subclass of the
16178 queried type (that'd be a CS1540).
16180 * ecore.cs (Expression.MemberLookup): Added overloaded version of
16181 this method which takes an additional `Type invocation_type'.
16183 * expression.cs (BaseAccess.DoResolve): Use the base type as
16184 invocation and query type.
16185 (MemberAccess.DoResolve): If the lookup failed and we're about to
16186 report a CS0122, try a lookup with the ec.ContainerType - if this
16187 succeeds, we must report a CS1540.
16189 2002-08-08 Martin Baulig <martin@gnome.org>
16191 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16192 (MethodGroupExpr): Implement the IMemberExpr interface.
16194 * expression (MemberAccess.ResolveMemberAccess): No need to have
16195 any special code for MethodGroupExprs anymore, they're now
16198 2002-08-08 Martin Baulig <martin@gnome.org>
16200 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16201 Family, FamANDAssem and FamORAssem permissions.
16202 (TypeManager.IsSubclassOrNestedChildOf): New public method.
16204 2002-08-08 Martin Baulig <martin@gnome.org>
16206 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16207 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16210 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16212 * driver.cs: implemented /resource option to embed managed resources.
16214 2002-08-07 Martin Baulig <martin@gnome.org>
16216 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16217 (FieldBase.HasFieldInitializer): New public property.
16218 (FieldBase.GetInitializerExpression): New public method. Resolves and
16219 returns the field initializer and makes sure it is only resolved once.
16220 (TypeContainer.EmitFieldInitializers): Call
16221 FieldBase.GetInitializerExpression to get the initializer, this ensures
16222 that it isn't resolved multiple times.
16224 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
16225 the resolving process (SimpleName/MemberLookup) that we're currently
16226 emitting a field initializer (which must not access any instance members,
16227 this is an error CS0236).
16229 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16230 argument, if the `IsFieldInitializer' flag is set, we must report and
16231 error CS0236 and not an error CS0120.
16233 2002-08-07 Martin Baulig <martin@gnome.org>
16235 * ecore.cs (IMemberExpr): New public interface.
16236 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16237 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16238 if the expression is an IMemberExpr.
16240 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16241 to be null, implicitly default to `this' if we're non-static in
16242 this case. Simplified the code a lot by using the new IMemberExpr
16243 interface. Also fixed bug #28176 here.
16245 2002-08-06 Martin Baulig <martin@gnome.org>
16247 * cs-parser.jay (SimpleLookup): Removed. We need to create
16248 ParameterReferences during semantic analysis so that we can do a
16249 type-only search when resolving Cast, TypeOf and SizeOf.
16250 (block): Pass the `current_local_parameters' to the Block's
16253 * class.cs (ConstructorInitializer): Added `Parameters parameters'
16254 argument to the constructor.
16255 (ConstructorInitializer.Resolve): Create a temporary implicit
16256 block with the parameters.
16258 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16259 references here if we aren't doing a type-only search.
16261 * statement.cs (Block): Added constructor which takes a
16262 `Parameters parameters' argument.
16263 (Block.Parameters): New public property.
16265 * support.cs (InternalParameters.Parameters): Renamed `parameters'
16266 to `Parameters' and made it public readonly.
16268 2002-08-06 Martin Baulig <martin@gnome.org>
16270 * ecore.cs (Expression.Warning): Made this public as well.
16272 * report.cs (Report.Debug): Print the contents of collections.
16274 2002-08-06 Martin Baulig <martin@gnome.org>
16276 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
16277 used to tell Resolve() which kinds of expressions it may return.
16278 (Expression.Resolve): Added overloaded version of this method which
16279 takes a `ResolveFlags flags' argument. This can be used to tell
16280 Resolve() which kinds of expressions it may return. Reports a
16282 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16283 ResolveFlags.SimpleName.
16284 (Expression.Error118): Added overloaded version of this method which
16285 takes a `ResolveFlags flags' argument. It uses the flags to determine
16286 which kinds of expressions are allowed.
16288 * expression.cs (Argument.ResolveMethodGroup): New public method.
16289 Resolves an argument, but allows a MethodGroup to be returned.
16290 This is used when invoking a delegate.
16292 * TODO: Updated a bit.
16294 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16296 Fixed compilation with csc.
16298 * ecore.cs: Expression.Error made public. Is this correct? Should
16299 Warning be made public too?
16301 * expression.cs: use ea.Location instead of ea.loc.
16302 [FIXME: Filed as bug #28607: MCS must report these errors.]
16304 2002-08-06 Martin Baulig <martin@gnome.org>
16306 * ecore.cs (Expression.loc): Moved the location here instead of
16307 duplicating it in all derived classes.
16308 (Expression.Location): New public property.
16309 (Expression.Error, Expression.Warning): Made them non-static and
16310 removed the location argument.
16311 (Expression.Warning): Added overloaded version which takes an
16312 `int level' argument.
16313 (Expression.Error118): Make this non-static and removed the
16314 expression and location arguments.
16315 (TypeExpr): Added location argument to the constructor.
16317 * expression.cs (StaticCallExpr): Added location argument to
16319 (Indirection, PointerArithmetic): Likewise.
16320 (CheckedExpr, UnCheckedExpr): Likewise.
16321 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16322 (StringPtr): Likewise.
16325 2002-08-05 Martin Baulig <martin@gnome.org>
16327 * expression.cs (BaseAccess.DoResolve): Actually report errors.
16329 * assign.cs (Assign.DoResolve): Check whether the source
16330 expression is a value or variable.
16332 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16333 while resolving the corresponding blocks.
16335 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16336 an error, don't silently return null.
16338 * statement.cs (Block.AddVariable): Do the error reporting here
16339 and distinguish between CS0128 and CS0136.
16340 (Block.DoResolve): Report all unused labels (warning CS0164).
16341 (LabeledStatement): Pass the location to the constructor.
16342 (LabeledStatement.HasBeenReferenced): New property.
16343 (LabeledStatement.Resolve): Set it to true here.
16345 * statement.cs (Return.Emit): Return success even after reporting
16346 a type mismatch error (CS0126 or CS0127), this is what csc does and
16347 it avoids confusing the users with any consecutive errors.
16349 2002-08-05 Martin Baulig <martin@gnome.org>
16351 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16353 * const.cs (Const.LookupConstantValue): Catch circular definitions.
16355 * expression.cs (MemberAccess.DoResolve): Silently return if an
16356 error has already been reported.
16358 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16359 error has already been reported.
16361 2002-08-05 Martin Baulig <martin@gnome.org>
16363 * statement.cs (UsageVector): Only initialize the `parameters'
16364 vector if we actually have any "out" parameters.
16366 2002-08-05 Martin Baulig <martin@gnome.org>
16368 * expression.cs (Binary.ResolveOperator): When combining delegates,
16369 they must have the same type.
16371 2002-08-05 Martin Baulig <martin@gnome.org>
16373 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16374 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16375 work with the ms runtime and we also don't need it: if we're a
16376 PropertyBuilder and not in the `indexer_arguments' hash, then we
16377 are a property and not an indexer.
16379 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16380 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16381 since the latter one doesn't work with the ms runtime.
16383 2002-08-03 Martin Baulig <martin@gnome.org>
16385 Fixed bugs #27998 and #22735.
16387 * class.cs (Method.IsOperator): New public field.
16388 (Method.CheckBase): Report CS0111 if there's already a method
16389 with the same parameters in the current class. Report CS0508 when
16390 attempting to change the return type of an inherited method.
16391 (MethodData.Emit): Report CS0179 if a method doesn't have a body
16392 and it's not marked abstract or extern.
16393 (PropertyBase): New abstract base class for Property and Indexer.
16394 (PropertyBase.CheckBase): Moved here from Property and made it work
16396 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16397 the same so we can reuse it there.
16398 (Property, Indexer): Derive from PropertyBase.
16399 (MethodSignature.inheritable_property_signature_filter): New delegate
16400 to find properties and indexers.
16402 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16403 argument and improved error reporting.
16405 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16406 EmptyReadOnlyParameters and made it a property.
16408 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16409 version of this method which takes a `PropertyInfo indexer'.
16410 (TypeManager.RegisterIndexer): New method.
16412 * class.cs: Added myself as author of this file :-)
16414 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16416 * class.cs: fixed compilation on windoze.
16418 2002-08-03 Martin Baulig <martin@gnome.org>
16420 * interface.cs (Interface.GetInterfaceBases): Check whether all
16421 base interfaces are at least as accessible than the current one.
16423 * class.cs (TypeContainer.GetClassBases): Check whether base types
16424 are at least as accessible than the current type.
16425 (TypeContainer.AsAccessible): Implemented and made non-static.
16426 (MemberBase.CheckParameters): Report errors if the accessibility
16429 * delegate.cs (Delegate.Delegate): The default visibility is
16430 internal for top-level types and private for nested types.
16431 (Delegate.Define): Report errors if the accessibility checks fail.
16433 * enum.cs (Enum.Enum): The default visibility is internal for
16434 top-level types and private for nested types.
16435 (Enum.DefineType): Compute the correct visibility.
16437 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16438 function which takes a `bool is_toplevel' instead of a TypeContainer.
16440 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16443 2002-08-02 Martin Baulig <martin@gnome.org>
16445 * expression.cs (LocalVariableReferenc): Added constructor which
16446 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16447 (LocalVariableReference.IsReadOnly): New property.
16448 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16449 variable is readonly, use our own readonly flag to do this; you can
16450 use the new constructor to get a writable reference to a read-only
16453 * cs-parser.jay (foreach_statement, using_statement): Get a writable
16454 reference to the local variable.
16456 2002-08-01 Miguel de Icaza <miguel@ximian.com>
16458 * rootcontext.cs (ResolveCore): Also include System.Exception
16460 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16461 we reach an EmptyStatement.
16463 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16466 * expression.cs (Binary.ResolveOperator): Check error result in
16469 use brtrue/brfalse directly and avoid compares to null.
16471 2002-08-02 Martin Baulig <martin@gnome.org>
16473 * class.cs (TypeContainer.Define): Define all nested interfaces here.
16474 Fixes bug #28407, added test-155.cs.
16476 2002-08-01 Martin Baulig <martin@gnome.org>
16478 * class.cs (Event.EmitDefaultMethod): Make this work with static
16479 events. Fixes #28311, added verify-3.cs.
16481 2002-08-01 Martin Baulig <martin@gnome.org>
16483 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16484 `is_disposable' fields.
16485 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16486 `hm.is_disposable' if we're using the collection pattern.
16487 (Foreach.EmitCollectionForeach): Use the correct type for the
16488 enumerator's local variable, only emit the try/finally block if
16489 necessary (fixes #27713).
16491 2002-08-01 Martin Baulig <martin@gnome.org>
16493 * ecore.cs (Expression.report118): Renamed to Error118 and made
16496 * statement.cs (Throw.Resolve): Check whether the expression is of
16497 the correct type (CS0118) and whether the type derives from
16498 System.Exception (CS0155).
16499 (Catch.Resolve): New method. Do the type lookup here and check
16500 whether it derives from System.Exception (CS0155).
16501 (Catch.CatchType, Catch.IsGeneral): New public properties.
16503 * typemanager.cs (TypeManager.exception_type): Added.
16505 2002-07-31 Miguel de Icaza <miguel@ximian.com>
16507 * driver.cs: Updated About function.
16509 2002-07-31 Martin Baulig <martin@gnome.org>
16511 Implemented Control Flow Analysis.
16513 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16514 (EmitContext.CurrentBranching): Added.
16515 (EmitContext.StartFlowBranching): Added.
16516 (EmitContext.EndFlowBranching): Added.
16517 (EmitContext.KillFlowBranching): Added.
16518 (EmitContext.IsVariableAssigned): Added.
16519 (EmitContext.SetVariableAssigned): Added.
16520 (EmitContext.IsParameterAssigned): Added.
16521 (EmitContext.SetParameterAssigned): Added.
16522 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16523 Added control flow analysis stuff here.
16525 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16526 resolve the expression as lvalue.
16527 (LocalVariableReference.DoResolve): Check whether the variable has
16528 already been assigned.
16529 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16530 the parameter as assigned here.
16531 (ParameterReference.DoResolve): Check whether the parameter has already
16533 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16534 expression as lvalue.
16536 * statement.cs (FlowBranching): New class for the flow analysis code.
16537 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16538 (LabeledStatement.IsDefined): New public property.
16539 (LabeledStatement.AddUsageVector): New public method to tell flow
16540 analyis that the label may be reached via a forward jump.
16541 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16543 (VariableInfo.Number): New public field. This is used by flow analysis
16544 to number all locals of a block.
16545 (Block.CountVariables): New public property. This is the number of
16546 local variables in this block (including the locals from all parent
16548 (Block.EmitMeta): Number all the variables.
16550 * statement.cs: Added flow analysis support to all classes.
16552 2002-07-31 Martin Baulig <martin@gnome.org>
16554 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16555 To get debugging messages, compile mcs with /define:MCS_DEBUG and
16556 then use this argument.
16558 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16560 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16561 use this to specify /define options.
16563 2002-07-29 Martin Baulig <martin@gnome.org>
16565 * statement.cs (Fixed): Moved all code that does variable lookups
16566 and resolvings from Emit to Resolve.
16568 * statement.cs (For): Moved all code that does variable lookups
16569 and resolvings from Emit to Resolve.
16571 * statement.cs (Using): Moved all code that does variable lookups
16572 and resolvings from Emit to Resolve.
16574 2002-07-29 Martin Baulig <martin@gnome.org>
16576 * attribute.cs (Attribute.Resolve): Explicitly catch a
16577 System.NullReferenceException when creating the
16578 CustromAttributeBuilder and report a different warning message.
16580 2002-07-29 Martin Baulig <martin@gnome.org>
16582 * support.cs (ParameterData.ParameterName): Added method to
16583 get the name of a parameter.
16585 * typemanager.cs (TypeManager.IsValueType): New public method.
16587 2002-07-29 Martin Baulig <martin@gnome.org>
16589 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
16590 is a flag which specifies that it's either ref or out.
16591 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16592 the out parameter to `out Parameter.Modifier mod', also set the
16593 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16595 * support.cs (InternalParameters.ParameterModifier): Distinguish
16596 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16597 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16599 * expression.cs (Argument.GetParameterModifier): Distinguish
16600 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16601 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16603 2002-07-29 Martin Baulig <martin@gnome.org>
16605 * expression.cs (ParameterReference.ParameterReference): Added
16606 `Location loc' argument to the constructor.
16608 * cs-parser.jay: Pass location to ParameterReference.
16610 2002-07-28 Miguel de Icaza <miguel@ximian.com>
16612 * statement.cs (Try): Initialize the location.
16614 * cs-parser.jay: pass location to Try.
16616 * expression.cs (Unary.Reduce): Change the prototype to return
16617 whether a constant fold could be performed or not. The result is
16618 returned in an out parameters. In the case of Indirection and
16619 AddressOf, we want to perform the full tests.
16621 2002-07-26 Miguel de Icaza <miguel@ximian.com>
16623 * statement.cs (Statement.Emit): Flag dead code.
16625 2002-07-27 Andrew Birkett <andy@nobugs.org>
16627 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16629 2002-07-27 Martin Baulig <martin@gnome.org>
16631 * class.cs (MethodData.Define): Put back call to
16632 TypeManager.AddMethod(), accidentally commented this out.
16634 * report.cs (Debug): New public method to print debugging information,
16635 this is `[Conditional ("DEBUG")]'.
16637 2002-07-26 Martin Baulig <martin@gnome.org>
16639 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16640 (switch_statement): Push the current_block to the switch_stack and
16641 pop it again when we're done with the switch.
16642 (switch_section): The new block is a child of the current_block.
16643 Fixes bug #24007, added test-152.cs.
16645 2002-07-27 Martin Baulig <martin@gnome.org>
16647 * expression.cs (Invocation.EmitArguments): When calling a varargs
16648 function with only its fixed arguments, we need to pass an empty
16651 2002-07-27 Martin Baulig <martin@gnome.org>
16653 Mono 0.13 has been released.
16655 2002-07-25 Miguel de Icaza <miguel@ximian.com>
16657 * driver.cs: Rename --resource to --linkres, because that is what
16658 we do currently, we dont support --resource yet.
16660 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16662 2002-07-25 Martin Baulig <martin@gnome.org>
16664 * class.cs (MethodData): New public class. This is a `method builder'
16665 class for a method or one accessor of a Property/Indexer/Event.
16666 (MethodData.GetMethodFlags): Moved here from MemberBase.
16667 (MethodData.ApplyAttributes): Likewise.
16668 (MethodData.ApplyObsoleteAttribute): Likewise.
16669 (MethodData.ApplyConditionalAttribute): Likewise.
16670 (MethodData.ApplyDllImportAttribute): Likewise.
16671 (MethodData.CheckAbstractAndExternal): Likewise.
16672 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16673 (MethodData.Emit): Formerly known as Method.Emit().
16674 (MemberBase): Moved everything which was specific to a single
16675 accessor/method to MethodData.
16676 (Method): Create a new MethodData and call Define() and Emit() on it.
16677 (Property, Indexer, Event): Create a new MethodData objects for each
16678 accessor and call Define() and Emit() on them.
16680 2002-07-25 Martin Baulig <martin@gnome.org>
16682 Made MethodCore derive from MemberBase to reuse the code from there.
16683 MemberBase now also checks for attributes.
16685 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16686 (MemberBase.GetMethodFlags): Moved here from class Method and marked
16688 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16689 `CallingConventions cc' and `Attributes opt_attrs' arguments.
16690 (MemberBase.ApplyAttributes): New virtual method; applies the
16691 attributes to a method or accessor.
16692 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16693 (MemberBase.ApplyConditionalAttribute): Likewise.
16694 (MemberBase.ApplyDllImportAttribute): Likewise.
16695 (MemberBase.CheckAbstractAndExternal): Likewise.
16696 (MethodCore.ParameterTypes): This is now a property instead of a
16697 method, it's initialized from DoDefineParameters().
16698 (MethodCore.ParameterInfo): Removed the set accessor.
16699 (MethodCore.DoDefineParameters): New protected virtual method to
16700 initialize ParameterTypes and ParameterInfo.
16701 (Method.GetReturnType): We can now simply return the MemberType.
16702 (Method.GetMethodFlags): Override the MemberBase version and add
16703 the conditional flags.
16704 (Method.CheckBase): Moved some code from Define() here, call
16705 DoDefineParameters() here.
16706 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16707 here to avoid some larger code duplication.
16708 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16709 ensure that abstract and external accessors don't declare a body.
16711 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16712 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16713 lookup in the attribute's parent classes, so we need to abort as soon
16714 as we found the first match.
16715 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16716 the attribute has no arguments.
16718 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16721 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16723 * cs-parser.jay: reverted previous patch.
16725 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16727 * cs-parser.jay: fixed bug #22119.
16729 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16731 * attribute.cs: fixed compilation. The error was:
16732 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
16733 be assigned to before control leaves the current method."
16734 [FIXME: Filed as bug #28186: MCS must report this error.]
16736 2002-07-25 Martin Baulig <martin@gnome.org>
16738 * attribute.cs (Attribute.Conditional_GetConditionName): New static
16739 method to pull the condition name ouf of a Conditional attribute.
16740 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16741 the obsolete message and error flag out of an Obsolete attribute.
16743 * class.cs (Method.GetMethodFlags): New public method to get the
16744 TypeManager.MethodFlags for this method.
16745 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16747 (Method.Define): Get and apply the Obsolete and Conditional attributes;
16748 if we're overriding a virtual function, set the new private variable
16749 `parent_method'; call the new TypeManager.AddMethod().
16751 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
16752 the MethodBuilder and the Method in a PtrHashtable.
16753 (TypeManager.builder_to_method): Added for this purpose.
16754 (TypeManager.MethodFlags): Added IsObsoleteError.
16755 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
16756 Obsolete and Conditional arguments in MethodBuilders. If we discover
16757 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16758 the message from the attribute.
16760 2002-07-24 Martin Baulig <martin@gnome.org>
16762 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16763 preprocessor directives, ensure that the argument to #define/#undef is
16764 exactly one identifier and that it's actually an identifier.
16766 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16769 2002-07-24 Martin Baulig <martin@gnome.org>
16771 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16772 initialize it to TypeManager.object_type in the constructor.
16773 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16774 of the `hm.get_current' method if we're using the collection pattern.
16775 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16776 for the explicit conversion to make it work when we're using the collection
16777 pattern and the `Current' property has a different return type than `object'.
16780 2002-07-24 Martin Baulig <martin@gnome.org>
16782 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16783 does not match, but don't report any errors. This method is called in
16784 order for all methods in a MethodGroupExpr until a matching method is
16785 found, so we don't want to bail out if the first method doesn't match.
16786 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16787 matches, report the 123. Fixes #28070.
16789 2002-07-24 Martin Baulig <martin@gnome.org>
16791 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16792 TypeManager.TypeToCoreType() to the top of the method so the
16793 following equality checks will work. Fixes #28107.
16795 2002-07-24 Martin Baulig <martin@gnome.org>
16797 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16798 operand is of type uint, and the other operand is of type sbyte,
16799 short or int, the operands are converted to type long." -
16800 Actually do what this comment already told us. Fixes bug #28106,
16803 2002-07-24 Martin Baulig <martin@gnome.org>
16805 * class.cs (MethodBase): New abstract class. This is now a base
16806 class for Property, Indexer and Event to avoid some code duplication
16807 in their Define() and DefineMethods() methods.
16808 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16809 generic methods for Define() and DefineMethods().
16810 (FieldBase): Derive from MemberBase, not MemberCore.
16811 (Property): Derive from MemberBase, not MemberCore.
16812 (Property.DefineMethod): Moved all the code from this method to the
16813 new MethodBase.DefineAccessor(), just call it with appropriate
16815 (Property.Define): Call the new Property.DoDefine(), this does some
16816 sanity checks and we don't need to duplicate the code everywhere.
16817 (Event): Derive from MemberBase, not MemberCore.
16818 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16819 accessors, this will also make them work with interface events.
16820 (Indexer): Derive from MemberBase, not MemberCore.
16821 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16822 (Indexer.Define): Use the new MethodBase functions.
16824 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16825 argument to the constructor.
16826 (Interface.FindMembers): Added support for interface events.
16827 (Interface.PopluateEvent): Implemented.
16829 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
16831 2002-07-22 Miguel de Icaza <miguel@ximian.com>
16833 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16834 but this is required to check for a method name being the same as
16835 the containing class.
16839 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16841 * interface.cs: initialize variable.
16843 2002-07-23 Martin Baulig <martin@gnome.org>
16845 Implemented the IndexerName attribute in interfaces.
16847 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16848 name if this is an explicit interface implementation.
16849 (Indexer.InterfaceIndexerName): New public variable. If we're
16850 implementing an interface indexer, this is the IndexerName in that
16851 interface. Otherwise, it's the IndexerName.
16852 (Indexer.DefineMethod): If we're implementing interface indexer,
16853 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
16854 and Pending.ImplementIndexer methods.
16855 (Indexer.Define): Also define the PropertyBuilder if we're
16856 implementing an interface indexer and this is neither an explicit
16857 interface implementation nor do the IndexerName match the one in
16860 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16861 If a method is defined here, then we always need to create a proxy
16862 for it. This is used when implementing interface indexers.
16863 (Pending.IsInterfaceIndexer): New public method.
16864 (Pending.ImplementIndexer): New public method.
16865 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16866 This is used when implementing interface indexers to define a proxy
16868 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16869 define a proxy if necessary.
16871 * interface.cs (Interface.IndexerName): New public variable.
16872 (Interface.PopulateIndexer): Set the IndexerName.
16873 (Interface.DefineIndexers): New private method. Populate all the
16874 indexers and make sure their IndexerNames match.
16876 * typemanager.cs (IndexerPropertyName): Added support for interface
16879 2002-07-22 Martin Baulig <martin@gnome.org>
16881 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16882 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16883 ret if HasReturnLabel.
16884 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16887 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16888 and set the ec.LoopBeginTryCatchLevel.
16889 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16890 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16891 the current ec.TryCatchLevel, the branch goes out of an exception
16892 block. In this case, we need to use Leave and not Br.
16894 2002-07-22 Martin Baulig <martin@gnome.org>
16896 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16897 block unless the block does not always return or it is contained in
16898 another try { ... } catch { ... } block. Fixes bug #26506.
16899 Added verify-1.cs to the test suite.
16901 2002-07-22 Martin Baulig <martin@gnome.org>
16903 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16904 then we do not always return. Fixes bug #24985.
16906 2002-07-22 Martin Baulig <martin@gnome.org>
16908 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16909 lookup on a per-class level; ie. walk up the class hierarchy until we
16910 found at least one applicable method, then choose the best among them.
16911 Fixes bug #24463 and test-29.cs.
16913 2002-07-22 Martin Baulig <martin@gnome.org>
16915 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16916 return types of the methods. The return type is not part of the
16917 signature and we must not check it to make the `new' modifier work.
16918 Fixes bug #27999, also added test-147.cs.
16919 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16921 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16922 on the method's return type.
16924 2002-07-21 Martin Baulig <martin@gnome.org>
16926 * assign.cs: Make this work if the rightmost source is a constant and
16927 we need to do an implicit type conversion. Also adding a few more tests
16928 to test-38.cs which should have caught this.
16930 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16931 target in the makefile for this. The makefile.gnu is primarily intended
16932 for end-users who don't want to debug the compiler.
16934 2002-07-21 Martin Baulig <martin@gnome.org>
16936 * assign.cs: Improved the Assign class so it can now handle embedded
16937 assignments (X = Y = Z = something). As a side-effect this'll now also
16938 consume less local variables. test-38.cs now passes with MCS, added
16939 a few new test cases to that test.
16941 2002-07-20 Martin Baulig <martin@gnome.org>
16943 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16944 instructions. Fixes bug #27977, also added test-146.cs.
16946 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16948 * cs-tokenizer.cs: fixed getHex ().
16950 2002-07-19 Martin Baulig <martin@gnome.org>
16952 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16953 not Type.GetType() to lookup the array type. This is needed when
16954 we're constructing an array of a user-defined type.
16955 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16956 single-dimensional arrays, but also for single-dimensial arrays of
16959 2002-07-19 Martin Baulig <martin@gnome.org>
16961 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16962 this function is called, it's not allowed to share LocalBuilders
16963 among ILGenerators.
16965 2002-07-19 Martin Baulig <martin@gnome.org>
16967 * expression.cs (Argument.Resolve): Report an error 118 when trying
16968 to pass a type as argument.
16970 2002-07-18 Martin Baulig <martin@gnome.org>
16972 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16973 Conv_R_Un for the signed `long' type.
16975 2002-07-15 Miguel de Icaza <miguel@ximian.com>
16977 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16978 `expr' for the temporary result, as that will fail if we do
16979 multiple resolves on the same expression.
16981 2002-07-05 Miguel de Icaza <miguel@ximian.com>
16983 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16984 ec.TypeContainer for looking up aliases.
16986 * class.cs (TypeContainer): Remove LookupAlias from here.
16988 * decl.cs (DeclSpace); Move here.
16990 2002-07-01 Miguel de Icaza <miguel@ximian.com>
16992 * class.cs (FindMembers): Only call filter if the constructor
16993 bulider is not null.
16995 Also handle delegates in `NestedTypes' now. Now we will perform
16996 type lookups using the standard resolution process. This also
16999 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17000 This uses Expressions (the limited kind that can be parsed by the
17001 tree) instead of strings.
17003 * expression.cs (ComposedCast.ToString): Implement, used to flag
17004 errors since now we have to render expressions.
17006 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
17009 * ecore.cs (SimpleName.ToString): ditto.
17011 * cs-parser.jay: Instead of using strings to assemble types, use
17012 Expressions to assemble the type (using SimpleName, ComposedCast,
17013 MemberAccess). This should fix the type lookups in declarations,
17014 because we were using a different code path for this.
17016 * statement.cs (Block.Resolve): Continue processing statements
17017 even when there is an error.
17019 2002-07-17 Miguel de Icaza <miguel@ximian.com>
17021 * class.cs (Event.Define): Also remove the `remove' method from
17022 the list of pending items.
17024 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17025 generate more compact code.
17027 2002-07-17 Martin Baulig <martin@gnome.org>
17029 * const.cs (Const.LookupConstantValue): Add support for constant
17030 `unchecked' and `checked' expressions.
17031 Also adding test case test-140.cs for this.
17033 2002-07-17 Martin Baulig <martin@gnome.org>
17035 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17036 check whether mi.ReturnType implements the IEnumerator interface; the
17037 `==' and the IsAssignableFrom() will fail in this situation.
17039 2002-07-16 Ravi Pratap <ravi@ximian.com>
17041 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
17044 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17046 * expression.cs: fixed bug #27811.
17048 2002-07-14 Miguel de Icaza <miguel@ximian.com>
17050 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17051 Molaro: when we are a ref, the value already contains a pointer
17052 value, do not take the address of it.
17054 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17055 * removed mb-parser.jay and mb-tokenizer.cs
17057 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17059 * expression.cs: check against the building corlib void type.
17061 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17063 * ecore.cs: fix for valuetype static readonly fields: when
17064 initializing them, we need their address, not the address of a copy.
17066 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17068 * typemanager.cs: register also enum_type in corlib.
17070 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17072 * class.cs: allow calling this (but not base) initializers in structs.
17074 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17076 * ecore.cs: make sure we compare against the building base types
17079 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17081 * typemanager.cs: fix TypeToCoreType() to handle void and object
17082 (corlib gets no more typerefs after this change).
17084 2002-07-12 Miguel de Icaza <miguel@ximian.com>
17086 * expression.cs (ArrayCreation.EmitArrayArguments): use
17087 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17089 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17090 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
17091 array indexes, the runtime actually forbids them.
17093 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17094 for array arguments here.
17096 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17097 instead of the default for ValueTypes.
17099 (New.DoEmit): Use IsValueType instead of
17100 IsSubclassOf (value_type)
17101 (New.DoResolve): ditto.
17102 (Invocation.EmitCall): ditto.
17104 * assign.cs (Assign): ditto.
17106 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17107 Statements *are* currently doing part of their resolution during
17110 Expressions do always resolve during resolve, but statements are
17111 only required to propagate resolution to their children.
17113 2002-07-11 Miguel de Icaza <miguel@ximian.com>
17115 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17117 (LoadAssembly): Do not add the dll if it is already specified
17119 (MainDriver): Add the System directory to the link path at the end,
17120 after all the other -L arguments.
17122 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17123 wrong opcode for loading bytes and bools (ldelem.i1 instead of
17124 ldelem.u1) and using the opposite for sbytes.
17126 This fixes Digger, and we can finally run it.
17128 * driver.cs (UnixParseOption): Move the option parsing here.
17129 (CSCParseOption): Implement CSC-like parsing of options.
17131 We now support both modes of operation, the old Unix way, and the
17132 new CSC-like way. This should help those who wanted to make cross
17133 platform makefiles.
17135 The only thing broken is that /r:, /reference: and /lib: are not
17136 implemented, because I want to make those have the same semantics
17137 as the CSC compiler has, and kill once and for all the confussion
17138 around this. Will be doing this tomorrow.
17140 * statement.cs (Unsafe.Resolve): The state is checked during
17141 resolve, not emit, so we have to set the flags for IsUnsfe here.
17143 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17145 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17146 not catch the Error_ObjectRefRequired in SimpleName (as it is
17147 possible to have a class/instance variable name that later gets
17148 deambiguated), we have to check this here.
17150 2002-07-10 Ravi Pratap <ravi@ximian.com>
17152 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17153 make static and put into Expression.
17155 (Event.Define): Register the private field of the event with the
17156 TypeManager so that GetFieldFromEvent can get at it.
17158 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17159 keep track of the private field associated with an event which
17162 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17165 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17167 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17169 * expression.cs (Binary.EmitBranchable): this routine emits the
17170 Binary expression in a branchable context. This basically means:
17171 we need to branch somewhere, not just get the value on the stack.
17173 This works together with Statement.EmitBoolExpression.
17175 * statement.cs (Statement.EmitBoolExpression): Use
17178 2002-07-09 Miguel de Icaza <miguel@ximian.com>
17180 * statement.cs (For): Reduce the number of jumps in loops.
17182 (For): Implement loop inversion for the For statement.
17184 (Break): We can be breaking out of a Try/Catch controlled section
17185 (foreach might have an implicit try/catch clause), so we need to
17186 use Leave instead of Br.
17188 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17189 now). If the instace expression supports IMemoryLocation, we use
17190 the AddressOf method from the IMemoryLocation to extract the
17191 address instead of emitting the instance.
17193 This showed up with `This', as we were emitting the instance
17194 always (Emit) instead of the Address of This. Particularly
17195 interesting when This is a value type, as we dont want the Emit
17196 effect (which was to load the object).
17198 2002-07-08 Miguel de Icaza <miguel@ximian.com>
17200 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17202 * statement.cs (Checked): Set the CheckedState during the resolve
17203 process too, as the ConvCast operations track the checked state on
17204 the resolve process, and not emit.
17206 * cs-parser.jay (namespace_member_declaration): Flag that we have
17207 found a declaration when we do. This is used to flag error 1529
17209 * driver.cs: Report ok when we display the help only.
17211 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
17213 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17215 2002-07-04 Miguel de Icaza <miguel@ximian.com>
17217 * cs-tokenizer.cs (define): We also have to track locally the
17218 defines. AllDefines is just used for the Conditional Attribute,
17219 but we also need the local defines for the current source code.
17221 2002-07-03 Miguel de Icaza <miguel@ximian.com>
17223 * statement.cs (While, For, Do): These loops can exit through a
17224 Break statement, use this information to tell whether the
17225 statement is the last piece of code.
17227 (Break): Flag that we break.
17229 * codegen.cs (EmitContexts): New `Breaks' state variable.
17231 2002-07-03 Martin Baulig <martin@gnome.org>
17233 * class.cs (TypeContainer.MethodModifiersValid): Allow override
17234 modifiers in method declarations in structs. Otherwise, you won't
17235 be able to override things like Object.Equals().
17237 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17239 * class.cs (Method, Property, Indexer): Do not allow the public
17240 modifier to be used in explicit interface implementations.
17242 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17243 override modifiers in method declarations in structs
17245 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
17247 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17248 integer or real overflow, report an error
17250 2002-07-02 Martin Baulig <martin@gnome.org>
17252 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17253 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17254 to tell the runtime about our newly created System.Object and
17255 System.ValueType types.
17257 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17259 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17260 struct instead of Ldarg/Starg.
17262 2002-07-02 Martin Baulig <martin@gnome.org>
17264 * expression.cs (Indirection.Indirection): Call
17265 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17267 2002-07-02 Martin Baulig <martin@gnome.org>
17269 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17270 ValueType, call TypeManager.TypeToCoreType() on it.
17271 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17272 the OpCodes.Newarr argument.
17274 2002-07-02 Martin Baulig <martin@gnome.org>
17276 * expression.cs (Invocation.EmitCall): When compiling corlib,
17277 replace all calls to the system's System.Array type to calls to
17278 the newly created one.
17280 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17281 System.Array methods.
17282 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17283 from the system's System.Array type which must be replaced.
17285 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17287 * typemanager.cs: load unverifiable_code_ctor so we can build
17288 corlib using the correct type. Avoid using GetTypeCode() with
17290 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17291 TypeManager.object_type to allow building corlib.
17293 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17295 * ecore.cs: handle System.Enum separately in LoadFromPtr().
17297 2002-07-01 Martin Baulig <martin@gnome.org>
17299 * class.cs: Make the last change actually work, we need to check
17300 whether `ifaces != null' to avoid a crash.
17302 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17304 * class.cs: when we build structs without fields that implement
17305 interfaces, we need to add the interfaces separately, since there is
17306 no API to both set the size and add the interfaces at type creation
17309 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17311 * expression.cs: the dimension arguments to the array constructors
17312 need to be converted if they are a long.
17314 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17316 * class.cs: don't emit ldarg.0 if there is no parent constructor
17317 (fixes showstopper for corlib).
17319 2002-06-29 Martin Baulig <martin@gnome.org>
17321 MCS now compiles corlib on GNU/Linux :-)
17323 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17324 ie. check for MethodImplOptions.InternalCall.
17326 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17327 and TypeManager.attribute_type are null, so we must explicitly check
17328 whether parent is not null to find out whether it's an attribute type.
17329 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17330 and SetBuilder, not only if the property is neither abstract nor external.
17331 This is necessary to set the MethodImplOptions on the accessor methods.
17332 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17333 SetBuilder, see Property.Emit().
17335 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17336 populate "System.Object", "System.ValueType" and "System.Attribute" since
17337 they've already been populated from BootCorlib_PopulateCoreTypes().
17339 2002-06-29 Martin Baulig <martin@gnome.org>
17341 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17342 is the NullLiteral, we also need to make sure that target_type is not
17345 2002-06-29 Martin Baulig <martin@gnome.org>
17347 * rootcontext.cs (RootContext.ResolveCore): We must initialize
17348 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17349 before calling BootstrapCorlib_ResolveDelegate ().
17351 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17353 * statement.cs: fixed build-breaker. All tests passed ok.
17355 2002-06-27 Martin Baulig <martin@gnome.org>
17357 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17358 for System.Decimal when compiling corlib.
17360 2002-06-27 Martin Baulig <martin@gnome.org>
17362 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17363 switch blocks which contain nothing but a default clause.
17365 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
17367 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17369 2002-06-27 Martin Baulig <martin@gnome.org>
17371 * ecore.cs (PropertyExpr.PropertyExpr): Call
17372 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17374 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17375 is already a TypeBuilder.
17377 2002-06-27 Martin Baulig <martin@gnome.org>
17379 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17380 `target_type == TypeManager.array_type', not IsAssignableFrom() in
17381 the "from an array-type to System.Array" case. This makes it work
17382 when compiling corlib.
17384 2002-06-27 Martin Baulig <martin@gnome.org>
17386 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17387 non-static PropertyExpr, set its InstanceExpression. This makes
17388 the `ICollection.Count' property work in System/Array.cs.
17390 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
17392 * driver.cs: Made error handling more consistent. Errors now
17393 tracked by Report class, so many methods which used to return int
17394 now return void. Main() now prints success/failure and
17395 errors/warnings message.
17397 Renamed '--probe' compiler argument to '--expect-error'. Removed
17398 the magic number return values (123 and 124). Now, if the
17399 expected error occurs, the compiler exits with success (exit value
17400 0). If the compilation completes without seeing that particular
17401 error, the compiler exits with failure (exit value 1). The
17402 makefile in mcs/errors has been changed to handle the new behaviour.
17404 * report.cs: Made 'expected error' number a property and renamed
17405 it from 'Probe' to 'ExpectedError'.
17407 * genericparser.cs: Removed error handling support, since it is
17408 now all done by Report class.
17410 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17411 class, so parse() no longer returns an int.
17413 * namespace.cs: Use Report.Error instead of GenericParser.error
17415 2002-06-22 Miguel de Icaza <miguel@ximian.com>
17417 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17418 TypeContainer.AddOperator): At the front of the list put the
17419 explicit implementations, so they get resolved/defined first.
17421 2002-06-21 Miguel de Icaza <miguel@ximian.com>
17423 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17424 interface type is implemented by this TypeContainer. Used during
17425 explicit interface implementation.
17427 (Property.Define, Indexer.Define, Method.Define): Validate that
17428 the given interface in the explicit implementation is one of the
17429 base classes for the containing type.
17431 Also if we are explicitly implementing an interface, but there is
17432 no match in the pending implementation table, report an error.
17434 (Property.Define): Only define the property if we are
17435 not explicitly implementing a property from an interface. Use the
17436 correct name also for those properties (the same CSC uses,
17437 although that is really not needed).
17439 (Property.Emit): Do not emit attributes for explicitly implemented
17440 properties, as there is no TypeBuilder.
17442 (Indexer.Emit): ditto.
17444 Hiding then means that we do not really *implement* a pending
17445 implementation, which makes code fail.
17447 2002-06-22 Martin Baulig <martin@gnome.org>
17449 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17450 the return value of Object.GetType(). [FIXME: we need to do this whenever
17451 we get a type back from the reflection library].
17453 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17455 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17457 2002-06-20 Miguel de Icaza <miguel@ximian.com>
17459 * attribute.cs: Return null if we can not look up the type.
17461 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17462 the interface types found.
17464 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17465 interface types found.
17467 * typemanager.cs (GetInterfaces): Make this routine returns alll
17468 the interfaces and work around the lame differences between
17469 System.Type and System.Reflection.Emit.TypeBuilder in the results
17470 result for GetInterfaces.
17472 (ExpandInterfaces): Given an array of interface types, expand and
17473 eliminate repeated ocurrences of an interface. This expands in
17474 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17477 2002-06-21 Martin Baulig <martin@gnome.org>
17479 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17482 2002-06-21 Martin Baulig <martin@gnome.org>
17484 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
17485 and called with one of the core types, return the corresponding typebuilder for
17488 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17491 2002-06-21 Martin Baulig <martin@gnome.org>
17493 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17494 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17495 (Expression.ConvertReferenceExplicit): Likewise.
17497 * expression.cs (ElementAccess.DoResolve): Likewise.
17498 (ElementAccess.DoResolveLValue): Likewise.
17500 2002-06-10 Martin Baulig <martin@gnome.org>
17502 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17503 add the "value" parameter to the parameter list.
17505 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17508 2002-06-19 Miguel de Icaza <miguel@ximian.com>
17510 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17511 the argument to an int, uint, long or ulong, per the spec. Also
17512 catch negative constants in array creation.
17514 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17516 * class.cs: do not allow the same interface to appear twice in
17517 the definition list.
17519 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17521 * ecore.cs: don't use ldlen with System.Array.
17523 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17525 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17527 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17529 * modifiers.cs: produce correct field attributes for protected
17530 internal. Easy fix so miguel can work on ther harder stuff:-)
17532 2002-06-18 Miguel de Icaza <miguel@ximian.com>
17534 * pending.cs: New file. Move the code from class.cs here.
17535 Support clearning the pending flag for all methods (when not doing
17536 explicit interface implementation).
17538 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17540 * rootcontext.cs: added a couple more types needed to bootstrap.
17542 2002-06-17 Miguel de Icaza <miguel@ximian.com>
17544 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17545 constructor in the type, instead of any constructor in the type
17546 hierarchy. Thanks to Paolo for finding this bug (it showed up as
17547 a bug in the Mono runtime when applying the params attribute).
17549 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17550 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17552 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
17554 * expression.cs (Unary.ResolveOperator): Use TypeManager
17555 to resolve the type.
17557 2002-06-13 Ravi Pratap <ravi@ximian.com>
17559 * cs-parser.jay (enum_member_declaration): Pass in the attributes
17562 * enum.cs (AddEnumMember): Add support to store the attributes associated
17563 with each member too.
17565 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17566 field builders too - this takes care of the enum member case.
17568 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
17570 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17571 address-of operator on both value types and pointers.
17573 2002-06-10 Martin Baulig <martin@gnome.org>
17575 * interface.cs (Interface.PopulateIndexer): Add the indexer's
17576 PropertyBuilder to the `property_builders' list.
17578 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17579 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17580 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
17581 find any indexers which are inherited from an interface.
17583 2002-06-09 Martin Baulig <martin@gnome.org>
17585 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17586 the same type as the constant if necessary. There's also a test-130.cs
17589 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17591 * typemanager.cs (TypeManager.ChangeType): Previously known as
17592 Enum.ChangeEnumType().
17594 2002-06-09 Martin Baulig <martin@gnome.org>
17596 * expression.cs (Cast.TryReduce): Added support for consts.
17598 2002-06-08 Ravi Pratap <ravi@ximian.com>
17600 * class.cs (Accessor): Hold attributes information so we can pass
17603 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17604 Modify to pass in attributes attached to the methods.
17606 (add_accessor_declaration, remove_accessor_declaration): Ditto.
17608 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17609 to handle the Accessor kind :-)
17611 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17613 2002-06-08 Martin Baulig <martin@gnome.org>
17615 * expression.cs (Unary.TryReduceNegative): Added support for
17618 2002-06-08 Martin Baulig <martin@gnome.org>
17620 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17621 name can't be found in the `defined_names' - the caller will do a
17622 MemberLookup in this case and thus find methods in System.Enum
17623 such as Enum.IsDefined().
17625 2002-06-08 Martin Baulig <martin@gnome.org>
17627 * enum.cs (Enum.ChangeEnumType): This is a custom version of
17628 Convert.ChangeType() which works with TypeBuilder created types.
17629 (Enum.LookupEnumValue, Enum.Define): Use it here.
17631 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17632 `TypeBuilder.BaseType != null' check.
17633 (TypeContainer.FindMembers): Only lookup parent members if we
17634 actually have a parent.
17635 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17636 (ConstructorInitializer.Resolve): Likewise.
17638 * interface.cs (Interface.FindMembers): Added
17639 `TypeBuilder.BaseType != null' check.
17641 * rootcontext.cs (RootContext.ResolveCore): Added
17642 "System.Runtime.CompilerServices.IndexerNameAttribute" to
17643 classes_second_stage.
17645 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17646 debug_type and trace_type when compiling with --nostdlib.
17648 2002-06-07 Martin Baulig <martin@gnome.org>
17650 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17651 (AddField): Set it to true when adding a non-static field.
17652 (DefineType): Use `have_nonstatic_fields' to find out whether we
17653 have non-static fields, not `Fields != null'.
17655 2002-06-02 Miguel de Icaza <miguel@ximian.com>
17657 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17658 dereferencing a null on the static-field code path)
17660 2002-05-30 Martin Baulig <martin@gnome.org>
17662 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17663 to take command line arguments. Use reflection to call the new
17664 custom `Initialize' function on the symbol writer and pass it the
17665 command line arguments.
17667 * driver.cs (--debug-args): New command line argument to pass command
17668 line arguments to the symbol writer.
17670 2002-05-28 Miguel de Icaza <miguel@ximian.com>
17672 * assign.cs (DoResolve): Forgot to do the implicit conversion to
17673 the target type for indexers and properties. Thanks to Joe for
17676 2002-05-27 Miguel de Icaza <miguel@ximian.com>
17678 * typemanager.cs (MethodFlags): returns the method flags
17679 (Obsolete/ShouldIgnore) that control warning emission and whether
17680 the invocation should be made, or ignored.
17682 * expression.cs (Invocation.Emit): Remove previous hack, we should
17683 not do this on matching a base type, we should do this based on an attribute
17685 Only emit calls to System.Diagnostics.Debug and
17686 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17687 on the command line.
17689 * rootcontext.cs: Global settings for tracing and debugging.
17691 * cs-tokenizer.cs (define): New utility function to track
17692 defines. Set the global settings for TRACE and DEBUG if found.
17694 2002-05-25 Ravi Pratap <ravi@ximian.com>
17696 * interface.cs (Populate*): Pass in the TypeContainer as well as
17697 the DeclSpace as parameters so that we can create EmitContexts and
17698 then use that to apply attributes etc.
17700 (PopulateMethod, PopulateEvent, PopulateProperty)
17701 (PopulateIndexer): Apply attributes everywhere.
17703 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17706 (ApplyAttributes): Update accordingly.
17708 We now apply interface attributes for all members too.
17710 2002-05-26 Miguel de Icaza <miguel@ximian.com>
17712 * class.cs (Indexer.Define); Correctly check if we are explicit
17713 implementation (instead of checking the Name for a ".", we
17714 directly look up if the InterfaceType was specified).
17716 Delay the creation of the PropertyBuilder.
17718 Only create the PropertyBuilder if we are not an explicit
17719 interface implementation. This means that explicit interface
17720 implementation members do not participate in regular function
17721 lookups, and hence fixes another major ambiguity problem in
17722 overload resolution (that was the visible effect).
17724 (DefineMethod): Return whether we are doing an interface
17727 * typemanager.cs: Temporary hack until we get attributes in
17728 interfaces (Ravi is working on that) and we get IndexerName
17729 support in interfaces.
17731 * interface.cs: Register the indexers as properties.
17733 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17734 warning, I have verified that this is a bug in the .NET runtime
17735 (JavaScript suffers of the same problem).
17737 * typemanager.cs (MemberLookup): When looking up members for
17738 interfaces, the parent of an interface is the implicit
17739 System.Object (so we succeed in searches of Object methods in an
17740 interface method invocation. Example: IEnumerable x; x.ToString
17743 2002-05-25 Miguel de Icaza <miguel@ximian.com>
17745 * class.cs (Event): Events should also register if they do
17746 implement the methods that an interface requires.
17748 * typemanager.cs (MemberLookup); use the new GetInterfaces
17751 (GetInterfaces): The code used to lookup interfaces for a type is
17752 used in more than one place, factor it here.
17754 * driver.cs: Track the errors at the bottom of the file, we kept
17757 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17758 instance if the method we are calling is static!
17760 2002-05-24 Miguel de Icaza <miguel@ximian.com>
17762 * attribute.cs (ApplyAttributes): Make this function filter out
17763 the IndexerName attribute (as that attribute in reality is never
17764 applied) and return the string constant for the IndexerName
17767 * class.cs (TypeContainer.Emit): Validate that all the indexers
17768 have the same IndexerName attribute, and if so, set the
17769 DefaultName attribute on the class.
17771 * typemanager.cs: The return value might contain other stuff (not
17772 only methods). For instance, consider a method with an "Item"
17773 property and an Item method.
17775 * class.cs: If there is a problem with the parameter types,
17778 2002-05-24 Ravi Pratap <ravi@ximian.com>
17780 * ecore.cs (ImplicitConversionExists): Wrapper function which also
17781 looks at user defined conversion after making a call to
17782 StandardConversionExists - we need this for overload resolution.
17784 * expression.cs : Update accordingly the various method calls.
17786 This fixes 2 bugs filed against implicit user defined conversions
17788 2002-05-22 Miguel de Icaza <miguel@ximian.com>
17790 * statement.cs: Track the result of the assignment.
17792 2002-05-21 Miguel de Icaza <miguel@ximian.com>
17794 * expression.cs (MemberAccess): Improved error reporting for
17795 inaccessible members.
17797 2002-05-22 Martin Baulig <martin@gnome.org>
17799 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
17800 itself with debugging support.
17802 2002-05-22 Martin Baulig <martin@gnome.org>
17804 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17805 Removed, this isn't needed anymore.
17807 2002-05-20 Martin Baulig <martin@gnome.org>
17809 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17810 be underlying type for an enum.
17812 2002-05-20 Miguel de Icaza <miguel@ximian.com>
17814 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17815 that splits out the loading of just the core types.
17817 * rootcontext.cs (ResolveCore): Split the struct resolution in
17818 two, so we can load the enumeration underlying types before any
17821 * expression.cs (Is): Bandaid until we fix properly Switch (see
17822 bug #24985 for details).
17824 * typemanager.cs (ImplementsInterface): The hashtable will contain
17825 a null if there are no interfaces implemented.
17827 2002-05-18 Miguel de Icaza <miguel@ximian.com>
17829 * cs-parser.jay (indexer_declarator): It is fine to have array
17832 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17834 * typemanager.cs: (RegisterBuilder): New function used to register
17835 TypeBuilders that implement interfaces. Since
17836 TypeBuilder.GetInterfaces (as usual) does not work with lame
17838 (AddUserType): register interfaces.
17840 (ImplementsInterface): Use the builder_to_ifaces hash if we are
17841 dealing with TypeBuilder. Also, arrays are showing up as
17842 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17843 methods can not be invoked on them!
17845 * ecore.cs (ExplicitReferenceConversionExists): Made public.
17846 (ImplicitReferenceConversionExists): Split out from
17847 StandardConversionExists.
17849 * expression.cs (As): We were only implementing one of the three
17850 cases for the as operator. We now implement them all.
17851 (Is): Implement the various other cases for Is as well.
17853 * typemanager.cs (CACHE): New define used to control if we want or
17854 not the FindMembers cache. Seems to have a negative impact on
17855 performance currently
17857 (MemberLookup): Nested types have full acess to
17858 enclosing type members
17860 Remove code that coped with instance/static returns for events, we
17861 now catch this in RealFindMembers.
17863 (RealFindMembers): only perform static lookup if the instance
17864 lookup did not return a type or an event.
17866 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17868 * assign.cs (CompoundAssign): We pass more semantic information
17869 now to Compound Assignments than we did before: now we have all
17870 the information at hand, and now we resolve the target *before* we
17871 do the expression expansion, which allows the "CacheValue" method
17872 to have the effect we intended (before, a [x] += 1 would generate
17873 two differen ArrayAccess expressions from the ElementAccess,
17874 during the resolution process).
17876 (CompoundAssign.DoResolve): Resolve target and original_source here.
17878 2002-05-16 Miguel de Icaza <miguel@ximian.com>
17880 * expression.cs (ArrayAccess): dropped debugging information.
17882 * typemanager.cs: Small bug fix: I was always returning i_members,
17883 instead of one of i_members or s_members (depending on which had
17886 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
17887 method is invoked before any code generation takes place, and it
17888 is a mechanism to inform that the expression will be invoked more
17889 than once, and that the method should use temporary values to
17890 avoid having side effects
17892 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17894 * ecore.cs (Expression.CacheTemporaries): Provide empty default
17897 * expression.cs (Indirection, ArrayAccess): Add support for
17898 CacheTemporaries in these two bad boys.
17900 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17901 ldobj or ldind_ref.
17902 (StoreFromPtr): Handle stobj as well.
17904 * expression.cs (UnaryMutator): Share more code.
17906 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17907 down: I was not tracking the Filter function as well, which
17908 was affecting the results of the cache.
17910 2002-05-15 Miguel de Icaza <miguel@ximian.com>
17912 * attribute.cs: Remove the hack to handle the CharSet property on
17915 2002-05-14 Miguel de Icaza <miguel@ximian.com>
17917 * attribute.cs (DoResolve): More uglyness, we now only try to
17918 resolve the attribute partially, to extract the CharSet
17919 information (only if we are a StructLayout attribute). Otherwise
17921 (GetExtraTypeInfo): Add some code to conditionally kill in the
17922 future this. I am more and more convinced that the .NET
17923 framework has special code to handle the attribute setting on
17926 * expression.cs (IsParamsMethodApplicable): Revert my previous
17927 foreach change here, it was wrong.
17929 2002-05-13 Miguel de Icaza <miguel@ximian.com>
17931 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17932 (pp_expr): do not abort on unknown input, just return.
17933 (eval): abort if there are pending chars.
17935 * attribute.cs (Attribute.Resolve): Positional parameters are
17936 optional. Deal with that case.
17938 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17939 the Ansi/Unicode/Auto information for the type.
17941 (TypeContainer.DefineType): instantiate the EmitContext here, as
17942 we will be using it during the type definition (to resolve
17943 attributes) and during the emit phase.
17945 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17946 to pull type information out of the attributes
17948 (Attribute.Resolve): track the constructor builder, and allow for
17949 multiple invocations (structs and classes will use this).
17951 * ecore.cs (MemberLookupFinal): new version with all the
17952 parameters customizable.
17954 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17955 constructors. Return if the result value is null (as the error
17956 would have been flagged already by MemberLookupFinal)
17958 Do not allow instances of abstract classes or interfaces to be
17961 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17962 We have to compare the assembly property here when dealing with
17963 FamANDAssem and Assembly access modifiers, because we might be
17964 creating an assembly from *modules* (that means that we are not
17965 getting TypeBuilders for types defined in other modules that are
17966 part of this assembly).
17968 (Method.Emit): If the method is marked abstract and has a body,
17971 (TypeContainer.DefineMembers): If both the defined member and the
17972 parent name match are methods, then do not emit any warnings: let
17973 the Method.Define routine take care of flagging warnings. But if
17974 there is a mismatch (method overrides something else, or method is
17975 overriwritten by something, then emit warning).
17977 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17978 set to null, this means `do not check for the return type on the
17981 (Method.Define): set the return type for the method signature to
17982 null, so that we get methods with the same name and parameters and
17983 different return types. This is used to flag warning 114 (you are
17984 hiding a method, and you probably want to use the new/override
17987 * typemanager.cs (MemberLookup): Implemented proper access
17988 control, closing a long standing set of bug reports. The problem
17989 was that the Framework only has two bits: Public and NonPublic,
17990 and NonPublic includes private and protected methods, but we need
17991 to enforce the FamANDAssem, FamOrAssem and Family.
17993 2002-05-11 Miguel de Icaza <miguel@ximian.com>
17995 * statement.cs (GotoCase): Return true: Ammounts to giving up
17996 knowledge on whether we return or not, and letting the other case
17997 be responsible for it.
17999 2002-05-10 Miguel de Icaza <miguel@ximian.com>
18001 * driver.cs: Do not load directories for each file processed, only
18002 do it if there is a pattern.
18004 * ecore.cs: Report readonly assigns here as well, as we might have
18005 been resolved only by MemberAccess.
18007 (SimpleName.SimpleNameResolve): Also be useful for LValue
18008 resolution. We need this to propagate assign to local readonly variables
18010 * typemanager.cs: Use a ptrhashtable for the criteria, because we
18011 do not want to reuse potential criteria memory.
18013 * class.cs (MyEventBuilder): Set reflected_type;
18015 * ecore.cs (Constantify): Added support for constifying bools.
18017 (RootContext.LookupType): Added a cache for values looked up in
18018 the declaration space.
18020 * typemanager.cs (FindMembers): Now is a front-end to
18021 RealFindMembers, and provides a two-level hashtable-based cache to
18024 15% performance improvement: from 22.5 to 19.2 seconds.
18026 * expression.cs (IsParamsMethodApplicable): use foreach.
18027 (Invocation.DoResolve): ditto.
18028 (New.DoResolve): ditto.
18029 (ArrayCreation.DoResolve): ditto.
18031 * ecore.cs (FindMostEncompassingType): use foreach.
18033 * delegate.cs (NewDelegate.DoResolve): Use foreach
18035 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18036 (RemoveMethods): use foreach.
18038 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18039 nested foreach statements instead of for, and also break out of
18040 the inner loop once a match is found.
18042 (Invocation.OverloadResolve): Use foreach, simplify the code.
18044 2002-05-08 Miguel de Icaza <miguel@ximian.com>
18046 * cfold.cs (BinaryFold): During an enumeration evaluation context,
18047 we actually unwrap the expression to allow for extra information
18050 * expression.cs: Use Shr_Un on unsigned operations.
18052 2002-05-08 Ravi Pratap <ravi@ximian.com>
18054 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
18055 applicable operators was not being considered correctly. This closes
18056 the bug Miguel reported.
18058 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18060 * attribute.cs: check that the type derives from System.Attribute
18061 and report the correct error in that case (moved the duplicate code to
18062 its own method, too).
18064 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18066 * attribute.cs: lookup attribute type name as the spec says: first the
18067 bare attribute name and then name + "Attribute" (nant compiles with
18068 mcs after this fix).
18070 2002-05-07 Miguel de Icaza <miguel@ximian.com>
18072 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
18073 Because of the way we parse things, we should try to see if a
18074 UIntConstant can fit in an integer.
18076 2002-05-07 Ravi Pratap <ravi@ximian.com>
18078 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18079 when we are in an explicit context.
18081 (ConvertReferenceExplicit): When converting from Iface type S to Class
18082 T make sure the rules are implemented as an OR.
18084 * parameter.cs (ParameterType): Make it a property for now although the
18085 purpose really isn't anything immediate.
18087 * expression.cs (Is*Applicable): Do better checking on the parameter type
18088 of a ref/out parameter. The ones from the system assemblies are already
18089 marked with the correct type so we don't need to do any correction.
18091 * ecore.cs (StandardConversionExists): Conversion from Interface types to
18092 the object type is standard too so include that.
18094 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18096 * ecore.cs (StandardConversionExists): Augment with missing code:
18097 deal with IntConstant, LongConstants and Enumerations.
18099 * assign.cs: Report the error, instead of failing silently
18101 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18102 typecontainer that they are declared, because the
18103 typecontainer/namespace will have the list of using clauses that
18104 need to be applied.
18106 Assembly Attributes were escaping the normal registration
18109 (EmitCode): Apply attributes within an EmitContext that represents
18110 the container they were declared on.
18112 * cs-parser.jay: Track bases for structs. How did I get this wrong?
18114 2002-05-06 Ravi Pratap <ravi@ximian.com>
18116 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18117 Revamp completely - make much cleaner as we now operate only
18120 (FindMostSpecificSource, FindMostSpecificTarget): New methods
18121 to implement the logic detailed in the spec more correctly.
18123 (UserDefinedConversion): Update accordingly.
18125 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18127 * statement.cs: Return flow analysis information up.
18129 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18132 (token): Do not consume an extra character before calling
18135 2002-05-06 Piers Haken <piersh@friskit.com>
18137 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18139 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18141 * class.cs (Constructor.Emit): Set the IsStatic flag in the
18142 EmitContext during the instance constructor initializer
18143 resolution, to stop access to instance variables.
18145 This is mandated by the spec, last paragraph of the `constructor
18146 initializers' section.
18148 2002-05-05 Miguel de Icaza <miguel@ximian.com>
18150 * cs-parser.jay, class.cs (Accessor): new class used to represent
18151 an accessor (get or set). In the past we used `null' to represent
18152 a missing accessor. But this is ambiguous because there was no
18153 way to tell in abstract indexers/properties if one of them was
18156 Now there is a way of addressing that.
18158 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18159 instead of FindMembers.
18161 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18162 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18164 * attribute.cs: Treat indexers and properties as the same in terms
18165 of applying attributes
18167 * ecore.cs (FindMostEncompassedType): Use statically initialized
18168 EmptyExpressions()s like we do elsewhere to avoid creating useless
18169 objects (and we take this out of the tight loop).
18171 (GetConversionOperators): Move the code to extract the actual
18172 operators to a separate routine to clean things up.
18174 2002-05-04 Miguel de Icaza <miguel@ximian.com>
18176 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18177 events are always registered FieldBuilders.
18179 * class.cs (FieldBase): New class shared by Fields
18181 * delegate.cs: If we are a toplevel delegate, use our full name.
18182 If we are a nested delegate, then only use our tail name.
18184 2002-05-02 Ravi Pratap <ravi@ximian.com>
18186 * expression.cs (IsApplicable): Ensure that we add the "&" to
18187 ref/out types before comparing it with the type of the argument.
18189 (IsParamsMethodApplicable): Ditto.
18191 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
18194 * delegate.cs : Handle the case when we have more than one applicable
18195 method. Flag an error only when we finish checking all.
18197 2002-05-02 Miguel de Icaza <miguel@ximian.com>
18199 * expression.cs: Add support for boolean static initializers.
18201 2002-05-01 Miguel de Icaza <miguel@ximian.com>
18203 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18205 * parameter.cs (ComputeParameterTypes,
18206 ComputeAndDefineParameterTypes): Better error handling: now we
18207 clear the `types' cache if we fail during any of the type lookups.
18208 We also return the status code correctly to our caller
18210 * delegate.cs: If we fail to define a delegate, abort the extra
18213 * expression.cs (Binary.ResolveOperator): for
18214 operator==(object,object) and operator !=(object, object) we also
18215 have to verify that there is an implicit conversion from one to
18218 (ArrayAccess.DoResolve): Array Access can operate on
18221 2002-04-30 Miguel de Icaza <miguel@ximian.com>
18223 * assign.cs (CompoundAssign): A new class used as a "flag" that
18224 the assignment actually is happening as part of a compound
18225 assignment operator.
18227 During compound assignment, a few new rules exist to enable things
18234 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18235 to the type of x) if y is implicitly convertible to the type of x,
18236 and the operator is a builtin operator and the return type of the
18237 operator is explicitly convertible to the type of x.
18239 * rootcontext.cs: Reset warning level to 2. 4 catches various
18240 "interesting" features in mcs, we must clean this up at some
18241 point, but currently am trying to kill other bugs ;-)
18243 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18244 in container classes as well.
18246 * expression.cs (Binary.ResolveOperator): Handle string case
18247 before anything else (as operator overloading does emit an error
18248 before doing anything else).
18250 This code could go away when we move to a table driven model, but
18251 i could not come up with a good plan last night.
18253 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
18255 * typemanager.cs (CSharpName): reimplementation using regex.
18256 * class.cs: added null check for fields in Emit
18257 * rootcontext.cs: set warninglevel to 4
18259 2002-04-29 Miguel de Icaza <miguel@ximian.com>
18261 * typemanager.cs (CSharpName): reimplemented with Lupus
18264 2002-04-28 Miguel de Icaza <miguel@ximian.com>
18266 * statement.cs (If): correclty implement Resolve, because we were
18267 not catching sem errors in there. The same process is needed
18269 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18272 (Statement.Warning_DeadCodeFound): Factorize code.
18273 (While): Report dead code here too.
18275 (Statement): Added Resolve virtual method to allow
18276 for resolution split from the emit code.
18278 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18280 * statement.cs (EmitBoolExpression): No longer try to resolve the
18282 (MakeBoolean): New utility function that resolve, implicitly
18283 converts to boolean and tags the expression.
18286 (If, Do): Implement dead code elimination.
18287 (While): Implement loop inversion
18289 (Do, While, For, If): Resolve the expression prior to calling our
18292 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
18295 - added method Report28 (warning: program has more than one entry point)
18296 - added method IsEntryPoint, implements paragraph 10.1 of the spec
18297 - modified method Method.Define, the part at the end of the method
18299 * rootcontext.cs: added static public Location EntryPointLocation;
18301 * ../errors/cs0028.cs : Add test case for the above warning.
18304 - modified method CSharpName to allow arrays of primitive type to
18305 be printed nicely (e.g. instead of System.Int32[][] it now prints
18307 - added method CSharpSignature: returns the signature of a method
18308 in string format to be used in reporting errors, warnings, etc.
18310 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18313 2002-04-26 Ravi Pratap <ravi@ximian.com>
18315 * delegate.cs (Define): Fix extremely silly bug where I was
18316 setting the type of the 'object' parameter of the BeginInvoke
18317 method to System.IAsyncResult instead of System.Object ;-)
18319 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18321 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18324 (Constructor.Emit): return if we fail to initialize the
18325 constructor. Another door closed!
18327 * expression.cs (New.DoResolve): Improve error message (from -6 to
18328 1501). Use DeclaredOnly lookup to find the exact constructor.
18330 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18331 loop. This is useful.
18333 * cs-parser.jay: Adjust the default parameters so that destructors
18334 have the proper signature.
18336 2002-04-26 Martin Baulig <martin@gnome.org>
18338 * driver.cs (LoadAssembly): If `assembly' contains any characters
18339 which are only valid in path names and not in assembly names
18340 (currently slash, backslash and point), use Assembly.LoadFrom ()
18341 instead of Assembly.Load () on the `assembly' (before iteration
18342 over the link_paths).
18344 2002-04-26 Martin Baulig <martin@gnome.org>
18346 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18348 2002-04-25 Miguel de Icaza <miguel@ximian.com>
18350 * class.cs (Property): use the new typemanager.MemberLookup
18352 (TypeContainer.MemberLookup): Implement using the
18353 TypeManager.MemberLookup now.
18355 * typemanager.cs: Make MemberLookup a function of the TypeManager,
18356 and return MemberInfos, so that these can be used without an
18357 EmitContext (what we had before).
18359 2002-04-24 Miguel de Icaza <miguel@ximian.com>
18361 * expression.cs: Fix the case where the argument to params if the
18362 type of the params. I omitted handling this before. Fixed
18364 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18366 * driver.cs: Call BootCorlib_PopulateCoreType
18368 * class.cs (Property.CheckBase): Check for properties only, not
18371 * interface.cs: Temporary hack: try/catch around the
18372 CustomAttributeBuilder, because I am getting an exception that I
18375 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18376 types whose definitions are required to be there (attributes are
18377 defined before standard types).
18379 Compute definitions as we boot the various types, as they are used
18380 immediately (value_type class will need object_type, but if we do
18381 not initialize object_type, we will pass a null, which will let
18382 the runtime pick the System.Object from the existing corlib, which
18383 is not what we want).
18385 2002-04-22 Patrik Torstensson <totte@labs2.com>
18387 * cs-tokenizer.cs: fixed a number of trim() issues.
18389 2002-04-22 Ravi Pratap <ravi@ximian.com>
18391 * expression.cs (Argument.Type): Ensure that we return the correct
18392 type when we have out or ref parameters [in which case we
18395 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18397 * class.cs (Property, Indexer): Allow extern modifier in there.
18399 * typemanager.cs (InitBaseTypes): Initializes object_type and
18400 value_type, since those will be used early on during the bootstrap
18401 process to compile corlib.
18403 (InitCoreTypes): Move code from here to InitBaseTypes.
18405 2002-04-21 Miguel de Icaza <miguel@ximian.com>
18407 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18408 single-dimension arrays as using the ldlen opcode.
18410 Daniel Lewis discovered this optimization.
18412 * typemanager.cs: Add signature for System.Array::get_Length
18414 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18416 * statement.cs: report the error when the foreach does not apply to an
18417 array nor a collection.
18419 2002-04-19 Miguel de Icaza <miguel@ximian.com>
18421 * expression.cs: Add implicit conversions to the operator ~.
18423 * constant.cs (DecimalConstant.Emit): Emit decimal value.
18425 * typemanager.cs: Locate the decimal constructor.
18427 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18429 * attribute.cs: use the new property of TypeOf.
18430 * expression.cs: added 'get' property around typearg.
18432 These changes fix a build breaker reported by NickD. Is this the
18433 correct way to fix? If not, please, revert my changes and make it
18436 2002-04-17 Miguel de Icaza <miguel@ximian.com>
18438 * attribute.cs: Add support for typeof in attribute invocations.
18439 I am not sure that this is right though.
18441 2002-04-14 Duncan Mak <duncan@ximian.com>
18443 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18444 Binary.Operator.Division case.
18446 2002-04-13 Ravi Pratap <ravi@ximian.com>
18448 * class.cs (DefineType): Ensure that we do a proper check on
18449 attribute types and also register it with the TypeManager.
18451 (TypeContainer.Targets): The default for attribute types is
18452 AttributeTargets.All.
18454 * attribute.cs (ApplyAttributes): Registering the attribute type
18455 is done elsewhere, not when we discover we have a Usage attribute.
18457 2002-04-12 Ravi Pratap <ravi@ximian.com>
18459 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18460 and get rid of is_delegate parameter.
18462 * everywhere : update.
18464 2002-04-12 Ravi Pratap <ravi@ximian.com>
18466 * cs-parser.jay (compilation_unit): Revamp completely to use
18467 some new ideas that I got from Rhys' grammar to solve the problems
18468 with assembly level attributes.
18470 (outer_declaration): New grammar production.
18472 (attribute_sections): Add.
18474 (opt_attributes): Base on attribute_sections
18476 (namespace_declaration): Allow opt_attributes to tackle the case
18477 when we have assembly level attributes - we are clever in this
18480 * attribute.cs (ApplyAttributes): Do not worry about assembly
18481 attributes in the non-global context.
18483 * rootcontext.cs (AddGlobalAttributes): Go back to using this
18484 instead of SetGlobalAttributes.
18486 * class.cs, rootcontext.cs : Ensure we define and generate
18487 attribute types before anything else.
18489 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18490 and flag the new error -20 for the case when the attribute type
18491 does not have valid targets specified. csc does not catch this.
18493 * ../errors/errors.txt : update for error # -20
18495 2002-04-11 Ravi Pratap <ravi@ximian.com>
18497 * support.cs (InternalParameters.ParameterModifier): Do some null
18498 checking and return sane values.
18500 * class.cs (Method.Define): If we are a PInvoke method, ensure
18501 that we are static and extern. Report error # 601
18503 * ../errors/cs0601.cs : Add test case for the above error.
18505 2002-04-07 Ravi Pratap <ravi@ximian.com>
18507 * rootcontext.cs (attribute_types): We need to keep type of
18508 all attribute types separately and emit code for them first.
18510 (RegisterAttribute) : Implement.
18512 * class.cs (DefineType): Check if the current Type is a custom
18513 attribute type and register it accordingly.
18515 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18516 adding the first attribute twice and rename to
18518 (SetGlobalAttributes): this.
18520 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18523 * attribute.cs (ApplyAttributes): Take an additional argument telling us
18524 if we are processing global arguments. Hmm, I am unsure of this.
18526 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18528 * expression.cs: added static array of strings to avoid calling
18529 Enum.ToString () for Operator in Binary. Significant recover of
18532 2002-04-10 Miguel de Icaza <miguel@ximian.com>
18534 * class.cs (FindMembers): Allow the Builders of the various
18535 members to be null. If they are skip them. This only happens
18536 during the PInvoke declaration.
18538 2002-04-09 Miguel de Icaza <miguel@ximian.com>
18540 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18541 failure, so we do not keep going afterwards.
18543 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18544 wanted to pass `false' as the `is_delegate' argument. If this is
18545 the case, why not use delegate_type == null to mean `is_delegate =
18546 false' and anything else as is_delegate = true.
18548 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
18550 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18551 code for the section, not the beginning of the tests.
18553 2002-04-08 Miguel de Icaza <miguel@ximian.com>
18555 * cfold.cs: Handle operator + (Enum x, Underlying x)
18557 * expression.cs (Binary): same. Warn about errors where we have
18558 Enum/Enum in operator + as well.
18560 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
18563 - added support for switch(bool)
18564 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18565 - add TableSwitchEmit() to handle table-based switch statements
18567 2002-04-05 Ravi Pratap <ravi@ximian.com>
18569 * expression.cs (Invocation.OverloadResolve): Factor out code which
18570 does parameter compatibility checking with arguments so that we can
18571 re-use the code even from Delegate.VerifyApplicability
18573 (VerifyArgumentsCompat): Move above code here.
18575 * delegate.cs (VerifyApplicability): Get rid of duplicate code
18576 and instead make a call to the above method.
18578 2002-03-31 Ravi Pratap <ravi@ximian.com>
18580 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18581 We use it to keep track of classes which are attribute types.
18583 2002-04-02 Miguel de Icaza <miguel@ximian.com>
18585 * delegate.cs (Delegate.Define): Correctly define the types in the
18586 presence of fixed and array parameters.
18588 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18591 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18592 include NonPublic after the first iteration.
18594 * class.cs (Indexer.CheckBase): Only check if both parents are
18597 * cs-parser.jay (accessor_body): If empty, set to null.
18599 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18600 same code path here to resolve constants names that we did have in
18601 MemberAccess.DoResolve. There is too much code duplicated here.
18603 2002-04-01 Miguel de Icaza <miguel@ximian.com>
18605 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18607 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18610 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18611 tokens, numbers and strings.
18613 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18616 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18617 asyncronous parameters and the regular parameters.
18619 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18620 specify the target directory.
18622 * expression.cs: (This.DoResolve): Simplify
18623 (As.Emit): Optimize, do not generate IsInst if the expression is
18624 always of the given type.
18626 (Is.DoResolve): Bug fix, we were reporting both always/never for
18629 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18630 creating too many unnecessary arrays.
18632 2002-03-31 Miguel de Icaza <miguel@ximian.com>
18634 * class.cs (EmitFieldInitializer): Use Assign expression to assign
18635 fields instead of rolling our own initializer. Takes care of all
18636 implicit conversions, and drops unnecessary static checks/argument.
18638 2002-03-31 Dick Porter <dick@ximian.com>
18640 * driver.cs: use the GetDirectories() return values properly, and
18641 use "/" as path separator.
18643 2002-03-30 Miguel de Icaza <miguel@ximian.com>
18645 * expression.cs (Unary): Optimize - - expr into expr.
18646 (Binary): Optimize a + (-b) into a -b.
18648 * codegen.cs (CodeGen): Made all methods static.
18650 2002-03-29 Miguel de Icaza <miguel@ximian.com>
18654 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18655 TypeBuilder property.
18657 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18660 * tree.cs: Removed the various RecordXXXX, and replaced with a
18661 single RecordDecl. Removed all the accessor methods, and just
18662 left a single access point Type
18664 * enum.cs: Rename DefineEnum to DefineType.
18666 * decl.cs: New abstract method `DefineType' used to unify the
18667 Defines for Enumerations, Interfaces, TypeContainers and
18670 (FindType): Moved LookupInterfaceOrClass here. Moved the
18671 LookupBaseClasses method that used to live in class.cs and
18672 interface.cs here, and renamed to FindType.
18674 * delegate.cs: Implement DefineType. Take advantage of the
18675 refactored pattern for locating the parent builder without taking
18676 the parent_builder argument (which we know does not work if we are
18677 nested, and triggering a toplevel definition).
18679 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18681 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18682 accessibility of a member has changed during override and report
18685 * class.cs (Method.Define, Property.Define): Only complain on
18686 overrides if the method is private, any other accessibility is
18687 fine (and since we just checked the permission is the same, we are
18690 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18691 and elif are processed always. The other pre-processing
18692 directives are only processed if we are "taking" the path
18694 2002-03-29 Martin Baulig <martin@gnome.org>
18696 * class.cs (Method.Emit): Only emit symbolic debugging info if the
18697 current location is not Null.
18699 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18700 a separate method so we can profile it.
18702 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18703 `span.Seconds' are just seconds, but no minutes or hours.
18704 (MainDriver): Profile the CodeGen.SaveSymbols calls.
18706 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18708 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18709 Remove the gratuitous set of Final:
18711 // If an interface implementation, then we can set Final.
18712 if (((flags & MethodAttributes.Abstract) == 0) &&
18713 implementing.DeclaringType.IsInterface)
18714 flags |= MethodAttributes.Final;
18716 I do not know what I was smoking when I used that.
18719 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18720 step into fixing the name resolution issues for delegates and
18721 unifying the toplevel name resolution.
18723 2002-03-28 Martin Baulig <martin@gnome.org>
18725 * class.cs (Method.Emit): If we have a symbol writer, call its
18726 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18727 tell it about the current method.
18729 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18730 writer that we're going to emit the first byte of IL code for a new
18731 statement (a new source line).
18732 (EmitContext.EmitTopBlock): If we have a symbol writer, call
18733 EmitContext.Mark() before emitting any code.
18735 * location.cs (SymbolDocument): Return null when we're Null.
18737 * statement.cs (Statement): Moved the `Location loc' variable here.
18738 (Statement.EmitBoolExpression): If we have a symbol writer, call
18739 ec.Mark() before emitting any code to tell it that we're at the
18740 beginning of a new statement.
18741 (StatementExpression): Added `Location' argument to the constructor.
18742 (Block): Added public readonly variable `StartLocation' and public
18743 variable `EndLocation'. The latter is to be set using SetEndLocation().
18744 (Block): Added constructor which takes a start and end location.
18745 (Block.SetEndLocation): New method. This sets the end location.
18746 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18747 local variables we create.
18748 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18749 each statement and do also mark the begin and end of the block.
18751 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18752 tell it the current lexer.Location, use Location.Null for the end of the
18754 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18755 current block, set its end location using SetEndLocation().
18756 (statement_expression): StatementExpression constructor now takes the
18757 lexer.Location as additional argument.
18758 (for_statement, declare_local_variables): Likewise.
18759 (declare_local_variables): When creating a new implicit block, use the
18760 new Block constructor and pass it the lexer.Location.
18762 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18764 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18765 members also on the parent interfaces recursively.
18767 2002-03-27 Miguel de Icaza <miguel@ximian.com>
18769 * report.cs: Use new formats, since Gonzalo finished the missing
18772 * expression.cs (Binary.ResolveOperator): added missing operator|
18773 operator& and operator^ for bool/bool.
18775 * cs-parser.jay: CheckDef now takes a Location argument that is
18776 used to report errors more precisly (instead of reporting the end
18777 of a definition, we try to track something which is a lot closer
18778 to the source of the problem).
18780 * cs-tokenizer.cs: Track global token use, so we can properly flag
18781 the use of #define/#undef after the first token has been seen.
18783 Also, rename the reportXXXX to Error_DescriptiveName
18785 * decl.cs (DeclSpace.IsTopLevel): Move property here from
18786 TypeContainer, so that Enum and Interface can use this too.
18788 * class.cs (TypeContainer.LookupInterfaceOrClass,
18789 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18790 `builder' argument. Typically this was used to pass the parent
18791 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18794 The problem is that a nested class could trigger the definition of
18795 a toplevel class, and the builder would be obviously wrong in that
18798 So we drop this argument, and we compute dynamically the
18799 TypeBuilder/ModuleBuilder (the correct information was available
18800 to us anyways from DeclSpace.Parent)
18802 * interface.cs (Interface.DefineInterface): Drop builder
18803 parameter cleanup like class.cs
18805 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
18808 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18811 (Try.Emit): Propagate the returns value from the statement.
18813 (Return.Emit): Even if we are leavning
18815 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18817 * modifiers.cs: Fix the computation of MethodAttributes flags.
18819 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18821 * driver.cs: allow compilation of files that start with '/'.
18822 Add a default case when checking the argument of --target.
18824 2002-03-25 Miguel de Icaza <miguel@ximian.com>
18826 * interface.cs: Implement the same search algorithm for types in
18827 the interface code.
18829 * delegate.cs: Do not allow multiple definition.
18831 * Recovered ChangeLog that got accidentally amputated
18833 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18835 * rootcontext.cs: Load manually enum to allow core classes to
18836 contain enumerations.
18838 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18839 Update to new static methods in TypeManager.
18841 * typemanager.cs (GetMethod, GetConstructor): Use our
18842 implementation of FindMembers to find the members, since during
18843 corlib compilation, the types are TypeBuilders and GetMethod and
18844 GetConstructor do not work.
18846 Make all methods in TypeManager static.
18848 (InitCodeHelpers): Split the functionality from
18849 the InitCodeTypes function.
18851 * driver.cs: Call InitCodeHelpers after we have populated the
18854 * cs-parser.jay (delegate_declaration): we did not used to compute
18855 the delegate name correctly for void delegates.
18857 2002-03-24 Miguel de Icaza <miguel@ximian.com>
18859 * rootcontext.cs (RootContext): Init the interface_resolve_order
18860 and type_container_resolve_order always.
18862 (ResolveCore, BootstrapCorlib_ResolveClass,
18863 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18864 compiler when compiling with --nostdlib
18866 * class.cs (TypeContainer.DefineType): Check that our parent is
18867 not null. This test is most important when we are bootstraping
18870 * codegen.cs: Split out the symbol writing code.
18872 2002-03-25 Martin Baulig <martin@gnome.org>
18874 * driver.cs (-g): Made -g an alias for --debug.
18876 2002-03-24 Martin Baulig <martin@gnome.org>
18878 * codegen.cs (SymbolWriter): New public variable. Returns the
18879 current symbol writer.
18880 (CodeGen): Added `bool want_debugging_support' argument to the
18881 constructor. If true, tell the ModuleBuild that we want debugging
18882 support and ask it for the ISymbolWriter.
18883 (Save): If we have a symbol writer, call it's Close() method after
18884 saving the assembly.
18886 * driver.c (--debug): New command line argument to create a
18887 debugger information file.
18889 * location.cs (SymbolDocument): New public property. Returns an
18890 ISymbolDocumentWriter object for the current source file or null
18891 if we don't have a symbol writer.
18893 2002-03-21 Miguel de Icaza <miguel@ximian.com>
18895 * driver.cs (LoadAssembly): Correctly return when all the paths
18896 have been tried and not before.
18898 * statement.cs (Switch.Emit): return the actual coverage for this
18899 statement (returns/not-returns)
18901 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18902 switch of the statement if we are the last switch section. That
18903 kills two problems: try/catch problems (we used to emit an empty
18904 nop at the end) and switch statements where all branches would
18907 2002-03-19 Miguel de Icaza <miguel@ximian.com>
18909 * driver.cs: Add default assemblies (the equivalent to the
18910 Microsoft CSC.RSP file)
18912 * cs-tokenizer.cs: When updating `cols and setting it to zero,
18913 also update tokens_seen and set it to false.
18915 * driver.cs: Implement --recurse for Mike.
18917 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18918 correctly splitting out the paths.
18920 2002-03-18 Miguel de Icaza <miguel@ximian.com>
18922 * interface.cs (Interface.PopulateProperty): Instead of using
18923 `parent' as the declaration space for the set parameters, use
18926 * support.cs (InternalParameters): InternalParameters constructor
18927 takes a DeclSpace instead of a TypeContainer.
18929 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18930 types are being initialized, load the address of it before calling
18933 (New): Provide a mechanism to disable the generation of local
18934 value type temporaries when the caller will be providing us with
18935 an address to store it.
18937 (ArrayCreation.EmitDynamicInitializers): Use it.
18939 2002-03-17 Miguel de Icaza <miguel@ximian.com>
18941 * expression.cs (Invocation.EmitArguments): Only probe for array
18942 property if there is more than one argument. Sorry about that.
18944 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18945 empty param arrays.
18947 * class.cs (Method.LabelParameters): Fix incorrect code path that
18948 prevented the `ParamArrayAttribute' from being applied to the
18951 2002-03-16 Miguel de Icaza <miguel@ximian.com>
18953 * support.cs (ReflectionParameters): Correctly compute whether the
18954 last argument is a params array. Fixes the problem with
18957 * typemanager.cs: Make the assemblies array always be non-null
18958 (empty, but non-null)
18960 * tree.cs (RecordDecl): New function that abstracts the recording
18961 of names. This reports error 101, and provides a pointer to the
18962 previous declaration. Fixes a crash in the compiler.
18964 * cs-parser.jay (constructor_declaration): Update to new grammar,
18965 and provide a constructor_body that can be empty.
18967 2002-03-15 Miguel de Icaza <miguel@ximian.com>
18969 * driver.cs: Add support for --resources.
18971 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18972 Make all types for the various array helper methods be integer.
18974 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18975 CheckState to ConvCast.
18977 (ConvCast): Now it takes a `checked' state argument, to avoid
18978 depending on the emit context for the conversion, and just using
18979 the resolve time setting.
18981 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18982 instead of Invocation.EmitArguments. We do not emit the original
18983 arguments, instead we emit those which have been converted to
18984 unsigned int expressions.
18986 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18988 * codegen.cs: ditto.
18990 * expression.cs (LocalVariableReference): Drop the use of the
18991 Store function that depended on the variable index.
18993 * statement.cs (VariableInfo): Drop the `Idx' property from this
18994 class, as this is not taking into account the indexes for
18995 temporaries tat we generate during the execution, getting the
18998 * class.cs: First emit class initializers, then call the parent
19001 * expression.cs (Binary): Fix opcode emision.
19002 (UnaryMutator.EmitCode): Support checked code generation
19004 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19005 matches for events for both the Static and Instance scans,
19006 pointing to the same element. Fix that.
19008 2002-03-14 Miguel de Icaza <miguel@ximian.com>
19010 * rootcontext.cs (ResolveTree): Always set the
19011 interface_resolve_order, because nested interfaces will be calling
19014 * class.cs (GetInterfaceOrClass): Track the same resolution
19015 process used by TypeManager.LookupType. This fixes the nested
19016 type lookups in class declarations (separate path from
19019 (TypeContainer.DefineType): Also define nested interfaces.
19020 (TypeContainer.RegisterOrder): New public function used to
19021 register the order in which child interfaces need to be closed.
19023 Nested interfaces need to be closed after their parents have been
19026 * interface.cs (InterfaceAttr): Put all the logic for computing
19027 the interface attribute here.
19029 (DefineInterface): Register our interface order with the
19030 RootContext or with the TypeContainer depending on the case.
19032 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19034 * cs-parser.jay: rework foreach statement to work with the new
19035 changes to the policy on SimpleNames.
19037 * report.cs: support Stacktrace on warnings as well.
19039 * makefile: drop --unsafe and /unsafe from the compile.
19041 2002-03-13 Ravi Pratap <ravi@ximian.com>
19043 * ecore.cs (StandardConversionExists): Modify to take an Expression
19044 as the first parameter. Ensure we do null -> reference type conversion
19047 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19048 temporary Expression objects.
19050 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19052 * interface.cs: workaround bug in method overloading resolution
19053 (there is already a bugzilla bug for it).
19055 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19057 We could also solve this problem by having a separate path for
19058 performing type lookups, instead of DoResolve, we could have a
19059 ResolveType entry point, and only participating pieces of the
19060 production (simplename, deref, array) would implement this.
19062 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19063 signal SimpleName to only resolve type names and not attempt to
19064 resolve anything else.
19066 * expression.cs (Cast): Set the flag.
19068 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19070 * class.cs: Only report 108 if there is no `new' modifier.
19072 * cs-parser.jay: rework foreach statement to work with the new
19073 changes to the policy on SimpleNames.
19075 * report.cs: support Stacktrace on warnings as well.
19077 * makefile: drop --unsafe and /unsafe from the compile.
19079 2002-03-11 Miguel de Icaza <miguel@ximian.com>
19081 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19082 lookups here, instead of doing that at parse time. This means
19083 that our grammar will not introduce `LocalVariableReferences' as
19084 expressions at this point. That solves the problem of code like
19088 static void Main ()
19092 This is only half the fix. The full fix requires parameters to
19093 also be handled in this way.
19095 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19096 makes the use more obvious of the DeclSpace. The
19097 ec.TypeContainer.TypeBuilder is now only used to pull the
19098 TypeBuilder for it.
19100 My theory is that I can get rid of the TypeBuilder completely from
19101 the EmitContext, and have typecasts where it is used (from
19102 DeclSpace to where it matters).
19104 The only pending problem is that the code that implements Aliases
19105 is on TypeContainer, and probably should go in DeclSpace.
19107 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19108 lookups here, instead of doing that at parse time. This means
19109 that our grammar will not introduce `LocalVariableReferences' as
19110 expressions at this point. That solves the problem of code like
19114 static void Main ()
19118 This is only half the fix. The full fix requires parameters to
19119 also be handled in this way.
19121 * class.cs (Property.DefineMethod): When implementing an interface
19122 method, set newslot, when implementing an abstract method, do not
19123 set the flag (before we tried never setting it, or always setting
19124 it, which is the difference).
19125 (Indexer.DefineMethod): same.
19126 (Method.DefineMethod): same.
19128 * ecore.cs: Only set the status used flag if we get back a Field.
19130 * attribute.cs: Temporary hack, so Paolo can keep working.
19132 2002-03-08 Ravi Pratap <ravi@ximian.com>
19134 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19135 the unmanaged type in the case we have a MarshalAs attribute.
19137 (Resolve): Handle the case when we are parsing the special MarshalAs
19138 attribute [we need to store the unmanaged type to use later]
19140 * typemanager.cs (marshal_as_attr_type): Built in type for the
19141 MarshalAs Attribute.
19143 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
19144 on parameters and accordingly set the marshalling info.
19146 2002-03-09 Miguel de Icaza <miguel@ximian.com>
19148 * class.cs: Optimizing slightly by removing redundant code after
19149 we switched to the `NoTypes' return value.
19150 (Property.DefineMethod): use NoTypes here too.
19152 This fixes the bug I introduced in my last batch of changes.
19154 2002-03-05 Ravi Pratap <ravi@ximian.com>
19156 * tree.cs (RecordEnum): Add. We now keep track of enums too.
19158 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19159 Enums since those are types too.
19161 * cs-parser.jay (enum_declaration): Record enums as we parse them.
19163 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
19164 thanks to a call during the lookup process.
19166 2002-03-07 Miguel de Icaza <miguel@ximian.com>
19168 * statement.cs (Foreach): Lots of work to accomodate a particular
19169 kind of foreach statement that I had not kept in mind. It is
19170 possible to have foreachs on classes that provide a GetEnumerator
19171 method that return objects that implement the "pattern" for using
19172 a foreach, there is no need to support GetEnumerator
19175 This is needed to compile nant.
19177 * decl.cs: Only report 114 if the member is not `Finalize' and if
19178 the warning level is at least 2.
19180 * class.cs: Moved the compare function from Method to
19183 (MethodSignature.InheritableMemberSignatureCompare): Add new
19184 filter function that is used to extract inheritable methods from a
19187 (Method.Define): Use the new `inheritable_method_signature_filter'
19190 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19193 2002-03-06 Miguel de Icaza <miguel@ximian.com>
19195 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19197 * cs-parser.jay: Add opt_semicolon to the interface declaration.
19199 * expression.cs: Pass location information to
19200 ConvertImplicitStandard.
19202 * class.cs: Added debugging code to track return values from
19205 2002-03-05 Miguel de Icaza <miguel@ximian.com>
19207 * expression.cs (Is.DoResolve): If either side of the `is' is an
19208 interface, do not flag the warning.
19210 * ecore.cs (ImplicitReferenceConversion): We need a separate test
19213 * report.cs: Allow for --fatal to be used with --probe.
19215 * typemanager.cs (NoTypes): Move the definition for the empty Type
19218 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19220 (TypeContainer.DefineProxy): New function used to proxy to parent
19221 implementations when implementing interfaces.
19222 (TypeContainer.ParentImplements): used to lookup if our parent
19223 implements a public function that is required by an interface.
19224 (TypeContainer.VerifyPendingMethods): Hook this up.
19226 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19227 `modules' and `assemblies' arraylists into arrays. We only grow
19228 these are the very early start up of the program, so this improves
19229 the speedof LookupType (nicely measured).
19231 * expression.cs (MakeByteBlob): Replaced unsafe code with
19232 BitConverter, as suggested by Paolo.
19234 * cfold.cs (ConstantFold.Binary): Special case: perform constant
19235 folding of string concatenation, but if either side is a string,
19236 and the other is not, then return null, and let the runtime use
19237 the concatenation on the string plus the object (using
19238 `Object.ToString').
19240 2002-03-04 Miguel de Icaza <miguel@ximian.com>
19242 Constant Folding has been implemented now.
19244 * expression.cs (Unary.Reduce): Do not throw an exception, catch
19245 the error instead on types that are not supported in one's
19248 * constant.cs (Constant and all children): New set of functions to
19249 perform implict and explicit conversions.
19251 * ecore.cs (EnumConstant): Implement the new functions to perform
19252 conversion by proxying to the child expression.
19254 * codegen.cs: (ConstantCheckState): Constant evaluation has its
19255 own separate setting that can not be turned off from the command
19256 line using --unchecked or --checked and is only controlled using
19257 the checked/unchecked statements and expressions. This setting is
19258 used by the constant folder to flag errors.
19260 * expression.cs (CheckedExpr, UncheckedExpr): Set the
19261 ConstantCheckState as well.
19263 During Resolve, they also have to flag the state, because the
19264 constant folder runs completely in the Resolve phase.
19266 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19269 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19271 * cfold.cs: New file, this file contains the constant folder.
19273 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19274 argument to track whether we are using the resulting address to
19275 load or store a value and provide better error messages.
19277 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19278 new AddressOf arguments.
19280 * statement.cs (Foreach.EmitCollectionForeach): Update
19282 * expression.cs (Argument.Emit): Call AddressOf with proper
19283 arguments to track usage.
19285 (New.DoEmit): Call AddressOf with new arguments.
19287 (Unary.Emit): Adjust AddressOf call.
19289 2002-03-01 Ravi Pratap <ravi@ximian.com>
19291 * cs-parser.jay (member_access): Change the case for pre-defined types
19292 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
19295 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19298 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19299 essentially like methods and apply attributes like MethodImplOptions to them too.
19301 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19304 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19305 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19308 * Update code everywhere accordingly.
19310 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19312 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19314 2002-02-28 Ravi Pratap <ravi@ximian.com>
19316 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19317 try performing lookups against those instead of jumping straight into using
19318 the 'using' clauses.
19320 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19322 (LookupType): Perform lookups in implicit parents too.
19324 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19325 sequence as RootContext.LookupType.
19327 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
19328 the various cases of namespace lookups into this method.
19330 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19332 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19333 in positional arguments)
19335 * class.cs (Operator): Update the AllowedModifiers to contain
19338 * cs-parser.jay: Update operator declaration to allow for the
19339 operator body to be empty.
19341 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19344 2002-02-27 Miguel de Icaza <miguel@ximian.com>
19346 * class.cs (Method.Emit): Label parameters.
19348 * driver.cs: Return 1 or 0 as the program exit code.
19350 2002-02-26 Miguel de Icaza <miguel@ximian.com>
19352 * expression.cs: Special case the `null' object when trying to
19353 auto-compute the type, as anything can be explicitly converted to
19356 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19357 spotting this Paolo.
19359 (Expression.ImplicitNumericConversion): Perform comparissions of
19360 the type using the underlying type in the case of an enumeration
19361 rather than using the enumeration type for the compare.
19363 Cope with the underlying == type case, which is not possible to
19366 (Expression.ConvertNumericExplicit): Perform comparissions of
19367 the type using the underlying type in the case of an enumeration
19368 rather than using the enumeration type for the compare.
19370 * driver.cs: If the user does not supply an extension, assume .exe
19372 * cs-parser.jay (if_statement): Rewrote so that we can track the
19373 location for the if statement.
19375 * expression.cs (Binary.ConstantFold): Only concat strings when
19376 the operation is "+", not everything ;-)
19378 * statement.cs (Statement.EmitBoolExpression): Take a location
19380 (If, While, Do): Track location.
19382 * expression.cs (Binary.ResolveOperator): In the object + string
19383 case, I was missing a call to ConvertImplicit
19385 2002-02-25 Ravi Pratap <ravi@ximian.com>
19387 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19388 Location arguments. Ensure we use RootContext.LookupType to do our work
19389 and not try to do a direct Type.GetType and ModuleBuilder.GetType
19391 * interface.cs (PopulateMethod): Handle the type of the parameter being
19394 * expression.cs (Invocation.BetterFunction): Handle the case when we
19395 have a params method with no fixed arguments and a call is made with no
19398 2002-02-25 Miguel de Icaza <miguel@ximian.com>
19400 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19401 the verbatim-string-literal
19403 * support.cs (InternalParameters.ParameterModifier): handle null
19405 (InternalParameters.ParameterType): ditto.
19407 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19408 duplicating the name of the variable parameter.
19409 (GetParameterByName): Fix bug where we were not looking up array
19410 paramters if they were the only present (thanks Paolo!).
19411 (GetParameterInfo): We only have an empty set of types if both
19412 fixed and array are set to null.
19413 (GetParameterInfo-idx): Handle FixedParameter == null
19415 * cs-parser.jay: Handle the case where there is no catch
19416 statements (missing null test).
19418 2002-02-22 Miguel de Icaza <miguel@ximian.com>
19420 * driver.cs (MainDriver): Be conservative on our command line
19423 Catch DirectoryNotFoundException when calling GetFiles.
19425 (SplitPathAndPattern): Used to split the input specification into
19426 a path and a pattern that we can feed to Directory.GetFiles.
19428 2002-02-21 Miguel de Icaza <miguel@ximian.com>
19430 * statement.cs (Fixed): Implement the last case of the Fixed
19431 statement (string handling).
19433 * expression.cs (StringPtr): New class used to return a char * to
19434 a string; Used by the Fixed statement.
19436 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
19438 * expression.cs (Binary.ResolveOperator): Remove redundant
19439 MemberLookup pn parent type.
19440 Optimize union call, we do not need a union if the types are the same.
19441 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19444 Specialize the use of MemberLookup everywhere, instead of using
19445 the default settings.
19447 (StackAlloc): Implement stackalloc keyword.
19449 * cs-parser.jay: Add rule to parse stackalloc.
19451 * driver.cs: Handle /h, /help, /?
19453 * expression.cs (MakeByteBlob): Removed the hacks we had in place
19454 before we supported unsafe code.
19456 * makefile: add --unsafe to the self compilation of mcs.
19458 2002-02-20 Miguel de Icaza <miguel@ximian.com>
19460 * expression.cs (PointerArithmetic): New class that is used to
19461 perform pointer arithmetic.
19462 (Binary.Resolve): Handle pointer arithmetic
19463 Handle pointer comparission.
19464 (ArrayPtr): Utility expression class that is used to take the
19465 address of an array.
19467 (ElementAccess): Implement array access for pointers
19469 * statement.cs (Fixed): Implement fixed statement for arrays, we
19470 are missing one more case before we are done.
19472 * expression.cs (Indirection): Implement EmitAssign and set the
19473 ExprClass to Variable. This allows pointer dereferences to be
19474 treated as variables, and to have values assigned to them.
19476 * ecore.cs (Expression.StoreFromPtr): New utility function to
19477 store values dereferencing.
19479 2002-02-20 Ravi Pratap <ravi@ximian.com>
19481 * expression.cs (Binary.ResolveOperator): Ensure that we are
19482 not trying to operate on a void type - this fixes the reported
19485 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19486 the parent implementation is sealed.
19488 * ../errors/cs0239.cs : Add.
19490 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19492 * typemanager.cs (unverifiable_code_type): Corresponds to
19493 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19494 which have unsafe code in them.
19496 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
19499 2002-02-19 Miguel de Icaza <miguel@ximian.com>
19501 * cs-tokenizer.cs: Add support for @"litreal strings"
19503 Make tokenizer accept pre-processor directives
19504 on any column (remove the old C-like limitation).
19506 * rootcontext.cs (EmitCode): Emit any global attributes.
19507 (AddGlobalAttributes): Used to keep track of assembly attributes.
19509 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19511 * cs-parser.jay: Add support for global attributes.
19513 2002-02-17 Miguel de Icaza <miguel@ximian.com>
19515 * expression.cs (Indirection): New helper class. Unary will
19516 create Indirection classes to be able to implement the
19517 IMemoryLocation interface on it.
19519 2002-02-16 Miguel de Icaza <miguel@ximian.com>
19521 * cs-parser.jay (fixed_statement): reference the right statement.
19523 * statement.cs (Fixed.Emit): Finish implementing the fixed
19524 statement for the &x case.
19526 2002-02-14 Miguel de Icaza <miguel@ximian.com>
19528 * class.cs (Property.Define, Method.Define): Remove newslot when
19531 * modifiers.cs: My use of NewSlot when `Abstract' was set was
19532 wrong. NewSlot should only be used if the `new' keyword is present.
19534 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19535 locating our system dir. Sorry about this.
19537 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19539 * driver.cs (GetSystemDir): Compute correctly the location of our
19540 system assemblies. I was using the compiler directory instead of
19541 the library directory.
19543 2002-02-13 Ravi Pratap <ravi@ximian.com>
19545 * expression.cs (BetterFunction): Put back in what Miguel commented out
19546 since it is the correct fix. The problem is elsewhere ;-)
19548 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19549 parameters of the parms method are themselves compatible or not !
19551 (StandardConversionExists): Fix very dangerous bug where we were forgetting
19552 to check that a class implements an interface before saying that an implicit
19553 conversion was allowed. Use ImplementsInterface to do the checking.
19555 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19557 * class.cs (Method.Define): Track whether we are an explicit
19558 implementation or not. And only call DefineMethodOverride if we
19559 are an explicit implementation.
19561 (Property.DefineMethod): Ditto.
19563 2002-02-11 Ravi Pratap <ravi@ximian.com>
19565 * expression.cs (BetterFunction): Catch hideous bug which was
19566 preventing us from detecting ambiguous calls due to implicit casts i.e
19569 2002-01-29 Miguel de Icaza <miguel@ximian.com>
19571 * support.cs (Pair): Remove un-needed method. I figured why I was
19572 getting the error in cs-parser.jay, the variable in a foreach loop
19573 is readonly, and the compiler does not really treat this as a variable.
19575 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
19576 instead of EQUALS in grammar.
19578 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19580 * expression.cs (Unary.DoResolve): Check whether the argument is
19583 2002-01-28 Miguel de Icaza <miguel@ximian.com>
19585 * support.cs: Api for Pair to set a value. Despite the fact that
19586 the variables are public the MS C# compiler refuses to compile
19587 code that accesses the field if the variable is part of a foreach
19590 * statement.cs (Fixed): Begin implementation of the fixed
19593 (Block.AddVariable): Return the VariableInfo on success and null
19594 on failure instead of true/false.
19596 * cs-parser.jay (foreach): Catch errors on variables already
19597 defined (we were ignoring this value before) and properly unwind
19598 the block hierarchy
19600 (fixed_statement): grammar for the fixed statement.
19602 2002-01-25 Miguel de Icaza <miguel@ximian.com>
19604 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19605 pointer types to be incretemented.
19607 (SizeOf): Implement.
19609 * cs-parser.jay (pointer_member_access): Implement
19610 expr->IDENTIFIER production.
19612 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19613 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19616 (Unary): Implement indirection.
19618 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19619 use in non-unsafe context).
19621 (SimpleName.DoResolve): Check for pointers in field access on safe
19624 (Expression.LoadFromPtr): Factor the load-indirect code in this
19625 function. This was duplicated in UnboxCast and ParameterReference
19627 2002-01-24 Miguel de Icaza <miguel@ximian.com>
19629 * expression.cs (ComposedCast): report an error if a pointer cast
19630 is used in a safe region.
19632 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19633 pointer type casts in unsafe context.
19635 * codegen.cs (EmitContext): Set up IsUnsafe.
19637 * cs-parser.jay (non_expression_type): Add productions for pointer
19640 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19641 code. We should not use force into static mode if the method is
19642 not virtual. Fixes bug in MIS
19644 * statement.cs (Do.Emit, While.Emit, For.Emit,
19645 Statement.EmitBoolExpression): Add support to Do and While to
19646 propagate infinite loop as `I do return' semantics.
19648 Improve the For case to also test for boolean constants.
19650 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19651 to the list of attributes we can add.
19653 Remove `EmitContext' argument.
19655 * class.cs (Method.Define): Apply parameter attributes.
19656 (Constructor.Define): Apply parameter attributes.
19657 (MethodCore.LabelParameters): Move here the core of labeling
19660 * support.cs (ReflectionParameters.ParameterModifier,
19661 InternalParameters.ParameterModifier): Use IsByRef on the type and
19662 only return the OUT bit for these parameters instead of in/out/ref
19665 This is because I miss-understood things. The ParameterInfo.IsIn
19666 and IsOut represent whether the parameter has the [In] and [Out]
19669 2002-01-22 Miguel de Icaza <miguel@ximian.com>
19671 * ecore.cs (FieldExpr.Emit): Release temporaries.
19673 * assign.cs (LocalTemporary.Release): new function.
19675 * codegen.cs (EmitContext.GetTemporaryStorage,
19676 EmitContext.FreeTemporaryStorage): Rework the way we deal with
19677 temporary storage. Now we can "put back" localbuilders when we
19680 2002-01-21 Miguel de Icaza <miguel@ximian.com>
19682 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19683 need to make a copy of the variable to generate verifiable code.
19685 2002-01-19 Miguel de Icaza <miguel@ximian.com>
19687 * driver.cs: Compute dynamically the system directory.
19689 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19690 Slower, but more generally useful. Used by the abstract
19691 registering implementation.
19693 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19694 the rules for the special rule on Type/instances. First check if
19695 we have the same name, and if so, try that special static path
19696 rather than the instance path.
19698 2002-01-18 Miguel de Icaza <miguel@ximian.com>
19700 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19703 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19704 Enum, ValueType, Delegate or Array for non-corlib compiles.
19706 * cs-tokenizer.cs: Catch long identifiers (645)
19708 * typemanager.cs (IndexerPropetyName): Ravi never tested this
19711 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19712 fix, we were returning too early, so we were not registering
19713 pending methods from abstract classes.
19715 Do not register pending methods if the class is abstract.
19717 * expression.cs (Conditional.DoResolve): Report circular implicit
19718 conversions when we neecd to compute it for conditional
19721 (Is.DoResolve): If the expression is always of the provided type,
19722 flag warning 183. If the expression can not ever be of the
19723 provided type flag warning 184.
19725 * class.cs: Catch 169 as well.
19727 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19730 2002-01-18 Nick Drochak <ndrochak@gol.com>
19732 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
19734 2002-01-17 Miguel de Icaza <miguel@ximian.com>
19736 * interface.cs: (PopulateMethod): Check for pointers being defined
19737 only if the unsafe context is active.
19738 (PopulateProperty): ditto.
19739 (PopulateIndexer): ditto.
19741 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19742 specified. If pointers are present, make sure that they are
19743 present in an unsafe context.
19744 (Constructor, Constructor.Define): ditto.
19745 (Field, Field.Define): ditto.
19746 (Property, Property.Define): ditto.
19747 (Event, Event.Define): ditto.
19749 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19750 hashtable if there are classes or structs defined.
19752 * expression.cs (LocalVariableReference.DoResolve): Simplify this
19753 code, as the constant resolution moved.
19755 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19756 the metadata, so we can flag error 133.
19758 * decl.cs (MemberCore.UnsafeOK): New function to test that a
19759 pointer is being declared in an unsafe context.
19761 2002-01-16 Miguel de Icaza <miguel@ximian.com>
19763 * modifiers.cs (Modifiers.Check): Require a Location argument.
19764 Report error 227 for Unsafe use.
19766 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19768 * statement.cs (For.Emit): If the test is null, then report that
19769 we do `return', as we wont reach anything afterwards.
19771 (Switch.SwitchGoverningType): Track the expression that matched
19774 * driver.cs: Allow negative numbers as an error code to flag.
19776 * cs-parser.jay: Handle 1551.
19778 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19780 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19782 * cs-parser.jay: Report 1518 (type declaration can only contain
19783 class, struct, interface, enum or delegate)
19785 (switch_label): Report 1523 (keywords `case' or `default' must
19788 (opt_switch_sections): Report 1522 (empty switch)
19790 * driver.cs: Report 1515 (response file specified multiple times)
19791 Report 1516 (Source file specified multiple times).
19793 * expression.cs (Argument.Resolve): Signal 1510
19795 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19796 access not allowed in static code)
19798 2002-01-11 Ravi Pratap <ravi@ximian.com>
19800 * typemanager.cs (IsPointerType): Utility method which we are going
19803 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19804 the object type, so we take care of that.
19806 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19808 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19809 added to non-params parameters :-)
19811 * typemanager.cs (CSharpName): Include 'void' type too.
19813 (void_ptr_type): Include in the set of core types.
19815 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
19818 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
19821 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
19822 completely forgotten about it.
19824 2002-01-10 Ravi Pratap <ravi@ximian.com>
19826 * cs-parser.jay (pointer_type): Add. This begins our implementation
19827 of parsing rules for unsafe code.
19829 (unsafe_statement): Implement.
19831 (embedded_statement): Modify to include the above.
19833 * statement.cs (Unsafe): Implement new class for unsafe blocks.
19835 * codegen.cs (EmitContext.InUnsafe): Add. This determines
19836 if the current context is an unsafe one.
19838 * cs-parser.jay (local_variable_pointer_type): Since local variable types
19839 are handled differently, we need separate rules for them.
19841 (local_variable_declaration): Update to use local_variable_pointer_type
19842 to allow variable declarations of unmanaged pointer types.
19844 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19845 in unsafe contexts.
19847 * ../errors/cs0214.cs : Add.
19849 2002-01-16 Nick Drochak <ndrochak@gol.com>
19851 * makefile: remove 'response' file when cleaning.
19853 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19855 * cs-parser.jay: Report 1524.
19857 2002-01-14 Miguel de Icaza <miguel@ximian.com>
19859 * typemanager.cs (RegisterMethod): drop checking if we have
19860 registered this from here
19862 2002-01-12 Miguel de Icaza <miguel@ximian.com>
19864 * class.cs (Method.EmitDestructor): Implement calling our base
19867 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19868 value of InFinally.
19870 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19871 this routine and will wrap the call in a try/catch block. Deal
19874 2002-01-11 Miguel de Icaza <miguel@ximian.com>
19876 * ecore.cs (Expression.MemberLookup): instead of taking a
19877 parameter `same_type' that was used to tell whether we could
19878 access private members we compute our containing type from the
19881 (FieldExpr): Added partial support for volatile fields. This does
19882 not work for volatile fields exposed from assemblies, as I can not
19883 figure out how to extract the modreq from it.
19885 Updated all the source files to use this.
19887 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19888 because it is referenced by MemberLookup very often.
19890 2002-01-09 Ravi Pratap <ravi@ximian.com>
19892 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19893 TypeBuilder.GetCustomAttributes to retrieve what we need.
19895 Get rid of redundant default_member_attr_type as this is the same as
19896 default_member_type which already exists.
19898 * interface.cs, attribute.cs : Update accordingly.
19900 2002-01-08 Miguel de Icaza <miguel@ximian.com>
19902 * typemanager.cs: Enable IndexerPropertyName again. It does not
19903 work for TYpeBuilders though. Ravi, can you please fix this?
19905 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19907 * expression.cs (Argument.Emit): Handle the case of ref objects
19908 being passed to ref functions;
19910 (ParameterReference.EmitLoad): Loads the content of the pointer
19911 without dereferencing.
19913 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19915 * cs-tokenizer.cs: Implemented the pre-processing expressions.
19917 2002-01-08 Ravi Pratap <ravi@ximian.com>
19919 * class.cs (Indexer.DefineMethod): Incorporate the interface
19920 type in the name of the method if we are doing explicit interface
19923 * expression.cs (ConversionExists): Remove as it is completely obsolete.
19925 (BetterConversion): Fix extremely trivial bug where we were referring to
19926 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19929 * ../errors/bug16.cs : Add although we have fixed it.
19931 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19933 * expression.cs (BaseIndexer): Begin implementation.
19935 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19937 * cs-parser.jay (indexer_declarator): Use qualified_identifier
19938 production directly to remove a shift/reduce, and implement
19939 explicit interface implementation.
19941 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19942 after a floating point suffix.
19944 * expression.cs (DoNumericPromotions): Improved the conversion for
19945 uint/uint. If we have a constant, we avoid doing a typecast to a
19948 * class.cs (Indexer): Implement explicit interface implementation
19951 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19953 * class.cs: make the default instance constructor public and hidebysig.
19955 2001-01-03 Ravi Pratap <ravi@ximian.com>
19957 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19958 so we can call it from elsewhere.
19960 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19961 we emit it internally if the class has a defined indexer; otherwise the user
19962 emits it by decorating the class definition with the DefaultMemberAttribute.
19964 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19965 attribute is not used on a type which defines an indexer.
19967 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19968 character when we skip whitespace.
19970 * ../errors/cs0646.cs : Add.
19972 2002-01-03 Miguel de Icaza <miguel@ximian.com>
19974 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19977 * makefile: Add practical target `mcs3.exe' which builds the third
19978 generation compiler.
19980 * expression.cs (New): Fix structures constructor calling.
19982 * class.cs (Property, Method, Indexer): Emit Final flag on the
19983 method if we are an interface implementation and we are not
19986 * ecore.cs (PropertyExpr): New public field `IsBase', tells
19987 whether this property is referencing a `base' method.
19989 * expression.cs (Invocation.EmitCall): take an extra argument:
19990 is_base, this is used to determine whether the `call' or
19991 `callvirt' opcode should be used.
19994 * delegate.cs: update EmitCall.
19996 * class.cs (Method.Define): Set NewSlot for the cases where we are
19997 not implementing an interface method.
19999 (Property.Define): ditto.
20001 2002-01-02 Miguel de Icaza <miguel@ximian.com>
20003 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20004 'r'. Allows mcs to parse itself fully.
20006 2002-01-02 Ravi Pratap <ravi@ximian.com>
20008 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20009 of the number of initializers that require the InitializeArray method.
20011 (CheckIndices): Store the Expression in all cases - not the plain value. Also
20012 update the above field where necessary.
20014 (MakeByteBlob): Update accordingly.
20016 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
20019 (EmitDynamicInitializers): Update in accordance with the new optimization.
20021 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20022 same OpCode applies.
20024 * cs-parser.jay : Fix some glaring errors I introduced.
20026 2002-01-01 Ravi Pratap <ravi@ximian.com>
20028 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20029 so that we can check for name clashes there too.
20031 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20032 for interface indexers.
20034 * interfaces.cs (Define): Emit the default member attribute.
20036 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20037 variable was being referred to while setting the value ;-)
20039 2002-01-01 Miguel de Icaza <miguel@ximian.com>
20041 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20042 byte-by-byte information when we know the data is zero.
20044 Make the block always a multiple of 4, because
20045 DefineInitializedData has a bug.
20047 * assign.cs: Fix, we should assign from the temporary, not from
20050 * expression.cs (MakeByteBlob): Fix my incorrect code.
20052 2001-12-31 Miguel de Icaza <miguel@ximian.com>
20054 * typemanager.cs (EnumToUnderlying): This function is used to get
20055 the underlying type from an enumeration, because it does not
20058 * constant.cs: Use the I4_S form for values between -128 and 127.
20060 * statement.cs (Block.LookupLabel): Looks up a label.
20061 (Block): Drop support for labeled blocks.
20063 (LabeledStatement): New kind of statement that represents a label
20066 (Goto): Finally implement this bad boy.
20068 * cs-parser.jay: Update to reflect new mechanism to implement
20071 2001-12-30 Miguel de Icaza <miguel@ximian.com>
20073 * codegen.cs (EmitContext.This): a codegen property that keeps the
20074 a single instance of this instead of creating many different this
20077 * delegate.cs (Delegate.DoResolve): Update to use the property;
20079 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20081 * expression.cs (BaseAccess.DoResolve): Ditto.
20083 2001-12-29 Ravi Pratap <ravi@ximian.com>
20085 * typemanager.cs (methodimpl_attr_type): Add to hold the type
20086 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20088 (InitCoreTypes): Update accordingly.
20090 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20091 so we can quickly store the state.
20093 (ApplyAttributes): Set the correct implementation flags
20094 for InternalCall methods.
20096 2001-12-29 Miguel de Icaza <miguel@ximian.com>
20098 * expression.cs (EmitCall): if a method is not virtual, then do
20099 not use callvirt on it.
20101 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20102 user defined stuff) requires the use of stobj, which takes an
20103 address on the stack instead of an array and an index. So emit
20104 the Ldelema operation for it.
20106 (EmitStoreOpcode): Use stobj for valuetypes.
20108 (UnaryMutator.EmitCode): Use the right 1 value depending on
20109 whether we are dealing with int64/uint64, float or doubles.
20111 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20112 constructors that I implemented last night.
20114 (Constructor.IsDefault): Fix to work properly for static
20117 * cs-parser.jay (CheckDef): report method signature errors.
20118 Update error number 103 to be 132.
20120 * decl.cs: New AdditionResult enumeration value: MethodExists.
20121 Although we do this check for methods later on in the semantic
20122 analysis, catching repeated default constructors is so easy that
20123 we catch these here.
20125 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20128 (ParameterReference.EmitAssign, Emit): handle
20131 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20132 (ArrayAccess.EmitStoreOpcode): ditto.
20134 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20136 * expression.cs (MakeByteBlob): Complete all the missing types
20137 (uint, short, ushort, byte, sbyte)
20139 * class.cs: Only init instance field initializers on instance
20142 Rename `constructors' to instance_constructors.
20144 (TypeContainer.AddConstructor): Only add constructors to the list
20145 if it is not static.
20147 Make sure that we handle default_static_constructor independently
20148 everywhere where we handle instance_constructors
20150 2001-12-28 Miguel de Icaza <miguel@ximian.com>
20152 * class.cs: Do not lookup or create a base initializer for a
20153 static constructor.
20155 (ConstructorInitializer.Resolve): use the proper type to lookup
20158 * cs-parser.jay: Report error 1585 (modifiers between type and name).
20160 * enum.cs, interface.cs: Remove CloseType, this is taken care by
20163 * decl.cs: CloseType is now an virtual method, the default
20164 implementation just closes this type.
20166 2001-12-28 Ravi Pratap <ravi@ximian.com>
20168 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20169 to PreserveSig by default. Also emit HideBySig on such methods.
20171 Basically, set the defaults to standard values.
20173 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20174 argument, if candidate is better, it can't be worse than the best !
20176 (Invocation): Re-write bits to differentiate between methods being
20177 applicable in their expanded form and their normal form - for params
20180 Get rid of use_standard everywhere as only standard conversions are allowed
20181 in overload resolution.
20183 More spec conformance.
20185 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20187 * driver.cs: Add --timestamp, to see where the compiler spends
20190 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20191 `this' in static code.
20193 (SimpleName.DoResolve): Implement in terms of a helper function
20194 that allows static-references to be passed upstream to
20197 (Expression.ResolveWithSimpleName): Resolve specially simple
20198 names when called by MemberAccess to implement the special
20201 (Expression.ImplicitReferenceConversion): Handle conversions from
20202 Null to reference types before others, as Null's type is
20205 * expression.cs (Invocation.EmitCall): Handle the special case of
20206 calling methods declared on a reference type from a ValueType
20207 (Base classes System.Object and System.Enum)
20209 (MemberAccess.Resolve): Only perform lookups on Enumerations if
20210 the left hand side is a TypeExpr, not on every enumeration.
20212 (Binary.Resolve): If types are reference types, then do a cast to
20213 object on operators != and == of both arguments.
20215 * typemanager.cs (FindMembers): Extract instance and static
20216 members if requested.
20218 * interface.cs (PopulateProperty): Use void_type instead of null
20219 as the return type for the setter method.
20221 (PopulateIndexer): ditto.
20223 2001-12-27 Ravi Pratap <ravi@ximian.com>
20225 * support.cs (ReflectionParameters): Fix minor bug where we
20226 were examining the wrong parameter for the ParamArray attribute.
20228 Cope with requests for the type of the parameter at position
20229 greater than the params parameter's. We now return the element
20230 type of the params array as that makes more sense.
20232 * expression.cs (Invocation.IsParamsMethodApplicable): Update
20233 accordingly as we no longer have to extract the element type
20236 (Invocation.OverloadResolve): Update.
20238 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20240 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20241 against IEnumerator, test whether the return value is a descendant
20242 of the IEnumerator interface.
20244 * class.cs (Indexer.Define): Use an auxiliary method to implement
20245 the other bits of the method definition. Begin support for
20246 explicit interface implementation.
20248 (Property.DefineMethod): Use TypeManager.void_type instead of null
20249 for an empty return value.
20251 2001-12-26 Miguel de Icaza <miguel@ximian.com>
20253 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20254 dealing with a FieldExpr which is composed of a FieldBuilder, in
20255 the code path we did extract the constant, but we should have
20256 obtained the underlying value to be able to cast it (otherwise we
20257 end up in an infinite loop, this is what Ravi was running into).
20259 (ArrayCreation.UpdateIndices): Arrays might be empty.
20261 (MemberAccess.ResolveMemberAccess): Add support for section
20262 14.5.4.1 that deals with the special case of E.I when E is a type
20263 and something else, that I can be a reference to a static member.
20265 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20266 handle a particular array type to create byte blobs, it is just
20267 something we dont generate byteblobs for.
20269 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20272 * location.cs (Push): remove the key from the hashtable that we
20273 are about to add. This happens for empty files.
20275 * driver.cs: Dispose files after we have parsed them.
20277 (tokenize): new function that only runs the tokenizer on its
20278 input, for speed testing.
20280 2001-12-26 Ravi Pratap <ravi@ximian.com>
20282 * class.cs (Event.Define): Define the private field only if there
20283 are no accessors defined.
20285 * expression.cs (ResolveMemberAccess): If there is no associated
20286 field with the event, that means we have an event defined with its
20287 own accessors and we should flag error cs0070 since transforming
20288 ourselves into a field is not valid in that case.
20290 * ecore.cs (SimpleName.DoResolve): Same as above.
20292 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20293 and charset to sane values.
20295 2001-12-25 Ravi Pratap <ravi@ximian.com>
20297 * assign.cs (DoResolve): Perform check on events only if they
20298 are being accessed outside the declaring type.
20300 * cs-parser.jay (event_declarations): Update rules to correctly
20301 set the type of the implicit parameter etc.
20303 (add_accessor, remove_accessor): Set current local parameters.
20305 * expression.cs (Binary): For delegate addition and subtraction,
20306 cast the return value from the method into the appropriate delegate
20309 2001-12-24 Ravi Pratap <ravi@ximian.com>
20311 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20312 of these as the workaround is unnecessary.
20314 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20315 delegate data - none of that is needed at all.
20317 Re-write bits to extract the instance expression and the delegate method
20320 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
20323 * attribute.cs (ApplyAttributes): New method to take care of common tasks
20324 of attaching attributes instead of duplicating code everywhere.
20326 * everywhere : Update code to do attribute emission using the above method.
20328 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20330 * expression.cs (IsParamsMethodApplicable): if there are not
20331 parameters, return immediately.
20333 * ecore.cs: The 0 literal can be implicity converted to an enum
20336 (SimpleName.DoResolve): First lookup the type, then lookup the
20339 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20340 want to get its address. If the InstanceExpression is not
20341 addressable, store the result in a temporary variable, then get
20344 * codegen.cs: Only display 219 errors on warning level or above.
20346 * expression.cs (ArrayAccess): Make it implement the
20347 IMemoryLocation interface.
20349 (Binary.DoResolve): handle the operator == (object a, object b)
20350 and operator != (object a, object b) without incurring into a
20351 BoxedCast (because 5 != o should never be performed).
20353 Handle binary enumerator operators.
20355 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20356 value type, otherwise use Ldelem_ref.
20358 Use precomputed names;
20360 (AddressOf): Implement address of
20362 * cs-parser.jay (labeled_statement): Fix recursive block
20363 addition by reworking the production.
20365 * expression.cs (New.DoEmit): New has a special case:
20367 If we are dealing with a ValueType, we have a few
20368 situations to deal with:
20370 * The target of New is a ValueType variable, that is
20371 easy, we just pass this as the variable reference
20373 * The target of New is being passed as an argument,
20374 to a boxing operation or a function that takes a
20377 In this case, we need to create a temporary variable
20378 that is the argument of New.
20381 2001-12-23 Ravi Pratap <ravi@ximian.com>
20383 * rootcontext.cs (LookupType): Check that current_type is not null before
20384 going about looking at nested types.
20386 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20387 not implement the IAssignMethod interface any more.
20389 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20390 where we tranform them into FieldExprs if they are being resolved from within
20391 the declaring type.
20393 * ecore.cs (SimpleName.DoResolve): Do the same here.
20395 * assign.cs (DoResolve, Emit): Clean up code considerably.
20397 * ../errors/bug10.cs : Add.
20399 * ../errors/cs0070.cs : Add.
20401 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20403 * assign.cs : Get rid of EventIsLocal everywhere.
20405 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20407 * ecore.cs (ConvertIntLiteral): finished the implementation.
20409 * statement.cs (SwitchLabel): Convert the value we are using as a
20410 key before looking up the table.
20412 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20414 * codegen.cs (EmitTopBlock): Require a Location argument now.
20416 * cs-parser.jay (constructor_declarator): We need to setup
20417 current_local_parameters before we parse the
20418 opt_constructor_initializer, to allow the variables to be bound
20419 to the constructor arguments.
20421 * rootcontext.cs (LookupType): First lookup nested classes in our
20422 class and our parents before we go looking outside our class.
20424 * expression.cs (ConstantFold): Extract/debox the values at the
20427 * rootcontext.cs (EmitCode): Resolve the constants first before we
20428 resolve the types. This is not really needed, but it helps debugging.
20430 * statement.cs: report location.
20432 * cs-parser.jay: pass location to throw statement.
20434 * driver.cs: Small bug fix.
20436 * report.cs: Updated format to be 4-zero filled digits.
20438 2001-12-22 Ravi Pratap <ravi@ximian.com>
20440 * expression.cs (CheckIndices): Fix minor bug where the wrong
20441 variable was being referred to ;-)
20443 (DoEmit): Do not call EmitStaticInitializers when the
20444 underlying type is System.Object.
20446 2001-12-21 Ravi Pratap <ravi@ximian.com>
20448 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20449 and do the usual workaround for SRE.
20451 * class.cs (MyEventBuilder.EventType): New member to get at the type
20452 of the event, quickly.
20454 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20456 * assign.cs (Assign.DoResolve): Handle the case when the target
20457 is an EventExpr and perform the necessary checks.
20459 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20462 (SimpleName.MemberStaticCheck): Include check for EventExpr.
20464 (EventExpr): Set the type in the constructor itself since we
20465 are meant to be born fully resolved.
20467 (EventExpr.Define): Revert code I wrote earlier.
20469 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20470 instance expression is null. The instance expression is a This in that case
20471 or a null, depending on whether it is a static method or not.
20473 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20474 refers to more than one method.
20476 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20477 and accordingly flag errors.
20479 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20481 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20483 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20485 * location.cs (ToString): Provide useful rutine.
20487 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20489 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20490 objects, return the actual integral boxed.
20492 * statement.cs (SwitchLabel): define an ILLabel for each
20495 (Switch.CheckSwitch): If the value is a Literal, extract
20496 the underlying literal.
20498 Also in the unused hashtable we had, add the SwitchLabel so we can
20499 quickly look this value up.
20501 * constant.cs: Implement a bunch of new constants. Rewrite
20502 Literal based on this. Made changes everywhere to adapt to this.
20504 * expression.cs (Expression.MakeByteBlob): Optimize routine by
20505 dereferencing array only once, and also copes with enumrations.
20507 bytes are two bytes wide, not one.
20509 (Cast): Perform constant conversions.
20511 * ecore.cs (TryImplicitIntConversion): Return literals instead of
20512 wrappers to the literals here.
20514 * expression.cs (DoNumericPromotions): long literals can converted
20515 to ulong implicity (this is taken care of elsewhere, but I was
20516 missing this spot).
20518 * ecore.cs (Expression.Literalize): Make the return type Literal,
20519 to improve type checking.
20521 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20523 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20525 * literal.cs: Revert code from ravi that checked the bounds. The
20526 bounds are sane by the definition of the type itself.
20528 * typemanager.cs: Fix implementation of ImplementsInterface. We
20529 need to actually look up in our parent hierarchy for interfaces
20532 * const.cs: Use the underlying type for enumerations
20534 * delegate.cs: Compute the basename for the delegate creation,
20535 that should fix the delegate test case, and restore the correct
20536 Type Lookup semantics in rootcontext
20538 * rootcontext.cs: Revert Ravi's last patch. The correct way of
20539 referencing a nested type with the Reflection API is using the "+"
20542 * cs-parser.jay: Do not require EOF token at the end.
20544 2001-12-20 Ravi Pratap <ravi@ximian.com>
20546 * rootcontext.cs (LookupType): Concatenate type names with
20547 a '.' instead of a '+' The test suite passes again.
20549 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20550 field of the enumeration.
20552 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20553 the case when the member is an EventExpr.
20555 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20556 static has an associated instance expression.
20558 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20560 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20562 * class.cs (Event.Define): Register event and perform appropriate checks
20565 We define the Add and Remove methods even if the use provides none because
20566 in that case, we provide default implementations ourselves.
20568 Define a private field of the type of the event. This is done by the CSC compiler
20569 and we should be doing it too ;-)
20571 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20572 More methods we use in code we generate.
20574 (multicast_delegate_type, delegate_type): Two separate types since the distinction
20577 (InitCoreTypes): Update accordingly for the above.
20579 * class.cs (Event.Emit): Generate code for default accessors that we provide
20581 (EmitDefaultMethod): Do the job in the above.
20583 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
20586 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20588 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20589 builders even if we were missing one.
20591 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20592 pass the Basename as our class name instead of the Name. The
20593 basename will be correctly composed for us.
20595 * parameter.cs (Paramters): Now takes a Location argument.
20597 * decl.cs (DeclSpace.LookupType): Removed convenience function and
20598 make all the code call directly LookupType in RootContext and take
20599 this chance to pass the Location information everywhere.
20601 * Everywhere: pass Location information.
20603 2001-12-19 Miguel de Icaza <miguel@ximian.com>
20605 * class.cs (Constructor.Define): Updated way of detecting the
20606 length of the parameters.
20608 (TypeContainer.DefineType): Use basename as the type name for
20611 (TypeContainer.Define): Do not recursively define types here, as
20612 definition is taken care in order by the RootContext.
20614 * tree.cs: Keep track of namespaces in a per-file basis.
20616 * parameter.cs (Parameter.ComputeSignature): Update to use
20619 (Parameters.GetSignature): ditto.
20621 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20622 instead of a TypeContainer.
20624 (Interface.SemanticAnalysis): Use `this' instead of our parent to
20625 resolve names. Because we need to be resolve in our context, not
20628 * driver.cs: Implement response files.
20630 * class.cs (TypeContainer.DefineType): If we are defined, do not
20631 redefine ourselves.
20633 (Event.Emit): Emit the code for add/remove handlers.
20634 (Event.Define): Save the MethodBuilders for add/remove.
20636 * typemanager.cs: Use pair here too.
20638 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20639 DictionaryEntry requires the first argument to be non-null.
20641 (enum_declaration): Compute full name for registering the
20644 (delegate_declaration): Instead of using
20645 formal_parameter_list, use opt_formal_parameter_list as the list
20648 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20649 (EventParsing): New property that controls whether `add' and
20650 `remove' are returned as tokens or identifiers (for events);
20652 2001-12-19 Ravi Pratap <ravi@ximian.com>
20654 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20655 use MyEventBuilder only and let it wrap the real builder for us.
20657 (MyEventBuilder): Revamp constructor etc.
20659 Implement all operations that we perform on EventBuilder in precisely the same
20662 (FindMembers): Update to use the EventBuilder member.
20664 (Event.Emit): Update accordingly.
20666 2001-12-18 Ravi Pratap <ravi@ximian.com>
20668 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20669 by calling the appropriate methods.
20671 (GetCustomAttributes): Make stubs as they cannot possibly do anything
20674 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20676 2001-12-17 Ravi Pratap <ravi@ximian.com>
20678 * delegate.cs (Delegate.Populate): Check that the return type
20679 and various parameters types are indeed accessible.
20681 * class.cs (Constructor.Define): Same here.
20683 (Field.Define): Ditto.
20685 (Event.Define): Ditto.
20687 (Operator.Define): Check that the underlying Method defined itself
20688 correctly - so it's MethodBuilder should not be null.
20690 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20691 expression happens to be null.
20693 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20694 members but as of now we don't seem to be able to do anything really useful with it.
20696 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20697 not the EventBuilder.
20699 2001-12-18 Miguel de Icaza <miguel@ximian.com>
20701 * cs-tokenizer.cs: Add support for defines.
20702 Add support for #if, #elif, #else, #endif
20704 (eval_var): evaluates a variable.
20705 (eval): stubbed for evaluating functions.
20707 * cs-parser.jay: Pass the defines information
20709 * driver.cs: Add --define command line option.
20711 * decl.cs: Move MemberCore here.
20713 Make it the base class for DeclSpace. This allows us to catch and
20714 report 108 and 109 for everything now.
20716 * class.cs (TypeContainer.Define): Extract all the members
20717 before populating and emit the warning 108 (new keyword required
20718 to override) instead of having each member implement this.
20720 (MemberCore.Define): New abstract method, we will be using this in
20721 the warning reporting engine in Populate.
20723 (Operator.Define): Adjust to new MemberCore protocol.
20725 * const.cs (Const): This does not derive from Expression, it is a
20726 temporary object we use to create fields, it is a MemberCore.
20728 * class.cs (Method.Define): Allow the entry point to be in a
20731 * driver.cs: Rewrite the argument handler to clean it up a bit.
20733 * rootcontext.cs: Made it just an auxiliary namespace feature by
20734 making everything static.
20736 * driver.cs: Adapt code to use RootContext type name instead of
20739 * delegate.cs: Remove RootContext argument.
20741 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20744 * class.cs (Event.Define): The lookup can fail.
20746 * cs-tokenizer.cs: Begin implementation of pre-procesor.
20748 * expression.cs: Resolve the this instance before invoking the code.
20750 2001-12-17 Miguel de Icaza <miguel@ximian.com>
20752 * cs-parser.jay: Add a production in element_access that allows
20753 the thing to become a "type" reference. This way we can parse
20754 things like "(string [])" as a type.
20756 Note that this still does not handle the more complex rules of
20760 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
20762 * ecore.cs: (CopyNewMethods): new utility function used to
20763 assemble the list of methods from running FindMembers.
20765 (MemberLookup): Rework FindMembers so that
20767 2001-12-16 Miguel de Icaza <miguel@ximian.com>
20769 * class.cs (TypeContainer): Remove Delegates who fail to be
20772 * delegate.cs (Populate): Verify that we dont get null return
20773 values. TODO: Check for AsAccessible.
20775 * cs-parser.jay: Use basename to emit error 574 (destructor should
20776 have the same name as container class), not the full name.
20778 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20779 possible representation.
20781 Also implements integer type suffixes U and L.
20783 2001-12-15 Miguel de Icaza <miguel@ximian.com>
20785 * expression.cs (ArrayCreation.DoResolve): We need to do the
20786 argument resolution *always*.
20788 * decl.cs: Make this hold the namespace. Hold the root context as
20790 (LookupType): Move here.
20792 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20794 * location.cs (Row, Name): Fixed the code, it was always returning
20795 references to the first file.
20797 * interface.cs: Register properties defined through interfaces.
20799 * driver.cs: Add support for globbing on the command line
20801 * class.cs (Field): Make it derive from MemberCore as well.
20804 2001-12-15 Ravi Pratap <ravi@ximian.com>
20806 * class.cs (Event::Define): Check that the type of the event is a delegate
20807 type else flag error #66.
20809 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20812 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20813 values of EntryPoint, CharSet etc etc.
20815 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20817 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20818 be null and we should ignore this. I am not sure if this is really clean. Apparently,
20819 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20820 which needs this to do its work.
20822 * ../errors/cs0066.cs : Add.
20824 2001-12-14 Miguel de Icaza <miguel@ximian.com>
20826 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20829 * class.cs: (MethodSignature.MethodSignature): Removed hack that
20830 clears out the parameters field.
20831 (MemberSignatureCompare): Cleanup
20833 (MemberCore): New base class used to share code between MethodCore
20836 (RegisterRequiredImplementations) BindingFlags.Public requires
20837 either BindingFlags.Instace or Static. Use instance here.
20839 (Property): Refactored code to cope better with the full spec.
20841 * parameter.cs (GetParameterInfo): Return an empty array instead
20844 * class.cs (Property): Abstract or extern properties have no bodies.
20846 * parameter.cs (GetParameterInfo): return a zero-sized array.
20848 * class.cs (TypeContainer.MethodModifiersValid): Move all the
20849 method modifier validation to the typecontainer so we can reuse
20850 this on properties.
20852 (MethodCore.ParameterTypes): return an empty sized array of types.
20854 (Property.Define): Test property modifier validity.
20856 Add tests for sealed/override too.
20858 (Method.Emit): abstract or extern methods have no bodies.
20860 2001-12-14 Ravi Pratap <ravi@ximian.com>
20862 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20865 (Method::Define, ::Emit): Modify accordingly.
20867 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20869 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20871 * makefile: Pass in /unsafe.
20873 2001-12-13 Miguel de Icaza <miguel@ximian.com>
20875 * class.cs (MakeKey): Kill routine.
20877 * class.cs (TypeContainer.Define): Correctly define explicit
20878 method implementations (they require the full interface name plus
20881 * typemanager.cs: Deply the PtrHashtable here and stop using the
20882 lame keys. Things work so much better.
20884 This of course broke everyone who depended on `RegisterMethod' to
20885 do the `test for existance' test. This has to be done elsewhere.
20887 * support.cs (PtrHashtable): A hashtable that avoid comparing with
20888 the object stupid Equals method (because, that like fails all over
20889 the place). We still do not use it.
20891 * class.cs (TypeContainer.SetRequiredInterface,
20892 TypeContainer.RequireMethods): Killed these two routines and moved
20893 all the functionality to RegisterRequiredImplementations.
20895 (TypeContainer.RegisterRequiredImplementations): This routine now
20896 registers all the implementations required in an array for the
20897 interfaces and abstract methods. We use an array of structures
20898 which can be computed ahead of time to reduce memory usage and we
20899 also assume that lookups are cheap as most classes will not
20900 implement too many interfaces.
20902 We also avoid creating too many MethodSignatures.
20904 (TypeContainer.IsInterfaceMethod): Update and optionally does not
20905 clear the "pending" bit if we find that there are problems with
20908 (TypeContainer.VerifyPendingMethods): Update to report errors of
20909 methods that look like implementations but are not.
20911 (TypeContainer.Define): Add support for explicit interface method
20914 2001-12-12 Miguel de Icaza <miguel@ximian.com>
20916 * typemanager.cs: Keep track of the parameters here instead of
20917 being a feature of the TypeContainer.
20919 * class.cs: Drop the registration of parameters here, as
20920 InterfaceMethods are also interface declarations.
20922 * delegate.cs: Register methods with the TypeManager not only with
20923 the TypeContainer. This code was buggy.
20925 * interface.cs: Full registation here.
20927 2001-12-11 Miguel de Icaza <miguel@ximian.com>
20929 * expression.cs: Remove reducer for binary expressions, it can not
20932 * const.cs: Put here the code that used to go into constant.cs
20934 * constant.cs: Put here the code for constants, this is a new base
20935 class for Literals.
20937 * literal.cs: Make Literal derive from Constant.
20939 2001-12-09 Miguel de Icaza <miguel@ximian.com>
20941 * statement.cs (Return.Emit): Report error 157 if the user
20942 attempts to return from a finally block.
20944 (Return.Emit): Instead of emitting a return, jump to the end of
20947 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20948 LocalBuilder to store the result of the function. ReturnLabel is
20949 the target where we jump.
20952 2001-12-09 Radek Doulik <rodo@ximian.com>
20954 * cs-parser.jay: remember alias in current namespace
20956 * ecore.cs (SimpleName::DoResolve): use aliases for types or
20959 * class.cs (LookupAlias): lookup alias in my_namespace
20961 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20963 (LookupAlias): lookup alias in this and if needed in parent
20966 2001-12-08 Miguel de Icaza <miguel@ximian.com>
20970 * rootcontext.cs: (ModuleBuilder) Made static, first step into
20971 making things static. I need this to avoid passing the
20972 TypeContainer when calling ParameterType.
20974 * support.cs (InternalParameters.ParameterType): Remove ugly hack
20975 that did string manipulation to compute the type and then call
20976 GetType. Use Parameter.ParameterType instead.
20978 * cs-tokenizer.cs: Consume the suffix for floating values.
20980 * expression.cs (ParameterReference): figure out whether this is a
20981 reference parameter or not. Kill an extra variable by computing
20982 the arg_idx during emission.
20984 * parameter.cs (Parameters.GetParameterInfo): New overloaded
20985 function that returns whether a parameter is an out/ref value or not.
20987 (Parameter.ParameterType): The type of the parameter (base,
20988 without ref/out applied).
20990 (Parameter.Resolve): Perform resolution here.
20991 (Parameter.ExternalType): The full type (with ref/out applied).
20993 * statement.cs (Using.Emit, Using.EmitExpression): Implement
20994 support for expressions on the using statement.
20996 2001-12-07 Miguel de Icaza <miguel@ximian.com>
20998 * statement.cs (Using.EmitLocalVariableDecls): Split the
20999 localvariable handling of the using statement.
21001 (Block.EmitMeta): Keep track of variable count across blocks. We
21002 were reusing slots on separate branches of blocks.
21004 (Try.Emit): Emit the general code block, we were not emitting it.
21006 Check the type of the declaration to be an IDisposable or
21007 something that can be implicity converted to it.
21009 Emit conversions if required.
21011 * ecore.cs (EmptyExpression): New utility class.
21012 (Expression.ImplicitConversionExists): New utility function.
21014 2001-12-06 Miguel de Icaza <miguel@ximian.com>
21016 * statement.cs (Using): Implement.
21018 * expression.cs (LocalVariableReference): Support read only variables.
21020 * statement.cs: Remove the explicit emit for the Leave opcode.
21021 (VariableInfo): Add a readonly field.
21023 2001-12-05 Miguel de Icaza <miguel@ximian.com>
21025 * ecore.cs (ConvCast): new class used to encapsulate the various
21026 explicit integer conversions that works in both checked and
21027 unchecked contexts.
21029 (Expression.ConvertNumericExplicit): Use new ConvCast class to
21030 properly generate the overflow opcodes.
21032 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21034 * statement.cs: The correct type for the EmptyExpression is the
21035 element_type, not the variable type. Ravi pointed this out.
21037 2001-12-04 Ravi Pratap <ravi@ximian.com>
21039 * class.cs (Method::Define): Handle PInvoke methods specially
21040 by using DefinePInvokeMethod instead of the usual one.
21042 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21043 above to do the task of extracting information and defining the method.
21045 2001-12-04 Ravi Pratap <ravi@ximian.com>
21047 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21048 of the condition for string type.
21050 (Emit): Move that here.
21052 (ArrayCreation::CheckIndices): Keep string literals in their expression
21055 (EmitDynamicInitializers): Handle strings appropriately.
21057 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21059 * codegen.cs (EmitContext): Replace multiple variables with a
21060 single pointer to the current Switch statement.
21062 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21065 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21069 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21072 (Foreach.Emit): Foreach on arrays was not setting
21073 up the loop variables (for break/continue).
21075 (GotoCase): Semi-implented.
21077 2001-12-03 Ravi Pratap <ravi@ximian.com>
21079 * attribute.cs (CheckAttribute): Handle system attributes by using
21080 Attribute.GetAttributes to examine information we need.
21082 (GetValidPlaces): Same here.
21084 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21086 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21088 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21090 (Method::Define): Set appropriate flags if we have a DllImport attribute.
21092 (Method::Emit): Handle the case when we are a PInvoke method.
21094 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21096 * expression.cs: Use ResolveWithSimpleName on compound names.
21098 2001-12-02 Ravi Pratap <ravi@ximian.com>
21100 * constant.cs (EmitConstant): Make sure we resolve the associated expression
21101 before trying to reduce it.
21103 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21105 * constant.cs (LookupConstantValue): Implement.
21107 (EmitConstant): Use the above in emitting the constant.
21109 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21110 that are user-defined by doing a LookupConstantValue on them.
21112 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21115 2001-11-29 Miguel de Icaza <miguel@ximian.com>
21117 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21119 (BaseAccess.DoResolve): Implement.
21121 (MemberAccess.DoResolve): Split this routine into a
21122 ResolveMemberAccess routine that can be used independently
21124 2001-11-28 Miguel de Icaza <miguel@ximian.com>
21126 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21127 As that share bits of the implementation. Is returns a boolean,
21128 while As returns the Type that is being probed.
21130 2001-12-01 Ravi Pratap <ravi@ximian.com>
21132 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21133 instead of a Literal - much easier.
21135 (EnumInTransit): Remove - utterly useless :-)
21137 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21139 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21141 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21142 chain when we have no associated expression.
21144 2001-11-30 Ravi Pratap <ravi@ximian.com>
21146 * constant.cs (Define): Use Location while reporting the errror.
21148 Also emit a warning when 'new' is used and there is no inherited
21151 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
21154 (LookupEnumValue): Implement to lookup an enum member's value and define it
21157 (Populate): Re-write accordingly to use the above routine.
21159 2001-11-27 Miguel de Icaza <miguel@ximian.com>
21161 * expression.cs (This): Fix prototype for DoResolveLValue to
21162 override the base class DoResolveLValue.
21164 * cs-parser.cs: Report errors cs574 and cs575 (destructor
21167 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21168 (we need to load the address of the field here). This fixes
21171 (FieldExpr.DoResolveLValue): Call the DoResolve
21172 function to initialize the Instance expression.
21174 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21175 correctly the GetEnumerator operation on a value type.
21177 * cs-parser.jay: Add more simple parsing error catches.
21179 * statement.cs (Switch): Add support for string switches.
21180 Handle null specially.
21182 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
21184 2001-11-28 Ravi Pratap <ravi@ximian.com>
21186 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21188 (declare_local_constant): New helper function.
21190 * statement.cs (AddConstant): Keep a separate record of constants
21192 (IsConstant): Implement to determine if a variable is a constant.
21194 (GetConstantExpression): Implement.
21196 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21198 * statement.cs (IsVariableDefined): Re-write.
21200 2001-11-27 Ravi Pratap <ravi@ximian.com>
21202 * class.cs (TypeContainer::FindMembers): Look for constants
21203 in the case when we are looking for MemberTypes.Field
21205 * expression.cs (MemberAccess::DoResolve): Check that in the
21206 case we are a FieldExpr and a Literal, we are not being accessed
21207 by an instance reference.
21209 * cs-parser.jay (local_constant_declaration): Implement.
21211 (declaration_statement): Implement for constant declarations.
21213 2001-11-26 Miguel de Icaza <miguel@ximian.com>
21215 * statement.cs (Switch): Catch double defaults.
21217 (Switch): More work on the switch() statement
21218 implementation. It works for integral values now, need to finish
21222 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21224 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21225 integer literals into other integer literals. To be used by
21228 2001-11-24 Ravi Pratap <ravi@ximian.com>
21230 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21233 (EmitDynamicInitializers): Cope with the above since we extract data
21234 directly from ArrayData now.
21236 (ExpectInitializers): Keep track of whether initializers are mandatory
21239 (Bounds): Make it a hashtable to prevent the same dimension being
21240 recorded for every element in that dimension.
21242 (EmitDynamicInitializers): Fix bug which prevented the Set array method
21245 Also fix bug which was causing the indices to be emitted in the reverse
21248 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21250 * expression.cs (ArrayCreation): Implement the bits that Ravi left
21251 unfinished. They do not work, because the underlying code is
21254 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21256 * cs-parser.jay: Remove bogus fixme.
21258 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21259 on Switch statement.
21261 2001-11-23 Ravi Pratap <ravi@ximian.com>
21263 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21266 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21267 parameter. Apparently, any expression is allowed.
21269 (ValidateInitializers): Update accordingly.
21271 (CheckIndices): Fix some tricky bugs thanks to recursion.
21273 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
21274 I was being completely brain-dead.
21276 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21277 and re-write acordingly.
21279 (DelegateInvocation): Re-write accordingly.
21281 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21283 (MakeByteBlob): Handle types more correctly.
21285 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21286 initialization from expressions but it is incomplete because I am a complete
21289 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21291 * statement.cs (If.Emit): Fix a bug that generated incorrect code
21292 on If. Basically, we have to return `true' (ie, we do return to
21293 our caller) only if both branches of the if return.
21295 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21296 short-circuit operators, handle them as short circuit operators.
21298 (Cast.DoResolve): Resolve type.
21299 (Cast.Cast): Take an expression as the target type.
21301 * cs-parser.jay (cast_expression): Remove old hack that only
21302 allowed a limited set of types to be handled. Now we take a
21303 unary_expression and we resolve to a type during semantic
21306 Use the grammar productions from Rhys to handle casts (this is
21307 not complete like Rhys syntax yet, we fail to handle that corner
21308 case that C# has regarding (-x), but we will get there.
21310 2001-11-22 Ravi Pratap <ravi@ximian.com>
21312 * class.cs (EmitFieldInitializer): Take care of the case when we have a
21313 field which is an array type.
21315 * cs-parser.jay (declare_local_variables): Support array initialization too.
21317 * typemanager.cs (MakeKey): Implement.
21319 (everywhere): Use the above appropriately.
21321 * cs-parser.jay (for_statement): Update for array initialization while
21322 declaring variables.
21324 * ecore.cs : The error message was correct, it's the variable's names that
21325 were misleading ;-) Make the code more readable.
21327 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21328 the correct type etc.
21330 (ConvertExplicit): Handle Enum types by examining the underlying type.
21332 2001-11-21 Ravi Pratap <ravi@ximian.com>
21334 * parameter.cs (GetCallingConvention): Always return
21335 CallingConventions.Standard for now.
21337 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21339 * expression.cs (Binary.ResolveOperator): Update the values of `l'
21340 and `r' after calling DoNumericPromotions.
21342 * ecore.cs: Fix error message (the types were in the wrong order).
21344 * statement.cs (Foreach.ProbeCollectionType): Need to pass
21345 BindingFlags.Instance as well
21347 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21348 implicit int literal conversion in an empty cast so that we
21349 propagate the right type upstream.
21351 (UnboxCast): new class used to unbox value types.
21352 (Expression.ConvertExplicit): Add explicit type conversions done
21355 (Expression.ImplicitNumericConversion): Oops, forgot to test for
21356 the target type before applying the implicit LongLiterals to ULong
21359 2001-11-21 Miguel de Icaza <miguel@ximian.com>
21361 * cs-parser.jay (for_statement): Reworked the way For works: now
21362 we declare manually any variables that are introduced in
21363 for_initializer to solve the problem of having out-of-band code
21364 emition (that is what got for broken).
21366 (declaration_statement): Perform the actual variable declaration
21367 that used to be done in local_variable_declaration here.
21369 (local_variable_declaration): Do not declare anything, just pass
21370 the information on a DictionaryEntry
21372 2001-11-20 Ravi Pratap <ravi@ximian.com>
21374 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21375 re-write of the logic to now make it recursive.
21377 (UpdateIndices): Re-write accordingly.
21379 Store element data in a separate ArrayData list in the above methods.
21381 (MakeByteBlob): Implement to dump the array data into a byte array.
21383 2001-11-19 Ravi Pratap <ravi@ximian.com>
21385 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21388 * constant.cs (Define): Implement.
21390 (EmitConstant): Re-write fully.
21392 Pass in location info.
21394 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21397 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21398 DictionaryEntry since we need location info too.
21400 (constant_declaration): Update accordingly.
21402 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21403 code into another method : UpdateIndices.
21405 2001-11-18 Ravi Pratap <ravi@ximian.com>
21407 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21408 some type checking etc.
21410 2001-11-17 Ravi Pratap <ravi@ximian.com>
21412 * expression.cs (ArrayCreation::ValidateInitializers): Implement
21413 bits to provide dimension info if the user skips doing that.
21415 Update second constructor to store the rank correctly.
21417 2001-11-16 Ravi Pratap <ravi@ximian.com>
21419 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21420 and try to implement.
21422 * ../errors/cs0150.cs : Add.
21424 * ../errors/cs0178.cs : Add.
21426 2001-11-16 Miguel de Icaza <miguel@ximian.com>
21428 * statement.cs: Implement foreach on multi-dimensional arrays.
21430 * parameter.cs (Parameters.GetParameterByName): Also lookup the
21431 name of the params argument.
21433 * expression.cs: Use EmitStoreOpcode to get the right opcode while
21434 initializing the array.
21436 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21437 we can use this elsewhere.
21439 * statement.cs: Finish implementation of foreach for single
21442 * cs-parser.jay: Use an out-of-band stack to pass information
21443 around, I wonder why I need this.
21445 foreach_block: Make the new foreach_block the current_block.
21447 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21448 function used to return a static Parameters structure. Used for
21449 empty parameters, as those are created very frequently.
21451 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21453 2001-11-15 Ravi Pratap <ravi@ximian.com>
21455 * interface.cs : Default modifier is private, not public. The
21456 make verify test passes again.
21458 2001-11-15 Ravi Pratap <ravi@ximian.com>
21460 * support.cs (ReflectionParameters): Fix logic to determine
21461 whether the last parameter is a params one. Test 9 passes again.
21463 * delegate.cs (Populate): Register the builders we define with
21464 RegisterParameterForBuilder. Test 19 passes again.
21466 * cs-parser.jay (property_declaration): Reference $6 instead
21467 of $$ to get at the location.
21469 (indexer_declaration): Similar stuff.
21471 (attribute): Ditto.
21473 * class.cs (Property): Register parameters for the Get and Set methods
21474 if they exist. Test 23 passes again.
21476 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21477 call to EmitArguments as we are sure there aren't any params arguments.
21478 Test 32 passes again.
21480 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21481 IndexOutOfRangeException.
21483 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21484 Test 33 now passes again.
21486 2001-11-15 Miguel de Icaza <miguel@ximian.com>
21488 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21489 broke a bunch of things. Will have to come up with a better way
21490 of tracking locations.
21492 * statement.cs: Implemented foreach for single dimension arrays.
21494 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21496 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21497 an error. This removes the lookup from the critical path.
21499 * cs-parser.jay: Removed use of temporary_loc, which is completely
21502 2001-11-14 Miguel de Icaza <miguel@ximian.com>
21504 * support.cs (ReflectionParameters.ParameterModifier): Report
21505 whether the argument is a PARAMS argument or not.
21507 * class.cs: Set the attribute `ParamArrayAttribute' on the
21508 parameter argument.
21510 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21511 and cons_param_array_attribute (ConstructorInfo for
21512 ParamArrayAttribute).,
21514 * codegen.cs: Emit the return using the `Return' statement, that
21515 way we can report the error correctly for missing return values.
21517 * class.cs (Method.Emit): Clean up.
21519 * expression.cs (Argument.Resolve): Take another argument: the
21520 location where this argument is used. Notice that this is not
21521 part of the "Argument" class as to reduce the size of the
21522 structure (we know the approximate location anyways).
21524 Test if the argument is a variable-reference, if not, then
21525 complain with a 206.
21527 (Argument.Emit): Emit addresses of variables.
21529 (Argument.FullDesc): Simplify.
21531 (Invocation.DoResolve): Update for Argument.Resolve.
21533 (ElementAccess.DoResolve): ditto.
21535 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21536 method should be virtual, as this method is always virtual.
21538 (NewDelegate.DoResolve): Update for Argument.Resolve.
21540 * class.cs (ConstructorInitializer.DoResolve): ditto.
21542 * attribute.cs (Attribute.Resolve): ditto.
21544 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21546 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21548 * expression.cs (ParameterReference): Drop IStackStorage and implement
21549 IAssignMethod instead.
21551 (LocalVariableReference): ditto.
21553 * ecore.cs (FieldExpr): Drop IStackStorage and implement
21554 IAssignMethod instead.
21556 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21558 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21559 enumerations that are used in heavily used structures derive from
21560 byte in a laughable and pathetic attempt to reduce memory usage.
21561 This is the kind of pre-optimzations that you should not do at
21562 home without adult supervision.
21564 * expression.cs (UnaryMutator): New class, used to handle ++ and
21565 -- separatedly from the other unary operators. Cleans up the
21566 code, and kills the ExpressionStatement dependency in Unary.
21568 (Unary): Removed `method' and `Arguments' from this class, making
21569 it smaller, and moving it all to SimpleCall, so I can reuse this
21570 code in other locations and avoid creating a lot of transient data
21571 strucutres when not required.
21573 * cs-parser.jay: Adjust for new changes.
21575 2001-11-11 Miguel de Icaza <miguel@ximian.com>
21577 * enum.cs (Enum.Populate): If there is a failure during
21580 * cs-parser.jay (opt_enum_base): we used to catch type errors
21581 here, but this is really incorrect. The type error should be
21582 catched during semantic analysis.
21584 2001-12-11 Ravi Pratap <ravi@ximian.com>
21586 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21587 current_local_parameters as expected since I, in my stupidity, had forgotten
21590 * attribute.cs (GetValidPlaces): Fix stupid bug.
21592 * class.cs (Method::Emit): Perform check on applicability of attributes.
21594 (Constructor::Emit): Ditto.
21596 (Field::Emit): Ditto.
21598 (Field.Location): Store location information.
21600 (Property, Event, Indexer, Operator): Ditto.
21602 * cs-parser.jay (field_declaration): Pass in location for each field.
21604 * ../errors/cs0592.cs : Add.
21606 2001-11-12 Ravi Pratap <ravi@ximian.com>
21608 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21610 (InitCoreTypes): Update accordingly.
21612 (RegisterAttrType, LookupAttr): Implement.
21614 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21615 info about the same.
21617 (Resolve): Update to populate the above as necessary.
21619 (Error592): Helper.
21621 (GetValidPlaces): Helper to the above.
21623 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21625 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21627 2001-11-12 Ravi Pratap <ravi@ximian.com>
21629 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21631 * ../errors/cs0617.cs : Add.
21633 2001-11-11 Ravi Pratap <ravi@ximian.com>
21635 * enum.cs (Emit): Rename to Populate to be more consistent with what
21636 we expect it to do and when exactly it is called.
21638 * class.cs, rootcontext.cs : Update accordingly.
21640 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21641 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21643 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21645 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21646 of a fieldinfo using the above, when dealing with a FieldBuilder.
21648 2001-11-10 Ravi Pratap <ravi@ximian.com>
21650 * ../errors/cs0031.cs : Add.
21652 * ../errors/cs1008.cs : Add.
21654 * ../errrors/cs0543.cs : Add.
21656 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21659 (FindMembers): Implement.
21661 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21662 enums and delegates too.
21664 (enum_types): Rename to builder_to_enum.
21666 (delegate_types): Rename to builder_to_delegate.
21668 * delegate.cs (FindMembers): Implement.
21670 2001-11-09 Ravi Pratap <ravi@ximian.com>
21672 * typemanager.cs (IsEnumType): Implement.
21674 * enum.cs (Emit): Re-write parts to account for the underlying type
21675 better and perform checking etc.
21677 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21678 of the underlying type.
21680 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21683 * enum.cs (error31): Helper to report error #31.
21685 * cs-parser.jay (enum_declaration): Store location of each member too.
21687 * enum.cs (member_to_location): New hashtable.
21689 (AddEnumMember): Update location hashtable.
21691 (Emit): Use the location of each member while reporting errors.
21693 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21695 * cs-parser.jay: A for_initializer if is a
21696 local_variable_declaration really ammount to have an implicit
21697 block with the variable declaration and no initializer for for.
21699 * statement.cs (For.Emit): Cope with null initializers.
21701 This fixes the infinite loop on for initializers.
21703 2001-11-08 Miguel de Icaza <miguel@ximian.com>
21705 * enum.cs: More cleanup.
21707 * ecore.cs: Remove dead code.
21709 * class.cs (Property.Emit): More simplification.
21710 (Event.Emit): ditto.
21712 Reworked to have less levels of indentation.
21714 2001-11-08 Ravi Pratap <ravi@ximian.com>
21716 * class.cs (Property): Emit attributes.
21726 * enum.cs (Emit): Ditto.
21728 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21731 * class.cs (Field, Event, etc.): Move attribute generation into the
21732 Emit method everywhere.
21734 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21735 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21736 as we had no way of defining nested enums !
21738 * rootcontext.cs : Adjust code accordingly.
21740 * typemanager.cs (AddEnumType): To keep track of enum types separately.
21742 2001-11-07 Ravi Pratap <ravi@ximian.com>
21744 * expression.cs (EvalConstantExpression): Move into ecore.cs
21746 * enum.cs (Enum): Rename some members and make them public and readonly
21747 according to our convention.
21749 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21752 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21754 (Enum::Emit): Write a simple version for now which doesn't try to compute
21755 expressions. I shall modify this to be more robust in just a while.
21757 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21759 (TypeContainer::CloseType): Create the Enum types too.
21761 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21763 * expression.cs (EvalConstantExpression): Get rid of completely.
21765 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21766 user-defined values and other cases.
21768 (IsValidEnumLiteral): Helper function.
21770 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
21771 out there in the case we had a literal FieldExpr.
21773 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21775 (Literalize): Revamp a bit to take two arguments.
21777 (EnumLiteral): New class which derives from Literal to wrap enum literals.
21779 2001-11-06 Ravi Pratap <ravi@ximian.com>
21781 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21783 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21785 (Resolve): Use the above to ensure we have proper initializers.
21787 2001-11-05 Ravi Pratap <ravi@ximian.com>
21789 * expression.cs (Expression::EvalConstantExpression): New method to
21790 evaluate constant expressions.
21792 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21794 2001-11-07 Miguel de Icaza <miguel@ximian.com>
21796 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21799 (Binary.ResolveOperator): Handle operator != (object a, object b)
21800 and operator == (object a, object b);
21802 (Binary.DoNumericPromotions): Indicate whether the numeric
21803 promotion was possible.
21805 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21808 Made the ArrayAccess implement interface IAssignMethod instead of
21809 IStackStore as the order in which arguments are passed reflects
21812 * assign.cs: Instead of using expr.ExprClass to select the way of
21813 assinging, probe for the IStackStore/IAssignMethod interfaces.
21815 * typemanager.cs: Load InitializeArray definition.
21817 * rootcontext.cs (RootContext.MakeStaticData): Used to define
21818 static data that can be used to initialize arrays.
21820 2001-11-05 Miguel de Icaza <miguel@ximian.com>
21822 * expression.cs: Handle operator== and operator!= for booleans.
21824 (Conditioal.Reduce): Implement reducer for the ?: operator.
21826 (Conditional.Resolve): Implement dead code elimination.
21828 (Binary.Resolve): Catch string literals and return a new
21829 concatenated string.
21831 (Unary.Reduce): Implement reduction of unary expressions.
21833 * ecore.cs: Split out the expression core handling here.
21835 (Expression.Reduce): New method used to perform constant folding
21836 and CSE. This is needed to support constant-expressions.
21838 * statement.cs (Statement.EmitBoolExpression): Pass true and false
21839 targets, and optimize for !x.
21841 2001-11-04 Ravi Pratap <ravi@ximian.com>
21843 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21844 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21845 set custom atttributes.
21847 * literal.cs (Literal::GetValue): New abstract method to return the actual
21848 value of the literal, cast as an object.
21850 (*Literal): Implement GetValue method.
21852 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21853 expressions to the arraylist but objects of type Argument.
21855 * class.cs (TypeContainer::Emit): Emit our attributes too.
21857 (Method::Emit, Constructor::Emit): Ditto.
21859 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21860 to be ignoring earlier.
21862 2001-11-03 Ravi Pratap <ravi@ximian.com>
21864 * attribute.cs (AttributeSection::Define): Implement to do the business
21865 of constructing a CustomAttributeBuilder.
21867 (Attribute): New trivial class. Increases readability of code.
21869 * cs-parser.jay : Update accordingly.
21871 (positional_argument_list, named_argument_list, named_argument): New rules
21873 (attribute_arguments): Use the above so that we are more correct.
21875 2001-11-02 Ravi Pratap <ravi@ximian.com>
21877 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21878 to perform all checks for a method with a params parameter.
21880 (Invocation::OverloadResolve): Update to use the above method and therefore
21881 cope correctly with params method invocations.
21883 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
21886 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21887 constructors in our parent too because we can't afford to miss out on
21890 * attribute.cs (AttributeSection): New name for the class Attribute
21892 Other trivial changes to improve readability.
21894 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21895 use the new class names.
21897 2001-11-01 Ravi Pratap <ravi@ximian.com>
21899 * class.cs (Method::Define): Complete definition for params types too
21901 (Indexer::Define): Ditto.
21903 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21904 Cope everywhere with a request for info about the array parameter.
21906 2001-11-01 Ravi Pratap <ravi@ximian.com>
21908 * tree.cs (RecordNamespace): Fix up to check for the correct key.
21910 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
21911 local_variable_type to extract the string corresponding to the type.
21913 (local_variable_type): Fixup the action to use the new helper method.
21915 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
21918 * expression.cs : Clean out code which uses the above.
21920 2001-10-31 Ravi Pratap <ravi@ximian.com>
21922 * typemanager.cs (RegisterMethod): Check if we already have an existing key
21923 and bale out if necessary by returning a false.
21925 (RegisterProperty): Ditto.
21927 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21928 and print out appropriate error messages.
21930 * interface.cs (everywhere): Ditto.
21932 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21933 location to constructor.
21935 * class.cs (Property, Event, Indexer): Update accordingly.
21937 * ../errors/cs111.cs : Added.
21939 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21940 of a method, as laid down by the spec.
21942 (Invocation::OverloadResolve): Use the above method.
21944 2001-10-31 Ravi Pratap <ravi@ximian.com>
21946 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21947 now take a TypeContainer and a Parameters object.
21949 (ParameterData): Modify return type of ParameterModifier method to be
21950 Parameter.Modifier and not a string.
21952 (ReflectionParameters, InternalParameters): Update accordingly.
21954 * expression.cs (Argument::GetParameterModifier): Same here.
21956 * support.cs (InternalParameters::ParameterType): Find a better way of determining
21957 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21958 symbol in it at all so maybe this is only for now.
21960 2001-10-30 Ravi Pratap <ravi@ximian.com>
21962 * support.cs (InternalParameters): Constructor now takes an extra argument
21963 which is the actual Parameters class.
21965 (ParameterDesc): Update to provide info on ref/out modifiers.
21967 * class.cs (everywhere): Update call to InternalParameters to pass in
21968 the second argument too.
21970 * support.cs (ParameterData): Add ParameterModifier, which is a method
21971 to return the modifier info [ref/out etc]
21973 (InternalParameters, ReflectionParameters): Implement the above.
21975 * expression.cs (Argument::ParameterModifier): Similar function to return
21976 info about the argument's modifiers.
21978 (Invocation::OverloadResolve): Update to take into account matching modifiers
21981 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21982 a new SetFormalParameters object which we pass to InternalParameters.
21984 2001-10-30 Ravi Pratap <ravi@ximian.com>
21986 * expression.cs (NewArray): Merge into the ArrayCreation class.
21988 2001-10-29 Ravi Pratap <ravi@ximian.com>
21990 * expression.cs (NewArray): Merge classes NewBuiltinArray and
21991 NewUserdefinedArray into one as there wasn't much of a use in having
21994 * expression.cs (Argument): Change field's name to ArgType from Type.
21996 (Type): New readonly property which returns the proper type, taking into
21997 account ref/out modifiers.
21999 (everywhere): Adjust code accordingly for the above.
22001 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22002 whether we are emitting for a ref or out parameter.
22004 * expression.cs (Argument::Emit): Use the above field to set the state.
22006 (LocalVariableReference::Emit): Update to honour the flag and emit the
22009 * parameter.cs (Attributes): Set the correct flags for ref parameters.
22011 * expression.cs (Argument::FullDesc): New function to provide a full desc.
22013 * support.cs (ParameterData): Add method ParameterDesc to the interface.
22015 (ReflectionParameters, InternalParameters): Implement the above method.
22017 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22020 (Invocation::FullMethodDesc): Ditto.
22022 2001-10-29 Miguel de Icaza <miguel@ximian.com>
22024 * cs-parser.jay: Add extra production for the second form of array
22027 * expression.cs (ArrayCreation): Update to reflect the above
22030 * Small changes to prepare for Array initialization.
22032 2001-10-28 Miguel de Icaza <miguel@ximian.com>
22034 * typemanager.cs (ImplementsInterface): interface might be null;
22035 Deal with this problem;
22037 Also, we do store negative hits on the cache (null values), so use
22038 this instead of calling t.GetInterfaces on the type everytime.
22040 2001-10-28 Ravi Pratap <ravi@ximian.com>
22042 * typemanager.cs (IsBuiltinType): New method to help determine the same.
22044 * expression.cs (New::DoResolve): Get rid of array creation code and instead
22045 split functionality out into different classes.
22047 (New::FormArrayType): Move into NewBuiltinArray.
22049 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22052 (NewBuiltinArray): New class to handle creation of built-in arrays.
22054 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22055 account creation of one-dimensional arrays.
22057 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22059 (NewUserdefinedArray::DoResolve): Implement.
22061 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22063 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22064 we maintain inside the TypeManager. This is necessary to perform lookups on the
22067 (LookupType): Update to perform GetType on the module builders too.
22069 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22071 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22073 2001-10-23 Ravi Pratap <ravi@ximian.com>
22075 * expression.cs (New::DoResolve): Implement guts of array creation.
22077 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22079 2001-10-27 Miguel de Icaza <miguel@ximian.com>
22081 * expression.cs: Fix bug I introduced lsat night that broke
22084 (Expression.Resolve): Report a 246 error (can not resolve name)
22085 if we find a SimpleName in the stream.
22087 (Expression.ResolveLValue): Ditto.
22089 (Expression.ResolveWithSimpleName): This function is a variant of
22090 ResolveName, this one allows SimpleNames to be returned without a
22091 warning. The only consumer of SimpleNames is MemberAccess
22093 2001-10-26 Miguel de Icaza <miguel@ximian.com>
22095 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22096 might arrive here. I have my doubts that this is correct.
22098 * statement.cs (Lock): Implement lock statement.
22100 * cs-parser.jay: Small fixes to support `lock' and `using'
22102 * cs-tokenizer.cs: Remove extra space
22104 * driver.cs: New flag --checked, allows to turn on integer math
22107 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22108 Threading.Monitor.Exit
22110 2001-10-23 Miguel de Icaza <miguel@ximian.com>
22112 * expression.cs (IndexerAccess::DoResolveLValue): Set the
22113 Expression Class to be IndexerAccess.
22115 Notice that Indexer::DoResolve sets the eclass to Value.
22117 2001-10-22 Miguel de Icaza <miguel@ximian.com>
22119 * class.cs (TypeContainer::Emit): Emit code for indexers.
22121 * assign.cs (IAssignMethod): New interface implemented by Indexers
22122 and Properties for handling assignment.
22124 (Assign::Emit): Simplify and reuse code.
22126 * expression.cs (IndexerAccess, PropertyExpr): Implement
22127 IAssignMethod, clean up old code.
22129 2001-10-22 Ravi Pratap <ravi@ximian.com>
22131 * typemanager.cs (ImplementsInterface): New method to determine if a type
22132 implements a given interface. Provides a nice cache too.
22134 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22137 (ConvertReferenceExplicit): Ditto.
22139 * delegate.cs (Delegate::Populate): Update to define the parameters on the
22140 various methods, with correct names etc.
22142 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
22143 Operator.UnaryNegation.
22145 * cs-parser.jay (operator_declarator): Be a little clever in the case where
22146 we have a unary plus or minus operator.
22148 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
22151 * everywhere : update accordingly.
22153 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22156 * class.cs (Method::Define): For the case where we are implementing a method
22157 inherited from an interface, we need to set the MethodAttributes.Final flag too.
22158 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22160 2001-10-21 Ravi Pratap <ravi@ximian.com>
22162 * interface.cs (FindMembers): Implement to work around S.R.E
22165 * typemanager.cs (IsInterfaceType): Implement.
22167 (FindMembers): Update to handle interface types too.
22169 * expression.cs (ImplicitReferenceConversion): Re-write bits which
22170 use IsAssignableFrom as that is not correct - it doesn't work.
22172 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22173 and accordingly override EmitStatement.
22175 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22176 using the correct logic :-)
22178 2001-10-19 Ravi Pratap <ravi@ximian.com>
22180 * ../errors/cs-11.cs : Add to demonstrate error -11
22182 2001-10-17 Miguel de Icaza <miguel@ximian.com>
22184 * assign.cs (Assign::Resolve): Resolve right hand side first, and
22185 then pass this as a hint to ResolveLValue.
22187 * expression.cs (FieldExpr): Add Location information
22189 (FieldExpr::LValueResolve): Report assignment to readonly
22192 (Expression::ExprClassFromMemberInfo): Pass location information.
22194 (Expression::ResolveLValue): Add new method that resolves an
22197 (Expression::DoResolveLValue): Default invocation calls
22200 (Indexers): New class used to keep track of indexers in a given
22203 (IStackStore): Renamed from LValue, as it did not really describe
22204 what this did. Also ResolveLValue is gone from this interface and
22205 now is part of Expression.
22207 (ElementAccess): Depending on the element access type
22209 * typemanager.cs: Add `indexer_name_type' as a Core type
22210 (System.Runtime.CompilerServices.IndexerNameAttribute)
22212 * statement.cs (Goto): Take a location.
22214 2001-10-18 Ravi Pratap <ravi@ximian.com>
22216 * delegate.cs (Delegate::VerifyDelegate): New method to verify
22217 if two delegates are compatible.
22219 (NewDelegate::DoResolve): Update to take care of the case when
22220 we instantiate a delegate from another delegate.
22222 * typemanager.cs (FindMembers): Don't even try to look up members
22223 of Delegate types for now.
22225 2001-10-18 Ravi Pratap <ravi@ximian.com>
22227 * delegate.cs (NewDelegate): New class to take care of delegate
22230 * expression.cs (New): Split the delegate related code out into
22231 the NewDelegate class.
22233 * delegate.cs (DelegateInvocation): New class to handle delegate
22236 * expression.cs (Invocation): Split out delegate related code into
22237 the DelegateInvocation class.
22239 2001-10-17 Ravi Pratap <ravi@ximian.com>
22241 * expression.cs (New::DoResolve): Implement delegate creation fully
22242 and according to the spec.
22244 (New::DoEmit): Update to handle delegates differently.
22246 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22247 because of which we were printing out arguments in reverse order !
22249 * delegate.cs (VerifyMethod): Implement to check if the given method
22250 matches the delegate.
22252 (FullDelegateDesc): Implement.
22254 (VerifyApplicability): Implement.
22256 * expression.cs (Invocation::DoResolve): Update to accordingly handle
22257 delegate invocations too.
22259 (Invocation::Emit): Ditto.
22261 * ../errors/cs1593.cs : Added.
22263 * ../errors/cs1594.cs : Added.
22265 * delegate.cs (InstanceExpression, TargetMethod): New properties.
22267 2001-10-16 Ravi Pratap <ravi@ximian.com>
22269 * typemanager.cs (intptr_type): Core type for System.IntPtr
22271 (InitCoreTypes): Update for the same.
22273 (iasyncresult_type, asynccallback_type): Ditto.
22275 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22278 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22281 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22282 the builders for the 4 members of a delegate type :-)
22284 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22287 * expression.cs (New::DoResolve): Implement guts for delegate creation.
22289 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22291 2001-10-15 Miguel de Icaza <miguel@ximian.com>
22293 * statement.cs (Break::Emit): Implement.
22294 (Continue::Emit): Implement.
22296 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
22297 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
22298 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
22299 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
22302 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22303 properties that track the label for the current loop (begin of the
22304 loop and end of the loop).
22306 2001-10-15 Ravi Pratap <ravi@ximian.com>
22308 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22309 use of emitting anything at all.
22311 * class.cs, rootcontext.cs : Get rid of calls to the same.
22313 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22315 (Populate): Define the constructor correctly and set the implementation
22318 * typemanager.cs (delegate_types): New hashtable to hold delegates that
22321 (AddDelegateType): Implement.
22323 (IsDelegateType): Implement helper method.
22325 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22327 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22328 and accordingly handle it.
22330 * delegate.cs (Populate): Take TypeContainer argument.
22331 Implement bits to define the Invoke method. However, I still haven't figured out
22332 how to take care of the native int bit :-(
22334 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
22335 Qualify the name of the delegate, not its return type !
22337 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22340 (StandardConversionExists): Checking for array types turns out to be recursive.
22342 (ConvertReferenceExplicit): Implement array conversion.
22344 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22346 2001-10-12 Ravi Pratap <ravi@ximian.com>
22348 * cs-parser.jay (delegate_declaration): Store the fully qualified
22349 name as it is a type declaration.
22351 * delegate.cs (ReturnType, Name): Rename members to these. Make them
22354 (DefineDelegate): Renamed from Define. Does the same thing essentially,
22355 as TypeContainer::DefineType.
22357 (Populate): Method in which all the definition of the various methods (Invoke)
22360 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22363 (CloseDelegate): Finally creates the delegate.
22365 * class.cs (TypeContainer::DefineType): Update to define delegates.
22366 (Populate, Emit and CloseType): Do the same thing here too.
22368 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22369 delegates in all these operations.
22371 2001-10-14 Miguel de Icaza <miguel@ximian.com>
22373 * expression.cs: LocalTemporary: a new expression used to
22374 reference a temporary that has been created.
22376 * assign.cs: Handle PropertyAccess back here, so that we can
22377 provide the proper semantic access to properties.
22379 * expression.cs (Expression::ConvertReferenceExplicit): Implement
22380 a few more explicit conversions.
22382 * modifiers.cs: `NEW' modifier maps to HideBySig.
22384 * expression.cs (PropertyExpr): Make this into an
22385 ExpressionStatement, and support the EmitStatement code path.
22387 Perform get/set error checking, clean up the interface.
22389 * assign.cs: recognize PropertyExprs as targets, and if so, turn
22390 them into toplevel access objects.
22392 2001-10-12 Miguel de Icaza <miguel@ximian.com>
22394 * expression.cs: PropertyExpr::PropertyExpr: use work around the
22397 * typemanager.cs: Keep track here of our PropertyBuilders again to
22398 work around lameness in SRE.
22400 2001-10-11 Miguel de Icaza <miguel@ximian.com>
22402 * expression.cs (LValue::LValueResolve): New method in the
22403 interface, used to perform a second resolution pass for LValues.
22405 (This::DoResolve): Catch the use of this in static methods.
22407 (This::LValueResolve): Implement.
22409 (This::Store): Remove warning, assigning to `this' in structures
22412 (Invocation::Emit): Deal with invocation of
22413 methods on value types. We need to pass the address to structure
22414 methods rather than the object itself. (The equivalent code to
22415 emit "this" for structures leaves the entire structure on the
22416 stack instead of a pointer to it).
22418 (ParameterReference::DoResolve): Compute the real index for the
22419 argument based on whether the method takes or not a `this' pointer
22420 (ie, the method is static).
22422 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22423 value types returned from functions when we need to invoke a
22424 method on the sturcture.
22427 2001-10-11 Ravi Pratap <ravi@ximian.com>
22429 * class.cs (TypeContainer::DefineType): Method to actually do the business of
22430 defining the type in the Modulebuilder or Typebuilder. This is to take
22431 care of nested types which need to be defined on the TypeBuilder using
22432 DefineNestedMethod.
22434 (TypeContainer::GetClassBases): Implement. Essentially the code from the
22435 methods in RootContext, only ported to be part of TypeContainer.
22437 (TypeContainer::GetInterfaceOrClass): Ditto.
22439 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22441 * interface.cs (Interface::DefineInterface): New method. Does exactly
22442 what RootContext.CreateInterface did earlier, only it takes care of nested types
22445 (Interface::GetInterfaces): Move from RootContext here and port.
22447 (Interface::GetInterfaceByName): Same here.
22449 * rootcontext.cs (ResolveTree): Re-write.
22451 (PopulateTypes): Re-write.
22453 * class.cs (TypeContainer::Populate): Populate nested types too.
22454 (TypeContainer::Emit): Emit nested members too.
22456 * typemanager.cs (AddUserType): Do not make use of the FullName property,
22457 instead just use the name argument passed in as it is already fully
22460 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22461 to TypeContainer mapping to see if a type is user-defined.
22463 * class.cs (TypeContainer::CloseType): Implement.
22465 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22466 the default constructor.
22468 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22471 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22473 * interface.cs (CloseType): Create the type here.
22475 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22478 Remove all the methods which are now in TypeContainer.
22480 2001-10-10 Ravi Pratap <ravi@ximian.com>
22482 * delegate.cs (Define): Re-write bits to define the delegate
22485 2001-10-10 Miguel de Icaza <miguel@ximian.com>
22487 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22489 * expression.cs (ImplicitReferenceConversion): handle null as well
22490 as a source to convert to any reference type.
22492 * statement.cs (Return): Perform any implicit conversions to
22493 expected return type.
22495 Validate use of return statement.
22497 * codegen.cs (EmitContext): Pass the expected return type here.
22499 * class.cs (Method, Constructor, Property): Pass expected return
22500 type to EmitContext.
22502 2001-10-09 Miguel de Icaza <miguel@ximian.com>
22504 * expression.cs: Make DoResolve take an EmitContext instead of a
22507 Replaced `l' and `location' for `loc', for consistency.
22509 (Error, Warning): Remove unneeded Tc argument.
22511 * assign.cs, literal.cs, constant.cs: Update to new calling
22514 * codegen.cs: EmitContext now contains a flag indicating whether
22515 code is being generated in a static method or not.
22517 * cs-parser.jay: DecomposeQI, new function that replaces the old
22518 QualifiedIdentifier. Now we always decompose the assembled
22519 strings from qualified_identifier productions into a group of
22522 2001-10-08 Miguel de Icaza <miguel@ximian.com>
22524 * rootcontext.cs: Deal with field-less struct types correctly now
22525 by passing the size option to Define Type.
22527 * class.cs: Removed hack that created one static field.
22529 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22531 * statement.cs: Moved most of the code generation here.
22533 2001-10-09 Ravi Pratap <ravi@ximian.com>
22535 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22538 (ElementAccess): Remove useless bits for now - keep checks as the spec
22541 2001-10-08 Ravi Pratap <ravi@ximian.com>
22543 * expression.cs (ElementAccess::DoResolve): Remove my crap code
22544 and start performing checks according to the spec.
22546 2001-10-07 Ravi Pratap <ravi@ximian.com>
22548 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22549 rank_specifiers instead.
22551 (rank_specifiers): Change the order in which the rank specifiers are stored
22553 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22555 * expression.cs (ElementAccess): Implement the LValue interface too.
22557 2001-10-06 Ravi Pratap <ravi@ximian.com>
22559 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22560 except that user defined conversions are not included.
22562 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
22563 perform the conversion of the return type, if necessary.
22565 (New::DoResolve): Check whether we are creating an array or an object
22566 and accordingly do the needful.
22568 (New::Emit): Same here.
22570 (New::DoResolve): Implement guts of array creation.
22572 (New::FormLookupType): Helper function.
22574 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22576 * codegen.cs: Removed most of the code generation here, and move the
22577 corresponding code generation bits to the statement classes.
22579 Added support for try/catch/finalize and throw.
22581 * cs-parser.jay: Added support for try/catch/finalize.
22583 * class.cs: Catch static methods having the flags override,
22584 virtual or abstract.
22586 * expression.cs (UserCast): This user cast was not really doing
22587 what it was supposed to do. Which is to be born in fully resolved
22588 state. Parts of the resolution were being performed at Emit time!
22592 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22594 * expression.cs: Implicity convert the result from UserCast.
22596 2001-10-05 Ravi Pratap <ravi@ximian.com>
22598 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22599 prevented it from working correctly.
22601 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22602 merely ConvertImplicit.
22604 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22606 * typemanager.cs: Make the LookupTypeContainer function static,
22607 and not per-instance.
22609 * class.cs: Make static FindMembers (the one that takes a Type
22612 * codegen.cs: Add EmitForeach here.
22614 * cs-parser.jay: Make foreach a toplevel object instead of the
22615 inline expansion, as we need to perform semantic analysis on it.
22617 2001-10-05 Ravi Pratap <ravi@ximian.com>
22619 * expression.cs (Expression::ImplicitUserConversion): Rename to
22620 UserDefinedConversion.
22622 (Expression::UserDefinedConversion): Take an extra argument specifying
22623 whether we look for explicit user conversions too.
22625 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22627 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22629 (ExplicitUserConversion): Make it a call to UserDefinedConversion
22630 with the appropriate arguments.
22632 * cs-parser.jay (cast_expression): Record location too.
22634 * expression.cs (Cast): Record location info.
22636 (Expression::ConvertExplicit): Take location argument.
22638 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22639 to determine if we are doing explicit conversions.
22641 (UserCast::Emit): Update accordingly.
22643 (Expression::ConvertExplicit): Report an error if everything fails.
22645 * ../errors/cs0030.cs : Add.
22647 2001-10-04 Miguel de Icaza <miguel@ximian.com>
22649 * modifiers.cs: If the ABSTRACT keyword is present, also set the
22650 virtual and newslot bits.
22652 * class.cs (TypeContainer::RegisterRequiredImplementations):
22653 Record methods we need.
22655 (TypeContainer::MakeKey): Helper function to make keys for
22656 MethodBases, since the Methodbase key is useless.
22658 (TypeContainer::Populate): Call RegisterRequiredImplementations
22659 before defining the methods.
22661 Create a mapping for method_builders_to_methods ahead of time
22662 instead of inside a tight loop.
22664 (::RequireMethods): Accept an object as the data to set into the
22665 hashtable so we can report interface vs abstract method mismatch.
22667 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22669 * report.cs: Make all of it static.
22671 * rootcontext.cs: Drop object_type and value_type computations, as
22672 we have those in the TypeManager anyways.
22674 Drop report instance variable too, now it is a global.
22676 * driver.cs: Use try/catch on command line handling.
22678 Add --probe option to debug the error reporting system with a test
22681 * report.cs: Add support for exiting program when a probe
22682 condition is reached.
22684 2001-10-03 Ravi Pratap <ravi@ximian.com>
22686 * expression.cs (Binary::DoNumericPromotions): Fix the case when
22687 we do a forcible conversion regardless of type, to check if
22688 ForceConversion returns a null.
22690 (Binary::error19): Use location to report error.
22692 (Unary::error23): Use location here too.
22694 * ../errors/cs0019.cs : Check in.
22696 * ../errors/cs0023.cs : Check in.
22698 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22699 case of a non-null MethodInfo object with a length of 0 !
22701 (Binary::ResolveOperator): Flag error if overload resolution fails to find
22702 an applicable member - according to the spec :-)
22703 Also fix logic to find members in base types.
22705 (Unary::ResolveOperator): Same here.
22707 (Unary::report23): Change name to error23 and make first argument a TypeContainer
22708 as I was getting thoroughly confused between this and error19 :-)
22710 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22711 (::FindMostEncompassedType): Implement.
22712 (::FindMostEncompassingType): Implement.
22713 (::StandardConversionExists): Implement.
22715 (UserImplicitCast): Re-vamp. We now need info about most specific
22716 source and target types so that we can do the necessary conversions.
22718 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22719 mathematical union with no duplicates.
22721 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22723 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22724 in order from base classes to child classes, so that we can in
22725 child classes look up in our parent for method names and
22726 attributes (required for handling abstract, virtual, new, override
22727 constructs: we need to instrospect our base class, and if we dont
22728 populate the classes in order, the introspection might be
22729 incorrect. For example, a method could query its parent before
22730 the parent has any methods and would determine that the parent has
22731 no abstract methods (while it could have had them)).
22733 (RootContext::CreateType): Record the order in which we define the
22736 2001-10-02 Miguel de Icaza <miguel@ximian.com>
22738 * class.cs (TypeContainer::Populate): Also method definitions can
22739 fail now, keep track of this.
22741 (TypeContainer::FindMembers): Implement support for
22742 DeclaredOnly/noDeclaredOnly flag.
22744 (Constructor::Emit) Return the ConstructorBuilder.
22746 (Method::Emit) Return the MethodBuilder.
22747 Check for abstract or virtual methods to be public.
22749 * rootcontext.cs (RootContext::CreateType): Register all the
22750 abstract methods required for the class to be complete and the
22751 interface methods that must be implemented.
22753 * cs-parser.jay: Report error 501 (method requires body if it is
22754 not marked abstract or extern).
22756 * expression.cs (TypeOf::Emit): Implement.
22758 * typemanager.cs: runtime_handle_type, new global type.
22760 * class.cs (Property::Emit): Generate code for properties.
22762 2001-10-02 Ravi Pratap <ravi@ximian.com>
22764 * expression.cs (Unary::ResolveOperator): Find operators on base type
22765 too - we now conform exactly to the spec.
22767 (Binary::ResolveOperator): Same here.
22769 * class.cs (Operator::Define): Fix minor quirk in the tests.
22771 * ../errors/cs0215.cs : Added.
22773 * ../errors/cs0556.cs : Added.
22775 * ../errors/cs0555.cs : Added.
22777 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22779 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22780 single integer which is really efficient
22782 2001-10-01 Ravi Pratap <ravi@ximian.com>
22784 * expression.cs (Expression::ImplicitUserConversion): Use location
22785 even in the case when we are examining True operators.
22787 * class.cs (Operator::Define): Perform extensive checks to conform
22788 with the rules for operator overloading in the spec.
22790 * expression.cs (Expression::ImplicitReferenceConversion): Implement
22791 some of the other conversions mentioned in the spec.
22793 * typemanager.cs (array_type): New static member for the System.Array built-in
22796 (cloneable_interface): For System.ICloneable interface.
22798 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22799 we start resolving the tree and populating types.
22801 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22803 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22805 * expression.cs (Expression::ExprClassFromMemberInfo,
22806 Expression::Literalize): Create literal expressions from
22807 FieldInfos which are literals.
22809 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22810 type casts, because they were wrong. The test suite in tests
22813 (ImplicitNumericConversion): ushort to ulong requires a widening
22816 Int32 constant to long requires widening cast as well.
22818 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22819 for integers because the type on the stack is not i4.
22821 2001-09-30 Miguel de Icaza <miguel@ximian.com>
22823 * expression.cs (report118): require location argument.
22825 * parameter.cs: Do not dereference potential null value.
22827 * class.cs: Catch methods that lack the `new' keyword when
22828 overriding a name. Report warnings when `new' is used without
22829 anything being there to override.
22831 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22833 * class.cs: Only add constructor to hashtable if it is non-null
22834 (as now constructors can fail on define).
22836 (TypeManager, Class, Struct): Take location arguments.
22838 Catch field instance initialization in structs as errors.
22840 accepting_filter: a new filter for FindMembers that is static so
22841 that we dont create an instance per invocation.
22843 (Constructor::Define): Catch errors where a struct constructor is
22846 * cs-parser.jay: Pass location information for various new
22849 * delegate.cs (Delegate): take a location argument.
22851 * driver.cs: Do not call EmitCode if there were problesm in the
22852 Definition of the types, as many Builders wont be there.
22854 * decl.cs (Decl::Decl): Require a location argument.
22856 * cs-tokenizer.cs: Handle properly hex constants that can not fit
22857 into integers, and find the most appropiate integer for it.
22859 * literal.cs: Implement ULongLiteral.
22861 * rootcontext.cs: Provide better information about the location of
22862 failure when CreateType fails.
22864 2001-09-29 Miguel de Icaza <miguel@ximian.com>
22866 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22869 * expression.cs (Binary::CheckShiftArguments): Add missing type
22871 (Binary::ResolveOperator): Add type to the logical and and logical
22872 or, Bitwise And/Or and Exclusive Or code paths, it was missing
22875 (Binary::DoNumericPromotions): In the case where either argument
22876 is ulong (and most signed types combined with ulong cause an
22877 error) perform implicit integer constant conversions as well.
22879 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22881 * expression.cs (UserImplicitCast): Method should always be
22883 (Invocation::BetterConversion): Simplified test for IntLiteral.
22885 (Expression::ImplicitNumericConversion): Split this routine out.
22886 Put the code that performs implicit constant integer conversions
22889 (Expression::Resolve): Become a wrapper around DoResolve so we can
22890 check eclass and type being set after resolve.
22892 (Invocation::Badness): Remove this dead function
22894 (Binary::ResolveOperator): Do not compute the expensive argumnets
22895 unless we have a union for it.
22897 (Probe::Emit): Is needs to do an isinst and then
22898 compare against null.
22900 (::CanConvert): Added Location argument. If the Location argument
22901 is null (Location.Null), then we do not report errors. This is
22902 used by the `probe' mechanism of the Explicit conversion. We do
22903 not want to generate an error for something that the user
22904 explicitly requested to be casted. But the pipeline for an
22905 explicit cast first tests for potential implicit casts.
22907 So for now, if the Location is null, it means `Probe only' to
22908 avoid adding another argument. Might have to revise this
22911 (ClassCast): New class used to type cast objects into arbitrary
22912 classes (used in Explicit Reference Conversions).
22914 Implement `as' as well.
22916 Reverted all the patches from Ravi below: they were broken:
22918 * The use of `level' as a mechanism to stop recursive
22919 invocations is wrong. That was there just to catch the
22920 bug with a strack trace but not as a way of addressing
22923 To fix the problem we have to *understand* what is going
22924 on and the interactions and come up with a plan, not
22925 just get things going.
22927 * The use of the type conversion cache that I proposed
22928 last night had an open topic: How does this work across
22929 protection domains. A user defined conversion might not
22930 be public in the location where we are applying the
22931 conversion, a different conversion might be selected
22932 (ie, private A->B (better) but public B->A (worse),
22933 inside A, A->B applies, but outside it, B->A will
22936 * On top of that (ie, even if the above is solved),
22937 conversions in a cache need to be abstract. Ie, `To
22938 convert from an Int to a Short use an OpcodeCast', not
22939 `To convert from an Int to a Short use the OpcodeCast on
22940 the variable 5' (which is what this patch was doing).
22942 2001-09-28 Ravi Pratap <ravi@ximian.com>
22944 * expression.cs (Invocation::ConversionExists): Re-write to use
22945 the conversion cache
22947 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22948 cache all conversions done, not just user-defined ones.
22950 (Invocation::BetterConversion): The real culprit. Use ConversionExists
22951 to determine if a conversion exists instead of acutually trying to
22952 perform the conversion. It's faster too.
22954 (Expression::ConvertExplicit): Modify to use ConversionExists to check
22955 and only then attempt the implicit conversion.
22957 2001-09-28 Ravi Pratap <ravi@ximian.com>
22959 * expression.cs (ConvertImplicit): Use a cache for conversions
22960 already found. Check level of recursion and bail out if necessary.
22962 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22964 * typemanager.cs (string_concat_string_string, string_concat_object_object):
22965 Export standard methods that we expect for string operations.
22967 * statement.cs (Block::UsageWarning): Track usage of variables and
22968 report the errors for not used variables.
22970 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22973 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22975 * codegen.cs: remove unnneded code
22977 * expression.cs: Removed BuiltinTypeAccess class
22979 Fix the order in which implicit conversions are
22982 The previous fixed dropped support for boxed conversions (adding a
22983 test to the test suite now)
22985 (UserImplicitCast::CanConvert): Remove test for source being null,
22986 that code is broken. We should not feed a null to begin with, if
22987 we do, then we should track the bug where the problem originates
22988 and not try to cover it up here.
22990 Return a resolved expression of type UserImplicitCast on success
22991 rather than true/false. Ravi: this is what I was talking about,
22992 the pattern is to use a static method as a "constructor" for
22995 Also, do not create arguments until the very last minute,
22996 otherwise we always create the arguments even for lookups that
22997 will never be performed.
22999 (UserImplicitCast::Resolve): Eliminate, objects of type
23000 UserImplicitCast are born in a fully resolved state.
23002 * typemanager.cs (InitCoreTypes): Init also value_type
23003 (System.ValueType).
23005 * expression.cs (Cast::Resolve): First resolve the child expression.
23007 (LValue): Add new method AddressOf to be used by
23010 Change the argument of Store to take an EmitContext instead of an
23011 ILGenerator, because things like FieldExpr need to be able to call
23012 their children expression to generate the instance code.
23014 (Expression::Error, Expression::Warning): Sugar functions for
23017 (Expression::MemberLookup): Accept a TypeContainer instead of a
23018 Report as the first argument.
23020 (Expression::ResolvePrimary): Killed. I still want to improve
23021 this as currently the code is just not right.
23023 (Expression::ResolveMemberAccess): Simplify, but it is still
23026 (Unary::Resolve): Catch errors in AddressOf operators.
23028 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23029 index to a byte for the short-version, or the compiler will choose
23030 the wrong Emit call, which generates the wrong data.
23032 (ParameterReference::Emit, ::Store): same.
23034 (FieldExpr::AddressOf): Implement.
23036 * typemanager.cs: TypeManager: made public variable instead of
23039 * driver.cs: document --fatal.
23041 * report.cs (ErrorMessage, WarningMessage): new names for the old
23042 Error and Warning classes.
23044 * cs-parser.jay (member_access): Turn built-in access to types
23045 into a normal simplename
23047 2001-09-27 Ravi Pratap <ravi@ximian.com>
23049 * expression.cs (Invocation::BetterConversion): Fix to cope
23050 with q being null, since this was introducing a bug.
23052 * expression.cs (ConvertImplicit): Do built-in conversions first.
23054 2001-09-27 Ravi Pratap <ravi@ximian.com>
23056 * expression.cs (UserImplicitCast::Resolve): Fix bug.
23058 2001-09-27 Ravi Pratap <ravi@ximian.com>
23060 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23061 I had introduced long ago (what's new ?).
23063 * expression.cs (UserImplicitCast::CanConvert): Static method to do
23064 the work of all the checking.
23065 (ConvertImplicit): Call CanConvert and only then create object if necessary.
23066 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23068 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23069 that is the right way.
23071 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
23072 overloading resolution. Use everywhere instead of cutting and pasting code.
23074 (Binary::ResolveOperator): Use MakeUnionSet.
23076 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
23077 we have to convert to bool types. Not complete yet.
23079 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23081 * typemanager.cs (TypeManager::CSharpName): support ushort.
23083 * expression.cs (Expression::TryImplicitIntConversion): Attempts
23084 to provide an expression that performsn an implicit constant int
23085 conversion (section 6.1.6).
23086 (Expression::ConvertImplicitRequired): Reworked to include
23087 implicit constant expression conversions.
23089 (Expression::ConvertNumericExplicit): Finished.
23091 (Invocation::Emit): If InstanceExpression is null, then it means
23092 that we perform a call on this.
23094 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23096 * expression.cs (Unary::Emit): Remove some dead code.
23097 (Probe): Implement Resolve and Emit for `is'.
23098 (Expression::ConvertImplicitRequired): Attempt to do constant
23099 expression conversions here. Maybe should be moved to
23100 ConvertImplicit, but I am not sure.
23101 (Expression::ImplicitLongConstantConversionPossible,
23102 Expression::ImplicitIntConstantConversionPossible): New functions
23103 that tell whether is it possible to apply an implicit constant
23104 expression conversion.
23106 (ConvertNumericExplicit): Started work on explicit numeric
23109 * cs-parser.jay: Update operator constants.
23111 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23112 (Parameters::GetSignature): Hook up VerifyArgs here.
23113 (Parameters::VerifyArgs): Verifies that no two arguments have the
23116 * class.cs (Operator): Update the operator names to reflect the
23117 ones that the spec expects (as we are just stringizing the
23120 * expression.cs (Unary::ResolveOperator): Fix bug: Use
23121 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23122 previous usage did only work for our methods.
23123 (Expression::ConvertImplicit): Handle decimal implicit numeric
23124 conversions as well.
23125 (Expression::InternalTypeConstructor): Used to invoke constructors
23126 on internal types for default promotions.
23128 (Unary::Emit): Implement special handling for the pre/post
23129 increment/decrement for overloaded operators, as they need to have
23130 the same semantics as the other operators.
23132 (Binary::ResolveOperator): ditto.
23133 (Invocation::ConversionExists): ditto.
23134 (UserImplicitCast::Resolve): ditto.
23136 2001-09-26 Ravi Pratap <ravi@ximian.com>
23138 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23139 operator, return after emitting body. Regression tests pass again !
23141 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23142 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23143 (Invocation::OverloadResolve): Ditto.
23144 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23146 * everywhere : update calls to the above methods accordingly.
23148 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23150 * assign.cs (Assign): Make it inherit from ExpressionStatement.
23152 * expression.cs (ExpressionStatement): New base class used for
23153 expressions that can appear in statements, so that we can provide
23154 an alternate path to generate expression that do not leave a value
23157 (Expression::Emit, and all the derivatives): We no longer return
23158 whether a value is left on the stack or not. Every expression
23159 after being emitted leaves a single value on the stack.
23161 * codegen.cs (EmitContext::EmitStatementExpression): Use the
23162 facilties of ExpressionStatement if possible.
23164 * cs-parser.jay: Update statement_expression.
23166 2001-09-25 Miguel de Icaza <miguel@ximian.com>
23168 * driver.cs: Change the wording of message
23170 2001-09-25 Ravi Pratap <ravi@ximian.com>
23172 * expression.cs (Binary::ResolveOperator): Had forgottten to set
23173 the type of the expression to the return type of the method if
23174 we have an overloaded operator match ! The regression tests pass again !
23175 (Unary::ResolveOperator): Ditto.
23177 * expression.cs (Invocation::ConversionExists): Correct the member lookup
23178 to find "op_Implicit", not "implicit" ;-)
23179 (UserImplicitCast): New class to take care of user-defined implicit conversions.
23180 (ConvertImplicit, ForceConversion): Take TypeContainer argument
23182 * everywhere : Correct calls to the above accordingly.
23184 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23185 (ConvertImplicit): Do user-defined conversion if it exists.
23187 2001-09-24 Miguel de Icaza <miguel@ximian.com>
23189 * assign.cs: track location.
23190 (Resolve): Use implicit conversions on assignment.
23192 * literal.cs: Oops. Not good, Emit of short access values should
23193 pass (Bytes) or the wrong argument will be selected.
23195 * expression.cs (Unary::Emit): Emit code for -expr.
23197 (Unary::ResolveOperator): Handle `Substract' for non-constants
23198 (substract from zero from the non-constants).
23199 Deal with Doubles as well.
23201 (Expression::ConvertImplicitRequired): New routine that reports an
23202 error if no implicit conversion exists.
23204 (Invocation::OverloadResolve): Store the converted implicit
23205 expressions if we make them
23207 2001-09-24 Ravi Pratap <ravi@ximian.com>
23209 * class.cs (ConstructorInitializer): Take a Location argument.
23210 (ConstructorBaseInitializer): Same here.
23211 (ConstructorThisInitializer): Same here.
23213 * cs-parser.jay : Update all calls accordingly.
23215 * expression.cs (Unary, Binary, New): Take location argument.
23216 Update accordingly everywhere.
23218 * cs-parser.jay : Update all calls to the above to take a location
23221 * class.cs : Ditto.
23223 2001-09-24 Ravi Pratap <ravi@ximian.com>
23225 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23226 (Invocation::BetterConversion): Same here
23227 (Invocation::ConversionExists): Ditto.
23229 (Invocation::ConversionExists): Implement.
23231 2001-09-22 Ravi Pratap <ravi@ximian.com>
23233 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23234 Also take an additional TypeContainer argument.
23236 * All over : Pass in TypeContainer as argument to OverloadResolve.
23238 * typemanager.cs (CSharpName): Update to check for the string type and return
23241 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23244 2001-09-21 Ravi Pratap <ravi@ximian.com>
23246 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23247 (Invocation::BetterFunction): Implement.
23248 (Invocation::BetterConversion): Implement.
23249 (Invocation::ConversionExists): Skeleton, no implementation yet.
23251 Okay, things work fine !
23253 2001-09-21 Miguel de Icaza <miguel@ximian.com>
23255 * typemanager.cs: declare and load enum_type, delegate_type and
23258 * expression.cs (Expression::Emit): Now emit returns a value that
23259 tells whether a value is left on the stack or not. This strategy
23260 might be reveted tomorrow with a mechanism that would address
23261 multiple assignments.
23262 (Expression::report118): Utility routine to report mismatches on
23265 (Unary::Report23): Report impossible type/operator combination
23268 (Unary::IsIncrementableNumber): Whether the type can be
23269 incremented or decremented with add.
23270 (Unary::ResolveOperator): Also allow enumerations to be bitwise
23272 (Unary::ResolveOperator): Implement ++, !, ~,
23274 (Invocation::Emit): Deal with new Emit convetion.
23276 * All Expression derivatives: Updated their Emit method to return
23277 whether they leave values on the stack or not.
23279 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23280 stack for expressions that are statements.
23282 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23284 * expression.cs (LValue): New interface. Must be implemented by
23286 (LocalVariableReference, ParameterReference, FieldExpr): Implement
23289 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23290 interface for generating code, simplifies the code.
23292 2001-09-20 Ravi Pratap <ravi@ximian.com>
23294 * expression.cs (everywhere): Comment out return statements in ::Resolve
23295 methods to avoid the warnings.
23297 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23299 * driver.cs (parse): Report error 2001 if we can not open the
23302 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23305 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23308 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23309 otherwise nested blocks end up with the same index.
23311 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23313 * expression.cs: Instead of having FIXMEs in the Resolve
23314 functions, throw exceptions so it is obvious that we are facing a
23317 * cs-parser.jay (invocation_expression): Pass Location information.
23319 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23320 Use a basename for those routines because .NET does not like paths
23323 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23326 2001-09-19 Miguel de Icaza <miguel@ximian.com>
23328 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23329 are loading the correct data types (throws an exception if not).
23330 (TypeManager::InitCoreTypes): Use CoreLookupType
23332 * expression.cs (Unary::ResolveOperator): return the child
23333 expression for expressions which are just +expr.
23334 (Unary::ResolveOperator): Return negative literals for -LITERAL
23335 expressions (otherwise they are Unary {Literal}).
23336 (Invocation::Badness): Take into account `Implicit constant
23337 expression conversions'.
23339 * literal.cs (LongLiteral): Implement long literal class.
23340 (IntLiteral): export the `Value' of the intliteral.
23342 2001-09-19 Ravi Pratap <ravi@ximian.com>
23344 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23346 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
23347 instead of 'Operator'
23349 * expression.cs (Binary::ResolveOperator): Update accordingly.
23350 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23353 * cs-parser.jay (unary_expression): Update to use the new names.
23355 * gen-treedump.cs (GetUnary): Same here.
23357 * expression.cs (Unary::Resolve): Implement.
23358 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
23359 operators are found instead of making noise ;-)
23360 (Unary::ResolveOperator): New method to do precisely the same thing which
23361 Binary::ResolveOperator does for Binary expressions.
23362 (Unary.method, .Arguments): Add.
23363 (Unary::OperName): Implement.
23364 (Unary::ForceConversion): Copy and Paste !
23366 * class.cs (Operator::Define): Fix a small bug for the case when we have
23369 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23370 for the inbuilt operators. Only overloading works for now ;-)
23372 2001-09-18 Miguel de Icaza <miguel@ximian.com>
23374 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23375 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23377 * expression.cs (This::Emit): Implement.
23378 (This::Resolve): Implement.
23379 (TypeOf:Resolve): Implement.
23380 (Expression::ResolveSimpleName): Add an implicit this to instance
23382 (MemberAccess::Resolve): Deal with Parameters and Fields.
23383 Bind instance variable to Field expressions.
23384 (FieldExpr::Instance): New field used to track the expression that
23385 represents the object instance.
23386 (FieldExpr::Resolve): Track potential errors from MemberLookup not
23388 (FieldExpr::Emit): Implement.
23390 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23391 the last instruction contains a return opcode to avoid generating
23392 the last `ret' instruction (this generates correct code, and it is
23393 nice to pass the peverify output).
23395 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23396 initializer for static and instance variables.
23397 (Constructor::Emit): Allow initializer to be null in the case of
23398 static constructors. Only emit initializer for instance
23401 (TypeContainer::FindMembers): Return a null array if there are no
23404 Also fix the code for the MemberTypes.Method branch, as it was not
23405 scanning that for operators (or tried to access null variables before).
23407 * assign.cs (Assign::Emit): Handle instance and static fields.
23411 * driver.cs: Stop compilation if there are parse errors.
23413 * cs-parser.jay (constructor_declaration): Provide default base
23414 initializer for non-static constructors.
23415 (constructor_declarator): Do not provide a default base
23416 initializers if none was specified.
23417 Catch the fact that constructors should not have parameters.
23419 * class.cs: Do not emit parent class initializers for static
23420 constructors, that should be flagged as an error.
23422 2001-09-18 Ravi Pratap <ravi@ximian.com>
23424 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23425 Move back code into TypeContainer::Populate.
23427 2001-09-18 Ravi Pratap <ravi@ximian.com>
23429 * class.cs (TypeContainer::AddConstructor): Fix the check to
23430 compare against Name, not Basename.
23431 (Operator::OpType): Change Plus and Minus to Add and Subtract.
23433 * cs-parser.jay : Update accordingly.
23435 * class.cs (TypeContainer::FindMembers): For the case where we are searching
23436 for methods, don't forget to look into the operators too.
23437 (RegisterMethodBuilder): Helper method to take care of this for
23438 methods, constructors and operators.
23439 (Operator::Define): Completely revamp.
23440 (Operator.OperatorMethod, MethodName): New fields.
23441 (TypeContainer::Populate): Move the registering of builders into
23442 RegisterMethodBuilder.
23443 (Operator::Emit): Re-write.
23445 * expression.cs (Binary::Emit): Comment out code path to emit method
23446 invocation stuff for the case when we have a user defined operator. I am
23447 just not able to get it right !
23449 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23451 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23454 (Expression::MemberLookup): Provide a version that allows to
23455 specify the MemberTypes and BindingFlags.
23457 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23458 so it was not fetching variable information from outer blocks.
23460 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23461 Beforefieldinit as it was buggy.
23463 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23464 that Ravi put here.
23466 * class.cs (Constructor::Emit): Only emit if block is not null.
23467 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23468 deal with this by semantically definining it as if the user had
23471 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23472 constructors as we now "emit" them at a higher level.
23474 (TypeContainer::DefineDefaultConstructor): Used to define the
23475 default constructors if none was provided.
23477 (ConstructorInitializer): Add methods Resolve and Emit.
23479 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23481 2001-09-17 Ravi Pratap <ravi@ximian.com>
23483 * class.cs (TypeContainer::EmitDefaultConstructor): Register
23484 the default constructor builder with our hashtable for methodbuilders
23487 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23488 and argument_count is 0 in which case we have a match.
23489 (Binary::ResolveOperator): More null checking and miscellaneous coding
23492 2001-09-17 Ravi Pratap <ravi@ximian.com>
23494 * rootcontext.cs (IsNameSpace): Compare against null.
23496 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23498 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23499 and Unary::Operator.
23501 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23504 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23505 we have overloaded operators.
23506 (Binary::ResolveOperator): Implement the part which does the operator overload
23509 * class.cs (Operator::Emit): Implement.
23510 (TypeContainer::Emit): Emit the operators we have too.
23512 * expression.cs (Binary::Emit): Update to emit the appropriate code for
23513 the case when we have a user-defined operator.
23515 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23517 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23519 2001-09-16 Ravi Pratap <ravi@ximian.com>
23521 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23522 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23523 (Constructor::Emit): Implement.
23524 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23525 if we have no work to do.
23526 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
23529 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23530 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23532 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23535 2001-09-15 Ravi Pratap <ravi@ximian.com>
23537 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23539 (Tree::RecordNamespace): Method to do what the name says ;-)
23540 (Tree::Namespaces): Property to get at the namespaces hashtable.
23542 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
23545 * rootcontext.cs (IsNamespace): Fixed it :-)
23547 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23549 * class.cs (TypeContainer::FindMembers): Add support for
23551 (MethodCore): New class that encapsulates both the shared aspects
23552 of a Constructor and a Method.
23553 (Method, Constructor): Factored pieces into MethodCore.
23555 * driver.cs: Added --fatal which makes errors throw exceptions.
23556 Load System assembly as well as part of the standard library.
23558 * report.cs: Allow throwing exceptions on errors for debugging.
23560 * modifiers.cs: Do not use `parent', instead use the real type
23561 container to evaluate permission settings.
23563 * class.cs: Put Ravi's patch back in. He is right, and we will
23564 have to cope with the
23566 2001-09-14 Ravi Pratap <ravi@ximian.com>
23568 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23569 FamORAssem, not FamANDAssem.
23571 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23573 * driver.cs: Added --parse option that only parses its input files
23576 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
23577 incorrect. IsTopLevel is not used to tell whether an object is
23578 root_types or not (that can be achieved by testing this ==
23579 root_types). But to see if this is a top-level *class* (not
23580 necessarly our "toplevel" container).
23582 2001-09-14 Ravi Pratap <ravi@ximian.com>
23584 * enum.cs (Enum::Define): Modify to call the Lookup method on the
23585 parent instead of a direct call to GetType.
23587 2001-09-14 Ravi Pratap <ravi@ximian.com>
23589 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23590 Modifiers.TypeAttr. This should just be a call to that method.
23592 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23593 object so that we can determine if we are top-level or not.
23595 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
23598 * enum.cs (Enum::Define): Ditto.
23600 * modifiers.cs (FieldAttr): Re-write.
23602 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23603 (TypeContainer::HaveStaticConstructor): New property to provide access
23604 to precisely that info.
23606 * modifiers.cs (MethodAttr): Re-write.
23607 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23609 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23610 of top-level types as claimed.
23612 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23614 * expression.cs (MemberLookup): Fruitless attempt to lookup
23615 constructors. Maybe I need to emit default constructors? That
23616 might be it (currently .NET emits this for me automatically).
23617 (Invocation::OverloadResolve): Cope with Arguments == null.
23618 (Invocation::EmitArguments): new function, shared by the new
23619 constructor and us.
23620 (Invocation::Emit): Handle static and instance methods. Emit
23621 proper call instruction for virtual or non-virtual invocations.
23622 (New::Emit): Implement.
23623 (New::Resolve): Implement.
23624 (MemberAccess:Resolve): Implement.
23625 (MethodGroupExpr::InstanceExpression): used conforming to the spec
23626 to track instances.
23627 (FieldExpr::Resolve): Set type.
23629 * support.cs: Handle empty arguments.
23631 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23632 SimpleLookup): Auxiliary routines to help parse a qualifier
23635 Update qualifier_identifier rule.
23637 * codegen.cs: Removed debugging messages.
23639 * class.cs: Make this a global thing, this acts just as a "key" to
23640 objects that we might have around.
23642 (Populate): Only initialize method_builders_to_methods once.
23644 * expression.cs (PropertyExpr): Initialize type from the
23647 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23648 Resolve pattern. Attempt to implicitly convert value to boolean.
23651 * expression.cs: Set the type for the int32/int32 argument case.
23652 (Binary::ResolveOperator): Set the return type to boolean for
23653 comparission operators
23655 * typemanager.cs: Remove debugging print code.
23657 (Invocation::Resolve): resolve type.
23659 * class.cs: Allocate a MemberInfo of the correct size, as the code
23660 elsewhere depends on the test to reflect the correct contents.
23662 (Method::) Keep track of parameters, due to System.Reflection holes
23664 (TypeContainer::Populate): Keep track of MethodBuilders to Method
23667 (TypeContainer::FindMembers): Use ArrayList and then copy an array
23668 of the exact size and return that.
23670 (Class::LookupMethodByBuilder): New function that maps
23671 MethodBuilders to its methods. Required to locate the information
23672 on methods because System.Reflection bit us again.
23674 * support.cs: New file, contains an interface ParameterData and
23675 two implementations: ReflectionParameters and InternalParameters
23676 used to access Parameter information. We will need to grow this
23679 * expression.cs (Invocation::GetParameterData): implement a cache
23680 and a wrapper around the ParameterData creation for methods.
23681 (Invocation::OverloadResolve): Use new code.
23683 2001-09-13 Ravi Pratap <ravi@ximian.com>
23685 * class.cs (TypeContainer::EmitField): Remove and move into
23686 (Field::Define): here and modify accordingly.
23687 (Field.FieldBuilder): New member.
23688 (TypeContainer::Populate): Update accordingly.
23689 (TypeContainer::FindMembers): Implement.
23691 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23693 * statement.cs: (VariableInfo::VariableType): New field to be
23694 initialized with the full type once it is resolved.
23696 2001-09-12 Miguel de Icaza <miguel@ximian.com>
23698 * parameter.cs (GetParameterInfo): Use a type cache to compute
23699 things only once, and to reuse this information
23701 * expression.cs (LocalVariableReference::Emit): Implement.
23702 (OpcodeCast::Emit): fix.
23704 (ParameterReference::Resolve): Implement.
23705 (ParameterReference::Emit): Implement.
23707 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23708 that are expressions need to stay as Expressions.
23710 * typemanager.cs (CSharpName): Returns the C# name of a type if
23713 * expression.cs (Expression::ConvertImplicit): New function that
23714 implements implicit type conversions.
23716 (Expression::ImplicitReferenceConversion): Implements implicit
23717 reference conversions.
23719 (EmptyCast): New type for transparent casts.
23721 (OpcodeCast): New type for casts of types that are performed with
23722 a sequence of bytecodes.
23724 (BoxedCast): New type used for casting value types into reference
23725 types. Emits a box opcode.
23727 (Binary::DoNumericPromotions): Implements numeric promotions of
23728 and computation of the Binary::Type.
23730 (Binary::EmitBranchable): Optimization.
23732 (Binary::Emit): Implement code emission for expressions.
23734 * typemanager.cs (TypeManager): Added two new core types: sbyte
23737 2001-09-12 Ravi Pratap <ravi@ximian.com>
23739 * class.cs (TypeContainer::FindMembers): Method which does exactly
23740 what Type.FindMembers does, only we don't have to use reflection. No
23741 implementation yet.
23743 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23744 typecontainer objects as we need to get at them.
23745 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23747 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23748 typecontainer object.
23750 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23751 of just a Report object.
23753 2001-09-11 Ravi Pratap <ravi@ximian.com>
23755 * class.cs (Event::Define): Go back to using the prefixes "add_" and
23757 (TypeContainer::Populate): Now define the delegates of the type too.
23758 (TypeContainer.Delegates): Property to access the list of delegates defined
23761 * delegates.cs (Delegate::Define): Implement partially.
23763 * modifiers.cs (TypeAttr): Handle more flags.
23765 2001-09-11 Ravi Pratap <ravi@ximian.com>
23767 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23769 (Operator::Define): Re-write logic to get types by using the LookupType method
23770 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23771 (Indexer::Define): Ditto.
23772 (Event::Define): Ditto.
23773 (Property::Define): Ditto.
23775 2001-09-10 Ravi Pratap <ravi@ximian.com>
23777 * class.cs (TypeContainer::Populate): Now define operators too.
23778 (TypeContainer.Operators): New property to access the list of operators
23780 (Operator.OperatorMethodBuilder): New member to hold the method builder
23781 for the operator we are defining.
23782 (Operator::Define): Implement.
23784 2001-09-10 Ravi Pratap <ravi@ximian.com>
23786 * class.cs (Event::Define): Make the prefixes of the accessor methods
23787 addOn_ and removeOn_
23789 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23790 of the location being passed in too. Ideally, this should go later since all
23791 error reporting should be done through the Report object.
23793 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23794 (Populate): Iterate thru the indexers we have and define them too.
23795 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23796 for the get and set accessors.
23797 (Indexer::Define): Implement.
23799 2001-09-09 Miguel de Icaza <miguel@ximian.com>
23801 * expression.cs (Binary::Resolve): Beginning of it. I scratched
23802 my previous implementation, did not work.
23804 * typemanager.cs: Add a couple of missing types (the longs).
23806 * literal.cs: Use TypeManager.bool_type instead of getting it.
23808 * expression.cs (EventExpr): New kind of expressions.
23809 (Expressio::ExprClassFromMemberInfo): finish
23811 2001-09-08 Miguel de Icaza <miguel@ximian.com>
23813 * assign.cs: Emit stores to static fields differently.
23815 2001-09-08 Ravi Pratap <ravi@ximian.com>
23817 * Merge in changes and adjust code to tackle conflicts. Backed out my
23818 code in Assign::Resolve ;-)
23820 2001-09-08 Ravi Pratap <ravi@ximian.com>
23822 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23823 instead Report.Error and also pass in the location.
23824 (CSharpParser::Lexer): New readonly property to return the reference
23825 to the Tokenizer object.
23826 (declare_local_variables): Use Report.Error with location instead of plain
23830 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23831 (Operator.CheckBinaryOperator): Ditto.
23833 * cs-parser.jay (operator_declarator): Update accordingly.
23835 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23836 (CheckBinaryOperator): Same here.
23838 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23839 on the name without any prefixes of namespace names etc. This is because we
23840 already might have something already fully qualified like
23841 'System.Console.WriteLine'
23843 * assign.cs (Resolve): Begin implementation. Stuck ;-)
23845 2001-09-07 Ravi Pratap <ravi@ximian.com>
23847 * cs-tokenizer.cs (location): Return a string which also contains
23850 * expression.cs (ElementAccess): New class for expressions of the
23851 type 'element access.'
23852 (BaseAccess): New class for expressions of the type 'base access.'
23853 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23856 * cs-parser.jay (element_access): Implement action.
23857 (base_access): Implement actions.
23858 (checked_expression, unchecked_expression): Implement.
23860 * cs-parser.jay (local_variable_type): Correct and implement.
23861 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23863 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23865 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23866 name and the specifiers.
23868 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23870 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
23871 making them all public ;-)
23873 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23876 2001-09-07 Miguel de Icaza <miguel@ximian.com>
23878 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23880 (FieldExpr, PropertyExprs): New resolved expressions.
23881 (SimpleName::MemberStaticCheck): Perform static checks for access
23882 to non-static fields on static methods. Maybe this should be
23883 generalized for MemberAccesses.
23884 (SimpleName::ResolveSimpleName): More work on simple name
23887 * cs-parser.jay (primary_expression/qualified_identifier): track
23888 the parameter index.
23890 * codegen.cs (CodeGen::Save): Catch save exception, report error.
23891 (EmitContext::EmitBoolExpression): Chain to expression generation
23892 instead of temporary hack.
23893 (::EmitStatementExpression): Put generic expression code generation.
23895 * assign.cs (Assign::Emit): Implement variable assignments to
23896 local variables, parameters and fields.
23898 2001-09-06 Miguel de Icaza <miguel@ximian.com>
23900 * statement.cs (Block::GetVariableInfo): New method, returns the
23901 VariableInfo for a variable name in a block.
23902 (Block::GetVariableType): Implement in terms of GetVariableInfo
23904 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23905 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23907 2001-09-06 Ravi Pratap <ravi@ximian.com>
23909 * cs-parser.jay (operator_declaration): Continue on my quest : update
23910 to take attributes argument.
23911 (event_declaration): Ditto.
23912 (enum_declaration): Ditto.
23913 (indexer_declaration): Ditto.
23915 * class.cs (Operator::Operator): Update constructor accordingly.
23916 (Event::Event): Ditto.
23918 * delegate.cs (Delegate::Delegate): Same here.
23920 * enum.cs (Enum::Enum): Same here.
23922 2001-09-05 Ravi Pratap <ravi@ximian.com>
23924 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23926 * ../tests/cs0658.cs : New file to demonstrate error 0658.
23928 * attribute.cs (Attributes): New class to encapsulate all attributes which were
23929 being passed around as an arraylist.
23930 (Attributes::AddAttribute): Method to add attribute sections.
23932 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23933 (struct_declaration): Update accordingly.
23934 (constant_declaration): Update.
23935 (field_declaration): Update.
23936 (method_header): Update.
23937 (fixed_parameter): Update.
23938 (parameter_array): Ditto.
23939 (property_declaration): Ditto.
23940 (destructor_declaration): Ditto.
23942 * class.cs (Struct::Struct): Update constructors accordingly.
23943 (Class::Class): Ditto.
23944 (Field::Field): Ditto.
23945 (Method::Method): Ditto.
23946 (Property::Property): Ditto.
23947 (TypeContainer::OptAttribute): update property's return type.
23949 * interface.cs (Interface.opt_attributes): New member.
23950 (Interface::Interface): Update to take the extra Attributes argument.
23952 * parameter.cs (Parameter::Parameter): Ditto.
23954 * constant.cs (Constant::Constant): Ditto.
23956 * interface.cs (InterfaceMemberBase): New OptAttributes field.
23957 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
23958 the attributes as a parameter.
23959 (InterfaceProperty): Update constructor call.
23960 (InterfaceEvent): Ditto.
23961 (InterfaceMethod): Ditto.
23962 (InterfaceIndexer): Ditto.
23964 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
23965 pass the attributes too.
23966 (interface_event_declaration): Ditto.
23967 (interface_property_declaration): Ditto.
23968 (interface_method_declaration): Ditto.
23969 (interface_declaration): Ditto.
23971 2001-09-05 Miguel de Icaza <miguel@ximian.com>
23973 * class.cs (Method::Define): Track the "static Main" definition to
23974 create an entry point.
23976 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23977 EntryPoint if we find it.
23979 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23980 (EmitContext::ig): Make this variable public.
23982 * driver.cs: Make the default output file be the first file name
23983 with the .exe extension.
23985 Detect empty compilations
23987 Handle various kinds of output targets. Handle --target and
23988 rename -t to --dumper.
23990 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23991 methods inherited from Expression return now an Expression. This
23992 will is used during the tree rewriting as we resolve them during
23995 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23996 the spec. Missing entirely is the information about
23997 accessability of elements of it.
23999 (Expression::ExprClassFromMemberInfo): New constructor for
24000 Expressions that creates a fully initialized Expression based on
24001 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24004 (Invocation::Resolve): Begin implementing resolution of invocations.
24006 * literal.cs (StringLiteral): Implement Emit.
24008 2001-09-05 Ravi Pratap <ravi@ximian.com>
24010 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24013 2001-09-04 Ravi Pratap <ravi@ximian.com>
24015 * cs-parser.jay (attribute_arguments): Implement actions.
24016 (attribute): Fix bug in production. Implement action.
24017 (attribute_list): Implement.
24018 (attribute_target): Implement.
24019 (attribute_target_specifier, opt_target_specifier): Implement
24020 (CheckAttributeTarget): New method to check if the attribute target
24022 (attribute_section): Implement.
24023 (opt_attributes): Implement.
24025 * attribute.cs : New file to handle attributes.
24026 (Attribute): Class to hold attribute info.
24028 * cs-parser.jay (opt_attribute_target_specifier): Remove production
24029 (attribute_section): Modify production to use 2 different rules to
24030 achieve the same thing. 1 s/r conflict down !
24031 Clean out commented, useless, non-reducing dimension_separator rules.
24033 * class.cs (TypeContainer.attributes): New member to hold list
24034 of attributes for a type.
24035 (Struct::Struct): Modify to take one more argument, the attribute list.
24036 (Class::Class): Ditto.
24037 (Field::Field): Ditto.
24038 (Method::Method): Ditto.
24039 (Property::Property): Ditto.
24041 * cs-parser.jay (struct_declaration): Update constructor call to
24042 pass in the attributes too.
24043 (class_declaration): Ditto.
24044 (constant_declaration): Ditto.
24045 (field_declaration): Ditto.
24046 (method_header): Ditto.
24047 (fixed_parameter): Ditto.
24048 (parameter_array): Ditto.
24049 (property_declaration): Ditto.
24051 * constant.cs (Constant::Constant): Update constructor similarly.
24052 Use System.Collections.
24054 * parameter.cs (Parameter::Parameter): Update as above.
24056 2001-09-02 Ravi Pratap <ravi@ximian.com>
24058 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24059 (TypeContainer.delegates): New member to hold list of delegates.
24061 * cs-parser.jay (delegate_declaration): Implement the action correctly
24062 this time as I seem to be on crack ;-)
24064 2001-09-02 Miguel de Icaza <miguel@ximian.com>
24066 * rootcontext.cs (RootContext::IsNamespace): new function, used to
24067 tell whether an identifier represents a namespace.
24069 * expression.cs (NamespaceExpr): A namespace expression, used only
24070 temporarly during expression resolution.
24071 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24072 utility functions to resolve names on expressions.
24074 2001-09-01 Miguel de Icaza <miguel@ximian.com>
24076 * codegen.cs: Add hook for StatementExpressions.
24078 * class.cs: Fix inverted test for static flag in methods.
24080 2001-09-02 Ravi Pratap <ravi@ximian.com>
24082 * class.cs (Operator::CheckUnaryOperator): Correct error number used
24083 to make it coincide with MS' number.
24084 (Operator::CheckBinaryOperator): Ditto.
24086 * ../errors/errors.txt : Remove error numbers added earlier.
24088 * ../errors/cs1019.cs : Test case for error # 1019
24090 * ../errros/cs1020.cs : Test case for error # 1020
24092 * cs-parser.jay : Clean out commented cruft.
24093 (dimension_separators, dimension_separator): Comment out. Ostensibly not
24094 used anywhere - non-reducing rule.
24095 (namespace_declarations): Non-reducing rule - comment out.
24097 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24098 with TypeContainer::AddEnum.
24100 * delegate.cs : New file for delegate handling classes.
24101 (Delegate): Class for declaring delegates.
24103 * makefile : Update.
24105 * cs-parser.jay (delegate_declaration): Implement.
24107 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
24109 * class.cs (Event::Define): Implement.
24110 (Event.EventBuilder): New member.
24112 * class.cs (TypeContainer::Populate): Update to define all enums and events
24114 (Events): New property for the events arraylist we hold. Shouldn't we move to using
24115 readonly fields for all these cases ?
24117 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24119 * class.cs (Property): Revamp to use the convention of making fields readonly.
24120 Accordingly modify code elsewhere.
24122 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24123 the Define method of the Property class.
24125 * class.cs : Clean up applied patch and update references to variables etc. Fix
24127 (TypeContainer::Populate): Update to define all the properties we have. Also
24128 define all enumerations.
24130 * enum.cs (Define): Implement.
24132 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24134 * cs-parser.jay (overloadable_operator): The semantic value is an
24135 enum of the Operator class.
24136 (operator_declarator): Implement actions.
24137 (operator_declaration): Implement.
24139 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24140 validity of definitions.
24141 (Operator::CheckBinaryOperator): Static method to check for binary operators
24142 (TypeContainer::AddOperator): New method to add an operator to a type.
24144 * cs-parser.jay (indexer_declaration): Added line to actually call the
24145 AddIndexer method so it gets added ;-)
24147 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
24148 already taken care of by the MS compiler ?
24150 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24152 * class.cs (Operator): New class for operator declarations.
24153 (Operator::OpType): Enum for the various operators.
24155 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24157 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24158 ostensibly handle this in semantic analysis.
24160 * cs-parser.jay (general_catch_clause): Comment out
24161 (specific_catch_clauses, specific_catch_clause): Ditto.
24162 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24163 (catch_args, opt_catch_args): New productions.
24164 (catch_clause): Rewrite to use the new productions above
24165 (catch_clauses): Modify accordingly.
24166 (opt_catch_clauses): New production to use in try_statement
24167 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24168 and re-write the code in the actions to extract the specific and
24169 general catch clauses by being a little smart ;-)
24171 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24172 Hooray, try and catch statements parse fine !
24174 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24176 * statement.cs (Block::GetVariableType): Fix logic to extract the type
24177 string from the hashtable of variables.
24179 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24180 I end up making that mistake ;-)
24181 (catch_clauses): Fixed gross error which made Key and Value of the
24182 DictionaryEntry the same : $1 !!
24184 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24186 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24188 * cs-parser.jay (event_declaration): Correct to remove the semicolon
24189 when the add and remove accessors are specified.
24191 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24193 * cs-parser.jay (IndexerDeclaration): New helper class to hold
24194 information about indexer_declarator.
24195 (indexer_declarator): Implement actions.
24196 (parsing_indexer): New local boolean used to keep track of whether
24197 we are parsing indexers or properties. This is necessary because
24198 implicit_parameters come into picture even for the get accessor in the
24199 case of an indexer.
24200 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24202 * class.cs (Indexer): New class for indexer declarations.
24203 (TypeContainer::AddIndexer): New method to add an indexer to a type.
24204 (TypeContainer::indexers): New member to hold list of indexers for the
24207 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24209 * cs-parser.jay (add_accessor_declaration): Implement action.
24210 (remove_accessor_declaration): Implement action.
24211 (event_accessors_declaration): Implement
24212 (variable_declarators): swap statements for first rule - trivial.
24214 * class.cs (Event): New class to hold information about event
24216 (TypeContainer::AddEvent): New method to add an event to a type
24217 (TypeContainer::events): New member to hold list of events.
24219 * cs-parser.jay (event_declaration): Implement actions.
24221 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24223 * cs-parser.jay (dim_separators): Implement. Make it a string
24224 concatenating all the commas together, just as they appear.
24225 (opt_dim_separators): Modify accordingly
24226 (rank_specifiers): Update accordingly. Basically do the same
24227 thing - instead, collect the brackets here.
24228 (opt_rank_sepcifiers): Modify accordingly.
24229 (array_type): Modify to actually return the complete type string
24230 instead of ignoring the rank_specifiers.
24231 (expression_list): Implement to collect the expressions
24232 (variable_initializer): Implement. We make it a list of expressions
24233 essentially so that we can handle the array_initializer case neatly too.
24234 (variable_initializer_list): Implement.
24235 (array_initializer): Make it a list of variable_initializers
24236 (opt_array_initializer): Modify accordingly.
24238 * expression.cs (New::NType): Add enumeration to help us
24239 keep track of whether we have an object/delegate creation
24240 or an array creation.
24241 (New:NewType, New::Rank, New::Indices, New::Initializers): New
24242 members to hold data about array creation.
24243 (New:New): Modify to update NewType
24244 (New:New): New Overloaded contructor for the array creation
24247 * cs-parser.jay (array_creation_expression): Implement to call
24248 the overloaded New constructor.
24250 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
24252 * class.cs (TypeContainer::Constructors): Return member
24253 constructors instead of returning null.
24255 2001-08-26 Miguel de Icaza <miguel@ximian.com>
24257 * typemanager.cs (InitCoreTypes): Initialize the various core
24258 types after we have populated the type manager with the user
24259 defined types (this distinction will be important later while
24260 compiling corlib.dll)
24262 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24263 on Expression Classification. Now all expressions have a method
24264 `Resolve' and a method `Emit'.
24266 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24267 generation from working. Also add some temporary debugging
24270 2001-08-24 Miguel de Icaza <miguel@ximian.com>
24272 * codegen.cs: Lots of code generation pieces. This is only the
24273 beginning, will continue tomorrow with more touches of polish. We
24274 handle the fundamentals of if, while, do, for, return. Others are
24275 trickier and I need to start working on invocations soon.
24277 * gen-treedump.cs: Bug fix, use s.Increment here instead of
24280 * codegen.cs (EmitContext): New struct, used during code
24281 emission to keep a context. Most of the code generation will be
24284 * cs-parser.jay: Add embedded blocks to the list of statements of
24285 this block. So code generation proceeds in a top down fashion.
24287 2001-08-23 Miguel de Icaza <miguel@ximian.com>
24289 * statement.cs: Add support for multiple child blocks.
24291 2001-08-22 Miguel de Icaza <miguel@ximian.com>
24293 * codegen.cs (EmitCode): New function, will emit the code for a
24294 Block of code given a TypeContainer and its ILGenerator.
24296 * statement.cs (Block): Standard public readonly optimization.
24297 (Block::Block constructors): Link children.
24298 (Block::Child): Child Linker.
24299 (Block::EmitVariables): Emits IL variable declarations.
24301 * class.cs: Drop support for MethodGroups here, delay until
24303 (Method::): Applied the same simplification that I did before, and
24304 move from Properties to public readonly fields.
24305 (Method::ParameterTypes): Returns the parameter types for the
24306 function, and implements a cache that will be useful later when I
24307 do error checking and the semantic analysis on the methods is
24309 (Constructor::GetCallingConvention): Renamed from CallingConvetion
24310 and made a method, optional argument tells whether this is a class
24311 or a structure to apply the `has-this' bit.
24312 (Method::GetCallingConvention): Implement, returns the calling
24314 (Method::Define): Defines the type, a second pass is performed
24315 later to populate the methods.
24317 (Constructor::ParameterTypes): implement a cache similar to the
24318 one on Method::ParameterTypes, useful later when we do semantic
24321 (TypeContainer::EmitMethod): New method. Emits methods.
24323 * expression.cs: Removed MethodGroup class from here.
24325 * parameter.cs (Parameters::GetCallingConvention): new method.
24327 2001-08-21 Miguel de Icaza <miguel@ximian.com>
24329 * class.cs (TypeContainer::Populate): Drop RootContext from the
24332 (Constructor::CallingConvention): Returns the calling convention.
24333 (Constructor::ParameterTypes): Returns the constructor parameter
24336 (TypeContainer::AddConstructor): Keep track of default constructor
24337 and the default static constructor.
24339 (Constructor::) Another class that starts using `public readonly'
24340 instead of properties.
24342 (Constructor::IsDefault): Whether this is a default constructor.
24344 (Field::) use readonly public fields instead of properties also.
24346 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24347 track of static constructors; If none is used, turn on
24348 BeforeFieldInit in the TypeAttributes.
24350 * cs-parser.jay (opt_argument_list): now the return can be null
24351 for the cases where there are no arguments.
24353 (constructor_declarator): If there is no implicit `base' or
24354 `this', then invoke the default parent constructor.
24356 * modifiers.cs (MethodAttr): New static function maps a set of
24357 modifiers flags into a MethodAttributes enum
24358 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
24359 MethodAttr, TypeAttr to represent the various mappings where the
24360 modifiers are used.
24361 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
24363 2001-08-19 Miguel de Icaza <miguel@ximian.com>
24365 * parameter.cs (GetParameterInfo): Fix bug where there would be no
24368 * interface.cs (PopulateIndexer): Implemented the code generator
24369 for interface indexers.
24371 2001-08-17 Miguel de Icaza <miguel@ximian.com>
24373 * interface.cs (InterfaceMemberBase): Now we track the new status
24376 (PopulateProperty): Implement property population. Woohoo! Got
24377 Methods and Properties going today.
24379 Removed all the properties for interfaces, and replaced them with
24380 `public readonly' fields.
24382 2001-08-16 Miguel de Icaza <miguel@ximian.com>
24384 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24385 initialize their hashtables/arraylists only when they are needed
24386 instead of doing this always.
24388 * parameter.cs: Handle refs and out parameters.
24390 * cs-parser.jay: Use an ArrayList to construct the arguments
24391 instead of the ParameterCollection, and then cast that to a
24394 * parameter.cs: Drop the use of ParameterCollection and use
24395 instead arrays of Parameters.
24397 (GetParameterInfo): Use the Type, not the Name when resolving
24400 2001-08-13 Miguel de Icaza <miguel@ximian.com>
24402 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24403 and instead use public readonly fields.
24405 * class.cs: Put back walking code for type containers.
24407 2001-08-11 Miguel de Icaza <miguel@ximian.com>
24409 * class.cs (MakeConstant): Code to define constants.
24411 * rootcontext.cs (LookupType): New function. Used to locate types
24414 2001-08-08 Miguel de Icaza <miguel@ximian.com>
24416 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
24417 this System.Reflection code is. Kudos to Microsoft
24419 * typemanager.cs: Implement a type cache and avoid loading all
24420 types at boot time. Wrap in LookupType the internals. This made
24421 the compiler so much faster. Wow. I rule!
24423 * driver.cs: Make sure we always load mscorlib first (for
24424 debugging purposes, nothing really important).
24426 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
24427 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
24429 * rootcontext.cs: Lookup types on their namespace; Lookup types
24430 on namespaces that have been imported using the `using' keyword.
24432 * class.cs (TypeContainer::TypeAttr): Virtualize.
24433 (Class::TypeAttr): Return attributes suitable for this bad boy.
24434 (Struct::TypeAttr): ditto.
24435 Handle nested classes.
24436 (TypeContainer::) Remove all the type visiting code, it is now
24437 replaced with the rootcontext.cs code
24439 * rootcontext.cs (GetClassBases): Added support for structs.
24441 2001-08-06 Miguel de Icaza <miguel@ximian.com>
24443 * interface.cs, statement.cs, class.cs, parameter.cs,
24444 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24445 Drop use of TypeRefs, and use strings instead.
24447 2001-08-04 Miguel de Icaza <miguel@ximian.com>
24451 * class.cs (Struct::Struct): set the SEALED flags after
24452 checking the modifiers.
24453 (TypeContainer::TypeAttr): new property, returns the
24454 TypeAttributes for a class.
24456 * cs-parser.jay (type_list): Oops, list production was creating a
24457 new list of base types.
24459 * rootcontext.cs (StdLib): New property.
24460 (GetInterfaceTypeByName): returns an interface by type name, and
24461 encapsulates error handling here.
24462 (GetInterfaces): simplified.
24463 (ResolveTree): Encapsulated all the tree resolution here.
24464 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24467 * driver.cs: Add support for --nostdlib, to avoid loading the
24468 default assemblies.
24469 (Main): Do not put tree resolution here.
24471 * rootcontext.cs: Beginning of the class resolution.
24473 2001-08-03 Miguel de Icaza <miguel@ximian.com>
24475 * rootcontext.cs: Provide better error reporting.
24477 * cs-parser.jay (interface_base): set our $$ to be interfaces.
24479 * rootcontext.cs (CreateInterface): Handle the case where there
24480 are no parent interfaces.
24482 (CloseTypes): Routine to flush types at the end.
24483 (CreateInterface): Track types.
24484 (GetInterfaces): Returns an array of Types from the list of
24485 defined interfaces.
24487 * typemanager.c (AddUserType): Mechanism to track user types (puts
24488 the type on the global type hash, and allows us to close it at the
24491 2001-08-02 Miguel de Icaza <miguel@ximian.com>
24493 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24494 RecordInterface instead.
24496 * cs-parser.jay: Updated to reflect changes above.
24498 * decl.cs (Definition): Keep track of the TypeBuilder type that
24499 represents this type here. Not sure we will use it in the long
24500 run, but wont hurt for now.
24502 * driver.cs: Smaller changes to accomodate the new code.
24504 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24507 * rootcontext.cs (CreateInterface): New method, used to create
24508 the System.TypeBuilder type for interfaces.
24509 (ResolveInterfaces): new entry point to resolve the interface
24511 (CodeGen): Property, used to keep track of the code generator.
24513 2001-07-26 Miguel de Icaza <miguel@ximian.com>
24515 * cs-parser.jay: Add a second production for delegate_declaration
24518 (enum_body): Put an opt_comma here instead of putting it on
24519 enum_body or enum_member_declarations so we can handle trailing
24520 commas on enumeration members. Gets rid of a shift/reduce.
24522 (type_list): Need a COMMA in the middle.
24524 (indexer_declaration): Tell tokenizer to recognize get/set
24526 * Remove old targets.
24528 * Re-add the parser target.
24530 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24532 * cs-parser.jay: Add precendence rules for a number of operators
24533 ot reduce the number of shift/reduce conflicts in the grammar.
24535 2001-07-17 Miguel de Icaza <miguel@ximian.com>
24537 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24540 Get rid of old crufty code.
24542 * rootcontext.cs: Use this to keep track of the parsed
24543 representation and the defined types available to the program.
24545 * gen-treedump.cs: adjust for new convention.
24547 * type.cs: Split out the type manager, and the assembly builder
24550 * typemanager.cs: the type manager will live here now.
24552 * cil-codegen.cs: And the code generator here.
24554 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
24556 * makefile: Fixed up for easy making.
24558 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24560 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24563 (unary_expression): Expand pre_increment_expression and
24564 post_decrement_expression to reduce a shift/reduce.
24566 2001-07-11 Simon Cozens
24568 * cs-tokenizer.cs: Hex numbers should begin with a 0.
24570 Improve allow_keyword_as_indent name.
24572 2001-06-19 Miguel de Icaza <miguel@ximian.com>
24574 * Adjustments for Beta2.
24576 2001-06-13 Miguel de Icaza <miguel@ximian.com>
24578 * decl.cs: Added `Define' abstract method.
24579 (InTransit): new property, used to catch recursive definitions.
24581 * interface.cs: Implement `Define'.
24583 * modifiers.cs: Map Modifiers.constants to
24584 System.Reflection.TypeAttribute flags.
24586 * class.cs: Keep track of types and user-defined types.
24587 (BuilderInit): New method for creating an assembly
24588 (ResolveType): New function to launch the resolution process, only
24589 used by interfaces for now.
24591 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24592 that are inserted into the name space.
24594 2001-06-08 Miguel de Icaza <miguel@ximian.com>
24596 * ARGH. I have screwed up my tree so many times due to the use of
24597 rsync rather than using CVS. Going to fix this at once.
24599 * driver.cs: Objetify driver. Load assemblies, use assemblies to
24602 2001-06-07 Miguel de Icaza <miguel@ximian.com>
24604 * Experiment successful: Use System.Type rather that our own
24607 2001-05-25 Miguel de Icaza <miguel@ximian.com>
24609 * cs-parser.jay: Removed nsAliases from here.
24611 Use new namespaces, handle `using XXX;'
24613 * namespace.cs: Reimplemented namespace handling, use a recursive
24614 definition of the class. Now we can keep track of using clauses
24615 and catch invalid using clauses.
24617 2001-05-24 Miguel de Icaza <miguel@ximian.com>
24619 * gen-treedump.cs: Adapted for all the renaming.
24621 * expression.cs (Expression): this class now has a Type property
24622 which returns an expression Type.
24624 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24625 `Type', as this has a different meaning now in the base
24627 2001-05-22 Miguel de Icaza <miguel@ximian.com>
24629 * interface.cs, class.cs: Removed from all the sources the
24630 references to signature computation, as we can not do method
24631 signature computation during the parsing time, as we are not
24632 trying to solve at that point distinguishing:
24636 void a (NS.Blah x) {}
24639 Which depending on the context might be valid or not, as we do not
24640 know if Blah is the same thing as NS.Blah at that point.
24642 * Redid everything so the code uses TypeRefs now instead of
24643 Types. TypeRefs are just temporary type placeholders, that need
24644 to be resolved. They initially have a pointer to a string and the
24645 current scope in which they are used. This is used later by the
24646 compiler to resolve the reference to an actual Type.
24648 * DeclSpace is no longer a CIR.Type, and neither are
24649 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
24650 are all DeclSpaces, but no Types.
24652 * type.cs (TypeRefManager): This implements the TypeRef manager,
24653 which keeps track of all the types that need to be resolved after
24654 the parsing has finished.
24656 2001-05-13 Miguel de Icaza <miguel@ximian.com>
24658 * ARGH. We are going to have to store `foreach' as a class rather
24659 than resolving it, as we need to verify error 1579 after name
24660 resolution. *OR* we could keep a flag that says `This request to
24661 IEnumerator comes from a foreach statement' which we can then use
24662 to generate the error.
24664 2001-05-10 Miguel de Icaza <miguel@ximian.com>
24666 * class.cs (TypeContainer.AddMethod): we now add methods to the
24667 MethodGroup instead of the method hashtable.
24669 * expression.cs: Add MethodGroup abstraction, which gets us one
24670 step closer to the specification in the way we handle method
24673 * cs-parser.jay (primary_expression): qualified_identifier now
24674 tried to match up an identifier to a local variable reference or
24675 to a parameter reference.
24677 current_local_parameters is now a parser global variable that
24678 points to the current parameters for the block, used during name
24681 (property_declaration): Now creates an implicit `value' argument to
24684 2001-05-09 Miguel de Icaza <miguel@ximian.com>
24686 * parameter.cs: Do not use `param' arguments as part of the
24687 signature, per the spec.
24689 2001-05-08 Miguel de Icaza <miguel@ximian.com>
24691 * decl.cs: Base class for classes, structs and interfaces. This
24692 is the "Declaration Space"
24694 * cs-parser.jay: Use CheckDef for checking declaration errors
24695 instead of having one on each function.
24697 * class.cs: Factor out some code for handling error handling in
24698 accordance to the "Declarations" section in the "Basic Concepts"
24699 chapter in the ECMA C# spec.
24701 * interface.cs: Make all interface member classes derive from
24702 InterfaceMemberBase.
24704 2001-05-07 Miguel de Icaza <miguel@ximian.com>
24706 * Many things: all interfaces are parsed and generated in
24707 gen-treedump. Support for member variables, constructors,
24708 destructors, properties, constants is there.
24710 Beginning of the IL backend, but very little done, just there for
24713 2001-04-29 Miguel de Icaza <miguel@ximian.com>
24715 * cs-parser.jay: Fix labeled statement.
24717 * cs-tokenizer.cs (escape): Escape " and ' always.
24718 ref_line, ref_name: keep track of the line/filename as instructed
24719 by #line by the compiler.
24722 2001-04-27 Miguel de Icaza <miguel@ximian.com>
24724 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24725 to match the values in System.CodeDOM.
24727 Divid renamed to Divide.
24729 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24731 (Statements.set): remove.
24733 * System.CodeDOM/CodeCatchClause.cs: always have a valid
24736 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24737 falseStatements always have valid values.
24739 * cs-parser.jay: Use System.CodeDOM now.