1 2007-01-09 Raja R Harinath <rharinath@novell.com>
4 * support.cs (ReflectionParameter): Don't use an invalid index on
5 the generic parameter data.
7 2007-01-08 Miguel de Icaza <miguel@novell.com>
9 * driver.cs: Just add a tiny bit of infrastructure.
11 2007-01-02 Marek Safar <marek.safar@gmail.com>
13 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
14 where field type is struct from current assembly.
16 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
19 2007-01-02 Marek Safar <marek.safar@gmail.com>
22 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
25 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
27 (Namespace.LookupType): Always use core types from corlib when speficied.
29 * report.cs: A new warning.
31 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
32 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
33 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
35 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
36 (InitCoreTypes): Set expression type of object_type and value_type
37 immediately after lookup.
39 2007-01-01 Miguel de Icaza <miguel@novell.com>
41 * cs-tokenizer.cs: Accept Pc class characters (Connector
42 Punctuation) as valid identifiers. Fixes #78259
44 * expression.cs (Invocation.DoResolve): Moved the check for the
45 use of `this' for doing method calls to the Invocation resolution
46 step, after overload resolution has taken place instead of doing
47 the check at the low-level `This.DoResolve' level.
49 The `This.DoResolve' happens before overload resolution, so it has
50 no way of knowing if the method that will be called will be
51 instace or static, triggering an erroneous report for cs0188 (Bug
54 We now do the check for instance method invocations after we know
55 what method will be called.
57 (This.CheckThisUsage): Move the actual use of this structure
58 checking into its own method and expose it.
60 * Everywhere that called Error_ValueCannotBeConverted: pass a new
63 Exceptions: Null.ConvertImplicitly,
64 Constant.ImplicitConversionRequired as there are too many call
65 sites for passing the ec.
67 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
68 EmitContext, if the value is null, then we do not try to provide
69 the extra information from the error (If a userdefined conversion
70 exists, as UserDefinedConversion requires a non null-EmitContext).
74 2006-12-30 Raja R Harinath <rharinath@novell.com>
76 * flowanalysis.cs (MyBitVector): Document some invariants.
77 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
78 introduced below, and add a couple of others,
80 2006-12-30 Marek Safar <marek.safar@gmail.com>
82 * attribute.cs (GetMethodObsoleteAttribute): Uses new
83 GetPropertyFromAccessor and GetEventFromAccessor.
85 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
86 overrides non-obsolete one.
87 (Indexer.Define): Error message has been moved to the parser.
89 * cs-parser.jay: Better syntax errors handling.
91 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
92 when an invocation has no arguments.
94 * ecore.cs: Removed not used caching.
96 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
99 * report.cs: Add a new warning.
101 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
103 * typemanager.cs (enumeration_type): Removed.
104 (CSharpSignature): Reuses IsSpecialMethod.
105 (IsEqual): Hack for MS BCL.
106 (GetPropertyFromAccessor): New method.
107 (GetEventFromAccessor): New method.
108 (IsSpecialMethod): Fixed to handle more cases.
110 2006-12-30 Marek Safar <marek.safar@gmail.com>
112 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
113 Made white spaces array static.
115 * ecore.cs (RemoveGenericArity): Optimized.
117 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
119 (MyBitVector.initialize_vector): Simplified.
121 2006-12-22 Miguel de Icaza <miguel@novell.com>
123 * ecore.cs: Am not entirely happy with this hack, but it seems to
124 address the issue in 80257 (a small test case for
127 I set the MethodGroupExpr.Type to an internal compiler type
128 (itself in this case) to force the resolution to take place. Why
129 it does not take place with a null is beyond me.
131 2006-12-20 Marek Safar <marek.safar@gmail.com>
134 * expression.cs (ResolveOperator): Consider user defined conversion for
135 logical and operator too.
136 (EmitBranchable): Optimization for logical and when full constant folding
137 could not be applied but one operand is constant.
139 2006-12-19 Marek Safar <marek.safar@gmail.com>
141 * class.cs (GetClassBases): Write 5 times every day, will never use
142 FullName for error reporting.
144 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
146 2006-12-19 Martin Baulig <martin@ximian.com>
148 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
149 the symbol file info here.
151 2006-12-18 Marek Safar <marek.safar@gmail.com>
153 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
154 of `elseif' is taking then following sections are not taking.
155 Fixes an issue reported on mono mailing list.
157 2006-12-18 Marek Safar <marek.safar@gmail.com>
160 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
161 a caller is not taking.
163 2006-12-18 Raja R Harinath <rharinath@novell.com>
165 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
166 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
167 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
168 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
169 * class.cs: Update to changes.
171 2006-12-17 Marek Safar <marek.safar@gmail.com>
174 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
177 * class.cs (ResolveMembers): Register an iterator in current container and
180 2006-12-16 Raja R Harinath <rharinath@novell.com>
183 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
184 satisfy a params annotated parameter.
186 2006-12-16 Marek Safar <marek.safar@gmail.com>
189 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
190 paramters correctly and not rely on hacks in Parameters class.
191 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
193 (Invocation.VerifyArgumentsCompat): Ditto.
194 (Invocation.EmitArguments): Changed to correctly emit params arguments at
197 * parameter.cs (HasParams): Don't assume that params is the last one.
199 * support.cs (ReflectionParameters.ctor): Look for params attribute
201 (ReflectionParameters.ParameterType): Removed hack when we returned last
202 parameter for out of range parameters.
203 (ParameterName, ParameterModifier): Ditto.
205 2006-12-14 Marek Safar <marek.safar@gmail.com>
208 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
209 when assembly is not CLS compliant but type is. I have no idea why is this
212 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
214 2006-12-13 Miguel de Icaza <miguel@novell.com>
216 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
217 in struct constructors, they are basically no-ops.
219 2006-12-12 Marek Safar <marek.safar@gmail.com>
221 * cs-tokenizer.cs (Position): Save preprocessor status too.
223 2006-12-12 Marek Safar <marek.safar@gmail.com>
226 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
228 2006-12-12 Marek Safar <marek.safar@gmail.com>
230 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
232 (pp_expr): Report error for an invalid expression.
233 (handle_preprocessing_directive): Simplified; add more error checking.
235 2006-12-11 Marek Safar <marek.safar@gmail.com>
238 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
241 2006-12-10 Marek Safar <marek.safar@gmail.com>
243 A fix for bugs #80093, and #75984
244 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
245 logic, it seems to me as it worked before "by coincidence".
246 (xtoken): Simplified to use reworked handle_preprocessing_directive.
247 (cleanup): Enabled endif check.
249 2006-12-09 Marek Safar <marek.safar@gmail.com>
252 * statement.cs (CollectionForeach.TryType): Generics and non-generics
253 enumerators are never ambiguous.
255 2006-12-08 Raja R Harinath <rharinath@novell.com>
258 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
260 2006-12-06 Marek Safar <marek.safar@gmail.com>
263 * class.cs (EventProperty.Define): Explicit implementation means
264 that an even is used.
266 2006-12-06 Marek Safar <marek.safar@gmail.com>
268 Fixes the operators implementation (part II)
270 * cfold.cs (DoConstantNumericPromotions): Renamed to
271 DoBinaryNumericPromotions and simplified.
272 (BinaryFold): Couple of conversion fixes; simplified.
274 * constant.cs, ecore.cs, literal.cs
275 (ToType): Renamed to ConvertImplicitly.
276 (Reduce): Renamed to ConvertExplicitly.
278 * class.cs, convert.cs: Updated.
280 * expression.cs: TryReduce doesn't throw an exception.
282 2006-12-01 Marek Safar <marek.safar@gmail.com>
285 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
288 2006-11-30 Marek Safar <marek.safar@gmail.com>
290 Fixes unary operators implementation (part I)
293 * cfold.cs (Error_CompileTimeOverflow): Made internal
295 * const.cs (IConstant): Changed to use reference to constant and
297 Updated IConstant implementations.
299 * constant.cs (CreateConstant): New factory method.
300 Updated IConstant implementation.
302 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
304 * ecore.cs: Updated to use CreateConstantReference.
306 * enum.cs: Reflects IConstant changes.
308 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
310 * literal.cs (NullConstant): Change to be independently usable.
312 2006-11-29 Martin Baulig <martin@ximian.com>
314 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
315 we need to emit the scope initializer before calling the base .ctor.
317 * anonymous.cs: Merged back from the new anonymous methods branch.
318 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
320 * expression.cs (ParameterReference.DoResolveBase): Create a
321 "normal" ScopeInfo when capturing parameters rather than using the
322 root scope; this makes things work with anonymous methods having
326 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
328 2006-11-22 Marek Safar <marek.safar@gmail.com>
331 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
332 check to a base class.
333 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
334 only when assembly has missing attribute.
337 2006-11-21 Marek Safar <marek.safar@gmail.com>
339 * cs-tokenizer.cs: Merged with gmcs version.
341 2006-11-20 Marek Safar <marek.safar@gmail.com>
344 * cs-parser.jay: Better error message when partial keyword is misplaced.
346 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
349 report.cs: CS1058 only applies to 2.0 profile (gmcs).
350 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
351 a RuntimeWrappedException by default.
353 2006-11-18 Marek Safar <marek.safar@gmail.com>
356 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
358 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
360 2006-11-18 Marek Safar <marek.safar@gmail.com>
362 * driver.cs, namespace.cs: Uses faster IndexOf version.
364 2006-11-17 Marek Safar <marek.safar@gmail.com>
367 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
369 (Operator.Define): Implicit/Explicit operator of same type is duplicate
370 even if internal name is different.
371 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
372 (UserDefinedConversion): Simplified as the operators cannot be internal.
373 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
375 (MethodLookup): Replaced EmitContext with parentType.
376 * expression.cs: Updated.
378 2006-11-09 Raja R Harinath <rharinath@novell.com>
380 * driver.cs (BadAssembly): Handle all the ugliness of
381 DefineDynamicAssembly.
383 2006-11-08 Raja R Harinath <rharinath@novell.com>
385 Address parts of #58244 -- most of what's left is in the runtime
386 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
387 CS1509 error checks, and handle them for all assembly loads, not
388 just the first invocation.
389 (LoadModule): Likewise. Move handling of 'adder_method' ...
390 * codegen.cs (AssemblyClass.AddModule): ... here.
392 2006-11-02 Marek Safar <marek.safar@gmail.com>
394 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
395 IEnumerable<T> is ambiguous.
397 2006-10-31 Marek Safar <marek.safar@gmail.com>
400 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
401 GetEnumerator is ambiguous.
403 * report.cs: Add new warning.
405 2006-10-29 Marek Safar <marek.safar@gmail.com>
408 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
409 to protected member can be nested type.
411 2006-10-28 Marek Safar <marek.safar@gmail.com>
414 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
415 to protected member must derive from current type.
417 2006-10-27 Marek Safar <marek.safar@gmail.com>
419 assign.cs: Reuses error method.
421 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
422 instead of type for constants.
423 (Expression.Error_ValueAssignment): Common error method.
425 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
428 2006-10-27 Marek Safar <marek.safar@gmail.com>
431 * expression.cs (MemberAccess.DoResolve): Check nested type
434 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
436 * doc.cs : nested delegates were not handled. Fixed bug #79754.
438 2006-10-26 Marek Safar <marek.safar@gmail.com>
441 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
443 2006-10-26 Marek Safar <marek.safar@gmail.com>
445 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
446 type forwarder of the same type multiple times.
448 2006-10-26 Raja R Harinath <rharinath@novell.com>
451 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
452 instance as an rvalue, even when we later resolve as an lvalue.
454 2006-10-25 Martin Baulig <martin@ximian.com>
456 * anonymous.cs: Fix #79673.
458 2006-10-24 Marek Safar <marek.safar@seznam.cz>
461 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
462 ignored when is optimized (= default value) as its value is already set.
464 2006-10-23 Marek Safar <marek.safar@seznam.cz>
467 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
468 TypeContainer for type lookup.
470 2006-10-23 Marek Safar <marek.safar@seznam.cz>
473 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
474 * expression.cs (OverloadResolve): Always convert type name for
476 (ResolveNamespaceOrType): Don't confuse a nested type with any
479 2006-10-18 Martin Baulig <martin@ximian.com>
481 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
483 2006-10-17 Miguel de Icaza <miguel@novell.com>
485 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
486 an int32, but requesting an int64 from the conversion
488 2006-10-12 Martin Baulig <martin@ximian.com>
491 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
493 2006-10-12 Martin Baulig <martin@ximian.com>
496 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
498 2006-10-11 Miguel de Icaza <miguel@novell.com>
500 * convert.cs: Remove broken code: I was doing the "Existance"
501 tests for Implicit conversions.
503 2006-10-10 Miguel de Icaza <miguel@novell.com>
505 * convert.cs: Added one missing case in
506 ImplicitStandardConversionExists uint64 to intptr.
510 * typemanager.cs (uintptr_type): another core known type.
512 * ecore.cs (OperatorCast): routine used to do cast operations that
513 depend on op_Explicit. We could change some of the Decimal
514 conversions to use this.
516 This one has a probe mechanism that checks both types for an op_
517 which it coudl be used to eliminate two classes: CastToDecimal
520 * convert.cs: Implement the conversions documented in #59800
522 2006-10-10 Martin Baulig <martin@ximian.com>
524 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
525 before RootScope.ResolveMembers().
527 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
528 `CurrentType' if appropriate.
530 2006-10-09 Marek Safar <marek.safar@seznam.cz>
533 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
534 when contains binary operators.
535 * cs-parser.jay: Updated.
537 2006-10-09 Martin Baulig <martin@ximian.com>
540 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
541 moved that into Define() and also do the other type parameter
542 checks there. Fixes #79094. Added gtest-292.cs.
545 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
546 since that doesn't include type parameters; don't use `Ldelema'
547 for type parameters. Fixes #78980. Added gtest-293.cs.
549 2006-10-08 Marek Safar <marek.safar@seznam.cz>
552 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
553 conversion is allowed.
555 2006-10-06 Marek Safar <marek.safar@seznam.cz>
557 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
558 error reporting when no error occurs.
560 2006-10-06 Marek Safar <marek.safar@seznam.cz>
562 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
565 2006-10-06 Raja R Harinath <rharinath@novell.com>
568 * class.cs (DefineTypeBuilder): Check circular dependencies before
569 setting the parent of the TypeBuilder.
570 (CheckRecursiveDefinition): Don't use 'BaseType', since
571 it may not be valid until after DefineTypeBuilder. Use
574 2006-10-04 Martin Baulig <martin@ximian.com>
576 Merged the Anonymous Methods patch.
578 * anonymous.cs, iterators.cs: The new anonymous methods code.
580 * statement.cs (Variable): New public abstract class.
581 (LocalInfo.Variable): New public property.
582 (LocalInfo.ResolveVariable): New public method.
583 (Block.Flags): Add `IsIterator'.
584 (Block.AddVariable): Improved the CS0136 check.
585 (Block.AnonymousChildren): New public property.
586 (Block.AddAnonymousChild): New public method.
587 (ToplevelBlock): Update to use the new anonymous method framework.
588 (ToplevelBlock.ctor): `container' is now a `Block' and not a
589 `ToplevelBlock'; this is required to correctly implement the
591 (Fixed, Using): Use `TemporaryVariable' instead of directly
592 creating the `LocalBuilder'.
594 * parameter.cs (Parameter.ResolveVariable): New public method.
595 (Parameters.ResolveVariable): Likewise.
597 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
599 * class.cs (TypeContainer): Replaced the `iterators' list and
600 corresponding methods with a list of `CompilerGeneratedClass'es.
601 (TypeContainer.ResolveMembers): New public method.
602 (Method): `IIteratorContainer' has been replaced by
605 * expression.cs (VariableReference): New public abstract base
606 class for `LocalVariableReference', `ParameterReference' and
609 * codegen.cs (EmitContext): Removed `capture_context',
610 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
611 (EmitContext.EmitThis): Removed.
613 * cs-parser.jay: Replace `iterator_container' with
616 2006-10-04 Martin Baulig <martin@ximian.com>
618 * generic.cs (GenericMethod): Don't make this abstract.
619 (Constraints.Clone): Added dummy implementation.
621 2006-10-04 Raja R Harinath <harinath@gmail.com>
624 * namespace.cs (LookForAnyGenericType): Avoid nullref on
625 'declspaces'. Avoid allocating arrays willy-nilly.
628 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
629 cases out of the switch.
631 2006-09-28 Marek Safar <marek.safar@seznam.cz>
633 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
634 message when non-generic type is used with the type arguments.
635 * expression.cs: Updated.
637 2006-09-28 Raja R Harinath <rharinath@novell.com>
640 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
641 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
642 Change semantics slightly. Don't insist on having only one
643 temporary EmptyExpression -- just throttle the creation of new ones.
646 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
647 non-interfaces too. If no methods are found, don't try to create
650 2006-09-28 Marek Safar <marek.safar@seznam.cz>
652 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
655 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
656 us produce better error message.
658 2006-09-27 Marek Safar <marek.safar@seznam.cz>
660 * expression.cs (Binary.ResolveOperator): Warn about a side effect
663 * report.cs: A new warning added.
665 2006-09-27 Martin Baulig <martin@ximian.com>
667 * generic.cs (GenericMethod): Don't make this abstract.
669 2006-09-27 Martin Baulig <martin@ximian.com>
672 (InternalErrorException): Added overloaded ctor taking a params array.
674 2006-09-26 Marek Safar <marek.safar@seznam.cz>
676 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
677 Fixed the cases when same error was reported twice.
679 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
680 now report symbol information.
682 2006-09-25 Martin Baulig <martin@ximian.com>
684 * class.cs: Completely unified with the gmcs version.
686 2006-09-25 Martin Baulig <martin@ximian.com>
688 * typemanager.cs (TypeManager.IsNullableType): New public function.
689 (TypeManager.IsNullableTypeOf): Likewise.
690 (TypeManager.IsNullableValueType): Likewise.
692 * class.cs (MethodCore): Added the `GenericMethod' argument from
693 gmcs and also unified all classes derived from `MethodCore' with gmcs.
695 2006-09-24 Raja R Harinath <harinath@gmail.com>
697 * convert.cs: Unify with gmcs version.
699 2006-09-24 Marek Safar <marek.safar@seznam.cz>
701 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
704 * report.cs: New warning.
706 2006-09-24 Marek Safar <marek.safar@seznam.cz>
708 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
709 for anonymous block with out argument.
711 2006-09-24 Marek Safar <marek.safar@seznam.cz>
713 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
714 not used private events only.
716 2006-09-23 Marek Safar <marek.safar@seznam.cz>
718 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
720 * const.cs (Const.Define): Check for constant type.
721 (Const.IsConstantTypeValid): Looks for valid constant types.
723 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
725 * ecore.cs (EmptyConstantCast): New common class for all constant based
728 * expression.cs (Is.DoResolve): Handle null constant especially.
729 (New.DoResolve): Check for new void().
730 (MemberAccess.DoResolve): Cope with all kind of nulls.
732 * literal.cs (NullConstant): Uses EmptyConstantCast.
733 (NullDefault): Based on EmptyConstantCast.
734 (NullLiteral): Uses EmptyConstantCast.
736 * statement.cs (Block.ResolveMeta): Check for constant type.
738 2006-09-22 Martin Baulig <martin@ximian.com>
740 * delegate.cs, attribute.cs: Merged with the gmcs versions.
742 2006-09-22 Raja R Harinath <rharinath@novell.com>
744 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
748 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
749 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
752 2006-09-22 Martin Baulig <martin@ximian.com>
754 * ecore.cs: Merged with the gmcs version.
756 * generic.cs (ConstructedType): New dummy class.
757 (TypeArguments): Don't make this abstract.
760 (TypeManager.IsGenericTypeDefinition): New method.
761 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
763 2006-09-22 Raja R Harinath <rharinath@novell.com>
765 * expression.cs (ComposedCast): Check for arrays of TypedReference
766 before creating the type, not after.
768 2006-09-21 Marek Safar <marek.safar@seznam.cz>
770 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
773 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
774 when constant must be implicitly convertible.
776 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
778 * ecore.cs (NullCast): Derives from NullConstant.
780 * expression.cs (Is.DoResolve): Removed useless variables.
781 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
782 (New.Constantify): Add enum support.
783 (MemberAccess.DoResolve): Add warning when accessing null constant or
786 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
789 * literal.cs (NullConstant): New abstract class with common
790 functionality for all null specializations.
791 (NullDefault): Represents default(X) when result can be
793 (NullLiteral): Updated.
795 * report.cs: Add new warning.
797 2006-09-21 Martin Baulig <martin@ximian.com>
799 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
801 2006-09-21 Martin Baulig <martin@ximian.com>
803 * generic.cs (GenericConstraints): New dummy class.
804 (Constraints): Likewise.
805 (TypeParameter): Likewise.
806 (TypeParameterName): Likewise.
807 (GenericMethod): Likewise.
809 * typemanager.cs (TypeManager.GetGenericArguments): New method.
811 * decl.cs: Merged with the gmcs version.
813 2006-09-21 Raja R Harinath <rharinath@novell.com>
815 * generic.cs (TypeParameter): Implement IMemberContainer.
816 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
818 * rootcontext.cs: Unify with gmcs version.
820 * report.cs: Unify with gmcs version.
821 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
822 from gmcs/generics.cs.
823 * generics.cs (TypeParameter): New dummy class.
825 * support.cs: Unify with gmcs version.
827 2006-09-20 Raja R Harinath <rharinath@novell.com>
829 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
830 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
832 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
833 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
834 * mcs.exe.sources: Add generic.cs.
836 * codegen.cs: Unify with gmcs version.
838 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
839 (EmitContext): Add GenericDeclContainer implementation.
840 * decl.cs (MemberCore, DeclSpace): Likewise.
841 * namespace.cs: Remove #ifdef GMCS_SOURCE.
843 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
844 MCS TypeManager has a corresponding dummy method.
846 2006-09-19 Martin Baulig <martin@ximian.com>
848 * expression.cs: Completely merged with the gmcs version.
850 2006-09-19 Martin Baulig <martin@ximian.com>
852 * expression.cs (Invocation): Merged with the gmcs version.
853 (ArrayAccess.GetStoreOpcode): Likewise.
855 2006-09-19 Martin Baulig <martin@ximian.com>
858 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
859 (TypeManager.IsGenericMethodDefinition): Likewise.
861 2006-09-19 Martin Baulig <martin@ximian.com>
864 (TypeManager.IsEqual): Moved the gmcs implementation here.
865 (TypeManager.DropGenericTypeArguments): Likewise.
866 (TypeManager.DropGenericMethodArguments): Likewise.
867 (TypeManager.GetTypeArguments): Moved here from gmcs.
868 (TypeManager.HasGenericArguments): Likewise.
870 2006-09-19 Martin Baulig <martin@ximian.com>
872 * expression.cs (Binary): Merged with the gmcs version.
874 2006-09-19 Martin Baulig <martin@ximian.com>
876 * expression.cs (Probe, As, Is): Merged with the gmcs version.
878 2006-09-19 Martin Baulig <martin@ximian.com>
880 * typemanager.cs: Merged with the gmcs version.
882 2006-09-16 Raja R Harinath <rharinath@novell.com>
884 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
885 * driver.cs: Likewise.
887 2006-09-16 Marek Safar <marek.safar@seznam.cz>
890 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
891 only if parent type is class.
892 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
895 2006-09-15 Marek Safar <marek.safar@seznam.cz>
898 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
900 * typemanager.cs(CSharpName): Converts NullType to null.
902 2006-09-15 Martin Baulig <martin@ximian.com>
905 (TypeManager.GetMethodName): Added mcs implementation.
906 (TypeManager.IsEqual): Likewise.
909 (SimpleName.RemoveGenericArity): Added dummy implementation.
911 * pending.cs: Merged with the gmcs version.
913 2006-09-15 Martin Baulig <martin@ximian.com>
915 * statement.cs: Merge with the gmcs version.
917 2006-09-15 Martin Baulig <martin@ximian.com>
919 * statement.cs (Switch): Merge with the gmcs implementation
920 (without nullables), which is newer.
922 2006-09-15 Martin Baulig <martin@ximian.com>
924 * statement.cs (Block.Variables): Make this public.
925 (ToplevelBlock.Parameters): Make this a property.
926 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
928 2006-09-15 Martin Baulig <martin@ximian.com>
930 * namespace.cs: Merge with the gmcs version.
932 2006-09-15 Martin Baulig <martin@ximian.com>
934 * decl.cs (MemberName): Minor code cleanups.
936 2006-09-15 Martin Baulig <martin@ximian.com>
938 * parameter.cs: Merge with the gmcs version.
940 2006-09-15 Martin Baulig <martin@ximian.com>
942 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
945 2006-09-15 Martin Baulig <martin@ximian.com>
947 * flowanalysis.cs: Merged from GMCS; added the generics code into
948 a `GMCS_SOURCE' conditional so we can share this file.
950 2006-09-08 Martin Baulig <martin@ximian.com>
952 * typemanager.cs (TypeManager.interlocked_type): New public field.
953 (TypeManager.int_interlocked_compare-exchange): New public field.
954 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
955 enumerator types here and call InitGenericCoreTypes().
956 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
957 after calling InitEnumUnderlyingTypes().
960 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
961 `classes_second_stage'.
963 2006-09-14 Marek Safar <marek.safar@seznam.cz>
965 * assign.cs, ecore.cs, expression.cs: Share error message text.
966 * class.cs (FieldMember.Define): Check for varible of static type.
967 * driver.cs (LoadAssembly): Uses error output for errors.
968 * statement.cs: Updated.
970 2006-09-08 Marek Safar <marek.safar@seznam.cz>
972 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
975 2006-09-07 Martin Baulig <martin@ximian.com>
978 (MainDriver): Revert r62663 from Marek; see #70506 for details.
980 2006-08-29 Miguel de Icaza <miguel@novell.com>
982 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
984 2006-08-17 Miguel de Icaza <miguel@novell.com>
986 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
987 #52019 and #79064, the use of the \uXXXX sequence in source code
988 to represent unicode characters.
990 2006-08-15 Marek Safar <marek.safar@seznam.cz>
992 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
994 * class.cs, ecore.cs, statement.cs: Merged to one error message.
996 2006-08-13 Miguel de Icaza <miguel@novell.com>
998 * assign.cs: Catch attempts to assign to a method groups in += and
1001 2006-08-13 Marek Safar <marek.safar@seznam.cz>
1004 * cs-parser.jay: Don't destroy current array type by typeof of array's.
1006 2006-08-12 Marek Safar <marek.safar@seznam.cz>
1008 * class.cs (Method.Define): Issue a warning when generic method looks like
1010 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
1013 2006-08-09 Marek Safar <marek.safar@seznam.cz>
1015 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
1017 * decl.cs (MemberCache.FindMembers): When container is interface we need to
1018 search all base interfaces as a member can be ambiguous.
1019 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
1020 Constructor member type filter.
1021 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
1022 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
1023 reporting for returned memberinfos.
1024 * report.cs: Updated.
1025 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
1026 version to work on all runtimes.
1027 (TypeManager.RealMemberLookup): Removed members filtering.
1029 2006-08-08 Raja R Harinath <rharinath@novell.com>
1031 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
1032 (PropertyExpr.EmitAssign): Likewise.
1033 * expression.cs (Indirection.EmitAssign): Likewise.
1034 (LocalVariableReference.EmitAssign): Likewise.
1035 (ParameterReference.EmitAssign): Likewise.
1036 (Invocation.EmitArguments): Likewise.
1037 (ArrayAccess.EmitAssign): Likewise.
1038 (IndexerAccess.EmitAssign): Likewise.
1039 (This.EmitAssign): Likewise.
1040 (ConditionalLogicalOperator.Emit): Likewise.
1043 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
1044 instead of ArrayList. If the hashtable has a LocalBuilder, don't
1045 leave it in after returning it.
1046 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
1048 2006-08-06 Marek Safar <marek.safar@seznam.cz>
1050 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
1053 2006-08-03 Raja R Harinath <rharinath@novell.com>
1055 Fix cs0146-3.cs and cs0146-4.cs.
1056 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
1057 enclosing types don't depend on the current type.
1059 2006-08-02 Raja R Harinath <rharinath@novell.com>
1062 * class.cs (TypeContainer.DoDefineMembers): Use
1063 FindBaseMemberWithSameName on Parent, since we're interested in
1064 whether we hide inherited members or not.
1065 (FindBaseMemberWithSameName): Make slightly more robust.
1067 Fix the non-generic testcase from #77396
1068 * decl.cs (DeclSpace.DeclContainer): Remove override.
1070 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
1071 declspaces for doppelgangers too.
1072 (UsingEntry): Implement IResolveContext.
1073 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
1074 'this' as the resolve context.
1075 (LocalAliasEntry): Likewise.
1077 Implement parts of #77403
1078 * roottypes.cs (RootDeclSpace): New. Used to represent the
1079 toplevel declaration space. Each namespace declaration introduces
1080 a "partial" root declaretion space.
1081 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
1082 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
1083 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
1084 from 'current_namespace.SlaveDeclSpace'.
1085 (namespace_declaration): Likewise.
1086 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
1087 check. It can't happen now.
1088 * decl.cs (DeclSpace.LookupType): Likewise.
1089 * driver.cs (MainDriver): Sanity check.
1091 2006-08-01 Raja R Harinath <rharinath@novell.com>
1093 * decl.cs (DeclSpace.FindNestedType): Remove.
1094 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
1095 LookupTypeContainer to get the container of the nested type.
1096 * class.cs (TypeContainer.FindNestedType): Make non-override.
1098 2006-07-31 Raja R Harinath <rharinath@novell.com>
1100 * decl.cs (DeclSpace.PartialContainer): Move field from ...
1101 * class.cs (TypeContainer.PartialContainer): ... here.
1102 (TypeContainer.AddBasesForPart): New helper.
1103 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
1105 * cs-parser.jay (current_class): Convert to DeclSpace.
1106 (struct_declaration, interface_declaration, class_declaration):
1107 Use AddBasesForPart instead of .Bases directly.
1108 * const.cs, iterators.cs: Update to changes.
1110 2006-07-28 Raja R Harinath <rharinath@novell.com>
1112 * class.cs (TypeContainer.AddMemberType): Rename from
1114 (TypeContainer.AddMember): Rename from AddToMemberContainer.
1115 (AddTypeContainer): New. Combine AddClassOrStruct and
1117 (AddPartial): Update. Add 'is_partial' argument.
1118 * roottypes.cs: Update to changes.
1119 * cs-parser.jay (push_current_class): New helper for handling
1120 current_container and current_class.
1121 (struct_declaration, interface_declaration, class_declaration):
1124 2006-07-26 Raja R Harinath <rharinath@novell.com>
1126 * roottypes.cs: Rename from tree.cs.
1128 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
1129 * tree.cs (Tree, ITreeDump): Remove types.
1130 * rootcontext.cs (tree, Tree): Remove fields.
1131 (root, ToplevelTypes): New.
1132 * *.cs: Update to rename.
1134 * tree.cs (Tree.RecordDecl): Remove.
1135 (RootTypes.AddToTypeContainer): Record the toplevel type in its
1137 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
1139 2006-07-23 Raja R Harinath <harinath@gmail.com>
1141 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
1142 DoFlowAnalysis and OmitStructFlowAnalysis here.
1143 (ec.With): Rename from WithUnsafe and generalize.
1144 (ec.WithCheckState): Remove. All users can be handled by 'With'.
1145 (ec.WithFlowAnalyis): New.
1146 * ecore.cs, expression.cs, statement.cs: Update.
1148 2006-07-22 Raja R Harinath <harinath@gmail.com>
1150 * statement.cs (Block.ResolveMeta): Simplify slightly.
1152 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
1153 multiple boolean fields. Convert InUnsafe, constant_check_state,
1154 check_state to flags.
1155 (CheckState, ConstantCheckState): Update.
1156 (InUnsafe): New read-only property.
1157 (FlagsHandle): Rename from CheckStateHandle and convert to handle
1159 (WithUnsafe): New helper similar to WithCheckState.
1160 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
1161 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
1163 2006-07-21 Raja R Harinath <rharinath@novell.com>
1165 Make comparisons use the same IL irrespective of whether they're
1166 in a 'checked' or 'unchecked' context: one of the issues in #78899
1167 * codegen.cs (EmitContext.CheckState): Make read-only property.
1168 (EmitContext.ConstantCheckState): Likewise.
1169 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
1170 helper that implement a save/restore stack for CheckState
1171 values. This is the only way to change check-state.
1172 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
1173 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
1174 (CheckedExpr.EmitBranchable): New forwarding method.
1175 (UnCheckedExpr): Likewise.
1176 * statement.cs (Block.ResolveMeta): Use WithCheckState.
1177 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
1178 (Checked.Resolve, checked.DoEmit): Likewise.
1180 2006-07-20 Miguel de Icaza <miguel@novell.com>
1182 * anonymous.cs: Cache the resolved anonymous delegate, and return
1183 this so that the ResolveTopBlock is only triggered once, not
1186 Currently we trigger ResolvetopBlock twice due to a first pass of
1187 argument check compatibility, and a second pass that does the
1190 2006-07-15 Marek Safar <marek.safar@seznam.cz>
1192 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
1194 * rootcontext.cs (Reset): Add helper_classes.
1196 2006-07-15 Marek Safar <marek.safar@seznam.cz>
1199 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
1202 2006-07-13 Miguel de Icaza <miguel@novell.com>
1204 * statement.cs (Lock): Handle expressions of type
1205 TypeManager.null_type specially. Fixes #78770
1207 2006-07-08 Marek Safar <marek.safar@seznam.cz>
1209 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
1212 2006-07-08 Marek Safar <marek.safar@seznam.cz>
1214 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
1215 for accessors as well.
1216 * ecore.cs (EventExpr): Add AccessorTable.
1218 2006-07-01 Marek Safar <marek.safar@seznam.cz>
1221 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
1222 for CS0122 where appropriate.
1223 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
1225 (Filter): Assembly can be null in the case of top level attributes.
1227 2006-06-25 Marek Safar <marek.safar@seznam.cz>
1231 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
1232 is done at global level.
1234 2006-06-24 Marek Safar <marek.safar@seznam.cz>
1236 A fix for #77002, Implemented TypeForwarder support.
1238 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
1239 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
1240 * typemanager.cs (): Add type_forwarder_attr_type.
1242 2006-06-24 Marek Safar <marek.safar@seznam.cz>
1244 * report.cs: Add CS0469 warning.
1246 2006-06-21 Martin Baulig <martin@ximian.com>
1248 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
1249 the `try'-block, so we also report CS0016 etc. there.
1251 2006-06-21 Martin Baulig <martin@ximian.com>
1254 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
1256 2006-06-21 Martin Baulig <martin@ximian.com>
1258 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
1259 also report CS1686 for parameters.
1261 2006-06-21 Martin Baulig <martin@ximian.com>
1263 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
1264 instead of an error if the value is not implicitly convertible to
1265 the switch types; fixes #77964.
1267 2006-06-21 Raja R Harinath <rharinath@novell.com>
1270 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
1271 FieldBuilder is null.
1274 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
1275 'left' and 'right' before error-checking.
1277 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
1279 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
1281 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
1282 (FieldExpr.DoResolve): likewise.
1283 (PropertyExpr.InstanceResolve): likewise.
1284 (EventExpr.InstanceResolve): likewise.
1286 2006-06-04 Marek Safar <marek.safar@seznam.cz>
1288 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
1289 attribute applicable tests for attribute argument.
1291 2006-06-02 Raja R Harinath <rharinath@novell.com>
1294 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
1295 (Binary.OverloadResolve_PredefinedIntegral): New.
1296 (Binary.OverloadResolve_PredefinedFloating): New.
1297 (Binary.OverloadResolve_PredefinedString): New.
1298 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
1299 Follow the standard more closely, and treat numeric promotions in
1300 terms of overload resolution.
1301 (Binary.CheckShiftArguments): Simplify.
1303 2006-06-01 Raja R Harinath <rharinath@novell.com>
1305 * flowanalysis.cs (MyBitVector): Simplify representation.
1306 (MyBitVector.Clone): Avoid allocating BitArray.
1307 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
1308 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
1309 (*): Update. Change all references to MyBitVector.And and
1310 MyBitVector.Or to &= and |=.
1312 2006-05-29 Raja R Harinath <rharinath@novell.com>
1315 * cs-parser.jay (formal_parameter_list): Extend the pattern below
1316 to param arguments too.
1318 2006-05-26 Miguel de Icaza <miguel@novell.com>
1320 * cs-parser.jay: Catch another parsing form for arglist being
1321 followed by other arguments. Fixes #78313.
1323 2006-05-24 Raja R Harinath <rharinath@novell.com>
1325 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1326 checking of out parameters to ...
1327 (FlowBranchingToplevel.Merge): ... here.
1328 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1329 set, propagate the origin upward, and only complain if there was
1331 (FlowBranchingException.AddContinueOrigin): Likewise.
1332 (FlowBranchingException.AddReturnOrigin): Likewise.
1333 (FlowBranchingException.AddGotoOrigin): Likewise.
1335 2006-05-23 Raja R Harinath <rharinath@novell.com>
1337 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1338 unreachable, skip it.
1339 (FlowBranchingException.Merge): Always propagate jumps, even if
1340 the finally block renders subsequent code unreachable.
1342 2006-05-18 Raja R Harinath <rharinath@novell.com>
1345 * statement.cs (Goto.Resolve): Move responsibility for resolving
1346 'goto' to FlowBranching.AddGotoOrigin.
1347 (Goto.SetResolvedTarget): New. Callback to set the
1348 LabeledStatement that's the target of the goto.
1349 (Goto.DoEmit): Use Leave instead of Br when crossing an
1350 unwind-protect boundary.
1351 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1352 LookupLabel and adjust to new semantics.
1353 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1354 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1355 Goto.SetResolvedTarget to update target.
1356 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1357 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1358 AddBreakOrigin & co. Delay propagation until ...
1359 (FlowBranchingException.Merge): ... this.
1361 * statement.cs (Block.Resolve): Always depend on flow-branching to
1362 determine unreachability. Kill workaround that originally emitted
1363 only one statement after an "unreachable" label (see infloop in
1366 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1367 This is still "wrong", but anything better would probably need a
1368 multi-pass algorithm.
1369 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1370 usage vector. Force current usage vector to be reachable, to
1371 optimistically signify backward jumps.
1372 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1374 (FlowBranchingLabeled.Merge): New. If no backward jump was
1375 detected, return the original salted-away usage vector instead,
1376 updated with appropriate changes. Print unreachable warning if
1378 * statement.cs (Block.Resolve): Don't print unreachable warning on
1379 a labeled statement.
1381 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
1383 * driver.cs: Pass filename without path to AssemblyBuilder's
1384 AddResourceFile. Fixes bug #78407.
1386 2006-05-17 Raja R Harinath <rharinath@novell.com>
1388 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1389 * flowanalysis.cs (FlowBranchingLabeled): ... here.
1390 (FlowBranching.MergeChild): Overwrite
1391 reachability information from Labeled branchings too.
1393 2006-05-16 Raja R Harinath <rharinath@novell.com>
1395 * statement.cs (Goto.Resolve): Merge jump origins here ...
1396 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1398 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1399 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
1400 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
1401 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1403 * statement.cs (Goto.Resolve): ... not here.
1404 (Goto.Emit): Remove CS1632 check.
1406 2006-05-14 Marek Safar <marek.safar@seznam.cz>
1408 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1411 2006-05-11 Raja R Harinath <rharinath@novell.com>
1413 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1414 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1415 (FlowBranchingException.Label): Likewise.
1417 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
1419 (MyBitVector.Or): Use it to avoid losing information (Count).
1420 (FlowBranching.MergeOrigins): Likewise.
1422 * flowanalysis.cs (UsageVector.IsDirty): Remove.
1423 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1424 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1425 (UsageVector.ToString): Simplify.
1426 (UsageVector.MergeSiblings): Move here from ...
1427 (FlowBranching.Merge): ... here.
1428 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1431 2006-05-10 Raja R Harinath <rharinath@novell.com>
1433 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1434 null bitvector is treated as all-true.
1436 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1437 (MyBitVector): Rationalize invariants. 'vector != null' implies
1438 that we have our own copy of the bitvector. Otherwise,
1439 'InheritsFrom == null' implies all inherited bits are true.
1441 2006-05-09 Marek Safar <marek.safar@seznam.cz>
1443 * statement.cs (LocalInfo): Add IsConstant.
1444 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1445 local variable for constants.
1447 2006-05-09 Raja R Harinath <rharinath@novell.com>
1449 * flowanalysis.cs (MyBitVector.Empty): New.
1450 (MyBitVector): Don't allow InheritedFrom to be null.
1451 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1452 (UsageVector, FlowBranching): Update to changes.
1454 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1455 recursion. The 'Parent == null' condition isn't sufficient for
1457 (FlowBranching.AddBreakOrigin): Likewise.
1458 (FlowBranching.AddContinueOrigin): Likewise.
1459 (FlowBranching.AddReturnOrigin): Likewise.
1460 (FlowBranching.StealFinallyClauses): Likewise.
1461 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1462 (FlowBranching.CheckOutParameters): Likewise.
1463 (FlowBranchingToplevel): Terminate all the above recursions here.
1464 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1465 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1467 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
1469 (FlowBranchingToplevel): New. Empty for now.
1470 (FlowBranching.MergeTopBlock): Update.
1471 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1472 branching for the anonymous delegate.
1473 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1475 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1476 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1477 information at the start of the merge. Reorganize.
1479 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1481 * class.cs (MethodData.Define): Method cannot implement interface accessor.
1483 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1485 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1486 to newly introduced ctor.
1488 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1489 message to one place.
1490 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1493 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1495 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1497 * ecore.cs (Expression.ResolveAsConstant): Updated.
1499 * statement.cs (ResolveMeta): Updated.
1501 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1503 * cs-parser.jay: __arglist cannot be used in initializer.
1505 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1508 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1511 2006-05-05 Raja R Harinath <rharinath@novell.com>
1513 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1514 (LabeledStatement): Add 'name' parameter.
1515 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1516 (Block.AddLabel): Update to changes.
1517 * cs-parser.jay (labeled_statement): Likewise.
1519 * flowanalysis.cs (BranchingType.Labeled): New.
1520 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1521 (FlowBranchingLabeled): New. Does nothing for now, but will
1522 eventually handle 'goto' flows.
1523 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1524 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1525 that's terminated ...
1526 (Block.Resolve): ... here.
1528 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1529 (UsageVector.MergeFinallyOrigins): Likewise.
1530 (FlowBranching.InTryOrCatch): Likewise.
1531 (FlowBranching.AddFinallyVector): Likewise.
1532 (FlowBranchingException): Update to changes.
1535 * statement.cs (Return.Resolve): Move error checking to ...
1536 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1537 (FlowBranchingException): Handle return origins like break and
1539 (FlowBranching.UsageVector.CheckOutParameters): Remove.
1541 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1544 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1547 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1550 * class.cs (MethodData.Define): Do public accessor check only when method
1551 implements an interface.
1553 2006-05-04 Raja R Harinath <rharinath@novell.com>
1555 Remove special handling of 'break'
1556 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1557 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
1558 (UsageVector.Break): Remove.
1559 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1561 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1563 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1564 UsageVector.Breaks (). Don't set NeedsReturnLabel.
1566 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1569 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1570 be the interface member.
1572 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1575 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1576 for emitting small (int) values.
1578 2006-05-03 Raja R Harinath <rharinath@novell.com>
1581 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1582 control-flow passes through the 'finally' after merging-in all the
1583 control-flows from 'try' and the 'catch' clauses.
1585 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1586 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
1587 always true at the only non-recursive entry point.
1588 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1589 FlowBranchingBreakable.
1590 (FlowBranchingLoop): Remove.
1591 * statement.cs (Return.DoResolve): Update to changes.
1594 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1595 (FlowBranching.CreateBranching): Handle it: create a
1596 FlowBranchingContinuable.
1597 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1598 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1599 except that it handles the 'continue' command.
1600 (FlowBranching.UsageVector.MergeOrigins): Rename from
1602 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1603 except that it overrides AddContinueOrigin.
1604 (FlowBranchingException): Override AddContinueOrigin, similar to
1606 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1607 Create a new branching around the embedded statement.
1608 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
1609 control flow after the embedded statement.
1610 (Continue.Resolve): Move all error checking to AddContinueOrigin.
1612 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1613 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1614 FlowBranchingBreakable.
1615 (FlowBranchingSwitch): Remove.
1618 * statement.cs (Break.Resolve): Simplify. Move responsibility for
1619 error reporting to ...
1620 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1621 Rename from 'AddBreakVector'. Add new location argument. Return
1622 a bool indicating whether the 'break' crosses an unwind-protect.
1623 (FlowBranchingException.AddBreakOrigin): Add.
1624 (FlowBranchingException.Merge): Propagate 'break's to surrounding
1625 flowbranching after updating with the effects of the 'finally'
1627 (FlowBranchingBreakable): New common base class for
1628 FlowBranchingLoop and FlowBranchingSwitch.
1630 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1632 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1634 2006-05-02 Raja R Harinath <rharinath@novell.com>
1636 * statement.cs (Do.Resolve): If the loop is infinite, set the
1638 (While.Resolve, For.Resolve): Set a barrier after the embedded
1639 statement. There's no direct control flow that goes from the end
1640 of the embedded statement to the end of the loop.
1641 * flowanalysis.cs (FlowBranching.Infinite): Remove.
1642 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
1643 above ensure that the reachability is correctly computed.
1645 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1646 (UsageVector.MergeBreakOrigins): If the current path is
1647 unreachable, treat it as if all parameters/locals are initialized.
1648 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
1649 infinite loops before merging-in break origins.
1651 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1652 (Reachability.Reachable): Split part into ...
1653 (Reachability.Unreachable): ... this. Simplify.
1654 (Reachability.IsUnreachable): Use 'Unreachable' instead.
1656 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1657 (Reachability.SetThrowsSometimes): Likewise.
1658 (FlowBranchingBlock.MergeTopBlock): Don't compare against
1659 TriState.Always, use corresponding property.
1660 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1661 (Block.Resolve): Likewise. Remove some redundant checks.
1663 2006-05-02 Raja R Harinath <harinath@gmail.com>
1665 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1666 (Reachability.Meet): Don't bother checking AlwaysThrows --
1667 barrier is always set.
1668 (FlowBranchingBlock.Merge): Likewise.
1670 2006-05-01 Raja R Harinath <harinath@gmail.com>
1672 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1673 checks for unreachable.
1675 2006-05-01 Marek Safar <marek.safar@seznam.cz>
1678 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1680 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1681 whether field is really assigned.
1683 2006-04-30 Raja R Harinath <harinath@gmail.com>
1685 * flowanalysis.cs (Reachability): Make 4-argument constructor
1687 (Reachability.Meet): Rename from 'And'. Remove static variant.
1688 (Reachability.Always): Rename from the highly misleading
1689 'Reachability.Never'.
1690 (FlowBranching.Merge): Update to changes. Mark an impossible
1691 situation with a 'throw'.
1692 (*): Update to changes.
1694 2006-04-29 Raja R Harinath <harinath@gmail.com>
1696 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1698 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1699 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1700 (*): Update to changes.
1701 * statement.cs: Update to changes.
1703 2006-04-28 Marek Safar <marek.safar@seznam.cz>
1706 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1708 2006-04-28 Raja R Harinath <harinath@gmail.com>
1710 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1713 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1714 argument to two arguments: an usage-vector and a bool. Move call
1715 to FlowBranching.Merge () ...
1716 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1718 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1719 handling of loop and switch reachability to ...
1720 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1722 2006-04-27 Raja R Harinath <harinath@gmail.com>
1724 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1725 handling to FlowBranchingLoop.InLoop.
1726 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1728 2006-04-26 Marek Safar <marek.safar@seznam.cz>
1731 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1732 anonymous method is allowed from AnonymousContainer here.
1734 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1736 2006-04-24 Raja R Harinath <rharinath@novell.com>
1739 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1741 2006-04-23 Marek Safar <marek.safar@seznam.cz>
1744 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1745 (DoubleConstant.Reduce): Ditto.
1747 2006-04-23 Raja R Harinath <rharinath@novell.com>
1749 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1750 Remove 'lvalue_right_side' argument. Move parts to ...
1751 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1752 (LocalVariable.DoResolveLValue): ... these.
1754 2006-04-21 Raja R Harinath <rharinath@novell.com>
1757 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1758 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1759 (LocalVariableReference.DoResolveBase): Use it to implement new
1761 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1762 (Argument.Resolve): Simplify. Move CS1510 check ...
1763 * ecore.cs (Expression.ResolveLValue): ... here.
1764 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1765 (PropertyExpr.DoResolveLValue): Likewise.
1766 (FieldExpr.Report_AssignToReadonly): Likewise.
1767 (FieldExpr.DoResolve): Add 'out_access' argument. Use
1768 LValueMemberAccess or LValueMemberOutAccess on instance depending
1770 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1771 DoResolve as appropriate.
1773 2006-04-20 Raja R Harinath <rharinath@novell.com>
1776 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1777 implicit conversions on 'out' and 'ref' arguments.
1779 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1780 improve clarity. Remove dead code.
1783 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1784 (Catch.Resolve): Resolve VarBlock if it exists.
1786 2006-04-19 Miguel de Icaza <miguel@novell.com>
1788 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1789 twice, this was some residual code, the enumerator was emitted
1790 properly in the two branche of if later.
1792 2006-04-19 Raja R Harinath <rharinath@novell.com>
1794 * expression.cs (Cast.ResolveLValue): Remove. The result of a
1795 cast is never an lvalue.
1796 (Cast.DoResolve, Cast.ResolveRest): Combine.
1797 (Argument.Emit): Simplify slightly. Move 'Expr is
1798 IMemoryLocation' check ...
1799 (Argument.Resolve): ... here.
1800 (Argument.Error_LValueRequired): Remove. Inline into only user.
1802 Simplifications. Fix cs0191-2.cs
1803 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1804 CS1649 and CS1651 to ...
1805 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
1806 the actual selection of the error code and message to a lookup
1807 table. Add a dummy return value to simplify callsites.
1808 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1809 readonly fields of other instances of the same type. Move CS0197
1811 * expression.cs (Argument.Resolve): ... here. Simplify code.
1812 Ensure that ec.InRefOutArgumentResolving is only set during LValue
1813 resolution of an out or ref argument. The code simplification
1814 above uses this invariant.
1816 2006-04-18 Raja R Harinath <rharinath@novell.com>
1818 Possibly fix #77752. Fix cs1690-[4-7].cs.
1819 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1820 CheckMarshallByRefAccess. Drop parameter.
1821 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
1823 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1825 * report.cs (AllWarnings): Add CS1690.
1826 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1828 (LocalVariableReference.DoResolveBase): Update.
1830 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1832 * class.cs (MethodOrOperator): Moved common parts from method class.
1833 detect obsolete attributes.
1834 (Method.Define): Simplified as it reuses code from base.
1835 (Constructor.ValidAttributeTargets): Fixed issue found during
1837 (Destructor.ValidAttributeTargets): Fixed issue found during
1839 (Operator): Finished refactoring set off by #78020. Operator class is now
1840 ordinary method class.
1842 * anonymous.cs: Updated.
1844 * decl.cs (DeclSpace): Add IsGeneric
1846 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1848 * class.cs (Constructor.Emit): Don't emit the attributes twice.
1850 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1852 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1853 detect obsolete attributes.
1854 (Method.CreateEmitContext): Moved to MethodOrOperator.
1856 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1859 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1860 customized exception to make crash detection easier.
1861 (MethodOrOperator): Started to work on new base class for methods and
1863 (Method): Derives from MethodOrOperator.
1864 (Constructor.Emit): Emits its own attributes.
1865 (AbstractPropertyEventMethod.Emit): Ditto.
1866 (Operator): Derives from MethodOrOperator, will refactor fully in extra
1868 (Operator.Emit): It's temporary more tricky than should be.
1870 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1872 * report.cs (InternalErrorException): Add ctor with inner exception.
1874 2006-04-08 Marek Safar <marek.safar@seznam.cz>
1877 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1880 2006-04-07 Marek Safar <marek.safar@seznam.cz>
1883 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1886 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1888 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1889 attribute is present and Guid not.
1890 (Interface.ApplyAttributeBuilder): Ditto.
1892 * attribute.cs: Add error message.
1894 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1898 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1899 sources (it's composite) so hold them in extra array as they are used in
1900 Emit phase only. It worked in the previous versions by mistake.
1901 (Attribute.Emit): Emit attribute for more owners when exist.
1903 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1904 it has now different behaviour.
1906 2006-04-04 Marek Safar <marek.safar@seznam.cz>
1908 * constant.cs (Constant.IsDefaultInitializer): New method.
1910 * class.cs: Updated.
1912 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1913 re-initialize default values. It saves KBs almost for every assembly.
1914 Thanks Zoltan for the idea.
1915 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1916 (ArrayCreation.DoResolve): Resolve only once.
1917 (ArrayCreation.Emit): Emit static initializer only when it is faster.
1918 (ArrayCreation.GetAttributableValue): Cope with optimized values.
1920 2006-04-03 Zoltan Varga <vargaz@gmail.com>
1922 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1925 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1927 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1928 in an embedded statement too.
1930 2006-04-01 Raja R Harinath <rharinath@novell.com>
1933 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1935 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1939 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1942 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1944 2006-03-31 Marek Safar <marek.safar@seznam.cz>
1946 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1949 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1950 LocalTemporary change.
1952 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1954 (ClassOrStruct.DefineFieldInitializers): Implemented static field
1955 initializers optimization.
1956 (ClassOrStruct.TypeAttr): Moved from modifiers.
1957 (Constructor.CheckBase): Don't crash when static ctor has parameters.
1958 (FieldBase.ResolveInitializer): Resolves initializer.
1959 (FieldBase.HasDefaultInitializer): New property.
1961 * cs-parser.jay: Removed message.
1963 * expression.cs (CompilerGeneratedThis): New specialization.
1965 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1967 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1969 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1971 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1973 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1974 be now EnumConstants only.
1976 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1978 * attribute.cs, driver.cs: Reset more caches.
1980 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1982 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1984 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1986 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1987 for easier reuse. Updated all overrides.
1988 (IntegralConstant): New base class for all integral constants.
1989 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1990 of the constant range, report custom error.
1991 (UIntConstant.Reduce): Fixed uint conversion.
1993 * ecore.cs, literal.cs: Reduce updates.
1995 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1999 * class.cs (Constructor.Define): Removed extra if for default ctors.
2000 A patch from Atsushi Enomoto.
2002 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2004 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
2005 GetAttributableValue.
2007 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
2010 * convert.cs (ImplicitConversionRequired): Error message moved to
2013 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
2014 automatic implicit conversion of an output value.
2015 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
2017 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
2019 (TypeOf.GetAttributableValue): Add extra handling for object type.
2021 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
2022 special error message.
2024 2006-03-25 Marek Safar <marek.safar@seznam.cz>
2026 * class.cs (Constructor.Emit): Don't crash when struct ctor is
2028 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
2029 compatible with MS runtime.
2031 2006-03-23 Marek Safar <marek.safar@seznam.cz>
2033 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
2034 attribute arguments here.
2036 * class.cs (Indexer.Define): The check was moved to attribute class.
2038 2006-03-22 Marek Safar <marek.safar@seznam.cz>
2040 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
2041 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
2044 2006-03-22 Raja R Harinath <rharinath@novell.com>
2046 Support ParameterDefaultValueAttribute in gmcs. Also applied to
2047 mcs to keep code differences small.
2048 * attribute.cs (Attribute.GetParameterDefaultValue): New.
2049 * typemanager.cs (parameter_default_value_attribute_type): New.
2050 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
2053 2006-03-21 Marek Safar <marek.safar@seznam.cz>
2055 * expression.cs (StringConcat.Append): Reverted back to no warning state.
2057 2006-03-21 Marek Safar <marek.safar@seznam.cz>
2059 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
2061 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
2064 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
2066 * doc-bootstrap.cs : fix build.
2068 2006-03-20 Marek Safar <marek.safar@seznam.cz>
2070 * expression.cs (StringConcat.Append): Issue a warning when empty string
2073 2006-03-20 Marek Safar <marek.safar@seznam.cz>
2075 * assign.cs (CompoundAssign.ResolveSource): Removed.
2077 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
2080 * class.cs (TypeContainer.FindMethods): Removed.
2081 (TypeContainer.CheckMemberUsage): Made static.
2083 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
2085 * constant.cs (CheckRange): Removed unused type argument.
2086 (CheckUnsigned): Removed unused type argument.
2088 * cs-parser.jay: Updated after MemberAccess clean up.
2089 Uses Length for empty string test.
2091 * cs-tokenizer.cs: Uses Length for empty string test.
2092 (IsCastToken): Made static.
2093 (is_hex): Made static.
2094 (real_type_suffix): Made static.
2096 * decl.cs (SetupCache): Made static.
2097 (OnGenerateDocComment): Removed unused ds argument.
2099 * delegate.cs (VerifyDelegate): Removed unused argument.
2101 * doc.cs: Uses Length for empty string test.
2103 * driver.cs: Uses Length for empty string test.
2105 * enum.cs (IsValidEnumType): Made static
2107 * expression.cs (EnumLiftUp): Removed unused argument.
2108 (ResolveMethodGroup): Ditto.
2109 (BetterConversion): Ditto.
2110 (GetVarargsTypes): Ditto.
2111 (UpdateIndices): Ditto.
2112 (ValidateInitializers): Ditto.
2113 (MemberAccess.ctor): Ditto.
2114 (GetIndexersForType): Ditto.
2116 * flowanalysis.cs: (MergeFinally): Removed unused argument.
2118 * iterators.cs: Updated after MemberAccess clean up.
2120 * location.cs: Uses Length for empty string test.
2122 * namespace.cs: Uses Length for empty string test.
2124 * report.cs (CheckWarningCode): Made static.
2126 * statement.cs (LabeledStatement): Removed unused argument.
2128 * typemanager.cs (FilterNone): Removed.
2130 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2132 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
2135 * class.cs: Updated.
2137 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2139 * cs-parser.jay.cs: __arglist is not allowed for delegates.
2141 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2145 * expression.cs (VerifyArgumentsCompat): Reverted to double error
2146 reporting, it's more tricky than I thought.
2148 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2152 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
2154 (AnonymousMethod.ImplicitStandardConversionExists): New method.
2155 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
2156 Add more error reporting; Fixed issue with params.
2158 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
2160 * cs-parser.jay: AnonymousMethod requires host container.
2162 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
2164 2006-03-18 Raja R Harinath <harinath@gmail.com>
2166 * class.cs: Change 'TypeContainer ds' constructor argument to
2167 'DeclSpace parent'. Some classes were missed below due to
2168 different naming convention.
2170 * class.cs (MemberCore.Parent): Delete. This makes the
2171 ParentContainer changes below enforceable by the compiler.
2173 Treat pointers to enclosing declaration space as 'DeclSpace', not
2175 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
2176 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
2178 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
2180 (Block.AddThisVariable): Likewise.
2181 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
2182 (AbstractPropertyEventMethod.Emit): Likewise.
2183 (AbstractPropertyEventMethod.EmitMethod): Likewise.
2184 (GetMethod.Define, SetMethod.Define): Likewise.
2185 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
2186 (DelegateMethod.EmitMethod): Likewise.
2188 Fix regression test-partial-13.cs.
2189 Rationalize use of PartialContainer. Ensure that the partial
2190 class semantics can be tied to type-correctness, i.e., any
2191 violation will cause a compile error.
2192 * class.cs, const.cs: Access all fields that belong to class
2193 TypeContainer via ParentContainer. Arguments of EmitContexts and
2194 Resolve()-like functions still use 'Parent'.
2196 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
2197 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
2198 (PropertyMethod.CheckModifiers): Remove unused argument.
2199 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
2202 2006-03-17 Raja R Harinath <harinath@gmail.com>
2204 Make semantics of PartialContainer simpler.
2205 * decl.cs (DeclSpace.IsPartial): Remove.
2206 * class.cs (TypeContainer.IsPartial): Likewise.
2207 (TypeContainer..ctor): Set PartialContainer to point to self.
2208 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
2209 (TypeContainer.FindNestedType): Likewise.
2210 (MemberCore.ParentContainer): Simplify. Remove deprecation.
2212 2006-03-17 Marek Safar <marek.safar@seznam.cz>
2214 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2216 2006-03-15 Marek Safar <marek.safar@seznam.cz>
2218 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
2221 2006-03-15 Marek Safar <marek.safar@seznam.cz>
2223 * class.cs (Operator.Define): An error for base conversion was not
2226 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
2228 * iterator.cs : yield break is allowed in try statement which has
2229 catch clauses. Fixed bug #77767.
2231 2006-03-13 Marek Safar <marek.safar@seznam.cz>
2233 A fix for #77593, #77574.
2235 * class.cs (MethodCore.CheckBase): Another if for operator.
2237 2006-03-09 Marek Safar <marek.safar@seznam.cz>
2239 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
2242 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
2243 (DelegateCreation.ImplicitStandardConversionExists): New method for just
2246 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
2249 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
2250 Updated after another emitcontext usage was clean up. It should help us to
2251 synchronize with gmcs easier.
2253 2006-03-04 Marek Safar <marek.safar@seznam.cz>
2257 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
2258 (Event.Define): ditto
2259 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
2261 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
2262 Removed redundant code and set NewSlot for Invoke method too.
2264 * parameter.cs (Parameters.ctor): Add custom, type ctor.
2265 (Parameters.MergeGenerated): New method. Use this method when you merge
2266 compiler generated argument with user arguments.
2268 2006-03-03 Marek Safar <marek.safar@seznam.cz>
2270 * attribute.cs (ResolveAsTypeTerminal): Removed.
2272 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
2273 specialization for predefined types; 30% speed up.
2274 Finally placed obsolete check to right place.
2275 (Expression.ResolveType): Removed.
2277 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
2278 Updated after ResolveType was removed.
2280 * expression.cs (Cast.ctor): Check void cast.
2281 (Binary.ResolveAsTypeTerminal): Is never type.
2282 (Conditional.ResolveAsTypeTerminal): Is never type.
2284 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
2286 2006-03-01 Raja R Harinath <rharinath@novell.com>
2289 * expression.cs (ParameterReference.DoResolveBase): Change return
2291 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2295 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2298 * typemanager.cs (GetFullNameSignature): Don't nullref on
2299 protected accessors.
2301 2006-02-27 Marek Safar <marek.safar@seznam.cz>
2303 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
2304 these two separated members to simplify the code.
2305 (Attribute.Resolve): Refactored to use new fields and methods.
2306 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
2307 implemented obsolete attribute checking.
2308 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2309 implemented obsolete checking again. It look line never ending quest ;-)
2310 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2312 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2314 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2316 *class.cs (Property.Define): Add RegisterProperty call.
2318 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2319 argument groups (only 2).
2321 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2322 encoding expression to arguments.
2323 (Expression.ExprClassToResolveFlags): Just turned to property.
2325 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2326 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2327 optimized as well as implemented support for zero-length attributes.
2329 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2330 Add caching of PropertyInfo's.
2332 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2334 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2335 error multiple times.
2337 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2339 New partial class implementation.
2340 A fix for #77027, #77029, #77403
2342 * attribute.cs (Attributable): Made attributes protected.
2344 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2345 the replacements of ClassPart and PartialContainer.
2346 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2347 (TypeContainer.AddInterface): Ditto.
2348 (TypeContainer.AddPartial): The main method for partial classes. It checks
2349 for errors and merges ModFlags and attributes. At the end class is added to
2351 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2353 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2354 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2355 from the rest of partial classes.
2356 (TypeContainer.GetClassBases): Simplified.
2357 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2359 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2360 (TypeContainer.HasExplicitLayout): Uses Flags now.
2361 (PartialContainer): Removed.
2362 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2363 (StaticClass): Was merged with Class.
2364 (Class.GetClassBases): class and static class bases are verified here.
2365 (Class.TypeAttr): Added static attributes when class is static.
2366 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2367 (MemberBase): In some cases we need to call parent container for partial
2368 class. It should be eliminated but it's not easy now.
2370 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2372 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2373 partial classed to accumulate class comments.
2374 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2376 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2378 * driver.cs (MainDriver): Tree.GetDecl was removed.
2380 * modifiers.cs (Modifiers): Add partial modifier.
2382 * tree.cs (Tree.decl): Removed.
2383 (RootTypes): Started to use this class more often for root types
2386 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2390 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2391 external interface does not have an attribute.
2393 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2395 Another prerequisites for new partial classs implementation.
2397 * attribute.cs (Attribute.Equal): Implemented.
2398 (Attribute.Emit): Changed as attributes can be applied more than twice.
2399 (Attributes.Emit): Check for duplicate attributes here.
2401 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2402 as a parameter, clean-up.
2404 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2408 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2409 contains obsolete attribute check which can in some cases look for base
2410 type of current class which is not initialized yet.
2411 (TypeContainer.BaseType): Replacement of ptype.
2413 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2415 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2417 First of prerequisites for new partial classs implemention.
2419 * attribute.cs (Attributable): Extended by ResolveContext;
2420 Attributes finally have correct context for resolving in all cases.
2421 (AttachTo): Attribute owner is assigned here.
2423 * codegen.cs (IResolveContext): Introduce new interface to hold
2424 all information needed in resolving phase.
2425 (EmitContext): Implements IResolveContext; more clean-up needed here.
2427 * decl.cs (MemberCore): Implemented IResolveContext.
2429 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2430 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2431 parameter.cs, statement.cs, tree.cs, typemanager.cs:
2432 Refactored to use new IResolveContext instead of EmitContext; cleanup
2434 2006-02-06 Miguel de Icaza <miguel@novell.com>
2436 * codegen.cs (EmitScopeInitFromBlock): check here the
2437 capture_context, there is no need to make two calls to the
2440 * anonymous.cs: Add some debugging messages that might help me
2441 track other instances of this problem in the future (the
2442 regression of test 467).
2444 * cs-parser.jay: track the variable block, as we need to initalize
2445 any captured variables declared in this block for the "catch"
2446 portion of the "Try" statement.
2448 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2449 scope initialization for captured variables.
2451 Also, move the emit for the variables after the block location has
2454 2006-02-06 Marek Safar <marek.safar@seznam.cz>
2456 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2458 2006-02-02 Miguel de Icaza <miguel@novell.com>
2460 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2461 commit yesterday, the initialization for the roots is necessary.
2462 What is not necessary is the scope activation.
2464 2006-02-02 Raja R Harinath <rharinath@novell.com>
2466 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2467 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2469 (Argument.Resolve): Remove CS0206 checks.
2471 2006-02-01 Miguel de Icaza <miguel@novell.com>
2473 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2474 scopes for all the roots, the scopes will now be emitted when the
2475 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2477 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2478 code. This reduces a lot of existing cruft.
2480 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2481 that the ScopeInfo is generated as we enter the scope, not at the
2482 time of use, which is what we used to do before.
2484 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2485 every time a Block is about to be emitted if we have a
2488 2006-02-01 Raja R Harinath <rharinath@novell.com>
2490 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2492 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2494 * typemanager.cs (cons_param_array_attribute): Make private.
2495 (Reset): Set it to null.
2496 (InitCoreHelpers): Don't initialize it.
2497 (ConsParamArrayAttribute): New. Initialize it as needed.
2498 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2500 2006-01-31 Miguel de Icaza <miguel@novell.com>
2502 * expression.cs: There might be errors reported during the
2503 selection of applicable methods. If there are errors, do not
2504 continue execution as it will lead the compiler to crash.
2506 2006-01-30 Miguel de Icaza <miguel@novell.com>
2508 * expression.cs: Member access is not allowed on anonymous
2509 methods. Fixes #77402.
2511 2006-01-30 Raja R Harinath <rharinath@novell.com>
2514 * cs-parser.jay (VariableDeclaration): Don't set
2515 current_array_type to null.
2516 (field_declaration, event_declaration, declaration_statement):
2517 Set it to null here.
2519 2006-01-28 Raja R Harinath <harinath@gmail.com>
2521 * typemanager.cs (GenericParameterPosition): New.
2524 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
2526 * doc.cs : To process "include" elements, first we should create
2527 another list than XmlNodeList, because it could result in node
2528 removal, which could result in that the XmlNodeList gives up
2531 (Also made code identical to gmcs again.)
2533 2006-01-25 Miguel de Icaza <miguel@novell.com>
2535 * ecore.cs: Introduce an error report that we were not catching
2536 before, if not silent, we must report the error. Gonzalo ran into
2539 2006-01-23 Miguel de Icaza <miguel@novell.com>
2541 A fix for bug: #76957
2543 * iterators.cs (MoveNextMethod.CreateMethodHost): call
2544 ComputeMethodHost before creating the method, this is a new
2547 * anonymous.cs (AnonymousContainer): Now we track all the scopes
2548 that this method references (RegisterScope). The actual scope
2549 where the method is hosted is computed with the ComputeMethodHost
2550 before we create the method.
2552 Moved the Deepest routine here.
2554 (AnonymousContainer.ComputeMethodHost): New routine used to
2555 compute the proper ScopeInfo that will host the anonymous method.
2557 (ScopeInfo): Deal with multiple roots. The problem was that we
2558 did not have a unique root where all ScopeInfos could be hanged
2559 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
2562 Remove AdjustMethodScope which is now computed at the end. Remove
2563 LinkScope which did a partial link, instead link all ScopeInfos
2564 before code generation from the new "LinkScopes" routine.
2566 Simplify all the Add* routines as they no longer need to maintain
2567 the tree, they just need to record that they are using variables
2570 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2571 routines to produce the forest of ScopeInfo trees.
2573 * class.cs (TypeContainer.AppendMethod): This is just like
2574 AddMethod, but ensures that an interface implementation method
2575 (IEnumerable.XXX) is not inserted at the beginning of the queue of
2576 methods, but at the end.
2578 We use this functionality to ensure that the generated MoveNext
2579 method in the iterator class is resolved/emitted before the
2580 enumerator methods created.
2582 This is required because the MoveNext method computes the right
2583 ScopeInfo for the method. And the other methods will eventually
2584 need to resolve and fetch information computed from the anonymous
2587 2006-01-21 Raja R Harinath <harinath@gmail.com>
2588 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2591 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2593 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2594 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2596 2006-01-18 Raja R Harinath <rharinath@novell.com>
2598 Fix #76656, cs0231-2.cs.
2599 * cs-parser.jay (formal_parameter_list): Make error case catch
2601 (parenthesized_expression_0): Add CS1026 check.
2602 (invocation_expression): Remove unused { $$ = lexer.Location }.
2604 2006-01-17 Raja R Harinath <rharinath@novell.com>
2607 * cs-parser.jay (statement_expression): Don't list out the
2608 individual statement-expressions. Convert syntax error into
2611 2006-01-16 Raja R Harinath <rharinath@novell.com>
2614 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2615 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
2616 CheckIntermediateModification.
2617 (FieldExpr.DoResolve): Add new two-argument version that
2618 allows us to resolve the InstanceExpression as an lvalue.
2619 The one-argument variant is now just a wrapper.
2620 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2621 Resolve the lhs as an lvalue if the it has a value type.
2622 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2623 from Assign.DoResolve.
2624 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2625 resolved as an lvalue.
2626 (PropertyExpr.DoResolve): Update.
2627 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2628 has a value type. Move CS1612 check here from
2629 CheckIntermediateModification.
2630 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2631 * expression.cs (EmptyExpression.OutAccess): New. Used as the
2632 'right_side' of a ResolveLValue on an 'out' argument.
2633 (EmptyExpression.LValueMemberAccess): New. Used as the
2634 'right_side' of a propagated ResolveLValue on a value type.
2635 (LocalVariableReference.DoResolveBase): Recognize
2636 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2638 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2639 EmptyExpression.Null.
2641 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
2643 * typemanager.cs : added IsGenericParameter(). In mcs it always
2645 * doc.cs : for generic parameters, use GenericParameterPosition,
2648 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
2650 * expression.cs: Fix Console.WriteLine ((this = x).foo);
2652 2006-01-12 Miguel de Icaza <miguel@novell.com>
2654 This fixes the problem where we used ldfld instead of ldflda to
2655 load the "THIS" pointer on captured parameters, when THIS is a
2656 value type. See bug #77205.
2658 * iterators.cs (CapturedThisReference.Emit): Pass false to
2659 EmitThis (we do not need the address).
2661 * codegen.cs (EmitThis): it needs to know whether we need the
2662 address of `this' or not. This is used by value types.
2664 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2665 every other call passes false.
2667 2006-01-12 Raja R Harinath <rharinath@novell.com>
2670 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2672 * expression.cs (Invocation.OverloadResolve): Update.
2673 (Invocation.DoResolve): Avoid double resolution of invocation.
2675 2006-01-11 Raja R Harinath <rharinath@novell.com>
2678 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2679 unary negation of floating point types as 0-expr; negation cannot
2680 overflow in floating point types.
2683 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2684 on operands of 'void' type.
2687 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2688 and ExclusiveOr for boolean constants too.
2690 2006-01-09 Raja R Harinath <rharinath@novell.com>
2693 * expression.cs (Invocation.OverloadResolve): Replace reflected
2694 override methods with their base virtual methods, rather than
2696 * typemanager.cs (TypeManager.GetOverride): New.
2698 2006-01-05 Jb Evain <jbevain@gmail.com>
2700 * class.cs (Property.Define, Indexer.Define): do not tag the
2701 properties as SpecialName | RTSpecialName.
2703 2006-01-04 Miguel de Icaza <miguel@novell.com>
2705 * class.cs (MethodCore.IsDuplicateImplementation): This method was
2706 doing a low-level comparission of parameter types. It was lacking
2707 a check for __argslist.
2709 2005-12-30 Miguel de Icaza <miguel@novell.com>
2711 * expression.cs (ParameterReference.DoResolveBase): Allow
2712 reference parameters if they are local to this block.
2714 This allows the ref and out parameters of a delegate to be used in
2715 an anonymous method, for example:
2717 delegate void set (out int x);
2719 set s = delegate (out int x){
2723 This is used by functionality introduced late in the C# language.
2725 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2726 method that take ref and out parameters.
2728 Fixes #77119 which was a late change in the spec.
2730 2005-12-23 Miguel de Icaza <miguel@novell.com>
2732 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2733 parent if its the same scope. Fixes #77060.
2735 2005-12-21 Miguel de Icaza <miguel@novell.com>
2737 * driver.cs: Report the case of no source files and no -out:
2740 2005-12-20 Raja R Harinath <rharinath@novell.com>
2743 * expression.cs (ComposedCast.GetSignatureForError): Define.
2745 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2749 * namespace.cs (NamespaceEntry): Add extern_aliases as a
2750 ListDictionary, to contain the ExternAliasEntry entries (in
2751 addition to the NamespaceEntry.aliases hashtable). This field is
2752 shared between the original entry and its doppelganger (bodyless
2754 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2755 extern_aliases field.
2756 (NamespaceEntry.Lookup): Move the IsImplicit check after the
2757 lookup in extern_aliases.
2759 2005-12-16 Raja R Harinath <rharinath@novell.com>
2762 * class.cs (TypeContainer.Mark_HasEquals): New.
2763 (TypeContainer.Mark_HasGetHashCode): New.
2764 (ClassPart): Override them.
2765 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2768 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2769 'parent' argument to the base constructor.
2771 Remove all mention of TypeContainer from decl.cs.
2772 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2773 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2774 (DeclSpace.DeclSpace): Likewise.
2775 (DeclSpace.DefineMembers): Remove unused argument.
2776 * cs-parser.jay (pop_current_class): Update to changes. Simplify
2777 debugging check -- we don't care if the debug code throws an
2778 InvalidCastException instead of an InternalErrorException.
2779 * class.cs (TypeContainer.DefineMembers): Update to changes.
2780 (TypeContainer.DoDefineMembers): Likewise.
2781 (TypeContainer.GetMethods): Likewise.
2782 (PropertyMember.Define): Likewise.
2783 (MemberBase.Parent): New property that forwards to
2784 MemberCore.Parent, but ensures that we get a TypeContainer.
2785 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2786 (RootContext.PopulateTypes): Likewise. Remove special case code
2787 for !RootContext.StdLib: DefineMembers is idempotent.
2789 2005-12-14 Miguel de Icaza <miguel@novell.com>
2791 * convert.cs (ExplicitConversionCore): Check the return value from
2792 ExplicitConversionCore which can return null on failure. Fixes #76914
2794 2005-12-13 Marek Safar <marek.safar@seznam.cz>
2796 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2798 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
2800 * doc.cs : The search for referenced namespace was insufficient to
2801 get global one as it used to do. Fixed bug #76965.
2803 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
2805 * doc.cs : check name in cref in the last phase that whether it is
2808 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2810 * cs-tokenizer.cs : reverted the latest change: it somehow broke
2813 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2815 * doc.cs : so it turned out that we cannot skip override check for
2816 interface members. Fixed bug #76954.
2818 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2820 * cs-tokenizer.cs : fixed bug #75984:
2821 - #warning and #error should not be handled when the source line
2823 - #line is not checked strictly when the source line is disabled.
2824 - #define and #undef is on the other hand checked strictly at any
2827 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
2829 * cs-tokenizer.cs : missing Location (actually, filename) in one of
2832 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2834 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2836 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2838 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2839 (FieldBase.Initializer): Initializer is now optional.
2840 (EventField.Define): Only event field can have initializer.
2842 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2844 * const.cs (Const): Reuse initializer.
2846 * cs-parser.jay: Updated after FieldBase changes.
2847 Added current_array_type to simplify array initializers.
2849 * ecore.cs (NullCast.IsDefaultValue): Implemented.
2851 * expression.cs, iterators.cs: Updated.
2853 * namespace.cs (NamespaceEntry): Made UsingFound private.
2855 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2857 * parameterCollection.cs: Obsolete, removed.
2858 * parser.cs: Obsolete, removed.
2860 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2863 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2865 * enum.cs (Enum.Define): Set obsolete context here.
2867 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2870 - FindDocumentedMember() now expects 1) paramList as null
2871 when "we don't have to check the number of parameters" and
2872 2) Type.EmptyTypes when "there is no arguments".
2873 - Introduced FoundMember struct to hold the exact type which was
2874 used to find the documented member (the above change broke
2875 test-xml-044; it might be better just to use DeclaringType than
2876 what MS does, like this change does, but it depends on usage.)
2878 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2880 * doc.cs : documented member might be from DeclaringType for nested
2881 types. Fixed bug #76782.
2883 2005-12-03 Ben Maurer <bmaurer@ximian.com>
2885 * anonymous.cs: Have the param code handle leaving copies on the
2886 stack etc. Allows anonymous params to take part in the assignment
2887 code (++, +=, etc). Fixes bug #76550
2889 * expression.cs: Handle the prepare_for_load/leave_copy by passing
2890 it down to the anon code.
2892 * iterators.cs: Use dummy var here
2894 * codegen.cs: Handle new vars
2896 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2899 * class.cs (MethodData.Define): Set proper Obsolete context.
2901 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2903 (FieldExpr.DoResolve): Ditto.
2905 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2908 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2909 parent is not obsolete.
2911 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
2913 * doc.cs : (FindDocumentedMember) find parameterless members first
2914 and get CS0419 in the early stage. Fixed first case of bug #76727.
2916 2005-11-30 Marek Safar <marek.safar@seznam.cz>
2919 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2920 no error was reported.
2922 *expression.cs (Binary.DoResolve): left can be null.
2924 2005-11-22 Marek Safar <marek.safar@seznam.cz>
2927 * class.cs (MethodData.Emit): Parameters should be labeled first.
2929 2005-11-21 Marek Safar <marek.safar@seznam.cz>
2932 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2934 2005-11-18 Marek Safar <marek.safar@seznam.cz>
2936 * attribute.cs (AreParametersCompliant): Moved to Parameter.
2938 * class.cs (MethodCore): Parameter clean up.
2939 (IMethodData): Added ParameterInfo.
2940 (MethodData): Parameter clean up.
2941 (Indexer.Define): Parameter clean up.
2953 * typemanager.cs: Parameter clean up.
2955 * delegate.cs (Define): Get rid of duplicated code.
2957 * expression.cs (ParameterReference): Removed useless parameters
2959 (Invocation): Ditto.
2961 * parameter.cs (ParamsParameter): New class, params specialization.
2962 (ArglistParameter): Attemp to separate arglist.
2963 (Parameter): Refactored to be reusable and faster.
2964 (Parameter.Modifier): Made understandable.
2965 (Parameters): Changed to be used as a class for `this' assembly
2966 parameters. Refactored to use new specialized classes.
2968 * support.cs (ParameterData): Added Types property.
2969 (InternalParameters): Deleted.
2971 2005-08-20 Martin Baulig <martin@ximian.com>
2973 Merging this patch from GMCS to fix #75867.
2975 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2976 scope if we don't already have it.
2978 2005-11-17 Martin Baulig <martin@ximian.com>
2981 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2982 inherit the scope from our parent. Fixes #76653.
2984 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2986 * doc.cs : the previous patch does not actually fix the bug.
2987 PropertyInfo override check is now implemented and really fixed it.
2988 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2990 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2992 * doc.cs : apply "override filter" also to properties.
2995 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2997 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2998 no need to check overrides. For classes, omit those results from
2999 interfaces since they must exist in the class. Fixed bug #76726.
3001 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3003 * typemanager.cs : (GetFullNameSignature) differentiate indexers
3004 with different parameters. Fixed the second problem in #76685.
3006 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3008 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3009 get expected 'protected' access in CheckValidFamilyAccess()).
3012 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3014 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3015 Fixed bug #76705. CS1569 was incorrectly commented out.
3017 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3019 * doc.cs : use Invocation.IsOverride() to do real override check.
3020 * expression.cs : made Invocation.IsOverride() internal.
3022 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3024 * doc.cs : use TypeManager.FindMembers() instead of (possible)
3025 TypeBuilder.FindMembers() and filter overriden base members out.
3028 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3030 * doc.cs : ref/out parameters are represented as '@' (instead of
3031 '&' in type FullName). Fixed bug #76630 (additionally crefs).
3033 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3035 * doc.cs : when there was no '.' in cref to methods in doc comment,
3036 then parameters were missing in the output. Fixed bug #76691.
3038 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3040 * driver.cs : don't output docs when there is an error.
3043 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3046 Now it should detect indexers. Fixed primary concern in bug #76685.
3047 Fixed CS0419 message to not show the identical member signature in
3050 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3052 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3053 instead of Type.FindMembers() since it does not handle events.
3056 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
3058 * codegen.cs: Fixed typo (speficied -> specified).
3060 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3063 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3065 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3067 * attribute.cs: Changed error message.
3069 * cs-tokenizer.cs: One more check.
3071 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3073 * statement.cs (Block.Resolve): Ignore empty statement.
3075 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3077 * report.cs: Made error/warning methods more strict to avoid
3080 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3081 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3082 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3083 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3085 2005-11-08 Marek Safar <marek.safar@seznam.cz>
3087 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3088 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3090 * class.cs (TypeContainer.IsComImport): New property.
3091 (Constructor.Define): Create proper ctor for ComImport types.
3093 * expression.cs (New.CheckComImport): Fixed.
3095 2005-11-07 Miguel de Icaza <miguel@novell.com>
3097 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3098 that a parameter has been captured does not mean that we do not
3099 have to do the rest of the processing. This fixes the second part
3100 of #76592. If there was another anonymous method capturing
3101 values in the past, the Scope would never be set for the second
3102 method that captured the same parameter.
3104 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3105 properly manipulate the stack. Second part of fix for #76592.
3107 * expression.cs (New): Add support for invoking "new" on
3108 interfaces that have been flagged with the ComImport attribute and
3109 the CoClass. Fixes #76637
3111 * statement.cs (Try.DoEmit): When a variable is captured, do not
3112 try to emit the vi.LocalBuilder variable as it has been captured.
3113 Create a temporary variable and store the results on the
3114 FieldBuilder. Fixes #76642
3116 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3118 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3120 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3122 * expression.cs (Binary.DoResolve): Added && optimalization.
3124 * typemanager.cs (AddUserType): Removed useless argument.
3126 2005-11-04 Marek Safar <marek.safar@seznam.cz>
3128 * statement.cs (Block.variables): Uses ListDictionary.
3130 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3133 * class.cs (PartialContainer.EmitType): Customized to emit
3134 security attributes.
3135 (ClassPart.ApplyAttributeBuilder): Transform security attribute
3136 for partial classes.
3138 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3141 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3142 access has to be fixed.
3144 * typemanager.cs (IsUnmanagedType): Wrong common field type.
3146 2005-11-01 Marek Safar <marek.safar@seznam.cz>
3149 * ecore.cs (NullCast.Reduce): Implemented.
3151 * expression.cs (ArrayCreation.CheckIndices): Correcly check
3154 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3156 (Foreach.Resolve): Catch null properly.
3158 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3160 * cs-tokenizer.cs: Warning text fix.
3162 * driver.cs: AllWarningNumbers exposed on public interface.
3164 * report.cs (): Reviewed warning numbers.
3165 (IsValidWarning): Use binary search.
3167 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3169 * driver.cs: Implemeted resource visibility.
3170 (Resources): New class for code sharing between /res: and
3173 2005-10-28 Marek Safar <marek.safar@seznam.cz>
3176 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3179 * convert (Convert.ImplicitReferenceConversion): NullCast holds
3182 * ecore.cs (NullCast): Child is contant only.
3184 * literal.cs (NullLiteral.Reduce): null can be converted to any
3187 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
3189 * driver.cs: Use Encoding.Default as default code page instead
3192 2005-10-27 Raja R Harinath <rharinath@novell.com>
3195 * expression.cs (Invocation.Error_InvalidArguments): Handle
3196 __arglist parameters.
3197 (Invocation.VerifyArgumentsCompat): Likewise.
3198 * support.cs (ReflectionParameters.GetSignatureForError): Print
3199 __arglist parameters.
3200 (InternalParamters.GetSignatureForError): Likewise.
3201 * parameter.cs (Parameters.GetSignatureForError): Likewise.
3203 2005-10-26 Marek Safar <marek.safar@seznam.cz>
3205 * attribute.cs (GetPropertyValue): Made public.
3207 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3209 Add new property WrapNonExceptionThrows to handle 2.0 assembly
3211 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3214 * driver.cs: Reflect method name change.
3216 * statement.cs (Try.Resolve): Warn when try has both general
3219 * typemanager.cs: runtime_compatibility_attr_type new predefined
3222 2005-10-26 Raja R Harinath <harinath@gmail.com>
3225 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3226 treat it as an empty parameter list.
3228 2005-10-26 Raja R Harinath <rharinath@novell.com>
3231 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
3232 ResolveAsTypeStep silent.
3233 * statement.cs (Block.AddConstant): Mark block as used.
3234 (Block.ResolveMeta): Avoid piling on error messages
3235 if a constant initializer resolution fails.
3237 2005-10-25 Raja R Harinath <rharinath@novell.com>
3239 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3241 (NamespaceEntry.VerifyAllUsing): New.
3242 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
3243 behaviour. Delegates actual resolution of alias to ...
3244 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
3245 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3247 * driver.cs (Driver.MainDriver): Update.
3249 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3250 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3252 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3254 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3255 RootNamespace.DefineNamespacesForAll.
3257 2005-10-24 Raja R Harinath <harinath@gmail.com>
3259 * typemanager.cs (assemblies, external_aliases, modules)
3260 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3261 (ComputeNamespaces, GetRootNamespace): Remove extra staging
3262 overhead. Move resposibility ...
3263 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
3264 * driver.cs, attribute.cs, codegen.cs: Update to changes.
3266 2005-10-23 Raja R Harinath <harinath@gmail.com>
3268 * namespace.cs (RootNamespace.all_namespaces): Renamed from
3269 cached_namespaces. Improve usage.
3270 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3271 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3272 Move from GlobalRootNamespace and simplify.
3273 (RootNamespace.Global): Make instance variable.
3274 (RootNamespace.RootNamespace): Add "alias name" parameter.
3275 (GlobalRootNamespace): Simplify drastically.
3276 (Namespace.Lookup): Don't use GetNamespace.
3277 * typemanager.cs (GetRootNamespace): Rename from
3278 ComputeNamespaceForAlias.
3279 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3281 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3283 * anonymous.cs (AnonymousContainer): Don't crash when container
3286 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3288 * expression.cs (Binary.DoResolve): Warn when comparing same
3291 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3294 * expression.cs (Binary.DoResolve): It looks like there are no
3295 convetsion rules in enum context.
3297 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3299 Add support for extern alias qualifiers.
3300 * typemanager.cs: Move some LookupTypeReflection code
3301 to namespace.cs, to have cleaner code. Added some methods
3302 to help us keep track of the extern aliased references.
3303 * driver.cs: Add suport for extern alias assemblies on command
3304 line and check for their warnings/errors. Also keep track of the
3305 extern aliased assemblies.
3306 * namespace.cs: Move the global functionality of Namespace
3307 to GlobalRootNamespace/RootNamespace. Now the global namespace
3308 is GlobalRootNamespace.Globa. Also the code moved from
3309 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
3310 Finally added LocalAliasEntry (AliasEntry before) and
3311 ExternAliasEntry, to handle alias statements.
3312 * cs-parser.jay: Add support in the grammar for extern alias
3314 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
3315 Update callings to Namespace (now in GlobalRootNamespace).
3317 2005-10-18 Raja R Harinath <rharinath@novell.com>
3320 * class.cs (TypeContainer.DefineType): Move updating of
3321 topological sort earlier in the code.
3322 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3324 2005-10-18 Marek Safar <marek.safar@seznam.cz>
3327 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3329 * constant.cs (Constant.TryReduce): Moved from Cast class.
3330 (Reduce): Made little bit more OO and fixed missing conversions.
3332 * ecore.cs (Reduce): Implemented.
3333 (Binary.EnumLiftUp): New method to upgrade values to enum values.
3335 * literal.cs (Reduce): Implemented.
3337 * class.cs: Reverted Miguel's wrong commit.
3339 2005-10-14 Miguel de Icaza <miguel@novell.com>
3341 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3343 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
3345 * cs-parser.jay, expression.cs : CS0214 was missing error location
3346 for constants. Fixed bug #76404.
3348 2005-10-11 Marek Safar <marek.safar@seznam.cz>
3351 * convert.cs (ExplicitConversionCore): Fixed object->enum
3354 2005-10-10 Raja R Harinath <rharinath@novell.com>
3356 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3358 (PropertyExpr.EmitCall): Likewise.
3359 * expression.cs (Invocation.EmitArguments): Handle case where
3361 (Invocation.EmitCall): Avoid allocating temporary variable if
3362 there are no arguments.
3364 2005-10-07 Raja R Harinath <rharinath@novell.com>
3367 * convert.cs (ImplicitConversionStandard): Move conversion of
3368 void* to arbitrary pointer types ...
3369 (ExplicitConversionStandard): .. here.
3370 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3371 error to always print typenames.
3373 2005-10-07 Raja R Harinath <rharinath@novell.com>
3375 * convert.cs (GetConversionOperator): Rename from
3376 GetConversionOperators. Move operator selection code from ...
3377 (UserDefinedConversion): ... here.
3379 2005-10-06 Marek Safar <marek.safar@seznam.cz>
3381 * convert.cs (ExplicitConversionCore): Removed duplicate enum
3384 2005-10-05 Marek Safar <marek.safar@seznam.cz>
3386 * assign.cs (Assign.DoResolve): Error method changed.
3388 * cfold.cs (DoConstantNumericPromotions): Error method changed.
3390 * const.cs (ResolveValue): Reset in_transit immediately.
3392 * constant.cs: Error method changed.
3394 * convert.cs: Removed useless location parameter.
3395 (ExplicitNumericConversion): Don't do double enum check.
3396 (ExplicitConversionCore): Renamed from ExplicitConversion.
3397 (ExplicitUnsafe): Extracted from ExplicitConversion.
3398 (ExplicitConversion): Uses for error reporting.
3400 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3402 (ResolveBoolean): Uses common error method.
3403 (CastToDecimal): Get rid of ec.
3404 (CastFromDecimal): Optimized.
3405 (ConvCast): Get rid of ec.
3407 * enum.cs (ResolveValue): Reset in_transit immediately.
3408 (Emit): Return after first error.
3410 * expression.cs: Convert changes.
3412 * literal.cs: Error method changed.
3414 * statement.cs: Error method changed.
3416 2005-10-03 Raja R Harinath <rharinath@novell.com>
3418 * support.cs (SeekableStreamReader.Position): Don't error out when
3419 the requested position is just beyond the end of the current
3422 2005-09-28 Raja R Harinath <rharinath@novell.com>
3424 * support.cs (SeekableStreamReader): Simplify drastically. Don't
3425 try to keep in sync with the byte count of the underlying Stream.
3426 However, this limits us to a window size of 2048 characters: i.e.,
3427 the maximum lookahead of our lexer/parser can be 2048 characters.
3429 2005-09-28 Marek Safar <marek.safar@seznam.cz>
3432 * driver.cs: Fix compilation files with full root path.
3434 2005-09-25 Miguel de Icaza <miguel@novell.com>
3436 * report.cs (SymbolRelatedToPreviousError): Format the output so
3437 it does not use an open parenthesis that is never closed.
3439 * driver.cs: Follow coding guidelines
3441 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3444 * const.cs (Const.ResolveValue): Check for assigning non-null
3445 value to reference type.
3447 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3449 * anonymous.cs: Implemented ExprClassName.
3451 * assign.cs (Assign.DoResolve): Don't chrash when type is not
3454 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3457 * class.cs (StaticClass.DefineContainerMembers): Report protected
3460 * codegen.cs: if(ed) PRODUCTION.
3462 * convert.cs (Error_CannotImplicitConversion): Better error
3465 * cs-parser.jay: More error checks.
3467 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3469 * driver.cs (CSCParseOption): Enabled wrong option check.
3471 * ecore.cs (Expression.ExprClassName): Turned to property.
3472 (MemberExpr.CheckIntermediateModification): For checking boxed
3473 value types modification.
3475 * statement.cs (Fixed.Resolve): Expression type must be
3476 convertible to fixed type.
3477 (CollectionForeach.GetEnumeratorFilter,TryType):
3478 Small refactoring for easier error checking.
3480 2005-09-26 Marek Safar <marek.safar@seznam.cz>
3482 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3485 * class.cs (GeneratedBaseInitializer): New class for customization
3486 compiler generated initializers.
3487 (MemberBase.DoDefine): Check Obsolete attribute here.
3488 (FieldMember.DoDefine): Ditto.
3490 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3493 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3494 (MemberCore.GetObsoleteAttribute): Removed argument.
3495 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3496 (MemberCore.CheckObsoleteType): New helper.
3500 * statement.cs: Updates after MemberCore changes.
3502 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3503 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3505 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3506 obsolete attribute for compiler construct.
3507 (As.DoResolve): Cache result.
3509 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3511 2005-09-26 Raja R Harinath <rharinath@novell.com>
3514 * expression.cs (This.VerifyFixed): In a value type T, the type of
3515 'this' is T&, iow, 'this' is either an out or ref parameter. In a
3516 value type R, 'this' is treated as a value parameter.
3518 2005-09-22 Miguel de Icaza <miguel@novell.com>
3520 * statement.cs (Lock): Use the TemporaryVariable class instead of
3521 manually using local variables as those do not work when variables
3524 * ecore.cs: Moved the TemporaryVariable class from being a nested
3525 class inside Foreach to be a public class that can be employed in
3528 2005-09-19 Marek Safar <marek.safar@seznam.cz>
3530 * cs-parser.jay: interface_accessors replaced by
3531 accessor_declarations.
3533 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3536 * statement.cs (GotoCase.Resolve): Convert null constant to
3538 (SwitchLabel.ResolveAndReduce): Ditto.
3539 (SwitchLabel.NullStringCase): Custom null stamp.
3540 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3542 typemanager.cs (CSharpSignature): Don't skip first argument
3545 2005-09-18 Miguel de Icaza <miguel@novell.com>
3547 * driver.cs: Set InEmacs based on the environment variable EMACS.
3549 * location.cs (InEmacs): in this mode, do not report column
3550 location as it confuses Emacs.
3552 2005-09-16 Marek Safar <marek.safar@seznam.cz>
3554 * cfold.cs, constant.cs, convert.cs, ecore.cs,
3555 expression.cs, iterators.cs, literal.cs: Store constants and
3558 * class.cs (MemberBase.ShortName): Pass location.
3560 * cs-parser.jay: Some location fixes.
3562 * ecore.cs (Expression.Location): Made virtual.
3564 2005-09-05 Miguel de Icaza <miguel@novell.com>
3566 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3567 if the underlying types are the same, otherwise we need to produce
3568 code that will do the proper cast.
3570 This was exposed by Marek's constant rewrite which produced
3571 invalid code for the call site:
3574 void Method (X v) {}
3578 This fixes test-49.cs
3580 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3582 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3583 Type/Object should be allowed as well. Fixed bug #75968.
3585 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3587 * expression.cs : (Binary.DoResolve): when one is enum constant and
3588 another is constant 0, then return enum one *as enum type*.
3591 2005-09-02 Raja R Harinath <rharinath@novell.com>
3593 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3597 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3598 flow-branching for LocalVariableReferences in case we were invoked
3599 from a MemberAccess.
3600 * expression.cs (LocalVariableReference.VerifyAssigned): New.
3602 (LocalVariableReference.DoResolveBase): ... this.
3603 (MemberAccess.Resolve): Do the check that was disabled during
3606 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3609 (PartialContainer.Create): check abstract/sealed/static strictly
3610 but abstract/sealed can exist only at one side. Fixed bug #75883.
3612 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
3615 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3616 specified, don't default to UnmanagedType.I4.
3618 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3620 * expression.cs : conditional operator should check possibly
3621 incorrect assign expression. Fixed bug #75946.
3623 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
3625 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
3626 Reverting the change. gmcs is much complex than mcs on this matter.
3628 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
3630 * cs-tokenizer.cs : To read another token ahead of the actual
3631 consumption, use new SavedToken and cache token instead of moving
3632 back the stream with SeekableStreamReader (it seemed problematic).
3634 driver.cs : Thus use StreamReader directly.
3635 * support.cs : Thus removed SeekableStreamReader.
3637 2005-08-30 Raja R Harinath <rharinath@novell.com>
3640 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3641 (ScopeInfo.EmitScopeType): Use it to construct field names from
3642 names of captured locals.
3645 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3646 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3647 Pass 'target_type' to BoxedCast. Don't default to 'object'.
3648 (ExplicitConversion): Remove enum cases already handled by
3649 implicit conversion. Move implicit conversion check to the beginning.
3650 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3651 * expression.cs (ArrayCreation.EmitDynamicInitializers):
3652 Don't treat System.Enum as a struct.
3654 2005-08-30 Jb Evain <jbevain@gmail.com>
3656 * attribute.cs: handles as expression in parameters.
3658 2005-08-30 Raja R Harinath <rharinath@novell.com>
3661 * class.cs (TypeContainer.VerifyClsName): Don't use a
3662 PartialContainer when verifying CLS compliance.
3663 (AbstractPropertyEventMethod): Set Parent here, ...
3664 (PropertyMethod): ... not here.
3666 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
3668 * attribute.cs : escaped attribute name should not be allowed to be
3669 resolved (e.g. @class as classAttribute). Fixed bug #75930.
3671 2005-08-29 Raja R Harinath <rharinath@novell.com>
3674 * convert.cs (ImplicitStandardConversionExists): Allow zero also
3675 when converting a long constant to unsigned long.
3676 * expression.cs (Invocation.OverloadResolve): Add sanity check to
3677 detect where IsApplicable and VerifyArgumentsCompat disagree.
3679 2005-08-29 Raja R Harinath <rharinath@novell.com>
3680 and Carlos Alberto Cortez <carlos@unixmexico.org>
3683 * class.cs (TypeContainer.CanElideInitializer): New helper.
3684 (TypeContainer.EmitFieldInitializers): Use it to determine if we
3685 can safely emitting the initializer of a field.
3687 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3689 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3690 allowed inside a switch (without loop). Fixed bug #75433.
3692 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3694 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3695 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3697 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3699 * driver.cs : kinda reverting the default encoding changes (not exact
3700 revert since I noticed that "codepage:reset" might not work fine).
3702 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3704 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3705 Location. Now getter and setter store location correctly.
3706 (errors/cs0111-12.cs now reports the expected location.)
3708 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3710 * driver.cs : Use default encoding on the environment.
3711 Removed (now that) extra parameter for SeekableStreamReader.
3712 * support.cs : (SeekableStreamReader) third .ctor() argument for
3713 StreamReader is not required (always true). preamble size could
3714 be acquired in simpler and safe way.
3716 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
3718 * cs-parser.jay: report CS0642 at warning level 3
3719 and report CS0642 for an if else statement also
3720 fixes bug #74745. Patch by John Luke (and a bit
3722 Removed extra CS0642 warning check for "while",
3724 * statement.cs: In Block.Resolve(), CS0642 check
3725 is reimplemented to check a sequence of an empty
3726 statement and a block.
3728 Both fix bug #66777.
3730 2005-08-24 Marek Safar <marek.safar@seznam.cz>
3732 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3733 detection until I fix it.
3735 * cs-tokenizer.cs: Changed error message.
3737 * cs-parser.jay: Fixed 2 error locations.
3739 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3740 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3743 * enum.cs (GetSignatureForError): Fixed.
3745 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3749 * typemanager.cs (RegisterProperty): Removed.
3751 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3753 2005-08-24 Raja R Harinath <rharinath@novell.com>
3756 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3757 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3759 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3761 * expression.cs : tiny fix is required for not warning positive ulong.
3764 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3766 * expression.cs : add CS0652 check for constant and integral
3767 expression. Fixed bug #53974.
3769 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3771 * expression.cs : in DoNumericPromotions(), check if there is implicit
3772 conversion overload for string (to check CS0034). Fixed bug #52492.
3774 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3776 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3778 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3780 * ecore.cs : report location when it is *not* Null.
3782 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3788 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3789 correctly. Fixed bug #75721.
3791 2005-08-23 Raja R Harinath <rharinath@novell.com>
3793 * support.cs (SeekableStreamReader.Position): Avoid an expensive
3794 loop that performs 'min (pos, char_count)'.
3797 * expression.cs (Unary.ResolveOperator): Don't discard implicit
3798 converted value in Operator.OnesComplement.
3800 2005-08-22 Ben Maurer <bmaurer@ximian.com>
3802 * anonymous.cs: If the anon method is pulled into a helper class,
3803 it needs to be `internal' not `private'. Fixes runtime behavior on
3806 2005-08-20 Martin Baulig <martin@ximian.com>
3808 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3809 scope if we don't already have it.
3811 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3812 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3815 2005-08-17 Marek Safar <marek.safar@seznam.cz>
3818 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3821 2005-08-16 Marek Safar <marek.safar@seznam.cz>
3823 The big constants rewrite
3824 Fix #75746, #75685 and more
3825 As a side effect saved 1MB for MWF ;-)
3827 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3828 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3829 enum based for corlib compilation.
3831 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3834 * class.cs (FixedField.Define): Use ResolveAsConstant.
3836 * const.cs (IConstant): Interface constants and enums.
3837 (Const.ResolveValue): New method for constant resolvning.
3838 (ExternalConstant): Constants from imported assemblies.
3840 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3841 conversion; like enums.
3842 (Constant.ToType): Converts this constant to different type.
3843 (Constant.Increment): Adds 1.
3845 * convert.cs (ImplicitConversionRequired): Simplified.
3847 * cs-parser.jay: Create EnumMember directly.
3849 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3851 * doc.cs (GenerateEnumDocComment): Removed.
3853 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3854 (ConvertIntLiteral): Removed.
3855 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3857 * enum.cs (EnumMember): Implement IConstant.
3858 (Enum.IsValidEnumConstant): Removed.
3859 (Enum.GetNextDefaultValue): Removed.
3860 (Enum.FindMembers): Updated.
3861 (Enum.GenerateDocComment): Iterate enum members.
3863 * expression.cs (Cast.TryReduce): Handle enums correctly.
3864 (New.Constantify): Made public.
3865 (MemberAccess.DoResolve): Removed contant specific if(s).
3867 * literal.cs (NullLiteral): Implement new abstract methods.
3869 * statement.cs (GotoCase.Resolve): Use new constant methods.
3870 (SwitchLabel.ResolveAndReduce): Use new constant methods.
3872 * typemanager.cs (LookupEnum): Removed.
3873 (IsEnumType): Fixed to work with corlib.
3874 (RegisterConstant): Removed.
3875 (LookupConstant): Removed.
3876 (GetConstant): Changed to work with IConstant.
3878 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
3880 * location.cs : Fixed overflown (>255) column number.
3882 2005-08-03 Raja R Harinath <rharinath@novell.com>
3884 First cut of the qualified-alias-member feature.
3885 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3887 * cs-parser.jay (DOUBLE_COLON): New token.
3888 (namespace_or_type_name): Add rule for recognizing
3889 qualified-alias-members.
3890 (primary_expression): Likewise.
3891 (element_access): Allow QualifiedAliasMember as a possible
3892 type-bearing expression.
3893 (local_variable_type, local_variable_pointer_type): Likewise.
3894 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
3895 aliases in the current and enclosing namespace declarations.
3896 (NamespaceEntry.UsingAlias): Add CS0440 warning.
3897 * decl.cs (MemberName.is_double_colon): New.
3898 (MemberName.MemberName): Add new constructor for alias-member.
3899 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3900 * expression.cs (QualifiedAliasMember): New expression type.
3902 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3904 * location.cs : it borked when no argument was specified.
3906 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3908 * location.cs : tiny ToString() format fix.
3910 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3912 * statement.cs : oops, it was missing.
3914 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3916 A set of fixes for precise line/column location.
3919 "token" field now holds a file/line "delta", a line number offset
3920 from the segment, and a column number. See also:
3921 http://lists.ximian.com/pipermail/mono-devel-list/2004-
3922 December/009508.html
3923 Removed static IsNull. Use instance IsNull property instead.
3925 For some tokens it stores Location. For Identifier it stores
3926 LocatedToken which is a pair of string name and location.
3927 Column numbers are adjusted only at getChar().
3929 Use Location.ToString() for reporting (it now contains column).
3931 Largely modified to use LocatedToken instead of
3932 string (IDENTIFIER), and to acquire Location from some tokens.
3933 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3934 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3936 Now MemberName holds Location. DeclSpace.ctor() receives Location
3937 as a parameter. Removed extra parameters to all derived classes.
3938 Replaced Location.IsNull() with instance property.
3939 * assign.cs, expression.cs :
3940 Added .ctor() overload that omits Location.
3942 Added "nameEscaped" flag that indicates the identifier was escaped
3943 in the source file. This fixes bug #57047.
3945 2005-08-02 Marek Safar <marek.safar@seznam.cz>
3947 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3948 New method, looking for lo-case imported cls type.
3950 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3953 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3955 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3957 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3959 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3961 Optimized to save 3.5 MB for SWF compilation.
3963 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3965 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3966 (PartialContainer.Create): Moved logic AddToContainer.
3967 (PartialContainer.MarkForDuplicationCheck): Shares name.
3969 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3972 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3974 (Namespace.GetSignatureForError): New method.
3976 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3977 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3979 2005-08-01 Raja R Harinath <rharinath@novell.com>
3982 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3983 member lookup rather than qualifier_type, since qualifier_type can
3986 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3988 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3991 2005-07-31 Miguel de Icaza <miguel@novell.com>
3993 * statement.cs: Copy the local exception into the exception
3994 captured local. Fixes 75674
3996 2005-07-31 Raja R Harinath <harinath@gmail.com>
3999 * expression.cs (Invocation.OverloadResolve): Don't report error
4000 CS1501 if error CS1502 has been reported.
4001 (New.DoResolve): Delegate CS1501 reporting to
4002 Invocation.OverloadResolve.
4005 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4006 invariant-meaning-in-block property in an enclosing block if
4009 2005-07-29 Marek Safar <marek.safar@seznam.cz>
4011 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4012 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4013 (Switch.CheckSwitch): Just save 50kb for SWF.
4015 2005-07-27 Martin Baulig <martin@ximian.com>
4017 * anonymous.cs (CaptureContext.AddField): Added
4018 `AnonymousContainer am' argument; compute its toplevel scope if
4019 it's not already computed. Fixes #75649.
4021 2005-07-26 Raja R Harinath <rharinath@novell.com>
4024 * class.cs (Constructor.Emit): Reset block to null if the block
4027 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4029 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4031 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4033 * class.cs (MethodData.Define): Check whether accessor implementing
4034 interface is public.
4036 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4038 2005-07-22 Marek Safar <marek.safar@seznam.cz>
4041 * namespace.cs (LookupType): Moved same type check to...
4043 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4046 2005-07-21 Raja R Harinath <rharinath@novell.com>
4048 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4049 already found a typebuilder.
4050 * class.cs (MethodCore.IsDuplicateImplementation): Compare
4051 MemberNames, not strings.
4053 * const.cs (Error_ExpressionMustBeConst):
4054 Rename from Error_EpressionMustBeConst.
4055 * const.cs, class.cs, statement.cd: Update.
4057 2005-07-21 Marek Safar <marek.safar@seznam.cz>
4061 * const.cs (Const.LookupConstantValue): Report missing contant expression
4063 (Error_EpressionMustBeConstant): Only one error method.
4065 * class.cs, statement.c: Updated.
4067 2005-07-20 Raja R Harinath <rharinath@novell.com>
4069 * statement.cs (Block.Flags): Add back HasVarargs.
4070 (Block.flags): Make protected.
4071 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4073 * typemanager.cs (types, typecontainers, user_types): Remove.
4074 (UserTypes, TypeContainers): Likewise.
4075 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4076 (CleanUp, Reset): Update.
4077 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
4078 (GetNestedType): Use Type.GetNestedType.
4079 (CoreLookupType): Take two arguments, the namespace and the
4080 basename of the type. Update to use the Namespace.Lookup
4082 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4083 (RealMemberLookup): Use IsNestedChildOf instead of playing with
4084 string concatenation and substring matches.
4085 * class.cs, enum.cs, delegate.cs: Update to changes.
4087 2005-07-20 Marek Safar <marek.safar@seznam.cz>
4089 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4090 Expression and made virtual.
4092 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4093 (ImplicitStandardConversionExists): Fixed `byte' typo ?
4095 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4097 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4100 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4103 2005-07-18 Marek Safar <marek.safar@seznam.cz>
4106 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4107 AssemblyCultureAttribute is not used on executable.
4110 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4112 2005-07-16 Raja R Harinath <rharinath@novell.com>
4115 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4116 New. Reports CS0252/CS0253.
4117 Mostly taken from preliminary patch by Duncak Mak.
4118 (Binary.DoResolveOperator): Store results of operator lookup.
4119 Use them to detect if we need to warn about unintended reference
4122 2005-07-15 Raja R Harinath <rharinath@novell.com>
4125 * namespace.cs (Namespace.Lookup): Add back location parameter.
4126 (Namespace.LookupType): Add CS0436 report. Add location parameter.
4127 * delegate.cs, ecore.cs, expression.cs: Update to changes.
4129 * codegen.cs (EmitContext.DeclSpace): Make readonly.
4130 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4131 (Namespace.LookupType): ... this.
4132 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4134 * typemanager.cs (LookupTypeReflection): Remove buggy code that
4135 purported to handle pointers.
4136 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4139 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4141 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4144 2005-07-15 Raja R Harinath <rharinath@novell.com>
4146 * namespace.cs (Namespace.Lookup): Drop location parameter.
4147 (NamespaceEntry.LookupAlias): Remove. Merge into ...
4148 (NamespaceEntry.Lookup): ... this.
4149 (NamespaceEntry.Error_AmbiguousTypeReference):
4150 Move here from DeclSpace.
4151 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4153 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4154 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4155 Move to NamespaceEntry.
4156 * delegate.cs, expression.cs: Update to changes.
4158 2005-07-14 Marek Safar <marek.safar@seznam.cz>
4160 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4161 CheckAttributeType and refactored.
4162 (Attribute.ResolvePossibleAttributeType): Changed to reuse
4163 ResolveAsTypeTerminal error handling.
4164 (ResolveAsTypeTerminal): Introduced because of global attributes extra
4166 (GetSignatureForError): Print errors in same way.
4169 * codegen.cs: Reflect attribute GetSignatureForError change.
4172 * expression.cs: Add silent parameter to ResolveAsTypeStep.
4174 * namespace.cs (UsingEntry): Refactored to make fields private.
4177 statement.cs: Error_UnexpectedKind has extra parameter.
4179 2005-07-14 Raja R Harinath <rharinath@novell.com>
4181 * ecore.cs (IAlias): Remove.
4182 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
4183 that implement the interface.
4184 * namespace.cs (Namespace): Likewise.
4185 (Namespace.declspaces): Renamed from 'defined_names'.
4186 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
4187 DeclSpace instead of an IAlias.
4188 * tree.cs (Tree.AddDecl): Update.
4190 2005-07-12 Raja R Harinath <rharinath@novell.com>
4192 * statement.cs (Block.Flags); Remove HasVarargs.
4193 (Block.HasVarargs): Move to ToplevelBlock.
4194 (Block.ThisVariable, Block.AddThisVariable): Likewise.
4195 (Block.Variables): Make protected. Initialize variable hashtable
4197 (Block.AddVariable): Update.
4198 (Block.Resolve): Update to changes.
4199 (ToplevelBlock.HasVarargs): New boolean.
4200 (ToplevelBlock.ThisVariable): Move here from Block.
4201 (ToplevelBlock.AddThisVariable): Likewise.
4202 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
4203 * expression.cs (This.ResolveBase): Update to changes.
4204 (ArglistAccess.DoResolve): Likewise.
4206 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4209 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4211 * class.cs (TypeContainer.VerifyMembers): Distinguish between
4212 not used and not used & assigned.
4213 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4215 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4218 * expression.cs (Is.DoResolve): null is never provided type.
4220 2005-07-08 Marek Safar <marek.safar@seznam.cz>
4223 * cs-parser.jay: Less strict event error rule to catch more errors.
4225 2005-07-08 Martin Baulig <martin@ximian.com>
4227 Fix test-iter-10.cs - distinguish whether we `yield' in a property
4228 gettter (allowed) or setter (not allowed).
4230 * class.cs (Accessor): Implement IIteratorContainer.
4231 (Accessor.Yields): New public field.
4232 (PropertyBase.PropertyMethod.Define): Handle iterators on a
4236 (get_accessor_declaration, set_accessor_declaration): Set the
4237 `yields' flag on the accessor, not the property.
4238 (property_declaration): Do the iterators check on a per-accessor
4239 basis and not for the whole property.
4241 2005-07-08 Martin Baulig <martin@ximian.com>
4243 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4244 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4246 2005-07-07 Marek Safar <marek.safar@seznam.cz>
4249 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4250 (ExtractSecurityPermissionSet): Cope with self referencing security
4251 attributes properly.
4253 * driver.cs (SetOutputFile): Made public property OutputFile.
4255 2005-07-07 Raja R Harinath <rharinath@novell.com>
4258 * class.cs (TypeContainer.first_nonstatic_field): Rename from
4259 has_nonstatic_fields. Make into a FieldBase pointer.
4260 (TypeContainer.AddField): Add CS0282 check.
4261 (TypeContainer.EmitType): Update.
4263 2005-07-06 Miguel de Icaza <miguel@novell.com>
4265 * cs-tokenizer.cs (consume_identifier): Do not create strings to
4266 compare if they start with __.
4268 2005-07-06 Raja R Harinath <rharinath@novell.com>
4270 * statement.cs (Switch.SwitchGoverningType): Only look at
4271 UserCasts that don't need implicit standard conversions to one of
4272 the allowed switch types (Fixes test-322.cs).
4273 (LocalInfo.Resolve): Re-enable sanity-test.
4275 2005-07-06 Marek Safar <marek.safar@seznam.cz>
4277 * cs-tokenizer.cs (consume_identifier): Detect double undescores
4279 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4281 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4283 2005-07-06 Raja R Harinath <rharinath@novell.com>
4286 * ecore.cs (SimpleName.GetSignatureForError): Add.
4287 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4288 (MemberAccess.GetSignatureForError): Add.
4290 2005-07-05 Marek Safar <marek.safar@seznam.cz>
4292 The big error and warning messages review.
4322 * typemanager.cs: Updated.
4324 * class.cs: (MethodCore.SetYields): Moved here to share.
4325 (PropertyMethod.Define): Moved iterator setup here.
4327 * iterators.cs: Add orig_method to have full access to parent
4330 2005-07-05 Raja R Harinath <rharinath@novell.com>
4332 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4333 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4334 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4335 variable of struct type.
4336 * expression.cs (Unary.ResolveOperator): Update to change.
4337 (Indirection.VerifyFixed): Likewise.
4338 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4339 (ParameterReference.VerifyFixed): Value parameters are fixed.
4340 (This.VerifyFixed): Treat 'this' as a value parameter.
4341 * statement.cs (LocalInfo.IsFixed): Remove.
4343 2005-07-01 Martin Baulig <martin@ximian.com>
4345 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4346 `ec.EmitThis ()' to get the correct scope.
4348 2005-07-01 Martin Baulig <martin@ximian.com>
4350 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4351 instance is a ParameterReference; fixes #75299.
4353 2005-07-01 Martin Baulig <martin@ximian.com>
4355 Reverted Marek's latest patch (r46725):
4356 - it contains structural changes which are neither mentioned in
4357 the ChangeLog nor explained anywhere; for example the additional
4358 argument of EmitContext's and Iterator's .ctor's and the
4359 TypeContainer.DefineMembers() change.
4360 - structural changes like this should go in in seperate patches
4361 and not be hidden in a huge patch which just seems to affect
4362 warnings and errors.
4363 a big and hard to understand patch.
4364 - it breaks iterators and causes regressions, for instance in
4367 2005-06-30 Raja R Harinath <rharinath@novell.com>
4370 * expression.cs (Indexers.map): Remove.
4371 (Indexers.Append): Filter out inaccessible setters and getters.
4372 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4375 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
4377 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4378 (FieldExpr.Emit, PropertyExpr.Emit): Update.
4379 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4380 * expression.cs (Invocation.EmitCall): Add CS0120 check.
4382 2005-06-30 Marek Safar <marek.safar@seznam.cz>
4385 * class.cs (FieldBase.GetInitializerExpression): One more field
4388 2005-06-28 Miguel de Icaza <miguel@novell.com>
4390 * pending.cs: Do not define a proxy if the base method is virtual,
4391 it will be picked up by the runtime (bug 75270).
4393 2005-06-08 Martin Baulig <martin@ximian.com>
4395 The big Iterators rewrite :-)
4397 * iterators.cs: Rewrite this to use the anonymous methods framework.
4399 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4400 before the TypeContainers; see 2test-21.cs.
4403 (TypeContainer.DefineType): Don't create a new EmitContext if we
4404 already have one (this only happens if we're an Iterator).
4405 (TypeContainer.Define): Also call Define() on all our iterators.
4406 (Method.CreateEmitContext): Added support for iterators.
4409 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4410 (AnonymousContainer.CreateMethodHost): Moved here from
4411 AnonymousMethod and made abstract.
4412 (AnonymousContainer.CreateScopeType): New abstract method.
4413 (AnonymousContainer.IsIterator): New public property.
4414 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4415 get the ScopeTypeBuilder rather than manually defining it here.
4416 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4419 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4420 before RootContext.DefineTypes().
4422 * codegen.cs (EmitContext.RemapToProxy): Removed.
4423 (EmitContext.CurrentAnonymousMethod): Changed type from
4424 AnonymousMethod -> AnonymousContainer.
4425 (EmitContext.ResolveTopBlock): Protect from being called twice.
4426 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4427 (EmitContext.EmitThis): Removed the iterators hacks; use the
4428 anonymous methods framework for that.
4431 (ToplevelBlock.Container): Make this a property, not a field.
4432 (ToplevelBlock.ReParent): New public method; move the
4433 ToplevelBlock into a new container.
4434 (Foreach.TemporaryVariable): Simplify.
4436 2005-06-05 Martin Baulig <martin@ximian.com>
4438 * statement.cs (LocalInfo.CompilerGenerated): New flag.
4439 (Block.AddTemporaryVariable): New public method; creates a new
4440 `LocalInfo' for a temporary variable.
4441 (Block.EmitMeta): Create the LocalBuilders for all the temporary
4443 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4444 non-iterator variables.
4446 2005-06-05 Martin Baulig <martin@ximian.com>
4448 * statement.cs (Foreach.TemporaryVariable): Create the
4449 LocalBuilder in the Emit phase and not in Resolve since in some
4450 situations, we don't have an ILGenerator during Resolve; see
4451 2test-19.cs for an example.
4453 2005-06-04 Martin Baulig <martin@ximian.com>
4455 **** Merged r45395 from GCS ****
4457 The big Foreach rewrite - Part II.
4459 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4460 with `PropertyInfo ienumerator_getcurrent'.
4462 * codegen.cs (VariableStorage): Removed.
4465 (Foreach): Derive from Statement, not ExceptionStatement.
4466 (Foreach.CollectionForeach): New nested class. Moved all the code
4467 dealing with collection foreach here.
4468 (Foreach.ForeachHelperMethods): Removed.
4469 (Foreach.TemporaryVariable): Implement IMemoryLocation.
4471 2005-05-23 Martin Baulig <martin@ximian.com>
4473 * statement.cs (Try.DoResolve): Don't create a `finally' if we
4474 don't need to. Fix #75014.
4476 2005-05-20 Martin Baulig <martin@ximian.com>
4478 Merged r44808 from GMCS.
4480 * class.cs (TypeContainer.CircularDepException): Removed.
4481 (TypeContainer.DefineType): Removed the `InTransit' stuff.
4482 (TypeContainer.CheckRecursiveDefinition): Check for circular class
4483 (CS0146) and interface (CS0529) dependencies here.
4485 2005-06-21 Raja R Harinath <rharinath@novell.com>
4487 * expression.cs (Invocation.EmitCall): Fix initialization
4488 'this_call' to reflect current behaviour. Fix indentation.
4490 * convert.cs (FindMostEncompassedType): Add two trivial special
4491 cases (number_of_types == 0 || number_of_types == 1).
4492 (FindMostEncompasingType): Likewise.
4494 2005-06-17 Raja R Harinath <rharinath@novell.com>
4496 Some cleanups preparing for the fix of #75283.
4497 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4499 (EventExpr.InstanceResolve): Likewise.
4500 (EventExpr.DoResolve): Remove redundant checks.
4502 2005-06-10 Duncan Mak <duncan@novell.com>
4504 * cs-tokenizer.cs (process_directives): New flag for controlling
4505 the processing of preprocessor directives.
4506 (x_token): After seeing a '#', return Token.NONE instead of going
4507 to handle_preprocessing_directive() when not processing
4508 directives. This avoids unnecessary processing during the token peek in
4513 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
4514 the existing error reporting methods instead of Report.Error.
4516 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
4517 after Raja's rewrite.
4519 2005-06-08 Miguel de Icaza <miguel@novell.com>
4521 * class.cs: Small fix.
4523 2005-06-08 Raja R Harinath <rharinath@novell.com>
4526 * class.cs (GetPartialBases): Fix return value check of
4529 2005-06-07 Raja R Harinath <rharinath@novell.com>
4531 Ensure that partial classes are registered in their enclosing
4532 namespace. Initial part of fix of #75160.
4533 * tree.cs (Tree.RecordDecl): Add new namespace argument.
4534 Register declspace with namespace here, not in
4535 DeclSpace.RecordDecl.
4536 * cs-parser.jay: Pass namespace to RecordDecl.
4537 * class.cs (PartialContainer.Create): Likewise.
4538 (ClassPart.DefineType): New sanity-check. Throws an exception if
4540 * decl.cs (Declspace.RecordDecl): Remove.
4541 * namespace.cs (NamespaceEntry.DefineName): Remove.
4543 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4545 * rootcontext.cs: Reset TargetExt as well.
4547 2005-06-03 Raja R Harinath <rharinath@novell.com>
4549 * ecore.cs (Expression.Resolve): Emit CS0654 error when
4552 2005-06-02 Raja R Harinath <rharinath@novell.com>
4554 Fix #75080, cs0119.cs.
4555 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
4557 (Expression.Resolve): ... this. Use it. Remove bogus code
4558 allowing ExprClass.Type and ExprClass.Namespace for
4559 ResolveFlags.VariableOrValue.
4560 (Expression.Resolve) [1-argument variant]: Change default resolve
4561 flags based on language version.
4562 (Expression.Error_UnexpectedKind): Use a simple string array
4563 rather than an ArrayList.
4564 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4566 (TypeOfVoid.DoResolve): Likewise.
4567 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
4568 flags argument -- it always has the same value.
4570 2005-05-31 Raja R Harinath <rharinath@novell.com>
4573 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4574 Use it in the error message.
4575 * assign.cs, expression.cs, statement.cs: Update.
4577 2005-05-30 Raja R Harinath <rharinath@novell.com>
4580 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4581 the "almostMatchedMember" case too.
4582 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4583 that failed the accessibility checks to 'almost_match'.
4585 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
4587 * attribute.cs: Use internal MethodBuilder methods to set
4588 ExactSpelling and SetLastError on PInvoke methods, instead
4589 of passing them via charset. Fixes #75060.
4591 2005-05-27 Raja R Harinath <rharinath@novell.com>
4593 * parameter.cs (Parameter): Remove TODO comment.
4594 (Parameter.DefineParameter): Remove Location parameter.
4595 (Parameters.LabelParameters): Likewise.
4596 * class.cs (Constructor.Emit): Update to change.
4597 (MethodData.Emit): Likewise.
4598 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
4599 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4601 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
4604 Removed Parameters.Location and added Parameter.Location instead.
4605 Removed Location parameter from Emit() and GetSignature().
4612 Modified all related calls.
4614 2005-05-26 Raja R Harinath <rharinath@novell.com>
4616 Improve user-defined conversion handling.
4617 * convert.cs (GetConversionOperators): Rewrite. Return only the
4618 applicable operators.
4619 (AddConversionOperators): New. Helper for GetConversionOperators.
4620 (FindMostEncompassedType, FindMostEncompassingType): Verify that
4621 there is only one most encompassed/encompassing type.
4622 (FindMostSpecificSource, FindMostSpecificTarget): Remove
4623 "applicable operator" handling.
4624 (UserConversion): Move cache here from GetConversionOperators.
4625 Directly cache the chosen operator, rather than the whole
4627 (ExplicitNumericConversion): Fix buggy implementation of Decimal
4628 case. Allow conversion of decimal to sbyte and byte too.
4629 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4630 New static methods. Used to avoid allocating EmptyExpressions in
4633 2005-05-24 Duncan Mak <duncan@novell.com>
4635 * ecore.cs (CastFromDecimal): New class for casting a decimal to
4636 another class, used in Convert.ExplicitNumericConversion.
4637 (CastToDecimal): New class, similar to above, but casts to
4638 System.Decimal, used in Convert.ImplicitNumericConversion and also
4639 in explicit convesion from double/float to decimal.
4641 * convert.cs (ImplicitNumericConversion): Handle implicit
4642 conversions to System.Decimal.
4643 (ExplicitNumericConversion): handle explicit conversions to
4648 2005-05-20 Miguel de Icaza <miguel@novell.com>
4650 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
4651 know the type at this stage, just break through. Fixes #75008
4653 2005-05-19 Martin Baulig <martin@ximian.com>
4656 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4657 to disable error reporting.
4659 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4660 here since we don't want to report an error; see the new test-336.cs.
4662 2005-05-19 Raja R Harinath <rharinath@novell.com>
4664 * statement.cs (ToplevelBlock.GetParameterReference)
4665 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4666 Move here from class Block.
4667 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4668 * expression.cs (ParameterReference.DoResolveBase): Likewise.
4670 2005-05-18 Martin Baulig <martin@ximian.com>
4675 (FlowBranching.Reachability): Add non-static public And() and Or()
4677 (FlowBranchingSwitch): New class; do the `break_origins' thing
4678 like in FlowBranchingLoop.
4679 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4680 reachability, not just locals and parameters.
4681 (FlowBranching.MergeChild): Remove some of the hacks for loop and
4682 switch; MergeBreakOrigins() now takes care of that.
4684 2005-05-18 Martin Baulig <martin@ximian.com>
4686 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4687 a loop and may leave it, reset the barrier; fixes #74974.
4689 2005-05-17 Marek Safar <marek.safar@seznam.cz>
4691 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4694 * cs-parser.jay: Catch more lexical errors.
4696 * report.cs: Add one more Error method.
4699 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4701 2005-05-17 Martin Baulig <martin@ximian.com>
4703 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4706 2005-05-16 Raja R Harinath <rharinath@novell.com>
4708 Fix test-382.cs. Emit values of decimal constants.
4709 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4711 (TypeContainer.AddField): ... this.
4712 (TypeContainer.EmitFieldInitializers): Allow the list of fields
4713 with initializers to include 'Const's.
4714 (ClassPart.RegisterFieldForInitialization): Forward to
4716 * const.cs (Const.Const): Pass initializer to base class.
4717 (Const.Define): In case of decimal constants, register them for
4718 initialization in a static constructor.
4720 2005-05-14 Martin Baulig <martin@ximian.com>
4722 * statement.cs (Block.Resolve): Correctly handle unreachable code;
4723 do not call ResolveUnreachable() on unreachable statements in
4724 here, see the comment in the source code.
4726 2005-05-13 Raja R Harinath <rharinath@novell.com>
4729 * expression.cs (BinaryResolveOperator): If one of the operands of
4730 an equality comparison is 'null' and the other is a pointer type,
4731 convert the null to a NullPointer.
4732 * convert.cs (ImplicitReferenceConversion): If the expression is a
4733 NullLiteral and the target type is a pointer type, return a
4734 NullPointer instead.
4735 (ImplicitConversionStandard): Likewise.
4737 2005-05-13 Marek Safar <marek.safar@seznam.cz>
4739 * cs-parser.jay: Set readonly context based on special constructs.
4741 * expression.cs (LocalVariableReference.DoResolveBase): Improved
4742 readonly variable error handling.
4744 * rootcontext.cs (EmitCode): Don't verify members when error
4747 * statement.cs (LocalInfo): Add reaodnly context information.
4748 (SetReadOnlyContext, GetReadOnlyContext): New methods.
4750 2005-05-13 Raja R Harinath <rharinath@novell.com>
4752 * statement.cs (Block.Resolve): Revert change below. Modify fix
4753 for #74041 to initialize 'resolved' to false only for explicit
4754 blocks. Fixes #74873.
4756 2005-05-12 Raja R Harinath <harinath@gmail.com>
4759 * typemanager.cs (unmanaged_enclosing_types): New.
4760 (IsUnmanagedType): Avoid infloops by using
4761 'unmanaged_enclosing_types' to talk with recursive invocations.
4763 2005-05-13 Martin Baulig <martin@ximian.com>
4765 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4766 instance variable, not a local. Fix #74873.
4767 (Block.ResolveUnreachable): Set it to true here.
4769 2005-05-11 Duncan Mak <duncan@novell.com>
4771 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4772 continuing to process for 'arg'.
4773 (handle_preprocessing_directive): Check the argument of the #endif
4774 directive and report error CS1025 if there are any trailing
4777 According to the C# spec, having even whitespace after the #endif
4778 directive is illegal; however, because we call arg.TrimEnd ()
4779 beforehand, we have the same behavior as csc, allowing whitespace
4780 after the directive.
4784 2005-05-11 Marek Safar <marek.safar@seznam.cz>
4788 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4789 (Constructor.GetObsoleteAttribute): Implemented correctly.
4791 2005-05-10 Martin Baulig <martin@ximian.com>
4793 * support.cs (ReflectionParameters.ParameterModifier): Use
4794 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4795 and `ParameterAttributes.In'. Fixes #74884.
4797 2005-05-10 Marek Safar <marek.safar@seznam.cz>
4799 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4801 * expression.cs (Argument.GetParameterModifier): Turned to property.
4802 (Invocation.Error_InvalidArguments): Add more descriptive errors.
4804 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4807 2005-05-09 Raja R Harinath <rharinath@novell.com>
4810 * decl.cs (MemberCache.AddMethods): Register override methods,
4811 rather than non-override methods.
4812 * typemanager.cs (RegisterOverride): New.
4813 (IsOverride): Update.
4815 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4819 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4820 recursive declaration.
4822 * statement.cs (Block.ResolveMeta): Report any error in resolving.
4824 2005-05-06 Marek Safar <marek.safar@seznam.cz>
4826 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4828 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4830 2005-05-05 Raja R Harinath <rharinath@novell.com>
4833 * decl.cs (DeclSpace.FamilyAccessible):
4834 Use TypeManager.IsNestedFamilyAccessible.
4836 Fix reopened #64812.
4837 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4840 2005-05-04 Raja R Harinath <rharinath@novell.com>
4841 Abin Thomas <projectmonokochi@rediffmail.com>
4842 Anoob V E <projectmonokochi@rediffmail.com>
4843 Harilal P R <projectmonokochi@rediffmail.com>
4846 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4847 allow access to all static members.
4849 2005-05-04 Martin Baulig <martin@ximian.com>
4851 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4853 2005-05-04 Martin Baulig <martin@ximian.com>
4857 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4858 section at the end; make things work if `default' is not the last
4861 2005-05-04 Martin Baulig <martin@ximian.com>
4865 * statement.cs (Switch): Replaced the `got_default' field with a
4866 `default_section' one.
4867 (Switch.CheckSwitch): Set `default_section' here.
4868 (Switch.Resolve): If we're a constant switch and the constant is
4869 not found, use the default section.
4871 2005-05-03 Martin Baulig <martin@ximian.com>
4873 * expression.cs (ArrayAccess.EmitGetLength): New public method.
4875 * statement.cs (Foreach.ArrayForeach): New nested class.
4876 (Foreach.TemporaryVariable): New nested class.
4877 (Foreach.EmitArrayForeach): Removed; this is now in the new
4880 2005-05-03 Raja R Harinath <rharinath@novell.com>
4882 * pending.cs (BaseImplements): Move the #74773 fix here. This is
4884 (VerifyPendingMethods): Revert change below.
4886 * typemanager.cs (IsOverride, RegisterNonOverride): New.
4887 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4888 that used to trigger warning -28. Remove warning -28.
4889 * expression.cs (Invocation.OverloadResolve): Use
4890 TypeManager.IsOverride to distinguish override methods.
4893 * pending.cs (VerifyPendingMethods): If a base type implements the
4894 requested interface, don't bother checking individual methods of
4895 the base type. As a side-effect, this prevents the creation of
4896 unnecessary proxies.
4898 2005-05-02 Martin Baulig <martin@ximian.com>
4902 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4903 Also `And' the locals if the old vector is null.
4904 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4905 null; in this case we basically reset all the variables.
4907 2005-05-02 Martin Baulig <martin@ximian.com>
4911 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4912 Added `FlowBranching branching' argument; always `and' the
4913 variables instead of `or'ing them unless we're an infinite loop.
4915 * statement.cs (While.Resolve): Create a new sibling unless we're
4918 2005-05-02 Martin Baulig <martin@ximian.com>
4922 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4923 arguments; use it instead of creating a new TopLevelBlock.
4924 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4925 our ConstructorInitializer.
4928 (TopLevelBlock.TopLevelBranching): New public property.
4929 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4930 and create our `TopLevelBranching'.
4932 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4933 anonymous method host, use `block.TopLevelBranching' rather than
4934 creating a new branching.
4936 2005-04-20 Miguel de Icaza <miguel@novell.com>
4938 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4939 a ScopeInfo, if any of the current children is a child of the new
4940 entry, move those children there.
4942 2005-04-30 Martin Baulig <martin@ximian.com>
4944 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4945 at the beginning of a SwitchSection. Fix #73335.
4947 2005-04-27 Marek Safar <marek.safar@seznam.cz>
4950 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4952 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4953 (FieldExpr.DoResolve): Obsolete members are ignored for field
4956 2005-04-26 Marek Safar <marek.safar@seznam.cz>
4958 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4959 of arrays detection.
4961 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4963 (Field.VerifyClsCompliance): Volatile fields are not compliant.
4965 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4968 2005-04-25 Ben Maurer <bmaurer@ximian.com>
4970 * cs-parser.jay: Use the prefered version of -unsafe in error
4973 2005-04-22 Marek Safar <marek.safar@seznam.cz>
4975 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4978 2005-04-20 John Luke <john.luke@gmail.com>
4980 * driver.cs: fix typo in error message, --outout to --output
4982 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4984 * codegen.cs (InRefOutArgumentResolving): New field.
4986 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4987 fields outside contructor.
4989 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4991 2005-04-19 Miguel de Icaza <miguel@novell.com>
4993 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4994 parameter code was not completed ever, so it was not as up-to-date
4995 as local variables. Must finish it.
4997 The bug fix was to compare the Toplevel of the block, not the
4998 current block. Thanks for Ben for pointing this out.
5000 2005-04-19 Raja R Harinath <rharinath@novell.com>
5002 * decl.cs (AddMethods): Use the declaring type of the problem
5003 method to determine if we want to squash a warning.
5005 2005-04-19 Marek Safar <marek.safar@seznam.cz>
5007 * attribute.cs: Removed debug output.
5009 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5011 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5014 2005-04-18 Raja R Harinath <rharinath@novell.com>
5017 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5018 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5019 all null comparisons against reference types.
5021 2005-04-18 Marek Safar <marek.safar@seznam.cz>
5024 * class.cs (TypeContainer.CircularDepException) New nested
5026 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5027 (TypeContainer.DefineType): Removed error, reset InTransit before
5029 (Class.DefineType): Throw exception when is in Transit.
5030 Catch exception and report error.
5031 (Struct.DefineType): Throw exception when is in Transit.
5032 Catch exception and report error.
5033 (Interface.DefineType): Throw exception when is in Transit.
5034 Catch exception and report error.
5036 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5037 handle nested exception handlers.
5039 * flowanalysis.cs (InTryWithCatch): New method, search for try with
5042 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5043 InFinally and InCatch storage.
5045 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5046 (Catch.Resolve): Set and Restore ec.InCatch.
5047 (Try.Resolve): Set and Restore ec.InFinally.
5048 (Try.HasCatch): True when try has catch.
5050 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
5052 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5053 for the same event member, so exclude such cases from warning 419.
5056 2005-04-16 Miguel de Icaza <miguel@novell.com>
5058 * expression.cs (Binary.ResolveOperator): Apply patch from John
5059 Luke to fix bug 59864: operators &, | and ^ on enumerations
5060 require that the same enum type on both sides.
5062 * driver.cs: Add warnings to old flag usage, this is to assist
5063 people who produce Makefiles and hope that the Makefiles will be
5066 * class.cs (TypeContainer.EmitType): Moved the definition of the
5067 special $PRIVATE$ field from the resolve phase to the Emit phase.
5068 During resolve we do not know if we are a struct with
5069 HasExplicitLayout, we know this only after the attributes for the
5072 Set the FieldOffset to zero on the dummy field that we create for
5073 the class. Fixes 74590.
5075 2005-04-16 Raja R Harinath <rharinath@novell.com>
5078 * ecore.cs (PropertyExpr.resolved): New.
5079 (DoResolve): Use it to handle a case of double resolution here.
5080 Handle a case of identical-name-and-type-name.
5081 * expression.cs (ArrayCreation.CheckIndices): Avoid double
5082 resolution by storing the results of expression resolution back
5083 into the "probes" array.
5085 2005-04-15 Raja R Harinath <rharinath@novell.com>
5087 Fix cs0208-7.cs and cs0208-8.cs.
5088 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5089 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
5090 error reporting to point out the reason a struct is not unmanaged.
5092 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5094 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
5095 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5097 2005-04-13 Raja R Harinath <rharinath@novell.com>
5100 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5101 IdenticalNameAndTypeName here.
5102 (EventExpr.InstanceResolve): Likewise.
5104 2005-04-13 Marek Safar <marek.safar@seznam.cz>
5106 C# 2.0 DefaultCharSetAttribute implementation
5108 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5109 which allows us to set GlobalNamespace for every resolve.
5110 (Attribute.ResolveArguments): Cut from Resolve.
5111 (Attribute.GetCharSetValue): Returns CharSet named argument.
5112 (Attribute.DefinePInvokeMethod): Gets default charset from
5114 (GlobalAttribute.ResolveAsTypeStep): Override.
5115 (GlobalAttribute.ResolveArguments): Override.
5117 * class.cs (TypeAttr): Is protected.
5119 * codegen.cs (ModuleClass.DefaultCharSet): New member.
5120 (ModuleClass.DefaultCharSetType): New memeber.
5121 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5123 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5124 charset from module.
5126 * delegate.cs (TypeAttr): Override.
5127 (Delegate.DefineType): Use this TypeAttr.
5129 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5130 at very early stage (before types are defined) to resolve model
5131 module attributes. It will probably not work with corlib but it
5134 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5135 charset from module.
5137 * typemanager.cs (default_charset_type): New type.
5139 2005-04-13 Raja R Harinath <rharinath@novell.com>
5141 * decl.cs (MemberCache.AddMethods): Don't warn if
5142 System.Object.Finalize has buggy MethodAttributes.
5144 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5147 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5149 * doc.cs : detect ambiguous reference to overloaded members.
5150 Fixed bug #71603. MS 1.1 csc does not detect it.
5152 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5154 * doc.cs : delegates must not be referenced with parameters.
5157 2005-04-12 Miguel de Icaza <miguel@novell.com>
5159 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5161 2005-04-10 Miguel de Icaza <miguel@novell.com>
5163 * driver.cs (MainDriver): Stop processing if the CLS stage found
5166 (CompilerCallableEntryPoint.InvokeCompiler): Always
5167 reset after execution; Take a TextWriter argument for the
5170 * report.cs: Use the error stream instead of hardcoding stderr.
5172 2005-04-09 Miguel de Icaza <miguel@novell.com>
5174 * class.cs: Reduce code paths to test, too small of an
5175 optimization to make it worth the extra testing. Always perform
5178 2005-04-08 Raja R Harinath <rharinath@novell.com>
5181 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5182 operators that had errors reported on them.
5184 2005-04-08 Marek Safar <marek.safar@seznam.cz>
5186 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5188 (Attribute.Resolve): Add named argument type checking.
5190 * class.cs (FixedField.Define): Use IsPrimitiveType
5192 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5194 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5195 unsafe parameter types.
5197 * statement.cs (Using.ResolveExpression): Add better error description.
5199 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5201 2005-04-08 Raja R Harinath <rharinath@novell.com>
5204 * attribute.cs (Attribute.GetAttributeUsage): Resolve
5205 AttributeUsageAttribute in the emitcontext of the attribute class,
5206 not in the emitcontext of the attributable entity it was attached to.
5207 * cs-parser.jay: Use 'current_class', not 'current_container',
5208 when creating a GlobalAttribute.
5210 2005-04-08 Alp Toker <alp@atoker.com>
5212 * pending.cs: The fix to #58413 failed to compile methods implementing
5213 interfaces with/without params modifiers and vice versa, even though
5214 params modifiers aren't part of the signature. Make the modifier check
5215 less strict as in csc.
5217 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
5218 Anoob V E <projectmonokochi@rediffmail.com>
5219 Harilal P R <projectmonokochi@rediffmail.com>
5222 * pending.cs (TypeAndMethods.mods): New. Store the parameter
5223 modifiers of pending methods.
5224 (PendingImplementation.PendingImplementation): Initialize it.
5225 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5226 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5227 with ParameterData. Add check for modifiers.
5228 * class.cs (MethodData.Define): Update to changes.
5230 2005-04-07 Raja R Harinath <rharinath@novell.com>
5232 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5234 2005-04-07 Marek Safar <marek.safar@seznam.cz>
5236 * class.cs (PropertyMethod.Define): Check private accessor in abstract
5239 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5242 * typemanager.cs: Registered RequiredAttributeAttribute.
5244 2005-04-06 Marek Safar <marek.safar@seznam.cz>
5246 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5247 Warning CS0169 is back at level 3.
5248 (IMethodData.SetMemberIsUsed): New method.
5250 * decl.cs (IsUsed): New value; moved from FieldBase.Status
5251 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5253 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5255 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5257 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5260 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5263 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5264 to avoid the problems with nested types.
5266 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
5267 Anoob V.E <projectmonokochi@rediffmail.com>
5268 Harilal P.R <projectmonokochi@rediffmail.com>
5269 Raja R Harinath <rharinath@novell.com>
5272 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5274 * typemanager (GetConstructor): Make public.
5276 2005-04-05 John Luke <john.luke@gmail.com>
5277 Raja R Harinath <rharinath@novell.com>
5280 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5281 struct too. Return false quicker in a few cases.
5282 (VerifyUnManaged): Use it.
5284 2005-04-05 Raja R Harinath <rharinath@novell.com>
5287 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5288 not 'unreachable_seen'.
5290 2005-04-04 Marek Safar <marek.safar@seznam.cz>
5292 * attribute.cs (Attribute.GetValue): Removed unused.
5294 * codegen.cs (CodeGen.TrimExt): Removed unused.
5296 * cs-parser.jay (output): Removed unused.
5298 * cs-tokenizer.cs (hex_digits): Removed unused.
5300 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5302 * expression.cs (Indirection.LoadExprValue): Removed unused.
5303 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5305 * iterators.cs (Iterator.param_types): Removed unused.
5307 * statement.cs (Goto.block): Removed unused.
5308 (ToplevelBlock.did): Removed unused.
5309 (Switch.ResolveConstantSwitch): Removed unused.
5311 2005-04-01 Ben Maurer <bmaurer@ximian.com>
5313 * rootcontext.cs: Allow mcs to bootstrap with the compilation
5316 2005-04-01 Raja R Harinath <rharinath@novell.com>
5318 Fix #74232 and cs0208-3.cs.
5319 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5320 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5321 unmanaged type. Don't use FieldBuilders when 't' is a
5322 TypeBuilder. Use ModFlags and MemberType fields.
5323 * class.cs (MemberBase.member_type): Rename from MemberType.
5324 (MemberBase.MemberType): New property. Determines member_type on
5326 (MemberBase.DoDefine): Don't initialize MemberType here.
5327 (FieldMember.Define): Likewise.
5329 2005-04-01 Marek Safar <marek.safar@seznam.cz>
5332 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5333 Attributes are emitted there.
5335 2005-04-01 Raja R Harinath <rharinath@novell.com>
5337 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5338 keyword in 'partial enum' too.
5339 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5341 Report from Kamil Skalski <nazgul@omega.pl>.
5344 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5345 have partial containers too.
5347 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5348 in block' checks to Block.CheckInvariantMeaningInBlock.
5349 * statement.cs (Block.GetKnownVariableInfo): Make private.
5350 (Block.IsVariableUsedInChildBlock): Remove.
5351 (Block.IsVariableUsedInBlock): Likewise.
5352 (Block.CheckInvariantMeaningInBlock): New. Show location of
5353 conflicting declaration.
5354 (Block.AddVariable): Make error messages less long-winded and more
5355 specific. Show location of conflicting declaration.
5356 * parameter.cs (Parameters.Location): New readonly property.
5358 2005-03-31 Raja R Harinath <rharinath@novell.com>
5360 Clean up semantics of invoking ResolveMemberAccess.
5361 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5362 can have an instance, ensure that we pass in a non-TypeExpression
5363 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
5364 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5365 argument. Update to changes and simplify.
5366 (FieldExpr.Emitinstance): Remove CS0120 check.
5367 (PropertyExpr.EmitInstance): Likewise.
5368 * expression.cs (Argument.Resolve): Likewise.
5369 (Invocation.DoResolve): Update to changes in semantics of
5372 2005-03-31 Marek Safar <marek.safar@seznam.cz>
5375 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5378 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5380 2005-03-31 Raja R Harinath <rharinath@novell.com>
5382 Fix difference in behaviour with commandline invocation.
5383 * driver.cs (Driver.Reset): New.
5384 (CompilerCallableEntryPoint): Call it.
5386 * statement.cs (If.Resolve): Avoid spurious "uninitialized
5387 variable" warnings if the boolean expression failed to resolve.
5389 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
5391 * attribute.cs: Fix the union of several permissions when some of them
5392 are unrestricted (so the result isn't an unrestricted permission set).
5395 2005-03-30 Raja R Harinath <rharinath@novell.com>
5397 * ecore.cs (MemberExpr): New class. Convert from interface
5399 (MemberExpr.ResolveMemberAccess): Refactor and move here from
5400 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
5402 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5403 (MethodGroupExpr.IsExplicitImpl): Remove.
5404 (Expression.GetFieldFromEvent): Remove.
5405 (SimpleName.MemberStaticCheck): Remove.
5406 (SimpleName.DoSimpleNameResolve): Update to changes.
5407 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5408 (MemberAccess.IdenticalNameAndTypeName): Remove.
5409 (MemberAccess.error176): Move to MemberExpr.
5410 (MemberAccess.DoResolve): Update to changes.
5411 (BaseAccess.DoResolve): Likewise.
5413 2005-03-30 Marek Safar <marek.safar@seznam.cz>
5415 C# 2.0 Conditional attribute class implementation
5417 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5418 Analyzes class whether it has attribute which has ConditionalAttribute
5419 and its condition is not defined.
5421 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5422 (Class.IsExcluded): New method. Search for at least one defined
5423 condition in ConditionalAttribute of attribute class.
5425 2005-03-30 Raja R Harinath <rharinath@novell.com>
5427 * ecore.cs (PropertyExpr): Derive from Expression, not
5428 ExpressionStatement.
5429 (PropertyExpr.EmitStatement): Remove.
5431 2005-03-29 Raja R Harinath <rharinath@novell.com>
5434 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5435 internal field "value__" of an enum be private. The examples for
5436 "value__" that I found on MSDN all used FieldAttributes.Private.
5438 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5439 Don't mention IL method attribute names.
5441 Fix #47991. Remove a TODO.
5442 * statement.cs (Block.Toplevel): Make into a field.
5443 (Block.Parameters): Move into ToplevelBlock.
5444 (Block.known_variables): Rename from child_variable_names.
5445 (Block.Block): Remove variants that take Parameters. Initialize
5446 'Toplevel' with the immediately surrounding toplevel block.
5447 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
5448 LocalInfo parameter.
5449 (Block.GetKnownVariableInfo): New.
5450 (Block.IsVariableNameUsedInChildBlock): Update.
5451 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
5452 the block, even though it may not be in scope.
5453 (Block.AddVariable): Remove Parameters parameter. Use
5454 Toplevel.Parameters instead.
5455 (Block.AddConstant): Remove Parameters parameter.
5456 (Block.GetParameterReference): Update to use Toplevel.Parameters.
5457 (Block.IsParamaterReference): Likewise.
5458 (Block.IsLocalParameter): Likewise. Simplify a lot.
5459 (ToplevelBlock.Parameters): New. Moved from Block.
5460 (ToplevelBlock.ToplevelBlock): Update to changes. Always
5461 initialize Parameters to a non-null value.
5462 * cs-parser.jay: Update to changes.
5463 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5464 simple names that mean different things in the same block. Use
5465 Block.IsVariableNameUsedInBlock.
5467 2005-03-28 Raja R Harinath <rharinath@novell.com>
5469 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5470 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5471 GetTypeHandle. It is possible for a reflected type to derive from
5472 a TypeBuilder (e.g., int[] derives from the TypeBuilder
5473 System.Array during mscorlib compilation).
5474 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5475 contain a method_hash, don't create one either. Don't create a
5476 deep copy of the base cache's method_hash.
5477 (MemberCache.SetupCache): Rename back from DeepCopy.
5478 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5479 already initialized. If we see an override function, add its
5480 underlying base virtual function to the member_hash too.
5482 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5484 2005-03-26 Raja R Harinath <harinath@acm.org>
5487 * assign.cs (Assign.DoResolve): When the RHS of an assignment
5488 fails to resolve, ensure that the LHS is still resolved as an
5491 2005-03-25 Raja R Harinath <harinath@acm.org>
5493 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5495 (Enum.current_ec): Remove.
5496 (Enum.LookupEnumValue): Remove EmitContext argument.
5497 Just uses the one created during DefineType.
5498 (Enum.FindMembers): Update.
5499 * expression.cs (MemberAccess.DoResolve): Update.
5501 2005-03-22 Marek Safar <marek.safar@seznam.cz>
5503 * assign.cs (Assign.DoResolve): Check for CS1717 when
5504 source and target are same (uses Equals).
5506 * expression.cs (LocalVariableReference, ParameterReference,
5507 This): Implemented Equals, GetHashCode.
5509 * statement.cs (Block.GetParameterReference): Removed useless
5512 2005-03-22 Raja R Harinath <rharinath@novell.com>
5515 * statement.cs (Block.AddVariable): Ensure that we skip implicit
5516 blocks before deciding whether the error is cs0136 or cs0128.
5518 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5519 (using_alias_directive, using_namespace_directive): Pass
5520 MemberName, not an expression to Namespace.UsingAlias and
5522 (MakeName): Use the MemberName of the namespace.
5523 * namespace.cs (Namespace.MemberName): New.
5524 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5525 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5527 * decl.cs (MemberName.Name): Make readonly.
5528 (MemberName.FromDotted): New "constructor".
5529 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5530 (MemberCore.Name): Compute from MemberName on demand.
5531 (MemberCore.SetMemberName): Provide a way to change the
5533 (MemberCore.AddToContainer): Don't take a fullname parameter.
5534 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5535 fully qualified name of the container to the member name.
5536 (TypeContainer.AddToTypeContainer): Use a fully qualified name
5537 only if the type is a member of the root container.
5538 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5539 MemberName.Left rather than searching for an embedded ".".
5540 (PartialContainer.CreatePart): Update to changes in RootContext.
5541 (MemberBase.ShortName): Turn into a property. Use
5542 MemberCore.SetMemberName.
5543 (MemberBase.ExplicitInterfaceName): Remove.
5544 (MemberBase.UpdateMemberName): Remove.
5545 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5546 (PropertyBase.SetMemberName): New override.
5547 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5548 (Tree.GetDecl): New.
5549 (Tree.AllDecls): Rename from Decls.
5550 * attribute.cs, enum.cs, report.cs: Update to changes.
5551 * driver.cs (MainDriver): Use MemberName.FromDotted on
5552 RootContext.MainClass.
5554 2005-03-21 Marek Safar <marek.safar@seznam.cz>
5556 * class.cs (FixedField.Define): Check for CS1664 and more sanity
5559 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5561 2005-03-18 Marek Safar <marek.safar@seznam.cz>
5563 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5564 property accessor modifiers.
5566 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5567 fixed buffer attribute (CS1716).
5568 (PropertyMethod.HasCustomAccessModifier): When property accessor
5569 has custom modifier.
5571 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5573 (PropertyExpr.DoResolveLValue): Add CS0272.
5575 2005-03-17 Miguel de Icaza <miguel@novell.com>
5577 * convert.cs: When converting to a pointer, use the proper Conv.U
5578 or Conv.I depending on the source data type.
5580 * cs-tokenizer.cs: Make the size for large decimal constants,
5583 2005-03-17 Martin Baulig <martin@ximian.com>
5585 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5586 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5588 2005-03-17 Martin Baulig <martin@ximian.com>
5590 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5591 to bool so we can return an error condition.
5592 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5595 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
5597 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5600 2005-03-16 Raja R Harinath <rharinath@novell.com>
5602 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5603 Refactor to avoid traversing the list of assemblies, and to avoid
5604 string concatenation.
5605 * typemanager.cs (guid_attr_type): Remove.
5606 (negative_hits, pointers, references): Remove hashes.
5608 (GetConstructedType): New. Uses type_hash to handle constructed
5609 types (arrays, references, pointers).
5610 (GetReferenceType, GetPointerType): Use it.
5611 (GetNestedType): New. Uses type_hash to handle nested types of
5613 (LookupType, LookupTypeDirect): Remove.
5614 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
5615 'types' hash and LookupTypeReflection directly.
5616 (params_string, params_object): Use GetConstructedType.
5617 * namespace.cs (Namespace.cached_types): New. Cache of reflected
5619 (Namespace.Lookup): Use cached_types.
5620 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5621 provided by old TypeManager.LookupType.
5622 * rootcontext.cs (MakeFQN): Remove.
5623 * decl.cs (DeclSpace.MakeFQN): Likewise.
5624 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5625 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5626 TypeManager.GetConstructedType.
5627 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5629 2005-03-15 Marek Safar <marek.safar@seznam.cz>
5631 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
5634 * cs-parser.jay: Reports CS1527 for any namespace element.
5636 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5639 * expression.cs (ParameterReference.IsAssigned): Changed error to
5641 (Error_WrongNumArguments): Moved CS0245 detection here.
5643 * statement.cs (Return.Resolve): Add CS1622 report.
5645 2005-03-11 Marek Safar <marek.safar@seznam.cz>
5647 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5649 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
5651 * attribute.cs expression.cs: Get rid of some allocations.
5653 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
5655 * doc.cs : just eliminate the latest change.
5657 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5659 * doc.cs : commented out the latest change. It breaks xml-030.cs
5661 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5663 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5664 fail. So invoke CreateType() in FindDocumentedType().
5666 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5668 * cs-tokenizer.cs : added IsKeyword().
5669 * doc.cs : Detect keyword incorrectly used as identifier.
5670 Allow identifiers prefixed by @.
5672 2005-03-10 Marek Safar <marek.safar@seznam.cz>
5674 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5675 It caused exception in namespace resolving (again!).
5677 * class.cs (Class.ctor): Removed exit.
5678 (PropertyMethod.ctor): ditto.
5680 * codegen.cs (Codegen.Reset): Reset static data.
5681 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5683 * cs-tokenizer.cs (Cleanup): Removed.
5685 * driver.cs (GetSystemDir): Rewrote to one line command.
5686 It caused problem with unloaded dynamic modules.
5687 (UnixParseOption): Removed Exit.
5688 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5689 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5690 Now can be mcs used as library.
5692 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5695 * location.cs (Reset): Reset static data.
5697 * namespace.cs (Reset): Reset static data.
5699 * report.cs (Report.Reset): Reset static data.
5701 * rootcontext.cs (RootContext.Reset): Reset static data.
5703 * tree.cs (RootTypes.ctor): Use Location.Null
5705 * typemanager.cs (TypeManager.Reset): Reset static data.
5706 (CoreLookupType): Removed Exit.
5707 (TypeHandle.Reset): Reset static data.
5709 2005-03-10 Raja R Harinath <rharinath@novell.com>
5712 * typemanager.cs (ComputeNamespaces): Import namespaces from
5713 referenced modules too.
5715 2005-03-09 Raja R Harinath <rharinath@novell.com>
5717 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5720 2005-03-09 Raja R Harinath <rharinath@novell.com>
5722 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5723 enclosing DeclSpace. This ensures that a name-lookup populates
5724 more caches and there are fewer 'TypeExpression's. Carve out
5725 nested type lookup into ...
5726 (LookupNestedTypeInHierarchy): ... this.
5728 2005-03-09 Raja R Harinath <rharinath@novell.com>
5730 Clean up a few partial-class semantics.
5731 Fixes test-357.cs and cs1618-2.cs.
5732 * cs-parser.jay (struct_declaration): Use 'current_class' as
5733 parent of newly-created struct. Remove call to Register ().
5734 Use 'pop_current_class' to complete handing the current struct.
5735 (interface_declaration): Likewise.
5736 (class_declaration): Likewise.
5737 (enum_declaration): Use 'current_class' as parent of newly created
5739 (delegate_declaration): Likewise.
5740 (pop_current_class): New function. This is used to handle closing
5741 up the 'current_class' and 'current_container', and pointing them
5742 to the enclosing class/container.
5743 (CSharpParser): Initialize 'current_class' too.
5744 * decl.cs (MemberCore): Add check for invariant: a partial
5745 container is not a parsed entity, and thus does not enclose any
5747 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5748 (DeclSpace.BaseTypeExpr): Use it.
5749 (DeclSpace.LookupType): Add check for invariant.
5750 * class.cs (TypeContainer): Add check for invariant: a nested
5751 class should have the same NamespaceEntry as its enclosing class.
5752 (TypeContainer.EmitFieldInitializers): Make virtual.
5753 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5755 (TypeContainer.Register): Remove.
5756 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5757 null. Use TypeResolveEmitContext for resolving base types and
5758 interfaces. Move initialization of Parts.TypeBuilder here from
5760 (TypeContainer.DefineNestedTypes): ... here.
5761 (PartialContainer): Take a Namespace not a NamespaceEntry.
5762 (PartialContainer.Create): Don't use Register. Call the
5763 appropriate Add... function directly.
5764 (ClassPart): Take both the PartialContainer and the enclosing
5765 class as constructor arguments.
5766 (ClassPart.EmitFieldInitializers): Override.
5767 (ClassPart.PartFindNestedTypes): Remove.
5768 (FieldBase.GetInitializerExpression): Resolve the initializer
5769 expression in the emit context of the enclosing class.
5770 * tree.cs (RootTypes): Remove Register ().
5772 2005-03-08 Marek Safar <marek.safar@seznam.cz>
5774 * cs-parser.jay: Removed CS0134.
5776 * driver.cs: Removed CS1901.
5778 * expression.cs (SizeOf.DoResolve): Don't report CS0233
5779 for predefined types.
5781 2005-03-07 Duncan Mak <duncan@novell.com>
5783 * codegen.cs (Save): Catch UnauthorizedAccessException as
5784 well. Fixes bug #73454.
5786 2005-03-07 Marek Safar <marek.safar@seznam.cz>
5788 * cs-tokenizer.cs (xtoken): Add CS1035.
5790 * class.cs (MethodData.Define): Add CS0683.
5791 (FieldMember.ctor): Add CS0681.
5793 2005-03-07 Raja R Harinath <rharinath@novell.com>
5795 * ecore.cs (SimpleName.DoResolve): Rename from
5796 SimpleName.DoResolveAllowStatic.
5797 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5798 Pass 'intermediate' flag to MemberStaticCheck.
5799 (SimpleName.MemberStaticCheck): Skip "static check" only in case
5800 of "intermediate" lookups via MemberAccess.
5801 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
5802 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5804 2005-03-07 Raja R Harinath <rharinath@novell.com>
5807 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5808 slipped in because of variable names that are identical to a
5809 builtin type's BCL equivalent ('string String;', 'int Int32;').
5810 (PropertyExpr.EmitInstance): Likewise.
5812 2005-03-04 Marek Safar <marek.safar@seznam.cz>
5814 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5816 * report.cs (warning_ignore_table): Made public.
5818 2005-03-04 Raja R Harinath <rharinath@novell.com>
5821 * class.cs (MethodData.Emit): Pass 'container' to
5822 container.GetObsoleteAttribute instead of 'container.Parent'.
5824 2005-03-03 Marek Safar <marek.safar@seznam.cz>
5826 * cs-parser.jay: Add 1534 error test.
5828 * iterators.cs (Yield.CheckContext): Add error 1629.
5829 (Iterator.ctor): Save unsafe modifier.
5830 (MoveNextMethod.DoEmit): Restore unsafe context.
5832 * namespace.cs (UsingAlias): Better error message.
5834 2005-03-03 Dan Winship <danw@novell.com>
5836 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5837 the warning message [#73219]
5839 2005-03-03 Raja R Harinath <rharinath@novell.com>
5841 Fix compile with MCS 1.0.0.0.
5842 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5843 w_restore to not depend on string constant folding.
5845 2005-03-03 Raja R Harinath <rharinath@novell.com>
5847 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
5848 CS0246 check to users who passed 'silent = false'.
5849 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5851 (SimpleName.SimpleNameResolve): Update.
5852 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5853 (MemberAccess.IdenticalNameAndTypeName): Update.
5854 * doc.cs (FindDocumentedTypeNonArray): Update.
5856 2005-03-03 Raja R Harinath <rharinath@novell.com>
5858 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5859 * parameters.cs (ComputeAndDefineParameters): Remove.
5860 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5861 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5862 Use GetParameterInfo.
5864 2005-03-02 Marek Safar <marek.safar@seznam.cz>
5866 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5868 2005-03-02 Raja R Harinath <rharinath@novell.com>
5870 Unify DeclSpace.LookupType and DeclSpace.FindType.
5871 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
5872 is in charge of defining nested types on demand.
5873 (DeclSpace.LookupType): Use it when the current_type is a
5874 TypeBuilder. Use LookupTypeDirect for reflected types.
5875 (DeclSpace.FindType): Remove.
5876 (DeclSpace.LookupInterfaceOrClass): Likewise.
5877 (DeclSpace.DefineTypeAndParents): Likewise.
5878 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5879 DeclSpace.LookupType.
5880 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5881 * typemanager.cs (LookupType): Simplify.
5882 (AddUserType): Remove type from negative_hits.
5883 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5884 * class.cs (TypeContainer.FindMembers): Move handling of nested
5886 (TypeContainer.FindMembers_NestedTypes): ... here.
5887 (TypeContainer.FindNestedType): Implement override.
5888 (ClassPart.FindNestedType): Delegate to PartialContainer.
5889 (ClassPart.PartFindNestedType): Looks up the nested types of the
5892 2005-03-02 Martin Baulig <martin@ximian.com>
5894 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5895 static constructor in static classes.
5897 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
5899 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5900 sizeParamIndex is not specified.
5902 2005-03-01 Marek Safar <marek.safar@seznam.cz>
5905 * report.cs (WarningMessage.IsEnabled): Missing null check.
5907 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5909 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5910 in the fields and not in the properties.
5912 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
5914 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
5917 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5919 * attribute.cs: Small refactoring (improved robustness).
5920 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5921 (ValidateGuid): Removed.
5922 (Resolve): Removed referenced to above mentioned.
5923 (GetAttributeUsage): Made private and changed to work without
5925 (GetIndexerAttributeValue): Don't crash.
5926 (GetConditionalAttributeValue): Ditto.
5927 (GetClsCompliantAttributeValue): Ditto.
5928 (ExtractSecurityPermissionSet): All attributes exceptions are
5930 (GetPropertyValue): New helper.
5931 (GetMethodImplOptions): New method.
5932 (DefinePInvokeMethod): Reuse common code. Implemented handling of
5933 some missing properties.
5935 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5936 (Method.ApplyAttributeBuilder): Updated.
5938 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5941 2005-02-28 Raja R Harinath <rharinath@novell.com>
5944 * report.cs (Report.SymbolRelatedToPreviousError): Handle
5945 non-simple types (array, pointer, reference).
5947 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5949 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5951 * class.cs (MethodCore.IsDuplicateImplementation): Special error
5953 (Method.CheckBase): Catch wrong destructor here.
5954 (MethodData.Define): Add errors 550, 668.
5956 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5958 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5960 * pending.cs (VerifyPendingMethods): Add error 551.
5962 * typemanager.cs (CSharpName): Next error report helper.
5964 2005-02-25 Marek Safar <marek.safar@seznam.cz>
5966 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5967 attributes. Removed useless attribute double check.
5968 It saves almost 2MBs for corlib.
5970 2005-02-25 Raja R Harinath <rharinath@novell.com>
5973 * statement.cs (ExpressionStatement.Resolve): Make robust to being
5974 called twice in case of error.
5976 2005-02-23 Chris Toshok <toshok@ximian.com>
5978 Fix compiler portions of #72827.
5979 * statement.cs (Block.Emit): call Begin/EndScope on the
5980 EmitContext instead of the ILGenerator.
5982 * codegen.cs (EmitContext.BeginScope): new method, call
5983 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5985 (EmitContext.BeginScope): same, but EndScope and CloseScope
5987 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5988 offset and call the superclass's OpenScope(int) with it.
5989 (SymbolWriter.CloseScope): get the current il
5990 offset and call superclass's CloseScope(int) with it.
5992 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5994 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5995 CS1677 for out and ref as well.
5997 * class.cs (Method.Define): Add error CS1599 detection.
5999 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6001 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6003 * delegate.cs (Delegate.Define): Add error CS1599 detection.
6005 * support.cs.cs (ModifierDesc): New helper method.
6007 2005-02-23 Raja R Harinath <rharinath@novell.com>
6008 Abin Thomas <projectmonokochi@rediffmail.com>
6009 Anoob V E <projectmonokochi@rediffmail.com>
6010 Harilal P R <projectmonokochi@rediffmail.com>
6013 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6014 MemberLookup (used for error reporting) actually returns a result.
6015 Fix error report number (122, not 112).
6017 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
6018 Anoob V E <projectmonokochi@rediffmail.com>
6019 Harilal P R <projectmonokochi@rediffmail.com>
6022 * pending.cs (PendingImplementation.GetAbstractMethods):
6023 Find NonPublic members too.
6025 2005-02-22 Marek Safar <marek.safar@seznam.cz>
6027 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6030 * class.cs (MethodCore.CheckMethodAgainstBase):
6031 Add error 239 report.
6033 2005-02-21 Raja R Harinath <rharinath@novell.com>
6036 * expression.cs (Invocation.IsApplicable): Make public.
6037 (Invocation.IsParamsMethodApplicable): Likewise.
6038 * delegate.cs (Delegate.VerifyApplicability): Don't use
6039 Invocation.VerifyArgumentCompat for parameter applicability
6040 testing. Use Invocation.IsApplicable and
6041 Invocation.IsParamsMethodApplicable.
6043 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6045 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6047 * class.cs (Operator.Define): Add error 217 report.
6049 2005-02-21 Raja R Harinath <rharinath@novell.com>
6051 * namespace.cs (UsingEntry.Resolve): Undo change below.
6053 2005-02-21 Raja R Harinath <rharinath@novell.com>
6056 * ecore.cs (Expression.MemberLookupFailed): Add argument to
6057 disable the error message when the extended MemberLookup also
6059 (Expression.MemberLookupFinal): Update.
6060 (SimpleName.DoSimpleNameResolve): Update.
6061 * expression.cs (MemberAccess.ResolveNamespaceOrType):
6062 Don't use MemberLookupFinal.
6063 (New.DoResolve): Update.
6064 (BaseAccess.CommonResolve): Update.
6066 2005-02-21 Raja R Harinath <rharinath@novell.com>
6069 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6070 occured previously, don't resolve again.
6072 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6075 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6076 argument. Call ResolveAttributeUsage for unresolved.
6077 when types doesn't match ctor arguments.
6079 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6080 for nested attribute classes.
6081 (Class.attribute_usage): Removed.
6082 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6083 for attribute class.
6085 * ecore.cs (IsAttribute): Removed.
6087 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6089 * rootcontext.cs (RegisterAttribute): Removed, attributes are
6091 (attribute_types): Removed.
6092 (EmitCode): Global attributes are emited as the latest.
6094 2005-02-18 Marek Safar <marek.safar@seznam.cz>
6096 * class.cs (EmitFieldInitializers): Don't emit field initializer
6097 for default values when optimilization is on.
6099 * constant.cs (Constant.IsDefaultValue): New property.
6101 * driver.cs: Add /optimize handling.
6105 * literal.cs: Implement new IsDefaultValue property.
6107 * rootcontext.cs (Optimize): New field, holds /optimize option.
6109 2005-02-18 Raja R Harinath <rharinath@novell.com>
6111 Fix crasher in re-opened #72347.
6112 * namespace.cs (Namespace.Lookup): Return null if
6113 DeclSpace.DefineType returns null.
6116 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6118 2005-02-18 Raja R Harinath <rharinath@novell.com>
6120 Fix remainder of #63202. Change semantics of DoResolveLValue: it
6121 now returns null if it cannot resolve to an lvalue.
6122 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6123 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6124 returned null. Remove check for SimpleName.
6125 (EventExpr.DoResolveLValue): New.
6126 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6127 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
6129 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
6131 (Unary.ResolveOperator): Move CS0211 check ...
6132 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
6134 (Unary.DoResolveLValue): Simplify.
6135 (AddressOf.DoResolveLValue): New.
6136 (ArrayAccess.DoResolveLValue): New.
6138 2005-02-16 Marek Safar <marek.safar@seznam.cz>
6140 * attribute.cs (Attribute.Resolve): Add arguments casting for
6141 when types doesn't match ctor arguments.
6143 2005-02-16 Raja R Harinath <rharinath@novell.com>
6145 Fix parts of #63202.
6146 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6147 lookup of operator in base type. Ensure that all checks happen
6148 when the operator resolves to an "op_..." method.
6150 2005-02-15 Raja R Harinath <rharinath@novell.com>
6153 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6154 'ignore_cs0104' parameter. Pass it to ...
6155 (NamespaceEntry.Lookup): ... this.
6156 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6157 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6158 (TypeLookupExpression.DoResolveAsTypeStep): Update.
6159 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6160 Update. Request that cs0104 errors be ignored.
6161 (ComposedCast.ResolveAsTypeStep): Update.
6163 2005-02-14 Raja R Harinath <rharinath@novell.com>
6166 * expression.cs (Invocation.BetterFunction): Remove support for
6167 comparing virtual functions and their overrides.
6168 (Invocation.IsOverride): New.
6169 (Invocation.OverloadResolve): Don't consider 'override' functions
6170 during candidate selection. Store them in a lookaside list.
6171 If the selected method is a 'virtual' function, use the list to
6172 find any overrides that are closer to the LHS type.
6174 2005-02-14 Marek Safar <marek.safar@seznam.cz>
6176 * expression.cs (New.DoResolve): Add complex core type reduction.
6177 (New.Constantify): Converts complex core type syntax like 'new int ()'
6180 2005-02-14 Raja R Harinath <rharinath@novell.com>
6182 * decl.cs (EntryType.EntryType): New constructor to create an
6183 updated copy of a cache entry.
6184 (MemberCache.AddMethods): Use it.
6185 (MemberCache.ClearDeclaredOnly): Remove.
6186 (MemberCache.MemberCache): Update.
6188 2005-02-11 Miguel de Icaza <miguel@novell.com>
6190 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6191 variable. This one is represents the actual low-level declaration
6192 of the method, as opposed to the semantic level `IsStatic'.
6194 An anonymous method which is hosted into a static method might be
6195 actually an instance method. IsStatic would reflect the
6196 container, while MethodIsStatic represents the actual code
6199 * expression.cs (ParameterReference): Use the new MethodIsStatic
6200 instead of IsStatic.
6202 * anonymous.cs (AnonymousMethod.Compatible): Pass the
6203 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6204 set on the current EmitContext.
6206 * expression.cs (Cast): Overload DoResolveLValue so we can pass
6207 resolve our casted expression as an LValue. This triggers the
6208 proper LValue processing that is later required by Assign.
6212 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6214 2005-02-11 Marek Safar <marek.safar@seznam.cz>
6216 C# 2.0 Fixed buffer implementation
6218 * anonymous.cs: Update after RegisterHelperClass renaming.
6220 * attribute.cs (AttributeTester.fixed_buffer_cache):
6221 Cache of external fixed buffers.
6222 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6223 implementation if field is fixed buffer else null.
6226 (TypeContainer.AddField): Accept FieldMember instead of Field.
6227 (FieldBase.IsFieldClsCompliant): Extracted code from
6228 VerifyClsCompliance descendant customization.
6229 (FixedField): New class handles fixed buffer fields.
6230 (FixedFieldExternal): Keeps information about imported fixed
6232 (IFixedField): Make access to internal or external fixed buffer
6235 * cs-parser.jay: Add fixed buffer parsing.
6237 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6240 * expression.cs (Indirection): Extended implementation to accept
6242 (PointerArithmetic.Emit): Get element from fixed buffer as well.
6243 (ElementAccess.MakePointerAccess): Get type as parameter.
6244 (DoResolve): Add fixed buffer field expression conversion.
6245 (DoResolveLValue): Ditto.
6246 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6247 (ArrayPtr): Derives from FixedBufferPtr.
6248 (ArrayPtr.Emit): Add extra emit for array elements.
6250 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6252 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6253 for compiler generated types.
6254 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6256 * statement.cs (Fixed): Refactored to be easier add fixed buffer
6257 and consume less memory.
6258 (Fixed.Resolve): Add fixed buffer case.
6260 * typemanager.cs (compiler_generated_attr_ctor,
6261 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6262 (HasElementType): Add our own implementation to work on every
6265 2005-02-11 Miguel de Icaza <miguel@novell.com>
6267 * anonymous.cs (CaptureContext): Track whether `this' has been
6270 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
6271 only captured `this' if it was implicitly done (instance
6272 methods/variables were used).
6274 * codegen.cs (EmitContext.CaptureThis): New method to flag that
6275 `this' must be captured.
6277 2005-01-30 Miguel de Icaza <miguel@novell.com>
6279 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6280 is null it means that there has been no need to capture anything,
6281 so we just create a sibling.
6283 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6285 Just a partial fix. The other half is fairly elusive.
6287 2005-02-10 Raja R Harinath <rharinath@novell.com>
6289 Fix #52586, cs0121-4.cs.
6290 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
6291 and return a hashtable.
6292 (MemberCache.ClearDeclaredOnly): New.
6293 (MemberCache.MemberCache): Update to change. Make a deep copy of
6294 the method_hash of a base type too.
6295 (MemberCache.AddMethods): Adapt to having a deep copy of the base
6296 type methods. Overwrite entries with the same MethodHandle so
6297 that the ReflectedType is correct. The process leaves in base
6298 virtual functions and their overrides as distinct entries.
6299 (CacheEntry): Now a class instead of a struct. It shouldn't alter
6300 matters since it was boxed in a ArrayList before.
6301 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6303 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
6304 case of a virtual function and its override (choose the overload
6306 (Invocation.OverloadResolve): Avoid 'override' members during
6307 'applicable_type' calculation.
6309 2005-02-09 Raja R Harinath <rharinath@novell.com>
6311 Combine two near-redundant caches.
6312 * typemanager.cs (method_params): Rename from method_internal_params.
6313 (TypeManager.GetParameterData): New. Replace
6314 Invocation.GetParameterData.
6315 (TypeManager.LookupParametersByBuilder): Remove.
6316 * expression.cs (Invocation.method_parameter_cache): Remove.
6317 (Invocation.GetParameterData): Remove.
6319 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6322 2005-02-08 Raja R Harinath <rharinath@novell.com>
6325 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6326 TypeManager.multicast_delegate_type is null, resolve it by looking
6327 up "System.MulticastDelegate".
6328 * rootcontext.cs (RootContext.ResolveCore): Simplify.
6330 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
6331 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
6332 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
6335 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6336 (LabeledStatement.AddReference): New. Set 'referenced'.
6337 (Goto.Resolve): Use it.
6339 2005-02-05 John Luke <john.luke@gmail.com>
6341 * driver.cs: remove duplicate -doc line in Usage ()
6343 2005-02-04 Raja R Harinath <rharinath@novell.com>
6345 * location.cs (Location.AddFile): Fix CS2002 error report.
6347 2005-02-02 Martin Baulig <martin@ximian.com>
6349 * delegate.cs (Delegate.DefineType): Report an internal error if
6350 TypeManager.multicast_delegate_type is null. See bug #72015 for
6353 2005-02-02 Raja R Harinath <rharinath@novell.com>
6355 Fix a crasher in a variant of #31984.
6356 * const.cs (Constant.CheckBase): New override that defers the
6357 new-or-override check in case the base type hasn't been populated
6359 (Constant.Define): Ensure the new-or-override check is performed.
6361 2005-02-01 Duncan Mak <duncan@ximian.com>
6363 * const.cs (LookupConstantValue): Check that `ce' is not null
6364 before calling GetValue ().
6366 2005-02-01 Raja R Harinath <rharinath@novell.com>
6368 Fix test-334.cs (#69519).
6369 * cs-parser.jay (using_alias_directive): Pass in an expression to
6370 NamespaceEntry.UsingAlias.
6371 (using_namespace_directive): Pass in an expression to
6372 NamespaceEntry.Using.
6373 (namespace_name): Don't flatten to a string.
6374 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6375 (NamespaceEntry.AliasEntry.Resolve): Lookup using
6377 (NamespaceEntry.UsingEntry): Likewise.
6378 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6380 (NamespaceEntry.LookupForUsing): Remove.
6381 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6383 (NamespaceEntry.Lookup): Remove support for dotted names.
6385 2005-02-01 Raja R Harinath <rharinath@novell.com>
6387 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6389 (NamespaceEntry.ImplicitParent): Compute on demand.
6390 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6391 parallels the current.
6392 (NamespaceEntry.LookupForUsing): Use it.
6393 (NamespaceEntry.Lookup): If the current namespace-entry is
6394 implicit, don't search aliases and using tables.
6396 2005-02-01 Raja R Harinath <rharinath@novell.com>
6399 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6401 (TypeContainer.BaseCache): Compute on demand.
6402 (TypeContainer.FindMembers): Define constants and types if they're
6403 not already created.
6404 (FieldMember.Define): Move resetting of ec.InUnsafe before error
6406 * const.cs (Constant.Define): Make idempotent.
6408 2005-01-29 Miguel de Icaza <miguel@novell.com>
6410 * pending.cs: Produce better code (no nops produced by using Ldarg
6413 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6414 i - 1' it should be arg + 1.
6418 2005-01-28 Raja R Harinath <rharinath@novell.com>
6420 * attribute.cs (Attribute.CheckAttributeType): Make private
6422 (Attribute.ResolveType): Make virtual.
6423 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6424 handling of RootContext.Tree.Types.
6426 2005-01-27 Raja R Harinath <rharinath@novell.com>
6428 Update attribute-handling to use the SimpleName/MemberAccess
6430 * cs-parser.jay (attribute): Pass in an expression to the
6431 constructors of Attribute and GlobalAttribute.
6432 * attribute.cs (Attribute): Take an expression for the name.
6433 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
6434 passed in attribute name expression.
6435 (Attribute.CheckAttributeType): Use it.
6436 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6437 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6438 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
6439 argument to prevent error messages if the lookup fails.
6441 2005-01-27 Marek Safar <marek.safar@seznam.cz>
6443 * expression.cs (Indirection): Implemented IVariable interface
6444 to support indirection in AddressOf operator.
6445 (PointerArithmetic.Emit): Add optimalization for case where
6446 result can be precomputed.
6448 2005-01-26 Martin Baulig <martin@ximian.com>
6450 * class.cs (TypeContainer.AttributeTargets): Return the correct
6451 AttributeTargets depending on our `Kind' instead of throwing an
6452 exception; fixes #71632.
6454 2005-01-26 Marek Safar <marek.safar@seznam.cz>
6457 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6460 2005-01-25 Raja R Harinath <rharinath@novell.com>
6463 * expression.cs (MemberAccess.DoResolve): Don't complain with
6464 cs0572 when the LHS of a member access has identical name and type
6467 2005-01-25 Marek Safar <marek.safar@seznam.cz>
6470 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6472 Create custom PermissionSet only for PermissionSetAttribute.
6474 2005-01-24 Marek Safar <marek.safar@seznam.cz>
6477 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6478 delegates in static class.
6480 2005-01-24 Martin Baulig <martin@ximian.com>
6482 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6483 merging an implicit block, just use its reachability.
6485 * statement.cs (Block.Resolve): Make the unreachable code check
6486 work wrt. implicit blocks; see test-337 from #63842.
6488 2005-01-21 Alp Toker <alp@atoker.com>
6490 * cs-parser.jay: destructor_declaration's container is PartialContainer
6491 not Class when partial types are used, so use Kind prop instead of
6494 2005-01-22 Miguel de Icaza <miguel@ximian.com>
6496 * cs-parser.jay: Improve error reporting when an interface
6499 2005-01-20 Dick Porter <dick@ximian.com>
6501 * support.cs: SeekableStreamReader fix from Sandor Dobos
6502 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6503 chars are read. Fixes bug 70369.
6505 2005-01-20 Raja R Harinath <rharinath@novell.com>
6507 * cs-parser.jay (catch_clause): Simplify current_block handling
6510 2005-01-17 Miguel de Icaza <miguel@ximian.com>
6512 * convert.cs (ImplicitStandardConversionExists): Synchronize the
6513 code with ImplicitStandardConversion to handle the implicit
6514 conversion of method groups into valid delegate invocations.
6516 The problem is that in parameter handling we were using this code
6517 path. Fixes bug #64698
6519 2005-01-19 Raja R Harinath <rharinath@novell.com>
6521 * cs-parser.jay: Fix several infelicities.
6522 - Avoid assigning to the parser value stack. Code like
6523 '$3 = null' is unclean. Synthesize a value for the code block
6525 - Avoid using oob_stack for storing location information. Use ...
6526 (_mark_): ... this. New (empty) rule. Saves the current location
6528 (foreach_statement): Avoid using oob_stack for current_block
6529 handling. Use technique used in for_statement and
6530 using_statement. Synthesize a value for the code block to store
6531 additional intermediate information.
6533 2005-01-13 Miguel de Icaza <miguel@ximian.com>
6535 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6536 of a different type is only allowed to private fields of a
6537 containing type, not on fields of a base class.
6539 See test-174.cs and error cs0122-9.cs
6541 2005-01-13 Raja R Harinath <rharinath@novell.com>
6543 Fix test-335.cs (bug #58126).
6544 * cs-parser.jay (argument): Split out non-expression parts of the
6545 rule into 'non_simple_argument'.
6546 (invocation_expression): Support parenthesized invocations with
6547 multiple arguments, and with single non-simple arguments.
6549 2005-01-13 Raja R Harinath <rharinath@novell.com>
6551 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6554 2005-01-12 Raja R Harinath <rharinath@novell.com>
6556 Fix cs0038-1.cs, cs1640-6.cs.
6557 * ecore.cs (Expression.Resolve): Remove special-case for
6558 SimpleName in error-handling.
6559 (Expression.almostMatchedMembers): Relax access permission to
6561 (Expression.MemberLookupFailed): Handle duplicates in
6562 almostMatchedMembers list.
6563 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6564 * expression.cs (New.DoResolve): Report CS1540 for more cases.
6565 * typemanager.cs (GetFullNameSignature): Use the MethodBase
6566 overload if the passed in MemberInfo is a MethodBase.
6568 2005-01-12 Marek Safar <marek.safar@seznam.cz>
6571 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6572 for non-CAS & merge permission sets properly.
6574 2005-01-11 Raja R Harinath <rharinath@novell.com>
6576 Improve standard-compliance of simple name and member access
6577 resolution. Fixes bugs #52697, #57200, #67520, #69519.
6578 * ecore.cs (FullNamedExpression): New abstract base class
6579 for Namespaces and TypeExpressions.
6580 (ResolveFlags.SimpleName): Remove.
6581 (SimpleName): Remove support for dotted names.
6582 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
6583 DeclSpace.FindType and DeclSpace.LookupType.
6584 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6585 (Expression.ExprClassName): Make member function.
6586 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6587 a namespace. Remove creation of dotted "SimpleName"s.
6588 (MemberAccess.DoResolve): Likewise.
6589 * decl.cs (DeclSpace.Cache): Make private.
6590 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6591 (DeclSpace.FindType): Update.
6592 (DeclSpace.LookupType): Move here from RootContext. Return a
6593 FullNamedExpression.
6594 * namespace.cs (Namespace): Derive from FullNamedExpression
6595 so that it can be part of expression resolution.
6596 (Namespace.Lookup): Return an FullNamedExpression.
6597 (NamespaceEntry.LookupAlias): Lookup aliases only in current
6599 * rootcontext.cs (NamespaceLookup): Remove.
6600 (LookupType): Move to DeclSpace.
6601 * attribute.cs (CheckAttributeType): Update.
6602 * doc.cs (FindDocumentedType): Remove allowAlias argument.
6603 (FindDocumentedTypeNonArray): Likewise.
6605 2005-01-11 Raja R Harinath <rharinath@novell.com>
6607 Fix cs0509.cs, cs1632.cs.
6608 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6609 is the same as IsInterface.
6610 (TypeContainer.GetClassBases): Likewise.
6611 * statement.cs (LabeledStatement.ig): New field.
6612 (LabeledStatement.LabelTarget): Save ILGenerator which created the
6614 (LabeledStatement.DoEmit): Check that the label was created with
6615 the same ILGenerator.
6617 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6620 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6621 accessors to its properties.
6623 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6624 from accessors to property.
6626 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6629 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6632 2005-01-08 Miguel de Icaza <miguel@ximian.com>
6634 * attribute.cs: Check for null and empty strings.
6636 I have lost another battle to Paolo.
6638 2005-01-07 Marek Safar <marek.safar@seznam.cz>
6641 * class.cs (PropertyMethod): Set Parent field in ctors.
6642 (SetMethod.InternalParameters): Add unsafe switch hack.
6643 Override MarkForDuplicationCheck where it is appropriate.
6645 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6646 It says whether container allows members with the same name.
6648 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6649 Removed is_method parameter.
6651 2005-01-06 Duncan Mak <duncan@ximian.com>
6653 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6654 because the previous change led to incorrect reporting of CS1032
6655 ("Cannot define/undefine preprocessor symbols after first token in
6656 file"). Instead of using `tokens_seen' as the only flag that
6657 triggers CS1040, introduce `comments_seen'. This new flag is used
6658 to signify having seen comments on the current line, so it is
6659 unset after a newline.
6661 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6663 * doc.cs : When searching for a type, find nested type too.
6664 This fixes bug #71040.
6666 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6669 - Warn missing member comment on those classes which also does not
6670 have doc comments. Fixed bug #71041.
6671 - Don't warn missing doc comment on default constructor.
6674 2005-01-06 Duncan Mak <duncan@ximian.com>
6676 * cs-tokenizer.cs (xtoken): After handling traditional C-style
6677 comments, set `tokens_seen' to true. This allows us to detect
6678 misplaced preprocessor directives (i.e. not at the beginning of
6679 the a line, nor after whitespaces). In that case, report error
6680 CS1040. This fixes bug #56460.
6682 * cs-parser.jay (interface_member_declaration): Add checks for
6683 IsExplicitImpl, and report CS0541 error if an interface member is
6684 defined as an explicit interface declaration.
6686 2005-01-06 Marek Safar <marek.safar@seznam.cz>
6689 * class.cs (PropertyMethod): Set Parent field in ctors.
6690 (SetMethod.InternalParameters): Add unsafe switch hack.
6692 * decl.cs (MemberCore.Parent): Cannot be readonly.
6694 2005-01-06 Raja R Harinath <rharinath@novell.com>
6696 * decl.cs (DeclSpace.ResolveType): Remove.
6697 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6698 Merge in code from ...
6699 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
6700 * class.cs, enum.cs: Update to changes.
6702 2005-01-06 Miguel de Icaza <miguel@ximian.com>
6704 * anonymous.cs: Ensure that we init the scope of our parent if it
6705 has not been initialized yet.
6707 2004-12-30 Duncan Mak <duncan@ximian.com>
6709 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6710 if field.FieldBuilder is null. Fixes #70758.
6712 * convert.cs: Fixed some typos and updated some of the comments.
6713 (ImplicitStandardConversionExists):
6714 (TryImplicitIntConversion): If `target_type' is an interface and
6715 the type of `ic' implements this interface, return true or a new
6716 BoxedCast instead of null. This fixes #70468.
6718 2004-12-29 Duncan Mak <duncan@ximian.com>
6720 * expression.cs (Argument.Emit): Check that Expr is
6721 IMemoryLocation before casting to it, and report CS1510 otherwise.
6725 2004-12-21 Ben Maurer <bmaurer@ximian.com>
6727 * statement.cs (Block.ThisVariable): remove the recursion here, to
6728 make the --profile more sane.
6730 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
6732 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6733 assembly, by JB Evain.
6735 2004-12-17 Raja R Harinath <rharinath@novell.com>
6737 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
6738 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6739 "parent" refers to enclosing type/class. "base" refers to superclass.
6741 2004-12-17 Raja R Harinath <rharinath@novell.com>
6743 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6744 Ensure that we only have GlobalAttributes.
6745 * attribute.cs (Attribute.Emit): Make non-virtual.
6746 (GlobalAttribute.Emit): Remove.
6747 (Attribute.Resolve): Make virtual.
6748 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
6749 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6750 the argument. Don't create one.
6751 (Attribute.GetObsoleteAttribute): Likewise.
6752 (Attribute.GetClsCompliantAttributeValue): Likewise.
6753 * class.cs, decl.cs: Update to changes.
6755 2004-12-17 Marek Safar <marek.safar@seznam.cz>
6757 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6759 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6761 * statement.cs (Foreach.Resolve): Add error 186 report.
6763 2004-12-16 Marek Safar <marek.safar@seznam.cz>
6765 * expression.cs (Conditional.DoResolve): Add warning 429.
6767 * statement.cs (If.Resolve): Add warning 665.
6769 2004-12-16 Raja R Harinath <rharinath@novell.com>
6771 New invariant: RootContext.Tree.Types.NamespaceEntry == null
6772 except when in the parser, and in GlobalAttribute.
6773 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6774 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6775 RootContext.Tree.Types.NamespaceEntry once work is done.
6776 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
6777 and resets RootContext.Tree.Types.NamespaceEntry.
6779 2004-12-15 Marek Safar <marek.safar@seznam.cz>
6781 * cs-parser.jay: Don't create a block for every variable.
6783 2004-12-14 Miguel de Icaza <miguel@ximian.com>
6785 * location.cs: Provide extra information.
6787 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6788 variables from the captured environment, it is the ldarg_0.
6790 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6792 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6795 * class.cs: Changed warning level for 169 to avoid developer
6796 displeasure from warning flooding. It will be changed back when they
6797 fix most of current BCL warnings.
6799 * RootContext.cs: Pushed default WarningLevel to 3.
6801 * statement.cs: Removed unused variable.
6803 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6805 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6806 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6807 Add error 502 report.
6808 (StaticClass.DefineType): Add error 441 report.
6809 (Class.AllowedModifiersProp): New virtual property as temporary
6810 extension to AllowedModifiers.
6811 (Class.DefineType): Add error 418 report. Moved ModFlags check here
6812 to share implementation with StaticClass and don't call virtual
6815 * driver.cs (MainDriver): Add error 1558 test.
6817 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6818 report. Moved error 36 test here.
6820 * statement.cs (Throw.Resolve): Add error 724 report.
6822 * typemanager.cs: Add out_attribute_type core type.
6824 2004-12-13 Marek Safar <marek.safar@seznam.cz>
6826 * class.cs (TypeContainer.VerifyClsCompliance): Add error
6828 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6830 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6833 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6835 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
6836 Add error 3023 report.
6837 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6839 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6842 2004-12-12 John Luke <john.luke@gmail.com>
6844 * driver.cs (AddArgs): take -- into account when
6845 adding arguments, fixes bug 65710
6847 2004-12-12 Martin Baulig <martin@ximian.com>
6849 * expression.cs (Unary.TryReduceNegative): Added support for
6850 SByteConstant and ByteConstant.
6851 (Unary.Reduce): Check error values from TryReduceNegative().
6853 2004-12-10 Marek Safar <marek.safar@seznam.cz>
6855 * attributes.cs (Attribute.Resolve): Avoid multiple error report
6856 and report exception as error 182.
6858 2004-12-10 Raja R Harinath <rharinath@novell.com>
6860 * driver.cs (Main): Fix message when there are warnings.
6862 2004-12-09 Miguel de Icaza <miguel@ximian.com>
6864 * delegate.cs: Fixed my fix from yesterday, sorry about that.
6866 2004-12-09 Marek Safar <marek.safar@seznam.cz>
6868 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
6869 Reduced number of warnings.
6871 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6873 2004-12-08 Miguel de Icaza <miguel@ximian.com>
6875 * driver.cs: Removed message.
6877 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6879 2004-12-08 <vargaz@freemail.hu>
6881 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6883 2004-12-08 Martin Baulig <martin@ximian.com>
6885 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6886 instead of a CS3002 for properties and indexer.
6888 2004-12-08 Martin Baulig <martin@ximian.com>
6890 * decl.cs (MemberName.ToString): Make this work again.
6892 2004-12-08 Marek Safar <marek.safar@seznam.cz>
6894 * attribute.cs (Resolve): Add error 591 detection.
6896 * class.cs (FieldMember.Define): Add error 1547 detection.
6897 (Indexer.Define): Add error 620 detection.
6898 (Operator.Define): Add error 590 detection.
6900 * ecore.cs: Missing argument for error 79.
6902 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6905 2004-12-07 Marek Safar <marek.safar@seznam.cz>
6908 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6911 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6913 * cs-parser.jay : handle doc comments on implicit/explicit operators.
6914 Some operator comments were suppressed.
6915 * doc.cs : Implicit/explicit operator name in doc comments are like
6916 "op_Explicit(type)~returnType", so added suffix handling.
6918 2004-12-07 Martin Baulig <martin@ximian.com>
6921 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6922 (MemberCore.GetClsCompliantAttributeValue): Likewise.
6923 (DeclSpace.ec): New protected field; store the EmitContext here.
6924 (DeclSpace.EmitContext): New public property; moved here from
6926 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6929 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6930 (Enum.Emit): Don't create a new EmitContext.
6932 * delegate.cs (Delegate.DefineType): Always create the
6935 * iterators.cs (Iterators.DefineIterator): Create a new
6936 EmitContext and store it in `ec'.
6938 2004-08-24 Martin Baulig <martin@ximian.com>
6941 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6942 this for accessibility checks.
6943 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6944 IsNestedFamilyAccessible.
6945 (TypeManager.IsSubclassOf): New method, do what the name actually
6948 2004-12-06 Raja R Harinath <rharinath@novell.com>
6950 Fix crash on cs0657-17.cs.
6951 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6952 Use RootContext.Tree.Types, not 'new RootTypes ()'.
6953 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6954 the case where the NamespaceEntry gets overwritten.
6956 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6958 Fixed #69195, #56821
6959 * ecore.cs (ResolveBoolean): Tiny refactoring.
6961 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6962 of right expression resolving when left is false constant and
6963 operator is LogicalAnd OR true constant and operator is LogicalOr.
6965 * statement.cs (ResolveUnreachable): Always reports warning.
6967 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6969 * class.cs: Distinguish between 1721 and 1722 (just a little help
6970 for the programmer).
6972 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6974 * delegate.cs: Only allow this on new versions of the language.
6976 2004-12-02 Duncan Mak <duncan@ximian.com>
6978 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6980 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6981 here as a static method. Take an additional bool out parameter
6982 `must_do_cs1540_check' for signaling to InstanceResolve.
6983 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6984 member field from PropertyExpr class and made it an argument of
6986 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6987 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6988 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6989 and `remove_accessor' as well as InstanceResolve: report CS0122
6994 2004-12-03 Raja R Harinath <rharinath@novell.com>
6996 Fix test-327.cs, test-328.cs, and put in early infrastructure
6997 for eventually fixing #52697.
6998 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6999 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7001 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7002 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7003 (VerifyUsing, error246): Update.
7004 * rootcontext.cs (RootContext.NamespaceLookup): Just use
7005 'NamespaceEntry.LookupNamespaceOrType'.
7007 2004-12-03 Martin Baulig <martin@ximian.com>
7009 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7010 method as our child, call AnonymousMethod.Compatible() on it.
7012 2004-12-03 Raja R Harinath <rharinath@novell.com>
7014 Disable XML documentation support in 'basic' profile.
7015 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
7016 Redirect XmlElement to System.Object.
7017 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
7018 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
7019 * mcs.exe.sources: Add doc-bootstrap.cs.
7020 * doc-bootstrap.cs: New file. Contains empty stub implementation
7023 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
7025 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7026 comments are allowed.
7028 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7030 * delegate.cs: Add checks for subtypes in paramaters and return values
7031 in VerifyMethod () to add support for Covariance/Contravariance
7034 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7036 * report.cs: Remove extra closing parenthesis.
7038 * convert.cs (Error_CannotImplicitConversion): If the name of the
7039 types are the same, provide some extra information.
7041 * class.cs (FieldBase): Use an unused bit field from the field to
7042 encode the `has_offset' property from the FieldMember. This saves
7043 a couple of Ks on bootstrap compilation.
7045 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7046 method as our child, return the AnonymousMethod resolved
7049 * expression.cs (New.DoResolve): Allow return values from
7050 NewDelegate to also include AnonymousMethods.
7054 2004-12-02 Marek Safar <marek.safar@seznam.cz>
7057 * attribute.cs (Resolve): Improved implementation of params
7058 attribute arguments.
7060 * support.cs (ParameterData): Add HasParams to be faster.
7062 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
7064 all things are for /doc support:
7066 * doc.cs: new file that supports XML documentation generation.
7067 * mcs.exe.sources: added doc.cs.
7069 Handle /doc command line option.
7070 Report error 2006 instead of 5 for missing file name for /doc.
7071 Generate XML documentation when required, after type resolution.
7073 Added support for picking up documentation (/// and /** ... */),
7074 including a new XmlCommentState enumeration.
7076 Added lines to fill Documentation element for field, constant,
7077 property, indexer, method, constructor, destructor, operator, event
7078 and class, struct, interface, delegate, enum.
7079 Added lines to warn incorrect comment.
7081 Added Documentation field (passed only when /doc was specified).
7083 Added DocComment, DocCommentHeader, GenerateDocComment() and
7084 OnGenerateDocComment() and some supporting private members for
7085 /doc feature to MemberCore.
7087 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7089 Added overriden DocCommentHeader.
7091 Added overriden DocCommentHeader and GenerateDocComment().
7093 2004-12-01 Miguel de Icaza <miguel@ximian.com>
7095 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7096 unwrapping the enumeration values, chain to
7097 DoConstantNumericPromotions again, so we can promote things to the
7098 fundamental types (takes care of enums that are bytes, sbytes).
7102 2004-12-01 Raja R Harinath <rharinath@novell.com>
7104 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7105 Fix long-standing bug in type-lookup. Use FindType instead of
7106 LookupType when ec.ResolvingTypeTree.
7107 (Attribute.ResolveType, Attribute.Resolve)
7108 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7110 (Attributes.Search): Remove internal version. Update.
7111 (Attributes.SearchMulti): Update.
7112 (Attributes.GetClsCompliantAttribute): Remove.
7113 (Attributes.GetIndexerNameAttribute): Remove.
7114 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7115 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7116 * class.cs (Indexer.Define): Likewise.
7118 2004-12-01 Marek Safar <marek.safar@seznam.cz>
7121 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7122 MarshallByReference members access.
7124 * expression.cs: Use CheckMarshallByRefAccess;
7125 Better error CS0197 message.
7127 * report.cs: Print whole related error message.
7129 2004-11-30 Raja R Harinath <rharinath@novell.com>
7131 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
7132 the current directory to help debugging.
7134 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7136 * class (GetClassBases): Better error 60 report.
7137 (EventProperty): Disabled warning 67 detection.
7139 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7142 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7144 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7147 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7150 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7152 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7154 2004-11-26 Miguel de Icaza <miguel@ximian.com>
7156 * attribute.cs (Attribute.Resolve): Refine error reporting and
7157 report a cs0117 if the identifier does not exist, to distinguish
7158 from 0617 which is a miss-use of the actual identifier.
7160 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7161 between cs0070 and cs0079.
7163 * class.cs (MemberBase.DoDefine): When reporting a wrong
7164 accessibility level, we use MethodCore to compare instead of
7165 Method (this was a regression in some refactoring effort).
7167 So now we correctly report cs0056 again.
7169 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7170 testing the target_type (which was known to be object_type) and
7171 not the source type (which is anonymous_method).
7173 Fixed reporting of error cs1660.
7175 * expression.cs (UserCast.Source): Expose the underlying cast.
7177 * statement.cs (Switch.SwitchGoverningType): Sort the list of
7178 allowed types to find a match to int32 first (most common).
7180 In addition, it ignores any ImplicitUserConversions that did an
7181 internal implicit conversion (as the switch statement allows only
7182 one integral conversion to exist).
7184 * class.cs (PartialContainer.Create): rename `name' to
7185 `member_name' for clarity. Then replace the string calls with a
7186 call to MemberName.GetPartialName, as now using
7187 MemberName.ToString is an error (this is due to the side effects
7188 it had, that were fixed in the past).
7190 This will restore the error reporting on a number of partial class
7191 errors that were missusing this (and getting an exception as a
7192 results, which is now just a plain textual warning, because
7193 yyparse debug output would crash otherwise).
7195 2004-11-26 Raja R Harinath <rharinath@novell.com>
7197 * Makefile (PROGRAM_INSTALL_DIR): Remove.
7199 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7201 * rootcontext.cs (LookupType): Make sure to cache lookups that
7202 don't give us a negative result. This saves about 5% of corlib
7205 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7207 * report.cs (AbstractMessage.Print): messages are sent to stderr
7209 * class.cs (TypeContainer.GetClassBases): It is an error to have a
7210 non-interface in the list of interfaces (at this point, either
7211 parent was properly set, or a base class is being listed in the
7212 interfaces section).
7214 This flags error 1722, and resolves the crash from bug 69259.
7216 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7218 * statement.cs (Using.EmitExpressionFinally): make this work right
7219 for valuetypes. Fixes 69926.
7221 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7223 * const.cs (Const.ChangeType): Cope with the "0 literal can be
7224 converted to an enum" here, before we try to change the underlying
7225 type. This code exists, but it is a different code path than the
7226 one used while encoding constants.
7228 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7229 old bug: when converting from the null literal to a pointer,
7230 return an EmptyCast, not the NullLiteral.
7232 This fixes #69921, the recent null_type changes probably made this
7235 (ImplicitReferenceConversionExists): In addition, resynchronized
7236 the code here, so it matches the same code in
7237 ImplicitReferenceConversionExists for the `from any class-type S
7238 to any interface-type T'.
7241 2004-11-25 Marek Safar <marek.safar@seznam.cz>
7243 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7245 2004-11-24 Miguel de Icaza <miguel@ximian.com>
7247 * cs-parser.jay: Use verbosity accordingly.
7249 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7251 * expression.cs (Unary.ResolveOperator): Do not report warning;
7252 AddressOf reads from variable.
7254 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7256 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7260 * attribute.cs (Attributable): Removed CheckTargets.
7261 (Attributes.Emit): Explicit attribute targets are tested here.
7263 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7264 not enabled for interfaces.
7266 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7267 (GetAssemblyName): Ouch next bug there.
7269 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7271 * expression.cs: Error 275 added.
7273 2004-11-23 Marek Safar <marek.safar@seznam.cz>
7275 Fix bug #69177 (Implemented decimal constant support)
7277 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7278 (BinaryFold): Add DecimalConstant.
7280 * const.cs (Define): Decimal constant
7282 (ChangeType): Add decimal type handling.
7283 (LookupConstantValue): Don't set value for decimal type but
7284 emit DecimalConstantAttribute. Needed for constant optimization.
7286 * constant.cs (ToDecimal): New method.
7287 (ConvertToDecimal): New method.
7288 (IntConstant): Implemented ConvertToDecimal.
7289 (DecimalConstant.Emit): Emit optimized version for decimals in
7292 * expression.cs (ResolveOperator): Changed order of constant
7293 reduction to work correctly with native types which have
7294 overloaded operators.
7295 (ResolveMemberAccess): Extract constant value from attribute
7298 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7300 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7301 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7302 (ChangeType): Decimal is special.
7303 (TypeToCoreType): Add decimal type.
7305 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7307 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7310 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7312 * class.cs (EventField.ApplyAttributeBuilder): Fix error
7315 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7317 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7319 * pending.cs (PendingImplementation): Grab only interfaces.
7321 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7323 * statement.cs (ForeachHelperMethods): Add location member and
7324 error 202 detection.
7326 2004-11-19 Raja R Harinath <rharinath@novell.com>
7328 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
7329 automatically handled by executable.make.
7330 (PROGRAM): Make profile-specific.
7332 2004-11-18 Marek Safar <marek.safar@seznam.cz>
7334 * expression.cs (DoResolveBase): Fixed wrong warning for out
7337 2004-11-18 Martin Baulig <martin@ximian.com>
7339 Merged latest changes into gmcs. Please keep this comment in
7340 here, it makes it easier for me to see what changed in MCS since
7341 the last time I merged.
7343 2004-11-17 Raja R Harinath <rharinath@novell.com>
7345 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7346 (TypeHandle.GetMemberCache): New.
7347 (TypeHandle.TypeHandle): Update.
7348 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7349 (TypeManager.LookupParentInterfacesCache):
7350 Rename from LookupInterfaceCache. Optimize slightly.
7351 (TypeManager.MemberLookup_FindMembers): Update.
7352 * decl.cs (MemberCache.MemberCache): Set Container to null in the
7354 (AddCacheContents): Rename from AddHashtable.
7355 * class.cs (TypeContainer.parent_container): Remove.
7356 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7357 (TypeContainer.DoDefineMembers): Don't initialize it.
7358 Update to name changes.
7360 2004-11-17 Miguel de Icaza <miguel@ximian.com>
7362 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7363 that factors the code to check access modifiers on override.
7365 (PropertyBase): Use the code here.
7367 Patch from Lluis S'anchez, fixes bug #69361.
7369 2004-11-15 Miguel de Icaza <miguel@ximian.com>
7371 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7372 routine that is used to report the use of a captured variable
7373 whose address has been taken.
7375 There are two checks: one when variables are being captured and
7376 the other check is when the address of a variable is taken.
7378 (because an anonymous methods might be resolved before *or* after
7379 the address has been taken) and
7381 * expression.cs (Conditional.DoResolve): Remove the special
7382 casing that Martin added to trueExpr and falseExpr being both
7383 NullLiteral. We get the right behavior now just by introducing
7384 the null_type into the compiler.
7386 * convert.cs (ExplicitConversion): Change the code to use
7387 null_type instead of testing `expr is NullLiteral'.
7388 (ImplicitConversionStandard): use null_type too.
7389 (ImplicitReferenceConversionExists): use null_type too.
7390 (ImplicitReferenceConversion): use null_type too.
7392 * literal.cs: The type of `NullLiteral' is now null_type instead
7394 (Resolve): Set the type here.
7396 * typemanager.cs: Introduce null_type.
7398 2004-11-17 Martin Baulig <martin@ximian.com>
7400 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7401 direction, like FindMembers() does. Fixes #69546, testcase is in
7404 2004-11-16 Martin Baulig <martin@ximian.com>
7406 This is based on a patch from Marek Safar, see bug #69082.
7407 Fixes bugs #63705 and #67130.
7409 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7410 method; create a MemberCache for an interface type and cache the
7413 * decl.cs (IMemberContainer.ParentContainer): Removed.
7414 (IMemberContainer.ParentCache): New property.
7415 (MemberCache.SetupCacheForInterface): Removed.
7416 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7417 to create a cache for an interface's "parent".
7419 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7422 2004-11-16 Martin Baulig <martin@ximian.com>
7424 Merged back from gmcs; these changes already went into gmcs a
7425 couple of weeks ago.
7428 (TypeManager.AddUserType): Removed the `ifaces' argument.
7429 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
7431 (TypeManager.AddUserInterface): Removed.
7432 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
7434 (TypeManager.GetInterfaces): Likewise.
7435 (TypeManager.GetExplicitInterfaces): Likewise.
7437 * ecore.cs (TypeExpr.GetInterfaces): Removed.
7439 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
7440 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
7442 2004-11-14 Ben Maurer <bmaurer@ximian.com>
7444 * statement.cs: Avoid adding bools to a hashtable.
7446 2004-11-07 Miguel de Icaza <miguel@ximian.com>
7448 * expression.cs (Invocation.OverloadResolve): Flag error if we are
7449 calling an unsafe method from a safe location.
7451 2004-11-06 Marek Safar <marek.safar@seznam.cz>
7454 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7456 2004-11-06 Miguel de Icaza <miguel@ximian.com>
7458 * namespace.cs (VerifyUsing): use GetPartialName instead of
7461 2004-11-05 Miguel de Icaza <miguel@ximian.com>
7463 * statement.cs (Return.Resolve): Fix regression in typo: if
7464 `in_exc', we have to request a NeedReturnLabel, this was a typo
7465 introduced in the anonymous method check-in. Fixes #69131.
7467 * Indexers were using the ShortName when defining themselves,
7468 causing a regression in the compiler bootstrap when applying the
7469 patch from 2004-11-02 (first part), now they use their full name
7470 and the bug is gone.
7472 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
7474 * driver.cs: Strip the path from the names of embedded resources. Fixes
7477 2004-11-04 Raja R Harinath <rharinath@novell.com>
7479 Fix error message regression: cs0104-2.cs.
7480 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7481 (AliasEntry.Resolve): Update.
7482 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
7484 (RootContext.LookupType): Update.
7486 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
7488 * cs-parser.jay: Add support for handling accessor modifiers
7489 * class: Add support port accessor modifiers and error checking,
7490 define PropertyMethod.Define as virtual (not abstract anymore)
7491 * ecore.cs: Add checking for proeprties access with access modifiers
7492 * iterators.cs: Modify Accessor constructor call based in the modified
7494 2004-11-02 Ben Maurer <bmaurer@ximian.com>
7496 * expression.cs (StringConcat): Handle being called twice,
7497 as when we have a concat in a field init with more than two
7500 2004-11-02 Miguel de Icaza <miguel@ximian.com>
7502 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7503 special case explicit implementations, we should always produce
7504 the .property or .event declaration.
7506 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7507 since it will not return correct data if people use this
7508 unresolved in the presence of using statements (see test-313).
7510 * class.cs (MethodData.Define): If we are an explicit interface
7511 implementation, set the method name to the full name of the
7512 interface plus the name of the method.
7514 Notice that using the method.MethodName.GetFullName() does not
7515 work, as it will only contain the name as declared on the source
7516 file (it can be a shorthand in the presence of using statements)
7517 and not the fully qualifed type name, for example:
7521 class D : ICloneable {
7522 object ICloneable.Clone () {
7526 Would produce a method called `ICloneable.Clone' instead of
7527 `System.ICloneable.Clone'.
7529 * namespace.cs (Alias.Resolve): Use GetPartialName.
7531 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7533 * cs-parser.jay: Add error 1055 report.
7535 2004-11-01 Miguel de Icaza <miguel@ximian.com>
7537 * assign.cs (Assign.DoResolve): Only do the transform of
7538 assignment into a New if the types are compatible, if not, fall
7539 through and let the implicit code deal with the errors and with
7540 the necessary conversions.
7542 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7544 * cs-parser.jay: Add error 1031 report.
7546 * cs-tokenizer.cs: Add location for error 1038.
7548 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7550 * cs-parser.jay: Add error 1016 report.
7552 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7554 * cs-parser.jay: Add errors 1575,1611 report.
7556 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7558 * cs-parser.jay: Add error 1001 report.
7560 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7563 * attribute.cs (GetMarshal): Add method argument for
7564 caller identification.
7566 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7567 agument for GetMarshal and RuntimeMissingSupport.
7569 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7571 * attribute.cs (ExtractSecurityPermissionSet): Removed
7572 TypeManager.code_access_permission_type.
7574 * typemanager.cs: Removed TypeManager.code_access_permission_type.
7576 2004-10-27 Miguel de Icaza <miguel@ximian.com>
7578 * expression.cs (LocalVariableReference.DoResolveLValue): Check
7579 for obsolete use of a variable here. Fixes regression on errors
7580 cs0619-25 and cs0619-26.
7582 2004-10-27 Marek Safar <marek.safar@seznam.cz>
7584 Fix #62358, implemented security attribute encoding.
7586 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7587 Tests permitted SecurityAction for assembly or other types.
7588 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7589 data from SecurityPermissionAttribute to PermisionSet class.
7591 * class.cs (ApplyAttributeBuilder): Added special handling
7592 for System.Security.Permissions.SecurityAttribute based types.
7594 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7595 special handling for System.Security.Permissions.SecurityAttribute
7598 * enum.cs (ApplyAttributeBuilder): Added special handling
7599 for System.Security.Permissions.SecurityAttribute based types.
7601 * parameter.cs (ApplyAttributeBuilder): Added special handling
7602 for System.Security.Permissions.SecurityAttribute based types.
7604 * rootcontext.cs: Next 2 core types.
7606 * typemanager.cs (TypeManager.security_permission_attr_type):
7607 Built in type for the SecurityPermission Attribute.
7608 (code_access_permission_type): Build in type.
7610 2004-10-17 Miguel de Icaza <miguel@ximian.com>
7612 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7613 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7614 all of this information into
7615 EmitContext.EmitCapturedVariableInstance.
7617 * codegen.cs (EmitCapturedVariableInstance): move here the
7618 funcionality of emitting an ldarg.0 in the presence of a
7619 remapping. This centralizes the instance emit code.
7621 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7622 then emit a load of this: it means that we have reached the
7623 topmost ScopeInfo: the one that contains the pointer to the
7624 instance of the class hosting the anonymous method.
7626 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7627 captures to the topmost CaptureContext.
7629 2004-10-12 Miguel de Icaza <miguel@ximian.com>
7631 * expression.cs (LocalVariableReference): Move the knowledge about
7632 the iterators into codegen's EmitCapturedVariableInstance.
7634 2004-10-11 Miguel de Icaza <miguel@ximian.com>
7636 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7637 all code paths return a value from an anonymous method (it is the
7638 same as the 161 error, but for anonymous methods).
7640 2004-10-08 Miguel de Icaza <miguel@ximian.com>
7642 The introduction of anonymous methods in the compiler changed
7643 various ways of doing things in the compiler. The most
7644 significant one is the hard split between the resolution phase
7645 and the emission phases of the compiler.
7647 For instance, routines that referenced local variables no
7648 longer can safely create temporary variables during the
7649 resolution phase: they must do so from the emission phase,
7650 since the variable might have been "captured", hence access to
7651 it can not be done with the local-variable operations from the runtime.
7655 (Block.Flags): New flag `IsTopLevel' to indicate that this block
7656 is a toplevel block.
7658 (ToplevelBlock): A new kind of Block, these are the blocks that
7659 are created by the parser for all toplevel method bodies. These
7660 include methods, accessors and anonymous methods.
7662 These contain some extra information not found in regular blocks:
7663 A pointer to an optional CaptureContext (for tracking captured
7664 local variables and parameters). A pointer to the parent
7667 (Return.Resolve): Catch missmatches when returning a value from an
7668 anonymous method (error 1662).
7669 Invoke NeedReturnLabel from the Resolve phase instead of the emit
7672 (Break.Resolve): ditto.
7674 (SwitchLabel): instead of defining the labels during the
7675 resolution phase, we now turned the public ILLabel and ILLabelCode
7676 labels into methods called GetILLabelCode() and GetILLabel() that
7677 only define the label during the Emit phase.
7679 (GotoCase): Track the SwitchLabel instead of the computed label
7680 (its contained therein). Emit the code by using
7681 SwitchLabel.GetILLabelCode ().
7683 (LocalInfo.Flags.Captured): A new flag has been introduce to track
7684 whether the Local has been captured or not.
7686 (LocalInfo.IsCaptured): New property, used to tell whether the
7687 local has been captured.
7689 * anonymous.cs: Vastly updated to contain the anonymous method
7692 The main classes here are: CaptureContext which tracks any
7693 captured information for a toplevel block and ScopeInfo used to
7694 track the activation frames for various local variables.
7696 Each toplevel block has an optional capture context associated
7697 with it. When a method contains an anonymous method both the
7698 toplevel method and the anonymous method will create a capture
7699 context. When variables or parameters are captured, they are
7700 recorded on the CaptureContext that owns them, for example:
7704 MyDelegate d = delegate {
7709 Here `a' will be recorded as captured on the toplevel
7710 CapturedContext, the inner captured context will not have anything
7711 (it will only have data if local variables or parameters from it
7712 are captured in a nested anonymous method.
7714 The ScopeInfo is used to track the activation frames for local
7715 variables, for example:
7717 for (int i = 0; i < 10; i++)
7718 for (int j = 0; j < 10; j++){
7719 MyDelegate d = delegate {
7724 At runtime this captures a single captured variable `i', but it
7725 captures 10 different versions of the variable `j'. The variable
7726 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7727 recorded on a child.
7729 The toplevel ScopeInfo will also track information like the `this'
7730 pointer if instance variables were referenced (this is necessary
7731 as the anonymous method lives inside a nested class in the host
7732 type of the method).
7734 (AnonymousMethod): Expanded to track the Toplevel, implement
7735 `AnonymousMethod.Compatible' to tell whether an anonymous method
7736 can be converted to a target delegate type.
7738 The routine now also produces the anonymous method content
7740 (AnonymousDelegate): A helper class that derives from
7741 DelegateCreation, this is used to generate the code necessary to
7742 produce the delegate for the anonymous method that was created.
7744 * assign.cs: API adjustments for new changes in
7745 Convert.ImplicitStandardConversionExists.
7747 * class.cs: Adjustments to cope with the fact that now toplevel
7748 blocks are of type `ToplevelBlock'.
7750 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7751 insteda of standard blocks.
7753 Flag errors if params arguments are passed to anonymous methods.
7755 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7756 `CurrentAnonymousMethod' which points to the current Anonymous
7757 Method. The variable points to the AnonymousMethod class that
7758 holds the code being compiled. It is set in the new EmitContext
7759 created for the anonymous method.
7761 (EmitContext.Phase): Introduce a variable and an enumeration to
7762 assist in enforcing some rules about when and where we are allowed
7763 to invoke certain methods (EmitContext.NeedsReturnLabel is the
7764 only one that enfonces this right now).
7766 (EmitContext.HaveCaptureInfo): new helper method that returns
7767 whether we have a CapturedContext initialized.
7769 (EmitContext.CaptureVariable): New method used to register that a
7770 LocalInfo must be flagged for capturing.
7772 (EmitContext.CapturedParameter): New method used to register that a
7773 parameters must be flagged for capturing.
7775 (EmitContext.CapturedField): New method used to register that a
7776 field must be flagged for capturing.
7778 (EmitContext.HaveCapturedVariables,
7779 EmitContext.HaveCapturedFields): Return whether there are captured
7780 variables or fields.
7782 (EmitContext.EmitMethodHostInstance): This is used to emit the
7783 instance for the anonymous method. The instance might be null
7784 (static methods), this (for anonymous methods that capture nothing
7785 and happen to live side-by-side with the current method body) or a
7786 more complicated expression if the method has a CaptureContext.
7788 (EmitContext.EmitTopBlock): Routine that drives the emission of
7789 code: it will first resolve the top block, then emit any metadata
7790 and then emit the code. The split is done so that we can extract
7791 any anonymous methods and flag any captured variables/parameters.
7793 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7794 during this phase, the ILGenerator should not be used as labels
7795 and local variables declared here might not be accessible to any
7796 code that is part of an anonymous method.
7798 Exceptions to this include the temporary variables that are
7799 created by some statements internally for holding temporary
7802 (EmitContext.EmitMeta): New routine, in charge of emitting all the
7805 (EmitContext.TemporaryReturn): This method is typically called
7806 from the Emit phase, and its the only place where we allow the
7807 ReturnLabel to be defined other than the EmitMeta. The reason is
7808 that otherwise we would have to duplicate a lot of logic in the
7809 Resolve phases of various methods that today is on the Emit
7812 (EmitContext.NeedReturnLabel): This no longer creates the label,
7813 as the ILGenerator is not valid during the resolve phase.
7815 (EmitContext.EmitThis): Extended the knowledge in this class to
7816 work in anonymous methods in addition to iterators.
7818 (EmitContext.EmitCapturedVariableInstance): This emits whatever
7819 code is necessary on the stack to access the instance to a local
7820 variable (the variable will be accessed as a field).
7822 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7823 EmitContext.EmitAddressOfParameter): Routines to support
7824 parameters (not completed at this point).
7826 Removals: Removed RemapLocal and RemapLocalLValue. We probably
7827 will also remove the parameters.
7829 * convert.cs (Convert): Define a `ConstantEC' which points to a
7830 null. This is just to prefity some code that uses
7831 ImplicitStandardConversion code and do not have an EmitContext
7834 The idea is to flag explicitly that at that point in time, it is
7835 known that the conversion will not trigger the delegate checking
7836 code in implicit conversions (which requires a valid
7839 Everywhere: pass new EmitContext parameter since
7840 ImplicitStandardConversionExists now requires it to check for
7841 anonymous method conversions.
7843 (Convert.ImplicitStandardConversionExists): If the type of an
7844 expression is the anonymous_method_type, and the type is a
7845 delegate, we invoke the AnonymousMethod.Compatible method to check
7846 whether an implicit conversion is possible.
7848 (Convert.ImplicitConversionStandard): Only do implicit method
7849 group conversions if the language level is not ISO_1.
7851 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7852 MethodInfo for the Invoke method. used by Delegate and
7855 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7856 method conversions if the target type is a delegate.
7858 Removed extra debugging nops.
7860 (LocalVariableReference): Turn the `local_info' into a public
7863 Add `prepared' field, the same hack used for FieldExprs to cope
7864 with composed assignments, as Local variables do not necessarily
7865 operate purely on the stack as they used to: they can be captured
7868 Add `temp' for a temporary result, like fields.
7870 Refactor DoResolve and DoResolveLValue into DoResolveBase.
7872 It now copes with Local variables that are captured and emits the
7873 proper instance variable to load it from a field in the captured
7876 (ParameterReference.DoResolveBase): During the resolve phase,
7877 capture parameters if we are in an anonymous method.
7879 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7880 anonymous method, use the EmitContext helper routines to emit the
7881 parameter reference.
7883 * iterators.cs: Set RemapToProxy to true/false during the
7886 * parameters.cs (GetParameterByName): New helper method.
7888 * typemanager.cs (anonymous_method_type) a new type that
7889 represents an anonyous method. This is always an internal type,
7890 used as a fencepost to test against the anonymous-methodness of an
7893 2004-10-20 Marek Safar <marek.safar@seznam.cz>
7895 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7897 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7899 2004-10-18 Martin Baulig <martin@ximian.com>
7901 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7902 `Type' directly, but call ResolveType() on it.
7903 (Catch.Resolve): Likewise.
7904 (Foreach.Resolve): Likewise.
7906 2004-10-18 Martin Baulig <martin@ximian.com>
7908 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7909 `Type' directly, but call ResolveType() on it.
7910 (Probe.DoResolve): Likewise.
7911 (ArrayCreation.LookupType): Likewise.
7912 (TypeOf.DoResolve): Likewise.
7913 (SizeOf.DoResolve): Likewise.
7915 2004-10-18 Martin Baulig <martin@ximian.com>
7917 * expression.cs (Invocation.BetterFunction): Put back
7918 TypeManager.TypeToCoreType().
7920 2004-10-18 Raja R Harinath <rharinath@novell.com>
7922 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7925 2004-10-18 Martin Baulig <martin@ximian.com>
7927 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
7928 `Type' directly, but call ResolveType() on it.
7930 2004-10-18 Martin Baulig <martin@ximian.com>
7932 * class.cs (FieldMember.Define): Don't access the TypeExpr's
7933 `Type' directly, but call ResolveType() on it.
7934 (MemberBase.DoDefine): Likewise.
7936 * expression.cs (New.DoResolve): Don't access the TypeExpr's
7937 `Type' directly, but call ResolveType() on it.
7938 (ComposedCast.DoResolveAsTypeStep): Likewise.
7940 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7941 `Type' directly, but call ResolveType() on it.
7943 2004-10-17 John Luke <john.luke@gmail.com>
7945 * class.cs (Operator.GetSignatureForError): use CSharpName
7947 * parameter.cs (Parameter.GetSignatureForError): Returns
7948 correct name even if was not defined.
7950 2004-10-13 Raja R Harinath <rharinath@novell.com>
7953 * class.cs (TypeContainer.EmitContext): New property.
7954 (DefineNestedTypes): Create an emitcontext for each part.
7955 (MethodCore.DoDefineParameters): Use container's emitcontext.
7956 Pass type array to InternalParameters.
7957 (MemberBase.DoDefine): Use container's emitcontext.
7958 (FieldMember.Define): Likewise.
7959 (Event.Define): Likewise.
7960 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7961 Pass type array to InternalParameters.
7962 (SetIndexerMethod.GetParameterInfo): Likewise.
7963 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7964 * delegate.cs (Define): Pass emitcontext to
7965 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7966 array to InternalParameters.
7967 * expression.cs (ParameterReference.DoResolveBase): Pass
7968 emitcontext to GetParameterInfo.
7969 (ComposedCast.DoResolveAsTypeStep): Remove check on
7970 ec.ResolvingTypeTree.
7971 * parameter.cs (Parameter.Resolve): Change argument to
7972 EmitContext. Use ResolveAsTypeTerminal.
7973 (Parameter.GetSignature): Change argument to EmitContext.
7974 (Parameters.ComputeSignature): Likewise.
7975 (Parameters.ComputeParameterTypes): Likewise.
7976 (Parameters.GetParameterInfo): Likewise.
7977 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7978 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7979 * support.cs (InternalParameters..ctor): Remove variant that takes
7981 * typemanager.cs (system_intptr_expr): New.
7982 (InitExpressionTypes): Initialize it.
7984 2004-10-12 Chris Toshok <toshok@ximian.com>
7986 * cs-parser.jay: fix location for try_statement and catch_clause.
7988 2004-10-11 Martin Baulig <martin@ximian.com>
7990 * report.cs: Don't make --fatal abort on warnings, we have
7991 -warnaserror for that.
7993 2004-10-07 Raja R Harinath <rharinath@novell.com>
7995 More DeclSpace.ResolveType avoidance.
7996 * decl.cs (MemberCore.InUnsafe): New property.
7997 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7998 with newly created EmitContext.
7999 (FieldMember.Define): Likewise.
8000 * delegate.cs (Delegate.Define): Likewise.
8001 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8002 only if normal name-lookup fails.
8003 (TypeExpr.DoResolve): Enable error-checking.
8004 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8005 (SizeOf.DoResolve): Likewise.
8006 (ComposedCast.DoResolveAsTypeStep): Likewise.
8007 (StackAlloc.DoResolve): Likewise.
8008 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8009 (Block.Unsafe): New property.
8010 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8011 (Unsafe): Set 'unsafe' flag of contained block.
8012 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8013 (Fixed.Resolve): Likewise.
8014 (Catch.Resolve): Likewise.
8015 (Using.ResolveLocalVariableDecls): Likewise.
8016 (Foreach.Resolve): Likewise.
8018 2004-10-05 John Luke <john.luke@gmail.com>
8020 * cs-parser.jay: add location to error CS0175
8022 2004-10-04 Miguel de Icaza <miguel@ximian.com>
8024 * ecore.cs (Expression.Constantity): Add support for turning null
8027 * const.cs (Const.Define): Allow constants to be reference types
8028 as long as the value is Null.
8030 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
8032 * namespace.cs (NamespaceEntry.Using): No matter which warning
8033 level is set, check if this namespace name has already been added.
8035 2004-10-03 Ben Maurer <bmaurer@ximian.com>
8037 * expression.cs: reftype [!=]= null should always use br[true,false].
8040 2004-10-03 Marek Safar <marek.safar@seznam.cz>
8043 * attribute.cs: Enum conversion moved to
8044 GetAttributeArgumentExpression to be applied to the all
8047 2004-10-01 Raja R Harinath <rharinath@novell.com>
8049 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8050 * class.c (TypeContainer.DefineType): Flag error if
8051 base types aren't accessible due to access permissions.
8052 * decl.cs (DeclSpace.ResolveType): Move logic to
8053 Expression.ResolveAsTypeTerminal.
8054 (DeclSpace.ResolveTypeExpr): Thin layer over
8055 Expression.ResolveAsTypeTerminal.
8056 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8057 Refactor code into NestedAccess. Use it.
8058 (DeclSpace.NestedAccess): New.
8059 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8060 argument to silence errors. Check access permissions.
8061 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8062 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8063 (Cast.DoResolve): Likewise.
8064 (New.DoResolve): Likewise.
8065 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8066 (TypeOf.DoResolve): Likewise.
8068 * expression.cs (Invocation.BetterConversion): Return the Type of
8069 the better conversion. Implement section 14.4.2.3 more faithfully.
8070 (Invocation.BetterFunction): Make boolean. Make correspondence to
8071 section 14.4.2.2 explicit.
8072 (Invocation.OverloadResolve): Update.
8073 (Invocation): Remove is_base field.
8074 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
8075 (Invocation.Emit): Likewise.
8077 2004-09-27 Raja R Harinath <rharinath@novell.com>
8079 * README: Update to changes.
8081 2004-09-24 Marek Safar <marek.safar@seznam.cz>
8083 * cs-parser.jay: Reverted 642 warning fix.
8085 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8088 * decl.cs (FindMemberWithSameName): Indexer can have more than
8091 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8093 * expression.cs (LocalVariableReference.DoResolveLValue):
8094 Do not report warning 219 for out values.
8095 (EmptyExpression.Null): New member to avoid extra allocations.
8097 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8099 * cs-parser.jay: Fix wrong warning 642 report.
8101 * cs-tokenizer.cs (CheckNextToken): New helper;
8102 Inspect next character if is same as expected.
8104 2004-09-23 Martin Baulig <martin@ximian.com>
8106 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8107 (Convert.ImplicitReferenceConversionExists): Likewise.
8109 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8111 * class.cs (Operator.Define): Add error 448 and 559 report.
8113 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8115 * class.cs (MemberBase.IsTypePermitted): New protected
8116 method for checking error CS0610.
8118 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8120 * class.cs (TypeContainer.HasExplicitLayout): New property
8121 Returns whether container has StructLayout attribute set Explicit.
8122 (FieldMember): New abstract class for consts and fields.
8123 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8124 (Field): Reuse FieldMember.
8126 * const.cs (Const): Reuse FieldMember.
8128 * rootcontext.cs: EmitConstants call moved to class.
8130 2004-09-22 Martin Baulig <martin@ximian.com>
8132 Thanks to Peter Sestoft for this bug report.
8134 * expression.cs (Conditional): If both the `trueExpr' and the
8135 `falseExpr' is a NullLiteral, return a NullLiteral.
8137 2004-09-22 Martin Baulig <martin@ximian.com>
8139 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8140 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8141 for the "get_Current" call.
8143 2004-09-22 Martin Baulig <martin@ximian.com>
8145 Marek and me just fixed one of our oldest bugs: #28562 :-)
8147 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8149 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8150 we're an EnumConstant, just return that.
8151 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8152 an EnumConstant. In this case, we need to use GetValueAsEnumType()
8153 to get the value which'll actually be written into the attribute.
8154 However, we have to use GetValue() to access the attribute's value
8157 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8159 * constant.cs (Constant.IsNegative): New abstract property
8162 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8163 (StackAlloc.DoResolve): Reused IsNegative.
8165 2004-09-21 Martin Baulig <martin@ximian.com>
8167 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
8168 if we're used in an iterator, we may be called from different
8171 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
8172 we actually have an exception block.
8174 2004-09-20 John Luke <jluke@cfl.rr.com>
8176 * class.cs, cs-parser.jay: Improve the error report for 1520:
8177 report the actual line where the error happens, not where the
8180 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
8181 Pass location information that was available elsewhere.
8183 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
8185 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
8186 runtime to delay sign assemblies.
8188 2004-09-19 Miguel de Icaza <miguel@ximian.com>
8190 * cs-parser.jay: Do not report the stack trace, this is barely
8193 2004-08-22 John Luke <john.luke@gmail.com>
8195 * driver.cs : check that a resource id is not already used
8196 before adding it, report CS1508 if it is, bug #63637
8198 2004-09-19 Miguel de Icaza <miguel@ximian.com>
8200 * ecore.cs: Removed dead code.
8202 2004-09-18 Marek Safar <marek.safar@seznam.cz>
8204 * class.cs: Do not report warning CS0067 on the interfaces.
8206 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8208 * cs-parser.jay: Add error 504 report.
8210 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8212 * rootcontext.cs: WarningLevel is 4 by default now.
8214 * statement.cs (Fixed.Resolve): Do not null
8217 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8220 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
8221 deep search when property is not virtual.
8222 (PropertyExpr.ResolveAccessors): Make one call for both
8225 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8228 * statement.cs: Error 152 report constains also location.
8230 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8233 * const.cs: Explicitly set constant as static.
8235 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8238 * cs-parser.jay: Add error 1017 report.
8240 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8242 Fixed bug #59980, #64224
8243 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
8245 * typemanager.cs (IsSpecialMethod): Simplified
8247 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8249 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
8250 condition with better params.
8252 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8255 * attribute.cs (Resolve): Property has to have both
8258 2004-09-14 Martin Baulig <martin@ximian.com>
8260 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8262 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8265 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8266 called and is obsolete then this member suppress message
8267 when call is inside next [Obsolete] method or type.
8269 * expression.cs: Use TestObsoleteMethodUsage member.
8271 2004-09-14 Martin Baulig <martin@ximian.com>
8273 * cs-parser.jay: Sync a bit with the GMCS version.
8275 2004-09-14 Martin Baulig <martin@ximian.com>
8277 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
8278 (CSharpParser.yacc_verbose_flag): New public field.
8280 * genericparser.cs: Removed.
8282 2004-09-14 Raja R Harinath <rharinath@novell.com>
8284 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
8286 2004-09-13 Marek Safar <marek.safar@seznam.cz>
8288 * class.cs (MethodCore.CheckBase): Fix bug #65757.
8290 2004-09-10 Martin Baulig <martin@ximian.com>
8292 Backported my MemberName changes from GMCS into MCS.
8294 - we are now using a special `MemberName' class instead of using
8295 strings; in GMCS, the `MemberName' also contains the type
8298 - changed the grammar rules a bit:
8299 * the old `member_name' is now a `namespace_or_type_name':
8300 The rule is that we use `namespace_or_type_name' everywhere
8301 where we expect either a "member name" (GetEnumerator) or a
8302 "member name" with an explicit interface name
8303 (IEnumerable.GetEnumerator).
8304 In GMCS, the explicit interface name may include type arguments
8305 (IEnumerable<T>.GetEnumerator).
8306 * we use `member_name' instead of just `IDENTIFIER' for
8308 The rule is that we use `member_name' wherever a member may
8309 have type parameters in GMCS.
8311 * decl.cs (MemberName): New public class.
8312 (MemberCore.MemberName): New public readonly field.
8313 (MemberCore.ctor): Take a `MemberName' argument, not a string.
8314 (DeclSpace): Likewise.
8316 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
8317 * enum.cs (Enum.ctor): Likewise.
8319 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
8321 (AliasEntry.ctor): Take a MemberName, not an Expression.
8322 (AliasEntry.UsingAlias): Likewise.
8324 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
8325 (IMethodData.MemberName): Changed type from string to MemberName.
8326 (MemberBase.ExplicitInterfaceName): Likewise.
8327 (AbstractPropertyEventMethod.SetupName): Make this private.
8328 (AbstractPropertyEventMethod.ctor): Added `string prefix'
8329 argument; compute the member name here.
8330 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
8331 on the `member.MemberName' and the `prefix'.
8333 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
8335 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
8336 thus, we get a `MemberName' instead of a `string'. These
8337 declarations may have type parameters in GMCS.
8338 (interface_method_declaration, delegate_declaration): Likewise.
8339 (class_declaration, interface_declaration): Likewise.
8340 (method_header): Use `namespace_or_type_name' instead of
8341 `member_name'. We may be an explicit interface implementation.
8342 (property_declaration, event_declaration): Likewise.
8343 (member_name): This is now just an `IDENTIFIER', not a
8344 `namespace_or_type_name'.
8345 (type_name, interface_type): Removed.
8346 (namespace_or_type_name): Return a MemberName, not an Expression.
8347 (primary_expression): Use `member_name' instead of `IDENTIFIER';
8348 call GetTypeExpression() on the MemberName to get an expression.
8349 (IndexerDeclaration.interface_type): Changed type from string to
8351 (MakeName): Operate on MemberName's instead of string's.
8353 2004-09-13 Raja R Harinath <rharinath@novell.com>
8356 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
8357 (NamespaceEntry.Lookup): Add new argument to flag if we want the
8358 lookup to avoid symbols introduced by 'using'.
8359 * rootcontext.cs (NamespaceLookup): Update.
8361 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8363 * class.cs (TypeContainer.DoDefineMembers): Do not call
8364 DefineDefaultConstructor for static classes.
8366 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8368 * attribute.cs (Attribute.Resolve): Add error 653 report.
8370 * class.cs (Class.ApplyAttributeBuilder): Add error 641
8372 (Method.ApplyAttributeBuilder): Add error 685 report.
8373 (Operator.Define): Add error 564 report.
8375 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8377 * expression.cs (Invocation.DoResolve): Add error
8380 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8383 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8385 * class.cs (ConstructorInitializer.Resolve):
8386 Wrong error number (515->516).
8388 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8390 * class.cs (Indexer.Define): Add error 631 report.
8392 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8394 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8396 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8398 * expression.cs (Probe.DoResolve): Add error CS0241 report.
8400 2004-09-10 Marek Safar <marek.safar@seznam.cz>
8402 * cs-parser.jay: Added error CS0241 report.
8404 2004-09-10 Raja R Harinath <rharinath@novell.com>
8406 * cs-parser.jay (fixed_statement): Introduce a scope for the
8407 declaration in the 'fixed' statement.
8409 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8411 * cs-parser.jay: Added CS0230 error report.
8413 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8415 * cs-parser.jay: Added errors CS0231 and CS0257 report.
8417 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8419 * expression.cs (Argument.Resolve): Added error CS0192 and
8422 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8424 C# 2.0 #pragma warning feature
8426 * cs-tokenizer.cs (PreProcessPragma): New method;
8427 Handles #pragma directive.
8429 * report.cs (WarningRegions): New class; Support
8430 class for #pragma warning directive. It tests whether
8431 warning is enabled for a given line.
8433 2004-09-08 Miguel de Icaza <miguel@ximian.com>
8435 * const.cs: Add more descriptive error report, tahnks to
8438 2004-09-08 Marek Safar <marek.safar@seznam.cz>
8440 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8442 2004-09-07 Miguel de Icaza <miguel@ximian.com>
8444 * expression.cs: Apply patch from Ben: Remove dead code from
8445 ArrayCreation, and remove the TurnintoConstant call in const.cs,
8446 as that code just threw an exception anwyays.
8448 * const.cs: Remove the call to the turnintoconstant, for details
8451 * literal.cs: The type of the null-literal is the null type; So
8452 we use a placeholder type (literal.cs:System.Null, defined here)
8455 * expression.cs (Conditional.DoResolve): Remove some old code that
8456 is no longer needed, conversions have been fixed.
8458 (ArrayCreationExpression.DoResolve): Return false if we fail to
8459 resolve the inner expression.
8461 2004-09-07 Raja R Harinath <rharinath@novell.com>
8464 * cs-parser.jay (delegate_declaration): Record a delegate
8465 declaration as a type declaration.
8466 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8468 2004-09-06 Miguel de Icaza <miguel@ximian.com>
8470 * parameter.cs: Do not crash if the type can not be resolved.
8472 * expression.cs: Report errors with unsafe pointers, fixes #64896
8474 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
8476 * expression.cs: Pointer arith always needs to do a conv.i
8477 if the operand is a long. fix 65320
8479 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8481 Fixed cs0619-37.cs, cs0619-38.cs
8483 * enum.cs (GetObsoleteAttribute): Removed.
8485 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8486 on Enum member is double staged. The first is tested member
8489 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8491 Fixed #56986, #63631, #65231
8493 * class.cs: (TypeContainer.AddToMemberContainer): New method,
8494 adds member to name container.
8495 (TypeContainer.AddToTypeContainer): New method, adds type to
8497 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8498 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8499 AddOperator): Simplified by reusing AddToMemberContainer.
8500 (TypeContainer.UserDefinedStaticConstructor): Changed to property
8502 (Method.CheckForDuplications): Fixed implementation to test all
8504 (MemberBase): Detection whether member is explicit interface
8505 implementation is now in constructor.
8506 (MemberBase.UpdateMemberName): Handles IndexerName.
8507 (Accessor): Changed to keep also location information.
8508 (AbstractPropertyEventMethod): Is derived from MemberCore.
8509 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8510 will be emited or not.
8511 (PropertyBase.AreAccessorsDuplicateImplementation):
8512 Tests whether accessors are not in collision with some method.
8513 (Operator): Is derived from MethodCore to simplify common
8516 * decl.cs (Flags.TestMethodDuplication): Test for duplication
8518 (DeclSpace.AddToContainer): Adds the member to defined_names
8519 table. It tests for duplications and enclosing name conflicts.
8521 * enum.cs (EnumMember): Clean up to reuse the base structures
8523 2004-09-03 Martin Baulig <martin@ximian.com>
8525 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8526 into TypeContainer, to make partial classes work again.
8528 2004-09-03 Martin Baulig <martin@ximian.com>
8530 * rootcontext.cs (RootContext.V2): Removed.
8532 2004-03-23 Martin Baulig <martin@ximian.com>
8534 * expression.cs (Invocation.OverloadResolve): Added `bool
8535 may_fail' argument and use it instead of the Location.IsNull() hack.
8537 2004-09-03 Martin Baulig <martin@ximian.com>
8539 Merged latest changes into gmcs. Please keep this comment in
8540 here, it makes it easier for me to see what changed in MCS since
8541 the last time I merged.
8543 2004-09-03 Raja R Harinath <rharinath@novell.com>
8546 * expression.cs (BetterConversion): Don't allow either conversion
8547 to be null. Remove redundant implicit conversion test when 'q ==
8548 null' -- when this function is invoked, we already know that the
8549 implicit conversion exists.
8550 (BetterFunction): Assume that 'best' is non-null. Remove
8551 redundant reimplementation of IsApplicable when 'best' is null.
8552 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8553 number of arguments.
8554 (IsAncestralType): Extract from OverloadResolve.
8555 (OverloadResolve): Make robust to the MethodGroupExpr being
8556 unsorted. Implement all the logic of Section 14.5.5.1, and
8557 support overloading of methods from multiple applicable types.
8558 Clean up logic somewhat. Don't pass null methods to BetterFunction.
8560 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8561 (RealError, Warning): Append type of report to related symbol.
8563 2004-09-03 Marek Safar <marek.safar@seznam.cz>
8565 * enum.cs: Fixed CLS-Compliance checks for enum members.
8566 Error tests cs3008-8.cs, cs3014-8.cs
8568 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8570 Fixed bug #62342, #63102
8571 * class.cs: ImplementIndexer uses member.IsExplicitImpl
8572 like ImplementMethod.
8574 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8576 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8579 2004-09-02 Martin Baulig <martin@ximian.com>
8581 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8582 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8585 2004-09-01 Marek Safar <marek.safar@seznam.cz>
8587 C# 2.0 Static classes implemented
8589 * class.cs (TypeContainer): instance_constructors,
8590 initialized_fields, initialized_static_fields,
8591 default_constructor, base_inteface_types are protected to be
8592 accessible from StaticClass.
8593 (TypeContainer.DefineDefaultConstructor): New virtual method
8594 for custom default constructor generating
8595 (StaticClass): New class to handle "Static classes" feature.
8597 * cs-parser.jay: Handle static keyword on class like instance
8600 * driver.cs: Added "/langversion" command line switch with two
8601 options (iso-1, default).
8603 2004-08-31 Marek Safar <marek.safar@seznam.cz>
8605 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8607 2004-08-31 Miguel de Icaza <miguel@ximian.com>
8609 * delegate.cs: Style.
8611 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
8613 * delegate.cs: Add seperate instance expr field for miguel.
8615 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8617 * PointerArithmetic (Resolve): make sure we are not doing
8618 pointer arith on void*. Also, make sure we are resolved
8619 by not setting eclass until resolve.
8621 All callers: Make sure that PointerArithmetic gets resolved.
8623 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8625 * ArrayCreation (LookupType): If the type does not resolve
8626 to an array, give an error.
8628 2004-08-27 Marek Safar <marek.safar@seznam.cz>
8630 * statement.cs (Try.Resolve): Fixed bug #64222
8632 2004-08-27 Martin Baulig <martin@ximian.com>
8635 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8638 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8640 * ecore.cs (Constantify): Get underlying type via
8641 System.Enum.GetUnderlyingType to avoid StackOverflow on the
8642 Windows in special cases.
8644 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8646 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8647 for obtaining also private methods.
8648 (GetRemoveMethod): Used GetRemoveMethod (true)
8649 for obtaining also private methods.
8651 2004-08-24 Martin Baulig <martin@ximian.com>
8653 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8654 MethodAttributes.HideBySig for operators.
8656 2004-08-23 Martin Baulig <martin@ximian.com>
8658 Back to the old error reporting system :-)
8660 * report.cs (Message): Removed.
8661 (Report.MessageData, ErrorData, WarningData): Removed.
8662 (Report.Error, Warning): Back to the old system.
8664 2004-08-23 Martin Baulig <martin@ximian.com>
8666 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8668 * class.cs (TypeContainer.ParentContainer): New public virtual
8669 method; replaces the explicit interface implementation.
8670 (ClassPart.ParentContainer): Override.
8672 2004-08-23 Martin Baulig <martin@ximian.com>
8674 * statement.cs (Switch): Added support for constant switches; see
8675 #59428 or test-285.cs.
8677 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8680 * statement.cs (GetEnumeratorFilter): Removed useless
8681 logic because C# specs is strict. GetEnumerator must be
8684 2004-08-22 Martin Baulig <martin@ximian.com>
8686 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8687 a switch and may break, reset the barrier. Fixes #59867.
8689 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8691 CLS-Compliance speed up (~5% for corlib)
8693 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8694 New method. Tests container for CLS-Compliant names
8696 * class.cs (TypeContainer.VerifyClsName): New method.
8697 Checks whether container name is CLS Compliant.
8698 (Constructor): Implements IMethodData.
8700 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8701 low-case table for CLS Compliance test.
8702 (MemberCache.VerifyClsParameterConflict): New method.
8703 Checks method parameters for CS3006 error.
8705 * enum.cs (EnumMember): Is derived from MemberCore.
8706 (Enum.VerifyClsName): Optimized for better performance.
8708 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8710 * report.cs: Renamed Error_T to Error and changed all
8713 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8715 * class.cs (TypeContainer.IndexerArrayList): New inner class
8716 container for indexers.
8717 (TypeContainer.DefaultIndexerName): New constant for default
8718 indexer name. Replaced all "Item" with this constant.
8719 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8721 * typemanager.cs (TypeManager.default_member_ctor): Cache here
8722 DefaultMemberAttribute constructor.
8724 2004-08-05 Martin Baulig <martin@ximian.com>
8726 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8729 2004-08-05 Marek Safar <marek.safar@seznam.cz>
8731 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8732 multi platforms problem.
8734 * compiler.csproj: Included shared files.
8736 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8738 Fix bug 60333, 55971 in the more general way
8739 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8740 Added arg_type argument for constant conversion.
8741 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8743 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8746 * class.cs (TypeContainer ): New inner classes MethodArrayList,
8747 OperatorArrayList, MethodCoreArrayList for typecontainer
8748 containers. Changed class member types to these new types.
8749 (MethodArrayList.DefineMembers): Added test for CS0659.
8751 2004-08-04 Miguel de Icaza <miguel@ximian.com>
8753 * cfold.cs: Synchronize the folding with the code in expression.cs
8754 Binary.DoNumericPromotions for uint operands.
8756 * attribute.cs: Revert patch from Raja, it introduced a regression
8757 while building Blam-1.2.1 (hard to isolate a test case).
8759 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8763 (TypeContainer.Define): Renamed to DefineContainerMembers because of
8765 (MethodCore.parent_method): New member. The method we're overriding
8766 if this is an override method.
8767 (MethodCore.CheckBase): Moved from Method class and made common.
8768 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8770 (MethodCore.CheckForDuplications): New abstract method. For custom
8771 member duplication search in a container
8772 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8773 method and its return type.
8774 (Event.conflict_symbol): New member. Symbol with same name in the
8778 (MemberCache.FindMemberWithSameName): New method. The method
8779 is looking for conflict with inherited symbols.
8781 2004-08-04 Martin Baulig <martin@ximian.com>
8783 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8785 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8787 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8789 * report.cs (Message): New enum for better error, warning reference in
8791 (MessageData): New inner abstract class. It generally handles printing of
8792 error and warning messages.
8793 Removed unused Error, Warning, Message methods.
8795 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8797 Fix for cs0592-8.cs test
8799 (Attributable.ValidAttributeTargets): Made public.
8800 (Attribute.ExplicitTarget): New member for explicit target value.
8801 (Attribute.CheckTargets): Now we translate explicit attribute
8802 target to Target here.
8804 2004-08-03 Ben Maurer <bmaurer@ximian.com>
8806 * ecore.cs (MethodGroupExpr): new IsBase property.
8808 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8810 * delegate.cs (DelegateCreation): store a MethodGroupExpr
8811 rather than an instance expr.
8813 (DelegateCreation.Emit): Use the method group rather than
8814 the instance expression. Also, if you have base.Foo as the
8815 method for a delegate, make sure to emit ldftn, not ldftnvirt.
8817 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
8819 (NewDelegate.DoResolve): Only check for the existance of Invoke
8820 if the method is going to be needed. Use MethodGroupExpr.
8822 (NewDelegate.Emit): Remove, DelegateCreation implements this.
8824 * expression.cs: For pointer arith., make sure to use
8825 the size of the type, not the size of the pointer to
8828 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8831 * class.cs (Class): Added error CS0502 test.
8833 2004-08-03 John Luke <jluke@cfl.rr.com>
8834 Raja R Harinath <rharinath@novell.com>
8837 * attribute.cs (Attribute.complained_before): New flag.
8838 (Attribute.ResolveType, Attribute.Resolve),
8839 (Attribute.DefinePInvokeMethod): Set it.
8840 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8842 2004-08-03 Martin Baulig <martin@ximian.com>
8844 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8845 use a user-defined operator; we still need to do numeric
8846 promotions in case one argument is a builtin type and the other
8847 one has an implicit conversion to that type. Fixes #62322.
8849 2004-08-02 Martin Baulig <martin@ximian.com>
8851 * statement.cs (LocalInfo.Flags): Added `IsThis'.
8852 (LocalInfo.IsThis): New public property.
8853 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8855 2004-08-01 Martin Baulig <martin@ximian.com>
8857 * class.cs (TypeContainer.GetClassBases): Don't set the default
8858 here since we may get called from GetPartialBases().
8859 (TypeContainer.DefineType): If GetClassBases() didn't return a
8860 parent, use the default one.
8862 2004-07-30 Duncan Mak <duncan@ximian.com>
8864 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
8866 2004-07-30 Martin Baulig <martin@ximian.com>
8868 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8870 * class.cs (SourceMethod): New public class, derive from the
8871 symbol writer's ISourceMethod.
8872 (Method): Use the new symbol writer API.
8874 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8875 as argument and use the new symbol writer.
8878 (SourceFile): Implement the symbol writer's ISourceFile.
8879 (Location.SymbolDocument): Removed.
8880 (Location.SourceFile): New public property.
8882 * symbolwriter.cs: Use the new symbol writer API.
8884 2004-07-30 Raja R Harinath <rharinath@novell.com>
8886 * Makefile (install-local): Remove. Functionality moved to
8889 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8891 * Makefile: Install mcs.exe.config file together with mcs.exe.
8892 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8893 correct runtime version.
8895 2004-07-25 Martin Baulig <martin@ximian.com>
8898 (TypeContainer.RegisterOrder): Removed, this was unused.
8899 (TypeContainer, interface_order): Removed.
8900 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8901 TypeContainer as argument since we can also be called with a
8902 `PartialContainer' for a partial class/struct/interface.
8903 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8904 of checking whether we're an `Interface' - we could be a
8906 (PartialContainer.Register): Override; call
8907 AddClass()/AddStruct()/AddInterface() on our parent.
8909 * cs-parser.jay (interface_member_declaration): Add things to the
8910 `current_container', not the `current_class'.
8912 * rootcontext.cs (RegisterOrder): The overloaded version which
8913 takes an `Interface' was unused, removed.
8915 * typemanager.cs (TypeManager.LookupInterface): Return a
8916 `TypeContainer', not an `Interface'.
8917 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8918 contain a `PartialContainer' for an interface, so check it's
8919 `Kind' to figure out what it is.
8921 2004-07-25 Martin Baulig <martin@ximian.com>
8923 * class.cs (Class.DefaultTypeAttributes): New public constant.
8924 (Struct.DefaultTypeAttributes): Likewise.
8925 (Interface.DefaultTypeAttributes): Likewise.
8926 (PartialContainer.TypeAttr): Override this and add the
8927 DefaultTypeAttributes.
8929 2004-07-25 Martin Baulig <martin@ximian.com>
8931 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8932 we can just use the `Parent' field instead.
8934 2004-07-25 Martin Baulig <martin@ximian.com>
8936 * class.cs (TypeContainer.Emit): Renamed to EmitType().
8938 2004-07-25 Martin Baulig <martin@ximian.com>
8940 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8941 our parts before defining any methods.
8942 (TypeContainer.VerifyImplements): Make this virtual.
8943 (ClassPart.VerifyImplements): Override and call VerifyImplements()
8944 on our PartialContainer.
8946 2004-07-25 Martin Baulig <martin@ximian.com>
8948 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8950 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8951 argument, we can just use the `Parent' field instead.
8954 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
8955 (MemberBase.DoDefine): Likewise.
8957 2004-07-24 Martin Baulig <martin@ximian.com>
8959 * decl.cs (MemberCore.Parent): New public field.
8960 (DeclSpace.Parent): Moved to MemberCore.
8962 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8963 (MemberBase.ctor): Added TypeContainer argument, pass it to our
8965 (FieldBase, Field, Operator): Likewise.
8966 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8967 (EventField, Event): Likewise.
8969 2004-07-23 Martin Baulig <martin@ximian.com>
8971 * class.cs (PartialContainer): New public class.
8972 (ClassPart): New public class.
8973 (TypeContainer): Added support for partial classes.
8974 (TypeContainer.GetClassBases): Splitted some of the functionality
8975 out into GetNormalBases() and GetPartialBases().
8977 * cs-tokenizer.cs (Token.PARTIAL): New token.
8978 (Tokenizer.consume_identifier): Added some hacks to recognize
8979 `partial', but only if it's immediately followed by `class',
8980 `struct' or `interface'.
8982 * cs-parser.jay: Added support for partial clases.
8984 2004-07-23 Martin Baulig <martin@ximian.com>
8986 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8987 a `DeclSpace' and also made it readonly.
8988 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8989 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8990 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8992 * cs-parser.jay: Pass the `current_class', not the
8993 `current_container' (at the moment, this is still the same thing)
8994 to a new Method, Property, Event, Indexer or Constructor.
8996 2004-07-23 Martin Baulig <martin@ximian.com>
8998 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8999 and removed the `current_interface' one.
9000 (struct_declaration, class_declaration, interface_declaration):
9001 Set `current_class' to the newly created class/struct/interface;
9002 set their `Bases' and call Register() before parsing their body.
9004 2004-07-23 Martin Baulig <martin@ximian.com>
9006 * class.cs (Kind): New public enum.
9007 (TypeContainer): Made this class abstract.
9008 (TypeContainer.Kind): New public readonly field.
9009 (TypeContainer.CheckDef): New public method; moved here from
9011 (TypeContainer.Register): New public abstract method.
9012 (TypeContainer.GetPendingImplementations): New public abstract
9014 (TypeContainer.GetClassBases): Removed the `is_class' and
9015 `is_iface' parameters.
9016 (TypeContainer.DefineNestedTypes): Formerly known as
9018 (ClassOrStruct): Made this class abstract.
9020 * tree.cs (RootTypes): New public type.
9022 2004-07-20 Martin Baulig <martin@ximian.com>
9024 * tree.cs (Tree.RecordNamespace): Removed.
9025 (Tree.Namespaces): Removed.
9027 * rootcontext.cs (RootContext.IsNamespace): Removed.
9029 * cs-parser.jay (namespace_declaration): Just create a new
9030 NamespaceEntry here.
9032 2004-07-20 Martin Baulig <martin@ximian.com>
9034 * statement.cs (ExceptionStatement): New abstract class. This is
9035 now used as a base class for everyone who's using `finally'.
9036 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
9037 our local variables before using them.
9039 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
9040 virtual method. This is used by Yield.Resolve() to "steal" an
9041 outer block's `finally' clauses.
9042 (FlowBranchingException): The .ctor now takes an ExceptionStatement
9045 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
9046 version which takes an ExceptionStatement. This version must be
9047 used to create exception branchings.
9050 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
9051 (Iterator.EmitMoveNext): Added exception support; protect the
9052 block with a `fault' clause, properly handle 'finally' clauses.
9053 (Iterator.EmitDispose): Run all the `finally' clauses here.
9055 2004-07-20 Martin Baulig <martin@ximian.com>
9057 * iterator.cs: This is the first of a set of changes in the
9058 iterator code. Match the spec more closely: if we're an
9059 IEnumerable, then GetEnumerator() must be called. The first time
9060 GetEnumerator() is called, it returns the current instance; all
9061 subsequent invocations (if any) must create a copy.
9063 2004-07-19 Miguel de Icaza <miguel@ximian.com>
9065 * expression.cs: Resolve the constant expression before returning
9068 2004-07-19 Martin Baulig <martin@ximian.com>
9070 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
9071 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
9072 the return type of the new EmitContext.
9074 2004-07-18 Martin Baulig <martin@ximian.com>
9076 * class.cs (Property.Define): Fix iterators.
9078 * iterators.cs (Iterator.Define): Moved the
9079 `container.AddInterator (this)' call here from the .ctor; only do
9080 it if we resolved successfully.
9082 2004-07-17 Miguel de Icaza <miguel@ximian.com>
9084 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
9085 `true' for preprocessing directives that we parse. The return
9086 value indicates whether we should return to regular tokenizing or
9087 not, not whether it was parsed successfully.
9089 In the past if we were in: #if false ... #line #endif, we would
9090 resume parsing after `#line'. See bug 61604.
9092 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
9093 building: IsEnumType should return true only for enums, not for
9094 enums or System.Enum itself. This fixes #61593.
9096 Likely what happened is that corlib was wrong: mcs depended on
9097 this bug in some places. The bug got fixed, we had to add the
9098 hack, which caused bug 61593.
9100 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
9101 that was a workaround for the older conditions.
9103 2004-07-16 Ben Maurer <bmaurer@ximian.com>
9105 * assign.cs: IAssignMethod has a new interface, as documented
9106 inline. All assignment code now uses this new api.
9108 * ecore.cs, expression.cs: All classes which implement
9109 IAssignMethod now use the new interface.
9111 * expression.cs (Invocation): add a hack to EmitCall so that
9112 IndexerAccess can be the target of a compound assignment without
9113 evaluating its arguments twice.
9115 * statement.cs: Handle changes in Invocation api.
9117 2004-07-16 Martin Baulig <martin@ximian.com>
9119 * iterators.cs: Rewrote this. We're now using one single Proxy
9120 class for both the IEnumerable and the IEnumerator interface and
9121 `Iterator' derives from Class so we can use the high-level API.
9123 * class.cs (TypeContainer.AddIterator): New method.
9124 (TypeContainer.DoDefineType): New protected virtual method, which
9125 is called from DefineType().
9126 (TypeContainer.DoDefineMembers): Call DefineType() and
9127 DefineMembers() on all our iterators.
9128 (TypeContainer.Emit): Call Emit() on all our iterators.
9129 (TypeContainer.CloseType): Call CloseType() on all our iterators.
9131 * codegen.cs (EmitContext.CurrentIterator): New public field.
9133 2004-07-15 Martin Baulig <martin@ximian.com>
9136 (TypeManager.not_supported_exception_type): New type.
9138 2004-07-14 Martin Baulig <martin@ximian.com>
9140 * iterators.cs: Use real error numbers.
9142 2004-07-14 Martin Baulig <martin@ximian.com>
9144 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9145 requires this to be a System.Collection.IEnumerable and not a
9146 class implementing that interface.
9147 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
9149 2004-07-13 Marek Safar <marek.safar@seznam.cz>
9151 * class.cs: Fixed previous fix, it broke some error tests.
9153 2004-07-12 Martin Baulig <martin@ximian.com>
9155 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9158 2004-07-09 Miguel de Icaza <miguel@ximian.com>
9160 * assign.cs (LocalTemporary): Add new argument: is_address,If
9161 `is_address' is true, then the value that we store is the address
9162 to the real value, and not the value itself.
9164 * ecore.cs (PropertyExpr): use the new local temporary
9165 stuff to allow us to handle X.Y += z (where X is a struct)
9167 2004-07-08 Martin Baulig <martin@ximian.com>
9169 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9170 not always return, just like we're doing in Using.Resolve().
9172 2004-07-07 Miguel de Icaza <miguel@ximian.com>
9174 * cs-parser.jay (fixed_statement): flag this as Pinned.
9176 2004-07-06 Miguel de Icaza <miguel@ximian.com>
9178 * typemanager.cs (TypeManager): Removed MakePinned method, this
9179 mechanism is replaced with the .NET 2.x compatible mechanism of
9180 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9182 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
9183 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9184 `IsFixed' property which has a different meaning.
9186 2004-07-02 Raja R Harinath <rharinath@novell.com>
9188 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9189 visible from inside a nested class, not just the names of the
9190 immediately enclosing class.
9193 2004-06-24 Raja R Harinath <rharinath@novell.com>
9195 * expression.cs (BetterConversion): Remove buggy special-case
9196 handling of "implicit constant expression conversions". At this
9197 point, we already know that the conversion is possible -- we're
9198 only checking to see which is better.
9200 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9202 * cs-parser.jay: Added error CS0210 test.
9204 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9206 * cs-parser.jay: Added error CS0134 test.
9208 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9211 * cs-parser.jay: Added error CS0145 test.
9213 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9215 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9217 2004-06-23 Ben Maurer <bmaurer@ximian.com>
9219 * expression.cs (StackAlloc.Resolve): The argument may not
9220 be a constant; deal with this case.
9222 2004-06-23 Marek Safar <marek.safar@seznam.cz>
9224 * attribute.cs (IndexerName_GetIndexerName): Renamed to
9225 GetIndexerAttributeValue.
9226 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9228 * class.cs (Indexer.Define): Added error tests for CS0415,
9231 2004-06-23 Miguel de Icaza <miguel@ximian.com>
9233 * attribute.cs (Attribute.Resolve): Keep field code in sync with
9236 2004-06-23 Martin Baulig <martin@ximian.com>
9238 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9239 neither return nor throw, reset the barrier as well. Fixes #60457.
9241 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
9243 * class.cs : EventAttributes is now set to None by default.
9244 This fixes bug #60459.
9246 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9249 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9250 Don't throw exception but return null (it's sufficient now).
9252 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9254 * typemanager.cs (GetArgumentTypes): Faster implementation.
9256 2004-06-18 Martin Baulig <martin@ximian.com>
9258 * attribute.cs (Attribute.Resolve): Check whether we're an
9259 EmptyCast which a Constant child. Fixes #60333.
9261 2004-06-17 Ben Maurer <bmaurer@ximian.com>
9263 * statement.cs (EmitCollectionForeach): Account for the fact that
9264 not all valuetypes are in areas which we can take the address of.
9265 For these variables, we store to a temporary variable. Also, make
9266 sure that we dont emit a `callvirt' on a valuetype method.
9268 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9270 * expression.cs (StackAlloc.DoReSolve): Added test for
9271 negative parameter (CS0247).
9273 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9276 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9278 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9281 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9284 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9286 Fix bug #58254 & cs1555.cs, cs1556.cs
9287 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9289 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9291 * cs-parser.jay: Added error CS1669 test for indexers.
9293 2004-06-11 Martin Baulig <martin@ximian.com>
9295 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9296 call this twice: for params and varargs methods.
9298 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9301 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9303 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9305 * attribute.cs (Attribute.GetValidTargets): Made public.
9308 (AbstractPropertyEventMethod): New class for better code sharing.
9309 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9311 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9313 2004-06-11 Raja R Harinath <rharinath@novell.com>
9316 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
9317 that the call to Resolve is part of a MemberAccess.
9318 (Expression.Resolve): Use it for SimpleName resolution.
9319 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
9320 Add 'intermediate' boolean argument.
9321 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
9322 error message when the SimpleName can be resolved ambiguously
9323 between an expression and a type.
9324 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
9326 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
9327 call on the left-side.
9329 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9332 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
9334 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9336 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
9338 2004-06-11 Martin Baulig <martin@ximian.com>
9340 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
9341 varargs methods if applicable.
9343 2004-06-11 Martin Baulig <martin@ximian.com>
9345 * expression.cs (Invocation.EmitCall): Don't use
9346 `method.CallingConvention == CallingConventions.VarArgs' since the
9347 method could also have `CallingConventions.HasThis'.
9349 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9351 * class.cs (Event.GetSignatureForError): Implemented.
9352 Fixed crash in error test cs3010.cs
9354 2004-06-10 Miguel de Icaza <miguel@ximian.com>
9356 * cs-tokenizer.cs: Change the way we track __arglist to be
9357 consistent with the other keywords.
9359 2004-06-09 Miguel de Icaza <miguel@ximian.com>
9361 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
9364 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
9366 * codegen.cs: Check that all referenced assemblies have a strongname
9367 before strongnaming the compiled assembly. If not report error CS1577.
9368 Fix bug #56563. Patch by Jackson Harper.
9369 * typemanager.cs: Added a method to return all referenced assemblies.
9370 Fix bug #56563. Patch by Jackson Harper.
9372 2004-06-08 Marek Safar <marek.safar@seznam.cz>
9375 (Method.ApplyAttributeBuilder): Moved and added conditional
9376 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
9379 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
9381 2004-06-08 Marek Safar <marek.safar@seznam.cz>
9384 * class.cs: (EventField.attribute_targets): Changed default target.
9386 2004-06-08 Martin Baulig <martin@ximian.com>
9388 * expression.cs (Invocation.EmitCall): Enable varargs methods.
9390 2004-06-08 Martin Baulig <martin@ximian.com>
9392 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
9394 2004-06-07 Martin Baulig <martin@ximian.com>
9396 Added support for varargs methods.
9398 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
9401 * cs-parser.jay: Added support for `__arglist'.
9403 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
9405 * expression.cs (Argument.AType): Added `ArgList'.
9406 (Invocation): Added support for varargs methods.
9407 (ArglistAccess): New public class.
9408 (Arglist): New public class.
9410 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
9412 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
9413 a method's top-level block if the method has varargs.
9415 * support.cs (ReflectionParameters, InternalParameters): Added
9416 support for varargs methods.
9418 2004-06-07 Miguel de Icaza <miguel@ximian.com>
9420 * class.cs: Provide location in indexer error report.
9422 * driver.cs: Use standard names.
9424 * namespace.cs: Catch the use of using after a namespace has been
9425 declared also on using aliases.
9427 2004-06-03 Raja R Harinath <rharinath@novell.com>
9430 * typemanager.cs (closure_private_ok, closure_invocation_type)
9431 (closure_qualifier_type, closure_invocation_assembly)
9432 (FilterWithClosure): Move to ...
9433 (Closure): New internal nested class.
9434 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
9435 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
9436 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
9437 (MemberLookup, MemberLookupFailed): Use it.
9438 * expression.cs (New.DoResolve): Treat the lookup for the
9439 constructor as being qualified by the 'new'ed type.
9440 (Indexers.GetIndexersForTypeOrInterface): Update.
9442 2004-06-03 Marek Safar <marek.safar@seznam.cz>
9445 (GetConditionalAttributeValue): New method. Returns
9446 condition of ConditionalAttribute.
9447 (SearchMulti): New method. Returns all attributes of type 't'.
9448 Use it when attribute is AllowMultiple = true.
9449 (IsConditionalMethodExcluded): New method.
9452 (Method.IsExcluded): Implemented. Returns true if method has conditional
9453 attribute and the conditions is not defined (method is excluded).
9454 (IMethodData): Extended interface for ConditionalAttribute support.
9455 (PropertyMethod.IsExcluded): Implemented.
9458 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
9461 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
9464 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
9466 * expression.cs (ArrayCreationExpression): Make this just an
9467 `expression'. It can't be a statement, so the code here was
9470 2004-06-02 Marek Safar <marek.safar@seznam.cz>
9473 * typemanager.cs (GetFullNameSignature): New method for
9476 2004-06-02 Marek Safar <marek.safar@seznam.cz>
9479 * class.cs (MemberBase.GetSignatureForError): New virtual method.
9480 Use this method when MethodBuilder is null.
9481 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
9482 Added test for error CS0626 (MONO reports error for this situation).
9483 (IMethodData.GetSignatureForError): Extended interface.
9485 2004-06-01 Marek Safar <marek.safar@seznam.cz>
9488 (AttributeTester.GetObsoleteAttribute): Returns instance of
9489 ObsoleteAttribute when type is obsolete.
9492 (TypeContainer.VerifyObsoleteAttribute): Override.
9493 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9494 (MethodCode.VerifyObsoleteAttribute): Override.
9495 (MemberBase.VerifyObsoleteAttribute): Override.
9498 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9499 and report proper error.
9502 Delegate.VerifyObsoleteAttribute): Override.
9505 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9506 and report proper error.
9507 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9510 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9514 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9515 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9516 Added test for ObsoleteAttribute.
9519 (Catch): Derived from Statement.
9521 2004-06-01 Marek Safar <marek.safar@seznam.cz>
9523 Fixed bug #59071 & cs0160.cs
9525 * statement.cs (Try.Resolve): Check here whether order of catch
9526 clauses matches their dependencies.
9528 2004-05-31 Miguel de Icaza <miguel@ximian.com>
9530 * Reverted patch to namespace.cs (Use lookuptypedirect). This
9531 caused a regression: #59343. Referencing nested classes from an
9532 assembly stopped working.
9534 2004-05-31 Martin Baulig <martin@ximian.com>
9536 MCS is now frozen for beta 2.
9538 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9540 * convert.cs: add a trivial cache for overload operator resolution.
9542 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9544 * decl.cs: If possible, use lookuptypedirect here. We can only do
9545 this if there is no `.' after the namespace. Avoids using
9546 LookupType, which does lots of slow processing.
9547 (FindNestedType) New method, does what it says :-).
9548 * namespace.cs: use LookupTypeDirect.
9549 * rootcontext.cs: use membercache, if possible.
9550 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9552 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9555 According to the spec,
9557 In a member access of the form E.I, if E is a single identifier,
9558 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9559 field, property, localvariable, or parameter with the same type as
9560 the meaning of E as a type-name (§3.8), then both possible
9561 meanings of E are permitted.
9563 We did not check that E as a simple-name had the same type as E as
9566 This trivial check gives us 5-7% on bootstrap time.
9568 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9570 * expression.cs (Invocation.OverloadResolve): Avoid the
9571 use of hashtables and boxing here by allocating on demand.
9573 2004-05-30 Martin Baulig <martin@ximian.com>
9575 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9576 we're doing a silent lookup. Don't try to lookup nested types in
9577 TypeManager.object_type (thanks to Ben Maurer).
9579 2004-05-30 Martin Baulig <martin@ximian.com>
9581 Committing a patch from Ben Maurer.
9583 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9585 2004-05-29 Martin Baulig <martin@ximian.com>
9587 * class.cs (IMethodData.ShouldIgnore): New method.
9589 * typemanager.cs (TypeManager.MethodFlags): Don't take a
9590 `Location' argument, we don't need it anywhere. Use
9591 `IMethodData.ShouldIgnore ()' instead of
9592 `MethodData.GetMethodFlags ()'.
9593 (TypeManager.AddMethod): Removed.
9594 (TypeManager.AddMethod2): Renamed to AddMethod.
9596 2004-05-29 Martin Baulig <martin@ximian.com>
9598 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9600 * convert.cs (Convert.ImplicitReferenceConversion): If we're
9601 converting from a class type S to an interface type and we already
9602 have an object on the stack, don't box it again. Fixes #52578.
9604 2004-05-29 Martin Baulig <martin@ximian.com>
9606 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9607 Added support for `params' parameters. Fixes #59267.
9609 2004-05-29 Martin Baulig <martin@ximian.com>
9611 * literal.cs (NullPointer): Provide a private .ctor which sets
9612 `type' to TypeManager.object_type. Fixes #59048.
9614 2004-05-29 Martin Baulig <martin@ximian.com>
9616 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9617 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
9619 * ecore.cs (EventExpr.instance_expr): Make the field private.
9621 2004-05-26 Marek Safar <marek.safar@seznam.cz>
9623 Fixed bug #50080 & cs0214-2.cs
9624 * expression.cs (Cast.DoResolve): Check unsafe context here.
9626 * statement.cs (Resolve.DoResolve): Likewise.
9628 2004-05-26 Martin Baulig <martin@ximian.com>
9630 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9632 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9633 (RootContext.LookupType): Pass down the `silent' flag.
9635 2004-05-25 Martin Baulig <martin@ximian.com>
9638 (MethodGroupExpr.IdenticalTypeName): New public property.
9639 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9640 expression actually refers to a type.
9642 2004-05-25 Martin Baulig <martin@ximian.com>
9644 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9645 for #56176 and made it actually work.
9647 2004-05-25 Martin Baulig <martin@ximian.com>
9649 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9650 (FieldExpr, PropertyExpr): Override and implement
9651 CacheTemporaries. Fixes #52279.
9653 2004-05-25 Miguel de Icaza <miguel@ximian.com>
9655 * location.cs: In the new compiler listing a file twice is a
9656 warning, not an error.
9658 2004-05-24 Martin Baulig <martin@ximian.com>
9660 * enum.cs (Enum.DefineType): For the `BaseType' to be a
9661 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
9663 2004-05-24 Martin Baulig <martin@ximian.com>
9665 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9666 walking the `using' list. Fixes #53921.
9668 2004-05-24 Martin Baulig <martin@ximian.com>
9670 * const.cs (Const.LookupConstantValue): Added support for
9671 EmptyCast's; fixes #55251.
9673 2004-05-24 Martin Baulig <martin@ximian.com>
9675 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9676 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9677 which does the CS0135 check. The reason is that we first need to
9678 check whether the variable actually exists.
9680 2004-05-24 Martin Baulig <martin@ximian.com>
9682 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9683 than RootContext.LookupType() to find the explicit interface
9686 2004-05-24 Raja R Harinath <rharinath@novell.com>
9688 * Makefile: Simplify. Use executable.make.
9689 * mcs.exe.sources: New file. List of sources of mcs.exe.
9691 2004-05-24 Anders Carlsson <andersca@gnome.org>
9695 Use the invariant culture when doing String.Compare for CLS case
9698 2004-05-23 Martin Baulig <martin@ximian.com>
9700 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9701 don't have any dots. Fixes #52622, added cs0246-8.cs.
9703 * namespace.cs (NamespaceEntry.Lookup): Likewise.
9705 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9707 * class.cs (MemberBase.Define): Reuse MemberType member for
9708 resolved type. Other methods can use it too.
9710 2004-05-23 Martin Baulig <martin@ximian.com>
9712 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9713 the variable also exists in the current block (otherwise, we need
9714 to report a CS0103). Fixes #58670.
9716 2004-05-23 Martin Baulig <martin@ximian.com>
9718 * flowanalysis.cs (Reachability.Reachable): Compute this
9719 on-the-fly rather than storing it as a field.
9721 2004-05-23 Martin Baulig <martin@ximian.com>
9723 * flowanalysis.cs (Reachability.And): Manually compute the
9724 resulting `barrier' from the reachability.
9726 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9729 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9730 instance of ObsoleteAttribute when symbol is obsolete.
9733 (IMethodData): Extended interface for ObsoleteAttribute support.
9735 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9737 * attribute.cs: Fix bug #55970
9739 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9743 (GetObsoleteAttribute): New method. Creates the instance of
9745 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9746 ObsoleteAttribute when member is obsolete.
9747 (AttributeTester.Report_ObsoleteMessage): Common method for
9748 Obsolete error/warning reporting.
9751 (TypeContainer.base_classs_type): New member for storing parent type.
9754 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9755 for this MemberCore.
9757 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9759 * attribute.cs, const.cs: Fix bug #58590
9761 2004-05-21 Martin Baulig <martin@ximian.com>
9763 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9764 out parameters if the end of the method is unreachable. Fixes
9767 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9769 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9770 Hari was right, why extra method.
9772 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9774 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9776 2004-05-20 Martin Baulig <martin@ximian.com>
9778 Merged this back from gmcs to keep the differences to a minumum.
9780 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
9781 instead of a Declspace.
9782 (Attribute.ResolveType): Likewise.
9783 (Attributes.Search): Likewise.
9784 (Attributes.Contains): Likewise.
9785 (Attributes.GetClsCompliantAttribute): Likewise.
9787 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
9789 (MethodData.ApplyAttributes): Take an EmitContext instead of a
9792 2004-05-19 Marek Safar <marek.safar@seznam.cz>
9794 Fix bug #58688 (MCS does not report error when the same attribute
9797 * attribute.cs (Attribute.Emit): Distinction between null and default.
9799 2004-05-19 Raja R Harinath <rharinath@novell.com>
9801 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9802 of a top-level attribute without an attribute target.
9803 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
9805 (Attribute.Conditional_GetConditionName),
9806 (Attribute.Obsolete_GetObsoleteMessage): Update.
9807 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
9808 part of ScanForIndexerName.
9809 (Attribute.CanIgnoreInvalidAttribute): New function.
9810 (Attribute.ScanForIndexerName): Move to ...
9811 (Attributes.ScanForIndexerName): ... here.
9812 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9813 (Attributes.Search): New internal variant that can choose not to
9814 complain if types aren't resolved. The original signature now
9816 (Attributes.GetClsCompliantAttribute): Use internal variant, with
9817 complaints suppressed.
9818 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9819 only if it not useful.
9820 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9821 top-level for attributes that are shared between the assembly
9822 and a top-level class.
9823 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9824 * class.cs: Update to reflect changes.
9825 (DefineIndexers): Fuse loops.
9826 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
9827 a couple more variants of attribute names.
9829 2004-05-18 Marek Safar <marek.safar@seznam.cz>
9831 Fix bug #52585 (Implemented explicit attribute declaration)
9834 (Attributable.ValidAttributeTargets): New abstract method. It gets
9835 list of valid attribute targets for explicit target declaration.
9836 (Attribute.Target): It holds target itself.
9837 (AttributeSection): Removed.
9838 (Attribute.CheckTargets): New method. It checks whether attribute
9839 target is valid for the current element.
9842 (EventProperty): New class. For events that are declared like
9843 property (with add and remove accessors).
9844 (EventField): New class. For events that are declared like field.
9847 * cs-parser.jay: Implemented explicit attribute target declaration.
9849 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
9850 Override ValidAttributeTargets.
9853 (ReturnParameter): Class for applying custom attributes on
9855 (ParameterAtribute): New class. Class for applying custom
9856 attributes on the parameter type.
9858 2004-05-17 Miguel de Icaza <miguel@ximian.com>
9860 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9863 (Method): Allow UNSAFE here.
9865 * modifiers.cs: Support unsafe reporting.
9867 2004-05-17 Marek Safar <marek.safar@seznam.cz>
9869 * decl.cs: Fix bug #58478.
9871 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9873 * statement.cs: When checking for unreachable code on an EmptyStatement,
9874 set the location. Fixes bug #58488.
9876 2004-05-13 Miguel de Icaza <miguel@ximian.com>
9878 * driver.cs: Add -pkg handling.
9880 From Gonzalo: UseShelLExecute=false
9882 2004-05-12 Marek Safar <marek.safar@seznam.cz>
9885 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9887 (Attribute.IsClsCompliaceRequired): Moved to base for better
9889 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9890 when attribute is AttributeUsageAttribute.
9891 (Attribute.GetValidTargets): Simplified.
9892 (Attribute.GetAttributeUsage): New method returns AttributeUsage
9893 attribute for this type.
9894 (Attribute.ApplyAttributes): Method renamed to Emit and make
9896 (GlobalAttributeSection): New class for special handling of global
9897 attributes (assembly, module).
9898 (AttributeSection.Emit): New method.
9900 * class.cs: Implemented Attributable abstract methods.
9901 (MethodCore.LabelParameters): Moved to Parameter class.
9902 (Accessor): Is back simple class.
9903 (PropertyMethod): Implemented Attributable abstract class.
9904 (DelegateMethod): Implemented Attributable abstract class.
9905 (Event): New constructor for disctintion between normal Event
9906 and Event with accessors.
9908 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9910 * codegen.cs, const.cs, decl.cs, delegate.cs:
9911 (CommonAssemblyModulClass): Implemented Attributable abstract class
9914 * enum.cs: Implement IAttributeSupport interface.
9915 (EnumMember): New class for emum members. Implemented Attributable
9919 (ParameterBase): Is abstract.
9920 (ReturnParameter): New class for easier [return:] attribute handling.
9922 * typemanager.cs: Removed builder_to_attr.
9924 2004-05-11 Raja R Harinath <rharinath@novell.com>
9927 * attribute.cs (Attribute.GetPositionalValue): New function.
9928 * class.cs (TypeContainer.VerifyMembers): New function.
9929 (TypeContainer.Emit): Use it.
9930 (ClassOrStruct): New base class for Class and Struct.
9931 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
9932 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9934 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9935 then each non-static field should have a FieldOffset attribute.
9936 Otherwise, none of the fields should have a FieldOffset attribute.
9937 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
9938 and FieldOffset attributes.
9939 * typemanager.cs (TypeManager.struct_layout_attribute_type)
9940 (TypeManager.field_offset_attribute_type): New core types.
9941 (TypeManager.InitCoreTypes): Initialize them.
9943 2004-05-11 Michal Moskal <malekith@pld-linux.org>
9945 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9946 Return correct type.
9949 2004-05-09 Miguel de Icaza <miguel@ximian.com>
9951 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9952 be implicitly converted to ulong.
9954 * expression.cs: The logic for allowing operator &, | and ^ worked
9955 was wrong, it worked before because we did not report an error in
9956 an else branch. Fixes 57895.
9958 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9959 allow volatile fields to be reference types.
9961 2004-05-07 Miguel de Icaza <miguel@ximian.com>
9963 * driver.cs: Add support for /debug-
9965 2004-05-07 Raja R Harinath <rharinath@novell.com>
9967 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
9968 Add a 'complain' parameter to silence errors.
9969 (Attribute.Resolve): Update to changes. Put in sanity check to catch
9970 silently overlooked type-resolutions.
9971 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9973 (Attributes.Search): New function.
9974 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9975 (Attributes.GetAttributeFullName): Remove hack.
9976 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9977 Update to reflect changes.
9978 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9979 Use Attributes.Search instead of nested loops.
9981 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9984 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9985 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9986 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9988 * report.cs: (Report.Warning): Renamed to Warning_T because of
9989 parameter collision.
9991 2004-05-05 Raja R Harinath <rharinath@novell.com>
9993 * expression.cs (MemberAccess.ResolveMemberAccess):
9994 Exit with non-zero status after Report.Error.
9995 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9997 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9999 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10001 * support.cs: Don't hang when the file is empty.
10003 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10005 * support.cs: In SeekableStreamReader, compute the preamble size of the
10006 underlying stream. Position changes should take into account that initial
10009 2004-05-03 Todd Berman <tberman@sevenl.net>
10011 * driver.cs: remove unused GetSysVersion function.
10013 2004-05-03 Todd Berman <tberman@sevenl.net>
10015 * driver.cs: Remove the hack from saturday, as well as the hack
10016 from jackson (LoadAssemblyFromGac), also adds the CWD to the
10017 link_paths to get that bit proper.
10019 2004-05-01 Todd Berman <tberman@sevenl.net>
10021 * driver.cs: Try a LoadFrom before a Load, this checks the current
10022 path. This is currently a bug in mono that is be fixed, however, this
10023 provides a workaround for now. This will be removed when the bug
10026 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
10028 * CryptoConvert.cs: Updated to latest version. Fix issue with
10029 incomplete key pairs (#57941).
10031 2004-05-01 Todd Berman <tberman@sevenl.net>
10033 * driver.cs: Remove '.' from path_chars, now System.* loads properly
10036 2004-04-30 Jackson Harper <jackson@ximian.com>
10038 * codegen.cs: Open keys readonly.
10040 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10042 * typemanager.cs: don't report cyclic struct layout when a struct
10043 contains 2 or more fields of the same type. Failed for Pango.AttrShape
10044 which has 2 Pango.Rectangle fields.
10046 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
10048 * expression.cs: Handle IntPtr comparisons with IL code
10049 rather than a method call.
10051 2004-04-29 Martin Baulig <martin@ximian.com>
10053 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
10054 the list of PropertyInfo's in class hierarchy and find the
10055 accessor. Fixes #56013.
10057 2004-04-29 Martin Baulig <martin@ximian.com>
10059 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10061 2004-04-29 Martin Baulig <martin@ximian.com>
10063 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10065 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10067 2004-04-29 Martin Baulig <martin@ximian.com>
10069 * class.cs (ConstructorInitializer.Resolve): Check whether the
10070 parent .ctor is accessible. Fixes #52146.
10072 2004-04-29 Martin Baulig <martin@ximian.com>
10074 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10076 * statement.cs (Using.EmitLocalVariableDecls): Use
10077 TypeManager.idisposable_type, not typeof (IDisposable).
10078 (Foreach.EmitCollectionForeach): Added support for valuetypes.
10080 2004-04-29 Martin Baulig <martin@ximian.com>
10082 * class.cs (Event.Define): Don't emit the field and don't set
10083 RTSpecialName and SpecialName for events on interfaces. Fixes
10086 2004-04-29 Raja R Harinath <rharinath@novell.com>
10088 Refactor Attribute.ApplyAttributes.
10089 * attribute.cs (Attributable): New base class for objects that can
10090 have Attributes applied on them.
10091 (Attribute): Make AttributeUsage fields public.
10092 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10093 (Attribute.IsInternalCall): New property.
10094 (Attribute.UsageAttr): Convert to a public read-only property.
10095 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10096 (Attribute.ResolveType, Attribute.Resolve)
10097 (Attribute.ScanForIndexerName): Update to reflect changes.
10098 (Attribute.CheckAttributeTarget): Re-format.
10099 (Attribute.ApplyAttributes): Refactor, to various
10100 Attributable.ApplyAttributeBuilder methods.
10101 * decl.cs (MemberCore): Make Attributable.
10102 * class.cs (Accessor): Make Attributable.
10103 (MethodData.ApplyAttributes): Use proper attribute types, not
10105 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10106 (TypeContainer.ApplyAttributeBuilder)
10107 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10108 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
10109 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10110 (Operator.ApplyAttributeBuilder): New factored-out methods.
10111 * const.cs (Const.ApplyAttributeBuilder): Likewise.
10112 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10113 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10114 * parameter.cs (ParameterBase): New Attributable base class
10115 that can also represent Return types.
10116 (Parameter): Update to the changes.
10118 2004-04-29 Jackson Harper <jackson@ximian.com>
10120 * driver.cs: Prefer the corlib system version when looking for
10121 assemblies in the GAC. This is still a hack, but its a better hack
10124 2004-04-29 Marek Safar <marek.safar@seznam.cz>
10126 * decl.cs, enum.cs: Improved error 3005 reporting.
10128 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10129 (related_symbols): New private member for list of symbols
10130 related to reported error/warning.
10132 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10134 2004-04-29 Martin Baulig <martin@ximian.com>
10136 * ecore.cs (Expression.Constantify): If we're an enum and
10137 TypeManager.TypeToCoreType() doesn't give us another type, use
10138 t.UnderlyingSystemType. Fixes #56178.
10140 2004-04-29 Martin Baulig <martin@ximian.com>
10142 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10143 interfaces and for each interface, only add members directly
10144 declared in that interface. Fixes #53255.
10146 2004-04-28 Martin Baulig <martin@ximian.com>
10148 * expression.cs (ConditionalLogicalOperator): Use a temporary
10149 variable for `left' to avoid that we evaluate it more than once;
10152 2004-04-28 Martin Baulig <martin@ximian.com>
10154 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10157 2004-04-28 Martin Baulig <martin@ximian.com>
10159 * statement.cs (LocalInfo.Resolve): Check whether the type is not
10162 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10163 whether the type is not void (CS1547).
10165 2004-04-28 Martin Baulig <martin@ximian.com>
10167 * expression.cs (Unary.DoResolveLValue): Override this and report
10168 CS0131 for anything but Operator.Indirection.
10170 2004-04-28 Martin Baulig <martin@ximian.com>
10172 Committing a patch from Ben Maurer; see bug #50820.
10174 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10177 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10180 2004-04-28 Martin Baulig <martin@ximian.com>
10182 Committing a patch from Ben Maurer; see bug #50820.
10184 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10187 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10190 2004-04-28 Martin Baulig <martin@ximian.com>
10192 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10193 (Block.AddLabel): Call DoLookupLabel() to only search in the
10196 2004-04-28 Martin Baulig <martin@ximian.com>
10198 * cfold.cs (ConstantFold.BinaryFold): Added special support for
10199 comparing StringConstants and NullLiterals in Equality and Inequality.
10201 2004-04-28 Jackson Harper <jackson@ximian.com>
10203 * driver.cs: Attempt to load referenced assemblies from the
10204 GAC. This is the quick and dirty version of this method that
10205 doesnt take into account versions and just takes the first
10206 canidate found. Will be good enough for now as we will not have more
10207 then one version installed into the GAC until I update this method.
10209 2004-04-28 Martin Baulig <martin@ximian.com>
10211 * typemanager.cs (TypeManager.CheckStructCycles): New public
10212 static method to check for cycles in the struct layout.
10214 * rootcontext.cs (RootContext.PopulateTypes): Call
10215 TypeManager.CheckStructCycles() for each TypeContainer.
10216 [Note: We only need to visit each type once.]
10218 2004-04-28 Martin Baulig <martin@ximian.com>
10220 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10222 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10223 success and added `out object value'. Use a `bool resolved' field
10224 to check whether we've already been called rather than
10225 `ConstantValue != null' since this breaks for NullLiterals.
10227 2004-04-28 Raja R Harinath <rharinath@novell.com>
10229 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10230 setting of this flag, since the 'set' method may be non-public.
10232 2004-04-28 Raja R Harinath <rharinath@novell.com>
10234 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10235 check on current_vector.Block.
10237 2004-04-27 Martin Baulig <martin@ximian.com>
10239 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10240 a field initializer. Fixes #56459.
10242 2004-04-27 Martin Baulig <martin@ximian.com>
10244 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10245 we're not attempting to use an indexer. Fixes #52154.
10247 2004-04-27 Martin Baulig <martin@ximian.com>
10249 * statement.cs (Return): Don't create a return label if we don't
10250 need it; reverts my change from January 20th. Thanks to Ben
10253 2004-04-27 Martin Baulig <martin@ximian.com>
10255 According to the spec, `goto' can only leave a nested scope, but
10258 * statement.cs (Block.LookupLabel): Only lookup in the current
10259 block, don't recurse into parent or child blocks.
10260 (Block.AddLabel): Check in parent and child blocks, report
10261 CS0140/CS0158 if we find a duplicate.
10262 (Block): Removed this indexer for label lookups.
10263 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10264 this already does the error reporting for us.
10267 (FlowBranching.UsageVector.Block): New public variable; may be null.
10268 (FlowBranching.CreateSibling): Added `Block' argument.
10269 (FlowBranching.LookupLabel): New public virtual method. Lookup a
10270 label for the target of a `goto' and check whether we're not
10271 leaving a `finally'.
10273 2004-04-27 Martin Baulig <martin@ximian.com>
10275 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10276 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10279 2004-04-27 Martin Baulig <martin@ximian.com>
10281 * statement.cs (Block.AddLabel): Also check for implicit blocks
10282 and added a CS0158 check.
10284 2004-04-27 Martin Baulig <martin@ximian.com>
10286 * flowanalysis.cs (FlowBranchingLoop): New class.
10287 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10288 UsageVector's instead of an ArrayList.
10289 (FlowBranching.Label): Likewise.
10290 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10291 (FlowBranching.AddBreakVector): New method.
10293 2004-04-27 Miguel de Icaza <miguel@ximian.com>
10295 * attribute.cs: Small regression fix: only convert the type if we
10296 the type is different, fixes System.Drawing build.
10298 2004-04-27 Martin Baulig <martin@ximian.com>
10300 * attribute.cs (Attribute.Resolve): If we have a constant value
10301 for a named field or property, implicity convert it to the correct
10304 2004-04-27 Raja R Harinath <rharinath@novell.com>
10306 * statement.cs (Block.Block): Implicit blocks share
10307 'child_variable_names' fields with parent blocks.
10308 (Block.AddChildVariableNames): Remove.
10309 (Block.AddVariable): Mark variable as "used by a child block" in
10310 every surrounding block.
10311 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10312 been used in a child block, complain about violation of "Invariant
10313 meaning in blocks" rule.
10314 * cs-parser.jay (declare_local_variables): Don't use
10315 AddChildVariableNames.
10316 (foreach_statement): Don't create an implicit block: 'foreach'
10317 introduces a scope.
10319 2004-04-23 Miguel de Icaza <miguel@ximian.com>
10321 * convert.cs (ImplicitNumericConversion): 0 is also positive when
10322 converting from 0L to ulong. Fixes 57522.
10324 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10326 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10327 derived class hides via 'new' keyword field from base class (test-242.cs).
10328 TODO: Handle this in the more general way.
10330 * class.cs (CheckBase): Ditto.
10332 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10334 * decl.cs (caching_flags): New member for storing cached values
10336 (MemberCore.Flags): New enum where bit flags for caching_flags
10338 (MemberCore.cls_compliance): Moved to caching_flags.
10339 (DeclSpace.Created): Moved to caching_flags.
10341 * class.cs: Use caching_flags instead of DeclSpace.Created
10343 2004-04-21 Miguel de Icaza <miguel@ximian.com>
10345 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10346 if we are only a derived class, not a nested class.
10348 * typemanager.cs: Same as above, but do this at the MemberLookup
10349 level (used by field and methods, properties are handled in
10350 PropertyExpr). Allow for the qualified access if we are a nested
10353 2004-04-21 Marek Safar <marek.safar@seznam.cz>
10355 * class.cs: Refactoring.
10356 (IMethodData): New inteface; Holds links to parent members
10357 to avoid member duplication (reduced memory allocation).
10358 (Method): Implemented IMethodData interface.
10359 (PropertyBase): New inner classes for get/set methods.
10360 (PropertyBase.PropertyMethod): Implemented IMethodData interface
10361 (Event): New inner classes for add/remove methods.
10362 (Event.DelegateMethod): Implemented IMethodData interface.
10364 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10365 EmitContext (related to class.cs refactoring).
10367 2004-04-21 Raja R Harinath <rharinath@novell.com>
10369 * delegate.cs (Delegate.VerifyApplicability): If the number of
10370 arguments are the same as the number of parameters, first try to
10371 verify applicability ignoring any 'params' modifier on the last
10375 2004-04-16 Raja R Harinath <rharinath@novell.com>
10377 * class.cs (TypeContainer.AddIndexer): Use
10378 'ExplicitInterfaceName' to determine if interface name was
10379 explicitly specified. 'InterfaceType' is not initialized at this time.
10380 (TypeContainer.DefineIndexers): Remove use of temporary list. The
10381 Indexers array is already in the required order. Initialize
10382 'IndexerName' only if there are normal indexers.
10383 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10384 (TypeContainer.Emit): Emit DefaultMember attribute only if
10385 IndexerName is initialized.
10388 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
10390 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10393 2004-04-15 Raja R Harinath <rharinath@novell.com>
10395 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10399 * attribute.cs (Attribute.Resolve): Check for duplicate named
10403 2004-04-15 Miguel de Icaza <miguel@ximian.com>
10405 * iterators.cs (MarkYield): track whether we are in an exception,
10406 and generate code accordingly. Use a temporary value to store the
10407 result for our state.
10409 I had ignored a bit the interaction of try/catch with iterators
10410 since their behavior was not entirely obvious, but now it is
10411 possible to verify that our behavior is the same as MS .NET 2.0
10415 2004-04-14 Miguel de Icaza <miguel@ximian.com>
10417 * iterators.cs: Avoid creating temporaries if there is no work to
10420 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10421 Enumerations, use TypeManager.EnumToUnderlying and call
10424 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10427 (This.Emit): Use EmitContext.EmitThis to emit our
10430 (This.EmitAssign): Ditto.
10432 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10433 codepaths, we will move all the functionality into
10436 (FieldExpr.EmitAssign): Ditto.
10438 This fixes several hidden bugs that I uncovered while doing a code
10439 review of this today.
10441 * codegen.cs (EmitThis): reworked so the semantics are more clear
10442 and also support value types "this" instances.
10444 * iterators.cs: Changed so that for iterators in value types, we
10445 do not pass the value type as a parameter.
10447 Initialization of the enumerator helpers is now done in the caller
10448 instead of passing the parameters to the constructors and having
10449 the constructor set the fields.
10451 The fields have now `assembly' visibility instead of private.
10453 2004-04-11 Miguel de Icaza <miguel@ximian.com>
10455 * expression.cs (Argument.Resolve): Check if fields passed as ref
10456 or out are contained in a MarshalByRefObject.
10458 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10459 another compiler type.
10461 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
10463 * class.cs (Indexer.Define): use the new name checking method.
10464 Also, return false on an error.
10465 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10466 (is_identifier_[start/part]_character): make static.
10468 2004-04-10 Miguel de Icaza <miguel@ximian.com>
10470 * expression.cs (Binary.ResolveOperator): Do no append strings
10471 twice: since we can be invoked more than once (array evaluation)
10472 on the same concatenation, take care of this here. Based on a fix
10473 from Ben (bug #56454)
10475 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10477 * codegen.cs: Fix another case where CS1548 must be reported (when
10478 delay-sign isn't specified and no private is available #56564). Fix
10479 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10480 error when MCS is used on the MS runtime and we need to delay-sign
10481 (which seems unsupported by AssemblyBuilder - see #56621).
10483 2004-04-08 Marek Safar <marek.safar@seznam.cz>
10485 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10486 (TypeManager.ComputeNamespaces): Faster implementation for
10489 * compiler.csproj: Updated AssemblyName to mcs.
10491 2004-04-07 Miguel de Icaza <miguel@ximian.com>
10493 * rootcontext.cs: Add new types to the boot resolution.
10495 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10496 MulticastDelegate is not allowed.
10498 * typemanager.cs: Add new types to lookup: System.TypedReference
10501 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10502 check for TypedReference or ArgIterator, they are not allowed.
10504 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10505 makes us properly catch 1510 in some conditions (see bug 56016 for
10508 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
10510 * CryptoConvert.cs: update from corlib version
10513 2004-04-05 Miguel de Icaza <miguel@ximian.com>
10515 * class.cs (Indexer.Define): Check indexername declaration
10517 2004-04-05 Marek Safar <marek.safar@seznam.cz>
10519 * attribute.cs (IsClsCompliant): Fixed problem with handling
10520 all three states (compliant, not-compliant, undetected).
10522 2004-03-30 Marek Safar <marek.safar@seznam.cz>
10524 * attribute.cs (Attribute): Location is now public.
10525 (Resolve): Store resolved arguments (pos_values) in attribute class.
10526 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10527 (GetClsCompliantAttributeValue): New method that gets
10528 CLSCompliantAttribute value.
10529 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10530 if exists else null.
10531 (AttributeTester): New class for CLS-Compliant verification routines.
10533 * class.cs (Emit): Add CLS-Compliant verification.
10534 (Method.GetSignatureForError): Implemented.
10535 (Constructor.GetSignatureForError): Implemented
10536 (Constructor.HasCompliantArgs): Returns if constructor has
10537 CLS-Compliant arguments.
10538 (Constructor.Emit): Override.
10539 (Construcor.IsIdentifierClsCompliant): New method; For constructors
10540 is needed to test only parameters.
10541 (FieldBase.GetSignatureForError): Implemented.
10542 (TypeContainer): New member for storing base interfaces.
10543 (TypeContainer.FindMembers): Search in base interfaces too.
10545 * codegen.cs (GetClsComplianceAttribute): New method that gets
10546 assembly or module CLSCompliantAttribute value.
10547 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10549 (ModuleClass.Emit): Add error 3012 test.
10551 * const.cs (Emit): Override and call base for CLS-Compliant tests.
10553 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10554 state for all decl types.
10555 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10556 if CLS-Compliant tests are required.
10557 (IsClsCompliaceRequired): New method. Analyze whether code
10558 must be CLS-Compliant.
10559 (IsExposedFromAssembly): New method. Returns true when MemberCore
10560 is exposed from assembly.
10561 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10562 value or gets cached value.
10563 (HasClsCompliantAttribute): New method. Returns true if MemberCore
10564 is explicitly marked with CLSCompliantAttribute.
10565 (IsIdentifierClsCompliant): New abstract method. This method is
10566 used to testing error 3005.
10567 (IsIdentifierAndParamClsCompliant): New method. Common helper method
10568 for identifier and parameters CLS-Compliant testing.
10569 (VerifyClsCompliance): New method. The main virtual method for
10570 CLS-Compliant verifications.
10571 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10572 null. I don't know why is null (too many public members !).
10573 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10574 and get value of first CLSCompliantAttribute that found.
10576 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10577 (VerifyClsCompliance): Override and add extra tests.
10579 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10580 clscheck- disable CLS-Compliant verification event if assembly is has
10581 CLSCompliantAttribute(true).
10583 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10584 ApllyAttribute is now called in emit section as in the other cases.
10585 Possible future Emit integration.
10586 (IsIdentifierClsCompliant): New override.
10587 (VerifyClsCompliance): New override.
10588 (GetEnumeratorName): Returns full enum name.
10590 * parameter.cs (GetSignatureForError): Implemented.
10592 * report.cs (WarningData): New struct for Warning message information.
10593 (LocationOfPreviousError): New method.
10594 (Warning): New method. Reports warning based on the warning table.
10595 (Error_T): New method. Reports error based on the error table.
10597 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10598 verifications are done here.
10600 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10602 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10603 CLSCompliantAttribute.
10604 (all_imported_types): New member holds all imported types from other
10606 (LoadAllImportedTypes): New method fills static table with exported types
10607 from all referenced assemblies.
10608 (Modules): New property returns all assembly modules.
10610 2004-03-30 Miguel de Icaza <miguel@ximian.com>
10612 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10613 throwing a parser error.
10615 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10616 which removes the hardcoded get_/set_ prefixes for properties, as
10617 IL allows for the properties to be named something else.
10621 * expression.cs: Do not override operand before we know if it is
10622 non-null. Fix 56207
10624 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10626 * typemanager.cs: support for pinned variables.
10628 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10630 * decl.cs, typemanager.cs: Avoid using an arraylist
10631 as a buffer if there is only one result set.
10633 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10635 * expression.cs: Make sure you cant call a static method
10636 with an instance expression, bug #56174.
10638 2004-03-29 Miguel de Icaza <miguel@ximian.com>
10640 * class.cs (IsDuplicateImplementation): Improve error reporting to
10641 flag 663 (method only differs in parameter modifier).
10643 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10644 in preprocessor directives.
10646 * location.cs (LookupFile): Allow for the empty path.
10648 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
10649 better approach for some of that patch, but its failing with the
10650 CharSet enumeration. For now try/catch will do.
10652 * typemanager.cs: Do not crash if a struct does not have fields.
10655 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10657 * expression.cs: cs0213, cant fix a fixed expression.
10660 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10662 * cs-parser.jay: detect invalid embeded statements gracefully.
10665 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10667 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10670 the invocation type may not be a subclass of the tye of the item/
10671 The type of the item must be a subclass of the invocation item.
10676 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
10678 * attribute.cs: Added methods to get a string and a bool from an
10679 attribute. Required to information from AssemblyKeyFileAttribute,
10680 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10681 * codegen.cs: Modified AssemblyName creation to include support for
10682 strongnames. Catch additional exceptions to report them as CS1548.
10683 * compiler.csproj: Updated include CryptoConvert.cs.
10684 * compiler.csproj.user: Removed file - user specific configuration.
10685 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
10686 Mono.Security assembly. The original class is maintained and tested in
10687 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10688 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10689 like CSC 8.0 (C# v2) supports.
10690 * Makefile: Added CryptoConvert.cs to mcs sources.
10691 * rootcontext.cs: Added new options for strongnames.
10693 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
10695 * driver.cs: For --expect-error, report error code `2'
10696 if the program compiled with no errors, error code `1' if
10697 it compiled with an error other than the one expected.
10699 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
10701 * compiler.csproj: Updated for Visual Studio .NET 2003.
10702 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10703 * compiler.sln: Updated for Visual Studio .NET 2003.
10705 2004-03-24 Ravi Pratap M <ravi@ximian.com>
10707 * expression.cs: Fix bug #47234. We basically need to apply the
10708 rule that we prefer the conversion of null to a reference type
10709 when faced with a conversion to 'object' (csc behaviour).
10711 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10713 * statement.cs: Shorter form for foreach, eliminates
10714 a local variable. r=Martin.
10716 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10718 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10719 checks if we can use brtrue/brfalse to test for 0.
10720 * expression.cs: use the above in the test for using brtrue/brfalse.
10721 cleanup code a bit.
10723 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10725 * expression.cs: Rewrite string concat stuff. Benefits:
10727 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10728 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10729 rather than a concat chain.
10731 * typemanager.cs: Add lookups for more concat overloads.
10733 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10735 * expression.cs: Emit shorter il code for array init.
10752 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
10754 * statement.cs: Before, two switch blocks would be merged if the
10755 total size of the blocks (end_item - begin_item + 1) was less than
10756 two times the combined sizes of the blocks.
10758 Now, it will only merge if after the merge at least half of the
10763 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
10765 * class.cs : csc build fix for GetMethods(). See bug #52503.
10767 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
10769 * expression.cs: Make sure fp comparisons work with NaN.
10770 This fixes bug #54303. Mig approved this patch a long
10771 time ago, but we were not able to test b/c the runtime
10774 2004-03-19 Miguel de Icaza <miguel@ximian.com>
10776 * ecore.cs (TypExpr.GetHashCode): implement this overload.
10778 2004-03-19 Martin Baulig <martin@ximian.com>
10780 * class.cs (MemberCore.IsDuplicateImplementation): Report the
10781 error here and not in our caller.
10783 2004-03-19 Martin Baulig <martin@ximian.com>
10785 * interface.cs: Completely killed this file.
10786 (Interface): We're now a TypeContainer and live in class.cs.
10788 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10789 argument; we're now also called for interfaces.
10790 (TypeContainer.DefineMembers): Allow this method being called
10792 (TypeContainer.GetMethods): New public method; formerly known as
10793 Interface.GetMethod(). This is used by PendingImplementation.
10794 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10795 it's now private and non-static.
10796 (Interface): Moved this here; it's now implemented similar to
10798 (Method, Property, Event, Indexer): Added `bool is_interface'
10799 argument to their .ctor's.
10800 (MemberBase.IsInterface): New public field.
10802 * cs-parser.jay: Create normal Method, Property, Event, Indexer
10803 instances instead of InterfaceMethod, InterfaceProperty, etc.
10804 (opt_interface_base): Removed; we now use `opt_class_base' instead.
10805 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10807 2004-03-19 Martin Baulig <martin@ximian.com>
10809 * class.cs (MethodCore.IsDuplicateImplementation): New private
10810 method which does the CS0111 checking.
10811 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10812 Use IsDuplicateImplementation().
10814 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
10816 * decl.cs (FindMemberToOverride): New method to find the correct
10817 method or property to override in the base class.
10819 - Make Method/Property use the above method to find the
10820 version in the base class.
10821 - Remove the InheritableMemberSignatureCompare as it is now
10824 This patch makes large code bases much faster to compile, as it is
10825 O(n) rather than O(n^2) to do this validation.
10827 Also, it fixes bug 52458 which is that nested classes are not
10828 taken into account when finding the base class member.
10830 Reviewed/Approved by Martin.
10832 2004-03-17 Marek Safar <marek.safar@seznam.cz>
10834 * interface.cs: In all interface classes removed redundant
10835 member initialization.
10837 2004-03-16 Martin Baulig <martin@ximian.com>
10839 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10841 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10843 * decl.cs (DefineTypeAndParents): New helper method to define a
10844 type's containers before the type itself is defined; This is a
10845 bug exposed by the recent changes to Windows.Forms when an
10846 implemented interface was defined inside a class that had not been
10849 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10851 (Check): Loop correctly to report errors modifiers
10852 (UNSAFE was not in the loop, since it was the same as TOP).
10854 * interface.cs: Every interface member now takes a ModFlags,
10855 instead of a "is_new" bool, which we set on the base MemberCore.
10857 Every place where we called "UnsafeOk" in the interface, now we
10858 call the proper member (InterfaceMethod.UnsafeOK) instead to get
10859 the unsafe settings from the member declaration instead of the
10860 container interface.
10862 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
10864 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10865 `set_indexer_name' to the pending bits (one per type).
10867 We fixed a bug today that was picking the wrong method to
10868 override, since for properties the existing InterfaceMethod code
10869 basically ignored the method name. Now we make sure that the
10870 method name is one of the valid indexer names.
10872 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
10874 * support.cs (SeekableStreamReader): Keep track of stream byte
10875 positions and don't mix them with character offsets to the buffer.
10877 Patch from Gustavo Giráldez
10879 2004-03-15 Marek Safar <marek.safar@seznam.cz>
10881 * interface.cs (InterfaceSetGetBase): Removed double member
10882 initialization, base class does it as well.
10884 2004-03-13 Martin Baulig <martin@ximian.com>
10886 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10887 when compiling corlib.
10889 2004-03-13 Miguel de Icaza <miguel@ximian.com>
10891 * convert.cs (ExplicitConversion): We were reporting an error on
10892 certain conversions (object_type source to a value type, when the
10893 expression was `null') before we had a chance to pass it through
10894 the user defined conversions.
10896 * driver.cs: Replace / and \ in resource specifications to dots.
10899 * class.cs: Add check for duplicate operators. Fixes 52477
10901 2004-03-11 Miguel de Icaza <miguel@ximian.com>
10903 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10904 that are in the middle of the statements, not only at the end.
10907 * class.cs (TypeContainer.AddField): No longer set the
10908 `HaveStaticConstructor' flag, now we call it
10909 `UserDefineStaticConstructor' to diferentiate the slightly
10910 semantic difference.
10912 The situation is that we were not adding BeforeFieldInit (from
10913 Modifiers.TypeAttr) to classes that could have it.
10914 BeforeFieldInit should be set to classes that have no static
10919 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10921 And most importantly Zoltan's comment:
10923 http://bugzilla.ximian.com/show_bug.cgi?id=44229
10925 "I think beforefieldinit means 'it's ok to initialize the type sometime
10926 before its static fields are used', i.e. initialization does not need
10927 to be triggered by the first access to the type. Setting this flag
10928 helps the JIT to compile better code, since it can run the static
10929 constructor at JIT time, and does not need to generate code to call it
10930 (possibly lots of times) at runtime. Unfortunately, mcs does not set
10931 this flag for lots of classes like String.
10933 csc sets this flag if the type does not have an explicit static
10934 constructor. The reasoning seems to be that if there are only static
10935 initalizers for a type, and no static constructor, then the programmer
10936 does not care when this initialization happens, so beforefieldinit
10939 This bug prevents the AOT compiler from being usable, since it
10940 generates so many calls to mono_runtime_class_init that the AOT code
10941 is much slower than the JITted code. The JITted code is faster,
10942 because it does not generate these calls if the vtable is type is
10943 already initialized, which is true in the majority of cases. But the
10944 AOT compiler can't do this."
10946 2004-03-10 Miguel de Icaza <miguel@ximian.com>
10948 * class.cs (MethodData.Emit): Refactor the code so symbolic
10949 information is generated for destructors; For some reasons we
10950 were taking a code path that did not generate symbolic information
10953 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
10955 * class.cs: Create a Constructor.CheckBase method that
10956 takes care of all validation type code. The method
10957 contains some code that was moved from Define.
10959 It also includes new code that checks for duplicate ctors.
10960 This fixes bug #55148.
10962 2004-03-09 Joshua Tauberer <tauberer@for.net>
10964 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10965 a { ... }-style array creation invokes EmitStaticInitializers
10966 which is not good for reference-type arrays. String, decimal
10967 and now null constants (NullCast) are not counted toward
10968 static initializers.
10970 2004-03-05 Martin Baulig <martin@ximian.com>
10972 * location.cs (SourceFile.HasLineDirective): New public field;
10973 specifies whether the file contains or is referenced by a "#line"
10975 (Location.DefineSymbolDocuments): Ignore source files which
10976 either contain or are referenced by a "#line" directive.
10978 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
10980 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10981 direct access to our parent, so check the method inline there.
10983 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
10985 * expression.cs (Invocation.EmitCall): Miguel's last commit
10986 caused a regression. If you had:
10991 In Foo the implict this would be null.
10993 2004-02-27 Miguel de Icaza <miguel@ximian.com>
10995 * expression.cs (Invocation.EmitCall): If the method is not
10996 virtual, do not emit a CallVirt to it, use Call.
10998 * typemanager.cs (GetFullNameSignature): Improve the method to
10999 cope with ".ctor" and replace it with the type name.
11001 * class.cs (ConstructorInitializer.Resolve): Now the method takes
11002 as an argument the ConstructorBuilder where it is being defined,
11003 to catch the recursive constructor invocations.
11005 2004-02-26 Miguel de Icaza <miguel@ximian.com>
11007 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11008 routines to check if a type is an enumerable/enumerator allow
11009 classes that implement the IEnumerable or IEnumerator interfaces.
11011 * class.cs (Property, Operator): Implement IIteratorContainer, and
11012 implement SetYields.
11014 (Property.Define): Do the block swapping for get_methods in the
11015 context of iterators. We need to check if Properties also
11016 include indexers or not.
11018 (Operator): Assign the Block before invoking the
11019 OperatorMethod.Define, so we can trigger the Iterator code
11022 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
11023 Property and Operator classes are not created when we parse the
11024 declarator but until we have the block completed, so we use a
11025 singleton SimpleIteratorContainer.Simple to flag whether the
11026 SetYields has been invoked.
11028 We propagate this setting then to the Property or the Operator to
11029 allow the `yield' to function.
11031 2004-02-25 Marek Safar <marek.safar@seznam.cz>
11033 * codegen.cs: Implemented attribute support for modules.
11034 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11035 Assembly/Module functionality.
11037 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11038 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11039 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11041 2004-02-16 Marek Safar <marek.safar@seznam.cz>
11043 * interface.cs (FindMembers): The operation is performed on all base
11044 interfaces and not only on the first. It is required for future CLS Compliance patch.
11046 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
11048 * statement.cs, codegen.cs:
11049 This patch deals with patterns such as:
11051 public class List : IEnumerable {
11053 public MyEnumerator GetEnumerator () {
11054 return new MyEnumerator(this);
11057 IEnumerator IEnumerable.GetEnumerator () {
11061 public struct MyEnumerator : IEnumerator {
11066 Before, there were a few things we did wrong:
11067 1) we would emit callvirt on a struct, which is illegal
11068 2) we emited ldarg when we needed to emit ldarga
11069 3) we would mistakenly call the interface methods on an enumerator
11070 type that derived from IEnumerator and was in another assembly. For example:
11072 public class MyEnumerator : IEnumerator
11074 Would have the interface methods called, even if there were public impls of the
11075 method. In a struct, this lead to invalid IL code.
11077 2004-02-11 Marek Safar <marek.safar@seznam.cz>
11079 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11082 * delegate.cs (Define): Fixed crash when delegate type is undefined.
11084 2004-02-11 Miguel de Icaza <miguel@ximian.com>
11086 * cs-parser.jay: Fix small regression: we were not testing V2
11087 compiler features correctly.
11089 * interface.cs: If the emit context is null, then create one
11091 2004-02-09 Marek Safar <marek.safar@seznam.cz>
11093 * decl.cs (GetSignatureForError): New virtual method to get full name
11094 for error messages.
11096 * attribute.cs (IAttributeSupport): New interface for attribute setting.
11097 Now it is possible to rewrite ApplyAttributes method to be less if/else.
11099 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11100 Duplicated members and code in these classes has been removed.
11101 Better encapsulation in these classes.
11103 2004-02-07 Miguel de Icaza <miguel@ximian.com>
11105 * assign.cs (Assign.DoResolve): When dealing with compound
11106 assignments, there is a new rule in ECMA C# 2.4 (might have been
11107 there before, but it is documented here) that states that in:
11111 If b is of type int, and the `op' is a shift-operator, then the
11112 above is evaluated as:
11116 * expression.cs (Binary.ResolveOperator): Instead of testing for
11117 int/uint/long/ulong, try to implicitly convert to any of those
11118 types and use that in pointer arithmetic.
11120 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11121 method to print information for from the type, not from the
11122 null-method we were given.
11124 2004-02-01 Duncan Mak <duncan@ximian.com>
11126 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11127 parsing for cmd, fixes bug #53694.
11129 2004-02-04 Marek Safar <marek.safar@seznam.cz>
11131 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11132 in the member name duplication tests. Property and operator name duplication
11133 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11135 2004-02-03 Marek Safar <marek.safar@seznam.cz>
11137 * interface.cs (PopulateMethod): Fixed crash when interface method
11138 returns not existing type (error test cs0246-3.cs).
11140 2004-02-02 Ravi Pratap M <ravi@ximian.com>
11142 * cs-parser.jay (interface_accessors): Re-write actions to also
11143 store attributes attached to get and set methods. Fix spelling
11146 (inteface_property_declaration): Modify accordingly.
11148 (InterfaceAccessorInfo): New helper class to store information to pass
11149 around between rules that use interface_accessors.
11151 * interface.cs (Emit): Apply attributes on the get and set
11152 accessors of properties and indexers too.
11154 * attribute.cs (ApplyAttributes): Modify accordingly to use the
11155 right MethodBuilder when applying attributes to the get and set accessors.
11157 2004-01-31 Miguel de Icaza <miguel@ximian.com>
11159 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11161 2004-01-26 Miguel de Icaza <miguel@ximian.com>
11163 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11165 2004-01-25 Miguel de Icaza <miguel@ximian.com>
11167 * cs-parser.jay: Remove YIELD token, instead use the new grammar
11168 changes that treat `yield' specially when present before `break'
11169 or `return' tokens.
11171 * cs-tokenizer.cs: yield is no longer a keyword.
11173 2004-01-23 Marek Safar <marek.safar@seznam.cz>
11175 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11176 setting for default constructors.
11177 For default constructors are almost every time set wrong Modifier. The
11178 generated IL code has been alright. But inside mcs this values was
11179 wrong and this was reason why several of my CLS Compliance tests
11182 2004-01-22 Martin Baulig <martin@ximian.com>
11184 * cs-parser.jay (namespace_or_type_name): Return an Expression,
11185 not a QualifiedIdentifier. This is what `type_name_expression'
11186 was previously doing.
11187 (type_name_expression): Removed; the code is now in
11188 `namespace_or_type_name'.
11189 (qualified_identifier): Removed, use `namespace_or_type_name'
11191 (QualifiedIdentifier): Removed this class.
11193 2004-01-22 Martin Baulig <martin@ximian.com>
11195 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11196 not a string as alias name.
11198 2004-01-21 Miguel de Icaza <miguel@ximian.com>
11200 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11201 #52730 bug, and instead compute correctly the need to use a
11202 temporary variable when requesting an address based on the
11203 static/instace modified of the field and the constructor.
11205 2004-01-21 Martin Baulig <martin@ximian.com>
11207 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11208 class and namespace before looking up aliases. Fixes #52517.
11210 2004-01-21 Martin Baulig <martin@ximian.com>
11212 * flowanalysis.cs (UsageVector.Merge): Allow variables being
11213 assinged in a 'try'; fixes exception4.cs.
11215 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11216 * class.cs : Implemented parameter-less constructor for TypeContainer
11218 * decl.cs: Attributes are now stored here. New property OptAttributes
11220 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11222 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11224 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11226 * typemanager.cs (CSharpSignature): Now reports also inner class name.
11227 (CSharpSignature): New method for indexer and property signature.
11229 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11231 * pending.cs (IsVirtualFilter): Faster implementation.
11233 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11235 * typemanager.cs: Avoid inclusion of same assembly more than once.
11237 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11239 * cs-parser.jay: Fixed problem where the last assembly attribute
11240 has been applied also to following declaration (class, struct, etc.)
11242 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11244 * class.cs: Added error CS0538, CS0539 reporting.
11245 Fixed crash on Microsoft runtime when field type is void.
11247 * cs-parser.jay: Added error CS0537 reporting.
11249 * pending.cs: Added error CS0535 reporting.
11250 Improved error report for errors CS0536, CS0534.
11252 2004-01-20 Miguel de Icaza <miguel@ximian.com>
11254 Merge a few bits from the Anonymous Method MCS tree.
11256 * statement.cs (ToplevelBlock): New class for toplevel methods,
11257 will hold anonymous methods, lifted variables.
11259 * cs-parser.jay: Create toplevel blocks for delegates and for
11260 regular blocks of code.
11262 2004-01-20 Martin Baulig <martin@ximian.com>
11264 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11265 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11266 and `NeedExplicitReturn'; added `IsLastStatement'.
11267 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11268 have a `ReturnLabel' or we're not unreachable.
11270 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11271 child's reachability; don't just override ours with it. Fixes
11272 #58058 (lluis's example).
11273 (FlowBranching): Added public InTryOrCatch(), InCatch(),
11274 InFinally(), InLoop(), InSwitch() and
11275 BreakCrossesTryCatchBoundary() methods.
11277 * statement.cs (Return): Do all error checking in Resolve().
11278 Unless we are the last statement in a top-level block, always
11279 create a return label and jump to it.
11280 (Break, Continue): Do all error checking in Resolve(); also make
11281 sure we aren't leaving a `finally'.
11282 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11283 statement in a top-level block.
11284 (Block.Flags): Added `IsDestructor'.
11285 (Block.IsDestructor): New public property.
11287 2004-01-20 Martin Baulig <martin@ximian.com>
11289 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11291 2004-01-20 Martin Baulig <martin@ximian.com>
11293 * statement.cs (Statement.ResolveUnreachable): New public method.
11294 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11295 (Block.Resolve): Resolve unreachable statements.
11297 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11299 * expression.cs: We need to fix the case where we do
11300 not have a temp variable here.
11302 * assign.cs: Only expression compound assignments need
11303 temporary variables.
11305 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11307 * flowanalysis.cs: Reduce memory allocation in a few ways:
11308 - A block with no variables should not allocate a bit
11310 - A method with no out parameters does not need any tracking
11311 for assignment of the parameters, so we need not allocate
11314 public readonly Type[] VariableTypes;
11315 public readonly string[] VariableNames;
11316 Are redundant. The data is already stored in the variable
11317 map, so we need not allocate another array for it.
11318 - We need to add alot of checks for if (params | locals) == null
11319 due to the first two changes.
11321 2004-01-18 Miguel de Icaza <miguel@ximian.com>
11323 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11324 implement IMemoryLocation, we store a copy on a local variable and
11325 take the address of it. Patch from Benjamin Jemlich
11327 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11328 to use a special "type_name_expression" rule which reduces the
11329 number of "QualifiedIdentifier" classes created, and instead
11330 directly creates MemberAccess expressions.
11332 2004-01-17 Miguel de Icaza <miguel@ximian.com>
11334 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11335 that fixes #52853. Null literal assignment to ValueType
11337 * class.cs (MethodData.Emit): Instead of checking the name of the
11338 method to determine if its a destructor, create a new derived
11339 class from Method called Destructor, and test for that.
11341 * cs-parser.jay: Create a Destructor object instead of a Method.
11343 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11347 2004-01-16 Miguel de Icaza <miguel@ximian.com>
11349 * expression.cs (Binary.ResolveOperator): Perform an implicit
11350 conversion from MethodGroups to their delegate types on the
11351 Addition operation.
11353 * delegate.cs: Introduce a new class DelegateCreation that is the
11354 base class for `NewDelegate' and `ImplicitDelegateCreation',
11355 factor some code in here.
11357 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11358 conversion from MethodGroups to compatible delegate types.
11360 * ecore.cs (Expression.Resolve): Do not flag error 654
11361 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11362 we allow conversions from MethodGroups to delegate types now.
11364 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11365 assignments in v2 either.
11367 2004-01-10 Miguel de Icaza <miguel@ximian.com>
11369 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11370 static read-only fields in ctors.
11372 Applied patch from Benjamin Jemlich
11374 * expression.cs (UnaryMutator): Avoid leaking local variables.
11376 2004-01-09 Miguel de Icaza <miguel@ximian.com>
11378 * cs-tokenizer.cs (IsCastToken): Allow the various native types
11379 here to return true, as they can be used like this:
11381 (XXX) int.MEMBER ()
11383 Fixed 49836 and all the other dups
11385 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
11387 * driver.cs: Implement /win32res and /win32icon.
11389 2004-01-08 Miguel de Icaza <miguel@ximian.com>
11391 * cs-parser.jay: Add a rule to improve error handling for the
11392 common mistake of placing modifiers after the type.
11394 2004-01-07 Miguel de Icaza <miguel@ximian.com>
11396 * cs-parser.jay (interface_event_declaration): Catch
11397 initialization of events on interfaces, and report cs0068
11399 * cs-parser.jay (interface_event_declaration): Catch
11400 initialization of events.
11402 * ecore.cs: Better report missing constructors.
11404 * expression.cs (Binary.ResolveOperator): My previous bug fix had
11405 the error reporting done in the wrong place. Fix.
11407 * expression.cs (Binary.ResolveOperator): Catch the
11408 operator + (E x, E y) error earlier, and later allow for implicit
11409 conversions in operator +/- (E e, U x) from U to the underlying
11412 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11413 52596, if the container class is abstract, the default constructor
11414 is protected otherwise its public (before, we were always public).
11416 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11419 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11420 Jemlich that fixes bug #52597, MCS was generating invalid code for
11421 idisposable structs. Thanks to Ben for following up with this
11424 2004-01-06 Miguel de Icaza <miguel@ximian.com>
11426 * driver.cs: Allow assemblies without code to be generated, fixes
11429 2004-01-07 Nick Drochak <ndrochak@gol.com>
11431 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11433 2004-01-05 Miguel de Icaza <miguel@ximian.com>
11435 * cs-parser.jay: Add rules to improve error reporting if fields or
11436 methods are declared at the namespace level (error 116)
11438 * Add rules to catch event add/remove
11440 2004-01-04 David Sheldon <dave-mono@earth.li>
11442 * expression.cs: Added matching ")" to error message for
11445 2004-01-03 Todd Berman <tberman@gentoo.org>
11447 * ecore.cs, attribute.cs:
11448 Applying fix from #52429.
11450 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11452 * ecore.cs, expression.cs, statement.cs:
11453 Total rewrite of how we handle branching. We
11454 now handle complex boolean expressions with fewer
11455 jumps. As well if (x == 0) no longer emits a ceq.
11457 if (x is Foo) is much faster now, because we generate
11460 Overall, we get a pretty big improvement on our benchmark
11461 tests. The code we generate is smaller and more readable.
11463 I did a full two-stage bootstrap. The patch was reviewed
11464 by Martin and Miguel.
11466 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11468 * cs-parser.jay: Make primary_expression not take a QI.
11469 we dont need this because the member_access rule covers
11470 us here. So we replace the rule with just IDENTIFIER.
11472 This has two good effects. First, we remove a s/r conflict.
11473 Second, we allocate many fewer QualifiedIdentifier objects.
11475 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11477 * attribute.cs: Handle MarshalAs attributes as pseudo, and
11478 set the correct information via SRE. This prevents
11479 hanging on the MS runtime. Fixes #29374.
11481 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11483 * convert.cs: correctly handle conversions to value types
11484 from Enum and ValueType as unboxing conversions.
11486 Fixes bug #52569. Patch by Benjamin Jemlich.
11488 2004-01-02 Ravi Pratap <ravi@ximian.com>
11490 * expression.cs (BetterConversion): Prefer int -> uint
11491 over int -> ulong (csc's behaviour). This fixed bug #52046.
11493 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
11495 * decl.cs (MemberCache.FindMembers): now returns a
11498 * typemanager.cs: In general, go with with ^^.
11499 (CopyNewMethods): take an IList.
11500 (RealMemberLookup): Only allocate an arraylist
11501 if we copy from two sets of methods.
11503 This change basically does two things:
11504 1) Fewer array lists allocated due to CopyNewMethods.
11505 2) the explicit cast in MemberList costed ALOT.
11507 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
11509 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11510 a hashtable to avoid needless string allocations when an identifier is
11511 used more than once (the common case).
11513 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11515 * pending.cs: MS's TypeBuilder.GetInterfaces ()
11516 is broken, it will not return anything. So, we
11517 have to use the information we have in mcs to
11520 * typemanager.cs: Add a cache for GetInterfaces,
11521 since this will now be used more often (due to ^^)
11523 (GetExplicitInterfaces) New method that gets the
11524 declared, not effective, interfaces on a type
11525 builder (eg, if you have interface IFoo, interface
11526 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11529 This patch makes MCS able to bootstrap itself on
11532 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11534 * expression.cs: Remove the Nop's that Miguel put
11537 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11539 * report.cs, codegen.cs: Give the real stack trace to
11540 the error when an exception is thrown.
11542 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11544 * decl.cs: only allocate hashtables for ifaces if
11547 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11549 * expression.cs: fix the error from cs0121-2.cs
11550 (a parent interface has two child interfaces that
11551 have a function with the same name and 0 params
11552 and the function is called through the parent).
11554 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
11556 * class.cs, rootcontext.cs, typmanager.cs: do not
11559 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
11561 * codegen.cs: remove stack for the ec flow branching.
11562 It is already a linked list, so no need.
11564 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
11566 * Makefile: Allow custom profiler here.
11568 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11570 * typemanager.cs (LookupType):
11571 - Use a static char [], because split takes
11572 a param array for args, so it was allocating
11574 - Do not store true in a hashtable, it boxes.
11576 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11578 * flowanalysis.cs: bytify common enums.
11580 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11582 * modifiers.cs: Add a new set of flags for the
11583 flags allowed on explicit interface impls.
11584 * cs-parser.jay: catch the use of modifiers in
11585 interfaces correctly.
11586 * class.cs: catch private void IFoo.Blah ().
11588 All related to bug #50572.
11590 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11592 * decl.cs: Rewrite the consistant accessability checking.
11593 Accessability is not linear, it must be implemented in
11594 a tableish way. Fixes #49704.
11596 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11598 * expression.cs: Handle negation in a checked context.
11599 We must use subtraction from zero. Fixes #38674.
11601 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11603 * class.cs: Ignore static void main in DLLs.
11604 * rootcontext.cs: Handle the target type here,
11605 since we are have to access it from class.cs
11606 * driver.cs: account for the above.
11608 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11610 * report.cs: Give line numbers and files if available.
11612 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
11614 * driver.cs: Implement /addmodule.
11616 * typemanager.cs: Change 'modules' field so it now contains Modules not
11619 2003-12-20 Martin Baulig <martin@ximian.com>
11621 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11622 (FieldBase.IsAssigned): Removed this field.
11623 (FieldBase.SetAssigned): New public method.
11624 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11626 2003-12-20 Martin Baulig <martin@ximian.com>
11628 * expression.cs (LocalVariableReference.DoResolve): Don't set
11629 `vi.Used' if we're called from DoResolveLValue().
11631 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11632 returns the usage vector it just merged into the current one -
11633 pass this one to UsageWarning().
11634 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11635 of the `EmitContext', don't call this recursively on our children.
11637 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
11639 * driver.cs: Implement /target:module.
11641 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
11643 * support.cs (CharArrayHashtable): New helper class.
11645 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
11646 char arrays, not strings, so we can avoid creating a string in
11647 consume_identifier if the identifier is a keyword.
11649 2003-12-16 Martin Baulig <martin@ximian.com>
11651 * statement.cs (LocalInfo.Assigned): Removed this property.
11652 (LocalInfo.Flags): Removed `Assigned'.
11653 (LocalInfo.IsAssigned): New public method; takes the EmitContext
11654 and uses flow analysis.
11655 (Block.UsageWarning): Made this method private.
11656 (Block.Resolve): Call UsageWarning() if appropriate.
11658 * expression.cs (LocalVariableReference.DoResolve): Always set
11659 LocalInfo.Used here.
11661 2003-12-13 Martin Baulig <martin@ximian.com>
11663 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11664 any value here; we're now using flow analysis to figure out
11665 whether a statement/block returns a value.
11667 2003-12-13 Martin Baulig <martin@ximian.com>
11669 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11671 (FlowBranching.MergeFinally): Don't call
11672 `branching.CheckOutParameters()' here, this is called in
11674 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11675 when adding the `finally' vector.
11677 2003-12-13 Martin Baulig <martin@ximian.com>
11680 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11681 actually work and also fix #48962.
11683 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
11685 * decl.cs: Do not check System.Object for nested types,
11686 since we know it does not have any. Big bang for buck:
11689 Run 1: 8.35 seconds
11690 Run 2: 8.32 seconds
11691 corlib: 17.99 seconds
11693 Run 1: 8.17 seconds
11694 Run 2: 8.17 seconds
11695 corlib: 17.39 seconds
11697 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
11699 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11700 time we are returning 0 members, so we save alot here.
11702 2003-12-11 Martin Baulig <martin@ximian.com>
11704 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11705 `MergeChild()', also just take the `FlowBranching' as argument;
11706 call Merge() on it and return the result.
11707 (FlowBranching.Merge): We don't need to do anything if we just
11710 2003-12-11 Martin Baulig <martin@ximian.com>
11712 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11713 them in an `ArrayList' to reduce memory usage. Thanks to Ben
11714 Maurer for this idea.
11716 2003-12-11 Martin Baulig <martin@ximian.com>
11718 * flowanalysis.cs (MergeResult): This class is now gone; we now
11719 use the `UsageVector' for this. The reason for this is that if a
11720 branching just has one sibling, we don't need to "merge" them at
11721 all - that's the next step to do.
11722 (FlowBranching.Merge): We now return a `UsageVector' instead of a
11725 2003-12-11 Martin Baulig <martin@ximian.com>
11727 Reworked flow analyis and made it more precise and bug-free. The
11728 most important change is that we're now using a special `Reachability'
11729 class instead of having "magic" meanings of `FlowReturns'. I'll
11730 do some more cleanups and optimizations and also add some more
11731 documentation this week.
11733 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11734 largely reworked this class.
11735 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11736 the new `Reachability' class instead of having "magic" values here.
11737 (FlowBranching): We're now using an instance of `Reachability'
11738 instead of having separate `Returns', `Breaks' etc. fields.
11740 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11741 based on flow analysis; ignore the return value of block.Emit ().
11743 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
11745 * driver.cs typemanager.cs: Find the mono extensions to corlib even
11746 if they are private.
11748 2003-12-09 Martin Baulig <martin@ximian.com>
11750 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11751 call them directly on the UsageVector.
11753 2003-12-09 Martin Baulig <martin@ximian.com>
11755 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11756 Changed return type from `FlowReturns' to `Reachability'.
11758 2003-12-09 Martin Baulig <martin@ximian.com>
11760 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11761 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11762 `Reachable' fields with a single `Reachability' one.
11764 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11766 * class.cs (FindMembers): Remove foreach's.
11771 Run 1: 8.74 seconds
11772 Run 2: 8.71 seconds
11775 Run 1: 8.64 seconds
11776 Run 2: 8.58 seconds
11779 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11784 This patch does a few things:
11785 1. EmptyStatement is now a singleton, so it is never reallocated.
11786 2. All blah is EmptyStatement constructs have been changed to
11787 blah == EmptyStatement.Value, which is much faster and valid
11788 now that EmptyStatement is a singleton.
11789 3. When resolving a block, rather than allocating a new array for
11790 the non-empty statements, empty statements are replaced with
11791 EmptyStatement.Value
11792 4. Some recursive functions have been made non-recursive.
11793 Mainly the performance impact is from (3), however (1) and (2) are needed for
11794 this to work. (4) does not make a big difference in normal situations, however
11795 it makes the profile look saner.
11800 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11801 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11802 Total memory allocated: 56397 KB
11805 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11806 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11807 Total memory allocated: 55666 KB
11809 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11811 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11812 than the hashtable in a hashtable version
11814 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11815 we always end up concating a string. This results in a huge perf
11816 loss, because many strings have to be tracked by the GC. In this
11817 patch, we first use a hashtable that works with two keys, so that
11818 the strings do not need to be concat'ed.
11822 Run 1: 8.74 seconds
11823 Run 2: 8.71 seconds
11826 Run 1: 8.65 seconds
11827 Run 2: 8.56 seconds
11829 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11831 * Makefile: Add a new target `do-time' that does a quick and simple
11832 profile, leaving easy to parse output.
11834 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
11836 * codegen.cs (Init): Create the dynamic assembly with
11837 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11839 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
11841 * support.cs: Make the PtrHashtable use only one
11842 instance of its comparer.
11844 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
11846 * typemanager.cs: Fix lookup of GetNamespaces.
11848 2003-11-29 Miguel de Icaza <miguel@ximian.com>
11850 * expression.cs: Removed redundant line.
11852 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11853 ArrayLists, use for loops with bounds.
11855 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11858 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11859 arraylists, use for loop with bounds.
11861 The above three changes give us a 0.071 second performance
11862 improvement out of 3.294 seconds down to 3.223. On my machine
11863 the above changes reduced the memory usage by 1,387 KB during
11864 compiler bootstrap.
11866 * cs-parser.jay (QualifiedIdentifier): New class used to represent
11867 QualifiedIdentifiers. Before we created a new string through
11868 concatenation, and mostly later on, the result would be
11869 manipulated by DecomposeQI through string manipulation.
11871 This reduced the compiler memory usage for bootstrapping from
11872 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11873 compile times in 0.05 seconds.
11875 2003-11-28 Dick Porter <dick@ximian.com>
11877 * support.cs: Do string compares with the Invariant culture.
11885 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11886 the comparison is done with the Invariant culture.
11888 2003-11-27 Miguel de Icaza <miguel@ximian.com>
11890 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11891 GetEnumerator method.
11893 (ProbeCollectionType): Iterate starting at the most specific type
11894 upwards looking for a GetEnumerator
11896 * expression.cs: Shift count can be up to 31 for int/uint and 63
11899 2003-11-26 Miguel de Icaza <miguel@ximian.com>
11901 * statement.cs (Block.LookupLabel): Also look for the label on the
11902 children blocks. Use a hash table to keep track of visited
11905 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11906 we actually did transform the other operand, otherwise fall back
11907 to the common codepath that casts to long.
11909 * cs-tokenizer.cs: Use the same code pattern as the int case.
11910 Maybe I should do the parsing myself, and avoid depending on the
11911 Parse routines to get this done.
11913 2003-11-25 Miguel de Icaza <miguel@ximian.com>
11915 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11916 which fixes bug 51347. This time test it.
11918 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11919 attributes for example can not tell the difference between these.
11920 The difference was only a syntax feature of the language.
11922 * attribute.cs: Apply attributes to delegates.
11924 * delegate.cs: Call the apply attributes method.
11926 2003-11-24 Miguel de Icaza <miguel@ximian.com>
11928 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11929 comparing 0 vs Byte.MinValue, not the value
11931 (ImplicitConversionRequired): When reporting a conversion error,
11932 use error 31 to print out the constant error instead of the
11935 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11936 which fixes bug 51347.
11938 2003-11-22 Miguel de Icaza <miguel@ximian.com>
11940 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
11941 which fixes the -warnaserror command line option.
11943 2003-11-21 Miguel de Icaza <miguel@ximian.com>
11945 * cfold.cs (DoNumericPromotions): During constant folding of
11946 additions on UIntConstant, special case intconstants with
11947 IntConstants like we do on the expression binary operator.
11949 2003-11-12 Miguel de Icaza <miguel@ximian.com>
11951 * convert.cs (ImplicitReferenceConversion): We were missing a case
11952 (System.Enum are not value types or class types, so we need to
11953 classify them separatedly).
11955 * driver.cs: We do not support error 2007.
11957 2003-11-12 Jackson Harper <jackson@ximian.com>
11959 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11960 system directory. Also use the full file name so users can
11961 libraries names mscorlib-o-tron.dll in a non system dir.
11963 2003-11-10 Martin Baulig <martin@ximian.com>
11965 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11966 (TypeManager.InitCoreTypes): Initialize them here, but instead of
11967 calling `ResolveType()' on them, directly assign their `Type'.
11969 2003-11-08 Martin Baulig <martin@ximian.com>
11971 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11972 return value and the `out parent' parameter.
11973 (TypeContainer.DefineType): Moved the CS0644 check into
11974 GetClassBases(). Don't pass the interface types to the
11975 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11976 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11978 * ecore.cs (TypeExpr.IsAttribute): New property.
11979 (TypeExpr.GetInterfaces): New method.
11981 * interface.cs (Interface.GetInterfaceTypeByName): Return a
11982 TypeExpr instead of a Type.
11983 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11984 (Interface.DefineType): Don't pass the interface types to the
11985 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11986 them later and then call `TypeBulider.AddInterfaceImplementation()'.
11988 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11989 instead of a `Type[]'.
11990 (TypeManager.RegisterBuilder): Likewise.
11991 (TypeManager.AddUserInterface): Likewise.
11992 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11993 `Type[]' and also return a `TypeExpr[]'.
11994 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11996 2003-11-08 Martin Baulig <martin@ximian.com>
11998 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12001 2003-11-08 Martin Baulig <martin@ximian.com>
12003 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12004 TypeManager.ResolveExpressionTypes().
12006 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12007 instead of an Expression.
12008 (TypeExpr): This is now an abstract base class for `TypeExpression'.
12009 (TypeExpression): New public class; formerly known as `TypeExpr'.
12011 * expression.cs (ComposedCast): Derive from TypeExpr.
12013 * typemanager.cs (TypeManager.system_*_expr): These are now
12014 TypExpr's instead of Expression's.
12015 (TypeManager.ResolveExpressionTypes): New public static function;
12016 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12019 2003-11-06 Miguel de Icaza <miguel@ximian.com>
12021 * expression.cs (New.DoResolve): Do not dereference value that
12022 might be a null return.
12024 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12025 sure that the constant value has the right type. Fixes an
12026 unreported bug, similar to 50425.
12028 * const.cs (Const.LookupConstantValue): Call
12029 ImplicitStandardConversionExists before doing a conversion to
12030 avoid havng the TypeManager.ChangeType do conversions.
12032 Reduced the number of casts used
12034 (Const.ChangeType): New routine to enable reuse of the constant
12035 type changing code from statement.
12037 * typemanager.cs (ChangeType): Move common initialization to
12038 static global variables.
12042 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12043 every value type to go through, even if it was void. Fix that.
12045 * cs-tokenizer.cs: Use is_identifier_start_character on the start
12046 character of the define, and the is_identifier_part_character for
12047 the rest of the string.
12049 2003-11-05 Miguel de Icaza <miguel@ximian.com>
12051 * expression.cs (UnaryMutator.EmitCode): When I updated
12052 LocalVariableReference.DoResolve, I overdid it, and dropped an
12053 optimization done on local variable references.
12055 2003-11-04 Miguel de Icaza <miguel@ximian.com>
12057 * ecore.cs: Convert the return from Ldlen into an int.
12059 2003-10-20 Miguel de Icaza <miguel@ximian.com>
12061 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12062 the accessibility, this is a special case for toplevel non-public
12063 classes (internal for instance).
12065 2003-10-20 Nick Drochak <ndrochak@gol.com>
12067 * ecore.cs: Fix typo and build. Needed another right paren.
12069 2003-10-19 Miguel de Icaza <miguel@ximian.com>
12071 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
12072 `internal' case regular and protected, but not allowing protected
12073 to be evaluated later. Bug 49840
12075 2003-10-15 Miguel de Icaza <miguel@ximian.com>
12077 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12078 to kb.Nlast, and not the kb.nFirst to isolate the switch
12081 Extract the underlying type, so enumerations of long/ulong are
12082 treated like long/ulong.
12084 2003-10-14 Miguel de Icaza <miguel@ximian.com>
12086 * expression.cs (New): Overload the meaning of RequestedType to
12087 track the possible creation of the NewDelegate type, since
12088 DoResolve is invoked more than once for new constructors on field
12091 See bugs: #48800 and #37014
12093 * cs-parser.jay (declare_local_constants): Take an arraylist
12094 instead of a single constant.
12096 (local_constant_declaration): It should take a
12097 constant_declarators, not a constant_declarator. Fixes 49487
12099 * convert.cs: Fix error report.
12101 2003-10-13 Jackson Harper <jackson@ximian.com>
12103 * typemanager.cs (TypeToCoreType): Add float and double this fixes
12106 2003-10-09 Martin Baulig <martin@ximian.com>
12108 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12110 (MethodCore.DoDefineParameters): Removed the TypeContainer
12111 argument; use the DeclSpace which was passed to the .ctor instead.
12112 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12113 TypeContainer; we only need a DeclSpace here.
12115 2003-10-09 Martin Baulig <martin@ximian.com>
12117 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12119 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12120 EmitContext's .ctor.
12122 2003-10-09 Martin Baulig <martin@ximian.com>
12124 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12125 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12126 AsAccessible(), moved them as well.
12128 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12130 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12132 * cs-parser.jay : Renamed yyName to yyNames related to jay.
12134 2003-10-07 Miguel de Icaza <miguel@ximian.com>
12136 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12137 generation for >=, as spotted by Paolo, bug 48679.
12138 Patch from David Waite.
12140 * cs-tokenizer.cs: Add handling for #pragma.
12142 * cs-parser.jay: Allow for both yield and yield return in the
12143 syntax. The anti-cobolization of C# fight will go on!
12145 * class.cs (TypeBuilder.DefineType): Catch error condition here
12146 (Parent.DefineType erroring out and returning null).
12148 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12149 coping with enumerations variables, we were mistakenly processing
12150 them as a regular value type instead of built-in types. Fixes the
12153 * typemanager.cs (IsBuiltinOrEnum): New method.
12155 2003-09-30 Miguel de Icaza <miguel@ximian.com>
12157 * cs-parser.jay: Upgrade: yield now needs the return clause.
12159 2003-09-19 Martin Baulig <martin@ximian.com>
12161 * decl.cs (MemberCache.SetupCacheForInterface): Take a
12162 `MemberCache parent' argument. Normally, an interface doesn't
12163 have a parent type except System.Object, but we use this in gmcs
12164 for generic type parameters.
12166 2003-09-18 Martin Baulig <martin@ximian.com>
12168 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12169 on `type.IsInterface'; don't check whether the type has a parent
12170 to determine whether it's an interface.
12172 2003-09-15 Martin Baulig <martin@ximian.com>
12174 * class.cs (TypeContainer.DefineType): Added an error flag to
12175 avoid reporting duplicate CS0146's ("class definition is
12178 * driver.cs (Driver.MainDriver): Abort if
12179 RootContext.ResolveTree() reported any errors.
12181 2003-09-07 Martin Baulig <martin@ximian.com>
12183 * report.cs (Error, Warning): Added overloaded versions which take
12184 a `params object[] args' and call String.Format().
12186 2003-09-07 Martin Baulig <martin@ximian.com>
12188 * decl.cs (DeclSpace..ctor): Don't call
12189 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12190 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
12191 (DeclSpace.RecordDecl): New method.
12193 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12195 2003-09-02 Ravi Pratap <ravi@ximian.com>
12197 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12198 value attributes to be applied to ParameterBuilders.
12200 * class.cs (MethodCore.LabelParameters): Make static and more
12201 generic so that it can be used from other places - like interface
12202 methods, for instance.
12204 * interface.cs (Interface.Emit): Call LabelParameters before
12205 emitting attributes on the InterfaceMethod.
12207 2003-08-26 Martin Baulig <martin@ximian.com>
12209 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12210 resolving aliases; fixes #47927.
12212 2003-08-26 Martin Baulig <martin@ximian.com>
12214 * statement.cs (Using.DoResolve): This is internally emitting a
12215 try/finally clause, so we need to set ec.NeedExplicitReturn if we
12216 do not always return. Fixes #47681.
12218 2003-08-26 Martin Baulig <martin@ximian.com>
12220 * decl.cs (MemberCore): Moved WarningNotHiding(),
12221 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12223 (AdditionResult): Make this nested in DeclSpace.
12224 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12225 argument; call NamespaceEntry.Define() unless we're nested in a
12228 * namespace.cs (Namespace.DefineName): New public function. This
12229 is called from DeclSpace's .ctor to add
12230 (Namespace.Lookup): Include DeclSpaces in the lookup.
12232 * class.cs (Operator): Derive from MemberBase, not MemberCore.
12234 * const.cs (Const): Derive from MemberBase, not MemberCore.
12236 2003-08-25 Martin Baulig <martin@ximian.com>
12238 * convert.cs (Convert.ExplicitReferenceConversion): When
12239 converting from an interface type to a class, unbox if the target
12240 type is a struct type. Fixes #47822.
12242 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12244 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12247 2003-08-22 Martin Baulig <martin@ximian.com>
12249 * class.cs (TypeManager.DefineType): When defining a nested type,
12250 call DefineType() on our parent; fixes #47801.
12252 2003-08-22 Martin Baulig <martin@ximian.com>
12254 * class.cs (MethodData.Define): While checking if a method is an
12255 interface implementation, improve the test a bit more to fix #47654.
12257 2003-08-22 Martin Baulig <martin@ximian.com>
12259 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12260 correctly; fixes #47722.
12262 2003-08-22 Martin Baulig <martin@ximian.com>
12264 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12265 LocalVariableReference, ensure it's not read-only. Fixes #47536.
12267 * statement.cs (Fixed.DoResolve): Make all variables read-only.
12269 2003-08-22 Martin Baulig <martin@ximian.com>
12271 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12272 can only be assigned in static constructors. Fixes #47161.
12274 2003-08-22 Martin Baulig <martin@ximian.com>
12276 Rewrote and improved the flow analysis code.
12278 * flowbranching.cs (FlowBranching): Make this class abstract.
12279 (FlowBranching.CreateBranching): New static function to create a
12280 new flow branching.
12281 (FlowBranchingBlock, FlowBranchingException): New classes.
12282 (FlowBranching.UsageVector.Type): New public readonly field.
12283 (FlowBranching.UsageVector.Breaks): Removed the setter.
12284 (FlowBranching.UsageVector.Returns): Removed the setter.
12285 (FlowBranching.UsageVector): Added Break(), Return(),
12286 NeverReachable() and Throw() methods to modify the reachability.
12287 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12288 done by FlowBranching.Merge().
12289 (FlowBranching.UsageVector.MergeChild): New method; merges the
12290 merge result into the current vector.
12291 (FlowBranching.Merge): New abstract method to merge a branching.
12293 2003-08-12 Martin Baulig <martin@ximian.com>
12295 * expression.cs (Indirection.CacheTemporaries): Create the
12296 LocalTemporary with the pointer type, not its element type.
12298 2003-08-10 Miguel de Icaza <miguel@ximian.com>
12300 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12301 token was a keyword or not.
12303 Add `error' options where an IDENTIFIER was expected; Provide
12304 CheckToken and CheckIdentifierToken convenience error reporting
12307 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12309 * decl.cs: Rename `NamespaceEntry Namespace' public field into
12310 NameSpaceEntry NameSpaceEntry.
12312 (LookupInterfaceOrClass): Avoid creating a full qualified name
12313 from namespace and name: avoid doing lookups when we know the
12314 namespace is non-existant. Use new Tree.LookupByNamespace which
12315 looks up DeclSpaces based on their namespace, name pair.
12317 * driver.cs: Provide a new `parser verbose' to display the
12318 exception thrown during parsing. This is turned off by default
12319 now, so the output of a failure from mcs is more graceful.
12321 * namespace.cs: Track all the namespaces defined in a hashtable
12324 (IsNamespace): New method
12326 2003-08-09 Miguel de Icaza <miguel@ximian.com>
12328 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
12329 we know that we need to concatenate (full typename can never be
12334 * statement.cs: Use a bitfield; Do not initialize to null things
12335 which are done by the constructor by default.
12337 * cs-parser.jay: bug fix, parameter was 4, not 3.
12339 * expression.cs: Just use the property;
12341 * statement.cs: No need for GetVariableInfo method.
12343 2003-08-08 Martin Baulig <martin@ximian.com>
12345 * flowanalysis.cs (FlowReturns): This is now nested in the
12346 `FlowBranching' class.
12347 (MyBitVector): Moved this here from statement.cs.
12348 (FlowBranching.SiblingType): New enum type.
12349 (FlowBranching.CreateSibling): Added `SiblingType' argument.
12351 2003-08-07 Martin Baulig <martin@ximian.com>
12353 * flowanalysis.cs (FlowBranchingType): This is now nested in the
12354 `FlowBranching' class and called `BranchingType'.
12356 2003-08-07 Martin Baulig <martin@ximian.com>
12358 * flowanalysis.cs: Moved all the control flow analysis code into
12361 2003-08-07 Martin Baulig <martin@ximian.com>
12363 * assign.cs (Assign.DoResolve): `target' must either be an
12364 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
12367 2003-08-07 Miguel de Icaza <miguel@ximian.com>
12369 * expression.cs (BinaryMethod): This kind of expression is created by the
12370 Binary class if it determines that the operator has to be handled
12373 (BinaryDelegate): This kind of expression is created if we are
12374 dealing with a + or - operator on delegates.
12376 (Binary): remove method, argumetns, and DelegateOperator: when
12377 dealing with methods,
12379 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12381 * statement.cs (Block): use bitfields for the three extra booleans
12382 we had in use. Remove unused topblock parameter.
12384 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12386 * assign.cs: Drop extra unneeded tests.
12388 2003-08-06 Miguel de Icaza <miguel@ximian.com>
12390 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12392 * statement.cs (Foreach): Use VariableStorage instead of
12395 * codegen.cs (VariableStorage): New class used by clients that
12396 require a variable stored: locals or fields for variables that
12397 need to live across yield.
12399 Maybe provide a convenience api for EmitThis+EmitLoad?
12401 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12404 2003-08-05 Miguel de Icaza <miguel@ximian.com>
12406 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12407 RemapParameterLValue): New methods that are used to turn a
12408 precomputed FieldInfo into an expression like this:
12412 The idea is to use this instead of making LocalVariableReference
12413 have more than one meaning.
12415 * cs-parser.jay: Add error production to BASE.
12417 * ecore.cs: Deal with TypeManager.GetField returning null, which
12418 is now a valid return value.
12420 (FieldExprNoAddress): New expression for Fields whose address can
12423 * expression.cs (LocalVariableReference): During the resolve
12424 phases, create new expressions if we are in a remapping context.
12425 Remove code that dealt with remapping here.
12427 (ParameterReference): same.
12429 (ProxyInstance): New expression, like the `This' expression, but
12430 it is born fully resolved. We know what we are doing, so remove
12431 the errors that are targeted to user-provided uses of `this'.
12433 * statement.cs (Foreach): our variable is now stored as an
12434 Expression; During resolution, follow the protocol, dont just
12435 assume it will return this.
12437 2003-08-06 Martin Baulig <martin@ximian.com>
12439 * support.cs (SeekableStreamReader.cs): New public class.
12441 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12442 SeekableStreamReader instead of the normal StreamReader.
12444 2003-08-04 Martin Baulig <martin@ximian.com>
12446 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12447 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12448 deambiguate casts and delegate invocations.
12449 (parenthesized_expression): Use the new tokens to ensure this is
12450 not a cast of method invocation.
12452 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12453 when reading a `)' and Deambiguate_CloseParens () was previously
12456 * expression.cs (ParenthesizedExpression): New class. This is
12457 just used for the CS0075 test.
12458 (Binary.DoResolve): Check for CS0075.
12460 2003-07-29 Ravi Pratap <ravi@ximian.com>
12462 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12463 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12464 reference comparison.
12466 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12467 examine the ReturnType for equality - this is necessary in the
12468 cases of implicit and explicit operators whose signature also
12469 includes the return type.
12471 2003-07-26 Miguel de Icaza <miguel@ximian.com>
12473 * namespace.cs: Cache the result of the namespace computation,
12474 instead of computing it every time.
12476 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12478 * decl.cs: Use a global arraylist that we reuse over invocations
12479 to avoid excesive memory consumption. Reduces memory usage on an
12480 mcs compile by one meg (45 average).
12482 * typemanager.cs (LookupTypeReflection): In .NET pointers are
12483 private, work around that.
12485 2003-07-23 Miguel de Icaza <miguel@ximian.com>
12487 * literal.cs (IntLiteral): Define Zero and One static literals.
12489 * cs-parser.jay (integer_literal): use static literals to reduce
12490 memory usage for the most used literals (0, 1 and -1). 211kb
12491 reduced in memory usage.
12493 Replace all calls to `new ArrayList' with `new
12494 ArrayList(4)' which is a good average number for most allocations,
12495 and also requires only 16 bytes of memory for its buffer by
12498 This reduced MCS memory usage in seven megabytes for the RSS after
12501 2003-07-28 Ravi Pratap <ravi@ximian.com>
12503 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12504 handle params methods the correct way by forming only one
12505 applicable set with params and normal methods in them. Earlier we
12506 were looking at params methods only if we found no normal methods
12507 which was not the correct thing to do.
12509 (Invocation.BetterFunction): Take separate arguments indicating
12510 when candidate and the best method are params methods in their
12513 This fixes bugs #43367 and #46199.
12515 * attribute.cs: Documentation updates.
12517 (CheckAttribute): Rename to CheckAttributeTarget.
12518 (GetValidPlaces): Rename to GetValidTargets.
12520 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12521 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12525 2003-07-28 Martin Baulig <martin@ximian.com>
12527 * class.cs (TypeContainer.DefineMembers): Use the base type's full
12528 name when looking up the base class of a nested class. Fixes #46977.
12530 2003-07-26 Martin Baulig <martin@ximian.com>
12532 * expression.cs (Indexers.Indexer): New nested struct; contains
12533 getter, setter and the indexer's type.
12534 (Indexers.Properties): This is now an ArrayList of
12535 Indexers.Indexer's.
12536 (IndexerAccess.DoResolveLValue): Correctly set the type if the
12537 indexer doesn't have any getters.
12539 * assign.cs (Assign.DoResolve): Also do the implicit conversions
12540 for embedded property and indexer assignments.
12542 2003-07-26 Martin Baulig <martin@ximian.com>
12544 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
12545 preprocessor directive is not the first non-whitespace character
12548 2003-07-26 Martin Baulig <martin@ximian.com>
12550 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
12551 namespace parsing, follow the spec more closely.
12553 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
12554 NamespaceEntry.Lookup().
12556 2003-07-25 Martin Baulig <martin@ximian.com>
12558 * MethodCore.cs (OverridesSomething): New public field; it's set
12559 from TypeContainer.DefineMembers if this method overrides
12560 something (which doesn't need to be a method). Fix #39462.
12562 2003-07-25 Ravi Pratap <ravi@ximian.com>
12564 * typemanager.cs (GetMembers): Ensure that the list of members is
12565 reversed. This keeps things in sync.
12567 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
12568 find an AttributeUsage attribute.
12570 * expression.cs (Invocation.OverloadResolve): Perform the check
12571 which disallows Invoke to be directly called on a Delegate.
12573 (Error_InvokeOnDelegate): Report error cs1533.
12575 2003-07-25 Martin Baulig <martin@ximian.com>
12577 * expression.cs (Indexers.GetIndexersForType): Only look in the
12578 interface hierarchy if the requested type is already an
12579 interface. Fixes #46788 while keeping #46502 fixed.
12581 2003-07-25 Martin Baulig <martin@ximian.com>
12583 * class.cs (TypeContainer.DefineMembers): Check whether all
12584 readonly fields have been assigned and report warning CS0649 if
12587 * statement.cs (LocalInfo.IsFixed): Always return true if this is
12590 2003-07-24 Ravi Pratap <ravi@ximian.com>
12592 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
12593 returned from GetMethods to make things consistent with the
12594 assumptions MCS makes about ordering of methods.
12596 This should comprehensively fix bug #45127 and it does :-)
12598 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
12599 ordering is actually reverse.
12601 * Clean up some debug messages I left lying around.
12603 * interface.cs (Populate*): Get rid of code which emits attributes
12604 since the stage in which we emit attributes is the 'Emit' stage,
12605 not the define stage.
12607 (Emit): Move attribute emission for interface members here.
12609 2003-07-22 Ravi Pratap <ravi@ximian.com>
12611 * expression.cs (Invocation.OverloadResolve): Follow the spec more
12612 closely: we eliminate methods in base types when we have an
12613 applicable method in a top-level type.
12615 Please see section 14.5.5.1 for an exact description of what goes
12618 This fixes bug #45127 and a host of other related to corlib compilation.
12620 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12621 array is the method corresponding to the top-level type (this is
12622 because of the changes made to icall.c) so we change this
12625 (MethodGroupExpr.Name): This too.
12627 * typemanager.cs (GetElementType): New method which does the right
12628 thing when compiling corlib.
12630 * everywhere: Make use of the above in the relevant places.
12632 2003-07-22 Martin Baulig <martin@ximian.com>
12634 * cs-parser.jay (invocation_expression): Moved
12635 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12636 `cast_expression', but create a InvocationOrCast which later
12637 resolves to either an Invocation or a Cast.
12639 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12640 method; call this before EmitStatement() to make sure that this
12641 expression can be used as a statement.
12643 * expression.cs (InvocationOrCast): New class; resolves to either
12644 an Invocation or a Cast.
12646 * statement.cs (StatementExpression): Call ResolveStatement() on
12647 the ExpressionStatement before emitting it.
12649 2003-07-21 Martin Baulig <martin@ximian.com>
12651 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12652 `ref' and `out' attributes match; fixes #46220.
12653 (MemberAccess.ResolveMemberAccess): You can't reference a type
12654 through an expression; fixes #33180.
12655 (Indexers.GetIndexersForType): Don't return the indexers from
12656 interfaces the class implements; fixes #46502.
12658 2003-07-21 Martin Baulig <martin@ximian.com>
12660 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12661 CS0661 checks; fixes bug #30442.
12663 2003-07-21 Martin Baulig <martin@ximian.com>
12665 * decl.cs (AdditionResult): Added `Error'.
12667 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12669 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
12670 makes cs0031.cs actually work.
12672 2003-07-20 Martin Baulig <martin@ximian.com>
12674 * namespace.cs: Fixed that bug which caused a crash when compiling
12675 the debugger's GUI.
12677 2003-07-20 Miguel de Icaza <miguel@ximian.com>
12679 * typemanager.cs (LookupTypeReflection): Never expose types which
12680 are NotPublic, NestedPrivate, NestedAssembly, or
12681 NestedFamANDAssem. We used to return these, and later do a check
12682 that would report a meaningful error, but the problem is that we
12683 would not get the real match, if there was a name override.
12685 2003-07-18 Miguel de Icaza <miguel@ximian.com>
12687 * namespace.cs (Namespace, Name): Do not compute the namespace
12688 name dynamically, compute it in the constructor. This reduced
12689 memory usage by 1697 KB.
12691 * driver.cs: Use --pause to pause at the end.
12693 2003-07-17 Peter Williams <peter@newton.cx>
12695 * Makefile: Change the name of the test target so that it doesn't
12696 conflict with the recursive test target.
12698 2003-07-17 Miguel de Icaza <miguel@ximian.com>
12700 * expression.cs (LocalVariableReference.Emit, EmitAssign,
12701 AddressOf): Do not use EmitThis, that was wrong, use the actual
12704 2003-07-15 Miguel de Icaza <miguel@ximian.com>
12706 * class.cs (MethodData.Define): While checking if a method is an
12707 interface implementation, improve the test: If we are not public
12708 (use new test here: use the computed MethodAttributes directly,
12709 instead of the parsed modifier flags) check if the `implementing'
12710 method comes from an interface or not.
12712 * pending.cs (VerifyPendingMethods): Slightly better error
12715 * makefile: add test target that does the mcs bootstrap.
12717 2003-07-16 Ravi Pratap <ravi@ximian.com>
12719 * interface.cs (Define): Do nothing here since there are no
12720 members to populate etc. Move the attribute emission out of here
12721 since this was just totally the wrong place to put it. Attribute
12722 application happens during the 'Emit' phase, not in the 'Define'
12725 (Emit): Add this method and move the attribute emission here
12727 * rootcontext.cs (EmitCode): Call the Emit method on interface
12730 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12732 * expression.cs (OverloadResolve): Report error only if Location
12733 is not 'Null' which means that there was a probe going on.
12735 2003-07-14 Martin Baulig <martin@ximian.com>
12737 * expression.cs (ConditionalLogicalOperator): New public class to
12738 implement user defined conditional logical operators.
12739 This is section 14.11.2 in the spec and bug #40505.
12741 2003-07-14 Martin Baulig <martin@ximian.com>
12743 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12745 2003-07-14 Martin Baulig <martin@ximian.com>
12747 * codegen.cs (EmitContext.InFixedInitializer): New public field.
12749 * ecore.cs (IVariable.VerifyFixed): New interface method.
12751 * expression.cs (Unary.ResolveOperator): When resolving the `&'
12752 operator, check whether the variable is actually fixed. Fixes bug
12753 #36055. Set a variable definitely assigned when taking its
12754 address as required by the spec.
12756 * statement.cs (LocalInfo.IsFixed): New field.
12757 (LocalInfo.MakePinned): Set `IsFixed' to true.
12759 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12761 * attribute.cs (Attribute.Resolve): While doing a Member lookup
12762 for .ctors, ensure that we only ask for members declared in the
12763 attribute type (BindingFlags.DeclaredOnly).
12767 * expression.cs (Error_WrongNumArguments): Report error 1501
12768 correctly the way CSC does.
12770 2003-07-13 Martin Baulig <martin@ximian.com>
12772 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12773 lookup on the fully qualified name, to make things like "X.X" work
12774 where "X.X" is a fully qualified type name, but we also have a
12775 namespace "X" in the using list. Fixes #41975.
12777 2003-07-13 Martin Baulig <martin@ximian.com>
12779 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12780 function. If we're a CompoundAssign, we need to create an embedded
12781 CompoundAssign, not an embedded Assign.
12782 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12785 2003-07-13 Martin Baulig <martin@ximian.com>
12787 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12788 work to fix bug #46088.
12790 2003-07-13 Ravi Pratap <ravi@ximian.com>
12792 * class.cs (Operator.Emit): Do not emit attributes here - it is
12793 taken care of by the Method class that we delegate too. This takes
12794 care of bug #45876.
12796 2003-07-10 Martin Baulig <martin@ximian.com>
12798 * expression.cs (TypeOfVoid): New class.
12799 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
12801 2003-07-10 Martin Baulig <martin@ximian.com>
12803 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12806 2003-07-10 Martin Baulig <martin@ximian.com>
12808 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12809 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12811 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12813 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12815 2003-07-10 Martin Baulig <martin@ximian.com>
12817 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12818 of decimal. Fixes #42850.
12820 NOTE: I also fixed the created byte blob, but this doesn't work on
12821 the MS runtime and csc never produces any byte blobs for decimal
12824 2003-07-10 Martin Baulig <martin@ximian.com>
12826 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12827 structs; fixes #32068.
12828 (Block.AddChildVariableNames): Fixed #44302.
12830 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12832 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12834 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12836 * attribute.cs: And this test is onger needed.
12838 2003-07-08 Martin Baulig <martin@ximian.com>
12840 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12841 inaccessible types. Fixes #36313.
12843 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12845 * namespace.cs (NamespaceEntry): Create implicit entries for all
12846 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12847 implicit entries for N1.N2 and N1.
12849 2003-07-08 Martin Baulig <martin@ximian.com>
12851 Rewrote the handling of namespaces to fix a lot of the issues
12852 wrt. `using' aliases etc.
12854 * namespace.cs (Namespace): Splitted this class into a
12855 per-assembly `Namespace' and a per-file `NamespaceEntry'.
12857 * typemanager.cs (TypeManager.IsNamespace): Removed.
12858 (TypeManager.ComputeNamespaces): Only compute namespaces from
12859 loaded assemblies here, not the namespaces from the assembly we're
12860 currently compiling.
12862 2003-07-08 Martin Baulig <martin@ximian.com>
12864 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12866 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12868 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12871 I thought about the memory savings here, but LookupTypeReflection
12872 is used under already very constrained scenarios. Compiling
12873 corlib or mcs only exposes one hit, so it would not really reduce
12874 any memory consumption.
12876 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12878 * typemanager.cs: fixes bug #45889 by only adding public types from
12879 other assemblies to the list of known types.
12881 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12883 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12884 on the type we resolved.
12886 2003-07-05 Martin Baulig <martin@ximian.com>
12888 * pending.cs (PendingImplementation.ParentImplements): Don't
12889 create the proxy if the parent is abstract.
12891 * class.cs (TypeContainer.DefineIndexers): Process explicit
12892 interface implementations first. Fixes #37714.
12894 2003-07-04 Miguel de Icaza <miguel@ximian.com>
12896 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12897 defined recursively; but since we modify the input parameters
12898 (left is set to `this' temporarily), we reset this value if the
12899 left_is_explicit is false, which gives the original semantics to
12902 * literal.cs (NullPointer): new class used to represent a null
12903 literal in a pointer context.
12905 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12906 type is a pointer, use a NullPointer object instead of a
12907 NullLiteral. Closes 43687
12909 (ExplicitConversion): Convert pointer values using
12910 the conv opcode to the proper type.
12912 * ecore.cs (New): change ValueTypeVariable property into a method,
12913 that returns whether the valuetype is suitable for being used.
12915 * expression.cs (Binary.DoNumericPromotions): Only return if we
12916 the int constant was a valid uint, and we can return both left and
12917 right as uints. If not, we continue processing, to trigger the
12918 type conversion. This fixes 39018.
12920 * statement.cs (Block.EmitMeta): During constant resolution, set
12921 the CurrentBlock property on the emitcontext, so that we resolve
12922 constants propertly.
12924 2003-07-02 Martin Baulig <martin@ximian.com>
12926 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12927 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12929 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12930 than emitting it here.
12932 * statement.cs: Fixed some more flow analysis bugs.
12934 2003-07-02 Martin Baulig <martin@ximian.com>
12936 * class.cs (MethodData.Define): When implementing interface
12937 methods, set Final unless we're Virtual.
12939 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12940 check work for interface methods.
12942 2003-07-01 Martin Baulig <martin@ximian.com>
12944 * ecore.cs (EmitContext.This): Replaced this property with a
12945 GetThis() method which takes a Location argument. This ensures
12946 that we get the correct error location for a CS0188.
12948 2003-07-01 Miguel de Icaza <miguel@ximian.com>
12950 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12951 ImplicitStandardConversion.
12953 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12955 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
12957 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12960 2003-06-30 Miguel de Icaza <miguel@ximian.com>
12962 * class.cs (Constructor.Define): Turn off initlocals for unsafe
12965 (MethodData.Define): Turn off initlocals for unsafe methods.
12967 2003-06-29 Miguel de Icaza <miguel@ximian.com>
12969 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12970 complete; Fixes #37521.
12972 * delegate.cs: Use Modifiers.TypeAttr to compute the
12973 TypeAttributes, instead of rolling our own. This makes the flags
12974 correct for the delegates.
12976 2003-06-28 Miguel de Icaza <miguel@ximian.com>
12978 * class.cs (Constructor.Define): Set the private flag for static
12979 constructors as well.
12981 * cs-parser.jay (statement_expression): Set the return value to
12982 null, to avoid a crash when we catch an error.
12984 2003-06-24 Miguel de Icaza <miguel@ximian.com>
12986 * cs-parser.jay: Applied patch from Jackson that adds support for
12987 extern and unsafe modifiers to destructor declarations.
12989 * expression.cs: Report error 21 if the user is trying to index a
12992 * driver.cs: Add an error message, suggested by the bug report.
12994 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12995 if we do not have a ": this ()" constructor initializer. Fixes 45149
12997 2003-06-14 Miguel de Icaza <miguel@ximian.com>
12999 * namespace.cs: Add some information to reduce FAQs.
13001 2003-06-13 Miguel de Icaza <miguel@ximian.com>
13003 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13004 underlying enumeration types. Fixes #43915.
13006 * expression.cs: Treat ushort/short as legal values to be used in
13007 bitwise operations.
13009 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13011 * delegate.cs: transfer custom attributes for paramenters from
13012 the delegate declaration to Invoke and BeginInvoke.
13014 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13016 * attribute.cs: handle custom marshalers and emit marshal info
13019 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
13021 * makefile.gnu: Added anonymous.cs to the compiler sources.
13023 2003-05-28 Miguel de Icaza <miguel@ximian.com>
13025 * iterators.cs: Change the name of the proxy class to include two
13028 * cs-parser.jay: Update grammar to include anonymous methods.
13030 * anonymous.cs: new file.
13032 2003-05-27 Miguel de Icaza <miguel@ximian.com>
13034 * class.cs (Field.Define): Add missing test for pointers and
13037 2003-05-27 Ravi Pratap <ravi@ximian.com>
13039 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13040 we use the stobj opcode.
13042 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13043 since it wasn't the correct fix.
13045 It still is puzzling that we are required to use stobj for IntPtr
13046 which seems to be a ValueType.
13048 2003-05-26 Miguel de Icaza <miguel@ximian.com>
13050 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13051 during regular simple name resolution. Now, the trick is that
13052 instead of returning for processing the simplename, we do a
13053 TypeManager.LookupType (ie, a rooted lookup as opposed to a
13054 contextual lookup type). If a match is found, return that, if
13055 not, return for further composition.
13057 This fixes long-standing 30485.
13059 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13060 using the address to initialize an object, do an Stobj instead of
13061 using the regular Stelem.
13063 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13064 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13065 Because if we are a BaseIndexerAccess that value will be true.
13068 * statement.cs (GotoCase.Resolve): Return after reporting an
13069 error, do not attempt to continue.
13071 * expression.cs (PointerArithmetic.Emit): If our operand is a
13072 long, convert our constants to match the operand before
13073 multiplying. Convert to I type before adding. Fixes 43670.
13075 2003-05-14 Ravi Pratap <ravi@ximian.com>
13077 * enum.cs (ImplicitConversionExists) : Rename to
13078 ImplicitEnumConversionExists to remove ambiguity.
13080 * ecore.cs (NullCast): New type of cast expression class which
13081 basically is very similar to EmptyCast with the difference being
13082 it still is a constant since it is used only to cast a null to
13084 (eg. (string) null)
13086 * convert.cs (ImplicitReferenceConversion): When casting a null
13087 literal, we return a NullCast.
13089 * literal.cs (NullLiteralTyped): Remove - I don't see why this
13090 should be around anymore.
13092 The renaming (reported was slightly wrong). Corrections:
13094 ConvertImplicitStandard -> ImplicitConversionStandard
13095 ConvertExplicitStandard -> ExplicitConversionStandard
13097 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13098 before passing them in !
13100 * convert.cs (ImplicitConversionStandard): When comparing for
13101 equal expr and target types, ensure that expr is not a
13104 In general, we must not be checking (expr_type ==
13105 target_type) in the top level conversion methods
13106 (ImplicitConversion, ExplicitConversion etc). This checking is
13107 done in the methods that they delegate to.
13109 2003-05-20 Miguel de Icaza <miguel@ximian.com>
13111 * convert.cs: Move Error_CannotConvertType,
13112 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13113 ImplicitNumericConversion, ImplicitConversionExists,
13114 ImplicitUserConversionExists, StandardConversionExists,
13115 FindMostEncompassedType, FindMostSpecificSource,
13116 FindMostSpecificTarget, ImplicitUserConversion,
13117 ExplicitUserConversion, GetConversionOperators,
13118 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13119 TryImplicitIntConversion, Error_CannotConvertImplicit,
13120 ConvertImplicitRequired, ConvertNumericExplicit,
13121 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13122 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13125 Perform the following renames:
13127 StandardConversionExists -> ImplicitStandardConversionExists
13128 ConvertImplicit -> ImplicitConversion
13129 ConvertImplicitStandard -> ImplicitStandardConversion
13130 TryImplicitIntConversion -> ImplicitIntConversion
13131 ConvertImplicitRequired -> ImplicitConversionRequired
13132 ConvertNumericExplicit -> ExplicitNumericConversion
13133 ConvertReferenceExplicit -> ExplicitReferenceConversion
13134 ConvertExplicit -> ExplicitConversion
13135 ConvertExplicitStandard -> ExplicitStandardConversion
13137 2003-05-19 Martin Baulig <martin@ximian.com>
13139 * statement.cs (TypeInfo.StructInfo): Made this type protected.
13140 (TypeInfo): Added support for structs having structs as fields.
13142 * ecore.cs (FieldExpr): Implement IVariable.
13143 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13144 VariableInfo for the field.
13146 2003-05-18 Martin Baulig <martin@ximian.com>
13148 * expression.cs (This.DoResolve): Report a CS0027 if we're
13149 emitting a field initializer.
13151 2003-05-18 Martin Baulig <martin@ximian.com>
13153 * expression.cs (This.ResolveBase): New public function.
13154 (This.DoResolve): Check for CS0188.
13156 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13159 * ecore.cs (MethodGroupExpr.DoResolve): Set the
13160 `instance_expression' to null if we don't have any non-static
13163 2003-05-18 Martin Baulig <martin@ximian.com>
13165 Reworked the way how local variables and parameters are handled by
13166 the flow analysis code.
13168 * statement.cs (TypeInfo, VariableMap): New public classes.
13169 (VariableInfo): New public class. This is now responsible for
13170 checking whether a variable has been assigned. It is used for
13171 parameters and local variables.
13172 (Block.EmitMeta): Take the InternalParameters as argument; compute
13173 the layout of the flow vectors here.
13174 (Block.LocalMap, Block.ParameterMap): New public properties.
13175 (FlowBranching): The .ctor doesn't get the InternalParameters
13176 anymore since Block.EmitMeta() now computes the layout of the flow
13178 (MyStructInfo): This class is now known as `StructInfo' and nested
13179 in `TypeInfo'; we don't access this directly anymore.
13181 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13182 property and removed IsAssigned(), IsFieldAssigned(),
13183 SetAssigned() and SetFieldAssigned(); we now call them on the
13184 VariableInfo so we don't need to duplicate this code everywhere.
13186 * expression.cs (ParameterReference): Added `Block block' argument
13188 (LocalVariableReference, ParameterReference, This): The new
13189 VariableInfo class is now responsible for all the definite
13192 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13193 IsParameterAssigned, SetParameterAssigned): Removed.
13195 2003-05-18 Martin Baulig <martin@ximian.com>
13197 * typemanager.cs (InitCoreTypes): Try calling
13198 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13199 the 3-args-version. Corlib now also needs our `void_type'.
13200 (GetMethod): Added overloaded version which takes an optional
13201 `bool report_errors' to allow lookups of optional methods.
13203 2003-05-12 Martin Baulig <martin@ximian.com>
13205 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13206 only used for locals and not for parameters.
13208 2003-05-12 Miguel de Icaza <miguel@ximian.com>
13210 * support.cs (InternalParameters.ParameterType): Return the
13211 ExternalType of the parameter.
13213 * parameter.cs (Parameter.ExternalType): drop the two arguments,
13216 2003-05-11 Miguel de Icaza <miguel@ximian.com>
13218 * class.cs (MethodData.Define): Do not set the `newslot' on
13219 interface members, if they are also flagged as "override".
13221 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13222 better code for ++i and i++. This only works for static fields
13223 and local variables.
13225 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13226 want to pull the DeclSpace out of the builder_to_declspace instead
13227 of the TypeBuilder (like in TypeContainer.FindMembers).
13229 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13230 instead of LookupTypeContainer. Fixes the crash on .NET for
13231 looking up interface members.
13233 * const.cs: Create our own emit context during the Definition
13234 stage, so that constants are evaluated in the proper context, when
13235 a recursive definition happens.
13237 2003-05-11 Martin Baulig <martin@ximian.com>
13239 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
13240 new block for a switch section.
13241 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13242 the adding/lookup in the switch block. Fixes #39828.
13244 2003-05-09 Miguel de Icaza <miguel@ximian.com>
13246 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13247 functionality: I needed to convert the data after I had performed
13248 the add/sub operation into the operands type size.
13250 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13251 pass the type for the box operation, otherwise the resulting
13252 object would have been of type object.
13254 (BoxedCast): Add constructor to specify the type to box as.
13256 2003-05-07 Miguel de Icaza <miguel@ximian.com>
13258 * iterators.cs: I was reusing the `count' variable inadvertently,
13259 take steps to not allow this to happen.
13261 2003-05-06 Miguel de Icaza <miguel@ximian.com>
13263 * attribute.cs (Attribute.Resolve): Params attributes are encoded
13264 by creating an array at the point where the params starts and
13265 putting all those arguments there, then adjusting the size of the
13268 2003-05-05 Miguel de Icaza <miguel@ximian.com>
13270 * expression.cs (New.AddressOf): Implement interface
13271 IMemoryLocation. This is used when the `new' operator is used in
13272 the context of an invocation to a method on a value type.
13274 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13277 * namespace.cs: Also check the using aliases here.
13279 * driver.cs: Move the test for using validity after the types have
13280 been entered, so we do a single pass that also includes the using
13283 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13284 in the regular case. CreateSiblingForFinally is doing extra
13287 * attribute.cs (GetAttributeArgumentExpression): Store the result
13288 on an out value, and use the return value to indicate failure
13289 instead of using null (which is a valid return for Constant.GetValue).
13291 * statement.cs: Perform the analysis flow for the increment
13292 portion after the statement, because this will be the real flow of
13293 execution. Fixes #42385
13295 * codegen.cs (EmitContext.EmitArgument,
13296 EmitContext.EmitStoreArgument): New helper functions when the
13297 RemapToProxy flag is set.
13299 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13302 Add support for remapping parameters.
13304 * iterators.cs: Propagate parameter values; Store parameter
13305 values in the proxy classes.
13307 2003-05-04 Miguel de Icaza <miguel@ximian.com>
13309 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
13310 need a proxy reference; I do not know what I was thinking
13312 * cs-parser.jay (constructor_initializer): catch another error,
13313 and display nice message.
13315 (field_declaration): catch void field declaration
13316 to flag a better error.
13318 * class.cs (MemberBase.CheckBase): Report an error instead of a
13319 warning if a new protected member is declared in a struct.
13320 (Field.Define): catch the error of readonly/volatile.
13322 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13324 (FieldExpr.AddressOf): ditto. Catch error where the address of a
13325 volatile variable is taken
13327 2003-05-02 Miguel de Icaza <miguel@ximian.com>
13329 * statement.cs (Fixed.Resolve): Report an error if we are not in
13332 2003-05-01 Miguel de Icaza <miguel@ximian.com>
13334 * typemanager.cs: reuse the code that handles type clashes for
13335 delegates and enumerations.
13337 * class.cs (Report28): Always report.
13339 * expression.cs (EncodeAsAttribute): Allow nulls here.
13341 2003-04-28 Miguel de Icaza <miguel@ximian.com>
13343 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13344 the functionality for testing whether an expression is valid for
13345 an attribute here. Also handle the case of arrays of elements
13348 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13349 encoding a linear array into an array of objects that are suitable
13350 to be passed to an CustomAttributeBuilder.
13352 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13354 * ecore.cs: (FieldExpr): Handle field remapping here.
13356 * iteratators.cs: Pass the instance variable (if the method is an
13357 instance method) to the constructors, so we can access the field
13358 variables on the class.
13360 TODO: Test this with structs. I think the THIS variable on
13361 structs might have to be a pointer, and not a refenrece
13363 2003-04-27 Miguel de Icaza <miguel@ximian.com>
13365 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13366 local variables to fields in a proxy class.
13368 * iterators.cs (PopulateProxy): Rename our internal fields to
13370 Create a <THIS> field if we are an instance method, so we can
13371 reference our parent container variables.
13372 (MapVariable): Called back from the EmitContext code to enter a
13373 new variable to field mapping into the proxy class (we just create
13377 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13378 for using the remapped locals to fields.
13380 I placed the code here, because that gives the same semantics to
13381 local variables, and only changes the Emit code.
13383 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13384 statements inside iterators.
13385 (VariableInfo): Add a FieldBuilder for the cases when we are
13386 remapping local variables to fields in a proxy class
13388 * ecore.cs (SimpleNameResolve): Avoid testing two times for
13389 current_block != null.
13391 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13392 not cope with strings, as it has been moved to the
13393 TableSwitchEmit. Fixed bug in switch generation.
13395 * expression.cs (New.DoResolve): Provide more context for the user
13396 when reporting an error.
13398 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13401 * expression.cs (MemberAccess.DoResolve): When we get a type back,
13402 check the permissions for it. Note than in a type-resolution
13403 context the check was already present in DeclSpace.ResolveType,
13404 but was missing from the MemberAccess.
13406 (ArrayCreation.CheckIndices): warn if the user has
13407 more nested levels of expressions, but there are no more
13408 dimensions specified. Avoids crash on bug 41906.
13410 2003-04-26 Miguel de Icaza <miguel@ximian.com>
13412 * statement.cs (Block): replace Implicit bool, for a generic
13414 New flag: `Unchecked'. This is used during the EmitMeta phase
13415 (which is out-of-line with the regular Resolve/Emit process for a
13416 statement, as this is done ahead of time, but still gets a chance
13417 to call constant resolve).
13419 (Block.Flags): new enum for adding a new flag.
13421 (Block.EmitMeta): track the state of unchecked.
13423 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13424 to enable constant resolution to work there as well.
13426 2003-04-22 Miguel de Icaza <miguel@ximian.com>
13428 * typemanager.cs (ienumerable_type): Also look up
13429 System.Collections.IEnumerable.
13431 2003-04-21 Miguel de Icaza <miguel@ximian.com>
13433 TODO: Test more than one conditional per method.
13435 * class.cs (Indexer.Define): Report the location where the user is
13436 referencing the unsupported feature.
13438 (MethodData): Overload the use of `conditionals' to
13439 minimize the creation of needless ArrayLists. This saves roughly
13440 212kb on my machine.
13442 (Method): Implement the new IIteratorContainer interface.
13443 (Method.SetYields): Implement the method by setting the ModFlags
13444 to contain METHOD_YIELDS.
13446 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13447 which just got set to null.
13449 * iterators.cs: New file.
13451 (Yield, YieldBreak): New statements.
13453 * statement.cs (Return.Resolve): Flag an error if we are used in
13454 an iterator method.
13456 * codegen.cs (InIterator): New flag set if the code is being
13457 compiled in an iterator method.
13459 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
13460 internal modifier, and we just use it to avoid adding extra
13461 fields, as this is seldom used.
13463 * cs-parser.jay: Add yield_statement (yield and yield break).
13465 * driver.cs: New flag -v2 to turn on version 2 features.
13467 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13468 hashtable when v2 is enabled.
13470 2003-04-20 Miguel de Icaza <miguel@ximian.com>
13472 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13473 there is already a namespace defined with this name.
13475 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13476 people upgraded their corlibs.
13478 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13479 always use fully qualified types, no need to use the compiler
13482 (TypeManager.IsNamespace): Use binarysearch.
13484 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13485 AddDelegate): I did not quite use the new IsValid API properly: I
13486 have to pass the short-name and the fullname. I was passing only
13487 the basename instead of the fullname sometimes.
13489 (TypeContainer.DefineType): call NamespaceClash.
13491 * interface.cs (Interface.DefineType): use NamespaceClash before
13494 * delegate.cs (Delegate.DefineType): use NamespaceClash before
13497 * enum.cs: (Enum.DefineType): use NamespaceClash before
13500 * typemanager.cs (: 3-line patch that gives us some tasty 11%
13501 speed increase. First, use the negative_hits cache when we get a
13502 negative. Second, add the type with its full original name
13503 instead of the new . and + encoded name (reflection uses + to
13504 separate type from a nested type). Use LookupTypeReflection
13505 directly which bypasses the type->name hashtable (that we already
13506 know does not contain the type.
13508 * decl.cs (DeclSpace.ResolveTypeExpr): track the
13509 location/container type.
13511 * driver.cs: When passing utf8, use directly the UTF8Encoding.
13513 2003-04-19 Miguel de Icaza <miguel@ximian.com>
13515 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13517 * delegate.cs (NewDelegate.Resolve): Test whether an instance
13518 method is being referenced in the method group from a static
13519 context, and report error 120 if so.
13521 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13524 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13525 is created, we create the A namespace).
13527 * cs-parser.jay: A namespace also introduces a DeclarationFound.
13530 2003-04-18 Miguel de Icaza <miguel@ximian.com>
13532 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13533 invocation to ModuleBuilder.GetType with the same values will
13534 return a new type instance, so we need to cache its return
13537 * expression.cs (Binary.ResolveOperator): Only allow the compare
13538 operators on enums if they are of the same type.
13540 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13541 types of ValueType on their own case. Before we were giving them
13542 the same treatment as objects.
13544 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13545 fullname. Short name is used to compare against container name.
13546 Fullname is used to check against defined namespace names.
13548 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13549 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13551 (Method.CheckBase): Call parent.
13552 (MemberBase.CheckBase): Check for protected members on sealed
13554 (PropertyBase.CheckBase): Call parent.
13555 (Field.Define): Call parent.
13557 * report.cs: Negative error codes are now mapped to 8000 - code,
13558 so that the display is render more nicely.
13560 * typemanager.cs: Do not use try/catch, instead report a regular
13563 (GetPointerType, GetReferenceType): These methods provide
13564 mechanisms to obtain the T* and T& from a T. We had the code
13565 previously scattered around the code base, and it also used
13566 TypeManager.LookupType that would go through plenty of caches.
13567 This one goes directly to the type source.
13569 In some places we did the Type.GetType followed by
13570 ModuleBuilder.GetType, but not in others, so this unifies the
13571 processing as well.
13573 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13574 statements now that we have namespace information.
13576 * typemanager.cs (IsNamespace): New method, returns whether the
13577 string presented is a namespace or not.
13579 (ComputeNamespaces): New public entry point, computes the list of
13580 available namespaces, using the GetNamespaces API call in Mono, or
13581 the slower version in MS.NET.
13583 Now before we start the semantic analysis phase, we have a
13584 complete list of namespaces including everything that the user has
13587 Deleted old code to cache namespaces in .nsc files.
13589 2003-04-17 Miguel de Icaza <miguel@ximian.com>
13591 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13592 class/struct location definition Location for the implicit
13593 constructor location.
13595 (Operator.Define): Use the location of the operator for the
13596 implicit Method definition.
13598 (Constructor.Emit): use the constructor location for the implicit
13599 base initializer constructor.
13601 * ecore.cs: Remove ITypeExpression. This interface is now gone,
13602 and the Expression class now contains two new methods:
13604 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
13605 isolate type lookup from the rest of the resolution process.
13607 Since we use Expressions to hold type definitions due to the way
13608 we parse the input we have historically overloaded Resolve to
13609 perform the Type lookups if a special flag is passed. Now this is
13610 eliminated and two methods take their place.
13612 The differences in the two methods between xStep and xTerminal is
13613 that xStep is involved in our current lookup system that uses
13614 SimpleNames to compose a name, while xTerminal is used just to
13615 catch the case where the simplename lookup failed.
13617 2003-04-16 Miguel de Icaza <miguel@ximian.com>
13619 * expression.cs (ResolveMemberAccess): Remove redundant code.
13620 TypeExpr expressions are always born fully resolved.
13622 * interface.cs (PopulateMethod): Do not lookup the types twice.
13623 We were doing it once during SemanticAnalysis and once during
13626 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13627 in local variable type definitions, were being returned as a
13628 SimpleName (we decomposed everything into a string), that is
13629 because primary_expression was being used instead of a type in the
13630 grammar (reduce/reduce conflicts).
13632 The part that was wrong is that we converted the expression into a
13633 string (an oversimplification in one hand, compounded with primary
13634 expressions doing string concatenation).
13640 Would return "A.B.C[]" as a SimpleName. This stopped things like
13641 using clauses from working on this particular context. And a type
13642 was being matched directly against "A.B.C[]".
13644 We now use the correct approach, and allow for ComposedCast to be
13645 part of the unary expression. So the "A.B.C []" become a composed
13646 cast of "A.B.C" (as a nested group of MemberAccess with a
13647 SimpleName at the end) plus the rank composition "[]".
13651 2003-04-10 Miguel de Icaza <miguel@ximian.com>
13653 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13654 for the access level checking.
13656 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
13657 `TypeContainer container', because I kept getting confused when I
13658 was debugging this code.
13660 * expression.cs (Indexers): Instead of tracking getters/setters,
13661 we now track them in parallel. We create one arraylist less, but
13662 most importantly it is possible now for the LValue code to find a
13663 matching get for a set.
13665 (IndexerAccess.DoResolveLValue): Update the code.
13666 GetIndexersForType has been modified already to extract all the
13667 indexers from a type. The code assumed it did not.
13669 Also make the code set the correct return type for the indexer.
13670 This was fixed a long time ago for properties, but was missing for
13671 indexers. It used to be void_type.
13673 (Binary.Emit): Test first for doubles instead of
13674 floats, as they are more common.
13676 (Binary.EmitBranchable): Use the .un version of the branch opcodes
13677 when dealing with floats and the <=, >= operators. This fixes bug
13680 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13681 to load the array value by emitting a load on the foreach variable
13682 type. This was incorrect.
13684 We now emit the code to load an element using the the array
13685 variable type, and then we emit the conversion operator.
13689 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
13691 * attribute.cs: Avoid allocation of ArrayLists in the common case.
13693 2003-04-09 Miguel de Icaza <miguel@ximian.com>
13695 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13696 test for protection before we test for signatures.
13698 (MethodSignature.ToString): implement.
13700 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13701 to the case where we reduced into a LongConstant.
13703 * decl.cs (CheckAccessLevel): If the type is an array, we can not
13704 depend on whether the information is acurrate, because the
13705 Microsoft runtime will always claim that the array type is public,
13706 regardless of the real state.
13708 If the type is a pointer, another problem happens: the type is
13709 reported as non-public in Microsoft.
13711 In both cases we have to call CheckAccessLevel recursively with
13712 the underlying type as the argument to be tested.
13714 2003-04-08 Miguel de Icaza <miguel@ximian.com>
13716 * assign.cs (Assign.Emit): If we are dealing with a compound
13717 assignment expression, we should use the code path that stores the
13718 intermediate result in a temporary value. This fixes #40903.
13720 *expression.cs (Indirection.ToString): Provide ToString method for
13723 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
13725 * class.cs: Null out fields holding references to Block objects so
13726 they can be garbage collected.
13728 * expression.cs (OverloadResolve): Remove unused local.
13730 2003-04-07 Martin Baulig <martin@ximian.com>
13732 * codegen.cs (EmitContext.CurrentFile): New public field.
13733 (EmitContext.Mark): Use the CurrentFile to check whether the
13734 location is in the correct file.
13735 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13737 2003-04-07 Martin Baulig <martin@ximian.com>
13739 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13741 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13742 location. [FIXME: The location argument which gets passed to this
13743 method is sometimes wrong!]
13745 2003-04-07 Nick Drochak <ndrochak@gol.com>
13747 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13749 2003-04-07 Miguel de Icaza <miguel@ximian.com>
13751 * expression.cs (Indirection.EmitAssign): We were using the
13752 temporary, but returning immediately instead of continuing the
13755 2003-04-06 Martin Baulig <martin@ximian.com>
13757 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13758 if it's a nested child, but also deriving from the outer class.
13761 * typemanager.cs (IsNestedChildOf): Make this work if it's a
13762 nested child, but also deriving from the outer class. See
13764 (FilterWithClosure): We may access private members of the outer
13765 class if we're a nested child and deriving from the outer class.
13766 (RealMemberLookup): Only set `closure_private_ok' if the
13767 `original_bf' contained BindingFlags.NonPublic.
13769 2003-04-05 Martin Baulig <martin@ximian.com>
13771 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
13773 2003-04-02 Miguel de Icaza <miguel@ximian.com>
13775 * class.cs (Event.Define): Do not allow abstract events to have
13778 2003-04-01 Miguel de Icaza <miguel@ximian.com>
13780 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13781 block in event declarations.
13783 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13784 value type, get its address.
13786 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13787 leaving a class on the stack instead of a boolean value (int
13788 0/1). Change the code so we compare against null, and then the
13789 result against zero.
13791 * class.cs (TypeContainer.GetClassBases): We were checking for the
13792 parent class being sealed too late.
13794 * expression.cs (Binary.Emit): For <= and >= when dealing with
13795 floating point values, use cgt.un and clt.un instead of cgt and
13798 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
13800 * statement.cs: Apply the same optimization as MS: skip the
13801 GetEnumerator returning an IEnumerator, and use the one returning a
13802 CharEnumerator instead. This allows us to avoid the try-finally block
13805 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
13807 * cs-parser.jay: Attributes cannot be applied to
13808 namespaces. Fixes #40473
13810 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13813 (Add*): check if the name is valid using the full name for constants,
13814 fields, properties and events.
13816 2003-03-28 Miguel de Icaza <miguel@ximian.com>
13818 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13819 char constants to be part of the enumeration.
13821 * expression.cs (Conditional.DoResolve): Add support for operator
13822 true. Implements the missing functionality from 14.12
13824 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13825 operator true/false as required by the spec.
13827 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13828 implicit conversion to boolean.
13830 * statement.cs (Statement.ResolveBoolean): A boolean expression is
13831 also one where the type implements `operator true'.
13833 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13834 get an expression that will invoke operator true based on an
13837 (GetConversionOperators): Removed the hack that called op_True
13840 (Expression.ResolveBoolean): Move this from Statement.
13842 2003-03-17 Miguel de Icaza <miguel@ximian.com>
13844 * ecore.cs (FieldExpr): do not allow initialization of initonly
13845 fields on derived classes
13847 2003-03-13 Martin Baulig <martin@ximian.com>
13849 * statement.cs (Block.Emit): Call ig.BeginScope() and
13850 ig.EndScope() when compiling with debugging info; call
13851 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13853 2003-03-08 Miguel de Icaza <miguel@ximian.com>
13855 * expression.cs (Indexers): Do not construct immediately, allow
13856 for new members to be appended as we go. Fixes 38143
13858 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13860 * expression.cs: save/restore context when resolving an unchecked
13863 2003-03-05 Miguel de Icaza <miguel@ximian.com>
13865 * cfold.cs: Catch division by zero in modulus operator during
13868 2003-03-03 Miguel de Icaza <miguel@ximian.com>
13870 * interface.cs (Interface.DefineMembers): Avoid defining members
13873 2003-02-27 Miguel de Icaza <miguel@ximian.com>
13875 * driver.cs: handle the +/- options for -noconfig
13877 * statement.cs (Unckeched.Resolve): Also track the state of
13878 unchecked in the Resolve phase.
13880 2003-02-27 Martin Baulig <martin@ximian.com>
13882 * ecore.cs (Expression.MemberLookup): Don't create a
13883 MethodGroupExpr for something which is not a method. Fixes #38291.
13885 2003-02-25 Miguel de Icaza <miguel@ximian.com>
13887 * class.cs (MemberBase.CheckParameters): Also check that the type
13888 is unmanaged if it is a pointer.
13890 * expression.cs (SizeOf.Resolve): Add location information.
13892 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13893 a managed type is declared.
13895 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13896 parameter modifiers as well. Fixes bug 38606
13898 * class.cs: Very sad. Am backing out the speed up changes
13899 introduced by the ArrayList -> Array in the TypeContainer, as they
13900 were not actually that much faster, and introduced a bug (no error
13901 reports on duplicated methods).
13903 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13904 source first, this will guarantee that we have a valid expression
13905 before calling in lower levels functions that will require a
13906 resolved object. Then use this original_source in the
13907 target.ResolveLValue instead of the original source that was
13910 Another change. Use target.Resolve instead of LValueResolve.
13911 Although we are resolving for LValues, we will let the Assign code
13912 take care of that (it will be called again from Resolve). This
13913 basically allows code like this:
13915 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13916 class Y { void A (X x) { x [0] += o; }
13918 The problem was that the indexer was trying to resolve for
13919 set_Item (idx, object o) and never finding one. The real set_Item
13920 was set_Item (idx, X). By delaying the process we get the right
13925 2003-02-23 Martin Baulig <martin@ximian.com>
13927 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13928 while calling DoEmit ().
13930 * codegen.cs (EmitContext.Mark): Don't mark locations in other
13931 source files; if you use the #line directive inside a method, the
13932 compiler stops emitting line numbers for the debugger until it
13933 reaches the end of the method or another #line directive which
13934 restores the original file.
13936 2003-02-23 Martin Baulig <martin@ximian.com>
13938 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13940 2003-02-23 Martin Baulig <martin@ximian.com>
13942 * statement.cs (Block.AddChildVariableNames): We need to call this
13943 recursively, not just for our immediate children.
13945 2003-02-23 Martin Baulig <martin@ximian.com>
13947 * class.cs (Event.Define): Always make the field private, like csc does.
13949 * typemanager.cs (TypeManager.RealMemberLookup): Make events
13950 actually work, fixes bug #37521.
13952 2003-02-23 Miguel de Icaza <miguel@ximian.com>
13954 * delegate.cs: When creating the various temporary "Parameters"
13955 classes, make sure that we call the ComputeAndDefineParameterTypes
13956 on those new parameters (just like we do with the formal ones), to
13957 allow them to be resolved in the context of the DeclSpace.
13959 This fixes the bug that Dick observed in Bugzilla #38530.
13961 2003-02-22 Miguel de Icaza <miguel@ximian.com>
13963 * expression.cs (ResolveMemberAccess): When resolving a constant,
13964 do not attempt to pull a constant if the value was not able to
13965 generate a valid constant.
13967 * const.cs (LookupConstantValue): Do not report more errors than required.
13969 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13971 * expression.cs: fixes bug #38328.
13973 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13975 * class.cs: Changed all the various members that can be part of a
13976 class from being an ArrayList to be an Array of the right type.
13977 During the DefineType type_list, interface_list, delegate_list and
13978 enum_list are turned into types, interfaces, delegates and enums
13981 And during the member population, indexer_list, event_list,
13982 constant_list, field_list, instance_constructor_list, method_list,
13983 operator_list and property_list are turned into their real arrays.
13985 Although we could probably perform this operation earlier, for
13986 good error reporting we need to keep the lists and remove the
13987 lists for longer than required.
13989 This optimization was triggered by Paolo profiling the compiler
13990 speed on the output of `gen-sample-program.pl' perl script.
13992 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13993 not crash in methods like MemberLookupFailed that use this field.
13995 This problem arises when the compiler fails to resolve a type
13996 during interface type definition for example.
13998 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14000 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14001 inherit from System.Object, so we have to stop at null, not only
14002 when reaching System.Object.
14004 2003-02-17 Miguel de Icaza <miguel@ximian.com>
14006 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14007 DeclaredOnly because the parent indexer might have had a different
14008 name, but did not loop until the top of the hierarchy was reached.
14010 The problem this one fixes is 35492: when a class implemented an
14011 indexer from an interface, we were getting the interface method
14012 (which was abstract) and we were flagging an error (can not invoke
14015 This also keeps bug 33089 functioning, and test-148 functioning.
14017 * typemanager.cs (IsSpecialMethod): The correct way of figuring
14018 out if a method is special is to see if it is declared in a
14019 property or event, or whether it is one of the predefined operator
14020 names. This should fix correctly #36804.
14022 2003-02-15 Miguel de Icaza <miguel@ximian.com>
14024 The goal here is to remove the dependency on EmptyCast.Peel ().
14025 Killing it completely.
14027 The problem is that currently in a number of places where
14028 constants are expected, we have to "probe" for an EmptyCast, and
14029 Peel, which is not the correct thing to do, as this will be
14030 repetitive and will likely lead to errors.
14032 The idea is to remove any EmptyCasts that are used in casts that
14033 can be reduced to constants, so we only have to cope with
14036 This bug hunt was triggered by Bug 37363 and the desire to remove
14037 the duplicate pattern where we were "peeling" emptycasts to check
14038 whether they were constants. Now constants will always be
14041 * ecore.cs: Use an enumconstant here instead of wrapping with
14044 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14045 throwing me off. By handling this we can get rid of a few hacks.
14047 * statement.cs (Switch): Removed Peel() code.
14049 2003-02-14 Miguel de Icaza <miguel@ximian.com>
14051 * class.cs: Location information for error 508
14053 * expression.cs (New.DoResolve): Add a guard against double
14054 resolution of an expression.
14056 The New DoResolve might be called twice when initializing field
14057 expressions (see EmitFieldInitializers, the call to
14058 GetInitializerExpression will perform a resolve on the expression,
14059 and later the assign will trigger another resolution
14061 This leads to bugs (#37014)
14063 * delegate.cs: The signature for EndInvoke should contain any ref
14064 or out parameters as well. We were not doing this in the past.
14066 * class.cs (Field.Define): Do not overwrite the type definition
14067 inside the `volatile' group. Turns out that volatile enumerations
14068 were changing the type here to perform a validity test, which
14071 2003-02-12 Miguel de Icaza <miguel@ximian.com>
14073 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14074 and structs, we do not want to load the instance variable
14076 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14077 enum_type has to be handled like an object reference (implicit
14078 conversions exists from this to object), but the regular IsClass
14079 and IsValueType tests will never return true for this one.
14081 Also we use TypeManager.IsValueType instead of type.IsValueType,
14082 just for consistency with the rest of the code (this is only
14083 needed if we ever use the construct exposed by test-180.cs inside
14084 corlib, which we dont today).
14086 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
14088 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14091 2003-02-09 Martin Baulig <martin@ximian.com>
14093 * namespace.cs (Namespace..ctor): Added SourceFile argument.
14094 (Namespace.DefineNamespaces): New static public method; this is
14095 called when we're compiling with debugging to add all namespaces
14096 to the symbol file.
14098 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14099 pass it to the Namespace's .ctor.
14101 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14102 and MethodBase arguments; pass the namespace ID to the symwriter;
14103 pass the MethodBase instead of the token to the symwriter.
14104 (SymbolWriter.DefineNamespace): New method to add a namespace to
14107 2003-02-09 Martin Baulig <martin@ximian.com>
14109 * symbolwriter.cs: New file. This is a wrapper around
14110 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
14111 methods here in near future.
14113 2003-02-09 Martin Baulig <martin@ximian.com>
14115 * codegen.cs (EmitContext.Mark): Just pass the arguments to
14116 ILGenerator.MarkSequencePoint() which are actually used by the
14119 2003-02-09 Martin Baulig <martin@ximian.com>
14121 * location.cs (SourceFile): New public sealed class. This
14122 contains the name and an index which is used in the location's token.
14123 (Location): Reserve an appropriate number of bits in the token for
14124 the source file instead of walking over that list, this gives us a
14125 really huge performance improvement when compiling with debugging.
14127 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14128 `SourceFile' argument instead of a string.
14129 (Driver.ProcessFile): Add all the files via Location.AddFile(),
14130 but don't parse/tokenize here, we need to generate the list of all
14131 source files before we do that.
14132 (Driver.ProcessFiles): New static function. Parses/tokenizes all
14135 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14136 instead of a string.
14138 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14141 2003-02-09 Martin Baulig <martin@ximian.com>
14143 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14144 filename on `#line default'.
14146 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14148 * statement.cs: don't clear the pinned var when the fixed statement
14149 returns from the method (fixes bug#37752).
14151 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14153 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
14156 2003-02-07 Martin Baulig <martin@ximian.com>
14158 * driver.cs: Removed the `--debug-args' command line argument.
14160 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14161 automatically by the AsssemblyBuilder.
14162 (CodeGen.InitializeSymbolWriter): We don't need to call any
14163 initialization function on the symbol writer anymore. This method
14164 doesn't take any arguments.
14166 2003-02-03 Miguel de Icaza <miguel@ximian.com>
14168 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14169 from referenced assemblies as well.
14171 2003-02-02 Martin Baulig <martin@ximian.com>
14173 * class.cs (MethodData.Emit): Generate debugging info for external methods.
14175 2003-02-02 Martin Baulig <martin@ximian.com>
14177 * class.cs (Constructor.Emit): Open the symbol writer before
14178 emitting the constructor initializer.
14179 (ConstructorInitializer.Emit): Call ec.Mark() to allow
14180 single-stepping through constructor initializers.
14182 2003-01-30 Miguel de Icaza <miguel@ximian.com>
14184 * class.cs: Handle error 549: do not allow virtual methods in
14187 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14189 * decl.cs: Check access levels when resolving types
14191 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14193 * statement.cs: Add parameters and locals set in catch blocks that might
14194 return to set vector
14196 2003-01-29 Miguel de Icaza <miguel@ximian.com>
14198 * class.cs (Operator): Set the SpecialName flags for operators.
14200 * expression.cs (Invocation.DoResolve): Only block calls to
14201 accessors and operators on SpecialName methods.
14203 (Cast.TryReduce): Handle conversions from char constants.
14206 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14208 * statement.cs: small memory and time optimization in FlowBranching.
14210 2003-01-28 Pedro Mart <yoros@wanadoo.es>
14212 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14213 problem that the last fix but in the other sid (Set).
14215 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14216 access when there is no indexer in the hierarchy.
14218 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14220 * class.cs: Combine some if statements.
14222 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14224 * driver.cs: fixed bug #37187.
14226 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
14228 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14229 any indexer, it's needed to build a list with all the indexers in the
14230 hierarchy (AllGetters), else we have problems. Fixes #35653.
14232 2003-01-23 Miguel de Icaza <miguel@ximian.com>
14234 * class.cs (MethodData.Define): It is wrong for an interface
14235 implementation to be static in both cases: explicit and implicit.
14236 We were only handling this in one case.
14238 Improve the if situation there to not have negations.
14240 * class.cs (Field.Define): Turns out that we do not need to check
14241 the unsafe bit on field definition, only on usage. Remove the test.
14243 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14245 * driver.cs: use assembly.Location instead of Codebase (the latest
14246 patch made mcs fail when using MS assemblies).
14248 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
14250 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14251 get the path to *corlib.dll.
14253 2003-01-21 Nick Drochak <ndrochak@gol.com>
14257 * typemanager.cs: Remove compiler warnings
14259 2003-01-20 Duncan Mak <duncan@ximian.com>
14261 * AssemblyInfo.cs: Bump the version number to 0.19.
14263 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14265 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14267 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
14269 * class.cs (Constructor::Emit): Emit debugging info for constructors.
14271 2003-01-17 Miguel de Icaza <miguel@ximian.com>
14273 * cs-parser.jay: Small fix: we were not comparing the constructor
14274 name correctly. Thanks to Zoltan for the initial pointer.
14276 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14278 * cs-tokenizer.cs: Set file name when specified with #line
14280 2003-01-15 Miguel de Icaza <miguel@ximian.com>
14282 * cs-parser.jay: Only perform the constructor checks here if we
14283 are named like the class; This will help provider a better
14284 error. The constructor path is taken when a type definition is
14285 not found, but most likely the user forgot to add the type, so
14286 report that rather than the constructor error.
14288 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14290 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14293 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14295 * cs-parser.jay: Add cleanup call.
14297 2003-01-13 Duncan Mak <duncan@ximian.com>
14299 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14300 consistent with other methods.
14302 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14304 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14306 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14308 * attribute.cs: only set GuidAttr to true when we have a
14311 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14315 * typemanager.cs: fixes to allow mcs compile corlib with the new
14316 Type.IsSubclassOf fix.
14318 2003-01-08 Miguel de Icaza <miguel@ximian.com>
14320 * expression.cs (LocalVariableReference.DoResolve): Classify a
14321 constant as a value, not as a variable. Also, set the type for
14324 * cs-parser.jay (fixed_statement): take a type instead of a
14325 pointer_type, so we can produce a better error message later.
14327 * statement.cs (Fixed.Resolve): Flag types that are not pointers
14330 (For.DoEmit): Make inifinite loops have a
14331 non-conditional branch back.
14333 (Fixed.DoEmit): First populate the pinned variables, then emit the
14334 statement, then clear the variables. Before I was emitting the
14335 code once for each fixed piece.
14338 2003-01-08 Martin Baulig <martin@ximian.com>
14340 * statement.cs (FlowBranching.MergeChild): A break in a
14341 SWITCH_SECTION does not leave a loop. Fixes #36155.
14343 2003-01-08 Martin Baulig <martin@ximian.com>
14345 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14346 lives in the same number space than `param_map'. Fixes #36154.
14348 2003-01-07 Miguel de Icaza <miguel@ximian.com>
14350 * cs-parser.jay (constructor_declaration): Set the
14351 Constructor.ModFlags before probing for it. This makes the
14352 compiler report 514, 515 and 132 (the code was there, but got
14355 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14356 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14357 (GotoCase.Resolve): Set `Returns' to ALWAYS.
14359 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14361 * enum.cs: create the enum static fields using the enum type.
14363 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14365 * class.cs: don't try to create the ParamBuilder for the return
14366 type if it's not needed (and handle it breaking for the ms runtime
14369 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14371 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14373 2002-12-29 Miguel de Icaza <miguel@ximian.com>
14375 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14376 the command. This showed up while compiling the JANET source
14377 code, which used \r as its only newline separator.
14379 2002-12-28 Miguel de Icaza <miguel@ximian.com>
14381 * class.cs (Method.Define): If we are an operator (because it
14382 reuses our code), then set the SpecialName and HideBySig. #36128
14384 2002-12-22 Miguel de Icaza <miguel@ximian.com>
14386 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14387 exception, report error 120 `object reference required'.
14389 * driver.cs: Add --pause option, used during to measure the size
14390 of the process as it goes with --timestamp.
14392 * expression.cs (Invocation.DoResolve): Do not allow methods with
14393 SpecialName to be invoked.
14395 2002-12-21 Miguel de Icaza <miguel@ximian.com>
14397 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14398 number before adding it.
14400 2002-12-21 Ravi Pratap <ravi@ximian.com>
14402 * ecore.cs (StandardImplicitConversion): When in an unsafe
14403 context, we allow conversion between void * to any other pointer
14404 type. This fixes bug #35973.
14406 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14408 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14409 is not thrown when extensionless outputs are used
14411 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14413 * rootcontext.cs: fixed compilation of corlib.
14415 2002-12-19 Miguel de Icaza <miguel@ximian.com>
14417 * attribute.cs (Attributes.Contains): Add new method.
14419 * class.cs (MethodCore.LabelParameters): if the parameter is an
14420 `out' parameter, check that no attribute `[In]' has been passed.
14422 * enum.cs: Handle the `value__' name in an enumeration.
14424 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
14426 * decl.cs: Added special case to allow overrides on "protected
14429 2002-12-18 Ravi Pratap <ravi@ximian.com>
14431 * attribute.cs (Attributes.AddAttributeSection): Rename to this
14432 since it makes much more sense.
14434 (Attributes.ctor): Don't require a Location parameter.
14436 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14438 * attribute.cs (ApplyAttributes): Remove extra Location parameters
14439 since we already have that information per attribute.
14441 * everywhere : make appropriate changes.
14443 * class.cs (LabelParameters): Write the code which actually
14444 applies attributes to the return type. We can't do this on the MS
14445 .NET runtime so we flag a warning in the case an exception is
14448 2002-12-18 Miguel de Icaza <miguel@ximian.com>
14450 * const.cs: Handle implicit null conversions here too.
14452 2002-12-17 Ravi Pratap <ravi@ximian.com>
14454 * class.cs (MethodCore.LabelParameters): Remove the extra
14455 Type [] parameter since it is completely unnecessary. Instead
14456 pass in the method's attributes so that we can extract
14457 the "return" attribute.
14459 2002-12-17 Miguel de Icaza <miguel@ximian.com>
14461 * cs-parser.jay (parse): Use Report.Error to flag errors instead
14462 of ignoring it and letting the compile continue.
14464 * typemanager.cs (ChangeType): use an extra argument to return an
14465 error condition instead of throwing an exception.
14467 2002-12-15 Miguel de Icaza <miguel@ximian.com>
14469 * expression.cs (Unary.TryReduce): mimic the code for the regular
14470 code path. Perform an implicit cast in the cases where we can
14471 implicitly convert to one of the integral types, and then reduce
14472 based on that constant. This fixes bug #35483.
14474 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14476 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14478 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14480 * namespace.cs: fixed bug #35489.
14482 2002-12-12 Miguel de Icaza <miguel@ximian.com>
14484 * class.cs: Remove some dead code.
14486 * cs-parser.jay: Estimate the number of methods needed
14487 (RootContext.MethodCount);
14489 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14490 numbers instead of StringBuilders.
14492 * support.cs (PtrHashtable): Add constructor with initial size;
14493 We can now reduce reallocations of the method table.
14495 2002-12-10 Ravi Pratap <ravi@ximian.com>
14497 * attribute.cs (ApplyAttributes): Keep track of the emitted
14498 attributes on a per-target basis. This fixes bug #35413.
14500 2002-12-10 Miguel de Icaza <miguel@ximian.com>
14502 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14503 default to the Windows 1252 encoding.
14505 (UnixParseOption): Support version, thanks to Alp for the missing
14508 * AssemblyInfo.cs: Add nice assembly information.
14510 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14513 * cs-parser.jay: Allow a trailing comma before the close bracked
14514 in the attribute_section production.
14516 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14517 address of the instance was being taken, I will take this out,
14518 because we take the address of the object immediately here.
14520 2002-12-09 Ravi Pratap <ravi@ximian.com>
14522 * typemanager.cs (AreMultipleAllowed): Take care of the most
14523 obvious case where attribute type is not in the current assembly -
14526 2002-12-08 Miguel de Icaza <miguel@ximian.com>
14528 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14529 definitions, instead of doing that afterwards.
14531 Also we use a nice little hack, depending on the constructor, we
14532 know if we are a "composed" name or a simple name. Hence, we
14533 avoid the IndexOf test, and we avoid
14535 * codegen.cs: Add code to assist in a bug reporter to track down
14536 the source of a compiler crash.
14538 2002-12-07 Ravi Pratap <ravi@ximian.com>
14540 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14541 types have been emitted for a given element and flag an error
14542 if something which does not have AllowMultiple set is used more
14545 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14546 attribute types and their corresponding AllowMultiple properties
14548 (AreMultipleAllowed): Check the property for a given type.
14550 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14551 property in the case we have a TypeContainer.
14553 (Attributes.AddAttribute): Detect duplicates and just skip on
14554 adding them. This trivial fix catches a pretty gross error in our
14555 attribute emission - global attributes were being emitted twice!
14557 Bugzilla bug #33187 is now fixed.
14559 2002-12-06 Miguel de Icaza <miguel@ximian.com>
14561 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14562 instead of pp_and).
14564 * expression.cs (Binary.ResolveOperator): I can only use the
14565 Concat (string, string, string) and Concat (string, string,
14566 string, string) if the child is actually a concatenation of
14569 2002-12-04 Miguel de Icaza <miguel@ximian.com>
14571 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14572 context where we need a 2-character lookahead.
14574 * pending.cs (PendingImplementation): Rework so we can keep track
14575 of interface types all the time, and flag those which were
14576 implemented by parents as optional.
14578 2002-12-03 Miguel de Icaza <miguel@ximian.com>
14580 * expression.cs (Binary.ResolveOperator): Use
14581 String.Concat(string,string,string) or
14582 String.Concat(string,string,string,string) when possible.
14584 * typemanager: More helper methods.
14587 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14589 * pending.cs: remove the bogus return from GetMissingInterfaces()
14590 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14592 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14594 * namespace.cs: avoid duplicated 'using xxx' being added to
14595 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14596 when we get more than one 'using' statement for the same namespace.
14597 Report a CS0105 warning for it.
14599 2002-11-30 Miguel de Icaza <miguel@ximian.com>
14601 * cs-tokenizer.cs (consume_identifier): use read directly, instead
14602 of calling getChar/putback, uses internal knowledge of it.
14604 (xtoken): Reorder tokenizer so most common patterns are checked
14605 first. This reduces the compilation time in another 5% (from 8.11s
14606 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14608 The parsing time is 22% of the compilation in mcs, and from that
14609 64% is spent on the tokenization process.
14611 I tried using a binary search for keywords, but this is slower
14612 than the hashtable. Another option would be to do a couple of
14615 * Not use a StringBuilder, instead use an array of chars,
14616 with a set value. Notice that this way we could catch
14617 the 645 error without having to do it *afterwards*.
14619 * We could write a hand-parser to avoid the hashtable
14620 compares altogether.
14622 The identifier consumption process takes 37% of the tokenization
14623 time. Another 15% is spent on is_number. 56% of the time spent
14624 on is_number is spent on Int64.Parse:
14626 * We could probably choose based on the string length to
14627 use Int32.Parse or Int64.Parse and avoid all the 64-bit
14630 Another 3% is spend on wrapping `xtoken' in the `token' function.
14632 Handle 0xa0 as whitespace (#34752)
14634 2002-11-26 Miguel de Icaza <miguel@ximian.com>
14636 * typemanager.cs (IsCLRType): New routine to tell whether a type
14637 is one of the builtin types.
14639 Maybe it needs to use TypeCodes to be faster. Maybe we could use
14640 typecode in more places instead of doing pointer comparissions.
14641 We could leverage some knowledge about the way the typecodes are
14644 New code to cache namespaces in assemblies, it is currently not
14645 invoked, to be used soon.
14647 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14649 * expression.cs (Binary.ResolveOperator): specially handle
14650 strings, and do not perform user-defined operator overloading for
14653 2002-11-24 Miguel de Icaza <miguel@ximian.com>
14655 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14656 internalcall as it is a pretty simple operation; Avoid whenever
14657 possible to call Char.IsLetter.
14659 (consume_identifier): Cut by half the number of
14660 hashtable calls by merging the is_keyword and GetKeyword behavior.
14662 Do not short-circuit, because if we do, we
14663 report errors (ie, #if false && true would produce an invalid
14667 2002-11-24 Martin Baulig <martin@ximian.com>
14669 * expression.cs (Cast.TryReduce): If we're in checked syntax,
14670 check constant ranges and report a CS0221. Fixes #33186.
14672 2002-11-24 Martin Baulig <martin@ximian.com>
14674 * cs-parser.jay: Make this work for uninitialized variable
14675 declarations in the `for' initializer. Fixes #32416.
14677 2002-11-24 Martin Baulig <martin@ximian.com>
14679 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14680 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
14682 2002-11-24 Martin Baulig <martin@ximian.com>
14684 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14685 argument; if true, we also check for user-defined conversions.
14686 This is only needed if both arguments are of a user-defined type.
14687 Fixes #30443, added test-175.cs.
14688 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14690 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14692 2002-11-24 Martin Baulig <martin@ximian.com>
14694 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14695 function to get the store opcode.
14696 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14697 only emit the Ldelema if the store opcode is Stobj. You must run
14698 both test-34 and test-167 to test this. Fixes #34529.
14700 2002-11-23 Martin Baulig <martin@ximian.com>
14702 * ecore.cs (Expression.MemberLookup): Added additional
14703 `qualifier_type' argument which is used when we're being called
14704 from MemberAccess.DoResolve() and null if we're called from a
14706 (Expression.MemberLookupFailed): New method to report errors; this
14707 does the CS1540 check and reports the correct error message.
14709 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14710 argument for the CS1540 check and redone the way how we're dealing
14711 with private members. See the comment in the source code for details.
14712 (FilterWithClosure): Reverted this back to revision 1.197; renamed
14713 `closure_start_type' to `closure_qualifier_type' and check whether
14714 it's not null. It was not this filter being broken, it was just
14715 being called with the wrong arguments.
14717 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14718 and pass it the correct `qualifier_type'; this also does the error
14721 2002-11-22 Miguel de Icaza <miguel@ximian.com>
14723 * expression.cs (Invocation.EmitParams): If the we are dealing
14724 with a non-built-in value type, load its address as well.
14726 (ArrayCreation): Use a a pretty constant instead
14727 of the hardcoded value 2. Use 6 instead of 2 for the number of
14728 static initializers.
14730 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14731 because they are not really value types, just glorified integers.
14733 * driver.cs: Do not append .exe, the CSC compiler does not do it.
14735 * ecore.cs: Remove redundant code for enumerations, make them use
14736 the same code path as everything else, fixes the casting issue
14737 with enumerations in Windows.Forms.
14739 * attribute.cs: Do only cast to string if it is a string, the
14740 validation happens later.
14742 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14743 people upgrade their corlibs.
14745 * ecore.cs: Oops, enumerations were not following the entire code path
14747 2002-11-21 Miguel de Icaza <miguel@ximian.com>
14749 * typemanager.cs (FilterWithClosure): Commented out the test for
14750 1540 in typemanager.cs, as it has problems when accessing
14751 protected methods from a parent class (see test-174.cs).
14753 * attribute.cs (Attribute.ValidateGuid): new method.
14754 (Attribute.Resolve): Use above.
14756 2002-11-19 Miguel de Icaza <miguel@ximian.com>
14758 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14760 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14761 handling for enumerations, as we only needed the TypeContainer
14762 functionality to begin with (this is required for the fix below to
14763 work for enums that reference constants in a container class for
14766 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14768 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14769 a valid TypeBuilder to perform lookups on.o
14771 * class.cs (InheritableMemberSignatureCompare): Use true in the
14772 call to GetGetMethod and GetSetMethod, because we are comparing
14773 the signature, and we need to get the methods *even* if they are
14776 (PropertyBase.CheckBase): ditto.
14778 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14779 GotoCase.Resolve): Use Peel on EmpytCasts.
14781 * ecore.cs (EmptyCast): drop child, add Peel method.
14783 2002-11-17 Martin Baulig <martin@ximian.com>
14785 * ecore.cs (EmptyCast.Child): New public property.
14787 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14788 label resolved to an EmptyCast. Fixes #34162.
14789 (GotoCase.Resolve): Likewise.
14790 (Block.EmitMeta): Likewise.
14792 2002-11-17 Martin Baulig <martin@ximian.com>
14794 * expression.cs (Invocation.BetterConversion): Prefer int over
14795 uint; short over ushort; long over ulong for integer literals.
14796 Use ImplicitConversionExists instead of StandardConversionExists
14797 since we also need to check for user-defined implicit conversions.
14798 Fixes #34165. Added test-173.cs.
14800 2002-11-16 Martin Baulig <martin@ximian.com>
14802 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14803 with the `true' and `false' literals. Fixes #33151.
14805 2002-11-16 Martin Baulig <martin@ximian.com>
14807 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14808 October 22nd; don't do the cs1540 check for static members.
14810 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14811 now using our own filter here and doing the cs1540 check again.
14813 2002-11-16 Martin Baulig <martin@ximian.com>
14815 * support.cs (InternalParameters): Don't crash if we don't have
14816 any fixed parameters. Fixes #33532.
14818 2002-11-16 Martin Baulig <martin@ximian.com>
14820 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14821 when looking up static methods to make this work on Windows.
14824 2002-11-16 Martin Baulig <martin@ximian.com>
14826 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14827 a setter rather than using PropertyInfo.CanWrite.
14829 2002-11-15 Nick Drochak <ndrochak@gol.com>
14831 * class.cs: Allow acces to block member by subclasses. Fixes build
14834 2002-11-14 Martin Baulig <martin@ximian.com>
14836 * class.cs (Constructor.Emit): Added the extern/block check.
14839 2002-11-14 Martin Baulig <martin@ximian.com>
14841 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14842 iteration while looking for indexers, this is needed because the
14843 indexer may have a different name in our base classes. Fixed the
14844 error reporting (no indexers at all, not get accessor, no
14845 overloaded match). Fixes bug #33089.
14846 (IndexerAccess.DoResolveLValue): Likewise.
14848 2002-11-14 Martin Baulig <martin@ximian.com>
14850 * class.cs (PropertyBase.CheckBase): Make this work for multiple
14851 indexers. Fixes the first part of bug #33089.
14852 (MethodSignature.InheritableMemberSignatureCompare): Added support
14855 2002-11-13 Ravi Pratap <ravi@ximian.com>
14857 * attribute.cs (Attribute.Resolve): Catch the
14858 NullReferenceException and report it since it isn't supposed to
14861 2002-11-12 Miguel de Icaza <miguel@ximian.com>
14863 * expression.cs (Binary.EmitBranchable): Also handle the cases for
14864 LogicalOr and LogicalAnd that can benefit from recursively
14865 handling EmitBranchable. The code now should be nice for Paolo.
14867 2002-11-08 Miguel de Icaza <miguel@ximian.com>
14869 * typemanager.cs (LookupType): Added a negative-hit hashtable for
14870 the Type lookups, as we perform quite a number of lookups on
14871 non-Types. This can be removed once we can deterministically tell
14872 whether we have a type or a namespace in advance.
14874 But this might require special hacks from our corlib.
14878 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14879 and double which avoids a conversion from an integer to a double.
14881 * expression.cs: tiny optimization, avoid calling IsConstant,
14882 because it effectively performs the lookup twice.
14884 2002-11-06 Miguel de Icaza <miguel@ximian.com>
14886 But a bogus return here to keep the semantics of the old code
14887 until the Mono runtime is fixed.
14889 * pending.cs (GetMissingInterfaces): New method used to remove all
14890 the interfaces that are already implemented by our parent
14891 classes from the list of pending methods.
14893 * interface.cs: Add checks for calls after ResolveTypeExpr.
14895 2002-11-05 Miguel de Icaza <miguel@ximian.com>
14897 * class.cs (Class.Emit): Report warning 67: event not used if the
14898 warning level is beyond 3.
14900 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14901 being a NullLiteral.
14903 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14906 * class.cs (TypeContainer.GetClassBases): Cover a missing code
14907 path that might fail if a type can not be resolved.
14909 * expression.cs (Binary.Emit): Emit unsigned versions of the
14912 * driver.cs: use error 5.
14914 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14916 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14918 2002-11-01 Miguel de Icaza <miguel@ximian.com>
14920 * cs-parser.jay (switch_section): A beautiful patch from Martin
14921 Baulig that fixed 33094.
14923 2002-10-31 Miguel de Icaza <miguel@ximian.com>
14925 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14926 Check whether the base is abstract and report an error if so.
14928 * expression.cs (IndexerAccess.DoResolveLValue,
14929 IndexerAccess.DoResolve): ditto.
14931 (Invocation.DoResolve): ditto.
14933 (Invocation.FullMethodDesc): Improve the report string.
14935 * statement.cs (Block): Eliminate IsVariableDefined as it is
14936 basically just a wrapper for GetVariableInfo.
14938 * ecore.cs (SimpleName): Use new
14940 * support.cs (ReflectionParamter.ParameterType): We unwrap the
14941 type, as we return the actual parameter ref/unref state on a
14944 2002-10-30 Miguel de Icaza <miguel@ximian.com>
14946 * support.cs: Return proper flags REF/OUT fixing the previous
14949 * expression.cs: Reverted last patch, that was wrong. Is_ref is
14950 not used to mean `ref' but `ref or out' in ParameterReference
14952 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14953 full type signature instead of calling TypeManger.CSharpName
14956 * support.cs (InternalParameters.ParameterDesc): Do not compare
14957 directly to the modflags, because REF/OUT will actually be bitsets
14960 * delegate.cs (VerifyMethod): Check also the modifiers.
14962 * cs-tokenizer.cs: Fix bug where floating point values with an
14963 exponent where a sign was missing was ignored.
14965 * driver.cs: Allow multiple assemblies to be specified in a single
14968 2002-10-28 Miguel de Icaza <miguel@ximian.com>
14970 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
14971 because identifiers after a parenthesis would end up in this kind
14972 of production, and we needed to desamiguate it for having casts
14975 (UserDefinedType *) xxx
14977 2002-10-24 Miguel de Icaza <miguel@ximian.com>
14979 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14980 we should set on the Bindingflags.NonPublic, but not turn on
14981 private_ok. private_ok controls whether a Private member is
14982 returned (this is chekced on the filter routine), while the
14983 BindingFlags.NonPublic just controls whether private/protected
14984 will be allowed. This fixes the problem part of the problem of
14985 private properties being allowed to be used in derived classes.
14987 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14988 so we can call the children DoResolveLValue method (this will
14989 properly signal errors on lvalue assignments to base properties)
14991 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14992 getter are null, and we have a property info, we know that this
14993 happened because the lookup failed, so we report an error 122 for
14994 protection level violation.
14996 We also silently return if setter and getter are null in the
14997 resolve functions, this condition only happens if we have flagged
14998 the error before. This is the other half of the problem.
15000 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15001 not have accessibility information, that is why we were returning
15002 true in the filter function in typemanager.cs.
15004 To properly report 122 (property is inaccessible because of its
15005 protection level) correctly, we report this error in ResolveAccess
15006 by failing if both the setter and the getter are lacking (ie, the
15009 DoResolve and DoLResolve have been modified to check for both
15010 setter/getter being null and returning silently, the reason being
15011 that I did not want to put the knowledge about this error in upper
15014 int old = Report.Errors;
15015 x = new PropertyExpr (...);
15016 if (old != Report.Errors)
15021 So the property expr is returned, but it is invalid, so the error
15022 will be flagged during the resolve process.
15024 * class.cs: Remove InheritablePropertySignatureCompare from the
15025 class, as we no longer depend on the property signature to compute
15026 whether it is possible to implement a method or not.
15028 The reason is that calling PropertyInfo.GetGetMethod will return
15029 null (in .NET, in Mono it works, and we should change this), in
15030 cases where the Get Method does not exist in that particular
15035 class X { public virtual int A { get { return 1; } } }
15037 class Z : Y { public override int A { get { return 2; } } }
15039 Would fail in Z because the parent (Y) would not have the property
15040 defined. So we avoid this completely now (because the alternative
15041 fix was ugly and slow), and we now depend exclusively on the
15044 (PropertyBase.CheckBase): Use a method-base mechanism to find our
15045 reference method, instead of using the property.
15047 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15048 routines are gone now.
15050 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15051 names, they were incorrectly named.
15053 * cs-tokenizer.cs: Return are more gentle token on failure.
15055 * pending.cs (PendingImplementation.InterfaceMethod): This routine
15056 had an out-of-sync index variable, which caused it to remove from
15057 the list of pending methods the wrong method sometimes.
15059 2002-10-22 Miguel de Icaza <miguel@ximian.com>
15061 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15062 CanWrite, because those refer to this particular instance of the
15063 property, and do not take into account the fact that we can
15064 override single members of a property.
15066 Constructor requires an EmitContext. The resolution process does
15067 not happen here, but we need to compute the accessors before,
15068 because the resolution does not always happen for properties.
15070 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15071 subclass, before we did not update this flag, but we did update
15074 (GetAccessors): Drop this routine, as it did not work in the
15075 presence of partially overwritten set/get methods.
15077 Notice that this broke the cs1540 detection, but that will require
15080 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15084 * driver.cs: issue a warning instead of an error if we don't support
15085 debugging for the platform. Also ignore a couple of errors that may
15086 arise when trying to write the symbols. Undo my previous patch.
15088 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15090 * driver.cs: ignore /debug switch except for Unix platforms.
15092 2002-10-23 Nick Drochak <ndrochak@gol.com>
15094 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15096 2002-10-21 Miguel de Icaza <miguel@ximian.com>
15098 * driver.cs: Do not make mcs-debug conditional, so we do not break
15099 builds that use it.
15101 * statement.cs (UsageVector.MergeChildren): I would like Martin to
15102 review this patch. But basically after all the children variables
15103 have been merged, the value of "Breaks" was not being set to
15104 new_breaks for Switch blocks. I think that it should be set after
15105 it has executed. Currently I set this to the value of new_breaks,
15106 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15107 conservative, but I do not understand this code very well.
15109 I did not break anything in the build, so that is good ;-)
15111 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15113 2002-10-20 Mark Crichton <crichton@gimp.org>
15115 * cfold.cs: Fixed compile blocker. Really fixed it this time.
15117 2002-10-20 Nick Drochak <ndrochak@gol.com>
15119 * cfold.cs: Fixed compile blocker.
15121 2002-10-20 Miguel de Icaza <miguel@ximian.com>
15123 * driver.cs: I was chekcing the key, not the file.
15125 2002-10-19 Ravi Pratap <ravi@ximian.com>
15127 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15128 message that we were generating - we just need to silently return
15131 2002-10-19 Miguel de Icaza <miguel@ximian.com>
15133 * class.cs (Event.Define): Change my previous commit, as this
15134 breaks the debugger. This is a temporary hack, as it seems like
15135 the compiler is generating events incorrectly to begin with.
15137 * expression.cs (Binary.ResolveOperator): Added support for
15138 "U operator - (E x, E y)"
15140 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15143 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15144 init-only variables, but this path did not take into account that
15145 there might be also instance readonly variables. Correct this
15148 This fixes bug 32253
15150 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15153 * driver.cs: Change the extension for modules to `netmodule'
15155 * cs-parser.jay: Improved slightly the location tracking for
15156 the debugger symbols.
15158 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15159 modifiers that were specified instead of the hardcoded value
15160 (FamAndAssem). This was basically ignoring the static modifier,
15161 and others. Fixes 32429.
15163 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15164 fixed a bug in the process (32476)
15166 * expression.cs (ArrayAccess.EmitAssign): Patch from
15167 hwang_rob@yahoo.ca that fixes bug 31834.3
15169 2002-10-18 Miguel de Icaza <miguel@ximian.com>
15171 * driver.cs: Make the module extension .netmodule.
15173 2002-10-16 Miguel de Icaza <miguel@ximian.com>
15175 * driver.cs: Report an error if the resource file is not found
15176 instead of crashing.
15178 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15179 false, like Emit does.
15181 2002-10-16 Nick Drochak <ndrochak@gol.com>
15183 * typemanager.cs: Remove unused private member. Also reported mcs
15184 bug to report this as a warning like csc.
15186 2002-10-15 Martin Baulig <martin@gnome.org>
15188 * statement.cs (Statement.Emit): Made this a virtual method; emits
15189 the line number info and calls DoEmit().
15190 (Statement.DoEmit): New protected abstract method, formerly knows
15191 as Statement.Emit().
15193 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15195 2002-10-11 Miguel de Icaza <miguel@ximian.com>
15197 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15198 have fixed a remaining problem: not every AddXXXX was adding a
15199 fully qualified name.
15201 Now everyone registers a fully qualified name in the DeclSpace as
15202 being defined instead of the partial name.
15204 Downsides: we are slower than we need to be due to the excess
15205 copies and the names being registered this way.
15207 The reason for this is that we currently depend (on the corlib
15208 bootstrap for instance) that types are fully qualified, because
15209 we dump all the types in the namespace, and we should really have
15210 types inserted into the proper namespace, so we can only store the
15211 basenames in the defined_names array.
15213 2002-10-10 Martin Baulig <martin@gnome.org>
15215 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15216 from bug #31834, see the bug report for a testcase which is
15219 2002-10-10 Martin Baulig <martin@gnome.org>
15221 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15222 flow analysis code for this.
15224 * statement.cs (Do, While, For): Tell the flow analysis code about
15226 (FlowBranching.UsageVector): Added support for infinite loops.
15227 (Block.Resolve): Moved the dead code elimination here and use flow
15230 2002-10-09 Miguel de Icaza <miguel@ximian.com>
15232 * class.cs (Field.Define): Catch cycles on struct type
15235 * typemanager.cs (IsUnmanagedtype): Do not recursively check
15236 fields if the fields are static. We only need to check instance
15239 * expression.cs (As.DoResolve): Test for reference type.
15241 * statement.cs (Using.ResolveExpression): Use
15242 ConvertImplicitRequired, not ConvertImplicit which reports an
15244 (Using.ResolveLocalVariableDecls): ditto.
15246 * expression.cs (Binary.ResolveOperator): Report errors in a few
15247 places where we had to.
15249 * typemanager.cs (IsUnmanagedtype): Finish implementation.
15251 2002-10-08 Miguel de Icaza <miguel@ximian.com>
15253 * expression.cs: Use StoreFromPtr instead of extracting the type
15254 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
15256 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15257 an enumeration value to a System.Enum, but System.Enum is not a
15258 value type, but an class type, so we need to box.
15260 (Expression.ConvertExplicit): One codepath could return
15261 errors but not flag them. Fix this. Fixes #31853
15263 * parameter.cs (Resolve): Do not allow void as a parameter type.
15265 2002-10-06 Martin Baulig <martin@gnome.org>
15267 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15268 if it's a class type and not a struct. Fixes #31815.
15270 2002-10-06 Martin Baulig <martin@gnome.org>
15272 * statement.cs: Reworked the flow analysis code a bit to make it
15273 usable for dead code elimination.
15275 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15277 * cs-parser.jay: allow empty source files. Fixes bug #31781.
15279 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15281 * expression.cs (ComposedCast.DoResolveType): A quick workaround
15282 to fix the test 165, will investigate deeper.
15284 2002-10-04 Martin Baulig <martin@gnome.org>
15286 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15287 finally blocks actually work.
15288 (Try.Resolve): We don't need to create a sibling for `finally' if
15289 there is no finally block.
15291 2002-10-04 Martin Baulig <martin@gnome.org>
15293 * class.cs (Constructor.Define): The default accessibility for a
15294 non-default constructor is private, not public.
15296 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15298 * class.cs (Constructor): Make AllowedModifiers public, add
15301 * cs-parser.jay: Perform the modifiers test here, as the
15302 constructor for the Constructor class usually receives a zero
15303 because of the way we create it (first we create, later we
15304 customize, and we were never checking the modifiers).
15306 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15307 is a version of LookupTypeReflection that includes the type-name
15308 cache. This can be used as a fast path for functions that know
15309 the fully qualified name and are only calling into *.GetType() to
15310 obtain a composed type.
15312 This is also used by TypeManager.LookupType during its type
15315 (LookupType): We now also track the real type name, as sometimes
15316 we can get a quey for the real type name from things like
15317 ComposedCast. This fixes bug 31422.
15319 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15320 complete type fullname, it does not have to go through the type
15321 resolution system to obtain the composed version of the type (for
15322 obtaining arrays or pointers).
15324 (Conditional.Emit): Use the EmitBoolExpression to
15325 generate nicer code, as requested by Paolo.
15327 (ArrayCreation.CheckIndices): Use the patch from
15328 hwang_rob@yahoo.ca to validate the array initializers.
15330 2002-10-03 Miguel de Icaza <miguel@ximian.com>
15332 * class.cs (ConstructorInitializer.Emit): simplify code by using
15333 Invocation.EmitCall, and at the same time, fix the bugs in calling
15334 parent constructors that took variable arguments.
15336 * ecore.cs (Expression.ConvertNumericExplicit,
15337 Expression.ImplicitNumericConversion): Remove the code that
15338 manually wrapped decimal (InternalTypeConstructor call is now gone
15341 * expression.cs (Cast.TryReduce): Also handle decimal types when
15342 trying to perform a constant fold on the type.
15344 * typemanager.cs (IsUnmanagedtype): Partially implemented.
15346 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15347 that only turned off an error report, and did nothing else.
15349 2002-10-02 Miguel de Icaza <miguel@ximian.com>
15351 * driver.cs: Handle and ignore /fullpaths
15353 2002-10-01 Miguel de Icaza <miguel@ximian.com>
15355 * expression.cs (Binary.ResolveOperator): Catch the case where
15356 DoNumericPromotions returns true,
15358 (Binary.DoNumericPromotions): Simplify the code, and the tests.
15360 2002-09-27 Miguel de Icaza <miguel@ximian.com>
15362 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15365 2002-09-26 Miguel de Icaza <miguel@ximian.com>
15367 * ecore.cs (ConvertNumericExplicit): It is not enough that the
15368 conversion exists, but it is also required that the conversion be
15369 performed. This manifested in "(Type64Enum) 2".
15371 * class.cs (TypeManager.AddMethod): The fix is not to change
15372 AddEnum, because that one was using a fully qualified name (every
15373 DeclSpace derivative does), but to change the AddMethod routine
15374 that was using an un-namespaced name. This now correctly reports
15375 the duplicated name.
15377 Revert patch until I can properly fix it. The issue
15378 is that we have a shared Type space across all namespaces
15379 currently, which is wrong.
15381 Options include making the Namespace a DeclSpace, and merge
15382 current_namespace/current_container in the parser.
15384 2002-09-25 Miguel de Icaza <miguel@ximian.com>
15386 * cs-parser.jay: Improve error reporting when we get a different
15387 kind of expression in local_variable_type and
15388 local_variable_pointer_type.
15390 Propagate this to avoid missleading errors being reported.
15392 * ecore.cs (ImplicitReferenceConversion): treat
15393 TypeManager.value_type as a target just like object_type. As
15398 Is valid, and needs to result in the int 1 being boxed before it
15399 is assigned to the value type v.
15401 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15402 to validate the enumeration name.
15404 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15405 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
15406 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15408 * ecore.cs (TryImplicitIntConversion): When doing an
15409 implicit-enumeration-conversion, check if the type is 64-bits and
15410 perform a conversion before passing to EnumConstant.
15412 2002-09-23 Miguel de Icaza <miguel@ximian.com>
15414 * decl.cs (Error_AmbiguousTypeReference); New routine used to
15415 report ambiguous type references. Unlike the MS version, we
15416 report what the ambiguity is. Innovation at work ;-)
15418 (DeclSpace.FindType): Require a location argument to
15419 display when we display an ambiguous error.
15421 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15423 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15425 * expression.cs (EmitDynamicInitializers): Apply patch from
15426 hwang_rob@yahoo.ca that fixes the order in which we emit our
15429 2002-09-21 Martin Baulig <martin@gnome.org>
15431 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15432 delegate takes no arguments.
15434 2002-09-20 Miguel de Icaza <miguel@ximian.com>
15436 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15439 * expression.cs: Extract the underlying type.
15441 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15443 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15445 2002-09-19 Miguel de Icaza <miguel@ximian.com>
15447 * class.cs (TypeContainer.DefineType): We can not use the nice
15448 PackingSize with the size set to 1 DefineType method, because it
15449 will not allow us to define the interfaces that the struct
15452 This completes the fixing of bug 27287
15454 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15455 means also structs. This fixes part of the problem.
15456 (Expresion.ImplicitReferenceConversionExists): ditto.
15458 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15459 error if there were no errors reported during the type lookup
15460 process, to avoid duplicates or redundant errors. Without this
15461 you would get an ambiguous errors plus a type not found. We have
15462 beaten the user enough with the first error.
15464 (DeclSparce.FindType): Emit a warning if we have an ambiguous
15467 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15468 during the resolution process, stop the lookup, this avoids
15469 repeated error reports (same error twice).
15471 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15473 * typemanager.cs (LookupType): Redo the type lookup code to match
15474 the needs of System.Reflection.
15476 The issue is that System.Reflection requires references to nested
15477 types to begin with a "+" sign instead of a dot. So toplevel
15478 types look like: "NameSpace.TopLevelClass", and nested ones look
15479 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15482 2002-09-19 Martin Baulig <martin@gnome.org>
15484 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15485 says that a method always returns or always throws an exception,
15486 don't report the CS0161.
15488 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15489 set `Returns = new_returns'.
15491 2002-09-19 Martin Baulig <martin@gnome.org>
15493 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15494 to an enum constant, check for a CS0176.
15496 2002-09-18 Miguel de Icaza <miguel@ximian.com>
15498 * class.cs (TypeContainer.CheckPairedOperators): Now we check
15499 for operators that must be in pairs and report errors.
15501 * ecore.cs (SimpleName.DoResolveType): During the initial type
15502 resolution process, when we define types recursively, we must
15503 check first for types in our current scope before we perform
15504 lookups in the enclosing scopes.
15506 * expression.cs (MakeByteBlob): Handle Decimal blobs.
15508 (Invocation.VerifyArgumentsCompat): Call
15509 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15510 I thought we were supposed to always call this, but there are a
15511 few places in the code where we dont do it.
15513 2002-09-17 Miguel de Icaza <miguel@ximian.com>
15515 * driver.cs: Add support in -linkres and -resource to specify the
15516 name of the identifier.
15518 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15520 * ecore.cs (StandardConversionExists): Sync with the conversion
15521 code: allow anything-* to void* conversions.
15523 (FindMostSpecificSource): Use an Expression argument
15524 instead of a Type, because we might be handed over a Literal which
15525 gets a few more implicit conversions that plain types do not. So
15526 this information was being lost.
15528 Also, we drop the temporary type-holder expression when not
15531 2002-09-17 Martin Baulig <martin@gnome.org>
15533 * class.cs (PropertyBase.CheckBase): Don't check the base class if
15534 this is an explicit interface implementation.
15536 2002-09-17 Martin Baulig <martin@gnome.org>
15538 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15539 different `IndexerName' attributes.
15541 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15542 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15543 virtual CommonResolve().
15545 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15547 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15548 and convert that to the UnderlyingType.
15550 * statement.cs (Foreach.Resolve): Indexers are just like variables
15551 or PropertyAccesses.
15553 * cs-tokenizer.cs (consume_string): Track line numbers and columns
15554 inside quoted strings, we were not doing this before.
15556 2002-09-16 Martin Baulig <martin@gnome.org>
15558 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15559 resolve it. This is needed for the definite assignment check of the
15560 instance expression, fixes bug #29846.
15561 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15563 2002-09-16 Nick Drochak <ndrochak@gol.com>
15565 * parameter.cs: Fix compile error. Cannot reference static member
15566 from an instance object. Is this an mcs bug?
15568 2002-09-14 Martin Baulig <martin@gnome.org>
15570 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15571 multiple times. Fixes bug #30295, added test-166.cs.
15573 2002-09-14 Martin Baulig <martin@gnome.org>
15575 * statement.cs (Block.Emit): Don't emit unreachable code.
15576 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15577 `break' statements.
15578 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15580 2002-09-14 Martin Baulig <martin@gnome.org>
15582 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15585 2002-09-14 Martin Baulig <martin@gnome.org>
15587 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15588 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15589 be false on the ms runtime.
15591 2002-09-13 Martin Baulig <martin@gnome.org>
15593 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15594 the CS0038 error message.
15596 2002-09-12 Miguel de Icaza <miguel@ximian.com>
15598 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15599 constant inside, return it.
15601 2002-09-12 Martin Baulig <martin@gnome.org>
15603 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15604 implicit conversion can be done between enum types.
15606 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15607 check whether an implicit conversion to the current enum's UnderlyingType
15608 exists and report an error if not.
15610 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15611 without debugging support.
15613 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15614 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
15616 2002-09-12 Martin Baulig <martin@gnome.org>
15618 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15620 * ecore.cs (IMemberExpr.DeclaringType): New property.
15621 (SimpleName.SimpleNameResolve): Check whether we're accessing a
15622 nonstatic member of an outer type (CS0038).
15624 2002-09-11 Miguel de Icaza <miguel@ximian.com>
15626 * driver.cs: Activate the using-error detector at warning level
15627 4 (at least for MS-compatible APIs).
15629 * namespace.cs (VerifyUsing): Small buglett fix.
15631 * pending.cs (PendingImplementation): pass the container pointer.
15633 * interface.cs (GetMethods): Allow for recursive definition. Long
15634 term, I would like to move every type to support recursive
15635 definitions, not the current ordering mechanism that we have right
15638 The situation is this: Attributes are handled before interfaces,
15639 so we can apply attributes to interfaces. But some attributes
15640 implement interfaces, we will now handle the simple cases
15641 (recursive definitions will just get an error).
15643 * parameter.cs: Only invalidate types at the end if we fail to
15646 2002-09-09 Martin Baulig <martin@gnome.org>
15648 * ecore.cs (PropertyExpr.Emit): Also check for
15649 TypeManager.system_int_array_get_length so this'll also work when
15650 compiling corlib. Fixes #30003.
15652 2002-09-09 Martin Baulig <martin@gnome.org>
15654 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15655 and throw an exception if we can't get the type's size. Fixed #30040,
15658 2002-09-09 Martin Baulig <martin@gnome.org>
15660 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15662 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15663 context. Fixes bug #30027.
15665 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15666 virtual functions. Fixes bug #30043, added test-164.cs.
15668 2002-09-08 Ravi Pratap <ravi@ximian.com>
15670 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15672 2002-09-08 Nick Drochak <ndrochak@gol.com>
15674 * driver.cs: Use an object to get the windows codepage since it's not a
15677 2002-09-08 Miguel de Icaza <miguel@ximian.com>
15679 * statement.cs (For.Emit): for infinite loops (test == null)
15680 return whether there is a break inside, not always "true".
15682 * namespace.cs (UsingEntry): New struct to hold the name of the
15683 using definition, the location where it is defined, and whether it
15684 has been used in a successful type lookup.
15686 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15691 2002-09-06 Ravi Pratap <ravi@ximian.com>
15693 * attribute.cs : Fix incorrect code which relied on catching
15694 a NullReferenceException to detect a null being passed in
15695 where an object was expected.
15697 2002-09-06 Miguel de Icaza <miguel@ximian.com>
15699 * statement.cs (Try): flag the catch variable as assigned
15701 * expression.cs (Cast): Simplified by using ResolveType instead of
15702 manually resolving.
15704 * statement.cs (Catch): Fix bug by using ResolveType.
15706 2002-09-06 Ravi Pratap <ravi@ximian.com>
15708 * expression.cs (BetterConversion): Special case for when we have
15709 a NullLiteral as the argument and we have to choose between string
15710 and object types - we choose string the way csc does.
15712 * attribute.cs (Attribute.Resolve): Catch the
15713 NullReferenceException and report error #182 since the Mono
15714 runtime no more has the bug and having this exception raised means
15715 we tried to select a constructor which takes an object and is
15718 2002-09-05 Ravi Pratap <ravi@ximian.com>
15720 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15721 message (1502, 1503) when we can't locate a method after overload
15722 resolution. This is much more informative and closes the bug
15725 * interface.cs (PopulateMethod): Return if there are no argument
15726 types. Fixes a NullReferenceException bug.
15728 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15729 expressions too. Previously we were checking only in one place for
15730 positional arguments leaving out named arguments.
15732 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15733 type to the enum type is not allowed. Remove code corresponding to
15736 (ConvertNumericExplicit): Allow explicit conversions from
15737 the underlying type to enum type. This precisely follows the spec
15738 and closes a bug filed by Gonzalo.
15740 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15743 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15745 2002-09-03 Miguel de Icaza <miguel@ximian.com>
15747 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15748 it was important that we stored the right value after the
15749 reduction in `converted'.
15751 2002-09-04 Martin Baulig <martin@gnome.org>
15753 * location.cs (Location.SymbolDocument): Use full pathnames for the
15756 2002-08-30 Miguel de Icaza <miguel@ximian.com>
15758 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15759 of the expression resolve mechanism, because that will catch the
15760 SimpleName error failures.
15762 (Conditional): If we can not resolve the
15763 expression, return, do not crash.
15765 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15768 (location): display token name instead of its number.
15770 2002-08-28 Martin Baulig <martin@gnome.org>
15772 * expression.cs (Binary.ResolveOperator): Don't silently return
15773 but return an error if an operator cannot be applied between two
15776 2002-08-28 Martin Baulig <martin@gnome.org>
15778 * class.cs (Constructor.Define): Set the permission attributes
15779 correctly instead of making all constructors public.
15781 2002-08-28 Martin Baulig <martin@gnome.org>
15783 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15784 for private members before reporting a CS0103; if we find anything,
15787 2002-08-28 Martin Baulig <martin@gnome.org>
15789 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15790 to check whether `closure_start_type == closure_invocation_type',
15791 we also need to check whether `m.DeclaringType == closure_invocation_type'
15792 before bypassing the permission checks. We might be accessing
15793 protected/private members from the base class.
15794 (TypeManager.RealMemberLookup): Only set private_ok if private
15795 members were requested via BindingFlags.NonPublic.
15797 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15799 * expression.cs (MemberAccess.ResolveMemberAccess): Set
15800 MethodGroupExpr.IsExplicitImpl if appropriate.
15801 (Invocation.DoResolve): Don't report the CS0120 for explicit
15802 interface implementations.
15804 2002-08-27 Martin Baulig <martin@gnome.org>
15806 * expression.cs (Invocation.DoResolve): If this is a static
15807 method and we don't have an InstanceExpression, we must report
15810 2002-08-25 Martin Baulig <martin@gnome.org>
15812 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15813 `==' between a valuetype and an object.
15815 2002-08-25 Miguel de Icaza <miguel@ximian.com>
15817 * ecore.cs (TypeExpr): Provide a ToString method.
15819 2002-08-24 Martin Baulig <martin@gnome.org>
15821 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15822 now called proggie.dbg and it's a binary file.
15824 2002-08-23 Martin Baulig <martin@gnome.org>
15826 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15828 2002-08-23 Martin Baulig <martin@gnome.org>
15830 * struct.cs (MyStructInfo.ctor): Make this work with empty
15831 structs; it's not allowed to use foreach() on null.
15833 2002-08-23 Martin Baulig <martin@gnome.org>
15835 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15836 writer the full pathname of the generated assembly.
15838 2002-08-23 Martin Baulig <martin@gnome.org>
15840 * statements.cs (FlowBranching.UsageVector.MergeChildren):
15841 A `finally' block never returns or breaks; improved handling of
15844 2002-08-23 Martin Baulig <martin@gnome.org>
15846 * statement.cs (Throw.Resolve): Allow `throw null'.
15848 2002-08-23 Martin Baulig <martin@gnome.org>
15850 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15851 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15852 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
15853 MemberLookup would return a wrong event if this is an explicit
15854 interface implementation and the class has an event with the same
15857 2002-08-23 Martin Baulig <martin@gnome.org>
15859 * statement.cs (Block.AddChildVariableNames): New public method.
15860 (Block.AddChildVariableName): Likewise.
15861 (Block.IsVariableNameUsedInChildBlock): Likewise.
15862 (Block.AddVariable): Check whether a variable name has already
15863 been used in a child block.
15865 * cs-parser.jay (declare_local_variables): Mark all variable names
15866 from the current block as being used in a child block in the
15869 2002-08-23 Martin Baulig <martin@gnome.org>
15871 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15872 find the symbol writer.
15874 * driver.cs: csc also allows the arguments to /define being
15875 separated by commas, not only by semicolons.
15877 2002-08-23 Martin Baulig <martin@gnome.org>
15879 * interface.cs (Interface.GetMembers): Added static check for events.
15881 2002-08-15 Martin Baulig <martin@gnome.org>
15883 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15884 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15886 * ecore.cs (Expression.MemberLookup): Added documentation and explained
15887 why the MethodData.EmitDestructor() change was necessary.
15889 2002-08-20 Martin Baulig <martin@gnome.org>
15891 * class.cs (TypeContainer.FindMembers): Added static check for events.
15893 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15895 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15896 use Type.GetEvents(), not Type.FindMembers().
15898 2002-08-20 Martin Baulig <martin@gnome.org>
15900 * decl.cs (MemberCache): Added a special method cache which will
15901 be used for method-only searched. This ensures that a method
15902 search will return a MethodInfo with the correct ReflectedType for
15905 2002-08-20 Martin Baulig <martin@gnome.org>
15907 * decl.cs (DeclSpace.FindMembers): Made this public.
15909 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15911 * delegate.cs: fixed build on windows.
15912 [FIXME: Filed as bug #29150: MCS must report these errors.]
15914 2002-08-19 Ravi Pratap <ravi@ximian.com>
15916 * ecore.cs (StandardConversionExists): Return a false
15917 if we are trying to convert the void type to anything else
15918 since that is not allowed.
15920 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15921 we flag error 70 in the event an event is trying to be accessed
15922 directly from outside the declaring type.
15924 2002-08-20 Martin Baulig <martin@gnome.org>
15926 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15927 MemberCache from typemanager.cs to decl.cs.
15929 2002-08-19 Martin Baulig <martin@gnome.org>
15931 * class.cs (TypeContainer): Implement IMemberContainer.
15932 (TypeContainer.DefineMembers): Create the MemberCache.
15933 (TypeContainer.FindMembers): Do better BindingFlags checking; only
15934 return public members if BindingFlags.Public was given, check
15935 whether members are static.
15937 2002-08-16 Martin Baulig <martin@gnome.org>
15939 * decl.cs (DeclSpace.Define): Splitted this in Define and
15940 DefineMembers. DefineMembers is called first and initializes the
15943 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
15944 DefineMembers() on all our DeclSpaces.
15946 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15947 but call DefineMembers() on all nested interfaces. We call their
15948 Define() in our new Define() function.
15950 * interface.cs (Interface): Implement IMemberContainer.
15951 (Interface.Define): Moved all code except the attribute stuf to
15953 (Interface.DefineMembers): Initialize the member cache.
15955 * typemanager.cs (IMemberFinder): Removed this interface, we don't
15956 need this anymore since we can use MemberCache.FindMembers directly.
15958 2002-08-19 Martin Baulig <martin@gnome.org>
15960 * typemanager.cs (MemberCache): When creating the cache for an
15961 interface type, add all inherited members.
15962 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15963 to `out bool used_cache' and documented it.
15964 (TypeManager.MemberLookup): If we already used the cache in the first
15965 iteration, we don't need to do the interfaces check.
15967 2002-08-19 Martin Baulig <martin@gnome.org>
15969 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
15970 here from IMemberFinder and don't implement this interface anymore.
15971 (DeclSpace.MemberCache): Moved here from IMemberFinder.
15973 * typemanager.cs (IMemberFinder): This interface is now only used by
15974 classes which actually support the member cache.
15975 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15976 since we only put DeclSpaces into this Hashtable.
15977 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15978 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15980 2002-08-16 Martin Baulig <martin@gnome.org>
15982 * typemanager.cs (ICachingMemberFinder): Removed.
15983 (IMemberFinder.MemberCache): New property.
15984 (TypeManager.FindMembers): Merged this with RealFindMembers().
15985 This function will never be called from TypeManager.MemberLookup()
15986 so we can't use the cache here, just the IMemberFinder.
15987 (TypeManager.MemberLookup_FindMembers): Check whether the
15988 IMemberFinder has a MemberCache and call the cache's FindMembers
15990 (MemberCache): Rewrote larger parts of this yet another time and
15991 cleaned it up a bit.
15993 2002-08-15 Miguel de Icaza <miguel@ximian.com>
15995 * driver.cs (LoadArgs): Support quoting.
15997 (Usage): Show the CSC-like command line arguments.
15999 Improved a few error messages.
16001 2002-08-15 Martin Baulig <martin@gnome.org>
16003 * typemanager.cs (IMemberContainer.Type): New property.
16004 (IMemberContainer.IsInterface): New property.
16006 The following changes are conditional to BROKEN_RUNTIME, which is
16007 defined at the top of the file.
16009 * typemanager.cs (MemberCache.MemberCache): Don't add the base
16010 class'es members, but add all members from TypeHandle.ObjectType
16011 if we're an interface.
16012 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16013 is the current type.
16014 (MemberCache.CacheEntry.Container): Removed this field.
16015 (TypeHandle.GetMembers): Include inherited members.
16017 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16019 * typemanager.cs: fixed compilation and added a comment on a field that
16022 2002-08-15 Martin Baulig <martin@gnome.org>
16024 * class.cs (ConstructorInitializer.Resolve): In the
16025 Expression.MemberLookup call, use the queried_type as
16028 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16029 declared' attribute, it's always true.
16030 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16031 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16032 temporary wrapper for FindMembers which tells MemberLookup whether
16033 members from the base classes are included in the return value.
16034 This will go away soon.
16035 (TypeManager.MemberLookup): Use this temporary hack here; once the
16036 new MemberCache is completed, we don't need to do the DeclaredOnly
16037 looping here anymore since the MemberCache will take care of this.
16038 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16039 (MemberCache): When creating the MemberCache for a class, get
16040 members from the current class and all its base classes.
16041 (MemberCache.CacheEntry.Container): New field. This is a
16042 temporary hack until the Mono runtime is fixed to distinguish
16043 between ReflectedType and DeclaringType. It allows us to use MCS
16044 with both the MS runtime and the unfixed Mono runtime without
16045 problems and without accecting performance.
16046 (MemberCache.SearchMembers): The DeclaredOnly looping from
16047 TypeManager.MemberLookup is now done here.
16049 2002-08-14 Martin Baulig <martin@gnome.org>
16051 * statement.cs (MyStructInfo.MyStructInfo): Don't call
16052 Type.GetFields on dynamic types but get the fields from the
16053 corresponding TypeContainer.
16054 (MyStructInfo.GetStructInfo): Added check for enum types.
16056 * typemanager.cs (MemberList.IsSynchronized): Implemented.
16057 (MemberList.SyncRoot): Implemented.
16058 (TypeManager.FilterWithClosure): No need to check permissions if
16059 closure_start_type == closure_invocation_type, don't crash if
16060 closure_invocation_type is null.
16062 2002-08-13 Martin Baulig <martin@gnome.org>
16064 Rewrote TypeContainer.FindMembers to use a member cache. This
16065 gives us a speed increase of about 35% for the self-hosting MCS
16066 build and of about 15-20% for the class libs (both on GNU/Linux).
16068 * report.cs (Timer): New class to get enhanced profiling. This
16069 whole class is "TIMER" conditional since it remarkably slows down
16072 * class.cs (MemberList): New class. This is an IList wrapper
16073 which we're now using instead of passing MemberInfo[]'s around to
16074 avoid copying this array unnecessarily.
16075 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16076 (ICachingMemberFinder, IMemberContainer): New interface.
16077 (TypeManager.FilterWithClosure): If `criteria' is null, the name
16078 has already been checked, otherwise use it for the name comparision.
16079 (TypeManager.FindMembers): Renamed to RealMemberFinder and
16080 provided wrapper which tries to use ICachingMemberFinder.FindMembers
16081 if possible. Returns a MemberList, not a MemberInfo [].
16082 (TypeHandle): New class, implements IMemberContainer. We create
16083 one instance of this class per type, it contains a MemberCache
16084 which is used to do the member lookups.
16085 (MemberCache): New class. Each instance of this class contains
16086 all members of a type and a name-based hash table.
16087 (MemberCache.FindMembers): This is our new member lookup
16088 function. First, it looks up all members of the requested name in
16089 the hash table. Then, it walks this list and sorts out all
16090 applicable members and returns them.
16092 2002-08-13 Martin Baulig <martin@gnome.org>
16094 In addition to a nice code cleanup, this gives us a performance
16095 increase of about 1.4% on GNU/Linux - not much, but it's already
16096 half a second for the self-hosting MCS compilation.
16098 * typemanager.cs (IMemberFinder): New interface. It is used by
16099 TypeManager.FindMembers to call FindMembers on a TypeContainer,
16100 Enum, Delegate or Interface.
16101 (TypeManager.finder_to_member_finder): New PtrHashtable.
16102 (TypeManager.finder_to_container): Removed.
16103 (TypeManager.finder_to_delegate): Removed.
16104 (TypeManager.finder_to_interface): Removed.
16105 (TypeManager.finder_to_enum): Removed.
16107 * interface.cs (Interface): Implement IMemberFinder.
16109 * delegate.cs (Delegate): Implement IMemberFinder.
16111 * enum.cs (Enum): Implement IMemberFinder.
16113 * class.cs (TypeContainer): Implement IMemberFinder.
16115 2002-08-12 Martin Baulig <martin@gnome.org>
16117 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16119 2002-08-12 Martin Baulig <martin@gnome.org>
16121 * ecore.cs (ITypeExpression): New interface for expressions which
16123 (TypeExpression): Renamed to TypeLookupExpression.
16124 (Expression.DoResolve): If we're doing a types-only lookup, the
16125 expression must implement the ITypeExpression interface and we
16126 call DoResolveType() on it.
16127 (SimpleName): Implement the new ITypeExpression interface.
16128 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16129 hack, the situation that we're only looking up types can't happen
16130 anymore when this method is called. Moved the type lookup code to
16131 DoResolveType() and call it.
16132 (SimpleName.DoResolveType): This ITypeExpression interface method
16133 is now doing the types-only lookup.
16134 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16135 (ResolveFlags): Added MaskExprClass.
16137 * expression.cs (MemberAccess): Implement the ITypeExpression
16139 (MemberAccess.DoResolve): Added support for a types-only lookup
16140 when we're called via ITypeExpression.DoResolveType().
16141 (ComposedCast): Implement the ITypeExpression interface.
16143 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
16144 Expression.Resolve() with ResolveFlags.Type instead.
16146 2002-08-12 Martin Baulig <martin@gnome.org>
16148 * interface.cs (Interface.Define): Apply attributes.
16150 * attribute.cs (Attribute.ApplyAttributes): Added support for
16151 interface attributes.
16153 2002-08-11 Martin Baulig <martin@gnome.org>
16155 * statement.cs (Block.Emit): Only check the "this" variable if we
16156 do not always throw an exception.
16158 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16159 whether the property has a set accessor.
16161 2002-08-11 Martin Baulig <martin@gnome.org>
16163 Added control flow analysis support for structs.
16165 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16166 with control flow analysis turned off.
16167 (IVariable): New interface.
16168 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16169 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16170 (FieldExpr.DoResolve): Resolve the instance expression with flow
16171 analysis turned off and do the definite assignment check after the
16172 resolving when we know what the expression will resolve to.
16174 * expression.cs (LocalVariableReference, ParameterReference):
16175 Implement the new IVariable interface, only call the flow analysis
16176 code if ec.DoFlowAnalysis is true.
16177 (This): Added constructor which takes a Block argument. Implement
16178 the new IVariable interface.
16179 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16180 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16181 This does the definite assignment checks for struct members.
16183 * class.cs (Constructor.Emit): If this is a non-static `struct'
16184 constructor which doesn't have any initializer, call
16185 Block.AddThisVariable() to tell the flow analysis code that all
16186 struct elements must be initialized before control returns from
16189 * statement.cs (MyStructInfo): New public class.
16190 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16191 argument to this indexer. If non-zero, check an individual struct
16192 member, not the whole struct.
16193 (FlowBranching.CheckOutParameters): Check struct members.
16194 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16195 overloaded versions of these methods which take an additional
16196 `int field_idx' argument to check struct members.
16197 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16198 overloaded versions of these methods which take an additional
16199 `string field_name' argument to check struct member.s
16200 (VariableInfo): Implement the IVariable interface.
16201 (VariableInfo.StructInfo): New public property. Returns the
16202 MyStructInfo instance of the variable if it's a struct or null.
16203 (Block.AddThisVariable): New public method. This is called from
16204 Constructor.Emit() for non-static `struct' constructor which do
16205 not have any initializer. It creates a special variable for the
16206 "this" instance variable which will be checked by the flow
16207 analysis code to ensure that all of the struct's fields are
16208 initialized before control returns from the constructor.
16209 (UsageVector): Added support for struct members. If a
16210 variable/parameter is a struct with N members, we reserve a slot
16211 in the usage vector for each member. A struct is considered fully
16212 initialized if either the struct itself (slot 0) or all its
16213 members are initialized.
16215 2002-08-08 Martin Baulig <martin@gnome.org>
16217 * driver.cs (Driver.MainDriver): Only report an error CS5001
16218 if there were no compilation errors.
16220 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16221 `UnsafeContext' property to determine whether the parent is in
16222 unsafe context rather than checking the parent's ModFlags:
16223 classes nested in an unsafe class are unsafe as well.
16225 2002-08-08 Martin Baulig <martin@gnome.org>
16227 * statement.cs (UsageVector.MergeChildren): Distinguish between
16228 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16229 we return. Added test17() and test18() to test-154.cs.
16231 2002-08-08 Martin Baulig <martin@gnome.org>
16233 * typemanager.cs (TypeManager.FilterWithClosure): If we have
16234 Family access, make sure the invoking type isn't a subclass of the
16235 queried type (that'd be a CS1540).
16237 * ecore.cs (Expression.MemberLookup): Added overloaded version of
16238 this method which takes an additional `Type invocation_type'.
16240 * expression.cs (BaseAccess.DoResolve): Use the base type as
16241 invocation and query type.
16242 (MemberAccess.DoResolve): If the lookup failed and we're about to
16243 report a CS0122, try a lookup with the ec.ContainerType - if this
16244 succeeds, we must report a CS1540.
16246 2002-08-08 Martin Baulig <martin@gnome.org>
16248 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16249 (MethodGroupExpr): Implement the IMemberExpr interface.
16251 * expression (MemberAccess.ResolveMemberAccess): No need to have
16252 any special code for MethodGroupExprs anymore, they're now
16255 2002-08-08 Martin Baulig <martin@gnome.org>
16257 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16258 Family, FamANDAssem and FamORAssem permissions.
16259 (TypeManager.IsSubclassOrNestedChildOf): New public method.
16261 2002-08-08 Martin Baulig <martin@gnome.org>
16263 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16264 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16267 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16269 * driver.cs: implemented /resource option to embed managed resources.
16271 2002-08-07 Martin Baulig <martin@gnome.org>
16273 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16274 (FieldBase.HasFieldInitializer): New public property.
16275 (FieldBase.GetInitializerExpression): New public method. Resolves and
16276 returns the field initializer and makes sure it is only resolved once.
16277 (TypeContainer.EmitFieldInitializers): Call
16278 FieldBase.GetInitializerExpression to get the initializer, this ensures
16279 that it isn't resolved multiple times.
16281 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
16282 the resolving process (SimpleName/MemberLookup) that we're currently
16283 emitting a field initializer (which must not access any instance members,
16284 this is an error CS0236).
16286 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16287 argument, if the `IsFieldInitializer' flag is set, we must report and
16288 error CS0236 and not an error CS0120.
16290 2002-08-07 Martin Baulig <martin@gnome.org>
16292 * ecore.cs (IMemberExpr): New public interface.
16293 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16294 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16295 if the expression is an IMemberExpr.
16297 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16298 to be null, implicitly default to `this' if we're non-static in
16299 this case. Simplified the code a lot by using the new IMemberExpr
16300 interface. Also fixed bug #28176 here.
16302 2002-08-06 Martin Baulig <martin@gnome.org>
16304 * cs-parser.jay (SimpleLookup): Removed. We need to create
16305 ParameterReferences during semantic analysis so that we can do a
16306 type-only search when resolving Cast, TypeOf and SizeOf.
16307 (block): Pass the `current_local_parameters' to the Block's
16310 * class.cs (ConstructorInitializer): Added `Parameters parameters'
16311 argument to the constructor.
16312 (ConstructorInitializer.Resolve): Create a temporary implicit
16313 block with the parameters.
16315 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16316 references here if we aren't doing a type-only search.
16318 * statement.cs (Block): Added constructor which takes a
16319 `Parameters parameters' argument.
16320 (Block.Parameters): New public property.
16322 * support.cs (InternalParameters.Parameters): Renamed `parameters'
16323 to `Parameters' and made it public readonly.
16325 2002-08-06 Martin Baulig <martin@gnome.org>
16327 * ecore.cs (Expression.Warning): Made this public as well.
16329 * report.cs (Report.Debug): Print the contents of collections.
16331 2002-08-06 Martin Baulig <martin@gnome.org>
16333 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
16334 used to tell Resolve() which kinds of expressions it may return.
16335 (Expression.Resolve): Added overloaded version of this method which
16336 takes a `ResolveFlags flags' argument. This can be used to tell
16337 Resolve() which kinds of expressions it may return. Reports a
16339 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16340 ResolveFlags.SimpleName.
16341 (Expression.Error118): Added overloaded version of this method which
16342 takes a `ResolveFlags flags' argument. It uses the flags to determine
16343 which kinds of expressions are allowed.
16345 * expression.cs (Argument.ResolveMethodGroup): New public method.
16346 Resolves an argument, but allows a MethodGroup to be returned.
16347 This is used when invoking a delegate.
16349 * TODO: Updated a bit.
16351 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16353 Fixed compilation with csc.
16355 * ecore.cs: Expression.Error made public. Is this correct? Should
16356 Warning be made public too?
16358 * expression.cs: use ea.Location instead of ea.loc.
16359 [FIXME: Filed as bug #28607: MCS must report these errors.]
16361 2002-08-06 Martin Baulig <martin@gnome.org>
16363 * ecore.cs (Expression.loc): Moved the location here instead of
16364 duplicating it in all derived classes.
16365 (Expression.Location): New public property.
16366 (Expression.Error, Expression.Warning): Made them non-static and
16367 removed the location argument.
16368 (Expression.Warning): Added overloaded version which takes an
16369 `int level' argument.
16370 (Expression.Error118): Make this non-static and removed the
16371 expression and location arguments.
16372 (TypeExpr): Added location argument to the constructor.
16374 * expression.cs (StaticCallExpr): Added location argument to
16376 (Indirection, PointerArithmetic): Likewise.
16377 (CheckedExpr, UnCheckedExpr): Likewise.
16378 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16379 (StringPtr): Likewise.
16382 2002-08-05 Martin Baulig <martin@gnome.org>
16384 * expression.cs (BaseAccess.DoResolve): Actually report errors.
16386 * assign.cs (Assign.DoResolve): Check whether the source
16387 expression is a value or variable.
16389 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16390 while resolving the corresponding blocks.
16392 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16393 an error, don't silently return null.
16395 * statement.cs (Block.AddVariable): Do the error reporting here
16396 and distinguish between CS0128 and CS0136.
16397 (Block.DoResolve): Report all unused labels (warning CS0164).
16398 (LabeledStatement): Pass the location to the constructor.
16399 (LabeledStatement.HasBeenReferenced): New property.
16400 (LabeledStatement.Resolve): Set it to true here.
16402 * statement.cs (Return.Emit): Return success even after reporting
16403 a type mismatch error (CS0126 or CS0127), this is what csc does and
16404 it avoids confusing the users with any consecutive errors.
16406 2002-08-05 Martin Baulig <martin@gnome.org>
16408 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16410 * const.cs (Const.LookupConstantValue): Catch circular definitions.
16412 * expression.cs (MemberAccess.DoResolve): Silently return if an
16413 error has already been reported.
16415 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16416 error has already been reported.
16418 2002-08-05 Martin Baulig <martin@gnome.org>
16420 * statement.cs (UsageVector): Only initialize the `parameters'
16421 vector if we actually have any "out" parameters.
16423 2002-08-05 Martin Baulig <martin@gnome.org>
16425 * expression.cs (Binary.ResolveOperator): When combining delegates,
16426 they must have the same type.
16428 2002-08-05 Martin Baulig <martin@gnome.org>
16430 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16431 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16432 work with the ms runtime and we also don't need it: if we're a
16433 PropertyBuilder and not in the `indexer_arguments' hash, then we
16434 are a property and not an indexer.
16436 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16437 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16438 since the latter one doesn't work with the ms runtime.
16440 2002-08-03 Martin Baulig <martin@gnome.org>
16442 Fixed bugs #27998 and #22735.
16444 * class.cs (Method.IsOperator): New public field.
16445 (Method.CheckBase): Report CS0111 if there's already a method
16446 with the same parameters in the current class. Report CS0508 when
16447 attempting to change the return type of an inherited method.
16448 (MethodData.Emit): Report CS0179 if a method doesn't have a body
16449 and it's not marked abstract or extern.
16450 (PropertyBase): New abstract base class for Property and Indexer.
16451 (PropertyBase.CheckBase): Moved here from Property and made it work
16453 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16454 the same so we can reuse it there.
16455 (Property, Indexer): Derive from PropertyBase.
16456 (MethodSignature.inheritable_property_signature_filter): New delegate
16457 to find properties and indexers.
16459 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16460 argument and improved error reporting.
16462 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16463 EmptyReadOnlyParameters and made it a property.
16465 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16466 version of this method which takes a `PropertyInfo indexer'.
16467 (TypeManager.RegisterIndexer): New method.
16469 * class.cs: Added myself as author of this file :-)
16471 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16473 * class.cs: fixed compilation on windoze.
16475 2002-08-03 Martin Baulig <martin@gnome.org>
16477 * interface.cs (Interface.GetInterfaceBases): Check whether all
16478 base interfaces are at least as accessible than the current one.
16480 * class.cs (TypeContainer.GetClassBases): Check whether base types
16481 are at least as accessible than the current type.
16482 (TypeContainer.AsAccessible): Implemented and made non-static.
16483 (MemberBase.CheckParameters): Report errors if the accessibility
16486 * delegate.cs (Delegate.Delegate): The default visibility is
16487 internal for top-level types and private for nested types.
16488 (Delegate.Define): Report errors if the accessibility checks fail.
16490 * enum.cs (Enum.Enum): The default visibility is internal for
16491 top-level types and private for nested types.
16492 (Enum.DefineType): Compute the correct visibility.
16494 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16495 function which takes a `bool is_toplevel' instead of a TypeContainer.
16497 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16500 2002-08-02 Martin Baulig <martin@gnome.org>
16502 * expression.cs (LocalVariableReferenc): Added constructor which
16503 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16504 (LocalVariableReference.IsReadOnly): New property.
16505 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16506 variable is readonly, use our own readonly flag to do this; you can
16507 use the new constructor to get a writable reference to a read-only
16510 * cs-parser.jay (foreach_statement, using_statement): Get a writable
16511 reference to the local variable.
16513 2002-08-01 Miguel de Icaza <miguel@ximian.com>
16515 * rootcontext.cs (ResolveCore): Also include System.Exception
16517 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16518 we reach an EmptyStatement.
16520 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16523 * expression.cs (Binary.ResolveOperator): Check error result in
16526 use brtrue/brfalse directly and avoid compares to null.
16528 2002-08-02 Martin Baulig <martin@gnome.org>
16530 * class.cs (TypeContainer.Define): Define all nested interfaces here.
16531 Fixes bug #28407, added test-155.cs.
16533 2002-08-01 Martin Baulig <martin@gnome.org>
16535 * class.cs (Event.EmitDefaultMethod): Make this work with static
16536 events. Fixes #28311, added verify-3.cs.
16538 2002-08-01 Martin Baulig <martin@gnome.org>
16540 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16541 `is_disposable' fields.
16542 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16543 `hm.is_disposable' if we're using the collection pattern.
16544 (Foreach.EmitCollectionForeach): Use the correct type for the
16545 enumerator's local variable, only emit the try/finally block if
16546 necessary (fixes #27713).
16548 2002-08-01 Martin Baulig <martin@gnome.org>
16550 * ecore.cs (Expression.report118): Renamed to Error118 and made
16553 * statement.cs (Throw.Resolve): Check whether the expression is of
16554 the correct type (CS0118) and whether the type derives from
16555 System.Exception (CS0155).
16556 (Catch.Resolve): New method. Do the type lookup here and check
16557 whether it derives from System.Exception (CS0155).
16558 (Catch.CatchType, Catch.IsGeneral): New public properties.
16560 * typemanager.cs (TypeManager.exception_type): Added.
16562 2002-07-31 Miguel de Icaza <miguel@ximian.com>
16564 * driver.cs: Updated About function.
16566 2002-07-31 Martin Baulig <martin@gnome.org>
16568 Implemented Control Flow Analysis.
16570 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16571 (EmitContext.CurrentBranching): Added.
16572 (EmitContext.StartFlowBranching): Added.
16573 (EmitContext.EndFlowBranching): Added.
16574 (EmitContext.KillFlowBranching): Added.
16575 (EmitContext.IsVariableAssigned): Added.
16576 (EmitContext.SetVariableAssigned): Added.
16577 (EmitContext.IsParameterAssigned): Added.
16578 (EmitContext.SetParameterAssigned): Added.
16579 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16580 Added control flow analysis stuff here.
16582 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16583 resolve the expression as lvalue.
16584 (LocalVariableReference.DoResolve): Check whether the variable has
16585 already been assigned.
16586 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16587 the parameter as assigned here.
16588 (ParameterReference.DoResolve): Check whether the parameter has already
16590 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16591 expression as lvalue.
16593 * statement.cs (FlowBranching): New class for the flow analysis code.
16594 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16595 (LabeledStatement.IsDefined): New public property.
16596 (LabeledStatement.AddUsageVector): New public method to tell flow
16597 analyis that the label may be reached via a forward jump.
16598 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16600 (VariableInfo.Number): New public field. This is used by flow analysis
16601 to number all locals of a block.
16602 (Block.CountVariables): New public property. This is the number of
16603 local variables in this block (including the locals from all parent
16605 (Block.EmitMeta): Number all the variables.
16607 * statement.cs: Added flow analysis support to all classes.
16609 2002-07-31 Martin Baulig <martin@gnome.org>
16611 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16612 To get debugging messages, compile mcs with /define:MCS_DEBUG and
16613 then use this argument.
16615 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16617 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16618 use this to specify /define options.
16620 2002-07-29 Martin Baulig <martin@gnome.org>
16622 * statement.cs (Fixed): Moved all code that does variable lookups
16623 and resolvings from Emit to Resolve.
16625 * statement.cs (For): Moved all code that does variable lookups
16626 and resolvings from Emit to Resolve.
16628 * statement.cs (Using): Moved all code that does variable lookups
16629 and resolvings from Emit to Resolve.
16631 2002-07-29 Martin Baulig <martin@gnome.org>
16633 * attribute.cs (Attribute.Resolve): Explicitly catch a
16634 System.NullReferenceException when creating the
16635 CustromAttributeBuilder and report a different warning message.
16637 2002-07-29 Martin Baulig <martin@gnome.org>
16639 * support.cs (ParameterData.ParameterName): Added method to
16640 get the name of a parameter.
16642 * typemanager.cs (TypeManager.IsValueType): New public method.
16644 2002-07-29 Martin Baulig <martin@gnome.org>
16646 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
16647 is a flag which specifies that it's either ref or out.
16648 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16649 the out parameter to `out Parameter.Modifier mod', also set the
16650 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16652 * support.cs (InternalParameters.ParameterModifier): Distinguish
16653 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16654 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16656 * expression.cs (Argument.GetParameterModifier): Distinguish
16657 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16658 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16660 2002-07-29 Martin Baulig <martin@gnome.org>
16662 * expression.cs (ParameterReference.ParameterReference): Added
16663 `Location loc' argument to the constructor.
16665 * cs-parser.jay: Pass location to ParameterReference.
16667 2002-07-28 Miguel de Icaza <miguel@ximian.com>
16669 * statement.cs (Try): Initialize the location.
16671 * cs-parser.jay: pass location to Try.
16673 * expression.cs (Unary.Reduce): Change the prototype to return
16674 whether a constant fold could be performed or not. The result is
16675 returned in an out parameters. In the case of Indirection and
16676 AddressOf, we want to perform the full tests.
16678 2002-07-26 Miguel de Icaza <miguel@ximian.com>
16680 * statement.cs (Statement.Emit): Flag dead code.
16682 2002-07-27 Andrew Birkett <andy@nobugs.org>
16684 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16686 2002-07-27 Martin Baulig <martin@gnome.org>
16688 * class.cs (MethodData.Define): Put back call to
16689 TypeManager.AddMethod(), accidentally commented this out.
16691 * report.cs (Debug): New public method to print debugging information,
16692 this is `[Conditional ("DEBUG")]'.
16694 2002-07-26 Martin Baulig <martin@gnome.org>
16696 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16697 (switch_statement): Push the current_block to the switch_stack and
16698 pop it again when we're done with the switch.
16699 (switch_section): The new block is a child of the current_block.
16700 Fixes bug #24007, added test-152.cs.
16702 2002-07-27 Martin Baulig <martin@gnome.org>
16704 * expression.cs (Invocation.EmitArguments): When calling a varargs
16705 function with only its fixed arguments, we need to pass an empty
16708 2002-07-27 Martin Baulig <martin@gnome.org>
16710 Mono 0.13 has been released.
16712 2002-07-25 Miguel de Icaza <miguel@ximian.com>
16714 * driver.cs: Rename --resource to --linkres, because that is what
16715 we do currently, we dont support --resource yet.
16717 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16719 2002-07-25 Martin Baulig <martin@gnome.org>
16721 * class.cs (MethodData): New public class. This is a `method builder'
16722 class for a method or one accessor of a Property/Indexer/Event.
16723 (MethodData.GetMethodFlags): Moved here from MemberBase.
16724 (MethodData.ApplyAttributes): Likewise.
16725 (MethodData.ApplyObsoleteAttribute): Likewise.
16726 (MethodData.ApplyConditionalAttribute): Likewise.
16727 (MethodData.ApplyDllImportAttribute): Likewise.
16728 (MethodData.CheckAbstractAndExternal): Likewise.
16729 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16730 (MethodData.Emit): Formerly known as Method.Emit().
16731 (MemberBase): Moved everything which was specific to a single
16732 accessor/method to MethodData.
16733 (Method): Create a new MethodData and call Define() and Emit() on it.
16734 (Property, Indexer, Event): Create a new MethodData objects for each
16735 accessor and call Define() and Emit() on them.
16737 2002-07-25 Martin Baulig <martin@gnome.org>
16739 Made MethodCore derive from MemberBase to reuse the code from there.
16740 MemberBase now also checks for attributes.
16742 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16743 (MemberBase.GetMethodFlags): Moved here from class Method and marked
16745 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16746 `CallingConventions cc' and `Attributes opt_attrs' arguments.
16747 (MemberBase.ApplyAttributes): New virtual method; applies the
16748 attributes to a method or accessor.
16749 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16750 (MemberBase.ApplyConditionalAttribute): Likewise.
16751 (MemberBase.ApplyDllImportAttribute): Likewise.
16752 (MemberBase.CheckAbstractAndExternal): Likewise.
16753 (MethodCore.ParameterTypes): This is now a property instead of a
16754 method, it's initialized from DoDefineParameters().
16755 (MethodCore.ParameterInfo): Removed the set accessor.
16756 (MethodCore.DoDefineParameters): New protected virtual method to
16757 initialize ParameterTypes and ParameterInfo.
16758 (Method.GetReturnType): We can now simply return the MemberType.
16759 (Method.GetMethodFlags): Override the MemberBase version and add
16760 the conditional flags.
16761 (Method.CheckBase): Moved some code from Define() here, call
16762 DoDefineParameters() here.
16763 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16764 here to avoid some larger code duplication.
16765 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16766 ensure that abstract and external accessors don't declare a body.
16768 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16769 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16770 lookup in the attribute's parent classes, so we need to abort as soon
16771 as we found the first match.
16772 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16773 the attribute has no arguments.
16775 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16778 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16780 * cs-parser.jay: reverted previous patch.
16782 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16784 * cs-parser.jay: fixed bug #22119.
16786 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16788 * attribute.cs: fixed compilation. The error was:
16789 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
16790 be assigned to before control leaves the current method."
16791 [FIXME: Filed as bug #28186: MCS must report this error.]
16793 2002-07-25 Martin Baulig <martin@gnome.org>
16795 * attribute.cs (Attribute.Conditional_GetConditionName): New static
16796 method to pull the condition name ouf of a Conditional attribute.
16797 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16798 the obsolete message and error flag out of an Obsolete attribute.
16800 * class.cs (Method.GetMethodFlags): New public method to get the
16801 TypeManager.MethodFlags for this method.
16802 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16804 (Method.Define): Get and apply the Obsolete and Conditional attributes;
16805 if we're overriding a virtual function, set the new private variable
16806 `parent_method'; call the new TypeManager.AddMethod().
16808 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
16809 the MethodBuilder and the Method in a PtrHashtable.
16810 (TypeManager.builder_to_method): Added for this purpose.
16811 (TypeManager.MethodFlags): Added IsObsoleteError.
16812 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
16813 Obsolete and Conditional arguments in MethodBuilders. If we discover
16814 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16815 the message from the attribute.
16817 2002-07-24 Martin Baulig <martin@gnome.org>
16819 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16820 preprocessor directives, ensure that the argument to #define/#undef is
16821 exactly one identifier and that it's actually an identifier.
16823 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16826 2002-07-24 Martin Baulig <martin@gnome.org>
16828 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16829 initialize it to TypeManager.object_type in the constructor.
16830 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16831 of the `hm.get_current' method if we're using the collection pattern.
16832 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16833 for the explicit conversion to make it work when we're using the collection
16834 pattern and the `Current' property has a different return type than `object'.
16837 2002-07-24 Martin Baulig <martin@gnome.org>
16839 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16840 does not match, but don't report any errors. This method is called in
16841 order for all methods in a MethodGroupExpr until a matching method is
16842 found, so we don't want to bail out if the first method doesn't match.
16843 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16844 matches, report the 123. Fixes #28070.
16846 2002-07-24 Martin Baulig <martin@gnome.org>
16848 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16849 TypeManager.TypeToCoreType() to the top of the method so the
16850 following equality checks will work. Fixes #28107.
16852 2002-07-24 Martin Baulig <martin@gnome.org>
16854 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16855 operand is of type uint, and the other operand is of type sbyte,
16856 short or int, the operands are converted to type long." -
16857 Actually do what this comment already told us. Fixes bug #28106,
16860 2002-07-24 Martin Baulig <martin@gnome.org>
16862 * class.cs (MethodBase): New abstract class. This is now a base
16863 class for Property, Indexer and Event to avoid some code duplication
16864 in their Define() and DefineMethods() methods.
16865 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16866 generic methods for Define() and DefineMethods().
16867 (FieldBase): Derive from MemberBase, not MemberCore.
16868 (Property): Derive from MemberBase, not MemberCore.
16869 (Property.DefineMethod): Moved all the code from this method to the
16870 new MethodBase.DefineAccessor(), just call it with appropriate
16872 (Property.Define): Call the new Property.DoDefine(), this does some
16873 sanity checks and we don't need to duplicate the code everywhere.
16874 (Event): Derive from MemberBase, not MemberCore.
16875 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16876 accessors, this will also make them work with interface events.
16877 (Indexer): Derive from MemberBase, not MemberCore.
16878 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16879 (Indexer.Define): Use the new MethodBase functions.
16881 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16882 argument to the constructor.
16883 (Interface.FindMembers): Added support for interface events.
16884 (Interface.PopluateEvent): Implemented.
16886 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
16888 2002-07-22 Miguel de Icaza <miguel@ximian.com>
16890 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16891 but this is required to check for a method name being the same as
16892 the containing class.
16896 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16898 * interface.cs: initialize variable.
16900 2002-07-23 Martin Baulig <martin@gnome.org>
16902 Implemented the IndexerName attribute in interfaces.
16904 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16905 name if this is an explicit interface implementation.
16906 (Indexer.InterfaceIndexerName): New public variable. If we're
16907 implementing an interface indexer, this is the IndexerName in that
16908 interface. Otherwise, it's the IndexerName.
16909 (Indexer.DefineMethod): If we're implementing interface indexer,
16910 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
16911 and Pending.ImplementIndexer methods.
16912 (Indexer.Define): Also define the PropertyBuilder if we're
16913 implementing an interface indexer and this is neither an explicit
16914 interface implementation nor do the IndexerName match the one in
16917 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16918 If a method is defined here, then we always need to create a proxy
16919 for it. This is used when implementing interface indexers.
16920 (Pending.IsInterfaceIndexer): New public method.
16921 (Pending.ImplementIndexer): New public method.
16922 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16923 This is used when implementing interface indexers to define a proxy
16925 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16926 define a proxy if necessary.
16928 * interface.cs (Interface.IndexerName): New public variable.
16929 (Interface.PopulateIndexer): Set the IndexerName.
16930 (Interface.DefineIndexers): New private method. Populate all the
16931 indexers and make sure their IndexerNames match.
16933 * typemanager.cs (IndexerPropertyName): Added support for interface
16936 2002-07-22 Martin Baulig <martin@gnome.org>
16938 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16939 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16940 ret if HasReturnLabel.
16941 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16944 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16945 and set the ec.LoopBeginTryCatchLevel.
16946 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16947 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16948 the current ec.TryCatchLevel, the branch goes out of an exception
16949 block. In this case, we need to use Leave and not Br.
16951 2002-07-22 Martin Baulig <martin@gnome.org>
16953 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16954 block unless the block does not always return or it is contained in
16955 another try { ... } catch { ... } block. Fixes bug #26506.
16956 Added verify-1.cs to the test suite.
16958 2002-07-22 Martin Baulig <martin@gnome.org>
16960 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16961 then we do not always return. Fixes bug #24985.
16963 2002-07-22 Martin Baulig <martin@gnome.org>
16965 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16966 lookup on a per-class level; ie. walk up the class hierarchy until we
16967 found at least one applicable method, then choose the best among them.
16968 Fixes bug #24463 and test-29.cs.
16970 2002-07-22 Martin Baulig <martin@gnome.org>
16972 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16973 return types of the methods. The return type is not part of the
16974 signature and we must not check it to make the `new' modifier work.
16975 Fixes bug #27999, also added test-147.cs.
16976 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16978 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16979 on the method's return type.
16981 2002-07-21 Martin Baulig <martin@gnome.org>
16983 * assign.cs: Make this work if the rightmost source is a constant and
16984 we need to do an implicit type conversion. Also adding a few more tests
16985 to test-38.cs which should have caught this.
16987 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16988 target in the makefile for this. The makefile.gnu is primarily intended
16989 for end-users who don't want to debug the compiler.
16991 2002-07-21 Martin Baulig <martin@gnome.org>
16993 * assign.cs: Improved the Assign class so it can now handle embedded
16994 assignments (X = Y = Z = something). As a side-effect this'll now also
16995 consume less local variables. test-38.cs now passes with MCS, added
16996 a few new test cases to that test.
16998 2002-07-20 Martin Baulig <martin@gnome.org>
17000 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17001 instructions. Fixes bug #27977, also added test-146.cs.
17003 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17005 * cs-tokenizer.cs: fixed getHex ().
17007 2002-07-19 Martin Baulig <martin@gnome.org>
17009 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17010 not Type.GetType() to lookup the array type. This is needed when
17011 we're constructing an array of a user-defined type.
17012 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17013 single-dimensional arrays, but also for single-dimensial arrays of
17016 2002-07-19 Martin Baulig <martin@gnome.org>
17018 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17019 this function is called, it's not allowed to share LocalBuilders
17020 among ILGenerators.
17022 2002-07-19 Martin Baulig <martin@gnome.org>
17024 * expression.cs (Argument.Resolve): Report an error 118 when trying
17025 to pass a type as argument.
17027 2002-07-18 Martin Baulig <martin@gnome.org>
17029 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17030 Conv_R_Un for the signed `long' type.
17032 2002-07-15 Miguel de Icaza <miguel@ximian.com>
17034 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17035 `expr' for the temporary result, as that will fail if we do
17036 multiple resolves on the same expression.
17038 2002-07-05 Miguel de Icaza <miguel@ximian.com>
17040 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17041 ec.TypeContainer for looking up aliases.
17043 * class.cs (TypeContainer): Remove LookupAlias from here.
17045 * decl.cs (DeclSpace); Move here.
17047 2002-07-01 Miguel de Icaza <miguel@ximian.com>
17049 * class.cs (FindMembers): Only call filter if the constructor
17050 bulider is not null.
17052 Also handle delegates in `NestedTypes' now. Now we will perform
17053 type lookups using the standard resolution process. This also
17056 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17057 This uses Expressions (the limited kind that can be parsed by the
17058 tree) instead of strings.
17060 * expression.cs (ComposedCast.ToString): Implement, used to flag
17061 errors since now we have to render expressions.
17063 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
17066 * ecore.cs (SimpleName.ToString): ditto.
17068 * cs-parser.jay: Instead of using strings to assemble types, use
17069 Expressions to assemble the type (using SimpleName, ComposedCast,
17070 MemberAccess). This should fix the type lookups in declarations,
17071 because we were using a different code path for this.
17073 * statement.cs (Block.Resolve): Continue processing statements
17074 even when there is an error.
17076 2002-07-17 Miguel de Icaza <miguel@ximian.com>
17078 * class.cs (Event.Define): Also remove the `remove' method from
17079 the list of pending items.
17081 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17082 generate more compact code.
17084 2002-07-17 Martin Baulig <martin@gnome.org>
17086 * const.cs (Const.LookupConstantValue): Add support for constant
17087 `unchecked' and `checked' expressions.
17088 Also adding test case test-140.cs for this.
17090 2002-07-17 Martin Baulig <martin@gnome.org>
17092 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17093 check whether mi.ReturnType implements the IEnumerator interface; the
17094 `==' and the IsAssignableFrom() will fail in this situation.
17096 2002-07-16 Ravi Pratap <ravi@ximian.com>
17098 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
17101 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17103 * expression.cs: fixed bug #27811.
17105 2002-07-14 Miguel de Icaza <miguel@ximian.com>
17107 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17108 Molaro: when we are a ref, the value already contains a pointer
17109 value, do not take the address of it.
17111 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17112 * removed mb-parser.jay and mb-tokenizer.cs
17114 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17116 * expression.cs: check against the building corlib void type.
17118 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17120 * ecore.cs: fix for valuetype static readonly fields: when
17121 initializing them, we need their address, not the address of a copy.
17123 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17125 * typemanager.cs: register also enum_type in corlib.
17127 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17129 * class.cs: allow calling this (but not base) initializers in structs.
17131 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17133 * ecore.cs: make sure we compare against the building base types
17136 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17138 * typemanager.cs: fix TypeToCoreType() to handle void and object
17139 (corlib gets no more typerefs after this change).
17141 2002-07-12 Miguel de Icaza <miguel@ximian.com>
17143 * expression.cs (ArrayCreation.EmitArrayArguments): use
17144 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17146 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17147 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
17148 array indexes, the runtime actually forbids them.
17150 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17151 for array arguments here.
17153 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17154 instead of the default for ValueTypes.
17156 (New.DoEmit): Use IsValueType instead of
17157 IsSubclassOf (value_type)
17158 (New.DoResolve): ditto.
17159 (Invocation.EmitCall): ditto.
17161 * assign.cs (Assign): ditto.
17163 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17164 Statements *are* currently doing part of their resolution during
17167 Expressions do always resolve during resolve, but statements are
17168 only required to propagate resolution to their children.
17170 2002-07-11 Miguel de Icaza <miguel@ximian.com>
17172 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17174 (LoadAssembly): Do not add the dll if it is already specified
17176 (MainDriver): Add the System directory to the link path at the end,
17177 after all the other -L arguments.
17179 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17180 wrong opcode for loading bytes and bools (ldelem.i1 instead of
17181 ldelem.u1) and using the opposite for sbytes.
17183 This fixes Digger, and we can finally run it.
17185 * driver.cs (UnixParseOption): Move the option parsing here.
17186 (CSCParseOption): Implement CSC-like parsing of options.
17188 We now support both modes of operation, the old Unix way, and the
17189 new CSC-like way. This should help those who wanted to make cross
17190 platform makefiles.
17192 The only thing broken is that /r:, /reference: and /lib: are not
17193 implemented, because I want to make those have the same semantics
17194 as the CSC compiler has, and kill once and for all the confussion
17195 around this. Will be doing this tomorrow.
17197 * statement.cs (Unsafe.Resolve): The state is checked during
17198 resolve, not emit, so we have to set the flags for IsUnsfe here.
17200 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17202 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17203 not catch the Error_ObjectRefRequired in SimpleName (as it is
17204 possible to have a class/instance variable name that later gets
17205 deambiguated), we have to check this here.
17207 2002-07-10 Ravi Pratap <ravi@ximian.com>
17209 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17210 make static and put into Expression.
17212 (Event.Define): Register the private field of the event with the
17213 TypeManager so that GetFieldFromEvent can get at it.
17215 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17216 keep track of the private field associated with an event which
17219 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17222 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17224 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17226 * expression.cs (Binary.EmitBranchable): this routine emits the
17227 Binary expression in a branchable context. This basically means:
17228 we need to branch somewhere, not just get the value on the stack.
17230 This works together with Statement.EmitBoolExpression.
17232 * statement.cs (Statement.EmitBoolExpression): Use
17235 2002-07-09 Miguel de Icaza <miguel@ximian.com>
17237 * statement.cs (For): Reduce the number of jumps in loops.
17239 (For): Implement loop inversion for the For statement.
17241 (Break): We can be breaking out of a Try/Catch controlled section
17242 (foreach might have an implicit try/catch clause), so we need to
17243 use Leave instead of Br.
17245 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17246 now). If the instace expression supports IMemoryLocation, we use
17247 the AddressOf method from the IMemoryLocation to extract the
17248 address instead of emitting the instance.
17250 This showed up with `This', as we were emitting the instance
17251 always (Emit) instead of the Address of This. Particularly
17252 interesting when This is a value type, as we dont want the Emit
17253 effect (which was to load the object).
17255 2002-07-08 Miguel de Icaza <miguel@ximian.com>
17257 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17259 * statement.cs (Checked): Set the CheckedState during the resolve
17260 process too, as the ConvCast operations track the checked state on
17261 the resolve process, and not emit.
17263 * cs-parser.jay (namespace_member_declaration): Flag that we have
17264 found a declaration when we do. This is used to flag error 1529
17266 * driver.cs: Report ok when we display the help only.
17268 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
17270 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17272 2002-07-04 Miguel de Icaza <miguel@ximian.com>
17274 * cs-tokenizer.cs (define): We also have to track locally the
17275 defines. AllDefines is just used for the Conditional Attribute,
17276 but we also need the local defines for the current source code.
17278 2002-07-03 Miguel de Icaza <miguel@ximian.com>
17280 * statement.cs (While, For, Do): These loops can exit through a
17281 Break statement, use this information to tell whether the
17282 statement is the last piece of code.
17284 (Break): Flag that we break.
17286 * codegen.cs (EmitContexts): New `Breaks' state variable.
17288 2002-07-03 Martin Baulig <martin@gnome.org>
17290 * class.cs (TypeContainer.MethodModifiersValid): Allow override
17291 modifiers in method declarations in structs. Otherwise, you won't
17292 be able to override things like Object.Equals().
17294 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17296 * class.cs (Method, Property, Indexer): Do not allow the public
17297 modifier to be used in explicit interface implementations.
17299 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17300 override modifiers in method declarations in structs
17302 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
17304 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17305 integer or real overflow, report an error
17307 2002-07-02 Martin Baulig <martin@gnome.org>
17309 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17310 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17311 to tell the runtime about our newly created System.Object and
17312 System.ValueType types.
17314 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17316 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17317 struct instead of Ldarg/Starg.
17319 2002-07-02 Martin Baulig <martin@gnome.org>
17321 * expression.cs (Indirection.Indirection): Call
17322 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17324 2002-07-02 Martin Baulig <martin@gnome.org>
17326 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17327 ValueType, call TypeManager.TypeToCoreType() on it.
17328 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17329 the OpCodes.Newarr argument.
17331 2002-07-02 Martin Baulig <martin@gnome.org>
17333 * expression.cs (Invocation.EmitCall): When compiling corlib,
17334 replace all calls to the system's System.Array type to calls to
17335 the newly created one.
17337 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17338 System.Array methods.
17339 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17340 from the system's System.Array type which must be replaced.
17342 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17344 * typemanager.cs: load unverifiable_code_ctor so we can build
17345 corlib using the correct type. Avoid using GetTypeCode() with
17347 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17348 TypeManager.object_type to allow building corlib.
17350 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17352 * ecore.cs: handle System.Enum separately in LoadFromPtr().
17354 2002-07-01 Martin Baulig <martin@gnome.org>
17356 * class.cs: Make the last change actually work, we need to check
17357 whether `ifaces != null' to avoid a crash.
17359 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17361 * class.cs: when we build structs without fields that implement
17362 interfaces, we need to add the interfaces separately, since there is
17363 no API to both set the size and add the interfaces at type creation
17366 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17368 * expression.cs: the dimension arguments to the array constructors
17369 need to be converted if they are a long.
17371 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17373 * class.cs: don't emit ldarg.0 if there is no parent constructor
17374 (fixes showstopper for corlib).
17376 2002-06-29 Martin Baulig <martin@gnome.org>
17378 MCS now compiles corlib on GNU/Linux :-)
17380 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17381 ie. check for MethodImplOptions.InternalCall.
17383 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17384 and TypeManager.attribute_type are null, so we must explicitly check
17385 whether parent is not null to find out whether it's an attribute type.
17386 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17387 and SetBuilder, not only if the property is neither abstract nor external.
17388 This is necessary to set the MethodImplOptions on the accessor methods.
17389 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17390 SetBuilder, see Property.Emit().
17392 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17393 populate "System.Object", "System.ValueType" and "System.Attribute" since
17394 they've already been populated from BootCorlib_PopulateCoreTypes().
17396 2002-06-29 Martin Baulig <martin@gnome.org>
17398 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17399 is the NullLiteral, we also need to make sure that target_type is not
17402 2002-06-29 Martin Baulig <martin@gnome.org>
17404 * rootcontext.cs (RootContext.ResolveCore): We must initialize
17405 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17406 before calling BootstrapCorlib_ResolveDelegate ().
17408 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17410 * statement.cs: fixed build-breaker. All tests passed ok.
17412 2002-06-27 Martin Baulig <martin@gnome.org>
17414 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17415 for System.Decimal when compiling corlib.
17417 2002-06-27 Martin Baulig <martin@gnome.org>
17419 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17420 switch blocks which contain nothing but a default clause.
17422 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
17424 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17426 2002-06-27 Martin Baulig <martin@gnome.org>
17428 * ecore.cs (PropertyExpr.PropertyExpr): Call
17429 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17431 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17432 is already a TypeBuilder.
17434 2002-06-27 Martin Baulig <martin@gnome.org>
17436 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17437 `target_type == TypeManager.array_type', not IsAssignableFrom() in
17438 the "from an array-type to System.Array" case. This makes it work
17439 when compiling corlib.
17441 2002-06-27 Martin Baulig <martin@gnome.org>
17443 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17444 non-static PropertyExpr, set its InstanceExpression. This makes
17445 the `ICollection.Count' property work in System/Array.cs.
17447 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
17449 * driver.cs: Made error handling more consistent. Errors now
17450 tracked by Report class, so many methods which used to return int
17451 now return void. Main() now prints success/failure and
17452 errors/warnings message.
17454 Renamed '--probe' compiler argument to '--expect-error'. Removed
17455 the magic number return values (123 and 124). Now, if the
17456 expected error occurs, the compiler exits with success (exit value
17457 0). If the compilation completes without seeing that particular
17458 error, the compiler exits with failure (exit value 1). The
17459 makefile in mcs/errors has been changed to handle the new behaviour.
17461 * report.cs: Made 'expected error' number a property and renamed
17462 it from 'Probe' to 'ExpectedError'.
17464 * genericparser.cs: Removed error handling support, since it is
17465 now all done by Report class.
17467 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17468 class, so parse() no longer returns an int.
17470 * namespace.cs: Use Report.Error instead of GenericParser.error
17472 2002-06-22 Miguel de Icaza <miguel@ximian.com>
17474 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17475 TypeContainer.AddOperator): At the front of the list put the
17476 explicit implementations, so they get resolved/defined first.
17478 2002-06-21 Miguel de Icaza <miguel@ximian.com>
17480 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17481 interface type is implemented by this TypeContainer. Used during
17482 explicit interface implementation.
17484 (Property.Define, Indexer.Define, Method.Define): Validate that
17485 the given interface in the explicit implementation is one of the
17486 base classes for the containing type.
17488 Also if we are explicitly implementing an interface, but there is
17489 no match in the pending implementation table, report an error.
17491 (Property.Define): Only define the property if we are
17492 not explicitly implementing a property from an interface. Use the
17493 correct name also for those properties (the same CSC uses,
17494 although that is really not needed).
17496 (Property.Emit): Do not emit attributes for explicitly implemented
17497 properties, as there is no TypeBuilder.
17499 (Indexer.Emit): ditto.
17501 Hiding then means that we do not really *implement* a pending
17502 implementation, which makes code fail.
17504 2002-06-22 Martin Baulig <martin@gnome.org>
17506 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17507 the return value of Object.GetType(). [FIXME: we need to do this whenever
17508 we get a type back from the reflection library].
17510 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17512 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17514 2002-06-20 Miguel de Icaza <miguel@ximian.com>
17516 * attribute.cs: Return null if we can not look up the type.
17518 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17519 the interface types found.
17521 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17522 interface types found.
17524 * typemanager.cs (GetInterfaces): Make this routine returns alll
17525 the interfaces and work around the lame differences between
17526 System.Type and System.Reflection.Emit.TypeBuilder in the results
17527 result for GetInterfaces.
17529 (ExpandInterfaces): Given an array of interface types, expand and
17530 eliminate repeated ocurrences of an interface. This expands in
17531 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17534 2002-06-21 Martin Baulig <martin@gnome.org>
17536 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17539 2002-06-21 Martin Baulig <martin@gnome.org>
17541 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
17542 and called with one of the core types, return the corresponding typebuilder for
17545 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17548 2002-06-21 Martin Baulig <martin@gnome.org>
17550 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17551 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17552 (Expression.ConvertReferenceExplicit): Likewise.
17554 * expression.cs (ElementAccess.DoResolve): Likewise.
17555 (ElementAccess.DoResolveLValue): Likewise.
17557 2002-06-10 Martin Baulig <martin@gnome.org>
17559 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17560 add the "value" parameter to the parameter list.
17562 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17565 2002-06-19 Miguel de Icaza <miguel@ximian.com>
17567 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17568 the argument to an int, uint, long or ulong, per the spec. Also
17569 catch negative constants in array creation.
17571 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17573 * class.cs: do not allow the same interface to appear twice in
17574 the definition list.
17576 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17578 * ecore.cs: don't use ldlen with System.Array.
17580 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17582 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17584 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17586 * modifiers.cs: produce correct field attributes for protected
17587 internal. Easy fix so miguel can work on ther harder stuff:-)
17589 2002-06-18 Miguel de Icaza <miguel@ximian.com>
17591 * pending.cs: New file. Move the code from class.cs here.
17592 Support clearning the pending flag for all methods (when not doing
17593 explicit interface implementation).
17595 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17597 * rootcontext.cs: added a couple more types needed to bootstrap.
17599 2002-06-17 Miguel de Icaza <miguel@ximian.com>
17601 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17602 constructor in the type, instead of any constructor in the type
17603 hierarchy. Thanks to Paolo for finding this bug (it showed up as
17604 a bug in the Mono runtime when applying the params attribute).
17606 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17607 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17609 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
17611 * expression.cs (Unary.ResolveOperator): Use TypeManager
17612 to resolve the type.
17614 2002-06-13 Ravi Pratap <ravi@ximian.com>
17616 * cs-parser.jay (enum_member_declaration): Pass in the attributes
17619 * enum.cs (AddEnumMember): Add support to store the attributes associated
17620 with each member too.
17622 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17623 field builders too - this takes care of the enum member case.
17625 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
17627 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17628 address-of operator on both value types and pointers.
17630 2002-06-10 Martin Baulig <martin@gnome.org>
17632 * interface.cs (Interface.PopulateIndexer): Add the indexer's
17633 PropertyBuilder to the `property_builders' list.
17635 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17636 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17637 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
17638 find any indexers which are inherited from an interface.
17640 2002-06-09 Martin Baulig <martin@gnome.org>
17642 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17643 the same type as the constant if necessary. There's also a test-130.cs
17646 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17648 * typemanager.cs (TypeManager.ChangeType): Previously known as
17649 Enum.ChangeEnumType().
17651 2002-06-09 Martin Baulig <martin@gnome.org>
17653 * expression.cs (Cast.TryReduce): Added support for consts.
17655 2002-06-08 Ravi Pratap <ravi@ximian.com>
17657 * class.cs (Accessor): Hold attributes information so we can pass
17660 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17661 Modify to pass in attributes attached to the methods.
17663 (add_accessor_declaration, remove_accessor_declaration): Ditto.
17665 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17666 to handle the Accessor kind :-)
17668 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17670 2002-06-08 Martin Baulig <martin@gnome.org>
17672 * expression.cs (Unary.TryReduceNegative): Added support for
17675 2002-06-08 Martin Baulig <martin@gnome.org>
17677 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17678 name can't be found in the `defined_names' - the caller will do a
17679 MemberLookup in this case and thus find methods in System.Enum
17680 such as Enum.IsDefined().
17682 2002-06-08 Martin Baulig <martin@gnome.org>
17684 * enum.cs (Enum.ChangeEnumType): This is a custom version of
17685 Convert.ChangeType() which works with TypeBuilder created types.
17686 (Enum.LookupEnumValue, Enum.Define): Use it here.
17688 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17689 `TypeBuilder.BaseType != null' check.
17690 (TypeContainer.FindMembers): Only lookup parent members if we
17691 actually have a parent.
17692 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17693 (ConstructorInitializer.Resolve): Likewise.
17695 * interface.cs (Interface.FindMembers): Added
17696 `TypeBuilder.BaseType != null' check.
17698 * rootcontext.cs (RootContext.ResolveCore): Added
17699 "System.Runtime.CompilerServices.IndexerNameAttribute" to
17700 classes_second_stage.
17702 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17703 debug_type and trace_type when compiling with --nostdlib.
17705 2002-06-07 Martin Baulig <martin@gnome.org>
17707 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17708 (AddField): Set it to true when adding a non-static field.
17709 (DefineType): Use `have_nonstatic_fields' to find out whether we
17710 have non-static fields, not `Fields != null'.
17712 2002-06-02 Miguel de Icaza <miguel@ximian.com>
17714 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17715 dereferencing a null on the static-field code path)
17717 2002-05-30 Martin Baulig <martin@gnome.org>
17719 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17720 to take command line arguments. Use reflection to call the new
17721 custom `Initialize' function on the symbol writer and pass it the
17722 command line arguments.
17724 * driver.cs (--debug-args): New command line argument to pass command
17725 line arguments to the symbol writer.
17727 2002-05-28 Miguel de Icaza <miguel@ximian.com>
17729 * assign.cs (DoResolve): Forgot to do the implicit conversion to
17730 the target type for indexers and properties. Thanks to Joe for
17733 2002-05-27 Miguel de Icaza <miguel@ximian.com>
17735 * typemanager.cs (MethodFlags): returns the method flags
17736 (Obsolete/ShouldIgnore) that control warning emission and whether
17737 the invocation should be made, or ignored.
17739 * expression.cs (Invocation.Emit): Remove previous hack, we should
17740 not do this on matching a base type, we should do this based on an attribute
17742 Only emit calls to System.Diagnostics.Debug and
17743 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17744 on the command line.
17746 * rootcontext.cs: Global settings for tracing and debugging.
17748 * cs-tokenizer.cs (define): New utility function to track
17749 defines. Set the global settings for TRACE and DEBUG if found.
17751 2002-05-25 Ravi Pratap <ravi@ximian.com>
17753 * interface.cs (Populate*): Pass in the TypeContainer as well as
17754 the DeclSpace as parameters so that we can create EmitContexts and
17755 then use that to apply attributes etc.
17757 (PopulateMethod, PopulateEvent, PopulateProperty)
17758 (PopulateIndexer): Apply attributes everywhere.
17760 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17763 (ApplyAttributes): Update accordingly.
17765 We now apply interface attributes for all members too.
17767 2002-05-26 Miguel de Icaza <miguel@ximian.com>
17769 * class.cs (Indexer.Define); Correctly check if we are explicit
17770 implementation (instead of checking the Name for a ".", we
17771 directly look up if the InterfaceType was specified).
17773 Delay the creation of the PropertyBuilder.
17775 Only create the PropertyBuilder if we are not an explicit
17776 interface implementation. This means that explicit interface
17777 implementation members do not participate in regular function
17778 lookups, and hence fixes another major ambiguity problem in
17779 overload resolution (that was the visible effect).
17781 (DefineMethod): Return whether we are doing an interface
17784 * typemanager.cs: Temporary hack until we get attributes in
17785 interfaces (Ravi is working on that) and we get IndexerName
17786 support in interfaces.
17788 * interface.cs: Register the indexers as properties.
17790 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17791 warning, I have verified that this is a bug in the .NET runtime
17792 (JavaScript suffers of the same problem).
17794 * typemanager.cs (MemberLookup): When looking up members for
17795 interfaces, the parent of an interface is the implicit
17796 System.Object (so we succeed in searches of Object methods in an
17797 interface method invocation. Example: IEnumerable x; x.ToString
17800 2002-05-25 Miguel de Icaza <miguel@ximian.com>
17802 * class.cs (Event): Events should also register if they do
17803 implement the methods that an interface requires.
17805 * typemanager.cs (MemberLookup); use the new GetInterfaces
17808 (GetInterfaces): The code used to lookup interfaces for a type is
17809 used in more than one place, factor it here.
17811 * driver.cs: Track the errors at the bottom of the file, we kept
17814 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17815 instance if the method we are calling is static!
17817 2002-05-24 Miguel de Icaza <miguel@ximian.com>
17819 * attribute.cs (ApplyAttributes): Make this function filter out
17820 the IndexerName attribute (as that attribute in reality is never
17821 applied) and return the string constant for the IndexerName
17824 * class.cs (TypeContainer.Emit): Validate that all the indexers
17825 have the same IndexerName attribute, and if so, set the
17826 DefaultName attribute on the class.
17828 * typemanager.cs: The return value might contain other stuff (not
17829 only methods). For instance, consider a method with an "Item"
17830 property and an Item method.
17832 * class.cs: If there is a problem with the parameter types,
17835 2002-05-24 Ravi Pratap <ravi@ximian.com>
17837 * ecore.cs (ImplicitConversionExists): Wrapper function which also
17838 looks at user defined conversion after making a call to
17839 StandardConversionExists - we need this for overload resolution.
17841 * expression.cs : Update accordingly the various method calls.
17843 This fixes 2 bugs filed against implicit user defined conversions
17845 2002-05-22 Miguel de Icaza <miguel@ximian.com>
17847 * statement.cs: Track the result of the assignment.
17849 2002-05-21 Miguel de Icaza <miguel@ximian.com>
17851 * expression.cs (MemberAccess): Improved error reporting for
17852 inaccessible members.
17854 2002-05-22 Martin Baulig <martin@gnome.org>
17856 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
17857 itself with debugging support.
17859 2002-05-22 Martin Baulig <martin@gnome.org>
17861 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17862 Removed, this isn't needed anymore.
17864 2002-05-20 Martin Baulig <martin@gnome.org>
17866 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17867 be underlying type for an enum.
17869 2002-05-20 Miguel de Icaza <miguel@ximian.com>
17871 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17872 that splits out the loading of just the core types.
17874 * rootcontext.cs (ResolveCore): Split the struct resolution in
17875 two, so we can load the enumeration underlying types before any
17878 * expression.cs (Is): Bandaid until we fix properly Switch (see
17879 bug #24985 for details).
17881 * typemanager.cs (ImplementsInterface): The hashtable will contain
17882 a null if there are no interfaces implemented.
17884 2002-05-18 Miguel de Icaza <miguel@ximian.com>
17886 * cs-parser.jay (indexer_declarator): It is fine to have array
17889 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17891 * typemanager.cs: (RegisterBuilder): New function used to register
17892 TypeBuilders that implement interfaces. Since
17893 TypeBuilder.GetInterfaces (as usual) does not work with lame
17895 (AddUserType): register interfaces.
17897 (ImplementsInterface): Use the builder_to_ifaces hash if we are
17898 dealing with TypeBuilder. Also, arrays are showing up as
17899 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17900 methods can not be invoked on them!
17902 * ecore.cs (ExplicitReferenceConversionExists): Made public.
17903 (ImplicitReferenceConversionExists): Split out from
17904 StandardConversionExists.
17906 * expression.cs (As): We were only implementing one of the three
17907 cases for the as operator. We now implement them all.
17908 (Is): Implement the various other cases for Is as well.
17910 * typemanager.cs (CACHE): New define used to control if we want or
17911 not the FindMembers cache. Seems to have a negative impact on
17912 performance currently
17914 (MemberLookup): Nested types have full acess to
17915 enclosing type members
17917 Remove code that coped with instance/static returns for events, we
17918 now catch this in RealFindMembers.
17920 (RealFindMembers): only perform static lookup if the instance
17921 lookup did not return a type or an event.
17923 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17925 * assign.cs (CompoundAssign): We pass more semantic information
17926 now to Compound Assignments than we did before: now we have all
17927 the information at hand, and now we resolve the target *before* we
17928 do the expression expansion, which allows the "CacheValue" method
17929 to have the effect we intended (before, a [x] += 1 would generate
17930 two differen ArrayAccess expressions from the ElementAccess,
17931 during the resolution process).
17933 (CompoundAssign.DoResolve): Resolve target and original_source here.
17935 2002-05-16 Miguel de Icaza <miguel@ximian.com>
17937 * expression.cs (ArrayAccess): dropped debugging information.
17939 * typemanager.cs: Small bug fix: I was always returning i_members,
17940 instead of one of i_members or s_members (depending on which had
17943 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
17944 method is invoked before any code generation takes place, and it
17945 is a mechanism to inform that the expression will be invoked more
17946 than once, and that the method should use temporary values to
17947 avoid having side effects
17949 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17951 * ecore.cs (Expression.CacheTemporaries): Provide empty default
17954 * expression.cs (Indirection, ArrayAccess): Add support for
17955 CacheTemporaries in these two bad boys.
17957 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17958 ldobj or ldind_ref.
17959 (StoreFromPtr): Handle stobj as well.
17961 * expression.cs (UnaryMutator): Share more code.
17963 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17964 down: I was not tracking the Filter function as well, which
17965 was affecting the results of the cache.
17967 2002-05-15 Miguel de Icaza <miguel@ximian.com>
17969 * attribute.cs: Remove the hack to handle the CharSet property on
17972 2002-05-14 Miguel de Icaza <miguel@ximian.com>
17974 * attribute.cs (DoResolve): More uglyness, we now only try to
17975 resolve the attribute partially, to extract the CharSet
17976 information (only if we are a StructLayout attribute). Otherwise
17978 (GetExtraTypeInfo): Add some code to conditionally kill in the
17979 future this. I am more and more convinced that the .NET
17980 framework has special code to handle the attribute setting on
17983 * expression.cs (IsParamsMethodApplicable): Revert my previous
17984 foreach change here, it was wrong.
17986 2002-05-13 Miguel de Icaza <miguel@ximian.com>
17988 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17989 (pp_expr): do not abort on unknown input, just return.
17990 (eval): abort if there are pending chars.
17992 * attribute.cs (Attribute.Resolve): Positional parameters are
17993 optional. Deal with that case.
17995 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17996 the Ansi/Unicode/Auto information for the type.
17998 (TypeContainer.DefineType): instantiate the EmitContext here, as
17999 we will be using it during the type definition (to resolve
18000 attributes) and during the emit phase.
18002 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18003 to pull type information out of the attributes
18005 (Attribute.Resolve): track the constructor builder, and allow for
18006 multiple invocations (structs and classes will use this).
18008 * ecore.cs (MemberLookupFinal): new version with all the
18009 parameters customizable.
18011 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18012 constructors. Return if the result value is null (as the error
18013 would have been flagged already by MemberLookupFinal)
18015 Do not allow instances of abstract classes or interfaces to be
18018 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18019 We have to compare the assembly property here when dealing with
18020 FamANDAssem and Assembly access modifiers, because we might be
18021 creating an assembly from *modules* (that means that we are not
18022 getting TypeBuilders for types defined in other modules that are
18023 part of this assembly).
18025 (Method.Emit): If the method is marked abstract and has a body,
18028 (TypeContainer.DefineMembers): If both the defined member and the
18029 parent name match are methods, then do not emit any warnings: let
18030 the Method.Define routine take care of flagging warnings. But if
18031 there is a mismatch (method overrides something else, or method is
18032 overriwritten by something, then emit warning).
18034 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18035 set to null, this means `do not check for the return type on the
18038 (Method.Define): set the return type for the method signature to
18039 null, so that we get methods with the same name and parameters and
18040 different return types. This is used to flag warning 114 (you are
18041 hiding a method, and you probably want to use the new/override
18044 * typemanager.cs (MemberLookup): Implemented proper access
18045 control, closing a long standing set of bug reports. The problem
18046 was that the Framework only has two bits: Public and NonPublic,
18047 and NonPublic includes private and protected methods, but we need
18048 to enforce the FamANDAssem, FamOrAssem and Family.
18050 2002-05-11 Miguel de Icaza <miguel@ximian.com>
18052 * statement.cs (GotoCase): Return true: Ammounts to giving up
18053 knowledge on whether we return or not, and letting the other case
18054 be responsible for it.
18056 2002-05-10 Miguel de Icaza <miguel@ximian.com>
18058 * driver.cs: Do not load directories for each file processed, only
18059 do it if there is a pattern.
18061 * ecore.cs: Report readonly assigns here as well, as we might have
18062 been resolved only by MemberAccess.
18064 (SimpleName.SimpleNameResolve): Also be useful for LValue
18065 resolution. We need this to propagate assign to local readonly variables
18067 * typemanager.cs: Use a ptrhashtable for the criteria, because we
18068 do not want to reuse potential criteria memory.
18070 * class.cs (MyEventBuilder): Set reflected_type;
18072 * ecore.cs (Constantify): Added support for constifying bools.
18074 (RootContext.LookupType): Added a cache for values looked up in
18075 the declaration space.
18077 * typemanager.cs (FindMembers): Now is a front-end to
18078 RealFindMembers, and provides a two-level hashtable-based cache to
18081 15% performance improvement: from 22.5 to 19.2 seconds.
18083 * expression.cs (IsParamsMethodApplicable): use foreach.
18084 (Invocation.DoResolve): ditto.
18085 (New.DoResolve): ditto.
18086 (ArrayCreation.DoResolve): ditto.
18088 * ecore.cs (FindMostEncompassingType): use foreach.
18090 * delegate.cs (NewDelegate.DoResolve): Use foreach
18092 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18093 (RemoveMethods): use foreach.
18095 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18096 nested foreach statements instead of for, and also break out of
18097 the inner loop once a match is found.
18099 (Invocation.OverloadResolve): Use foreach, simplify the code.
18101 2002-05-08 Miguel de Icaza <miguel@ximian.com>
18103 * cfold.cs (BinaryFold): During an enumeration evaluation context,
18104 we actually unwrap the expression to allow for extra information
18107 * expression.cs: Use Shr_Un on unsigned operations.
18109 2002-05-08 Ravi Pratap <ravi@ximian.com>
18111 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
18112 applicable operators was not being considered correctly. This closes
18113 the bug Miguel reported.
18115 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18117 * attribute.cs: check that the type derives from System.Attribute
18118 and report the correct error in that case (moved the duplicate code to
18119 its own method, too).
18121 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18123 * attribute.cs: lookup attribute type name as the spec says: first the
18124 bare attribute name and then name + "Attribute" (nant compiles with
18125 mcs after this fix).
18127 2002-05-07 Miguel de Icaza <miguel@ximian.com>
18129 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
18130 Because of the way we parse things, we should try to see if a
18131 UIntConstant can fit in an integer.
18133 2002-05-07 Ravi Pratap <ravi@ximian.com>
18135 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18136 when we are in an explicit context.
18138 (ConvertReferenceExplicit): When converting from Iface type S to Class
18139 T make sure the rules are implemented as an OR.
18141 * parameter.cs (ParameterType): Make it a property for now although the
18142 purpose really isn't anything immediate.
18144 * expression.cs (Is*Applicable): Do better checking on the parameter type
18145 of a ref/out parameter. The ones from the system assemblies are already
18146 marked with the correct type so we don't need to do any correction.
18148 * ecore.cs (StandardConversionExists): Conversion from Interface types to
18149 the object type is standard too so include that.
18151 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18153 * ecore.cs (StandardConversionExists): Augment with missing code:
18154 deal with IntConstant, LongConstants and Enumerations.
18156 * assign.cs: Report the error, instead of failing silently
18158 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18159 typecontainer that they are declared, because the
18160 typecontainer/namespace will have the list of using clauses that
18161 need to be applied.
18163 Assembly Attributes were escaping the normal registration
18166 (EmitCode): Apply attributes within an EmitContext that represents
18167 the container they were declared on.
18169 * cs-parser.jay: Track bases for structs. How did I get this wrong?
18171 2002-05-06 Ravi Pratap <ravi@ximian.com>
18173 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18174 Revamp completely - make much cleaner as we now operate only
18177 (FindMostSpecificSource, FindMostSpecificTarget): New methods
18178 to implement the logic detailed in the spec more correctly.
18180 (UserDefinedConversion): Update accordingly.
18182 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18184 * statement.cs: Return flow analysis information up.
18186 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18189 (token): Do not consume an extra character before calling
18192 2002-05-06 Piers Haken <piersh@friskit.com>
18194 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18196 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18198 * class.cs (Constructor.Emit): Set the IsStatic flag in the
18199 EmitContext during the instance constructor initializer
18200 resolution, to stop access to instance variables.
18202 This is mandated by the spec, last paragraph of the `constructor
18203 initializers' section.
18205 2002-05-05 Miguel de Icaza <miguel@ximian.com>
18207 * cs-parser.jay, class.cs (Accessor): new class used to represent
18208 an accessor (get or set). In the past we used `null' to represent
18209 a missing accessor. But this is ambiguous because there was no
18210 way to tell in abstract indexers/properties if one of them was
18213 Now there is a way of addressing that.
18215 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18216 instead of FindMembers.
18218 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18219 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18221 * attribute.cs: Treat indexers and properties as the same in terms
18222 of applying attributes
18224 * ecore.cs (FindMostEncompassedType): Use statically initialized
18225 EmptyExpressions()s like we do elsewhere to avoid creating useless
18226 objects (and we take this out of the tight loop).
18228 (GetConversionOperators): Move the code to extract the actual
18229 operators to a separate routine to clean things up.
18231 2002-05-04 Miguel de Icaza <miguel@ximian.com>
18233 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18234 events are always registered FieldBuilders.
18236 * class.cs (FieldBase): New class shared by Fields
18238 * delegate.cs: If we are a toplevel delegate, use our full name.
18239 If we are a nested delegate, then only use our tail name.
18241 2002-05-02 Ravi Pratap <ravi@ximian.com>
18243 * expression.cs (IsApplicable): Ensure that we add the "&" to
18244 ref/out types before comparing it with the type of the argument.
18246 (IsParamsMethodApplicable): Ditto.
18248 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
18251 * delegate.cs : Handle the case when we have more than one applicable
18252 method. Flag an error only when we finish checking all.
18254 2002-05-02 Miguel de Icaza <miguel@ximian.com>
18256 * expression.cs: Add support for boolean static initializers.
18258 2002-05-01 Miguel de Icaza <miguel@ximian.com>
18260 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18262 * parameter.cs (ComputeParameterTypes,
18263 ComputeAndDefineParameterTypes): Better error handling: now we
18264 clear the `types' cache if we fail during any of the type lookups.
18265 We also return the status code correctly to our caller
18267 * delegate.cs: If we fail to define a delegate, abort the extra
18270 * expression.cs (Binary.ResolveOperator): for
18271 operator==(object,object) and operator !=(object, object) we also
18272 have to verify that there is an implicit conversion from one to
18275 (ArrayAccess.DoResolve): Array Access can operate on
18278 2002-04-30 Miguel de Icaza <miguel@ximian.com>
18280 * assign.cs (CompoundAssign): A new class used as a "flag" that
18281 the assignment actually is happening as part of a compound
18282 assignment operator.
18284 During compound assignment, a few new rules exist to enable things
18291 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18292 to the type of x) if y is implicitly convertible to the type of x,
18293 and the operator is a builtin operator and the return type of the
18294 operator is explicitly convertible to the type of x.
18296 * rootcontext.cs: Reset warning level to 2. 4 catches various
18297 "interesting" features in mcs, we must clean this up at some
18298 point, but currently am trying to kill other bugs ;-)
18300 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18301 in container classes as well.
18303 * expression.cs (Binary.ResolveOperator): Handle string case
18304 before anything else (as operator overloading does emit an error
18305 before doing anything else).
18307 This code could go away when we move to a table driven model, but
18308 i could not come up with a good plan last night.
18310 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
18312 * typemanager.cs (CSharpName): reimplementation using regex.
18313 * class.cs: added null check for fields in Emit
18314 * rootcontext.cs: set warninglevel to 4
18316 2002-04-29 Miguel de Icaza <miguel@ximian.com>
18318 * typemanager.cs (CSharpName): reimplemented with Lupus
18321 2002-04-28 Miguel de Icaza <miguel@ximian.com>
18323 * statement.cs (If): correclty implement Resolve, because we were
18324 not catching sem errors in there. The same process is needed
18326 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18329 (Statement.Warning_DeadCodeFound): Factorize code.
18330 (While): Report dead code here too.
18332 (Statement): Added Resolve virtual method to allow
18333 for resolution split from the emit code.
18335 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18337 * statement.cs (EmitBoolExpression): No longer try to resolve the
18339 (MakeBoolean): New utility function that resolve, implicitly
18340 converts to boolean and tags the expression.
18343 (If, Do): Implement dead code elimination.
18344 (While): Implement loop inversion
18346 (Do, While, For, If): Resolve the expression prior to calling our
18349 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
18352 - added method Report28 (warning: program has more than one entry point)
18353 - added method IsEntryPoint, implements paragraph 10.1 of the spec
18354 - modified method Method.Define, the part at the end of the method
18356 * rootcontext.cs: added static public Location EntryPointLocation;
18358 * ../errors/cs0028.cs : Add test case for the above warning.
18361 - modified method CSharpName to allow arrays of primitive type to
18362 be printed nicely (e.g. instead of System.Int32[][] it now prints
18364 - added method CSharpSignature: returns the signature of a method
18365 in string format to be used in reporting errors, warnings, etc.
18367 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18370 2002-04-26 Ravi Pratap <ravi@ximian.com>
18372 * delegate.cs (Define): Fix extremely silly bug where I was
18373 setting the type of the 'object' parameter of the BeginInvoke
18374 method to System.IAsyncResult instead of System.Object ;-)
18376 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18378 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18381 (Constructor.Emit): return if we fail to initialize the
18382 constructor. Another door closed!
18384 * expression.cs (New.DoResolve): Improve error message (from -6 to
18385 1501). Use DeclaredOnly lookup to find the exact constructor.
18387 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18388 loop. This is useful.
18390 * cs-parser.jay: Adjust the default parameters so that destructors
18391 have the proper signature.
18393 2002-04-26 Martin Baulig <martin@gnome.org>
18395 * driver.cs (LoadAssembly): If `assembly' contains any characters
18396 which are only valid in path names and not in assembly names
18397 (currently slash, backslash and point), use Assembly.LoadFrom ()
18398 instead of Assembly.Load () on the `assembly' (before iteration
18399 over the link_paths).
18401 2002-04-26 Martin Baulig <martin@gnome.org>
18403 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18405 2002-04-25 Miguel de Icaza <miguel@ximian.com>
18407 * class.cs (Property): use the new typemanager.MemberLookup
18409 (TypeContainer.MemberLookup): Implement using the
18410 TypeManager.MemberLookup now.
18412 * typemanager.cs: Make MemberLookup a function of the TypeManager,
18413 and return MemberInfos, so that these can be used without an
18414 EmitContext (what we had before).
18416 2002-04-24 Miguel de Icaza <miguel@ximian.com>
18418 * expression.cs: Fix the case where the argument to params if the
18419 type of the params. I omitted handling this before. Fixed
18421 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18423 * driver.cs: Call BootCorlib_PopulateCoreType
18425 * class.cs (Property.CheckBase): Check for properties only, not
18428 * interface.cs: Temporary hack: try/catch around the
18429 CustomAttributeBuilder, because I am getting an exception that I
18432 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18433 types whose definitions are required to be there (attributes are
18434 defined before standard types).
18436 Compute definitions as we boot the various types, as they are used
18437 immediately (value_type class will need object_type, but if we do
18438 not initialize object_type, we will pass a null, which will let
18439 the runtime pick the System.Object from the existing corlib, which
18440 is not what we want).
18442 2002-04-22 Patrik Torstensson <totte@labs2.com>
18444 * cs-tokenizer.cs: fixed a number of trim() issues.
18446 2002-04-22 Ravi Pratap <ravi@ximian.com>
18448 * expression.cs (Argument.Type): Ensure that we return the correct
18449 type when we have out or ref parameters [in which case we
18452 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18454 * class.cs (Property, Indexer): Allow extern modifier in there.
18456 * typemanager.cs (InitBaseTypes): Initializes object_type and
18457 value_type, since those will be used early on during the bootstrap
18458 process to compile corlib.
18460 (InitCoreTypes): Move code from here to InitBaseTypes.
18462 2002-04-21 Miguel de Icaza <miguel@ximian.com>
18464 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18465 single-dimension arrays as using the ldlen opcode.
18467 Daniel Lewis discovered this optimization.
18469 * typemanager.cs: Add signature for System.Array::get_Length
18471 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18473 * statement.cs: report the error when the foreach does not apply to an
18474 array nor a collection.
18476 2002-04-19 Miguel de Icaza <miguel@ximian.com>
18478 * expression.cs: Add implicit conversions to the operator ~.
18480 * constant.cs (DecimalConstant.Emit): Emit decimal value.
18482 * typemanager.cs: Locate the decimal constructor.
18484 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18486 * attribute.cs: use the new property of TypeOf.
18487 * expression.cs: added 'get' property around typearg.
18489 These changes fix a build breaker reported by NickD. Is this the
18490 correct way to fix? If not, please, revert my changes and make it
18493 2002-04-17 Miguel de Icaza <miguel@ximian.com>
18495 * attribute.cs: Add support for typeof in attribute invocations.
18496 I am not sure that this is right though.
18498 2002-04-14 Duncan Mak <duncan@ximian.com>
18500 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18501 Binary.Operator.Division case.
18503 2002-04-13 Ravi Pratap <ravi@ximian.com>
18505 * class.cs (DefineType): Ensure that we do a proper check on
18506 attribute types and also register it with the TypeManager.
18508 (TypeContainer.Targets): The default for attribute types is
18509 AttributeTargets.All.
18511 * attribute.cs (ApplyAttributes): Registering the attribute type
18512 is done elsewhere, not when we discover we have a Usage attribute.
18514 2002-04-12 Ravi Pratap <ravi@ximian.com>
18516 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18517 and get rid of is_delegate parameter.
18519 * everywhere : update.
18521 2002-04-12 Ravi Pratap <ravi@ximian.com>
18523 * cs-parser.jay (compilation_unit): Revamp completely to use
18524 some new ideas that I got from Rhys' grammar to solve the problems
18525 with assembly level attributes.
18527 (outer_declaration): New grammar production.
18529 (attribute_sections): Add.
18531 (opt_attributes): Base on attribute_sections
18533 (namespace_declaration): Allow opt_attributes to tackle the case
18534 when we have assembly level attributes - we are clever in this
18537 * attribute.cs (ApplyAttributes): Do not worry about assembly
18538 attributes in the non-global context.
18540 * rootcontext.cs (AddGlobalAttributes): Go back to using this
18541 instead of SetGlobalAttributes.
18543 * class.cs, rootcontext.cs : Ensure we define and generate
18544 attribute types before anything else.
18546 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18547 and flag the new error -20 for the case when the attribute type
18548 does not have valid targets specified. csc does not catch this.
18550 * ../errors/errors.txt : update for error # -20
18552 2002-04-11 Ravi Pratap <ravi@ximian.com>
18554 * support.cs (InternalParameters.ParameterModifier): Do some null
18555 checking and return sane values.
18557 * class.cs (Method.Define): If we are a PInvoke method, ensure
18558 that we are static and extern. Report error # 601
18560 * ../errors/cs0601.cs : Add test case for the above error.
18562 2002-04-07 Ravi Pratap <ravi@ximian.com>
18564 * rootcontext.cs (attribute_types): We need to keep type of
18565 all attribute types separately and emit code for them first.
18567 (RegisterAttribute) : Implement.
18569 * class.cs (DefineType): Check if the current Type is a custom
18570 attribute type and register it accordingly.
18572 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18573 adding the first attribute twice and rename to
18575 (SetGlobalAttributes): this.
18577 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18580 * attribute.cs (ApplyAttributes): Take an additional argument telling us
18581 if we are processing global arguments. Hmm, I am unsure of this.
18583 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18585 * expression.cs: added static array of strings to avoid calling
18586 Enum.ToString () for Operator in Binary. Significant recover of
18589 2002-04-10 Miguel de Icaza <miguel@ximian.com>
18591 * class.cs (FindMembers): Allow the Builders of the various
18592 members to be null. If they are skip them. This only happens
18593 during the PInvoke declaration.
18595 2002-04-09 Miguel de Icaza <miguel@ximian.com>
18597 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18598 failure, so we do not keep going afterwards.
18600 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18601 wanted to pass `false' as the `is_delegate' argument. If this is
18602 the case, why not use delegate_type == null to mean `is_delegate =
18603 false' and anything else as is_delegate = true.
18605 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
18607 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18608 code for the section, not the beginning of the tests.
18610 2002-04-08 Miguel de Icaza <miguel@ximian.com>
18612 * cfold.cs: Handle operator + (Enum x, Underlying x)
18614 * expression.cs (Binary): same. Warn about errors where we have
18615 Enum/Enum in operator + as well.
18617 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
18620 - added support for switch(bool)
18621 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18622 - add TableSwitchEmit() to handle table-based switch statements
18624 2002-04-05 Ravi Pratap <ravi@ximian.com>
18626 * expression.cs (Invocation.OverloadResolve): Factor out code which
18627 does parameter compatibility checking with arguments so that we can
18628 re-use the code even from Delegate.VerifyApplicability
18630 (VerifyArgumentsCompat): Move above code here.
18632 * delegate.cs (VerifyApplicability): Get rid of duplicate code
18633 and instead make a call to the above method.
18635 2002-03-31 Ravi Pratap <ravi@ximian.com>
18637 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18638 We use it to keep track of classes which are attribute types.
18640 2002-04-02 Miguel de Icaza <miguel@ximian.com>
18642 * delegate.cs (Delegate.Define): Correctly define the types in the
18643 presence of fixed and array parameters.
18645 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18648 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18649 include NonPublic after the first iteration.
18651 * class.cs (Indexer.CheckBase): Only check if both parents are
18654 * cs-parser.jay (accessor_body): If empty, set to null.
18656 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18657 same code path here to resolve constants names that we did have in
18658 MemberAccess.DoResolve. There is too much code duplicated here.
18660 2002-04-01 Miguel de Icaza <miguel@ximian.com>
18662 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18664 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18667 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18668 tokens, numbers and strings.
18670 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18673 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18674 asyncronous parameters and the regular parameters.
18676 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18677 specify the target directory.
18679 * expression.cs: (This.DoResolve): Simplify
18680 (As.Emit): Optimize, do not generate IsInst if the expression is
18681 always of the given type.
18683 (Is.DoResolve): Bug fix, we were reporting both always/never for
18686 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18687 creating too many unnecessary arrays.
18689 2002-03-31 Miguel de Icaza <miguel@ximian.com>
18691 * class.cs (EmitFieldInitializer): Use Assign expression to assign
18692 fields instead of rolling our own initializer. Takes care of all
18693 implicit conversions, and drops unnecessary static checks/argument.
18695 2002-03-31 Dick Porter <dick@ximian.com>
18697 * driver.cs: use the GetDirectories() return values properly, and
18698 use "/" as path separator.
18700 2002-03-30 Miguel de Icaza <miguel@ximian.com>
18702 * expression.cs (Unary): Optimize - - expr into expr.
18703 (Binary): Optimize a + (-b) into a -b.
18705 * codegen.cs (CodeGen): Made all methods static.
18707 2002-03-29 Miguel de Icaza <miguel@ximian.com>
18711 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18712 TypeBuilder property.
18714 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18717 * tree.cs: Removed the various RecordXXXX, and replaced with a
18718 single RecordDecl. Removed all the accessor methods, and just
18719 left a single access point Type
18721 * enum.cs: Rename DefineEnum to DefineType.
18723 * decl.cs: New abstract method `DefineType' used to unify the
18724 Defines for Enumerations, Interfaces, TypeContainers and
18727 (FindType): Moved LookupInterfaceOrClass here. Moved the
18728 LookupBaseClasses method that used to live in class.cs and
18729 interface.cs here, and renamed to FindType.
18731 * delegate.cs: Implement DefineType. Take advantage of the
18732 refactored pattern for locating the parent builder without taking
18733 the parent_builder argument (which we know does not work if we are
18734 nested, and triggering a toplevel definition).
18736 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18738 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18739 accessibility of a member has changed during override and report
18742 * class.cs (Method.Define, Property.Define): Only complain on
18743 overrides if the method is private, any other accessibility is
18744 fine (and since we just checked the permission is the same, we are
18747 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18748 and elif are processed always. The other pre-processing
18749 directives are only processed if we are "taking" the path
18751 2002-03-29 Martin Baulig <martin@gnome.org>
18753 * class.cs (Method.Emit): Only emit symbolic debugging info if the
18754 current location is not Null.
18756 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18757 a separate method so we can profile it.
18759 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18760 `span.Seconds' are just seconds, but no minutes or hours.
18761 (MainDriver): Profile the CodeGen.SaveSymbols calls.
18763 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18765 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18766 Remove the gratuitous set of Final:
18768 // If an interface implementation, then we can set Final.
18769 if (((flags & MethodAttributes.Abstract) == 0) &&
18770 implementing.DeclaringType.IsInterface)
18771 flags |= MethodAttributes.Final;
18773 I do not know what I was smoking when I used that.
18776 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18777 step into fixing the name resolution issues for delegates and
18778 unifying the toplevel name resolution.
18780 2002-03-28 Martin Baulig <martin@gnome.org>
18782 * class.cs (Method.Emit): If we have a symbol writer, call its
18783 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18784 tell it about the current method.
18786 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18787 writer that we're going to emit the first byte of IL code for a new
18788 statement (a new source line).
18789 (EmitContext.EmitTopBlock): If we have a symbol writer, call
18790 EmitContext.Mark() before emitting any code.
18792 * location.cs (SymbolDocument): Return null when we're Null.
18794 * statement.cs (Statement): Moved the `Location loc' variable here.
18795 (Statement.EmitBoolExpression): If we have a symbol writer, call
18796 ec.Mark() before emitting any code to tell it that we're at the
18797 beginning of a new statement.
18798 (StatementExpression): Added `Location' argument to the constructor.
18799 (Block): Added public readonly variable `StartLocation' and public
18800 variable `EndLocation'. The latter is to be set using SetEndLocation().
18801 (Block): Added constructor which takes a start and end location.
18802 (Block.SetEndLocation): New method. This sets the end location.
18803 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18804 local variables we create.
18805 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18806 each statement and do also mark the begin and end of the block.
18808 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18809 tell it the current lexer.Location, use Location.Null for the end of the
18811 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18812 current block, set its end location using SetEndLocation().
18813 (statement_expression): StatementExpression constructor now takes the
18814 lexer.Location as additional argument.
18815 (for_statement, declare_local_variables): Likewise.
18816 (declare_local_variables): When creating a new implicit block, use the
18817 new Block constructor and pass it the lexer.Location.
18819 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18821 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18822 members also on the parent interfaces recursively.
18824 2002-03-27 Miguel de Icaza <miguel@ximian.com>
18826 * report.cs: Use new formats, since Gonzalo finished the missing
18829 * expression.cs (Binary.ResolveOperator): added missing operator|
18830 operator& and operator^ for bool/bool.
18832 * cs-parser.jay: CheckDef now takes a Location argument that is
18833 used to report errors more precisly (instead of reporting the end
18834 of a definition, we try to track something which is a lot closer
18835 to the source of the problem).
18837 * cs-tokenizer.cs: Track global token use, so we can properly flag
18838 the use of #define/#undef after the first token has been seen.
18840 Also, rename the reportXXXX to Error_DescriptiveName
18842 * decl.cs (DeclSpace.IsTopLevel): Move property here from
18843 TypeContainer, so that Enum and Interface can use this too.
18845 * class.cs (TypeContainer.LookupInterfaceOrClass,
18846 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18847 `builder' argument. Typically this was used to pass the parent
18848 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18851 The problem is that a nested class could trigger the definition of
18852 a toplevel class, and the builder would be obviously wrong in that
18855 So we drop this argument, and we compute dynamically the
18856 TypeBuilder/ModuleBuilder (the correct information was available
18857 to us anyways from DeclSpace.Parent)
18859 * interface.cs (Interface.DefineInterface): Drop builder
18860 parameter cleanup like class.cs
18862 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
18865 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18868 (Try.Emit): Propagate the returns value from the statement.
18870 (Return.Emit): Even if we are leavning
18872 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18874 * modifiers.cs: Fix the computation of MethodAttributes flags.
18876 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18878 * driver.cs: allow compilation of files that start with '/'.
18879 Add a default case when checking the argument of --target.
18881 2002-03-25 Miguel de Icaza <miguel@ximian.com>
18883 * interface.cs: Implement the same search algorithm for types in
18884 the interface code.
18886 * delegate.cs: Do not allow multiple definition.
18888 * Recovered ChangeLog that got accidentally amputated
18890 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18892 * rootcontext.cs: Load manually enum to allow core classes to
18893 contain enumerations.
18895 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18896 Update to new static methods in TypeManager.
18898 * typemanager.cs (GetMethod, GetConstructor): Use our
18899 implementation of FindMembers to find the members, since during
18900 corlib compilation, the types are TypeBuilders and GetMethod and
18901 GetConstructor do not work.
18903 Make all methods in TypeManager static.
18905 (InitCodeHelpers): Split the functionality from
18906 the InitCodeTypes function.
18908 * driver.cs: Call InitCodeHelpers after we have populated the
18911 * cs-parser.jay (delegate_declaration): we did not used to compute
18912 the delegate name correctly for void delegates.
18914 2002-03-24 Miguel de Icaza <miguel@ximian.com>
18916 * rootcontext.cs (RootContext): Init the interface_resolve_order
18917 and type_container_resolve_order always.
18919 (ResolveCore, BootstrapCorlib_ResolveClass,
18920 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18921 compiler when compiling with --nostdlib
18923 * class.cs (TypeContainer.DefineType): Check that our parent is
18924 not null. This test is most important when we are bootstraping
18927 * codegen.cs: Split out the symbol writing code.
18929 2002-03-25 Martin Baulig <martin@gnome.org>
18931 * driver.cs (-g): Made -g an alias for --debug.
18933 2002-03-24 Martin Baulig <martin@gnome.org>
18935 * codegen.cs (SymbolWriter): New public variable. Returns the
18936 current symbol writer.
18937 (CodeGen): Added `bool want_debugging_support' argument to the
18938 constructor. If true, tell the ModuleBuild that we want debugging
18939 support and ask it for the ISymbolWriter.
18940 (Save): If we have a symbol writer, call it's Close() method after
18941 saving the assembly.
18943 * driver.c (--debug): New command line argument to create a
18944 debugger information file.
18946 * location.cs (SymbolDocument): New public property. Returns an
18947 ISymbolDocumentWriter object for the current source file or null
18948 if we don't have a symbol writer.
18950 2002-03-21 Miguel de Icaza <miguel@ximian.com>
18952 * driver.cs (LoadAssembly): Correctly return when all the paths
18953 have been tried and not before.
18955 * statement.cs (Switch.Emit): return the actual coverage for this
18956 statement (returns/not-returns)
18958 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18959 switch of the statement if we are the last switch section. That
18960 kills two problems: try/catch problems (we used to emit an empty
18961 nop at the end) and switch statements where all branches would
18964 2002-03-19 Miguel de Icaza <miguel@ximian.com>
18966 * driver.cs: Add default assemblies (the equivalent to the
18967 Microsoft CSC.RSP file)
18969 * cs-tokenizer.cs: When updating `cols and setting it to zero,
18970 also update tokens_seen and set it to false.
18972 * driver.cs: Implement --recurse for Mike.
18974 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18975 correctly splitting out the paths.
18977 2002-03-18 Miguel de Icaza <miguel@ximian.com>
18979 * interface.cs (Interface.PopulateProperty): Instead of using
18980 `parent' as the declaration space for the set parameters, use
18983 * support.cs (InternalParameters): InternalParameters constructor
18984 takes a DeclSpace instead of a TypeContainer.
18986 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18987 types are being initialized, load the address of it before calling
18990 (New): Provide a mechanism to disable the generation of local
18991 value type temporaries when the caller will be providing us with
18992 an address to store it.
18994 (ArrayCreation.EmitDynamicInitializers): Use it.
18996 2002-03-17 Miguel de Icaza <miguel@ximian.com>
18998 * expression.cs (Invocation.EmitArguments): Only probe for array
18999 property if there is more than one argument. Sorry about that.
19001 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19002 empty param arrays.
19004 * class.cs (Method.LabelParameters): Fix incorrect code path that
19005 prevented the `ParamArrayAttribute' from being applied to the
19008 2002-03-16 Miguel de Icaza <miguel@ximian.com>
19010 * support.cs (ReflectionParameters): Correctly compute whether the
19011 last argument is a params array. Fixes the problem with
19014 * typemanager.cs: Make the assemblies array always be non-null
19015 (empty, but non-null)
19017 * tree.cs (RecordDecl): New function that abstracts the recording
19018 of names. This reports error 101, and provides a pointer to the
19019 previous declaration. Fixes a crash in the compiler.
19021 * cs-parser.jay (constructor_declaration): Update to new grammar,
19022 and provide a constructor_body that can be empty.
19024 2002-03-15 Miguel de Icaza <miguel@ximian.com>
19026 * driver.cs: Add support for --resources.
19028 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19029 Make all types for the various array helper methods be integer.
19031 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19032 CheckState to ConvCast.
19034 (ConvCast): Now it takes a `checked' state argument, to avoid
19035 depending on the emit context for the conversion, and just using
19036 the resolve time setting.
19038 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19039 instead of Invocation.EmitArguments. We do not emit the original
19040 arguments, instead we emit those which have been converted to
19041 unsigned int expressions.
19043 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19045 * codegen.cs: ditto.
19047 * expression.cs (LocalVariableReference): Drop the use of the
19048 Store function that depended on the variable index.
19050 * statement.cs (VariableInfo): Drop the `Idx' property from this
19051 class, as this is not taking into account the indexes for
19052 temporaries tat we generate during the execution, getting the
19055 * class.cs: First emit class initializers, then call the parent
19058 * expression.cs (Binary): Fix opcode emision.
19059 (UnaryMutator.EmitCode): Support checked code generation
19061 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19062 matches for events for both the Static and Instance scans,
19063 pointing to the same element. Fix that.
19065 2002-03-14 Miguel de Icaza <miguel@ximian.com>
19067 * rootcontext.cs (ResolveTree): Always set the
19068 interface_resolve_order, because nested interfaces will be calling
19071 * class.cs (GetInterfaceOrClass): Track the same resolution
19072 process used by TypeManager.LookupType. This fixes the nested
19073 type lookups in class declarations (separate path from
19076 (TypeContainer.DefineType): Also define nested interfaces.
19077 (TypeContainer.RegisterOrder): New public function used to
19078 register the order in which child interfaces need to be closed.
19080 Nested interfaces need to be closed after their parents have been
19083 * interface.cs (InterfaceAttr): Put all the logic for computing
19084 the interface attribute here.
19086 (DefineInterface): Register our interface order with the
19087 RootContext or with the TypeContainer depending on the case.
19089 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19091 * cs-parser.jay: rework foreach statement to work with the new
19092 changes to the policy on SimpleNames.
19094 * report.cs: support Stacktrace on warnings as well.
19096 * makefile: drop --unsafe and /unsafe from the compile.
19098 2002-03-13 Ravi Pratap <ravi@ximian.com>
19100 * ecore.cs (StandardConversionExists): Modify to take an Expression
19101 as the first parameter. Ensure we do null -> reference type conversion
19104 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19105 temporary Expression objects.
19107 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19109 * interface.cs: workaround bug in method overloading resolution
19110 (there is already a bugzilla bug for it).
19112 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19114 We could also solve this problem by having a separate path for
19115 performing type lookups, instead of DoResolve, we could have a
19116 ResolveType entry point, and only participating pieces of the
19117 production (simplename, deref, array) would implement this.
19119 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19120 signal SimpleName to only resolve type names and not attempt to
19121 resolve anything else.
19123 * expression.cs (Cast): Set the flag.
19125 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19127 * class.cs: Only report 108 if there is no `new' modifier.
19129 * cs-parser.jay: rework foreach statement to work with the new
19130 changes to the policy on SimpleNames.
19132 * report.cs: support Stacktrace on warnings as well.
19134 * makefile: drop --unsafe and /unsafe from the compile.
19136 2002-03-11 Miguel de Icaza <miguel@ximian.com>
19138 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19139 lookups here, instead of doing that at parse time. This means
19140 that our grammar will not introduce `LocalVariableReferences' as
19141 expressions at this point. That solves the problem of code like
19145 static void Main ()
19149 This is only half the fix. The full fix requires parameters to
19150 also be handled in this way.
19152 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19153 makes the use more obvious of the DeclSpace. The
19154 ec.TypeContainer.TypeBuilder is now only used to pull the
19155 TypeBuilder for it.
19157 My theory is that I can get rid of the TypeBuilder completely from
19158 the EmitContext, and have typecasts where it is used (from
19159 DeclSpace to where it matters).
19161 The only pending problem is that the code that implements Aliases
19162 is on TypeContainer, and probably should go in DeclSpace.
19164 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19165 lookups here, instead of doing that at parse time. This means
19166 that our grammar will not introduce `LocalVariableReferences' as
19167 expressions at this point. That solves the problem of code like
19171 static void Main ()
19175 This is only half the fix. The full fix requires parameters to
19176 also be handled in this way.
19178 * class.cs (Property.DefineMethod): When implementing an interface
19179 method, set newslot, when implementing an abstract method, do not
19180 set the flag (before we tried never setting it, or always setting
19181 it, which is the difference).
19182 (Indexer.DefineMethod): same.
19183 (Method.DefineMethod): same.
19185 * ecore.cs: Only set the status used flag if we get back a Field.
19187 * attribute.cs: Temporary hack, so Paolo can keep working.
19189 2002-03-08 Ravi Pratap <ravi@ximian.com>
19191 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19192 the unmanaged type in the case we have a MarshalAs attribute.
19194 (Resolve): Handle the case when we are parsing the special MarshalAs
19195 attribute [we need to store the unmanaged type to use later]
19197 * typemanager.cs (marshal_as_attr_type): Built in type for the
19198 MarshalAs Attribute.
19200 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
19201 on parameters and accordingly set the marshalling info.
19203 2002-03-09 Miguel de Icaza <miguel@ximian.com>
19205 * class.cs: Optimizing slightly by removing redundant code after
19206 we switched to the `NoTypes' return value.
19207 (Property.DefineMethod): use NoTypes here too.
19209 This fixes the bug I introduced in my last batch of changes.
19211 2002-03-05 Ravi Pratap <ravi@ximian.com>
19213 * tree.cs (RecordEnum): Add. We now keep track of enums too.
19215 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19216 Enums since those are types too.
19218 * cs-parser.jay (enum_declaration): Record enums as we parse them.
19220 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
19221 thanks to a call during the lookup process.
19223 2002-03-07 Miguel de Icaza <miguel@ximian.com>
19225 * statement.cs (Foreach): Lots of work to accomodate a particular
19226 kind of foreach statement that I had not kept in mind. It is
19227 possible to have foreachs on classes that provide a GetEnumerator
19228 method that return objects that implement the "pattern" for using
19229 a foreach, there is no need to support GetEnumerator
19232 This is needed to compile nant.
19234 * decl.cs: Only report 114 if the member is not `Finalize' and if
19235 the warning level is at least 2.
19237 * class.cs: Moved the compare function from Method to
19240 (MethodSignature.InheritableMemberSignatureCompare): Add new
19241 filter function that is used to extract inheritable methods from a
19244 (Method.Define): Use the new `inheritable_method_signature_filter'
19247 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19250 2002-03-06 Miguel de Icaza <miguel@ximian.com>
19252 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19254 * cs-parser.jay: Add opt_semicolon to the interface declaration.
19256 * expression.cs: Pass location information to
19257 ConvertImplicitStandard.
19259 * class.cs: Added debugging code to track return values from
19262 2002-03-05 Miguel de Icaza <miguel@ximian.com>
19264 * expression.cs (Is.DoResolve): If either side of the `is' is an
19265 interface, do not flag the warning.
19267 * ecore.cs (ImplicitReferenceConversion): We need a separate test
19270 * report.cs: Allow for --fatal to be used with --probe.
19272 * typemanager.cs (NoTypes): Move the definition for the empty Type
19275 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19277 (TypeContainer.DefineProxy): New function used to proxy to parent
19278 implementations when implementing interfaces.
19279 (TypeContainer.ParentImplements): used to lookup if our parent
19280 implements a public function that is required by an interface.
19281 (TypeContainer.VerifyPendingMethods): Hook this up.
19283 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19284 `modules' and `assemblies' arraylists into arrays. We only grow
19285 these are the very early start up of the program, so this improves
19286 the speedof LookupType (nicely measured).
19288 * expression.cs (MakeByteBlob): Replaced unsafe code with
19289 BitConverter, as suggested by Paolo.
19291 * cfold.cs (ConstantFold.Binary): Special case: perform constant
19292 folding of string concatenation, but if either side is a string,
19293 and the other is not, then return null, and let the runtime use
19294 the concatenation on the string plus the object (using
19295 `Object.ToString').
19297 2002-03-04 Miguel de Icaza <miguel@ximian.com>
19299 Constant Folding has been implemented now.
19301 * expression.cs (Unary.Reduce): Do not throw an exception, catch
19302 the error instead on types that are not supported in one's
19305 * constant.cs (Constant and all children): New set of functions to
19306 perform implict and explicit conversions.
19308 * ecore.cs (EnumConstant): Implement the new functions to perform
19309 conversion by proxying to the child expression.
19311 * codegen.cs: (ConstantCheckState): Constant evaluation has its
19312 own separate setting that can not be turned off from the command
19313 line using --unchecked or --checked and is only controlled using
19314 the checked/unchecked statements and expressions. This setting is
19315 used by the constant folder to flag errors.
19317 * expression.cs (CheckedExpr, UncheckedExpr): Set the
19318 ConstantCheckState as well.
19320 During Resolve, they also have to flag the state, because the
19321 constant folder runs completely in the Resolve phase.
19323 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19326 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19328 * cfold.cs: New file, this file contains the constant folder.
19330 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19331 argument to track whether we are using the resulting address to
19332 load or store a value and provide better error messages.
19334 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19335 new AddressOf arguments.
19337 * statement.cs (Foreach.EmitCollectionForeach): Update
19339 * expression.cs (Argument.Emit): Call AddressOf with proper
19340 arguments to track usage.
19342 (New.DoEmit): Call AddressOf with new arguments.
19344 (Unary.Emit): Adjust AddressOf call.
19346 2002-03-01 Ravi Pratap <ravi@ximian.com>
19348 * cs-parser.jay (member_access): Change the case for pre-defined types
19349 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
19352 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19355 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19356 essentially like methods and apply attributes like MethodImplOptions to them too.
19358 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19361 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19362 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19365 * Update code everywhere accordingly.
19367 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19369 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19371 2002-02-28 Ravi Pratap <ravi@ximian.com>
19373 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19374 try performing lookups against those instead of jumping straight into using
19375 the 'using' clauses.
19377 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19379 (LookupType): Perform lookups in implicit parents too.
19381 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19382 sequence as RootContext.LookupType.
19384 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
19385 the various cases of namespace lookups into this method.
19387 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19389 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19390 in positional arguments)
19392 * class.cs (Operator): Update the AllowedModifiers to contain
19395 * cs-parser.jay: Update operator declaration to allow for the
19396 operator body to be empty.
19398 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19401 2002-02-27 Miguel de Icaza <miguel@ximian.com>
19403 * class.cs (Method.Emit): Label parameters.
19405 * driver.cs: Return 1 or 0 as the program exit code.
19407 2002-02-26 Miguel de Icaza <miguel@ximian.com>
19409 * expression.cs: Special case the `null' object when trying to
19410 auto-compute the type, as anything can be explicitly converted to
19413 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19414 spotting this Paolo.
19416 (Expression.ImplicitNumericConversion): Perform comparissions of
19417 the type using the underlying type in the case of an enumeration
19418 rather than using the enumeration type for the compare.
19420 Cope with the underlying == type case, which is not possible to
19423 (Expression.ConvertNumericExplicit): Perform comparissions of
19424 the type using the underlying type in the case of an enumeration
19425 rather than using the enumeration type for the compare.
19427 * driver.cs: If the user does not supply an extension, assume .exe
19429 * cs-parser.jay (if_statement): Rewrote so that we can track the
19430 location for the if statement.
19432 * expression.cs (Binary.ConstantFold): Only concat strings when
19433 the operation is "+", not everything ;-)
19435 * statement.cs (Statement.EmitBoolExpression): Take a location
19437 (If, While, Do): Track location.
19439 * expression.cs (Binary.ResolveOperator): In the object + string
19440 case, I was missing a call to ConvertImplicit
19442 2002-02-25 Ravi Pratap <ravi@ximian.com>
19444 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19445 Location arguments. Ensure we use RootContext.LookupType to do our work
19446 and not try to do a direct Type.GetType and ModuleBuilder.GetType
19448 * interface.cs (PopulateMethod): Handle the type of the parameter being
19451 * expression.cs (Invocation.BetterFunction): Handle the case when we
19452 have a params method with no fixed arguments and a call is made with no
19455 2002-02-25 Miguel de Icaza <miguel@ximian.com>
19457 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19458 the verbatim-string-literal
19460 * support.cs (InternalParameters.ParameterModifier): handle null
19462 (InternalParameters.ParameterType): ditto.
19464 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19465 duplicating the name of the variable parameter.
19466 (GetParameterByName): Fix bug where we were not looking up array
19467 paramters if they were the only present (thanks Paolo!).
19468 (GetParameterInfo): We only have an empty set of types if both
19469 fixed and array are set to null.
19470 (GetParameterInfo-idx): Handle FixedParameter == null
19472 * cs-parser.jay: Handle the case where there is no catch
19473 statements (missing null test).
19475 2002-02-22 Miguel de Icaza <miguel@ximian.com>
19477 * driver.cs (MainDriver): Be conservative on our command line
19480 Catch DirectoryNotFoundException when calling GetFiles.
19482 (SplitPathAndPattern): Used to split the input specification into
19483 a path and a pattern that we can feed to Directory.GetFiles.
19485 2002-02-21 Miguel de Icaza <miguel@ximian.com>
19487 * statement.cs (Fixed): Implement the last case of the Fixed
19488 statement (string handling).
19490 * expression.cs (StringPtr): New class used to return a char * to
19491 a string; Used by the Fixed statement.
19493 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
19495 * expression.cs (Binary.ResolveOperator): Remove redundant
19496 MemberLookup pn parent type.
19497 Optimize union call, we do not need a union if the types are the same.
19498 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19501 Specialize the use of MemberLookup everywhere, instead of using
19502 the default settings.
19504 (StackAlloc): Implement stackalloc keyword.
19506 * cs-parser.jay: Add rule to parse stackalloc.
19508 * driver.cs: Handle /h, /help, /?
19510 * expression.cs (MakeByteBlob): Removed the hacks we had in place
19511 before we supported unsafe code.
19513 * makefile: add --unsafe to the self compilation of mcs.
19515 2002-02-20 Miguel de Icaza <miguel@ximian.com>
19517 * expression.cs (PointerArithmetic): New class that is used to
19518 perform pointer arithmetic.
19519 (Binary.Resolve): Handle pointer arithmetic
19520 Handle pointer comparission.
19521 (ArrayPtr): Utility expression class that is used to take the
19522 address of an array.
19524 (ElementAccess): Implement array access for pointers
19526 * statement.cs (Fixed): Implement fixed statement for arrays, we
19527 are missing one more case before we are done.
19529 * expression.cs (Indirection): Implement EmitAssign and set the
19530 ExprClass to Variable. This allows pointer dereferences to be
19531 treated as variables, and to have values assigned to them.
19533 * ecore.cs (Expression.StoreFromPtr): New utility function to
19534 store values dereferencing.
19536 2002-02-20 Ravi Pratap <ravi@ximian.com>
19538 * expression.cs (Binary.ResolveOperator): Ensure that we are
19539 not trying to operate on a void type - this fixes the reported
19542 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19543 the parent implementation is sealed.
19545 * ../errors/cs0239.cs : Add.
19547 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19549 * typemanager.cs (unverifiable_code_type): Corresponds to
19550 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19551 which have unsafe code in them.
19553 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
19556 2002-02-19 Miguel de Icaza <miguel@ximian.com>
19558 * cs-tokenizer.cs: Add support for @"litreal strings"
19560 Make tokenizer accept pre-processor directives
19561 on any column (remove the old C-like limitation).
19563 * rootcontext.cs (EmitCode): Emit any global attributes.
19564 (AddGlobalAttributes): Used to keep track of assembly attributes.
19566 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19568 * cs-parser.jay: Add support for global attributes.
19570 2002-02-17 Miguel de Icaza <miguel@ximian.com>
19572 * expression.cs (Indirection): New helper class. Unary will
19573 create Indirection classes to be able to implement the
19574 IMemoryLocation interface on it.
19576 2002-02-16 Miguel de Icaza <miguel@ximian.com>
19578 * cs-parser.jay (fixed_statement): reference the right statement.
19580 * statement.cs (Fixed.Emit): Finish implementing the fixed
19581 statement for the &x case.
19583 2002-02-14 Miguel de Icaza <miguel@ximian.com>
19585 * class.cs (Property.Define, Method.Define): Remove newslot when
19588 * modifiers.cs: My use of NewSlot when `Abstract' was set was
19589 wrong. NewSlot should only be used if the `new' keyword is present.
19591 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19592 locating our system dir. Sorry about this.
19594 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19596 * driver.cs (GetSystemDir): Compute correctly the location of our
19597 system assemblies. I was using the compiler directory instead of
19598 the library directory.
19600 2002-02-13 Ravi Pratap <ravi@ximian.com>
19602 * expression.cs (BetterFunction): Put back in what Miguel commented out
19603 since it is the correct fix. The problem is elsewhere ;-)
19605 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19606 parameters of the parms method are themselves compatible or not !
19608 (StandardConversionExists): Fix very dangerous bug where we were forgetting
19609 to check that a class implements an interface before saying that an implicit
19610 conversion was allowed. Use ImplementsInterface to do the checking.
19612 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19614 * class.cs (Method.Define): Track whether we are an explicit
19615 implementation or not. And only call DefineMethodOverride if we
19616 are an explicit implementation.
19618 (Property.DefineMethod): Ditto.
19620 2002-02-11 Ravi Pratap <ravi@ximian.com>
19622 * expression.cs (BetterFunction): Catch hideous bug which was
19623 preventing us from detecting ambiguous calls due to implicit casts i.e
19626 2002-01-29 Miguel de Icaza <miguel@ximian.com>
19628 * support.cs (Pair): Remove un-needed method. I figured why I was
19629 getting the error in cs-parser.jay, the variable in a foreach loop
19630 is readonly, and the compiler does not really treat this as a variable.
19632 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
19633 instead of EQUALS in grammar.
19635 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19637 * expression.cs (Unary.DoResolve): Check whether the argument is
19640 2002-01-28 Miguel de Icaza <miguel@ximian.com>
19642 * support.cs: Api for Pair to set a value. Despite the fact that
19643 the variables are public the MS C# compiler refuses to compile
19644 code that accesses the field if the variable is part of a foreach
19647 * statement.cs (Fixed): Begin implementation of the fixed
19650 (Block.AddVariable): Return the VariableInfo on success and null
19651 on failure instead of true/false.
19653 * cs-parser.jay (foreach): Catch errors on variables already
19654 defined (we were ignoring this value before) and properly unwind
19655 the block hierarchy
19657 (fixed_statement): grammar for the fixed statement.
19659 2002-01-25 Miguel de Icaza <miguel@ximian.com>
19661 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19662 pointer types to be incretemented.
19664 (SizeOf): Implement.
19666 * cs-parser.jay (pointer_member_access): Implement
19667 expr->IDENTIFIER production.
19669 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19670 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19673 (Unary): Implement indirection.
19675 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19676 use in non-unsafe context).
19678 (SimpleName.DoResolve): Check for pointers in field access on safe
19681 (Expression.LoadFromPtr): Factor the load-indirect code in this
19682 function. This was duplicated in UnboxCast and ParameterReference
19684 2002-01-24 Miguel de Icaza <miguel@ximian.com>
19686 * expression.cs (ComposedCast): report an error if a pointer cast
19687 is used in a safe region.
19689 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19690 pointer type casts in unsafe context.
19692 * codegen.cs (EmitContext): Set up IsUnsafe.
19694 * cs-parser.jay (non_expression_type): Add productions for pointer
19697 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19698 code. We should not use force into static mode if the method is
19699 not virtual. Fixes bug in MIS
19701 * statement.cs (Do.Emit, While.Emit, For.Emit,
19702 Statement.EmitBoolExpression): Add support to Do and While to
19703 propagate infinite loop as `I do return' semantics.
19705 Improve the For case to also test for boolean constants.
19707 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19708 to the list of attributes we can add.
19710 Remove `EmitContext' argument.
19712 * class.cs (Method.Define): Apply parameter attributes.
19713 (Constructor.Define): Apply parameter attributes.
19714 (MethodCore.LabelParameters): Move here the core of labeling
19717 * support.cs (ReflectionParameters.ParameterModifier,
19718 InternalParameters.ParameterModifier): Use IsByRef on the type and
19719 only return the OUT bit for these parameters instead of in/out/ref
19722 This is because I miss-understood things. The ParameterInfo.IsIn
19723 and IsOut represent whether the parameter has the [In] and [Out]
19726 2002-01-22 Miguel de Icaza <miguel@ximian.com>
19728 * ecore.cs (FieldExpr.Emit): Release temporaries.
19730 * assign.cs (LocalTemporary.Release): new function.
19732 * codegen.cs (EmitContext.GetTemporaryStorage,
19733 EmitContext.FreeTemporaryStorage): Rework the way we deal with
19734 temporary storage. Now we can "put back" localbuilders when we
19737 2002-01-21 Miguel de Icaza <miguel@ximian.com>
19739 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19740 need to make a copy of the variable to generate verifiable code.
19742 2002-01-19 Miguel de Icaza <miguel@ximian.com>
19744 * driver.cs: Compute dynamically the system directory.
19746 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19747 Slower, but more generally useful. Used by the abstract
19748 registering implementation.
19750 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19751 the rules for the special rule on Type/instances. First check if
19752 we have the same name, and if so, try that special static path
19753 rather than the instance path.
19755 2002-01-18 Miguel de Icaza <miguel@ximian.com>
19757 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19760 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19761 Enum, ValueType, Delegate or Array for non-corlib compiles.
19763 * cs-tokenizer.cs: Catch long identifiers (645)
19765 * typemanager.cs (IndexerPropetyName): Ravi never tested this
19768 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19769 fix, we were returning too early, so we were not registering
19770 pending methods from abstract classes.
19772 Do not register pending methods if the class is abstract.
19774 * expression.cs (Conditional.DoResolve): Report circular implicit
19775 conversions when we neecd to compute it for conditional
19778 (Is.DoResolve): If the expression is always of the provided type,
19779 flag warning 183. If the expression can not ever be of the
19780 provided type flag warning 184.
19782 * class.cs: Catch 169 as well.
19784 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19787 2002-01-18 Nick Drochak <ndrochak@gol.com>
19789 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
19791 2002-01-17 Miguel de Icaza <miguel@ximian.com>
19793 * interface.cs: (PopulateMethod): Check for pointers being defined
19794 only if the unsafe context is active.
19795 (PopulateProperty): ditto.
19796 (PopulateIndexer): ditto.
19798 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19799 specified. If pointers are present, make sure that they are
19800 present in an unsafe context.
19801 (Constructor, Constructor.Define): ditto.
19802 (Field, Field.Define): ditto.
19803 (Property, Property.Define): ditto.
19804 (Event, Event.Define): ditto.
19806 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19807 hashtable if there are classes or structs defined.
19809 * expression.cs (LocalVariableReference.DoResolve): Simplify this
19810 code, as the constant resolution moved.
19812 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19813 the metadata, so we can flag error 133.
19815 * decl.cs (MemberCore.UnsafeOK): New function to test that a
19816 pointer is being declared in an unsafe context.
19818 2002-01-16 Miguel de Icaza <miguel@ximian.com>
19820 * modifiers.cs (Modifiers.Check): Require a Location argument.
19821 Report error 227 for Unsafe use.
19823 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19825 * statement.cs (For.Emit): If the test is null, then report that
19826 we do `return', as we wont reach anything afterwards.
19828 (Switch.SwitchGoverningType): Track the expression that matched
19831 * driver.cs: Allow negative numbers as an error code to flag.
19833 * cs-parser.jay: Handle 1551.
19835 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19837 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19839 * cs-parser.jay: Report 1518 (type declaration can only contain
19840 class, struct, interface, enum or delegate)
19842 (switch_label): Report 1523 (keywords `case' or `default' must
19845 (opt_switch_sections): Report 1522 (empty switch)
19847 * driver.cs: Report 1515 (response file specified multiple times)
19848 Report 1516 (Source file specified multiple times).
19850 * expression.cs (Argument.Resolve): Signal 1510
19852 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19853 access not allowed in static code)
19855 2002-01-11 Ravi Pratap <ravi@ximian.com>
19857 * typemanager.cs (IsPointerType): Utility method which we are going
19860 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19861 the object type, so we take care of that.
19863 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19865 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19866 added to non-params parameters :-)
19868 * typemanager.cs (CSharpName): Include 'void' type too.
19870 (void_ptr_type): Include in the set of core types.
19872 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
19875 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
19878 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
19879 completely forgotten about it.
19881 2002-01-10 Ravi Pratap <ravi@ximian.com>
19883 * cs-parser.jay (pointer_type): Add. This begins our implementation
19884 of parsing rules for unsafe code.
19886 (unsafe_statement): Implement.
19888 (embedded_statement): Modify to include the above.
19890 * statement.cs (Unsafe): Implement new class for unsafe blocks.
19892 * codegen.cs (EmitContext.InUnsafe): Add. This determines
19893 if the current context is an unsafe one.
19895 * cs-parser.jay (local_variable_pointer_type): Since local variable types
19896 are handled differently, we need separate rules for them.
19898 (local_variable_declaration): Update to use local_variable_pointer_type
19899 to allow variable declarations of unmanaged pointer types.
19901 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19902 in unsafe contexts.
19904 * ../errors/cs0214.cs : Add.
19906 2002-01-16 Nick Drochak <ndrochak@gol.com>
19908 * makefile: remove 'response' file when cleaning.
19910 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19912 * cs-parser.jay: Report 1524.
19914 2002-01-14 Miguel de Icaza <miguel@ximian.com>
19916 * typemanager.cs (RegisterMethod): drop checking if we have
19917 registered this from here
19919 2002-01-12 Miguel de Icaza <miguel@ximian.com>
19921 * class.cs (Method.EmitDestructor): Implement calling our base
19924 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19925 value of InFinally.
19927 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19928 this routine and will wrap the call in a try/catch block. Deal
19931 2002-01-11 Miguel de Icaza <miguel@ximian.com>
19933 * ecore.cs (Expression.MemberLookup): instead of taking a
19934 parameter `same_type' that was used to tell whether we could
19935 access private members we compute our containing type from the
19938 (FieldExpr): Added partial support for volatile fields. This does
19939 not work for volatile fields exposed from assemblies, as I can not
19940 figure out how to extract the modreq from it.
19942 Updated all the source files to use this.
19944 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19945 because it is referenced by MemberLookup very often.
19947 2002-01-09 Ravi Pratap <ravi@ximian.com>
19949 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19950 TypeBuilder.GetCustomAttributes to retrieve what we need.
19952 Get rid of redundant default_member_attr_type as this is the same as
19953 default_member_type which already exists.
19955 * interface.cs, attribute.cs : Update accordingly.
19957 2002-01-08 Miguel de Icaza <miguel@ximian.com>
19959 * typemanager.cs: Enable IndexerPropertyName again. It does not
19960 work for TYpeBuilders though. Ravi, can you please fix this?
19962 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19964 * expression.cs (Argument.Emit): Handle the case of ref objects
19965 being passed to ref functions;
19967 (ParameterReference.EmitLoad): Loads the content of the pointer
19968 without dereferencing.
19970 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19972 * cs-tokenizer.cs: Implemented the pre-processing expressions.
19974 2002-01-08 Ravi Pratap <ravi@ximian.com>
19976 * class.cs (Indexer.DefineMethod): Incorporate the interface
19977 type in the name of the method if we are doing explicit interface
19980 * expression.cs (ConversionExists): Remove as it is completely obsolete.
19982 (BetterConversion): Fix extremely trivial bug where we were referring to
19983 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19986 * ../errors/bug16.cs : Add although we have fixed it.
19988 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19990 * expression.cs (BaseIndexer): Begin implementation.
19992 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19994 * cs-parser.jay (indexer_declarator): Use qualified_identifier
19995 production directly to remove a shift/reduce, and implement
19996 explicit interface implementation.
19998 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19999 after a floating point suffix.
20001 * expression.cs (DoNumericPromotions): Improved the conversion for
20002 uint/uint. If we have a constant, we avoid doing a typecast to a
20005 * class.cs (Indexer): Implement explicit interface implementation
20008 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20010 * class.cs: make the default instance constructor public and hidebysig.
20012 2001-01-03 Ravi Pratap <ravi@ximian.com>
20014 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20015 so we can call it from elsewhere.
20017 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20018 we emit it internally if the class has a defined indexer; otherwise the user
20019 emits it by decorating the class definition with the DefaultMemberAttribute.
20021 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20022 attribute is not used on a type which defines an indexer.
20024 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20025 character when we skip whitespace.
20027 * ../errors/cs0646.cs : Add.
20029 2002-01-03 Miguel de Icaza <miguel@ximian.com>
20031 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20034 * makefile: Add practical target `mcs3.exe' which builds the third
20035 generation compiler.
20037 * expression.cs (New): Fix structures constructor calling.
20039 * class.cs (Property, Method, Indexer): Emit Final flag on the
20040 method if we are an interface implementation and we are not
20043 * ecore.cs (PropertyExpr): New public field `IsBase', tells
20044 whether this property is referencing a `base' method.
20046 * expression.cs (Invocation.EmitCall): take an extra argument:
20047 is_base, this is used to determine whether the `call' or
20048 `callvirt' opcode should be used.
20051 * delegate.cs: update EmitCall.
20053 * class.cs (Method.Define): Set NewSlot for the cases where we are
20054 not implementing an interface method.
20056 (Property.Define): ditto.
20058 2002-01-02 Miguel de Icaza <miguel@ximian.com>
20060 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20061 'r'. Allows mcs to parse itself fully.
20063 2002-01-02 Ravi Pratap <ravi@ximian.com>
20065 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20066 of the number of initializers that require the InitializeArray method.
20068 (CheckIndices): Store the Expression in all cases - not the plain value. Also
20069 update the above field where necessary.
20071 (MakeByteBlob): Update accordingly.
20073 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
20076 (EmitDynamicInitializers): Update in accordance with the new optimization.
20078 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20079 same OpCode applies.
20081 * cs-parser.jay : Fix some glaring errors I introduced.
20083 2002-01-01 Ravi Pratap <ravi@ximian.com>
20085 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20086 so that we can check for name clashes there too.
20088 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20089 for interface indexers.
20091 * interfaces.cs (Define): Emit the default member attribute.
20093 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20094 variable was being referred to while setting the value ;-)
20096 2002-01-01 Miguel de Icaza <miguel@ximian.com>
20098 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20099 byte-by-byte information when we know the data is zero.
20101 Make the block always a multiple of 4, because
20102 DefineInitializedData has a bug.
20104 * assign.cs: Fix, we should assign from the temporary, not from
20107 * expression.cs (MakeByteBlob): Fix my incorrect code.
20109 2001-12-31 Miguel de Icaza <miguel@ximian.com>
20111 * typemanager.cs (EnumToUnderlying): This function is used to get
20112 the underlying type from an enumeration, because it does not
20115 * constant.cs: Use the I4_S form for values between -128 and 127.
20117 * statement.cs (Block.LookupLabel): Looks up a label.
20118 (Block): Drop support for labeled blocks.
20120 (LabeledStatement): New kind of statement that represents a label
20123 (Goto): Finally implement this bad boy.
20125 * cs-parser.jay: Update to reflect new mechanism to implement
20128 2001-12-30 Miguel de Icaza <miguel@ximian.com>
20130 * codegen.cs (EmitContext.This): a codegen property that keeps the
20131 a single instance of this instead of creating many different this
20134 * delegate.cs (Delegate.DoResolve): Update to use the property;
20136 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20138 * expression.cs (BaseAccess.DoResolve): Ditto.
20140 2001-12-29 Ravi Pratap <ravi@ximian.com>
20142 * typemanager.cs (methodimpl_attr_type): Add to hold the type
20143 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20145 (InitCoreTypes): Update accordingly.
20147 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20148 so we can quickly store the state.
20150 (ApplyAttributes): Set the correct implementation flags
20151 for InternalCall methods.
20153 2001-12-29 Miguel de Icaza <miguel@ximian.com>
20155 * expression.cs (EmitCall): if a method is not virtual, then do
20156 not use callvirt on it.
20158 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20159 user defined stuff) requires the use of stobj, which takes an
20160 address on the stack instead of an array and an index. So emit
20161 the Ldelema operation for it.
20163 (EmitStoreOpcode): Use stobj for valuetypes.
20165 (UnaryMutator.EmitCode): Use the right 1 value depending on
20166 whether we are dealing with int64/uint64, float or doubles.
20168 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20169 constructors that I implemented last night.
20171 (Constructor.IsDefault): Fix to work properly for static
20174 * cs-parser.jay (CheckDef): report method signature errors.
20175 Update error number 103 to be 132.
20177 * decl.cs: New AdditionResult enumeration value: MethodExists.
20178 Although we do this check for methods later on in the semantic
20179 analysis, catching repeated default constructors is so easy that
20180 we catch these here.
20182 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20185 (ParameterReference.EmitAssign, Emit): handle
20188 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20189 (ArrayAccess.EmitStoreOpcode): ditto.
20191 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20193 * expression.cs (MakeByteBlob): Complete all the missing types
20194 (uint, short, ushort, byte, sbyte)
20196 * class.cs: Only init instance field initializers on instance
20199 Rename `constructors' to instance_constructors.
20201 (TypeContainer.AddConstructor): Only add constructors to the list
20202 if it is not static.
20204 Make sure that we handle default_static_constructor independently
20205 everywhere where we handle instance_constructors
20207 2001-12-28 Miguel de Icaza <miguel@ximian.com>
20209 * class.cs: Do not lookup or create a base initializer for a
20210 static constructor.
20212 (ConstructorInitializer.Resolve): use the proper type to lookup
20215 * cs-parser.jay: Report error 1585 (modifiers between type and name).
20217 * enum.cs, interface.cs: Remove CloseType, this is taken care by
20220 * decl.cs: CloseType is now an virtual method, the default
20221 implementation just closes this type.
20223 2001-12-28 Ravi Pratap <ravi@ximian.com>
20225 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20226 to PreserveSig by default. Also emit HideBySig on such methods.
20228 Basically, set the defaults to standard values.
20230 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20231 argument, if candidate is better, it can't be worse than the best !
20233 (Invocation): Re-write bits to differentiate between methods being
20234 applicable in their expanded form and their normal form - for params
20237 Get rid of use_standard everywhere as only standard conversions are allowed
20238 in overload resolution.
20240 More spec conformance.
20242 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20244 * driver.cs: Add --timestamp, to see where the compiler spends
20247 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20248 `this' in static code.
20250 (SimpleName.DoResolve): Implement in terms of a helper function
20251 that allows static-references to be passed upstream to
20254 (Expression.ResolveWithSimpleName): Resolve specially simple
20255 names when called by MemberAccess to implement the special
20258 (Expression.ImplicitReferenceConversion): Handle conversions from
20259 Null to reference types before others, as Null's type is
20262 * expression.cs (Invocation.EmitCall): Handle the special case of
20263 calling methods declared on a reference type from a ValueType
20264 (Base classes System.Object and System.Enum)
20266 (MemberAccess.Resolve): Only perform lookups on Enumerations if
20267 the left hand side is a TypeExpr, not on every enumeration.
20269 (Binary.Resolve): If types are reference types, then do a cast to
20270 object on operators != and == of both arguments.
20272 * typemanager.cs (FindMembers): Extract instance and static
20273 members if requested.
20275 * interface.cs (PopulateProperty): Use void_type instead of null
20276 as the return type for the setter method.
20278 (PopulateIndexer): ditto.
20280 2001-12-27 Ravi Pratap <ravi@ximian.com>
20282 * support.cs (ReflectionParameters): Fix minor bug where we
20283 were examining the wrong parameter for the ParamArray attribute.
20285 Cope with requests for the type of the parameter at position
20286 greater than the params parameter's. We now return the element
20287 type of the params array as that makes more sense.
20289 * expression.cs (Invocation.IsParamsMethodApplicable): Update
20290 accordingly as we no longer have to extract the element type
20293 (Invocation.OverloadResolve): Update.
20295 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20297 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20298 against IEnumerator, test whether the return value is a descendant
20299 of the IEnumerator interface.
20301 * class.cs (Indexer.Define): Use an auxiliary method to implement
20302 the other bits of the method definition. Begin support for
20303 explicit interface implementation.
20305 (Property.DefineMethod): Use TypeManager.void_type instead of null
20306 for an empty return value.
20308 2001-12-26 Miguel de Icaza <miguel@ximian.com>
20310 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20311 dealing with a FieldExpr which is composed of a FieldBuilder, in
20312 the code path we did extract the constant, but we should have
20313 obtained the underlying value to be able to cast it (otherwise we
20314 end up in an infinite loop, this is what Ravi was running into).
20316 (ArrayCreation.UpdateIndices): Arrays might be empty.
20318 (MemberAccess.ResolveMemberAccess): Add support for section
20319 14.5.4.1 that deals with the special case of E.I when E is a type
20320 and something else, that I can be a reference to a static member.
20322 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20323 handle a particular array type to create byte blobs, it is just
20324 something we dont generate byteblobs for.
20326 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20329 * location.cs (Push): remove the key from the hashtable that we
20330 are about to add. This happens for empty files.
20332 * driver.cs: Dispose files after we have parsed them.
20334 (tokenize): new function that only runs the tokenizer on its
20335 input, for speed testing.
20337 2001-12-26 Ravi Pratap <ravi@ximian.com>
20339 * class.cs (Event.Define): Define the private field only if there
20340 are no accessors defined.
20342 * expression.cs (ResolveMemberAccess): If there is no associated
20343 field with the event, that means we have an event defined with its
20344 own accessors and we should flag error cs0070 since transforming
20345 ourselves into a field is not valid in that case.
20347 * ecore.cs (SimpleName.DoResolve): Same as above.
20349 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20350 and charset to sane values.
20352 2001-12-25 Ravi Pratap <ravi@ximian.com>
20354 * assign.cs (DoResolve): Perform check on events only if they
20355 are being accessed outside the declaring type.
20357 * cs-parser.jay (event_declarations): Update rules to correctly
20358 set the type of the implicit parameter etc.
20360 (add_accessor, remove_accessor): Set current local parameters.
20362 * expression.cs (Binary): For delegate addition and subtraction,
20363 cast the return value from the method into the appropriate delegate
20366 2001-12-24 Ravi Pratap <ravi@ximian.com>
20368 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20369 of these as the workaround is unnecessary.
20371 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20372 delegate data - none of that is needed at all.
20374 Re-write bits to extract the instance expression and the delegate method
20377 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
20380 * attribute.cs (ApplyAttributes): New method to take care of common tasks
20381 of attaching attributes instead of duplicating code everywhere.
20383 * everywhere : Update code to do attribute emission using the above method.
20385 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20387 * expression.cs (IsParamsMethodApplicable): if there are not
20388 parameters, return immediately.
20390 * ecore.cs: The 0 literal can be implicity converted to an enum
20393 (SimpleName.DoResolve): First lookup the type, then lookup the
20396 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20397 want to get its address. If the InstanceExpression is not
20398 addressable, store the result in a temporary variable, then get
20401 * codegen.cs: Only display 219 errors on warning level or above.
20403 * expression.cs (ArrayAccess): Make it implement the
20404 IMemoryLocation interface.
20406 (Binary.DoResolve): handle the operator == (object a, object b)
20407 and operator != (object a, object b) without incurring into a
20408 BoxedCast (because 5 != o should never be performed).
20410 Handle binary enumerator operators.
20412 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20413 value type, otherwise use Ldelem_ref.
20415 Use precomputed names;
20417 (AddressOf): Implement address of
20419 * cs-parser.jay (labeled_statement): Fix recursive block
20420 addition by reworking the production.
20422 * expression.cs (New.DoEmit): New has a special case:
20424 If we are dealing with a ValueType, we have a few
20425 situations to deal with:
20427 * The target of New is a ValueType variable, that is
20428 easy, we just pass this as the variable reference
20430 * The target of New is being passed as an argument,
20431 to a boxing operation or a function that takes a
20434 In this case, we need to create a temporary variable
20435 that is the argument of New.
20438 2001-12-23 Ravi Pratap <ravi@ximian.com>
20440 * rootcontext.cs (LookupType): Check that current_type is not null before
20441 going about looking at nested types.
20443 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20444 not implement the IAssignMethod interface any more.
20446 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20447 where we tranform them into FieldExprs if they are being resolved from within
20448 the declaring type.
20450 * ecore.cs (SimpleName.DoResolve): Do the same here.
20452 * assign.cs (DoResolve, Emit): Clean up code considerably.
20454 * ../errors/bug10.cs : Add.
20456 * ../errors/cs0070.cs : Add.
20458 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20460 * assign.cs : Get rid of EventIsLocal everywhere.
20462 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20464 * ecore.cs (ConvertIntLiteral): finished the implementation.
20466 * statement.cs (SwitchLabel): Convert the value we are using as a
20467 key before looking up the table.
20469 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20471 * codegen.cs (EmitTopBlock): Require a Location argument now.
20473 * cs-parser.jay (constructor_declarator): We need to setup
20474 current_local_parameters before we parse the
20475 opt_constructor_initializer, to allow the variables to be bound
20476 to the constructor arguments.
20478 * rootcontext.cs (LookupType): First lookup nested classes in our
20479 class and our parents before we go looking outside our class.
20481 * expression.cs (ConstantFold): Extract/debox the values at the
20484 * rootcontext.cs (EmitCode): Resolve the constants first before we
20485 resolve the types. This is not really needed, but it helps debugging.
20487 * statement.cs: report location.
20489 * cs-parser.jay: pass location to throw statement.
20491 * driver.cs: Small bug fix.
20493 * report.cs: Updated format to be 4-zero filled digits.
20495 2001-12-22 Ravi Pratap <ravi@ximian.com>
20497 * expression.cs (CheckIndices): Fix minor bug where the wrong
20498 variable was being referred to ;-)
20500 (DoEmit): Do not call EmitStaticInitializers when the
20501 underlying type is System.Object.
20503 2001-12-21 Ravi Pratap <ravi@ximian.com>
20505 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20506 and do the usual workaround for SRE.
20508 * class.cs (MyEventBuilder.EventType): New member to get at the type
20509 of the event, quickly.
20511 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20513 * assign.cs (Assign.DoResolve): Handle the case when the target
20514 is an EventExpr and perform the necessary checks.
20516 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20519 (SimpleName.MemberStaticCheck): Include check for EventExpr.
20521 (EventExpr): Set the type in the constructor itself since we
20522 are meant to be born fully resolved.
20524 (EventExpr.Define): Revert code I wrote earlier.
20526 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20527 instance expression is null. The instance expression is a This in that case
20528 or a null, depending on whether it is a static method or not.
20530 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20531 refers to more than one method.
20533 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20534 and accordingly flag errors.
20536 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20538 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20540 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20542 * location.cs (ToString): Provide useful rutine.
20544 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20546 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20547 objects, return the actual integral boxed.
20549 * statement.cs (SwitchLabel): define an ILLabel for each
20552 (Switch.CheckSwitch): If the value is a Literal, extract
20553 the underlying literal.
20555 Also in the unused hashtable we had, add the SwitchLabel so we can
20556 quickly look this value up.
20558 * constant.cs: Implement a bunch of new constants. Rewrite
20559 Literal based on this. Made changes everywhere to adapt to this.
20561 * expression.cs (Expression.MakeByteBlob): Optimize routine by
20562 dereferencing array only once, and also copes with enumrations.
20564 bytes are two bytes wide, not one.
20566 (Cast): Perform constant conversions.
20568 * ecore.cs (TryImplicitIntConversion): Return literals instead of
20569 wrappers to the literals here.
20571 * expression.cs (DoNumericPromotions): long literals can converted
20572 to ulong implicity (this is taken care of elsewhere, but I was
20573 missing this spot).
20575 * ecore.cs (Expression.Literalize): Make the return type Literal,
20576 to improve type checking.
20578 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20580 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20582 * literal.cs: Revert code from ravi that checked the bounds. The
20583 bounds are sane by the definition of the type itself.
20585 * typemanager.cs: Fix implementation of ImplementsInterface. We
20586 need to actually look up in our parent hierarchy for interfaces
20589 * const.cs: Use the underlying type for enumerations
20591 * delegate.cs: Compute the basename for the delegate creation,
20592 that should fix the delegate test case, and restore the correct
20593 Type Lookup semantics in rootcontext
20595 * rootcontext.cs: Revert Ravi's last patch. The correct way of
20596 referencing a nested type with the Reflection API is using the "+"
20599 * cs-parser.jay: Do not require EOF token at the end.
20601 2001-12-20 Ravi Pratap <ravi@ximian.com>
20603 * rootcontext.cs (LookupType): Concatenate type names with
20604 a '.' instead of a '+' The test suite passes again.
20606 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20607 field of the enumeration.
20609 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20610 the case when the member is an EventExpr.
20612 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20613 static has an associated instance expression.
20615 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20617 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20619 * class.cs (Event.Define): Register event and perform appropriate checks
20622 We define the Add and Remove methods even if the use provides none because
20623 in that case, we provide default implementations ourselves.
20625 Define a private field of the type of the event. This is done by the CSC compiler
20626 and we should be doing it too ;-)
20628 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20629 More methods we use in code we generate.
20631 (multicast_delegate_type, delegate_type): Two separate types since the distinction
20634 (InitCoreTypes): Update accordingly for the above.
20636 * class.cs (Event.Emit): Generate code for default accessors that we provide
20638 (EmitDefaultMethod): Do the job in the above.
20640 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
20643 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20645 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20646 builders even if we were missing one.
20648 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20649 pass the Basename as our class name instead of the Name. The
20650 basename will be correctly composed for us.
20652 * parameter.cs (Paramters): Now takes a Location argument.
20654 * decl.cs (DeclSpace.LookupType): Removed convenience function and
20655 make all the code call directly LookupType in RootContext and take
20656 this chance to pass the Location information everywhere.
20658 * Everywhere: pass Location information.
20660 2001-12-19 Miguel de Icaza <miguel@ximian.com>
20662 * class.cs (Constructor.Define): Updated way of detecting the
20663 length of the parameters.
20665 (TypeContainer.DefineType): Use basename as the type name for
20668 (TypeContainer.Define): Do not recursively define types here, as
20669 definition is taken care in order by the RootContext.
20671 * tree.cs: Keep track of namespaces in a per-file basis.
20673 * parameter.cs (Parameter.ComputeSignature): Update to use
20676 (Parameters.GetSignature): ditto.
20678 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20679 instead of a TypeContainer.
20681 (Interface.SemanticAnalysis): Use `this' instead of our parent to
20682 resolve names. Because we need to be resolve in our context, not
20685 * driver.cs: Implement response files.
20687 * class.cs (TypeContainer.DefineType): If we are defined, do not
20688 redefine ourselves.
20690 (Event.Emit): Emit the code for add/remove handlers.
20691 (Event.Define): Save the MethodBuilders for add/remove.
20693 * typemanager.cs: Use pair here too.
20695 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20696 DictionaryEntry requires the first argument to be non-null.
20698 (enum_declaration): Compute full name for registering the
20701 (delegate_declaration): Instead of using
20702 formal_parameter_list, use opt_formal_parameter_list as the list
20705 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20706 (EventParsing): New property that controls whether `add' and
20707 `remove' are returned as tokens or identifiers (for events);
20709 2001-12-19 Ravi Pratap <ravi@ximian.com>
20711 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20712 use MyEventBuilder only and let it wrap the real builder for us.
20714 (MyEventBuilder): Revamp constructor etc.
20716 Implement all operations that we perform on EventBuilder in precisely the same
20719 (FindMembers): Update to use the EventBuilder member.
20721 (Event.Emit): Update accordingly.
20723 2001-12-18 Ravi Pratap <ravi@ximian.com>
20725 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20726 by calling the appropriate methods.
20728 (GetCustomAttributes): Make stubs as they cannot possibly do anything
20731 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20733 2001-12-17 Ravi Pratap <ravi@ximian.com>
20735 * delegate.cs (Delegate.Populate): Check that the return type
20736 and various parameters types are indeed accessible.
20738 * class.cs (Constructor.Define): Same here.
20740 (Field.Define): Ditto.
20742 (Event.Define): Ditto.
20744 (Operator.Define): Check that the underlying Method defined itself
20745 correctly - so it's MethodBuilder should not be null.
20747 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20748 expression happens to be null.
20750 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20751 members but as of now we don't seem to be able to do anything really useful with it.
20753 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20754 not the EventBuilder.
20756 2001-12-18 Miguel de Icaza <miguel@ximian.com>
20758 * cs-tokenizer.cs: Add support for defines.
20759 Add support for #if, #elif, #else, #endif
20761 (eval_var): evaluates a variable.
20762 (eval): stubbed for evaluating functions.
20764 * cs-parser.jay: Pass the defines information
20766 * driver.cs: Add --define command line option.
20768 * decl.cs: Move MemberCore here.
20770 Make it the base class for DeclSpace. This allows us to catch and
20771 report 108 and 109 for everything now.
20773 * class.cs (TypeContainer.Define): Extract all the members
20774 before populating and emit the warning 108 (new keyword required
20775 to override) instead of having each member implement this.
20777 (MemberCore.Define): New abstract method, we will be using this in
20778 the warning reporting engine in Populate.
20780 (Operator.Define): Adjust to new MemberCore protocol.
20782 * const.cs (Const): This does not derive from Expression, it is a
20783 temporary object we use to create fields, it is a MemberCore.
20785 * class.cs (Method.Define): Allow the entry point to be in a
20788 * driver.cs: Rewrite the argument handler to clean it up a bit.
20790 * rootcontext.cs: Made it just an auxiliary namespace feature by
20791 making everything static.
20793 * driver.cs: Adapt code to use RootContext type name instead of
20796 * delegate.cs: Remove RootContext argument.
20798 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20801 * class.cs (Event.Define): The lookup can fail.
20803 * cs-tokenizer.cs: Begin implementation of pre-procesor.
20805 * expression.cs: Resolve the this instance before invoking the code.
20807 2001-12-17 Miguel de Icaza <miguel@ximian.com>
20809 * cs-parser.jay: Add a production in element_access that allows
20810 the thing to become a "type" reference. This way we can parse
20811 things like "(string [])" as a type.
20813 Note that this still does not handle the more complex rules of
20817 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
20819 * ecore.cs: (CopyNewMethods): new utility function used to
20820 assemble the list of methods from running FindMembers.
20822 (MemberLookup): Rework FindMembers so that
20824 2001-12-16 Miguel de Icaza <miguel@ximian.com>
20826 * class.cs (TypeContainer): Remove Delegates who fail to be
20829 * delegate.cs (Populate): Verify that we dont get null return
20830 values. TODO: Check for AsAccessible.
20832 * cs-parser.jay: Use basename to emit error 574 (destructor should
20833 have the same name as container class), not the full name.
20835 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20836 possible representation.
20838 Also implements integer type suffixes U and L.
20840 2001-12-15 Miguel de Icaza <miguel@ximian.com>
20842 * expression.cs (ArrayCreation.DoResolve): We need to do the
20843 argument resolution *always*.
20845 * decl.cs: Make this hold the namespace. Hold the root context as
20847 (LookupType): Move here.
20849 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20851 * location.cs (Row, Name): Fixed the code, it was always returning
20852 references to the first file.
20854 * interface.cs: Register properties defined through interfaces.
20856 * driver.cs: Add support for globbing on the command line
20858 * class.cs (Field): Make it derive from MemberCore as well.
20861 2001-12-15 Ravi Pratap <ravi@ximian.com>
20863 * class.cs (Event::Define): Check that the type of the event is a delegate
20864 type else flag error #66.
20866 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20869 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20870 values of EntryPoint, CharSet etc etc.
20872 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20874 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20875 be null and we should ignore this. I am not sure if this is really clean. Apparently,
20876 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20877 which needs this to do its work.
20879 * ../errors/cs0066.cs : Add.
20881 2001-12-14 Miguel de Icaza <miguel@ximian.com>
20883 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20886 * class.cs: (MethodSignature.MethodSignature): Removed hack that
20887 clears out the parameters field.
20888 (MemberSignatureCompare): Cleanup
20890 (MemberCore): New base class used to share code between MethodCore
20893 (RegisterRequiredImplementations) BindingFlags.Public requires
20894 either BindingFlags.Instace or Static. Use instance here.
20896 (Property): Refactored code to cope better with the full spec.
20898 * parameter.cs (GetParameterInfo): Return an empty array instead
20901 * class.cs (Property): Abstract or extern properties have no bodies.
20903 * parameter.cs (GetParameterInfo): return a zero-sized array.
20905 * class.cs (TypeContainer.MethodModifiersValid): Move all the
20906 method modifier validation to the typecontainer so we can reuse
20907 this on properties.
20909 (MethodCore.ParameterTypes): return an empty sized array of types.
20911 (Property.Define): Test property modifier validity.
20913 Add tests for sealed/override too.
20915 (Method.Emit): abstract or extern methods have no bodies.
20917 2001-12-14 Ravi Pratap <ravi@ximian.com>
20919 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20922 (Method::Define, ::Emit): Modify accordingly.
20924 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20926 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20928 * makefile: Pass in /unsafe.
20930 2001-12-13 Miguel de Icaza <miguel@ximian.com>
20932 * class.cs (MakeKey): Kill routine.
20934 * class.cs (TypeContainer.Define): Correctly define explicit
20935 method implementations (they require the full interface name plus
20938 * typemanager.cs: Deply the PtrHashtable here and stop using the
20939 lame keys. Things work so much better.
20941 This of course broke everyone who depended on `RegisterMethod' to
20942 do the `test for existance' test. This has to be done elsewhere.
20944 * support.cs (PtrHashtable): A hashtable that avoid comparing with
20945 the object stupid Equals method (because, that like fails all over
20946 the place). We still do not use it.
20948 * class.cs (TypeContainer.SetRequiredInterface,
20949 TypeContainer.RequireMethods): Killed these two routines and moved
20950 all the functionality to RegisterRequiredImplementations.
20952 (TypeContainer.RegisterRequiredImplementations): This routine now
20953 registers all the implementations required in an array for the
20954 interfaces and abstract methods. We use an array of structures
20955 which can be computed ahead of time to reduce memory usage and we
20956 also assume that lookups are cheap as most classes will not
20957 implement too many interfaces.
20959 We also avoid creating too many MethodSignatures.
20961 (TypeContainer.IsInterfaceMethod): Update and optionally does not
20962 clear the "pending" bit if we find that there are problems with
20965 (TypeContainer.VerifyPendingMethods): Update to report errors of
20966 methods that look like implementations but are not.
20968 (TypeContainer.Define): Add support for explicit interface method
20971 2001-12-12 Miguel de Icaza <miguel@ximian.com>
20973 * typemanager.cs: Keep track of the parameters here instead of
20974 being a feature of the TypeContainer.
20976 * class.cs: Drop the registration of parameters here, as
20977 InterfaceMethods are also interface declarations.
20979 * delegate.cs: Register methods with the TypeManager not only with
20980 the TypeContainer. This code was buggy.
20982 * interface.cs: Full registation here.
20984 2001-12-11 Miguel de Icaza <miguel@ximian.com>
20986 * expression.cs: Remove reducer for binary expressions, it can not
20989 * const.cs: Put here the code that used to go into constant.cs
20991 * constant.cs: Put here the code for constants, this is a new base
20992 class for Literals.
20994 * literal.cs: Make Literal derive from Constant.
20996 2001-12-09 Miguel de Icaza <miguel@ximian.com>
20998 * statement.cs (Return.Emit): Report error 157 if the user
20999 attempts to return from a finally block.
21001 (Return.Emit): Instead of emitting a return, jump to the end of
21004 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21005 LocalBuilder to store the result of the function. ReturnLabel is
21006 the target where we jump.
21009 2001-12-09 Radek Doulik <rodo@ximian.com>
21011 * cs-parser.jay: remember alias in current namespace
21013 * ecore.cs (SimpleName::DoResolve): use aliases for types or
21016 * class.cs (LookupAlias): lookup alias in my_namespace
21018 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21020 (LookupAlias): lookup alias in this and if needed in parent
21023 2001-12-08 Miguel de Icaza <miguel@ximian.com>
21027 * rootcontext.cs: (ModuleBuilder) Made static, first step into
21028 making things static. I need this to avoid passing the
21029 TypeContainer when calling ParameterType.
21031 * support.cs (InternalParameters.ParameterType): Remove ugly hack
21032 that did string manipulation to compute the type and then call
21033 GetType. Use Parameter.ParameterType instead.
21035 * cs-tokenizer.cs: Consume the suffix for floating values.
21037 * expression.cs (ParameterReference): figure out whether this is a
21038 reference parameter or not. Kill an extra variable by computing
21039 the arg_idx during emission.
21041 * parameter.cs (Parameters.GetParameterInfo): New overloaded
21042 function that returns whether a parameter is an out/ref value or not.
21044 (Parameter.ParameterType): The type of the parameter (base,
21045 without ref/out applied).
21047 (Parameter.Resolve): Perform resolution here.
21048 (Parameter.ExternalType): The full type (with ref/out applied).
21050 * statement.cs (Using.Emit, Using.EmitExpression): Implement
21051 support for expressions on the using statement.
21053 2001-12-07 Miguel de Icaza <miguel@ximian.com>
21055 * statement.cs (Using.EmitLocalVariableDecls): Split the
21056 localvariable handling of the using statement.
21058 (Block.EmitMeta): Keep track of variable count across blocks. We
21059 were reusing slots on separate branches of blocks.
21061 (Try.Emit): Emit the general code block, we were not emitting it.
21063 Check the type of the declaration to be an IDisposable or
21064 something that can be implicity converted to it.
21066 Emit conversions if required.
21068 * ecore.cs (EmptyExpression): New utility class.
21069 (Expression.ImplicitConversionExists): New utility function.
21071 2001-12-06 Miguel de Icaza <miguel@ximian.com>
21073 * statement.cs (Using): Implement.
21075 * expression.cs (LocalVariableReference): Support read only variables.
21077 * statement.cs: Remove the explicit emit for the Leave opcode.
21078 (VariableInfo): Add a readonly field.
21080 2001-12-05 Miguel de Icaza <miguel@ximian.com>
21082 * ecore.cs (ConvCast): new class used to encapsulate the various
21083 explicit integer conversions that works in both checked and
21084 unchecked contexts.
21086 (Expression.ConvertNumericExplicit): Use new ConvCast class to
21087 properly generate the overflow opcodes.
21089 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21091 * statement.cs: The correct type for the EmptyExpression is the
21092 element_type, not the variable type. Ravi pointed this out.
21094 2001-12-04 Ravi Pratap <ravi@ximian.com>
21096 * class.cs (Method::Define): Handle PInvoke methods specially
21097 by using DefinePInvokeMethod instead of the usual one.
21099 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21100 above to do the task of extracting information and defining the method.
21102 2001-12-04 Ravi Pratap <ravi@ximian.com>
21104 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21105 of the condition for string type.
21107 (Emit): Move that here.
21109 (ArrayCreation::CheckIndices): Keep string literals in their expression
21112 (EmitDynamicInitializers): Handle strings appropriately.
21114 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21116 * codegen.cs (EmitContext): Replace multiple variables with a
21117 single pointer to the current Switch statement.
21119 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21122 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21126 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21129 (Foreach.Emit): Foreach on arrays was not setting
21130 up the loop variables (for break/continue).
21132 (GotoCase): Semi-implented.
21134 2001-12-03 Ravi Pratap <ravi@ximian.com>
21136 * attribute.cs (CheckAttribute): Handle system attributes by using
21137 Attribute.GetAttributes to examine information we need.
21139 (GetValidPlaces): Same here.
21141 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21143 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21145 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21147 (Method::Define): Set appropriate flags if we have a DllImport attribute.
21149 (Method::Emit): Handle the case when we are a PInvoke method.
21151 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21153 * expression.cs: Use ResolveWithSimpleName on compound names.
21155 2001-12-02 Ravi Pratap <ravi@ximian.com>
21157 * constant.cs (EmitConstant): Make sure we resolve the associated expression
21158 before trying to reduce it.
21160 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21162 * constant.cs (LookupConstantValue): Implement.
21164 (EmitConstant): Use the above in emitting the constant.
21166 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21167 that are user-defined by doing a LookupConstantValue on them.
21169 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21172 2001-11-29 Miguel de Icaza <miguel@ximian.com>
21174 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21176 (BaseAccess.DoResolve): Implement.
21178 (MemberAccess.DoResolve): Split this routine into a
21179 ResolveMemberAccess routine that can be used independently
21181 2001-11-28 Miguel de Icaza <miguel@ximian.com>
21183 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21184 As that share bits of the implementation. Is returns a boolean,
21185 while As returns the Type that is being probed.
21187 2001-12-01 Ravi Pratap <ravi@ximian.com>
21189 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21190 instead of a Literal - much easier.
21192 (EnumInTransit): Remove - utterly useless :-)
21194 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21196 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21198 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21199 chain when we have no associated expression.
21201 2001-11-30 Ravi Pratap <ravi@ximian.com>
21203 * constant.cs (Define): Use Location while reporting the errror.
21205 Also emit a warning when 'new' is used and there is no inherited
21208 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
21211 (LookupEnumValue): Implement to lookup an enum member's value and define it
21214 (Populate): Re-write accordingly to use the above routine.
21216 2001-11-27 Miguel de Icaza <miguel@ximian.com>
21218 * expression.cs (This): Fix prototype for DoResolveLValue to
21219 override the base class DoResolveLValue.
21221 * cs-parser.cs: Report errors cs574 and cs575 (destructor
21224 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21225 (we need to load the address of the field here). This fixes
21228 (FieldExpr.DoResolveLValue): Call the DoResolve
21229 function to initialize the Instance expression.
21231 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21232 correctly the GetEnumerator operation on a value type.
21234 * cs-parser.jay: Add more simple parsing error catches.
21236 * statement.cs (Switch): Add support for string switches.
21237 Handle null specially.
21239 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
21241 2001-11-28 Ravi Pratap <ravi@ximian.com>
21243 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21245 (declare_local_constant): New helper function.
21247 * statement.cs (AddConstant): Keep a separate record of constants
21249 (IsConstant): Implement to determine if a variable is a constant.
21251 (GetConstantExpression): Implement.
21253 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21255 * statement.cs (IsVariableDefined): Re-write.
21257 2001-11-27 Ravi Pratap <ravi@ximian.com>
21259 * class.cs (TypeContainer::FindMembers): Look for constants
21260 in the case when we are looking for MemberTypes.Field
21262 * expression.cs (MemberAccess::DoResolve): Check that in the
21263 case we are a FieldExpr and a Literal, we are not being accessed
21264 by an instance reference.
21266 * cs-parser.jay (local_constant_declaration): Implement.
21268 (declaration_statement): Implement for constant declarations.
21270 2001-11-26 Miguel de Icaza <miguel@ximian.com>
21272 * statement.cs (Switch): Catch double defaults.
21274 (Switch): More work on the switch() statement
21275 implementation. It works for integral values now, need to finish
21279 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21281 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21282 integer literals into other integer literals. To be used by
21285 2001-11-24 Ravi Pratap <ravi@ximian.com>
21287 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21290 (EmitDynamicInitializers): Cope with the above since we extract data
21291 directly from ArrayData now.
21293 (ExpectInitializers): Keep track of whether initializers are mandatory
21296 (Bounds): Make it a hashtable to prevent the same dimension being
21297 recorded for every element in that dimension.
21299 (EmitDynamicInitializers): Fix bug which prevented the Set array method
21302 Also fix bug which was causing the indices to be emitted in the reverse
21305 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21307 * expression.cs (ArrayCreation): Implement the bits that Ravi left
21308 unfinished. They do not work, because the underlying code is
21311 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21313 * cs-parser.jay: Remove bogus fixme.
21315 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21316 on Switch statement.
21318 2001-11-23 Ravi Pratap <ravi@ximian.com>
21320 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21323 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21324 parameter. Apparently, any expression is allowed.
21326 (ValidateInitializers): Update accordingly.
21328 (CheckIndices): Fix some tricky bugs thanks to recursion.
21330 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
21331 I was being completely brain-dead.
21333 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21334 and re-write acordingly.
21336 (DelegateInvocation): Re-write accordingly.
21338 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21340 (MakeByteBlob): Handle types more correctly.
21342 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21343 initialization from expressions but it is incomplete because I am a complete
21346 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21348 * statement.cs (If.Emit): Fix a bug that generated incorrect code
21349 on If. Basically, we have to return `true' (ie, we do return to
21350 our caller) only if both branches of the if return.
21352 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21353 short-circuit operators, handle them as short circuit operators.
21355 (Cast.DoResolve): Resolve type.
21356 (Cast.Cast): Take an expression as the target type.
21358 * cs-parser.jay (cast_expression): Remove old hack that only
21359 allowed a limited set of types to be handled. Now we take a
21360 unary_expression and we resolve to a type during semantic
21363 Use the grammar productions from Rhys to handle casts (this is
21364 not complete like Rhys syntax yet, we fail to handle that corner
21365 case that C# has regarding (-x), but we will get there.
21367 2001-11-22 Ravi Pratap <ravi@ximian.com>
21369 * class.cs (EmitFieldInitializer): Take care of the case when we have a
21370 field which is an array type.
21372 * cs-parser.jay (declare_local_variables): Support array initialization too.
21374 * typemanager.cs (MakeKey): Implement.
21376 (everywhere): Use the above appropriately.
21378 * cs-parser.jay (for_statement): Update for array initialization while
21379 declaring variables.
21381 * ecore.cs : The error message was correct, it's the variable's names that
21382 were misleading ;-) Make the code more readable.
21384 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21385 the correct type etc.
21387 (ConvertExplicit): Handle Enum types by examining the underlying type.
21389 2001-11-21 Ravi Pratap <ravi@ximian.com>
21391 * parameter.cs (GetCallingConvention): Always return
21392 CallingConventions.Standard for now.
21394 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21396 * expression.cs (Binary.ResolveOperator): Update the values of `l'
21397 and `r' after calling DoNumericPromotions.
21399 * ecore.cs: Fix error message (the types were in the wrong order).
21401 * statement.cs (Foreach.ProbeCollectionType): Need to pass
21402 BindingFlags.Instance as well
21404 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21405 implicit int literal conversion in an empty cast so that we
21406 propagate the right type upstream.
21408 (UnboxCast): new class used to unbox value types.
21409 (Expression.ConvertExplicit): Add explicit type conversions done
21412 (Expression.ImplicitNumericConversion): Oops, forgot to test for
21413 the target type before applying the implicit LongLiterals to ULong
21416 2001-11-21 Miguel de Icaza <miguel@ximian.com>
21418 * cs-parser.jay (for_statement): Reworked the way For works: now
21419 we declare manually any variables that are introduced in
21420 for_initializer to solve the problem of having out-of-band code
21421 emition (that is what got for broken).
21423 (declaration_statement): Perform the actual variable declaration
21424 that used to be done in local_variable_declaration here.
21426 (local_variable_declaration): Do not declare anything, just pass
21427 the information on a DictionaryEntry
21429 2001-11-20 Ravi Pratap <ravi@ximian.com>
21431 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21432 re-write of the logic to now make it recursive.
21434 (UpdateIndices): Re-write accordingly.
21436 Store element data in a separate ArrayData list in the above methods.
21438 (MakeByteBlob): Implement to dump the array data into a byte array.
21440 2001-11-19 Ravi Pratap <ravi@ximian.com>
21442 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21445 * constant.cs (Define): Implement.
21447 (EmitConstant): Re-write fully.
21449 Pass in location info.
21451 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21454 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21455 DictionaryEntry since we need location info too.
21457 (constant_declaration): Update accordingly.
21459 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21460 code into another method : UpdateIndices.
21462 2001-11-18 Ravi Pratap <ravi@ximian.com>
21464 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21465 some type checking etc.
21467 2001-11-17 Ravi Pratap <ravi@ximian.com>
21469 * expression.cs (ArrayCreation::ValidateInitializers): Implement
21470 bits to provide dimension info if the user skips doing that.
21472 Update second constructor to store the rank correctly.
21474 2001-11-16 Ravi Pratap <ravi@ximian.com>
21476 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21477 and try to implement.
21479 * ../errors/cs0150.cs : Add.
21481 * ../errors/cs0178.cs : Add.
21483 2001-11-16 Miguel de Icaza <miguel@ximian.com>
21485 * statement.cs: Implement foreach on multi-dimensional arrays.
21487 * parameter.cs (Parameters.GetParameterByName): Also lookup the
21488 name of the params argument.
21490 * expression.cs: Use EmitStoreOpcode to get the right opcode while
21491 initializing the array.
21493 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21494 we can use this elsewhere.
21496 * statement.cs: Finish implementation of foreach for single
21499 * cs-parser.jay: Use an out-of-band stack to pass information
21500 around, I wonder why I need this.
21502 foreach_block: Make the new foreach_block the current_block.
21504 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21505 function used to return a static Parameters structure. Used for
21506 empty parameters, as those are created very frequently.
21508 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21510 2001-11-15 Ravi Pratap <ravi@ximian.com>
21512 * interface.cs : Default modifier is private, not public. The
21513 make verify test passes again.
21515 2001-11-15 Ravi Pratap <ravi@ximian.com>
21517 * support.cs (ReflectionParameters): Fix logic to determine
21518 whether the last parameter is a params one. Test 9 passes again.
21520 * delegate.cs (Populate): Register the builders we define with
21521 RegisterParameterForBuilder. Test 19 passes again.
21523 * cs-parser.jay (property_declaration): Reference $6 instead
21524 of $$ to get at the location.
21526 (indexer_declaration): Similar stuff.
21528 (attribute): Ditto.
21530 * class.cs (Property): Register parameters for the Get and Set methods
21531 if they exist. Test 23 passes again.
21533 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21534 call to EmitArguments as we are sure there aren't any params arguments.
21535 Test 32 passes again.
21537 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21538 IndexOutOfRangeException.
21540 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21541 Test 33 now passes again.
21543 2001-11-15 Miguel de Icaza <miguel@ximian.com>
21545 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21546 broke a bunch of things. Will have to come up with a better way
21547 of tracking locations.
21549 * statement.cs: Implemented foreach for single dimension arrays.
21551 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21553 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21554 an error. This removes the lookup from the critical path.
21556 * cs-parser.jay: Removed use of temporary_loc, which is completely
21559 2001-11-14 Miguel de Icaza <miguel@ximian.com>
21561 * support.cs (ReflectionParameters.ParameterModifier): Report
21562 whether the argument is a PARAMS argument or not.
21564 * class.cs: Set the attribute `ParamArrayAttribute' on the
21565 parameter argument.
21567 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21568 and cons_param_array_attribute (ConstructorInfo for
21569 ParamArrayAttribute).,
21571 * codegen.cs: Emit the return using the `Return' statement, that
21572 way we can report the error correctly for missing return values.
21574 * class.cs (Method.Emit): Clean up.
21576 * expression.cs (Argument.Resolve): Take another argument: the
21577 location where this argument is used. Notice that this is not
21578 part of the "Argument" class as to reduce the size of the
21579 structure (we know the approximate location anyways).
21581 Test if the argument is a variable-reference, if not, then
21582 complain with a 206.
21584 (Argument.Emit): Emit addresses of variables.
21586 (Argument.FullDesc): Simplify.
21588 (Invocation.DoResolve): Update for Argument.Resolve.
21590 (ElementAccess.DoResolve): ditto.
21592 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21593 method should be virtual, as this method is always virtual.
21595 (NewDelegate.DoResolve): Update for Argument.Resolve.
21597 * class.cs (ConstructorInitializer.DoResolve): ditto.
21599 * attribute.cs (Attribute.Resolve): ditto.
21601 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21603 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21605 * expression.cs (ParameterReference): Drop IStackStorage and implement
21606 IAssignMethod instead.
21608 (LocalVariableReference): ditto.
21610 * ecore.cs (FieldExpr): Drop IStackStorage and implement
21611 IAssignMethod instead.
21613 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21615 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21616 enumerations that are used in heavily used structures derive from
21617 byte in a laughable and pathetic attempt to reduce memory usage.
21618 This is the kind of pre-optimzations that you should not do at
21619 home without adult supervision.
21621 * expression.cs (UnaryMutator): New class, used to handle ++ and
21622 -- separatedly from the other unary operators. Cleans up the
21623 code, and kills the ExpressionStatement dependency in Unary.
21625 (Unary): Removed `method' and `Arguments' from this class, making
21626 it smaller, and moving it all to SimpleCall, so I can reuse this
21627 code in other locations and avoid creating a lot of transient data
21628 strucutres when not required.
21630 * cs-parser.jay: Adjust for new changes.
21632 2001-11-11 Miguel de Icaza <miguel@ximian.com>
21634 * enum.cs (Enum.Populate): If there is a failure during
21637 * cs-parser.jay (opt_enum_base): we used to catch type errors
21638 here, but this is really incorrect. The type error should be
21639 catched during semantic analysis.
21641 2001-12-11 Ravi Pratap <ravi@ximian.com>
21643 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21644 current_local_parameters as expected since I, in my stupidity, had forgotten
21647 * attribute.cs (GetValidPlaces): Fix stupid bug.
21649 * class.cs (Method::Emit): Perform check on applicability of attributes.
21651 (Constructor::Emit): Ditto.
21653 (Field::Emit): Ditto.
21655 (Field.Location): Store location information.
21657 (Property, Event, Indexer, Operator): Ditto.
21659 * cs-parser.jay (field_declaration): Pass in location for each field.
21661 * ../errors/cs0592.cs : Add.
21663 2001-11-12 Ravi Pratap <ravi@ximian.com>
21665 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21667 (InitCoreTypes): Update accordingly.
21669 (RegisterAttrType, LookupAttr): Implement.
21671 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21672 info about the same.
21674 (Resolve): Update to populate the above as necessary.
21676 (Error592): Helper.
21678 (GetValidPlaces): Helper to the above.
21680 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21682 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21684 2001-11-12 Ravi Pratap <ravi@ximian.com>
21686 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21688 * ../errors/cs0617.cs : Add.
21690 2001-11-11 Ravi Pratap <ravi@ximian.com>
21692 * enum.cs (Emit): Rename to Populate to be more consistent with what
21693 we expect it to do and when exactly it is called.
21695 * class.cs, rootcontext.cs : Update accordingly.
21697 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21698 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21700 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21702 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21703 of a fieldinfo using the above, when dealing with a FieldBuilder.
21705 2001-11-10 Ravi Pratap <ravi@ximian.com>
21707 * ../errors/cs0031.cs : Add.
21709 * ../errors/cs1008.cs : Add.
21711 * ../errrors/cs0543.cs : Add.
21713 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21716 (FindMembers): Implement.
21718 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21719 enums and delegates too.
21721 (enum_types): Rename to builder_to_enum.
21723 (delegate_types): Rename to builder_to_delegate.
21725 * delegate.cs (FindMembers): Implement.
21727 2001-11-09 Ravi Pratap <ravi@ximian.com>
21729 * typemanager.cs (IsEnumType): Implement.
21731 * enum.cs (Emit): Re-write parts to account for the underlying type
21732 better and perform checking etc.
21734 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21735 of the underlying type.
21737 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21740 * enum.cs (error31): Helper to report error #31.
21742 * cs-parser.jay (enum_declaration): Store location of each member too.
21744 * enum.cs (member_to_location): New hashtable.
21746 (AddEnumMember): Update location hashtable.
21748 (Emit): Use the location of each member while reporting errors.
21750 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21752 * cs-parser.jay: A for_initializer if is a
21753 local_variable_declaration really ammount to have an implicit
21754 block with the variable declaration and no initializer for for.
21756 * statement.cs (For.Emit): Cope with null initializers.
21758 This fixes the infinite loop on for initializers.
21760 2001-11-08 Miguel de Icaza <miguel@ximian.com>
21762 * enum.cs: More cleanup.
21764 * ecore.cs: Remove dead code.
21766 * class.cs (Property.Emit): More simplification.
21767 (Event.Emit): ditto.
21769 Reworked to have less levels of indentation.
21771 2001-11-08 Ravi Pratap <ravi@ximian.com>
21773 * class.cs (Property): Emit attributes.
21783 * enum.cs (Emit): Ditto.
21785 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21788 * class.cs (Field, Event, etc.): Move attribute generation into the
21789 Emit method everywhere.
21791 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21792 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21793 as we had no way of defining nested enums !
21795 * rootcontext.cs : Adjust code accordingly.
21797 * typemanager.cs (AddEnumType): To keep track of enum types separately.
21799 2001-11-07 Ravi Pratap <ravi@ximian.com>
21801 * expression.cs (EvalConstantExpression): Move into ecore.cs
21803 * enum.cs (Enum): Rename some members and make them public and readonly
21804 according to our convention.
21806 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21809 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21811 (Enum::Emit): Write a simple version for now which doesn't try to compute
21812 expressions. I shall modify this to be more robust in just a while.
21814 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21816 (TypeContainer::CloseType): Create the Enum types too.
21818 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21820 * expression.cs (EvalConstantExpression): Get rid of completely.
21822 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21823 user-defined values and other cases.
21825 (IsValidEnumLiteral): Helper function.
21827 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
21828 out there in the case we had a literal FieldExpr.
21830 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21832 (Literalize): Revamp a bit to take two arguments.
21834 (EnumLiteral): New class which derives from Literal to wrap enum literals.
21836 2001-11-06 Ravi Pratap <ravi@ximian.com>
21838 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21840 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21842 (Resolve): Use the above to ensure we have proper initializers.
21844 2001-11-05 Ravi Pratap <ravi@ximian.com>
21846 * expression.cs (Expression::EvalConstantExpression): New method to
21847 evaluate constant expressions.
21849 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21851 2001-11-07 Miguel de Icaza <miguel@ximian.com>
21853 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21856 (Binary.ResolveOperator): Handle operator != (object a, object b)
21857 and operator == (object a, object b);
21859 (Binary.DoNumericPromotions): Indicate whether the numeric
21860 promotion was possible.
21862 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21865 Made the ArrayAccess implement interface IAssignMethod instead of
21866 IStackStore as the order in which arguments are passed reflects
21869 * assign.cs: Instead of using expr.ExprClass to select the way of
21870 assinging, probe for the IStackStore/IAssignMethod interfaces.
21872 * typemanager.cs: Load InitializeArray definition.
21874 * rootcontext.cs (RootContext.MakeStaticData): Used to define
21875 static data that can be used to initialize arrays.
21877 2001-11-05 Miguel de Icaza <miguel@ximian.com>
21879 * expression.cs: Handle operator== and operator!= for booleans.
21881 (Conditioal.Reduce): Implement reducer for the ?: operator.
21883 (Conditional.Resolve): Implement dead code elimination.
21885 (Binary.Resolve): Catch string literals and return a new
21886 concatenated string.
21888 (Unary.Reduce): Implement reduction of unary expressions.
21890 * ecore.cs: Split out the expression core handling here.
21892 (Expression.Reduce): New method used to perform constant folding
21893 and CSE. This is needed to support constant-expressions.
21895 * statement.cs (Statement.EmitBoolExpression): Pass true and false
21896 targets, and optimize for !x.
21898 2001-11-04 Ravi Pratap <ravi@ximian.com>
21900 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21901 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21902 set custom atttributes.
21904 * literal.cs (Literal::GetValue): New abstract method to return the actual
21905 value of the literal, cast as an object.
21907 (*Literal): Implement GetValue method.
21909 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21910 expressions to the arraylist but objects of type Argument.
21912 * class.cs (TypeContainer::Emit): Emit our attributes too.
21914 (Method::Emit, Constructor::Emit): Ditto.
21916 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21917 to be ignoring earlier.
21919 2001-11-03 Ravi Pratap <ravi@ximian.com>
21921 * attribute.cs (AttributeSection::Define): Implement to do the business
21922 of constructing a CustomAttributeBuilder.
21924 (Attribute): New trivial class. Increases readability of code.
21926 * cs-parser.jay : Update accordingly.
21928 (positional_argument_list, named_argument_list, named_argument): New rules
21930 (attribute_arguments): Use the above so that we are more correct.
21932 2001-11-02 Ravi Pratap <ravi@ximian.com>
21934 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21935 to perform all checks for a method with a params parameter.
21937 (Invocation::OverloadResolve): Update to use the above method and therefore
21938 cope correctly with params method invocations.
21940 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
21943 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21944 constructors in our parent too because we can't afford to miss out on
21947 * attribute.cs (AttributeSection): New name for the class Attribute
21949 Other trivial changes to improve readability.
21951 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21952 use the new class names.
21954 2001-11-01 Ravi Pratap <ravi@ximian.com>
21956 * class.cs (Method::Define): Complete definition for params types too
21958 (Indexer::Define): Ditto.
21960 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21961 Cope everywhere with a request for info about the array parameter.
21963 2001-11-01 Ravi Pratap <ravi@ximian.com>
21965 * tree.cs (RecordNamespace): Fix up to check for the correct key.
21967 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
21968 local_variable_type to extract the string corresponding to the type.
21970 (local_variable_type): Fixup the action to use the new helper method.
21972 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
21975 * expression.cs : Clean out code which uses the above.
21977 2001-10-31 Ravi Pratap <ravi@ximian.com>
21979 * typemanager.cs (RegisterMethod): Check if we already have an existing key
21980 and bale out if necessary by returning a false.
21982 (RegisterProperty): Ditto.
21984 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21985 and print out appropriate error messages.
21987 * interface.cs (everywhere): Ditto.
21989 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21990 location to constructor.
21992 * class.cs (Property, Event, Indexer): Update accordingly.
21994 * ../errors/cs111.cs : Added.
21996 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21997 of a method, as laid down by the spec.
21999 (Invocation::OverloadResolve): Use the above method.
22001 2001-10-31 Ravi Pratap <ravi@ximian.com>
22003 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22004 now take a TypeContainer and a Parameters object.
22006 (ParameterData): Modify return type of ParameterModifier method to be
22007 Parameter.Modifier and not a string.
22009 (ReflectionParameters, InternalParameters): Update accordingly.
22011 * expression.cs (Argument::GetParameterModifier): Same here.
22013 * support.cs (InternalParameters::ParameterType): Find a better way of determining
22014 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22015 symbol in it at all so maybe this is only for now.
22017 2001-10-30 Ravi Pratap <ravi@ximian.com>
22019 * support.cs (InternalParameters): Constructor now takes an extra argument
22020 which is the actual Parameters class.
22022 (ParameterDesc): Update to provide info on ref/out modifiers.
22024 * class.cs (everywhere): Update call to InternalParameters to pass in
22025 the second argument too.
22027 * support.cs (ParameterData): Add ParameterModifier, which is a method
22028 to return the modifier info [ref/out etc]
22030 (InternalParameters, ReflectionParameters): Implement the above.
22032 * expression.cs (Argument::ParameterModifier): Similar function to return
22033 info about the argument's modifiers.
22035 (Invocation::OverloadResolve): Update to take into account matching modifiers
22038 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22039 a new SetFormalParameters object which we pass to InternalParameters.
22041 2001-10-30 Ravi Pratap <ravi@ximian.com>
22043 * expression.cs (NewArray): Merge into the ArrayCreation class.
22045 2001-10-29 Ravi Pratap <ravi@ximian.com>
22047 * expression.cs (NewArray): Merge classes NewBuiltinArray and
22048 NewUserdefinedArray into one as there wasn't much of a use in having
22051 * expression.cs (Argument): Change field's name to ArgType from Type.
22053 (Type): New readonly property which returns the proper type, taking into
22054 account ref/out modifiers.
22056 (everywhere): Adjust code accordingly for the above.
22058 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22059 whether we are emitting for a ref or out parameter.
22061 * expression.cs (Argument::Emit): Use the above field to set the state.
22063 (LocalVariableReference::Emit): Update to honour the flag and emit the
22066 * parameter.cs (Attributes): Set the correct flags for ref parameters.
22068 * expression.cs (Argument::FullDesc): New function to provide a full desc.
22070 * support.cs (ParameterData): Add method ParameterDesc to the interface.
22072 (ReflectionParameters, InternalParameters): Implement the above method.
22074 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22077 (Invocation::FullMethodDesc): Ditto.
22079 2001-10-29 Miguel de Icaza <miguel@ximian.com>
22081 * cs-parser.jay: Add extra production for the second form of array
22084 * expression.cs (ArrayCreation): Update to reflect the above
22087 * Small changes to prepare for Array initialization.
22089 2001-10-28 Miguel de Icaza <miguel@ximian.com>
22091 * typemanager.cs (ImplementsInterface): interface might be null;
22092 Deal with this problem;
22094 Also, we do store negative hits on the cache (null values), so use
22095 this instead of calling t.GetInterfaces on the type everytime.
22097 2001-10-28 Ravi Pratap <ravi@ximian.com>
22099 * typemanager.cs (IsBuiltinType): New method to help determine the same.
22101 * expression.cs (New::DoResolve): Get rid of array creation code and instead
22102 split functionality out into different classes.
22104 (New::FormArrayType): Move into NewBuiltinArray.
22106 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22109 (NewBuiltinArray): New class to handle creation of built-in arrays.
22111 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22112 account creation of one-dimensional arrays.
22114 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22116 (NewUserdefinedArray::DoResolve): Implement.
22118 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22120 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22121 we maintain inside the TypeManager. This is necessary to perform lookups on the
22124 (LookupType): Update to perform GetType on the module builders too.
22126 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22128 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22130 2001-10-23 Ravi Pratap <ravi@ximian.com>
22132 * expression.cs (New::DoResolve): Implement guts of array creation.
22134 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22136 2001-10-27 Miguel de Icaza <miguel@ximian.com>
22138 * expression.cs: Fix bug I introduced lsat night that broke
22141 (Expression.Resolve): Report a 246 error (can not resolve name)
22142 if we find a SimpleName in the stream.
22144 (Expression.ResolveLValue): Ditto.
22146 (Expression.ResolveWithSimpleName): This function is a variant of
22147 ResolveName, this one allows SimpleNames to be returned without a
22148 warning. The only consumer of SimpleNames is MemberAccess
22150 2001-10-26 Miguel de Icaza <miguel@ximian.com>
22152 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22153 might arrive here. I have my doubts that this is correct.
22155 * statement.cs (Lock): Implement lock statement.
22157 * cs-parser.jay: Small fixes to support `lock' and `using'
22159 * cs-tokenizer.cs: Remove extra space
22161 * driver.cs: New flag --checked, allows to turn on integer math
22164 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22165 Threading.Monitor.Exit
22167 2001-10-23 Miguel de Icaza <miguel@ximian.com>
22169 * expression.cs (IndexerAccess::DoResolveLValue): Set the
22170 Expression Class to be IndexerAccess.
22172 Notice that Indexer::DoResolve sets the eclass to Value.
22174 2001-10-22 Miguel de Icaza <miguel@ximian.com>
22176 * class.cs (TypeContainer::Emit): Emit code for indexers.
22178 * assign.cs (IAssignMethod): New interface implemented by Indexers
22179 and Properties for handling assignment.
22181 (Assign::Emit): Simplify and reuse code.
22183 * expression.cs (IndexerAccess, PropertyExpr): Implement
22184 IAssignMethod, clean up old code.
22186 2001-10-22 Ravi Pratap <ravi@ximian.com>
22188 * typemanager.cs (ImplementsInterface): New method to determine if a type
22189 implements a given interface. Provides a nice cache too.
22191 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22194 (ConvertReferenceExplicit): Ditto.
22196 * delegate.cs (Delegate::Populate): Update to define the parameters on the
22197 various methods, with correct names etc.
22199 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
22200 Operator.UnaryNegation.
22202 * cs-parser.jay (operator_declarator): Be a little clever in the case where
22203 we have a unary plus or minus operator.
22205 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
22208 * everywhere : update accordingly.
22210 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22213 * class.cs (Method::Define): For the case where we are implementing a method
22214 inherited from an interface, we need to set the MethodAttributes.Final flag too.
22215 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22217 2001-10-21 Ravi Pratap <ravi@ximian.com>
22219 * interface.cs (FindMembers): Implement to work around S.R.E
22222 * typemanager.cs (IsInterfaceType): Implement.
22224 (FindMembers): Update to handle interface types too.
22226 * expression.cs (ImplicitReferenceConversion): Re-write bits which
22227 use IsAssignableFrom as that is not correct - it doesn't work.
22229 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22230 and accordingly override EmitStatement.
22232 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22233 using the correct logic :-)
22235 2001-10-19 Ravi Pratap <ravi@ximian.com>
22237 * ../errors/cs-11.cs : Add to demonstrate error -11
22239 2001-10-17 Miguel de Icaza <miguel@ximian.com>
22241 * assign.cs (Assign::Resolve): Resolve right hand side first, and
22242 then pass this as a hint to ResolveLValue.
22244 * expression.cs (FieldExpr): Add Location information
22246 (FieldExpr::LValueResolve): Report assignment to readonly
22249 (Expression::ExprClassFromMemberInfo): Pass location information.
22251 (Expression::ResolveLValue): Add new method that resolves an
22254 (Expression::DoResolveLValue): Default invocation calls
22257 (Indexers): New class used to keep track of indexers in a given
22260 (IStackStore): Renamed from LValue, as it did not really describe
22261 what this did. Also ResolveLValue is gone from this interface and
22262 now is part of Expression.
22264 (ElementAccess): Depending on the element access type
22266 * typemanager.cs: Add `indexer_name_type' as a Core type
22267 (System.Runtime.CompilerServices.IndexerNameAttribute)
22269 * statement.cs (Goto): Take a location.
22271 2001-10-18 Ravi Pratap <ravi@ximian.com>
22273 * delegate.cs (Delegate::VerifyDelegate): New method to verify
22274 if two delegates are compatible.
22276 (NewDelegate::DoResolve): Update to take care of the case when
22277 we instantiate a delegate from another delegate.
22279 * typemanager.cs (FindMembers): Don't even try to look up members
22280 of Delegate types for now.
22282 2001-10-18 Ravi Pratap <ravi@ximian.com>
22284 * delegate.cs (NewDelegate): New class to take care of delegate
22287 * expression.cs (New): Split the delegate related code out into
22288 the NewDelegate class.
22290 * delegate.cs (DelegateInvocation): New class to handle delegate
22293 * expression.cs (Invocation): Split out delegate related code into
22294 the DelegateInvocation class.
22296 2001-10-17 Ravi Pratap <ravi@ximian.com>
22298 * expression.cs (New::DoResolve): Implement delegate creation fully
22299 and according to the spec.
22301 (New::DoEmit): Update to handle delegates differently.
22303 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22304 because of which we were printing out arguments in reverse order !
22306 * delegate.cs (VerifyMethod): Implement to check if the given method
22307 matches the delegate.
22309 (FullDelegateDesc): Implement.
22311 (VerifyApplicability): Implement.
22313 * expression.cs (Invocation::DoResolve): Update to accordingly handle
22314 delegate invocations too.
22316 (Invocation::Emit): Ditto.
22318 * ../errors/cs1593.cs : Added.
22320 * ../errors/cs1594.cs : Added.
22322 * delegate.cs (InstanceExpression, TargetMethod): New properties.
22324 2001-10-16 Ravi Pratap <ravi@ximian.com>
22326 * typemanager.cs (intptr_type): Core type for System.IntPtr
22328 (InitCoreTypes): Update for the same.
22330 (iasyncresult_type, asynccallback_type): Ditto.
22332 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22335 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22338 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22339 the builders for the 4 members of a delegate type :-)
22341 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22344 * expression.cs (New::DoResolve): Implement guts for delegate creation.
22346 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22348 2001-10-15 Miguel de Icaza <miguel@ximian.com>
22350 * statement.cs (Break::Emit): Implement.
22351 (Continue::Emit): Implement.
22353 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
22354 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
22355 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
22356 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
22359 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22360 properties that track the label for the current loop (begin of the
22361 loop and end of the loop).
22363 2001-10-15 Ravi Pratap <ravi@ximian.com>
22365 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22366 use of emitting anything at all.
22368 * class.cs, rootcontext.cs : Get rid of calls to the same.
22370 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22372 (Populate): Define the constructor correctly and set the implementation
22375 * typemanager.cs (delegate_types): New hashtable to hold delegates that
22378 (AddDelegateType): Implement.
22380 (IsDelegateType): Implement helper method.
22382 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22384 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22385 and accordingly handle it.
22387 * delegate.cs (Populate): Take TypeContainer argument.
22388 Implement bits to define the Invoke method. However, I still haven't figured out
22389 how to take care of the native int bit :-(
22391 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
22392 Qualify the name of the delegate, not its return type !
22394 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22397 (StandardConversionExists): Checking for array types turns out to be recursive.
22399 (ConvertReferenceExplicit): Implement array conversion.
22401 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22403 2001-10-12 Ravi Pratap <ravi@ximian.com>
22405 * cs-parser.jay (delegate_declaration): Store the fully qualified
22406 name as it is a type declaration.
22408 * delegate.cs (ReturnType, Name): Rename members to these. Make them
22411 (DefineDelegate): Renamed from Define. Does the same thing essentially,
22412 as TypeContainer::DefineType.
22414 (Populate): Method in which all the definition of the various methods (Invoke)
22417 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22420 (CloseDelegate): Finally creates the delegate.
22422 * class.cs (TypeContainer::DefineType): Update to define delegates.
22423 (Populate, Emit and CloseType): Do the same thing here too.
22425 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22426 delegates in all these operations.
22428 2001-10-14 Miguel de Icaza <miguel@ximian.com>
22430 * expression.cs: LocalTemporary: a new expression used to
22431 reference a temporary that has been created.
22433 * assign.cs: Handle PropertyAccess back here, so that we can
22434 provide the proper semantic access to properties.
22436 * expression.cs (Expression::ConvertReferenceExplicit): Implement
22437 a few more explicit conversions.
22439 * modifiers.cs: `NEW' modifier maps to HideBySig.
22441 * expression.cs (PropertyExpr): Make this into an
22442 ExpressionStatement, and support the EmitStatement code path.
22444 Perform get/set error checking, clean up the interface.
22446 * assign.cs: recognize PropertyExprs as targets, and if so, turn
22447 them into toplevel access objects.
22449 2001-10-12 Miguel de Icaza <miguel@ximian.com>
22451 * expression.cs: PropertyExpr::PropertyExpr: use work around the
22454 * typemanager.cs: Keep track here of our PropertyBuilders again to
22455 work around lameness in SRE.
22457 2001-10-11 Miguel de Icaza <miguel@ximian.com>
22459 * expression.cs (LValue::LValueResolve): New method in the
22460 interface, used to perform a second resolution pass for LValues.
22462 (This::DoResolve): Catch the use of this in static methods.
22464 (This::LValueResolve): Implement.
22466 (This::Store): Remove warning, assigning to `this' in structures
22469 (Invocation::Emit): Deal with invocation of
22470 methods on value types. We need to pass the address to structure
22471 methods rather than the object itself. (The equivalent code to
22472 emit "this" for structures leaves the entire structure on the
22473 stack instead of a pointer to it).
22475 (ParameterReference::DoResolve): Compute the real index for the
22476 argument based on whether the method takes or not a `this' pointer
22477 (ie, the method is static).
22479 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22480 value types returned from functions when we need to invoke a
22481 method on the sturcture.
22484 2001-10-11 Ravi Pratap <ravi@ximian.com>
22486 * class.cs (TypeContainer::DefineType): Method to actually do the business of
22487 defining the type in the Modulebuilder or Typebuilder. This is to take
22488 care of nested types which need to be defined on the TypeBuilder using
22489 DefineNestedMethod.
22491 (TypeContainer::GetClassBases): Implement. Essentially the code from the
22492 methods in RootContext, only ported to be part of TypeContainer.
22494 (TypeContainer::GetInterfaceOrClass): Ditto.
22496 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22498 * interface.cs (Interface::DefineInterface): New method. Does exactly
22499 what RootContext.CreateInterface did earlier, only it takes care of nested types
22502 (Interface::GetInterfaces): Move from RootContext here and port.
22504 (Interface::GetInterfaceByName): Same here.
22506 * rootcontext.cs (ResolveTree): Re-write.
22508 (PopulateTypes): Re-write.
22510 * class.cs (TypeContainer::Populate): Populate nested types too.
22511 (TypeContainer::Emit): Emit nested members too.
22513 * typemanager.cs (AddUserType): Do not make use of the FullName property,
22514 instead just use the name argument passed in as it is already fully
22517 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22518 to TypeContainer mapping to see if a type is user-defined.
22520 * class.cs (TypeContainer::CloseType): Implement.
22522 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22523 the default constructor.
22525 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22528 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22530 * interface.cs (CloseType): Create the type here.
22532 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22535 Remove all the methods which are now in TypeContainer.
22537 2001-10-10 Ravi Pratap <ravi@ximian.com>
22539 * delegate.cs (Define): Re-write bits to define the delegate
22542 2001-10-10 Miguel de Icaza <miguel@ximian.com>
22544 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22546 * expression.cs (ImplicitReferenceConversion): handle null as well
22547 as a source to convert to any reference type.
22549 * statement.cs (Return): Perform any implicit conversions to
22550 expected return type.
22552 Validate use of return statement.
22554 * codegen.cs (EmitContext): Pass the expected return type here.
22556 * class.cs (Method, Constructor, Property): Pass expected return
22557 type to EmitContext.
22559 2001-10-09 Miguel de Icaza <miguel@ximian.com>
22561 * expression.cs: Make DoResolve take an EmitContext instead of a
22564 Replaced `l' and `location' for `loc', for consistency.
22566 (Error, Warning): Remove unneeded Tc argument.
22568 * assign.cs, literal.cs, constant.cs: Update to new calling
22571 * codegen.cs: EmitContext now contains a flag indicating whether
22572 code is being generated in a static method or not.
22574 * cs-parser.jay: DecomposeQI, new function that replaces the old
22575 QualifiedIdentifier. Now we always decompose the assembled
22576 strings from qualified_identifier productions into a group of
22579 2001-10-08 Miguel de Icaza <miguel@ximian.com>
22581 * rootcontext.cs: Deal with field-less struct types correctly now
22582 by passing the size option to Define Type.
22584 * class.cs: Removed hack that created one static field.
22586 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22588 * statement.cs: Moved most of the code generation here.
22590 2001-10-09 Ravi Pratap <ravi@ximian.com>
22592 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22595 (ElementAccess): Remove useless bits for now - keep checks as the spec
22598 2001-10-08 Ravi Pratap <ravi@ximian.com>
22600 * expression.cs (ElementAccess::DoResolve): Remove my crap code
22601 and start performing checks according to the spec.
22603 2001-10-07 Ravi Pratap <ravi@ximian.com>
22605 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22606 rank_specifiers instead.
22608 (rank_specifiers): Change the order in which the rank specifiers are stored
22610 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22612 * expression.cs (ElementAccess): Implement the LValue interface too.
22614 2001-10-06 Ravi Pratap <ravi@ximian.com>
22616 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22617 except that user defined conversions are not included.
22619 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
22620 perform the conversion of the return type, if necessary.
22622 (New::DoResolve): Check whether we are creating an array or an object
22623 and accordingly do the needful.
22625 (New::Emit): Same here.
22627 (New::DoResolve): Implement guts of array creation.
22629 (New::FormLookupType): Helper function.
22631 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22633 * codegen.cs: Removed most of the code generation here, and move the
22634 corresponding code generation bits to the statement classes.
22636 Added support for try/catch/finalize and throw.
22638 * cs-parser.jay: Added support for try/catch/finalize.
22640 * class.cs: Catch static methods having the flags override,
22641 virtual or abstract.
22643 * expression.cs (UserCast): This user cast was not really doing
22644 what it was supposed to do. Which is to be born in fully resolved
22645 state. Parts of the resolution were being performed at Emit time!
22649 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22651 * expression.cs: Implicity convert the result from UserCast.
22653 2001-10-05 Ravi Pratap <ravi@ximian.com>
22655 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22656 prevented it from working correctly.
22658 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22659 merely ConvertImplicit.
22661 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22663 * typemanager.cs: Make the LookupTypeContainer function static,
22664 and not per-instance.
22666 * class.cs: Make static FindMembers (the one that takes a Type
22669 * codegen.cs: Add EmitForeach here.
22671 * cs-parser.jay: Make foreach a toplevel object instead of the
22672 inline expansion, as we need to perform semantic analysis on it.
22674 2001-10-05 Ravi Pratap <ravi@ximian.com>
22676 * expression.cs (Expression::ImplicitUserConversion): Rename to
22677 UserDefinedConversion.
22679 (Expression::UserDefinedConversion): Take an extra argument specifying
22680 whether we look for explicit user conversions too.
22682 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22684 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22686 (ExplicitUserConversion): Make it a call to UserDefinedConversion
22687 with the appropriate arguments.
22689 * cs-parser.jay (cast_expression): Record location too.
22691 * expression.cs (Cast): Record location info.
22693 (Expression::ConvertExplicit): Take location argument.
22695 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22696 to determine if we are doing explicit conversions.
22698 (UserCast::Emit): Update accordingly.
22700 (Expression::ConvertExplicit): Report an error if everything fails.
22702 * ../errors/cs0030.cs : Add.
22704 2001-10-04 Miguel de Icaza <miguel@ximian.com>
22706 * modifiers.cs: If the ABSTRACT keyword is present, also set the
22707 virtual and newslot bits.
22709 * class.cs (TypeContainer::RegisterRequiredImplementations):
22710 Record methods we need.
22712 (TypeContainer::MakeKey): Helper function to make keys for
22713 MethodBases, since the Methodbase key is useless.
22715 (TypeContainer::Populate): Call RegisterRequiredImplementations
22716 before defining the methods.
22718 Create a mapping for method_builders_to_methods ahead of time
22719 instead of inside a tight loop.
22721 (::RequireMethods): Accept an object as the data to set into the
22722 hashtable so we can report interface vs abstract method mismatch.
22724 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22726 * report.cs: Make all of it static.
22728 * rootcontext.cs: Drop object_type and value_type computations, as
22729 we have those in the TypeManager anyways.
22731 Drop report instance variable too, now it is a global.
22733 * driver.cs: Use try/catch on command line handling.
22735 Add --probe option to debug the error reporting system with a test
22738 * report.cs: Add support for exiting program when a probe
22739 condition is reached.
22741 2001-10-03 Ravi Pratap <ravi@ximian.com>
22743 * expression.cs (Binary::DoNumericPromotions): Fix the case when
22744 we do a forcible conversion regardless of type, to check if
22745 ForceConversion returns a null.
22747 (Binary::error19): Use location to report error.
22749 (Unary::error23): Use location here too.
22751 * ../errors/cs0019.cs : Check in.
22753 * ../errors/cs0023.cs : Check in.
22755 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22756 case of a non-null MethodInfo object with a length of 0 !
22758 (Binary::ResolveOperator): Flag error if overload resolution fails to find
22759 an applicable member - according to the spec :-)
22760 Also fix logic to find members in base types.
22762 (Unary::ResolveOperator): Same here.
22764 (Unary::report23): Change name to error23 and make first argument a TypeContainer
22765 as I was getting thoroughly confused between this and error19 :-)
22767 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22768 (::FindMostEncompassedType): Implement.
22769 (::FindMostEncompassingType): Implement.
22770 (::StandardConversionExists): Implement.
22772 (UserImplicitCast): Re-vamp. We now need info about most specific
22773 source and target types so that we can do the necessary conversions.
22775 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22776 mathematical union with no duplicates.
22778 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22780 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22781 in order from base classes to child classes, so that we can in
22782 child classes look up in our parent for method names and
22783 attributes (required for handling abstract, virtual, new, override
22784 constructs: we need to instrospect our base class, and if we dont
22785 populate the classes in order, the introspection might be
22786 incorrect. For example, a method could query its parent before
22787 the parent has any methods and would determine that the parent has
22788 no abstract methods (while it could have had them)).
22790 (RootContext::CreateType): Record the order in which we define the
22793 2001-10-02 Miguel de Icaza <miguel@ximian.com>
22795 * class.cs (TypeContainer::Populate): Also method definitions can
22796 fail now, keep track of this.
22798 (TypeContainer::FindMembers): Implement support for
22799 DeclaredOnly/noDeclaredOnly flag.
22801 (Constructor::Emit) Return the ConstructorBuilder.
22803 (Method::Emit) Return the MethodBuilder.
22804 Check for abstract or virtual methods to be public.
22806 * rootcontext.cs (RootContext::CreateType): Register all the
22807 abstract methods required for the class to be complete and the
22808 interface methods that must be implemented.
22810 * cs-parser.jay: Report error 501 (method requires body if it is
22811 not marked abstract or extern).
22813 * expression.cs (TypeOf::Emit): Implement.
22815 * typemanager.cs: runtime_handle_type, new global type.
22817 * class.cs (Property::Emit): Generate code for properties.
22819 2001-10-02 Ravi Pratap <ravi@ximian.com>
22821 * expression.cs (Unary::ResolveOperator): Find operators on base type
22822 too - we now conform exactly to the spec.
22824 (Binary::ResolveOperator): Same here.
22826 * class.cs (Operator::Define): Fix minor quirk in the tests.
22828 * ../errors/cs0215.cs : Added.
22830 * ../errors/cs0556.cs : Added.
22832 * ../errors/cs0555.cs : Added.
22834 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22836 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22837 single integer which is really efficient
22839 2001-10-01 Ravi Pratap <ravi@ximian.com>
22841 * expression.cs (Expression::ImplicitUserConversion): Use location
22842 even in the case when we are examining True operators.
22844 * class.cs (Operator::Define): Perform extensive checks to conform
22845 with the rules for operator overloading in the spec.
22847 * expression.cs (Expression::ImplicitReferenceConversion): Implement
22848 some of the other conversions mentioned in the spec.
22850 * typemanager.cs (array_type): New static member for the System.Array built-in
22853 (cloneable_interface): For System.ICloneable interface.
22855 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22856 we start resolving the tree and populating types.
22858 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22860 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22862 * expression.cs (Expression::ExprClassFromMemberInfo,
22863 Expression::Literalize): Create literal expressions from
22864 FieldInfos which are literals.
22866 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22867 type casts, because they were wrong. The test suite in tests
22870 (ImplicitNumericConversion): ushort to ulong requires a widening
22873 Int32 constant to long requires widening cast as well.
22875 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22876 for integers because the type on the stack is not i4.
22878 2001-09-30 Miguel de Icaza <miguel@ximian.com>
22880 * expression.cs (report118): require location argument.
22882 * parameter.cs: Do not dereference potential null value.
22884 * class.cs: Catch methods that lack the `new' keyword when
22885 overriding a name. Report warnings when `new' is used without
22886 anything being there to override.
22888 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22890 * class.cs: Only add constructor to hashtable if it is non-null
22891 (as now constructors can fail on define).
22893 (TypeManager, Class, Struct): Take location arguments.
22895 Catch field instance initialization in structs as errors.
22897 accepting_filter: a new filter for FindMembers that is static so
22898 that we dont create an instance per invocation.
22900 (Constructor::Define): Catch errors where a struct constructor is
22903 * cs-parser.jay: Pass location information for various new
22906 * delegate.cs (Delegate): take a location argument.
22908 * driver.cs: Do not call EmitCode if there were problesm in the
22909 Definition of the types, as many Builders wont be there.
22911 * decl.cs (Decl::Decl): Require a location argument.
22913 * cs-tokenizer.cs: Handle properly hex constants that can not fit
22914 into integers, and find the most appropiate integer for it.
22916 * literal.cs: Implement ULongLiteral.
22918 * rootcontext.cs: Provide better information about the location of
22919 failure when CreateType fails.
22921 2001-09-29 Miguel de Icaza <miguel@ximian.com>
22923 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22926 * expression.cs (Binary::CheckShiftArguments): Add missing type
22928 (Binary::ResolveOperator): Add type to the logical and and logical
22929 or, Bitwise And/Or and Exclusive Or code paths, it was missing
22932 (Binary::DoNumericPromotions): In the case where either argument
22933 is ulong (and most signed types combined with ulong cause an
22934 error) perform implicit integer constant conversions as well.
22936 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22938 * expression.cs (UserImplicitCast): Method should always be
22940 (Invocation::BetterConversion): Simplified test for IntLiteral.
22942 (Expression::ImplicitNumericConversion): Split this routine out.
22943 Put the code that performs implicit constant integer conversions
22946 (Expression::Resolve): Become a wrapper around DoResolve so we can
22947 check eclass and type being set after resolve.
22949 (Invocation::Badness): Remove this dead function
22951 (Binary::ResolveOperator): Do not compute the expensive argumnets
22952 unless we have a union for it.
22954 (Probe::Emit): Is needs to do an isinst and then
22955 compare against null.
22957 (::CanConvert): Added Location argument. If the Location argument
22958 is null (Location.Null), then we do not report errors. This is
22959 used by the `probe' mechanism of the Explicit conversion. We do
22960 not want to generate an error for something that the user
22961 explicitly requested to be casted. But the pipeline for an
22962 explicit cast first tests for potential implicit casts.
22964 So for now, if the Location is null, it means `Probe only' to
22965 avoid adding another argument. Might have to revise this
22968 (ClassCast): New class used to type cast objects into arbitrary
22969 classes (used in Explicit Reference Conversions).
22971 Implement `as' as well.
22973 Reverted all the patches from Ravi below: they were broken:
22975 * The use of `level' as a mechanism to stop recursive
22976 invocations is wrong. That was there just to catch the
22977 bug with a strack trace but not as a way of addressing
22980 To fix the problem we have to *understand* what is going
22981 on and the interactions and come up with a plan, not
22982 just get things going.
22984 * The use of the type conversion cache that I proposed
22985 last night had an open topic: How does this work across
22986 protection domains. A user defined conversion might not
22987 be public in the location where we are applying the
22988 conversion, a different conversion might be selected
22989 (ie, private A->B (better) but public B->A (worse),
22990 inside A, A->B applies, but outside it, B->A will
22993 * On top of that (ie, even if the above is solved),
22994 conversions in a cache need to be abstract. Ie, `To
22995 convert from an Int to a Short use an OpcodeCast', not
22996 `To convert from an Int to a Short use the OpcodeCast on
22997 the variable 5' (which is what this patch was doing).
22999 2001-09-28 Ravi Pratap <ravi@ximian.com>
23001 * expression.cs (Invocation::ConversionExists): Re-write to use
23002 the conversion cache
23004 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23005 cache all conversions done, not just user-defined ones.
23007 (Invocation::BetterConversion): The real culprit. Use ConversionExists
23008 to determine if a conversion exists instead of acutually trying to
23009 perform the conversion. It's faster too.
23011 (Expression::ConvertExplicit): Modify to use ConversionExists to check
23012 and only then attempt the implicit conversion.
23014 2001-09-28 Ravi Pratap <ravi@ximian.com>
23016 * expression.cs (ConvertImplicit): Use a cache for conversions
23017 already found. Check level of recursion and bail out if necessary.
23019 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23021 * typemanager.cs (string_concat_string_string, string_concat_object_object):
23022 Export standard methods that we expect for string operations.
23024 * statement.cs (Block::UsageWarning): Track usage of variables and
23025 report the errors for not used variables.
23027 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23030 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23032 * codegen.cs: remove unnneded code
23034 * expression.cs: Removed BuiltinTypeAccess class
23036 Fix the order in which implicit conversions are
23039 The previous fixed dropped support for boxed conversions (adding a
23040 test to the test suite now)
23042 (UserImplicitCast::CanConvert): Remove test for source being null,
23043 that code is broken. We should not feed a null to begin with, if
23044 we do, then we should track the bug where the problem originates
23045 and not try to cover it up here.
23047 Return a resolved expression of type UserImplicitCast on success
23048 rather than true/false. Ravi: this is what I was talking about,
23049 the pattern is to use a static method as a "constructor" for
23052 Also, do not create arguments until the very last minute,
23053 otherwise we always create the arguments even for lookups that
23054 will never be performed.
23056 (UserImplicitCast::Resolve): Eliminate, objects of type
23057 UserImplicitCast are born in a fully resolved state.
23059 * typemanager.cs (InitCoreTypes): Init also value_type
23060 (System.ValueType).
23062 * expression.cs (Cast::Resolve): First resolve the child expression.
23064 (LValue): Add new method AddressOf to be used by
23067 Change the argument of Store to take an EmitContext instead of an
23068 ILGenerator, because things like FieldExpr need to be able to call
23069 their children expression to generate the instance code.
23071 (Expression::Error, Expression::Warning): Sugar functions for
23074 (Expression::MemberLookup): Accept a TypeContainer instead of a
23075 Report as the first argument.
23077 (Expression::ResolvePrimary): Killed. I still want to improve
23078 this as currently the code is just not right.
23080 (Expression::ResolveMemberAccess): Simplify, but it is still
23083 (Unary::Resolve): Catch errors in AddressOf operators.
23085 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23086 index to a byte for the short-version, or the compiler will choose
23087 the wrong Emit call, which generates the wrong data.
23089 (ParameterReference::Emit, ::Store): same.
23091 (FieldExpr::AddressOf): Implement.
23093 * typemanager.cs: TypeManager: made public variable instead of
23096 * driver.cs: document --fatal.
23098 * report.cs (ErrorMessage, WarningMessage): new names for the old
23099 Error and Warning classes.
23101 * cs-parser.jay (member_access): Turn built-in access to types
23102 into a normal simplename
23104 2001-09-27 Ravi Pratap <ravi@ximian.com>
23106 * expression.cs (Invocation::BetterConversion): Fix to cope
23107 with q being null, since this was introducing a bug.
23109 * expression.cs (ConvertImplicit): Do built-in conversions first.
23111 2001-09-27 Ravi Pratap <ravi@ximian.com>
23113 * expression.cs (UserImplicitCast::Resolve): Fix bug.
23115 2001-09-27 Ravi Pratap <ravi@ximian.com>
23117 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23118 I had introduced long ago (what's new ?).
23120 * expression.cs (UserImplicitCast::CanConvert): Static method to do
23121 the work of all the checking.
23122 (ConvertImplicit): Call CanConvert and only then create object if necessary.
23123 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23125 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23126 that is the right way.
23128 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
23129 overloading resolution. Use everywhere instead of cutting and pasting code.
23131 (Binary::ResolveOperator): Use MakeUnionSet.
23133 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
23134 we have to convert to bool types. Not complete yet.
23136 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23138 * typemanager.cs (TypeManager::CSharpName): support ushort.
23140 * expression.cs (Expression::TryImplicitIntConversion): Attempts
23141 to provide an expression that performsn an implicit constant int
23142 conversion (section 6.1.6).
23143 (Expression::ConvertImplicitRequired): Reworked to include
23144 implicit constant expression conversions.
23146 (Expression::ConvertNumericExplicit): Finished.
23148 (Invocation::Emit): If InstanceExpression is null, then it means
23149 that we perform a call on this.
23151 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23153 * expression.cs (Unary::Emit): Remove some dead code.
23154 (Probe): Implement Resolve and Emit for `is'.
23155 (Expression::ConvertImplicitRequired): Attempt to do constant
23156 expression conversions here. Maybe should be moved to
23157 ConvertImplicit, but I am not sure.
23158 (Expression::ImplicitLongConstantConversionPossible,
23159 Expression::ImplicitIntConstantConversionPossible): New functions
23160 that tell whether is it possible to apply an implicit constant
23161 expression conversion.
23163 (ConvertNumericExplicit): Started work on explicit numeric
23166 * cs-parser.jay: Update operator constants.
23168 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23169 (Parameters::GetSignature): Hook up VerifyArgs here.
23170 (Parameters::VerifyArgs): Verifies that no two arguments have the
23173 * class.cs (Operator): Update the operator names to reflect the
23174 ones that the spec expects (as we are just stringizing the
23177 * expression.cs (Unary::ResolveOperator): Fix bug: Use
23178 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23179 previous usage did only work for our methods.
23180 (Expression::ConvertImplicit): Handle decimal implicit numeric
23181 conversions as well.
23182 (Expression::InternalTypeConstructor): Used to invoke constructors
23183 on internal types for default promotions.
23185 (Unary::Emit): Implement special handling for the pre/post
23186 increment/decrement for overloaded operators, as they need to have
23187 the same semantics as the other operators.
23189 (Binary::ResolveOperator): ditto.
23190 (Invocation::ConversionExists): ditto.
23191 (UserImplicitCast::Resolve): ditto.
23193 2001-09-26 Ravi Pratap <ravi@ximian.com>
23195 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23196 operator, return after emitting body. Regression tests pass again !
23198 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23199 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23200 (Invocation::OverloadResolve): Ditto.
23201 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23203 * everywhere : update calls to the above methods accordingly.
23205 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23207 * assign.cs (Assign): Make it inherit from ExpressionStatement.
23209 * expression.cs (ExpressionStatement): New base class used for
23210 expressions that can appear in statements, so that we can provide
23211 an alternate path to generate expression that do not leave a value
23214 (Expression::Emit, and all the derivatives): We no longer return
23215 whether a value is left on the stack or not. Every expression
23216 after being emitted leaves a single value on the stack.
23218 * codegen.cs (EmitContext::EmitStatementExpression): Use the
23219 facilties of ExpressionStatement if possible.
23221 * cs-parser.jay: Update statement_expression.
23223 2001-09-25 Miguel de Icaza <miguel@ximian.com>
23225 * driver.cs: Change the wording of message
23227 2001-09-25 Ravi Pratap <ravi@ximian.com>
23229 * expression.cs (Binary::ResolveOperator): Had forgottten to set
23230 the type of the expression to the return type of the method if
23231 we have an overloaded operator match ! The regression tests pass again !
23232 (Unary::ResolveOperator): Ditto.
23234 * expression.cs (Invocation::ConversionExists): Correct the member lookup
23235 to find "op_Implicit", not "implicit" ;-)
23236 (UserImplicitCast): New class to take care of user-defined implicit conversions.
23237 (ConvertImplicit, ForceConversion): Take TypeContainer argument
23239 * everywhere : Correct calls to the above accordingly.
23241 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23242 (ConvertImplicit): Do user-defined conversion if it exists.
23244 2001-09-24 Miguel de Icaza <miguel@ximian.com>
23246 * assign.cs: track location.
23247 (Resolve): Use implicit conversions on assignment.
23249 * literal.cs: Oops. Not good, Emit of short access values should
23250 pass (Bytes) or the wrong argument will be selected.
23252 * expression.cs (Unary::Emit): Emit code for -expr.
23254 (Unary::ResolveOperator): Handle `Substract' for non-constants
23255 (substract from zero from the non-constants).
23256 Deal with Doubles as well.
23258 (Expression::ConvertImplicitRequired): New routine that reports an
23259 error if no implicit conversion exists.
23261 (Invocation::OverloadResolve): Store the converted implicit
23262 expressions if we make them
23264 2001-09-24 Ravi Pratap <ravi@ximian.com>
23266 * class.cs (ConstructorInitializer): Take a Location argument.
23267 (ConstructorBaseInitializer): Same here.
23268 (ConstructorThisInitializer): Same here.
23270 * cs-parser.jay : Update all calls accordingly.
23272 * expression.cs (Unary, Binary, New): Take location argument.
23273 Update accordingly everywhere.
23275 * cs-parser.jay : Update all calls to the above to take a location
23278 * class.cs : Ditto.
23280 2001-09-24 Ravi Pratap <ravi@ximian.com>
23282 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23283 (Invocation::BetterConversion): Same here
23284 (Invocation::ConversionExists): Ditto.
23286 (Invocation::ConversionExists): Implement.
23288 2001-09-22 Ravi Pratap <ravi@ximian.com>
23290 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23291 Also take an additional TypeContainer argument.
23293 * All over : Pass in TypeContainer as argument to OverloadResolve.
23295 * typemanager.cs (CSharpName): Update to check for the string type and return
23298 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23301 2001-09-21 Ravi Pratap <ravi@ximian.com>
23303 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23304 (Invocation::BetterFunction): Implement.
23305 (Invocation::BetterConversion): Implement.
23306 (Invocation::ConversionExists): Skeleton, no implementation yet.
23308 Okay, things work fine !
23310 2001-09-21 Miguel de Icaza <miguel@ximian.com>
23312 * typemanager.cs: declare and load enum_type, delegate_type and
23315 * expression.cs (Expression::Emit): Now emit returns a value that
23316 tells whether a value is left on the stack or not. This strategy
23317 might be reveted tomorrow with a mechanism that would address
23318 multiple assignments.
23319 (Expression::report118): Utility routine to report mismatches on
23322 (Unary::Report23): Report impossible type/operator combination
23325 (Unary::IsIncrementableNumber): Whether the type can be
23326 incremented or decremented with add.
23327 (Unary::ResolveOperator): Also allow enumerations to be bitwise
23329 (Unary::ResolveOperator): Implement ++, !, ~,
23331 (Invocation::Emit): Deal with new Emit convetion.
23333 * All Expression derivatives: Updated their Emit method to return
23334 whether they leave values on the stack or not.
23336 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23337 stack for expressions that are statements.
23339 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23341 * expression.cs (LValue): New interface. Must be implemented by
23343 (LocalVariableReference, ParameterReference, FieldExpr): Implement
23346 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23347 interface for generating code, simplifies the code.
23349 2001-09-20 Ravi Pratap <ravi@ximian.com>
23351 * expression.cs (everywhere): Comment out return statements in ::Resolve
23352 methods to avoid the warnings.
23354 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23356 * driver.cs (parse): Report error 2001 if we can not open the
23359 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23362 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23365 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23366 otherwise nested blocks end up with the same index.
23368 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23370 * expression.cs: Instead of having FIXMEs in the Resolve
23371 functions, throw exceptions so it is obvious that we are facing a
23374 * cs-parser.jay (invocation_expression): Pass Location information.
23376 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23377 Use a basename for those routines because .NET does not like paths
23380 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23383 2001-09-19 Miguel de Icaza <miguel@ximian.com>
23385 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23386 are loading the correct data types (throws an exception if not).
23387 (TypeManager::InitCoreTypes): Use CoreLookupType
23389 * expression.cs (Unary::ResolveOperator): return the child
23390 expression for expressions which are just +expr.
23391 (Unary::ResolveOperator): Return negative literals for -LITERAL
23392 expressions (otherwise they are Unary {Literal}).
23393 (Invocation::Badness): Take into account `Implicit constant
23394 expression conversions'.
23396 * literal.cs (LongLiteral): Implement long literal class.
23397 (IntLiteral): export the `Value' of the intliteral.
23399 2001-09-19 Ravi Pratap <ravi@ximian.com>
23401 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23403 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
23404 instead of 'Operator'
23406 * expression.cs (Binary::ResolveOperator): Update accordingly.
23407 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23410 * cs-parser.jay (unary_expression): Update to use the new names.
23412 * gen-treedump.cs (GetUnary): Same here.
23414 * expression.cs (Unary::Resolve): Implement.
23415 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
23416 operators are found instead of making noise ;-)
23417 (Unary::ResolveOperator): New method to do precisely the same thing which
23418 Binary::ResolveOperator does for Binary expressions.
23419 (Unary.method, .Arguments): Add.
23420 (Unary::OperName): Implement.
23421 (Unary::ForceConversion): Copy and Paste !
23423 * class.cs (Operator::Define): Fix a small bug for the case when we have
23426 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23427 for the inbuilt operators. Only overloading works for now ;-)
23429 2001-09-18 Miguel de Icaza <miguel@ximian.com>
23431 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23432 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23434 * expression.cs (This::Emit): Implement.
23435 (This::Resolve): Implement.
23436 (TypeOf:Resolve): Implement.
23437 (Expression::ResolveSimpleName): Add an implicit this to instance
23439 (MemberAccess::Resolve): Deal with Parameters and Fields.
23440 Bind instance variable to Field expressions.
23441 (FieldExpr::Instance): New field used to track the expression that
23442 represents the object instance.
23443 (FieldExpr::Resolve): Track potential errors from MemberLookup not
23445 (FieldExpr::Emit): Implement.
23447 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23448 the last instruction contains a return opcode to avoid generating
23449 the last `ret' instruction (this generates correct code, and it is
23450 nice to pass the peverify output).
23452 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23453 initializer for static and instance variables.
23454 (Constructor::Emit): Allow initializer to be null in the case of
23455 static constructors. Only emit initializer for instance
23458 (TypeContainer::FindMembers): Return a null array if there are no
23461 Also fix the code for the MemberTypes.Method branch, as it was not
23462 scanning that for operators (or tried to access null variables before).
23464 * assign.cs (Assign::Emit): Handle instance and static fields.
23468 * driver.cs: Stop compilation if there are parse errors.
23470 * cs-parser.jay (constructor_declaration): Provide default base
23471 initializer for non-static constructors.
23472 (constructor_declarator): Do not provide a default base
23473 initializers if none was specified.
23474 Catch the fact that constructors should not have parameters.
23476 * class.cs: Do not emit parent class initializers for static
23477 constructors, that should be flagged as an error.
23479 2001-09-18 Ravi Pratap <ravi@ximian.com>
23481 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23482 Move back code into TypeContainer::Populate.
23484 2001-09-18 Ravi Pratap <ravi@ximian.com>
23486 * class.cs (TypeContainer::AddConstructor): Fix the check to
23487 compare against Name, not Basename.
23488 (Operator::OpType): Change Plus and Minus to Add and Subtract.
23490 * cs-parser.jay : Update accordingly.
23492 * class.cs (TypeContainer::FindMembers): For the case where we are searching
23493 for methods, don't forget to look into the operators too.
23494 (RegisterMethodBuilder): Helper method to take care of this for
23495 methods, constructors and operators.
23496 (Operator::Define): Completely revamp.
23497 (Operator.OperatorMethod, MethodName): New fields.
23498 (TypeContainer::Populate): Move the registering of builders into
23499 RegisterMethodBuilder.
23500 (Operator::Emit): Re-write.
23502 * expression.cs (Binary::Emit): Comment out code path to emit method
23503 invocation stuff for the case when we have a user defined operator. I am
23504 just not able to get it right !
23506 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23508 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23511 (Expression::MemberLookup): Provide a version that allows to
23512 specify the MemberTypes and BindingFlags.
23514 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23515 so it was not fetching variable information from outer blocks.
23517 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23518 Beforefieldinit as it was buggy.
23520 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23521 that Ravi put here.
23523 * class.cs (Constructor::Emit): Only emit if block is not null.
23524 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23525 deal with this by semantically definining it as if the user had
23528 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23529 constructors as we now "emit" them at a higher level.
23531 (TypeContainer::DefineDefaultConstructor): Used to define the
23532 default constructors if none was provided.
23534 (ConstructorInitializer): Add methods Resolve and Emit.
23536 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23538 2001-09-17 Ravi Pratap <ravi@ximian.com>
23540 * class.cs (TypeContainer::EmitDefaultConstructor): Register
23541 the default constructor builder with our hashtable for methodbuilders
23544 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23545 and argument_count is 0 in which case we have a match.
23546 (Binary::ResolveOperator): More null checking and miscellaneous coding
23549 2001-09-17 Ravi Pratap <ravi@ximian.com>
23551 * rootcontext.cs (IsNameSpace): Compare against null.
23553 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23555 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23556 and Unary::Operator.
23558 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23561 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23562 we have overloaded operators.
23563 (Binary::ResolveOperator): Implement the part which does the operator overload
23566 * class.cs (Operator::Emit): Implement.
23567 (TypeContainer::Emit): Emit the operators we have too.
23569 * expression.cs (Binary::Emit): Update to emit the appropriate code for
23570 the case when we have a user-defined operator.
23572 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23574 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23576 2001-09-16 Ravi Pratap <ravi@ximian.com>
23578 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23579 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23580 (Constructor::Emit): Implement.
23581 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23582 if we have no work to do.
23583 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
23586 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23587 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23589 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23592 2001-09-15 Ravi Pratap <ravi@ximian.com>
23594 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23596 (Tree::RecordNamespace): Method to do what the name says ;-)
23597 (Tree::Namespaces): Property to get at the namespaces hashtable.
23599 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
23602 * rootcontext.cs (IsNamespace): Fixed it :-)
23604 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23606 * class.cs (TypeContainer::FindMembers): Add support for
23608 (MethodCore): New class that encapsulates both the shared aspects
23609 of a Constructor and a Method.
23610 (Method, Constructor): Factored pieces into MethodCore.
23612 * driver.cs: Added --fatal which makes errors throw exceptions.
23613 Load System assembly as well as part of the standard library.
23615 * report.cs: Allow throwing exceptions on errors for debugging.
23617 * modifiers.cs: Do not use `parent', instead use the real type
23618 container to evaluate permission settings.
23620 * class.cs: Put Ravi's patch back in. He is right, and we will
23621 have to cope with the
23623 2001-09-14 Ravi Pratap <ravi@ximian.com>
23625 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23626 FamORAssem, not FamANDAssem.
23628 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23630 * driver.cs: Added --parse option that only parses its input files
23633 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
23634 incorrect. IsTopLevel is not used to tell whether an object is
23635 root_types or not (that can be achieved by testing this ==
23636 root_types). But to see if this is a top-level *class* (not
23637 necessarly our "toplevel" container).
23639 2001-09-14 Ravi Pratap <ravi@ximian.com>
23641 * enum.cs (Enum::Define): Modify to call the Lookup method on the
23642 parent instead of a direct call to GetType.
23644 2001-09-14 Ravi Pratap <ravi@ximian.com>
23646 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23647 Modifiers.TypeAttr. This should just be a call to that method.
23649 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23650 object so that we can determine if we are top-level or not.
23652 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
23655 * enum.cs (Enum::Define): Ditto.
23657 * modifiers.cs (FieldAttr): Re-write.
23659 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23660 (TypeContainer::HaveStaticConstructor): New property to provide access
23661 to precisely that info.
23663 * modifiers.cs (MethodAttr): Re-write.
23664 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23666 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23667 of top-level types as claimed.
23669 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23671 * expression.cs (MemberLookup): Fruitless attempt to lookup
23672 constructors. Maybe I need to emit default constructors? That
23673 might be it (currently .NET emits this for me automatically).
23674 (Invocation::OverloadResolve): Cope with Arguments == null.
23675 (Invocation::EmitArguments): new function, shared by the new
23676 constructor and us.
23677 (Invocation::Emit): Handle static and instance methods. Emit
23678 proper call instruction for virtual or non-virtual invocations.
23679 (New::Emit): Implement.
23680 (New::Resolve): Implement.
23681 (MemberAccess:Resolve): Implement.
23682 (MethodGroupExpr::InstanceExpression): used conforming to the spec
23683 to track instances.
23684 (FieldExpr::Resolve): Set type.
23686 * support.cs: Handle empty arguments.
23688 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23689 SimpleLookup): Auxiliary routines to help parse a qualifier
23692 Update qualifier_identifier rule.
23694 * codegen.cs: Removed debugging messages.
23696 * class.cs: Make this a global thing, this acts just as a "key" to
23697 objects that we might have around.
23699 (Populate): Only initialize method_builders_to_methods once.
23701 * expression.cs (PropertyExpr): Initialize type from the
23704 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23705 Resolve pattern. Attempt to implicitly convert value to boolean.
23708 * expression.cs: Set the type for the int32/int32 argument case.
23709 (Binary::ResolveOperator): Set the return type to boolean for
23710 comparission operators
23712 * typemanager.cs: Remove debugging print code.
23714 (Invocation::Resolve): resolve type.
23716 * class.cs: Allocate a MemberInfo of the correct size, as the code
23717 elsewhere depends on the test to reflect the correct contents.
23719 (Method::) Keep track of parameters, due to System.Reflection holes
23721 (TypeContainer::Populate): Keep track of MethodBuilders to Method
23724 (TypeContainer::FindMembers): Use ArrayList and then copy an array
23725 of the exact size and return that.
23727 (Class::LookupMethodByBuilder): New function that maps
23728 MethodBuilders to its methods. Required to locate the information
23729 on methods because System.Reflection bit us again.
23731 * support.cs: New file, contains an interface ParameterData and
23732 two implementations: ReflectionParameters and InternalParameters
23733 used to access Parameter information. We will need to grow this
23736 * expression.cs (Invocation::GetParameterData): implement a cache
23737 and a wrapper around the ParameterData creation for methods.
23738 (Invocation::OverloadResolve): Use new code.
23740 2001-09-13 Ravi Pratap <ravi@ximian.com>
23742 * class.cs (TypeContainer::EmitField): Remove and move into
23743 (Field::Define): here and modify accordingly.
23744 (Field.FieldBuilder): New member.
23745 (TypeContainer::Populate): Update accordingly.
23746 (TypeContainer::FindMembers): Implement.
23748 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23750 * statement.cs: (VariableInfo::VariableType): New field to be
23751 initialized with the full type once it is resolved.
23753 2001-09-12 Miguel de Icaza <miguel@ximian.com>
23755 * parameter.cs (GetParameterInfo): Use a type cache to compute
23756 things only once, and to reuse this information
23758 * expression.cs (LocalVariableReference::Emit): Implement.
23759 (OpcodeCast::Emit): fix.
23761 (ParameterReference::Resolve): Implement.
23762 (ParameterReference::Emit): Implement.
23764 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23765 that are expressions need to stay as Expressions.
23767 * typemanager.cs (CSharpName): Returns the C# name of a type if
23770 * expression.cs (Expression::ConvertImplicit): New function that
23771 implements implicit type conversions.
23773 (Expression::ImplicitReferenceConversion): Implements implicit
23774 reference conversions.
23776 (EmptyCast): New type for transparent casts.
23778 (OpcodeCast): New type for casts of types that are performed with
23779 a sequence of bytecodes.
23781 (BoxedCast): New type used for casting value types into reference
23782 types. Emits a box opcode.
23784 (Binary::DoNumericPromotions): Implements numeric promotions of
23785 and computation of the Binary::Type.
23787 (Binary::EmitBranchable): Optimization.
23789 (Binary::Emit): Implement code emission for expressions.
23791 * typemanager.cs (TypeManager): Added two new core types: sbyte
23794 2001-09-12 Ravi Pratap <ravi@ximian.com>
23796 * class.cs (TypeContainer::FindMembers): Method which does exactly
23797 what Type.FindMembers does, only we don't have to use reflection. No
23798 implementation yet.
23800 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23801 typecontainer objects as we need to get at them.
23802 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23804 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23805 typecontainer object.
23807 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23808 of just a Report object.
23810 2001-09-11 Ravi Pratap <ravi@ximian.com>
23812 * class.cs (Event::Define): Go back to using the prefixes "add_" and
23814 (TypeContainer::Populate): Now define the delegates of the type too.
23815 (TypeContainer.Delegates): Property to access the list of delegates defined
23818 * delegates.cs (Delegate::Define): Implement partially.
23820 * modifiers.cs (TypeAttr): Handle more flags.
23822 2001-09-11 Ravi Pratap <ravi@ximian.com>
23824 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23826 (Operator::Define): Re-write logic to get types by using the LookupType method
23827 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23828 (Indexer::Define): Ditto.
23829 (Event::Define): Ditto.
23830 (Property::Define): Ditto.
23832 2001-09-10 Ravi Pratap <ravi@ximian.com>
23834 * class.cs (TypeContainer::Populate): Now define operators too.
23835 (TypeContainer.Operators): New property to access the list of operators
23837 (Operator.OperatorMethodBuilder): New member to hold the method builder
23838 for the operator we are defining.
23839 (Operator::Define): Implement.
23841 2001-09-10 Ravi Pratap <ravi@ximian.com>
23843 * class.cs (Event::Define): Make the prefixes of the accessor methods
23844 addOn_ and removeOn_
23846 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23847 of the location being passed in too. Ideally, this should go later since all
23848 error reporting should be done through the Report object.
23850 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23851 (Populate): Iterate thru the indexers we have and define them too.
23852 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23853 for the get and set accessors.
23854 (Indexer::Define): Implement.
23856 2001-09-09 Miguel de Icaza <miguel@ximian.com>
23858 * expression.cs (Binary::Resolve): Beginning of it. I scratched
23859 my previous implementation, did not work.
23861 * typemanager.cs: Add a couple of missing types (the longs).
23863 * literal.cs: Use TypeManager.bool_type instead of getting it.
23865 * expression.cs (EventExpr): New kind of expressions.
23866 (Expressio::ExprClassFromMemberInfo): finish
23868 2001-09-08 Miguel de Icaza <miguel@ximian.com>
23870 * assign.cs: Emit stores to static fields differently.
23872 2001-09-08 Ravi Pratap <ravi@ximian.com>
23874 * Merge in changes and adjust code to tackle conflicts. Backed out my
23875 code in Assign::Resolve ;-)
23877 2001-09-08 Ravi Pratap <ravi@ximian.com>
23879 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23880 instead Report.Error and also pass in the location.
23881 (CSharpParser::Lexer): New readonly property to return the reference
23882 to the Tokenizer object.
23883 (declare_local_variables): Use Report.Error with location instead of plain
23887 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23888 (Operator.CheckBinaryOperator): Ditto.
23890 * cs-parser.jay (operator_declarator): Update accordingly.
23892 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23893 (CheckBinaryOperator): Same here.
23895 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23896 on the name without any prefixes of namespace names etc. This is because we
23897 already might have something already fully qualified like
23898 'System.Console.WriteLine'
23900 * assign.cs (Resolve): Begin implementation. Stuck ;-)
23902 2001-09-07 Ravi Pratap <ravi@ximian.com>
23904 * cs-tokenizer.cs (location): Return a string which also contains
23907 * expression.cs (ElementAccess): New class for expressions of the
23908 type 'element access.'
23909 (BaseAccess): New class for expressions of the type 'base access.'
23910 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23913 * cs-parser.jay (element_access): Implement action.
23914 (base_access): Implement actions.
23915 (checked_expression, unchecked_expression): Implement.
23917 * cs-parser.jay (local_variable_type): Correct and implement.
23918 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23920 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23922 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23923 name and the specifiers.
23925 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23927 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
23928 making them all public ;-)
23930 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23933 2001-09-07 Miguel de Icaza <miguel@ximian.com>
23935 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23937 (FieldExpr, PropertyExprs): New resolved expressions.
23938 (SimpleName::MemberStaticCheck): Perform static checks for access
23939 to non-static fields on static methods. Maybe this should be
23940 generalized for MemberAccesses.
23941 (SimpleName::ResolveSimpleName): More work on simple name
23944 * cs-parser.jay (primary_expression/qualified_identifier): track
23945 the parameter index.
23947 * codegen.cs (CodeGen::Save): Catch save exception, report error.
23948 (EmitContext::EmitBoolExpression): Chain to expression generation
23949 instead of temporary hack.
23950 (::EmitStatementExpression): Put generic expression code generation.
23952 * assign.cs (Assign::Emit): Implement variable assignments to
23953 local variables, parameters and fields.
23955 2001-09-06 Miguel de Icaza <miguel@ximian.com>
23957 * statement.cs (Block::GetVariableInfo): New method, returns the
23958 VariableInfo for a variable name in a block.
23959 (Block::GetVariableType): Implement in terms of GetVariableInfo
23961 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23962 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23964 2001-09-06 Ravi Pratap <ravi@ximian.com>
23966 * cs-parser.jay (operator_declaration): Continue on my quest : update
23967 to take attributes argument.
23968 (event_declaration): Ditto.
23969 (enum_declaration): Ditto.
23970 (indexer_declaration): Ditto.
23972 * class.cs (Operator::Operator): Update constructor accordingly.
23973 (Event::Event): Ditto.
23975 * delegate.cs (Delegate::Delegate): Same here.
23977 * enum.cs (Enum::Enum): Same here.
23979 2001-09-05 Ravi Pratap <ravi@ximian.com>
23981 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23983 * ../tests/cs0658.cs : New file to demonstrate error 0658.
23985 * attribute.cs (Attributes): New class to encapsulate all attributes which were
23986 being passed around as an arraylist.
23987 (Attributes::AddAttribute): Method to add attribute sections.
23989 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23990 (struct_declaration): Update accordingly.
23991 (constant_declaration): Update.
23992 (field_declaration): Update.
23993 (method_header): Update.
23994 (fixed_parameter): Update.
23995 (parameter_array): Ditto.
23996 (property_declaration): Ditto.
23997 (destructor_declaration): Ditto.
23999 * class.cs (Struct::Struct): Update constructors accordingly.
24000 (Class::Class): Ditto.
24001 (Field::Field): Ditto.
24002 (Method::Method): Ditto.
24003 (Property::Property): Ditto.
24004 (TypeContainer::OptAttribute): update property's return type.
24006 * interface.cs (Interface.opt_attributes): New member.
24007 (Interface::Interface): Update to take the extra Attributes argument.
24009 * parameter.cs (Parameter::Parameter): Ditto.
24011 * constant.cs (Constant::Constant): Ditto.
24013 * interface.cs (InterfaceMemberBase): New OptAttributes field.
24014 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
24015 the attributes as a parameter.
24016 (InterfaceProperty): Update constructor call.
24017 (InterfaceEvent): Ditto.
24018 (InterfaceMethod): Ditto.
24019 (InterfaceIndexer): Ditto.
24021 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
24022 pass the attributes too.
24023 (interface_event_declaration): Ditto.
24024 (interface_property_declaration): Ditto.
24025 (interface_method_declaration): Ditto.
24026 (interface_declaration): Ditto.
24028 2001-09-05 Miguel de Icaza <miguel@ximian.com>
24030 * class.cs (Method::Define): Track the "static Main" definition to
24031 create an entry point.
24033 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24034 EntryPoint if we find it.
24036 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24037 (EmitContext::ig): Make this variable public.
24039 * driver.cs: Make the default output file be the first file name
24040 with the .exe extension.
24042 Detect empty compilations
24044 Handle various kinds of output targets. Handle --target and
24045 rename -t to --dumper.
24047 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24048 methods inherited from Expression return now an Expression. This
24049 will is used during the tree rewriting as we resolve them during
24052 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24053 the spec. Missing entirely is the information about
24054 accessability of elements of it.
24056 (Expression::ExprClassFromMemberInfo): New constructor for
24057 Expressions that creates a fully initialized Expression based on
24058 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24061 (Invocation::Resolve): Begin implementing resolution of invocations.
24063 * literal.cs (StringLiteral): Implement Emit.
24065 2001-09-05 Ravi Pratap <ravi@ximian.com>
24067 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24070 2001-09-04 Ravi Pratap <ravi@ximian.com>
24072 * cs-parser.jay (attribute_arguments): Implement actions.
24073 (attribute): Fix bug in production. Implement action.
24074 (attribute_list): Implement.
24075 (attribute_target): Implement.
24076 (attribute_target_specifier, opt_target_specifier): Implement
24077 (CheckAttributeTarget): New method to check if the attribute target
24079 (attribute_section): Implement.
24080 (opt_attributes): Implement.
24082 * attribute.cs : New file to handle attributes.
24083 (Attribute): Class to hold attribute info.
24085 * cs-parser.jay (opt_attribute_target_specifier): Remove production
24086 (attribute_section): Modify production to use 2 different rules to
24087 achieve the same thing. 1 s/r conflict down !
24088 Clean out commented, useless, non-reducing dimension_separator rules.
24090 * class.cs (TypeContainer.attributes): New member to hold list
24091 of attributes for a type.
24092 (Struct::Struct): Modify to take one more argument, the attribute list.
24093 (Class::Class): Ditto.
24094 (Field::Field): Ditto.
24095 (Method::Method): Ditto.
24096 (Property::Property): Ditto.
24098 * cs-parser.jay (struct_declaration): Update constructor call to
24099 pass in the attributes too.
24100 (class_declaration): Ditto.
24101 (constant_declaration): Ditto.
24102 (field_declaration): Ditto.
24103 (method_header): Ditto.
24104 (fixed_parameter): Ditto.
24105 (parameter_array): Ditto.
24106 (property_declaration): Ditto.
24108 * constant.cs (Constant::Constant): Update constructor similarly.
24109 Use System.Collections.
24111 * parameter.cs (Parameter::Parameter): Update as above.
24113 2001-09-02 Ravi Pratap <ravi@ximian.com>
24115 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24116 (TypeContainer.delegates): New member to hold list of delegates.
24118 * cs-parser.jay (delegate_declaration): Implement the action correctly
24119 this time as I seem to be on crack ;-)
24121 2001-09-02 Miguel de Icaza <miguel@ximian.com>
24123 * rootcontext.cs (RootContext::IsNamespace): new function, used to
24124 tell whether an identifier represents a namespace.
24126 * expression.cs (NamespaceExpr): A namespace expression, used only
24127 temporarly during expression resolution.
24128 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24129 utility functions to resolve names on expressions.
24131 2001-09-01 Miguel de Icaza <miguel@ximian.com>
24133 * codegen.cs: Add hook for StatementExpressions.
24135 * class.cs: Fix inverted test for static flag in methods.
24137 2001-09-02 Ravi Pratap <ravi@ximian.com>
24139 * class.cs (Operator::CheckUnaryOperator): Correct error number used
24140 to make it coincide with MS' number.
24141 (Operator::CheckBinaryOperator): Ditto.
24143 * ../errors/errors.txt : Remove error numbers added earlier.
24145 * ../errors/cs1019.cs : Test case for error # 1019
24147 * ../errros/cs1020.cs : Test case for error # 1020
24149 * cs-parser.jay : Clean out commented cruft.
24150 (dimension_separators, dimension_separator): Comment out. Ostensibly not
24151 used anywhere - non-reducing rule.
24152 (namespace_declarations): Non-reducing rule - comment out.
24154 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24155 with TypeContainer::AddEnum.
24157 * delegate.cs : New file for delegate handling classes.
24158 (Delegate): Class for declaring delegates.
24160 * makefile : Update.
24162 * cs-parser.jay (delegate_declaration): Implement.
24164 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
24166 * class.cs (Event::Define): Implement.
24167 (Event.EventBuilder): New member.
24169 * class.cs (TypeContainer::Populate): Update to define all enums and events
24171 (Events): New property for the events arraylist we hold. Shouldn't we move to using
24172 readonly fields for all these cases ?
24174 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24176 * class.cs (Property): Revamp to use the convention of making fields readonly.
24177 Accordingly modify code elsewhere.
24179 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24180 the Define method of the Property class.
24182 * class.cs : Clean up applied patch and update references to variables etc. Fix
24184 (TypeContainer::Populate): Update to define all the properties we have. Also
24185 define all enumerations.
24187 * enum.cs (Define): Implement.
24189 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24191 * cs-parser.jay (overloadable_operator): The semantic value is an
24192 enum of the Operator class.
24193 (operator_declarator): Implement actions.
24194 (operator_declaration): Implement.
24196 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24197 validity of definitions.
24198 (Operator::CheckBinaryOperator): Static method to check for binary operators
24199 (TypeContainer::AddOperator): New method to add an operator to a type.
24201 * cs-parser.jay (indexer_declaration): Added line to actually call the
24202 AddIndexer method so it gets added ;-)
24204 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
24205 already taken care of by the MS compiler ?
24207 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24209 * class.cs (Operator): New class for operator declarations.
24210 (Operator::OpType): Enum for the various operators.
24212 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24214 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24215 ostensibly handle this in semantic analysis.
24217 * cs-parser.jay (general_catch_clause): Comment out
24218 (specific_catch_clauses, specific_catch_clause): Ditto.
24219 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24220 (catch_args, opt_catch_args): New productions.
24221 (catch_clause): Rewrite to use the new productions above
24222 (catch_clauses): Modify accordingly.
24223 (opt_catch_clauses): New production to use in try_statement
24224 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24225 and re-write the code in the actions to extract the specific and
24226 general catch clauses by being a little smart ;-)
24228 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24229 Hooray, try and catch statements parse fine !
24231 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24233 * statement.cs (Block::GetVariableType): Fix logic to extract the type
24234 string from the hashtable of variables.
24236 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24237 I end up making that mistake ;-)
24238 (catch_clauses): Fixed gross error which made Key and Value of the
24239 DictionaryEntry the same : $1 !!
24241 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24243 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24245 * cs-parser.jay (event_declaration): Correct to remove the semicolon
24246 when the add and remove accessors are specified.
24248 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24250 * cs-parser.jay (IndexerDeclaration): New helper class to hold
24251 information about indexer_declarator.
24252 (indexer_declarator): Implement actions.
24253 (parsing_indexer): New local boolean used to keep track of whether
24254 we are parsing indexers or properties. This is necessary because
24255 implicit_parameters come into picture even for the get accessor in the
24256 case of an indexer.
24257 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24259 * class.cs (Indexer): New class for indexer declarations.
24260 (TypeContainer::AddIndexer): New method to add an indexer to a type.
24261 (TypeContainer::indexers): New member to hold list of indexers for the
24264 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24266 * cs-parser.jay (add_accessor_declaration): Implement action.
24267 (remove_accessor_declaration): Implement action.
24268 (event_accessors_declaration): Implement
24269 (variable_declarators): swap statements for first rule - trivial.
24271 * class.cs (Event): New class to hold information about event
24273 (TypeContainer::AddEvent): New method to add an event to a type
24274 (TypeContainer::events): New member to hold list of events.
24276 * cs-parser.jay (event_declaration): Implement actions.
24278 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24280 * cs-parser.jay (dim_separators): Implement. Make it a string
24281 concatenating all the commas together, just as they appear.
24282 (opt_dim_separators): Modify accordingly
24283 (rank_specifiers): Update accordingly. Basically do the same
24284 thing - instead, collect the brackets here.
24285 (opt_rank_sepcifiers): Modify accordingly.
24286 (array_type): Modify to actually return the complete type string
24287 instead of ignoring the rank_specifiers.
24288 (expression_list): Implement to collect the expressions
24289 (variable_initializer): Implement. We make it a list of expressions
24290 essentially so that we can handle the array_initializer case neatly too.
24291 (variable_initializer_list): Implement.
24292 (array_initializer): Make it a list of variable_initializers
24293 (opt_array_initializer): Modify accordingly.
24295 * expression.cs (New::NType): Add enumeration to help us
24296 keep track of whether we have an object/delegate creation
24297 or an array creation.
24298 (New:NewType, New::Rank, New::Indices, New::Initializers): New
24299 members to hold data about array creation.
24300 (New:New): Modify to update NewType
24301 (New:New): New Overloaded contructor for the array creation
24304 * cs-parser.jay (array_creation_expression): Implement to call
24305 the overloaded New constructor.
24307 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
24309 * class.cs (TypeContainer::Constructors): Return member
24310 constructors instead of returning null.
24312 2001-08-26 Miguel de Icaza <miguel@ximian.com>
24314 * typemanager.cs (InitCoreTypes): Initialize the various core
24315 types after we have populated the type manager with the user
24316 defined types (this distinction will be important later while
24317 compiling corlib.dll)
24319 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24320 on Expression Classification. Now all expressions have a method
24321 `Resolve' and a method `Emit'.
24323 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24324 generation from working. Also add some temporary debugging
24327 2001-08-24 Miguel de Icaza <miguel@ximian.com>
24329 * codegen.cs: Lots of code generation pieces. This is only the
24330 beginning, will continue tomorrow with more touches of polish. We
24331 handle the fundamentals of if, while, do, for, return. Others are
24332 trickier and I need to start working on invocations soon.
24334 * gen-treedump.cs: Bug fix, use s.Increment here instead of
24337 * codegen.cs (EmitContext): New struct, used during code
24338 emission to keep a context. Most of the code generation will be
24341 * cs-parser.jay: Add embedded blocks to the list of statements of
24342 this block. So code generation proceeds in a top down fashion.
24344 2001-08-23 Miguel de Icaza <miguel@ximian.com>
24346 * statement.cs: Add support for multiple child blocks.
24348 2001-08-22 Miguel de Icaza <miguel@ximian.com>
24350 * codegen.cs (EmitCode): New function, will emit the code for a
24351 Block of code given a TypeContainer and its ILGenerator.
24353 * statement.cs (Block): Standard public readonly optimization.
24354 (Block::Block constructors): Link children.
24355 (Block::Child): Child Linker.
24356 (Block::EmitVariables): Emits IL variable declarations.
24358 * class.cs: Drop support for MethodGroups here, delay until
24360 (Method::): Applied the same simplification that I did before, and
24361 move from Properties to public readonly fields.
24362 (Method::ParameterTypes): Returns the parameter types for the
24363 function, and implements a cache that will be useful later when I
24364 do error checking and the semantic analysis on the methods is
24366 (Constructor::GetCallingConvention): Renamed from CallingConvetion
24367 and made a method, optional argument tells whether this is a class
24368 or a structure to apply the `has-this' bit.
24369 (Method::GetCallingConvention): Implement, returns the calling
24371 (Method::Define): Defines the type, a second pass is performed
24372 later to populate the methods.
24374 (Constructor::ParameterTypes): implement a cache similar to the
24375 one on Method::ParameterTypes, useful later when we do semantic
24378 (TypeContainer::EmitMethod): New method. Emits methods.
24380 * expression.cs: Removed MethodGroup class from here.
24382 * parameter.cs (Parameters::GetCallingConvention): new method.
24384 2001-08-21 Miguel de Icaza <miguel@ximian.com>
24386 * class.cs (TypeContainer::Populate): Drop RootContext from the
24389 (Constructor::CallingConvention): Returns the calling convention.
24390 (Constructor::ParameterTypes): Returns the constructor parameter
24393 (TypeContainer::AddConstructor): Keep track of default constructor
24394 and the default static constructor.
24396 (Constructor::) Another class that starts using `public readonly'
24397 instead of properties.
24399 (Constructor::IsDefault): Whether this is a default constructor.
24401 (Field::) use readonly public fields instead of properties also.
24403 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24404 track of static constructors; If none is used, turn on
24405 BeforeFieldInit in the TypeAttributes.
24407 * cs-parser.jay (opt_argument_list): now the return can be null
24408 for the cases where there are no arguments.
24410 (constructor_declarator): If there is no implicit `base' or
24411 `this', then invoke the default parent constructor.
24413 * modifiers.cs (MethodAttr): New static function maps a set of
24414 modifiers flags into a MethodAttributes enum
24415 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
24416 MethodAttr, TypeAttr to represent the various mappings where the
24417 modifiers are used.
24418 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
24420 2001-08-19 Miguel de Icaza <miguel@ximian.com>
24422 * parameter.cs (GetParameterInfo): Fix bug where there would be no
24425 * interface.cs (PopulateIndexer): Implemented the code generator
24426 for interface indexers.
24428 2001-08-17 Miguel de Icaza <miguel@ximian.com>
24430 * interface.cs (InterfaceMemberBase): Now we track the new status
24433 (PopulateProperty): Implement property population. Woohoo! Got
24434 Methods and Properties going today.
24436 Removed all the properties for interfaces, and replaced them with
24437 `public readonly' fields.
24439 2001-08-16 Miguel de Icaza <miguel@ximian.com>
24441 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24442 initialize their hashtables/arraylists only when they are needed
24443 instead of doing this always.
24445 * parameter.cs: Handle refs and out parameters.
24447 * cs-parser.jay: Use an ArrayList to construct the arguments
24448 instead of the ParameterCollection, and then cast that to a
24451 * parameter.cs: Drop the use of ParameterCollection and use
24452 instead arrays of Parameters.
24454 (GetParameterInfo): Use the Type, not the Name when resolving
24457 2001-08-13 Miguel de Icaza <miguel@ximian.com>
24459 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24460 and instead use public readonly fields.
24462 * class.cs: Put back walking code for type containers.
24464 2001-08-11 Miguel de Icaza <miguel@ximian.com>
24466 * class.cs (MakeConstant): Code to define constants.
24468 * rootcontext.cs (LookupType): New function. Used to locate types
24471 2001-08-08 Miguel de Icaza <miguel@ximian.com>
24473 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
24474 this System.Reflection code is. Kudos to Microsoft
24476 * typemanager.cs: Implement a type cache and avoid loading all
24477 types at boot time. Wrap in LookupType the internals. This made
24478 the compiler so much faster. Wow. I rule!
24480 * driver.cs: Make sure we always load mscorlib first (for
24481 debugging purposes, nothing really important).
24483 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
24484 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
24486 * rootcontext.cs: Lookup types on their namespace; Lookup types
24487 on namespaces that have been imported using the `using' keyword.
24489 * class.cs (TypeContainer::TypeAttr): Virtualize.
24490 (Class::TypeAttr): Return attributes suitable for this bad boy.
24491 (Struct::TypeAttr): ditto.
24492 Handle nested classes.
24493 (TypeContainer::) Remove all the type visiting code, it is now
24494 replaced with the rootcontext.cs code
24496 * rootcontext.cs (GetClassBases): Added support for structs.
24498 2001-08-06 Miguel de Icaza <miguel@ximian.com>
24500 * interface.cs, statement.cs, class.cs, parameter.cs,
24501 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24502 Drop use of TypeRefs, and use strings instead.
24504 2001-08-04 Miguel de Icaza <miguel@ximian.com>
24508 * class.cs (Struct::Struct): set the SEALED flags after
24509 checking the modifiers.
24510 (TypeContainer::TypeAttr): new property, returns the
24511 TypeAttributes for a class.
24513 * cs-parser.jay (type_list): Oops, list production was creating a
24514 new list of base types.
24516 * rootcontext.cs (StdLib): New property.
24517 (GetInterfaceTypeByName): returns an interface by type name, and
24518 encapsulates error handling here.
24519 (GetInterfaces): simplified.
24520 (ResolveTree): Encapsulated all the tree resolution here.
24521 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24524 * driver.cs: Add support for --nostdlib, to avoid loading the
24525 default assemblies.
24526 (Main): Do not put tree resolution here.
24528 * rootcontext.cs: Beginning of the class resolution.
24530 2001-08-03 Miguel de Icaza <miguel@ximian.com>
24532 * rootcontext.cs: Provide better error reporting.
24534 * cs-parser.jay (interface_base): set our $$ to be interfaces.
24536 * rootcontext.cs (CreateInterface): Handle the case where there
24537 are no parent interfaces.
24539 (CloseTypes): Routine to flush types at the end.
24540 (CreateInterface): Track types.
24541 (GetInterfaces): Returns an array of Types from the list of
24542 defined interfaces.
24544 * typemanager.c (AddUserType): Mechanism to track user types (puts
24545 the type on the global type hash, and allows us to close it at the
24548 2001-08-02 Miguel de Icaza <miguel@ximian.com>
24550 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24551 RecordInterface instead.
24553 * cs-parser.jay: Updated to reflect changes above.
24555 * decl.cs (Definition): Keep track of the TypeBuilder type that
24556 represents this type here. Not sure we will use it in the long
24557 run, but wont hurt for now.
24559 * driver.cs: Smaller changes to accomodate the new code.
24561 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24564 * rootcontext.cs (CreateInterface): New method, used to create
24565 the System.TypeBuilder type for interfaces.
24566 (ResolveInterfaces): new entry point to resolve the interface
24568 (CodeGen): Property, used to keep track of the code generator.
24570 2001-07-26 Miguel de Icaza <miguel@ximian.com>
24572 * cs-parser.jay: Add a second production for delegate_declaration
24575 (enum_body): Put an opt_comma here instead of putting it on
24576 enum_body or enum_member_declarations so we can handle trailing
24577 commas on enumeration members. Gets rid of a shift/reduce.
24579 (type_list): Need a COMMA in the middle.
24581 (indexer_declaration): Tell tokenizer to recognize get/set
24583 * Remove old targets.
24585 * Re-add the parser target.
24587 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24589 * cs-parser.jay: Add precendence rules for a number of operators
24590 ot reduce the number of shift/reduce conflicts in the grammar.
24592 2001-07-17 Miguel de Icaza <miguel@ximian.com>
24594 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24597 Get rid of old crufty code.
24599 * rootcontext.cs: Use this to keep track of the parsed
24600 representation and the defined types available to the program.
24602 * gen-treedump.cs: adjust for new convention.
24604 * type.cs: Split out the type manager, and the assembly builder
24607 * typemanager.cs: the type manager will live here now.
24609 * cil-codegen.cs: And the code generator here.
24611 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
24613 * makefile: Fixed up for easy making.
24615 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24617 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24620 (unary_expression): Expand pre_increment_expression and
24621 post_decrement_expression to reduce a shift/reduce.
24623 2001-07-11 Simon Cozens
24625 * cs-tokenizer.cs: Hex numbers should begin with a 0.
24627 Improve allow_keyword_as_indent name.
24629 2001-06-19 Miguel de Icaza <miguel@ximian.com>
24631 * Adjustments for Beta2.
24633 2001-06-13 Miguel de Icaza <miguel@ximian.com>
24635 * decl.cs: Added `Define' abstract method.
24636 (InTransit): new property, used to catch recursive definitions.
24638 * interface.cs: Implement `Define'.
24640 * modifiers.cs: Map Modifiers.constants to
24641 System.Reflection.TypeAttribute flags.
24643 * class.cs: Keep track of types and user-defined types.
24644 (BuilderInit): New method for creating an assembly
24645 (ResolveType): New function to launch the resolution process, only
24646 used by interfaces for now.
24648 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24649 that are inserted into the name space.
24651 2001-06-08 Miguel de Icaza <miguel@ximian.com>
24653 * ARGH. I have screwed up my tree so many times due to the use of
24654 rsync rather than using CVS. Going to fix this at once.
24656 * driver.cs: Objetify driver. Load assemblies, use assemblies to
24659 2001-06-07 Miguel de Icaza <miguel@ximian.com>
24661 * Experiment successful: Use System.Type rather that our own
24664 2001-05-25 Miguel de Icaza <miguel@ximian.com>
24666 * cs-parser.jay: Removed nsAliases from here.
24668 Use new namespaces, handle `using XXX;'
24670 * namespace.cs: Reimplemented namespace handling, use a recursive
24671 definition of the class. Now we can keep track of using clauses
24672 and catch invalid using clauses.
24674 2001-05-24 Miguel de Icaza <miguel@ximian.com>
24676 * gen-treedump.cs: Adapted for all the renaming.
24678 * expression.cs (Expression): this class now has a Type property
24679 which returns an expression Type.
24681 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24682 `Type', as this has a different meaning now in the base
24684 2001-05-22 Miguel de Icaza <miguel@ximian.com>
24686 * interface.cs, class.cs: Removed from all the sources the
24687 references to signature computation, as we can not do method
24688 signature computation during the parsing time, as we are not
24689 trying to solve at that point distinguishing:
24693 void a (NS.Blah x) {}
24696 Which depending on the context might be valid or not, as we do not
24697 know if Blah is the same thing as NS.Blah at that point.
24699 * Redid everything so the code uses TypeRefs now instead of
24700 Types. TypeRefs are just temporary type placeholders, that need
24701 to be resolved. They initially have a pointer to a string and the
24702 current scope in which they are used. This is used later by the
24703 compiler to resolve the reference to an actual Type.
24705 * DeclSpace is no longer a CIR.Type, and neither are
24706 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
24707 are all DeclSpaces, but no Types.
24709 * type.cs (TypeRefManager): This implements the TypeRef manager,
24710 which keeps track of all the types that need to be resolved after
24711 the parsing has finished.
24713 2001-05-13 Miguel de Icaza <miguel@ximian.com>
24715 * ARGH. We are going to have to store `foreach' as a class rather
24716 than resolving it, as we need to verify error 1579 after name
24717 resolution. *OR* we could keep a flag that says `This request to
24718 IEnumerator comes from a foreach statement' which we can then use
24719 to generate the error.
24721 2001-05-10 Miguel de Icaza <miguel@ximian.com>
24723 * class.cs (TypeContainer.AddMethod): we now add methods to the
24724 MethodGroup instead of the method hashtable.
24726 * expression.cs: Add MethodGroup abstraction, which gets us one
24727 step closer to the specification in the way we handle method
24730 * cs-parser.jay (primary_expression): qualified_identifier now
24731 tried to match up an identifier to a local variable reference or
24732 to a parameter reference.
24734 current_local_parameters is now a parser global variable that
24735 points to the current parameters for the block, used during name
24738 (property_declaration): Now creates an implicit `value' argument to
24741 2001-05-09 Miguel de Icaza <miguel@ximian.com>
24743 * parameter.cs: Do not use `param' arguments as part of the
24744 signature, per the spec.
24746 2001-05-08 Miguel de Icaza <miguel@ximian.com>
24748 * decl.cs: Base class for classes, structs and interfaces. This
24749 is the "Declaration Space"
24751 * cs-parser.jay: Use CheckDef for checking declaration errors
24752 instead of having one on each function.
24754 * class.cs: Factor out some code for handling error handling in
24755 accordance to the "Declarations" section in the "Basic Concepts"
24756 chapter in the ECMA C# spec.
24758 * interface.cs: Make all interface member classes derive from
24759 InterfaceMemberBase.
24761 2001-05-07 Miguel de Icaza <miguel@ximian.com>
24763 * Many things: all interfaces are parsed and generated in
24764 gen-treedump. Support for member variables, constructors,
24765 destructors, properties, constants is there.
24767 Beginning of the IL backend, but very little done, just there for
24770 2001-04-29 Miguel de Icaza <miguel@ximian.com>
24772 * cs-parser.jay: Fix labeled statement.
24774 * cs-tokenizer.cs (escape): Escape " and ' always.
24775 ref_line, ref_name: keep track of the line/filename as instructed
24776 by #line by the compiler.
24779 2001-04-27 Miguel de Icaza <miguel@ximian.com>
24781 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24782 to match the values in System.CodeDOM.
24784 Divid renamed to Divide.
24786 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24788 (Statements.set): remove.
24790 * System.CodeDOM/CodeCatchClause.cs: always have a valid
24793 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24794 falseStatements always have valid values.
24796 * cs-parser.jay: Use System.CodeDOM now.