1 2007-01-28 Raja R Harinath <rharinath@novell.com>
4 * anonymous.cs (ScopeInfo.InflateParameters): New.
5 (AnonymousContainer.Resolve): Use it to redirect types of
8 2007-01-27 Raja R Harinath <rharinath@novell.com>
11 * expression.cs (Error_InvalidArguments): Don't use two different
12 messages for CS1503. Use ExtraInformation and
13 SymbolRelatedToPreviousError instead.
16 * decl.cs (DeclSpace.initialize_type_params): Don't access
17 'type_params' of a partial class directly.
19 2007-01-26 Miguel de Icaza <miguel@novell.com>
21 * constant.cs: Removed a handful of out-of-range checks that were
24 2007-01-25 Marek Safar <marek.safar@gmail.com>
26 * expression.cs (CheckUselessComparison): Add additional check for char
29 * namespace.cs: Fixed typo.
31 2007-01-23 Miguel de Icaza <miguel@novell.com>
33 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
34 gone, instead we inline the test, preventing the needless casts to
35 longs, ulongs and doubles for the parameters, avoiding calls to
36 methods that overchecked stuff, and instead inlined things
39 2007-01-20 Marek Safar <marek.safar@gmail.com>
41 * cs-parser.jay: Better parameter error handling.
43 2007-01-17 Marek Safar <marek.safar@gmail.com>
45 A fix for bug #80368, #80522
46 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
47 whether array initializer contains constants only.
48 (ArrayCreation.Emit): Use better formula to decide when
49 are array initializers for static initialization.
50 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
51 have to emit even constants otherwise they are pre-initialized.
53 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
54 Raja R Harinath <rharinath@novell.com>
56 Fix emit order of 'get' vs. 'set'.
57 * support.cs (Accessors): New.
58 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
59 Note the order in which accessors are declared in the source.
60 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
61 Refactored from Property.Define and Indexer.Define.
62 (PropertyBase.DefineAccessors): New helper that calls the above in
63 appropriate order as noted by the parser.
64 (Property.Define, Indexer.Define): Update to changes.
65 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
67 2007-01-17 Raja R Harinath <rharinath@novell.com>
69 Fix cs0029-6.cs and gcs0029-2.cs (regression)
70 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
71 there's an implicit conversion from the current type to the target
72 type before converting the underlying constant.
74 2007-01-16 Marek Safar <marek.safar@gmail.com>
76 * const.cs (ResolveValue): Updated after constant conversion was made more
79 * constant.cs (GetAttributableValue): constant to object conversion is
80 used for attributes only.
81 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
83 (LongConstant.ConvertImplicitly): Ditto.
85 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
86 (ImplicitConversionStandard): Handle constant conversion as extra step.
87 It solves the issue when constant conversion was called indirectly like
88 inside array initializer and constant folding was skipped.
90 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
93 * statement.cs(ImplicitConversionStandard): Updated after constant
94 conversion was made more generic.
96 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
98 * expression.cs (As.DoResolve): Use GenericConstraints instead of
99 Constraints, solves the problem where the compiler incorrectly
100 reported that a type parameter was not constrained to a class (Bug
103 2007-01-14 Marek Habersack <grendello@gmail.com>
105 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
107 2007-01-14 Marek Safar <marek.safar@gmail.com>
110 * assign.cs (FieldInitializer): New class implements field
111 initializer statement.
113 * attribute.cs: Update after FieldMember rename.
115 * class.cs (PropertyBasedMember): New common class for property based
117 (InterfaceMemberBase): New base class for all members which can be used as
118 an interface members.
119 (MethodCore): Moved really common code to InterfaceMemberBase.
120 (Method.Define): Equal and GetHasCode detection is relevant for methods
122 (MethodData.Define): Don't assume that public event implements an
123 interface automatically.
124 (MethodData.DefineMethodBuilder): Issue an error even if only extern
126 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
127 (FieldMember): Merged with FieldBase.
128 (EventProperty.AEventPropertyAccessor): New specialization to check whether
129 event extern modifier can be used.
130 (EventField.EventFieldAccessor): Moved event field specific code here.
131 (Event.AllowedModifiers): Even event can be extern.
132 (Event.FindOutBaseMethod): New override specific to events.
133 (Indexer.parameters): Reintroduce parameters because base class holds
134 only properties common data.
135 (Indexer.CheckForDuplications): Indexers are threated as methods so we
136 need do extra parameters check.
138 * const.cs: Update after FieldMember rename.
140 * decl.cs (MemberCache.FindBaseEvent): New method.
142 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
143 to reflect that indexer is now derived from PropertyBased.
145 * ecore.cs (GetMemberType): Made public.
146 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
149 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
151 * typemanager.cs (CSharpSignature): Correctly print event accessors.
152 (RegisterEvent): Removed.
153 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
154 (GetPrivateFieldOfEvent): Renamed to GetEventField.
156 2007-01-11 Raja R Harinath <rharinath@novell.com>
159 * statement.cs (CollectionForeach.TryType): Prefer generic
160 GetEnumerator over non-generic variant. Fix code to follow comments.
162 2007-01-09 Raja R Harinath <rharinath@novell.com>
165 * support.cs (ReflectionParameter): Don't use an invalid index on
166 the generic parameter data.
168 2007-01-08 Miguel de Icaza <miguel@novell.com>
170 * driver.cs: Just add a tiny bit of infrastructure.
172 2007-01-02 Marek Safar <marek.safar@gmail.com>
174 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
175 where field type is struct from current assembly.
177 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
180 2007-01-02 Marek Safar <marek.safar@gmail.com>
183 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
186 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
188 (Namespace.LookupType): Always use core types from corlib when speficied.
190 * report.cs: A new warning.
192 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
193 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
194 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
196 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
197 (InitCoreTypes): Set expression type of object_type and value_type
198 immediately after lookup.
200 2007-01-01 Miguel de Icaza <miguel@novell.com>
202 * cs-tokenizer.cs: Accept Pc class characters (Connector
203 Punctuation) as valid identifiers. Fixes #78259
205 * expression.cs (Invocation.DoResolve): Moved the check for the
206 use of `this' for doing method calls to the Invocation resolution
207 step, after overload resolution has taken place instead of doing
208 the check at the low-level `This.DoResolve' level.
210 The `This.DoResolve' happens before overload resolution, so it has
211 no way of knowing if the method that will be called will be
212 instace or static, triggering an erroneous report for cs0188 (Bug
215 We now do the check for instance method invocations after we know
216 what method will be called.
218 (This.CheckThisUsage): Move the actual use of this structure
219 checking into its own method and expose it.
221 * Everywhere that called Error_ValueCannotBeConverted: pass a new
224 Exceptions: Null.ConvertImplicitly,
225 Constant.ImplicitConversionRequired as there are too many call
226 sites for passing the ec.
228 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
229 EmitContext, if the value is null, then we do not try to provide
230 the extra information from the error (If a userdefined conversion
231 exists, as UserDefinedConversion requires a non null-EmitContext).
235 2006-12-30 Raja R Harinath <rharinath@novell.com>
237 * flowanalysis.cs (MyBitVector): Document some invariants.
238 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
239 introduced below, and add a couple of others,
241 2006-12-30 Marek Safar <marek.safar@gmail.com>
243 * attribute.cs (GetMethodObsoleteAttribute): Uses new
244 GetPropertyFromAccessor and GetEventFromAccessor.
246 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
247 overrides non-obsolete one.
248 (Indexer.Define): Error message has been moved to the parser.
250 * cs-parser.jay: Better syntax errors handling.
252 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
253 when an invocation has no arguments.
255 * ecore.cs: Removed not used caching.
257 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
260 * report.cs: Add a new warning.
262 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
264 * typemanager.cs (enumeration_type): Removed.
265 (CSharpSignature): Reuses IsSpecialMethod.
266 (IsEqual): Hack for MS BCL.
267 (GetPropertyFromAccessor): New method.
268 (GetEventFromAccessor): New method.
269 (IsSpecialMethod): Fixed to handle more cases.
271 2006-12-30 Marek Safar <marek.safar@gmail.com>
273 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
274 Made white spaces array static.
276 * ecore.cs (RemoveGenericArity): Optimized.
278 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
280 (MyBitVector.initialize_vector): Simplified.
282 2006-12-22 Miguel de Icaza <miguel@novell.com>
284 * ecore.cs: Am not entirely happy with this hack, but it seems to
285 address the issue in 80257 (a small test case for
288 I set the MethodGroupExpr.Type to an internal compiler type
289 (itself in this case) to force the resolution to take place. Why
290 it does not take place with a null is beyond me.
292 2006-12-20 Marek Safar <marek.safar@gmail.com>
295 * expression.cs (ResolveOperator): Consider user defined conversion for
296 logical and operator too.
297 (EmitBranchable): Optimization for logical and when full constant folding
298 could not be applied but one operand is constant.
300 2006-12-19 Marek Safar <marek.safar@gmail.com>
302 * class.cs (GetClassBases): Write 5 times every day, will never use
303 FullName for error reporting.
305 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
307 2006-12-19 Martin Baulig <martin@ximian.com>
309 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
310 the symbol file info here.
312 2006-12-18 Marek Safar <marek.safar@gmail.com>
314 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
315 of `elseif' is taking then following sections are not taking.
316 Fixes an issue reported on mono mailing list.
318 2006-12-18 Marek Safar <marek.safar@gmail.com>
321 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
322 a caller is not taking.
324 2006-12-18 Raja R Harinath <rharinath@novell.com>
326 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
327 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
328 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
329 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
330 * class.cs: Update to changes.
332 2006-12-17 Marek Safar <marek.safar@gmail.com>
335 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
338 * class.cs (ResolveMembers): Register an iterator in current container and
341 2006-12-16 Raja R Harinath <rharinath@novell.com>
344 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
345 satisfy a params annotated parameter.
347 2006-12-16 Marek Safar <marek.safar@gmail.com>
350 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
351 paramters correctly and not rely on hacks in Parameters class.
352 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
354 (Invocation.VerifyArgumentsCompat): Ditto.
355 (Invocation.EmitArguments): Changed to correctly emit params arguments at
358 * parameter.cs (HasParams): Don't assume that params is the last one.
360 * support.cs (ReflectionParameters.ctor): Look for params attribute
362 (ReflectionParameters.ParameterType): Removed hack when we returned last
363 parameter for out of range parameters.
364 (ParameterName, ParameterModifier): Ditto.
366 2006-12-14 Marek Safar <marek.safar@gmail.com>
369 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
370 when assembly is not CLS compliant but type is. I have no idea why is this
373 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
375 2006-12-13 Miguel de Icaza <miguel@novell.com>
377 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
378 in struct constructors, they are basically no-ops.
380 2006-12-12 Marek Safar <marek.safar@gmail.com>
382 * cs-tokenizer.cs (Position): Save preprocessor status too.
384 2006-12-12 Marek Safar <marek.safar@gmail.com>
387 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
389 2006-12-12 Marek Safar <marek.safar@gmail.com>
391 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
393 (pp_expr): Report error for an invalid expression.
394 (handle_preprocessing_directive): Simplified; add more error checking.
396 2006-12-11 Marek Safar <marek.safar@gmail.com>
399 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
402 2006-12-10 Marek Safar <marek.safar@gmail.com>
404 A fix for bugs #80093, and #75984
405 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
406 logic, it seems to me as it worked before "by coincidence".
407 (xtoken): Simplified to use reworked handle_preprocessing_directive.
408 (cleanup): Enabled endif check.
410 2006-12-09 Marek Safar <marek.safar@gmail.com>
413 * statement.cs (CollectionForeach.TryType): Generics and non-generics
414 enumerators are never ambiguous.
416 2006-12-08 Raja R Harinath <rharinath@novell.com>
419 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
421 2006-12-06 Marek Safar <marek.safar@gmail.com>
424 * class.cs (EventProperty.Define): Explicit implementation means
425 that an even is used.
427 2006-12-06 Marek Safar <marek.safar@gmail.com>
429 Fixes the operators implementation (part II)
431 * cfold.cs (DoConstantNumericPromotions): Renamed to
432 DoBinaryNumericPromotions and simplified.
433 (BinaryFold): Couple of conversion fixes; simplified.
435 * constant.cs, ecore.cs, literal.cs
436 (ToType): Renamed to ConvertImplicitly.
437 (Reduce): Renamed to ConvertExplicitly.
439 * class.cs, convert.cs: Updated.
441 * expression.cs: TryReduce doesn't throw an exception.
443 2006-12-01 Marek Safar <marek.safar@gmail.com>
446 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
449 2006-11-30 Marek Safar <marek.safar@gmail.com>
451 Fixes unary operators implementation (part I)
454 * cfold.cs (Error_CompileTimeOverflow): Made internal
456 * const.cs (IConstant): Changed to use reference to constant and
458 Updated IConstant implementations.
460 * constant.cs (CreateConstant): New factory method.
461 Updated IConstant implementation.
463 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
465 * ecore.cs: Updated to use CreateConstantReference.
467 * enum.cs: Reflects IConstant changes.
469 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
471 * literal.cs (NullConstant): Change to be independently usable.
473 2006-11-29 Martin Baulig <martin@ximian.com>
475 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
476 we need to emit the scope initializer before calling the base .ctor.
478 * anonymous.cs: Merged back from the new anonymous methods branch.
479 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
481 * expression.cs (ParameterReference.DoResolveBase): Create a
482 "normal" ScopeInfo when capturing parameters rather than using the
483 root scope; this makes things work with anonymous methods having
487 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
489 2006-11-22 Marek Safar <marek.safar@gmail.com>
492 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
493 check to a base class.
494 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
495 only when assembly has missing attribute.
498 2006-11-21 Marek Safar <marek.safar@gmail.com>
500 * cs-tokenizer.cs: Merged with gmcs version.
502 2006-11-20 Marek Safar <marek.safar@gmail.com>
505 * cs-parser.jay: Better error message when partial keyword is misplaced.
507 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
510 report.cs: CS1058 only applies to 2.0 profile (gmcs).
511 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
512 a RuntimeWrappedException by default.
514 2006-11-18 Marek Safar <marek.safar@gmail.com>
517 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
519 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
521 2006-11-18 Marek Safar <marek.safar@gmail.com>
523 * driver.cs, namespace.cs: Uses faster IndexOf version.
525 2006-11-17 Marek Safar <marek.safar@gmail.com>
528 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
530 (Operator.Define): Implicit/Explicit operator of same type is duplicate
531 even if internal name is different.
532 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
533 (UserDefinedConversion): Simplified as the operators cannot be internal.
534 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
536 (MethodLookup): Replaced EmitContext with parentType.
537 * expression.cs: Updated.
539 2006-11-09 Raja R Harinath <rharinath@novell.com>
541 * driver.cs (BadAssembly): Handle all the ugliness of
542 DefineDynamicAssembly.
544 2006-11-08 Raja R Harinath <rharinath@novell.com>
546 Address parts of #58244 -- most of what's left is in the runtime
547 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
548 CS1509 error checks, and handle them for all assembly loads, not
549 just the first invocation.
550 (LoadModule): Likewise. Move handling of 'adder_method' ...
551 * codegen.cs (AssemblyClass.AddModule): ... here.
553 2006-11-02 Marek Safar <marek.safar@gmail.com>
555 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
556 IEnumerable<T> is ambiguous.
558 2006-10-31 Marek Safar <marek.safar@gmail.com>
561 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
562 GetEnumerator is ambiguous.
564 * report.cs: Add new warning.
566 2006-10-29 Marek Safar <marek.safar@gmail.com>
569 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
570 to protected member can be nested type.
572 2006-10-28 Marek Safar <marek.safar@gmail.com>
575 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
576 to protected member must derive from current type.
578 2006-10-27 Marek Safar <marek.safar@gmail.com>
580 assign.cs: Reuses error method.
582 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
583 instead of type for constants.
584 (Expression.Error_ValueAssignment): Common error method.
586 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
589 2006-10-27 Marek Safar <marek.safar@gmail.com>
592 * expression.cs (MemberAccess.DoResolve): Check nested type
595 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
597 * doc.cs : nested delegates were not handled. Fixed bug #79754.
599 2006-10-26 Marek Safar <marek.safar@gmail.com>
602 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
604 2006-10-26 Marek Safar <marek.safar@gmail.com>
606 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
607 type forwarder of the same type multiple times.
609 2006-10-26 Raja R Harinath <rharinath@novell.com>
612 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
613 instance as an rvalue, even when we later resolve as an lvalue.
615 2006-10-25 Martin Baulig <martin@ximian.com>
617 * anonymous.cs: Fix #79673.
619 2006-10-24 Marek Safar <marek.safar@seznam.cz>
622 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
623 ignored when is optimized (= default value) as its value is already set.
625 2006-10-23 Marek Safar <marek.safar@seznam.cz>
628 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
629 TypeContainer for type lookup.
631 2006-10-23 Marek Safar <marek.safar@seznam.cz>
634 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
635 * expression.cs (OverloadResolve): Always convert type name for
637 (ResolveNamespaceOrType): Don't confuse a nested type with any
640 2006-10-18 Martin Baulig <martin@ximian.com>
642 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
644 2006-10-17 Miguel de Icaza <miguel@novell.com>
646 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
647 an int32, but requesting an int64 from the conversion
649 2006-10-12 Martin Baulig <martin@ximian.com>
652 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
654 2006-10-12 Martin Baulig <martin@ximian.com>
657 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
659 2006-10-11 Miguel de Icaza <miguel@novell.com>
661 * convert.cs: Remove broken code: I was doing the "Existance"
662 tests for Implicit conversions.
664 2006-10-10 Miguel de Icaza <miguel@novell.com>
666 * convert.cs: Added one missing case in
667 ImplicitStandardConversionExists uint64 to intptr.
671 * typemanager.cs (uintptr_type): another core known type.
673 * ecore.cs (OperatorCast): routine used to do cast operations that
674 depend on op_Explicit. We could change some of the Decimal
675 conversions to use this.
677 This one has a probe mechanism that checks both types for an op_
678 which it coudl be used to eliminate two classes: CastToDecimal
681 * convert.cs: Implement the conversions documented in #59800
683 2006-10-10 Martin Baulig <martin@ximian.com>
685 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
686 before RootScope.ResolveMembers().
688 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
689 `CurrentType' if appropriate.
691 2006-10-09 Marek Safar <marek.safar@seznam.cz>
694 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
695 when contains binary operators.
696 * cs-parser.jay: Updated.
698 2006-10-09 Martin Baulig <martin@ximian.com>
701 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
702 moved that into Define() and also do the other type parameter
703 checks there. Fixes #79094. Added gtest-292.cs.
706 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
707 since that doesn't include type parameters; don't use `Ldelema'
708 for type parameters. Fixes #78980. Added gtest-293.cs.
710 2006-10-08 Marek Safar <marek.safar@seznam.cz>
713 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
714 conversion is allowed.
716 2006-10-06 Marek Safar <marek.safar@seznam.cz>
718 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
719 error reporting when no error occurs.
721 2006-10-06 Marek Safar <marek.safar@seznam.cz>
723 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
726 2006-10-06 Raja R Harinath <rharinath@novell.com>
729 * class.cs (DefineTypeBuilder): Check circular dependencies before
730 setting the parent of the TypeBuilder.
731 (CheckRecursiveDefinition): Don't use 'BaseType', since
732 it may not be valid until after DefineTypeBuilder. Use
735 2006-10-04 Martin Baulig <martin@ximian.com>
737 Merged the Anonymous Methods patch.
739 * anonymous.cs, iterators.cs: The new anonymous methods code.
741 * statement.cs (Variable): New public abstract class.
742 (LocalInfo.Variable): New public property.
743 (LocalInfo.ResolveVariable): New public method.
744 (Block.Flags): Add `IsIterator'.
745 (Block.AddVariable): Improved the CS0136 check.
746 (Block.AnonymousChildren): New public property.
747 (Block.AddAnonymousChild): New public method.
748 (ToplevelBlock): Update to use the new anonymous method framework.
749 (ToplevelBlock.ctor): `container' is now a `Block' and not a
750 `ToplevelBlock'; this is required to correctly implement the
752 (Fixed, Using): Use `TemporaryVariable' instead of directly
753 creating the `LocalBuilder'.
755 * parameter.cs (Parameter.ResolveVariable): New public method.
756 (Parameters.ResolveVariable): Likewise.
758 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
760 * class.cs (TypeContainer): Replaced the `iterators' list and
761 corresponding methods with a list of `CompilerGeneratedClass'es.
762 (TypeContainer.ResolveMembers): New public method.
763 (Method): `IIteratorContainer' has been replaced by
766 * expression.cs (VariableReference): New public abstract base
767 class for `LocalVariableReference', `ParameterReference' and
770 * codegen.cs (EmitContext): Removed `capture_context',
771 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
772 (EmitContext.EmitThis): Removed.
774 * cs-parser.jay: Replace `iterator_container' with
777 2006-10-04 Martin Baulig <martin@ximian.com>
779 * generic.cs (GenericMethod): Don't make this abstract.
780 (Constraints.Clone): Added dummy implementation.
782 2006-10-04 Raja R Harinath <harinath@gmail.com>
785 * namespace.cs (LookForAnyGenericType): Avoid nullref on
786 'declspaces'. Avoid allocating arrays willy-nilly.
789 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
790 cases out of the switch.
792 2006-09-28 Marek Safar <marek.safar@seznam.cz>
794 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
795 message when non-generic type is used with the type arguments.
796 * expression.cs: Updated.
798 2006-09-28 Raja R Harinath <rharinath@novell.com>
801 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
802 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
803 Change semantics slightly. Don't insist on having only one
804 temporary EmptyExpression -- just throttle the creation of new ones.
807 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
808 non-interfaces too. If no methods are found, don't try to create
811 2006-09-28 Marek Safar <marek.safar@seznam.cz>
813 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
816 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
817 us produce better error message.
819 2006-09-27 Marek Safar <marek.safar@seznam.cz>
821 * expression.cs (Binary.ResolveOperator): Warn about a side effect
824 * report.cs: A new warning added.
826 2006-09-27 Martin Baulig <martin@ximian.com>
828 * generic.cs (GenericMethod): Don't make this abstract.
830 2006-09-27 Martin Baulig <martin@ximian.com>
833 (InternalErrorException): Added overloaded ctor taking a params array.
835 2006-09-26 Marek Safar <marek.safar@seznam.cz>
837 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
838 Fixed the cases when same error was reported twice.
840 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
841 now report symbol information.
843 2006-09-25 Martin Baulig <martin@ximian.com>
845 * class.cs: Completely unified with the gmcs version.
847 2006-09-25 Martin Baulig <martin@ximian.com>
849 * typemanager.cs (TypeManager.IsNullableType): New public function.
850 (TypeManager.IsNullableTypeOf): Likewise.
851 (TypeManager.IsNullableValueType): Likewise.
853 * class.cs (MethodCore): Added the `GenericMethod' argument from
854 gmcs and also unified all classes derived from `MethodCore' with gmcs.
856 2006-09-24 Raja R Harinath <harinath@gmail.com>
858 * convert.cs: Unify with gmcs version.
860 2006-09-24 Marek Safar <marek.safar@seznam.cz>
862 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
865 * report.cs: New warning.
867 2006-09-24 Marek Safar <marek.safar@seznam.cz>
869 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
870 for anonymous block with out argument.
872 2006-09-24 Marek Safar <marek.safar@seznam.cz>
874 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
875 not used private events only.
877 2006-09-23 Marek Safar <marek.safar@seznam.cz>
879 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
881 * const.cs (Const.Define): Check for constant type.
882 (Const.IsConstantTypeValid): Looks for valid constant types.
884 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
886 * ecore.cs (EmptyConstantCast): New common class for all constant based
889 * expression.cs (Is.DoResolve): Handle null constant especially.
890 (New.DoResolve): Check for new void().
891 (MemberAccess.DoResolve): Cope with all kind of nulls.
893 * literal.cs (NullConstant): Uses EmptyConstantCast.
894 (NullDefault): Based on EmptyConstantCast.
895 (NullLiteral): Uses EmptyConstantCast.
897 * statement.cs (Block.ResolveMeta): Check for constant type.
899 2006-09-22 Martin Baulig <martin@ximian.com>
901 * delegate.cs, attribute.cs: Merged with the gmcs versions.
903 2006-09-22 Raja R Harinath <rharinath@novell.com>
905 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
909 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
910 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
913 2006-09-22 Martin Baulig <martin@ximian.com>
915 * ecore.cs: Merged with the gmcs version.
917 * generic.cs (ConstructedType): New dummy class.
918 (TypeArguments): Don't make this abstract.
921 (TypeManager.IsGenericTypeDefinition): New method.
922 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
924 2006-09-22 Raja R Harinath <rharinath@novell.com>
926 * expression.cs (ComposedCast): Check for arrays of TypedReference
927 before creating the type, not after.
929 2006-09-21 Marek Safar <marek.safar@seznam.cz>
931 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
934 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
935 when constant must be implicitly convertible.
937 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
939 * ecore.cs (NullCast): Derives from NullConstant.
941 * expression.cs (Is.DoResolve): Removed useless variables.
942 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
943 (New.Constantify): Add enum support.
944 (MemberAccess.DoResolve): Add warning when accessing null constant or
947 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
950 * literal.cs (NullConstant): New abstract class with common
951 functionality for all null specializations.
952 (NullDefault): Represents default(X) when result can be
954 (NullLiteral): Updated.
956 * report.cs: Add new warning.
958 2006-09-21 Martin Baulig <martin@ximian.com>
960 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
962 2006-09-21 Martin Baulig <martin@ximian.com>
964 * generic.cs (GenericConstraints): New dummy class.
965 (Constraints): Likewise.
966 (TypeParameter): Likewise.
967 (TypeParameterName): Likewise.
968 (GenericMethod): Likewise.
970 * typemanager.cs (TypeManager.GetGenericArguments): New method.
972 * decl.cs: Merged with the gmcs version.
974 2006-09-21 Raja R Harinath <rharinath@novell.com>
976 * generic.cs (TypeParameter): Implement IMemberContainer.
977 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
979 * rootcontext.cs: Unify with gmcs version.
981 * report.cs: Unify with gmcs version.
982 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
983 from gmcs/generics.cs.
984 * generics.cs (TypeParameter): New dummy class.
986 * support.cs: Unify with gmcs version.
988 2006-09-20 Raja R Harinath <rharinath@novell.com>
990 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
991 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
993 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
994 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
995 * mcs.exe.sources: Add generic.cs.
997 * codegen.cs: Unify with gmcs version.
999 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
1000 (EmitContext): Add GenericDeclContainer implementation.
1001 * decl.cs (MemberCore, DeclSpace): Likewise.
1002 * namespace.cs: Remove #ifdef GMCS_SOURCE.
1004 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
1005 MCS TypeManager has a corresponding dummy method.
1007 2006-09-19 Martin Baulig <martin@ximian.com>
1009 * expression.cs: Completely merged with the gmcs version.
1011 2006-09-19 Martin Baulig <martin@ximian.com>
1013 * expression.cs (Invocation): Merged with the gmcs version.
1014 (ArrayAccess.GetStoreOpcode): Likewise.
1016 2006-09-19 Martin Baulig <martin@ximian.com>
1019 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
1020 (TypeManager.IsGenericMethodDefinition): Likewise.
1022 2006-09-19 Martin Baulig <martin@ximian.com>
1025 (TypeManager.IsEqual): Moved the gmcs implementation here.
1026 (TypeManager.DropGenericTypeArguments): Likewise.
1027 (TypeManager.DropGenericMethodArguments): Likewise.
1028 (TypeManager.GetTypeArguments): Moved here from gmcs.
1029 (TypeManager.HasGenericArguments): Likewise.
1031 2006-09-19 Martin Baulig <martin@ximian.com>
1033 * expression.cs (Binary): Merged with the gmcs version.
1035 2006-09-19 Martin Baulig <martin@ximian.com>
1037 * expression.cs (Probe, As, Is): Merged with the gmcs version.
1039 2006-09-19 Martin Baulig <martin@ximian.com>
1041 * typemanager.cs: Merged with the gmcs version.
1043 2006-09-16 Raja R Harinath <rharinath@novell.com>
1045 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
1046 * driver.cs: Likewise.
1048 2006-09-16 Marek Safar <marek.safar@seznam.cz>
1051 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
1052 only if parent type is class.
1053 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
1056 2006-09-15 Marek Safar <marek.safar@seznam.cz>
1059 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
1061 * typemanager.cs(CSharpName): Converts NullType to null.
1063 2006-09-15 Martin Baulig <martin@ximian.com>
1066 (TypeManager.GetMethodName): Added mcs implementation.
1067 (TypeManager.IsEqual): Likewise.
1070 (SimpleName.RemoveGenericArity): Added dummy implementation.
1072 * pending.cs: Merged with the gmcs version.
1074 2006-09-15 Martin Baulig <martin@ximian.com>
1076 * statement.cs: Merge with the gmcs version.
1078 2006-09-15 Martin Baulig <martin@ximian.com>
1080 * statement.cs (Switch): Merge with the gmcs implementation
1081 (without nullables), which is newer.
1083 2006-09-15 Martin Baulig <martin@ximian.com>
1085 * statement.cs (Block.Variables): Make this public.
1086 (ToplevelBlock.Parameters): Make this a property.
1087 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
1089 2006-09-15 Martin Baulig <martin@ximian.com>
1091 * namespace.cs: Merge with the gmcs version.
1093 2006-09-15 Martin Baulig <martin@ximian.com>
1095 * decl.cs (MemberName): Minor code cleanups.
1097 2006-09-15 Martin Baulig <martin@ximian.com>
1099 * parameter.cs: Merge with the gmcs version.
1101 2006-09-15 Martin Baulig <martin@ximian.com>
1103 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
1104 and an error in mcs.
1106 2006-09-15 Martin Baulig <martin@ximian.com>
1108 * flowanalysis.cs: Merged from GMCS; added the generics code into
1109 a `GMCS_SOURCE' conditional so we can share this file.
1111 2006-09-08 Martin Baulig <martin@ximian.com>
1113 * typemanager.cs (TypeManager.interlocked_type): New public field.
1114 (TypeManager.int_interlocked_compare-exchange): New public field.
1115 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
1116 enumerator types here and call InitGenericCoreTypes().
1117 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
1118 after calling InitEnumUnderlyingTypes().
1121 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
1122 `classes_second_stage'.
1124 2006-09-14 Marek Safar <marek.safar@seznam.cz>
1126 * assign.cs, ecore.cs, expression.cs: Share error message text.
1127 * class.cs (FieldMember.Define): Check for varible of static type.
1128 * driver.cs (LoadAssembly): Uses error output for errors.
1129 * statement.cs: Updated.
1131 2006-09-08 Marek Safar <marek.safar@seznam.cz>
1133 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
1136 2006-09-07 Martin Baulig <martin@ximian.com>
1139 (MainDriver): Revert r62663 from Marek; see #70506 for details.
1141 2006-08-29 Miguel de Icaza <miguel@novell.com>
1143 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
1145 2006-08-17 Miguel de Icaza <miguel@novell.com>
1147 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
1148 #52019 and #79064, the use of the \uXXXX sequence in source code
1149 to represent unicode characters.
1151 2006-08-15 Marek Safar <marek.safar@seznam.cz>
1153 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
1155 * class.cs, ecore.cs, statement.cs: Merged to one error message.
1157 2006-08-13 Miguel de Icaza <miguel@novell.com>
1159 * assign.cs: Catch attempts to assign to a method groups in += and
1162 2006-08-13 Marek Safar <marek.safar@seznam.cz>
1165 * cs-parser.jay: Don't destroy current array type by typeof of array's.
1167 2006-08-12 Marek Safar <marek.safar@seznam.cz>
1169 * class.cs (Method.Define): Issue a warning when generic method looks like
1171 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
1174 2006-08-09 Marek Safar <marek.safar@seznam.cz>
1176 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
1178 * decl.cs (MemberCache.FindMembers): When container is interface we need to
1179 search all base interfaces as a member can be ambiguous.
1180 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
1181 Constructor member type filter.
1182 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
1183 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
1184 reporting for returned memberinfos.
1185 * report.cs: Updated.
1186 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
1187 version to work on all runtimes.
1188 (TypeManager.RealMemberLookup): Removed members filtering.
1190 2006-08-08 Raja R Harinath <rharinath@novell.com>
1192 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
1193 (PropertyExpr.EmitAssign): Likewise.
1194 * expression.cs (Indirection.EmitAssign): Likewise.
1195 (LocalVariableReference.EmitAssign): Likewise.
1196 (ParameterReference.EmitAssign): Likewise.
1197 (Invocation.EmitArguments): Likewise.
1198 (ArrayAccess.EmitAssign): Likewise.
1199 (IndexerAccess.EmitAssign): Likewise.
1200 (This.EmitAssign): Likewise.
1201 (ConditionalLogicalOperator.Emit): Likewise.
1204 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
1205 instead of ArrayList. If the hashtable has a LocalBuilder, don't
1206 leave it in after returning it.
1207 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
1209 2006-08-06 Marek Safar <marek.safar@seznam.cz>
1211 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
1214 2006-08-03 Raja R Harinath <rharinath@novell.com>
1216 Fix cs0146-3.cs and cs0146-4.cs.
1217 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
1218 enclosing types don't depend on the current type.
1220 2006-08-02 Raja R Harinath <rharinath@novell.com>
1223 * class.cs (TypeContainer.DoDefineMembers): Use
1224 FindBaseMemberWithSameName on Parent, since we're interested in
1225 whether we hide inherited members or not.
1226 (FindBaseMemberWithSameName): Make slightly more robust.
1228 Fix the non-generic testcase from #77396
1229 * decl.cs (DeclSpace.DeclContainer): Remove override.
1231 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
1232 declspaces for doppelgangers too.
1233 (UsingEntry): Implement IResolveContext.
1234 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
1235 'this' as the resolve context.
1236 (LocalAliasEntry): Likewise.
1238 Implement parts of #77403
1239 * roottypes.cs (RootDeclSpace): New. Used to represent the
1240 toplevel declaration space. Each namespace declaration introduces
1241 a "partial" root declaretion space.
1242 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
1243 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
1244 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
1245 from 'current_namespace.SlaveDeclSpace'.
1246 (namespace_declaration): Likewise.
1247 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
1248 check. It can't happen now.
1249 * decl.cs (DeclSpace.LookupType): Likewise.
1250 * driver.cs (MainDriver): Sanity check.
1252 2006-08-01 Raja R Harinath <rharinath@novell.com>
1254 * decl.cs (DeclSpace.FindNestedType): Remove.
1255 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
1256 LookupTypeContainer to get the container of the nested type.
1257 * class.cs (TypeContainer.FindNestedType): Make non-override.
1259 2006-07-31 Raja R Harinath <rharinath@novell.com>
1261 * decl.cs (DeclSpace.PartialContainer): Move field from ...
1262 * class.cs (TypeContainer.PartialContainer): ... here.
1263 (TypeContainer.AddBasesForPart): New helper.
1264 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
1266 * cs-parser.jay (current_class): Convert to DeclSpace.
1267 (struct_declaration, interface_declaration, class_declaration):
1268 Use AddBasesForPart instead of .Bases directly.
1269 * const.cs, iterators.cs: Update to changes.
1271 2006-07-28 Raja R Harinath <rharinath@novell.com>
1273 * class.cs (TypeContainer.AddMemberType): Rename from
1275 (TypeContainer.AddMember): Rename from AddToMemberContainer.
1276 (AddTypeContainer): New. Combine AddClassOrStruct and
1278 (AddPartial): Update. Add 'is_partial' argument.
1279 * roottypes.cs: Update to changes.
1280 * cs-parser.jay (push_current_class): New helper for handling
1281 current_container and current_class.
1282 (struct_declaration, interface_declaration, class_declaration):
1285 2006-07-26 Raja R Harinath <rharinath@novell.com>
1287 * roottypes.cs: Rename from tree.cs.
1289 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
1290 * tree.cs (Tree, ITreeDump): Remove types.
1291 * rootcontext.cs (tree, Tree): Remove fields.
1292 (root, ToplevelTypes): New.
1293 * *.cs: Update to rename.
1295 * tree.cs (Tree.RecordDecl): Remove.
1296 (RootTypes.AddToTypeContainer): Record the toplevel type in its
1298 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
1300 2006-07-23 Raja R Harinath <harinath@gmail.com>
1302 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
1303 DoFlowAnalysis and OmitStructFlowAnalysis here.
1304 (ec.With): Rename from WithUnsafe and generalize.
1305 (ec.WithCheckState): Remove. All users can be handled by 'With'.
1306 (ec.WithFlowAnalyis): New.
1307 * ecore.cs, expression.cs, statement.cs: Update.
1309 2006-07-22 Raja R Harinath <harinath@gmail.com>
1311 * statement.cs (Block.ResolveMeta): Simplify slightly.
1313 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
1314 multiple boolean fields. Convert InUnsafe, constant_check_state,
1315 check_state to flags.
1316 (CheckState, ConstantCheckState): Update.
1317 (InUnsafe): New read-only property.
1318 (FlagsHandle): Rename from CheckStateHandle and convert to handle
1320 (WithUnsafe): New helper similar to WithCheckState.
1321 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
1322 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
1324 2006-07-21 Raja R Harinath <rharinath@novell.com>
1326 Make comparisons use the same IL irrespective of whether they're
1327 in a 'checked' or 'unchecked' context: one of the issues in #78899
1328 * codegen.cs (EmitContext.CheckState): Make read-only property.
1329 (EmitContext.ConstantCheckState): Likewise.
1330 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
1331 helper that implement a save/restore stack for CheckState
1332 values. This is the only way to change check-state.
1333 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
1334 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
1335 (CheckedExpr.EmitBranchable): New forwarding method.
1336 (UnCheckedExpr): Likewise.
1337 * statement.cs (Block.ResolveMeta): Use WithCheckState.
1338 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
1339 (Checked.Resolve, checked.DoEmit): Likewise.
1341 2006-07-20 Miguel de Icaza <miguel@novell.com>
1343 * anonymous.cs: Cache the resolved anonymous delegate, and return
1344 this so that the ResolveTopBlock is only triggered once, not
1347 Currently we trigger ResolvetopBlock twice due to a first pass of
1348 argument check compatibility, and a second pass that does the
1351 2006-07-15 Marek Safar <marek.safar@seznam.cz>
1353 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
1355 * rootcontext.cs (Reset): Add helper_classes.
1357 2006-07-15 Marek Safar <marek.safar@seznam.cz>
1360 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
1363 2006-07-13 Miguel de Icaza <miguel@novell.com>
1365 * statement.cs (Lock): Handle expressions of type
1366 TypeManager.null_type specially. Fixes #78770
1368 2006-07-08 Marek Safar <marek.safar@seznam.cz>
1370 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
1373 2006-07-08 Marek Safar <marek.safar@seznam.cz>
1375 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
1376 for accessors as well.
1377 * ecore.cs (EventExpr): Add AccessorTable.
1379 2006-07-01 Marek Safar <marek.safar@seznam.cz>
1382 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
1383 for CS0122 where appropriate.
1384 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
1386 (Filter): Assembly can be null in the case of top level attributes.
1388 2006-06-25 Marek Safar <marek.safar@seznam.cz>
1392 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
1393 is done at global level.
1395 2006-06-24 Marek Safar <marek.safar@seznam.cz>
1397 A fix for #77002, Implemented TypeForwarder support.
1399 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
1400 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
1401 * typemanager.cs (): Add type_forwarder_attr_type.
1403 2006-06-24 Marek Safar <marek.safar@seznam.cz>
1405 * report.cs: Add CS0469 warning.
1407 2006-06-21 Martin Baulig <martin@ximian.com>
1409 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
1410 the `try'-block, so we also report CS0016 etc. there.
1412 2006-06-21 Martin Baulig <martin@ximian.com>
1415 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
1417 2006-06-21 Martin Baulig <martin@ximian.com>
1419 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
1420 also report CS1686 for parameters.
1422 2006-06-21 Martin Baulig <martin@ximian.com>
1424 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
1425 instead of an error if the value is not implicitly convertible to
1426 the switch types; fixes #77964.
1428 2006-06-21 Raja R Harinath <rharinath@novell.com>
1431 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
1432 FieldBuilder is null.
1435 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
1436 'left' and 'right' before error-checking.
1438 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
1440 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
1442 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
1443 (FieldExpr.DoResolve): likewise.
1444 (PropertyExpr.InstanceResolve): likewise.
1445 (EventExpr.InstanceResolve): likewise.
1447 2006-06-04 Marek Safar <marek.safar@seznam.cz>
1449 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
1450 attribute applicable tests for attribute argument.
1452 2006-06-02 Raja R Harinath <rharinath@novell.com>
1455 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
1456 (Binary.OverloadResolve_PredefinedIntegral): New.
1457 (Binary.OverloadResolve_PredefinedFloating): New.
1458 (Binary.OverloadResolve_PredefinedString): New.
1459 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
1460 Follow the standard more closely, and treat numeric promotions in
1461 terms of overload resolution.
1462 (Binary.CheckShiftArguments): Simplify.
1464 2006-06-01 Raja R Harinath <rharinath@novell.com>
1466 * flowanalysis.cs (MyBitVector): Simplify representation.
1467 (MyBitVector.Clone): Avoid allocating BitArray.
1468 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
1469 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
1470 (*): Update. Change all references to MyBitVector.And and
1471 MyBitVector.Or to &= and |=.
1473 2006-05-29 Raja R Harinath <rharinath@novell.com>
1476 * cs-parser.jay (formal_parameter_list): Extend the pattern below
1477 to param arguments too.
1479 2006-05-26 Miguel de Icaza <miguel@novell.com>
1481 * cs-parser.jay: Catch another parsing form for arglist being
1482 followed by other arguments. Fixes #78313.
1484 2006-05-24 Raja R Harinath <rharinath@novell.com>
1486 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1487 checking of out parameters to ...
1488 (FlowBranchingToplevel.Merge): ... here.
1489 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1490 set, propagate the origin upward, and only complain if there was
1492 (FlowBranchingException.AddContinueOrigin): Likewise.
1493 (FlowBranchingException.AddReturnOrigin): Likewise.
1494 (FlowBranchingException.AddGotoOrigin): Likewise.
1496 2006-05-23 Raja R Harinath <rharinath@novell.com>
1498 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1499 unreachable, skip it.
1500 (FlowBranchingException.Merge): Always propagate jumps, even if
1501 the finally block renders subsequent code unreachable.
1503 2006-05-18 Raja R Harinath <rharinath@novell.com>
1506 * statement.cs (Goto.Resolve): Move responsibility for resolving
1507 'goto' to FlowBranching.AddGotoOrigin.
1508 (Goto.SetResolvedTarget): New. Callback to set the
1509 LabeledStatement that's the target of the goto.
1510 (Goto.DoEmit): Use Leave instead of Br when crossing an
1511 unwind-protect boundary.
1512 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1513 LookupLabel and adjust to new semantics.
1514 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1515 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1516 Goto.SetResolvedTarget to update target.
1517 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1518 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1519 AddBreakOrigin & co. Delay propagation until ...
1520 (FlowBranchingException.Merge): ... this.
1522 * statement.cs (Block.Resolve): Always depend on flow-branching to
1523 determine unreachability. Kill workaround that originally emitted
1524 only one statement after an "unreachable" label (see infloop in
1527 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1528 This is still "wrong", but anything better would probably need a
1529 multi-pass algorithm.
1530 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1531 usage vector. Force current usage vector to be reachable, to
1532 optimistically signify backward jumps.
1533 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1535 (FlowBranchingLabeled.Merge): New. If no backward jump was
1536 detected, return the original salted-away usage vector instead,
1537 updated with appropriate changes. Print unreachable warning if
1539 * statement.cs (Block.Resolve): Don't print unreachable warning on
1540 a labeled statement.
1542 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
1544 * driver.cs: Pass filename without path to AssemblyBuilder's
1545 AddResourceFile. Fixes bug #78407.
1547 2006-05-17 Raja R Harinath <rharinath@novell.com>
1549 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1550 * flowanalysis.cs (FlowBranchingLabeled): ... here.
1551 (FlowBranching.MergeChild): Overwrite
1552 reachability information from Labeled branchings too.
1554 2006-05-16 Raja R Harinath <rharinath@novell.com>
1556 * statement.cs (Goto.Resolve): Merge jump origins here ...
1557 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1559 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1560 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
1561 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
1562 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1564 * statement.cs (Goto.Resolve): ... not here.
1565 (Goto.Emit): Remove CS1632 check.
1567 2006-05-14 Marek Safar <marek.safar@seznam.cz>
1569 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1572 2006-05-11 Raja R Harinath <rharinath@novell.com>
1574 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1575 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1576 (FlowBranchingException.Label): Likewise.
1578 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
1580 (MyBitVector.Or): Use it to avoid losing information (Count).
1581 (FlowBranching.MergeOrigins): Likewise.
1583 * flowanalysis.cs (UsageVector.IsDirty): Remove.
1584 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1585 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1586 (UsageVector.ToString): Simplify.
1587 (UsageVector.MergeSiblings): Move here from ...
1588 (FlowBranching.Merge): ... here.
1589 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1592 2006-05-10 Raja R Harinath <rharinath@novell.com>
1594 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1595 null bitvector is treated as all-true.
1597 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1598 (MyBitVector): Rationalize invariants. 'vector != null' implies
1599 that we have our own copy of the bitvector. Otherwise,
1600 'InheritsFrom == null' implies all inherited bits are true.
1602 2006-05-09 Marek Safar <marek.safar@seznam.cz>
1604 * statement.cs (LocalInfo): Add IsConstant.
1605 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1606 local variable for constants.
1608 2006-05-09 Raja R Harinath <rharinath@novell.com>
1610 * flowanalysis.cs (MyBitVector.Empty): New.
1611 (MyBitVector): Don't allow InheritedFrom to be null.
1612 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1613 (UsageVector, FlowBranching): Update to changes.
1615 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1616 recursion. The 'Parent == null' condition isn't sufficient for
1618 (FlowBranching.AddBreakOrigin): Likewise.
1619 (FlowBranching.AddContinueOrigin): Likewise.
1620 (FlowBranching.AddReturnOrigin): Likewise.
1621 (FlowBranching.StealFinallyClauses): Likewise.
1622 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1623 (FlowBranching.CheckOutParameters): Likewise.
1624 (FlowBranchingToplevel): Terminate all the above recursions here.
1625 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1626 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1628 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
1630 (FlowBranchingToplevel): New. Empty for now.
1631 (FlowBranching.MergeTopBlock): Update.
1632 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1633 branching for the anonymous delegate.
1634 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1636 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1637 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1638 information at the start of the merge. Reorganize.
1640 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1642 * class.cs (MethodData.Define): Method cannot implement interface accessor.
1644 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1646 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1647 to newly introduced ctor.
1649 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1650 message to one place.
1651 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1654 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1656 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1658 * ecore.cs (Expression.ResolveAsConstant): Updated.
1660 * statement.cs (ResolveMeta): Updated.
1662 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1664 * cs-parser.jay: __arglist cannot be used in initializer.
1666 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1669 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1672 2006-05-05 Raja R Harinath <rharinath@novell.com>
1674 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1675 (LabeledStatement): Add 'name' parameter.
1676 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1677 (Block.AddLabel): Update to changes.
1678 * cs-parser.jay (labeled_statement): Likewise.
1680 * flowanalysis.cs (BranchingType.Labeled): New.
1681 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1682 (FlowBranchingLabeled): New. Does nothing for now, but will
1683 eventually handle 'goto' flows.
1684 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1685 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1686 that's terminated ...
1687 (Block.Resolve): ... here.
1689 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1690 (UsageVector.MergeFinallyOrigins): Likewise.
1691 (FlowBranching.InTryOrCatch): Likewise.
1692 (FlowBranching.AddFinallyVector): Likewise.
1693 (FlowBranchingException): Update to changes.
1696 * statement.cs (Return.Resolve): Move error checking to ...
1697 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1698 (FlowBranchingException): Handle return origins like break and
1700 (FlowBranching.UsageVector.CheckOutParameters): Remove.
1702 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1705 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1708 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1711 * class.cs (MethodData.Define): Do public accessor check only when method
1712 implements an interface.
1714 2006-05-04 Raja R Harinath <rharinath@novell.com>
1716 Remove special handling of 'break'
1717 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1718 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
1719 (UsageVector.Break): Remove.
1720 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1722 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1724 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1725 UsageVector.Breaks (). Don't set NeedsReturnLabel.
1727 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1730 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1731 be the interface member.
1733 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1736 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1737 for emitting small (int) values.
1739 2006-05-03 Raja R Harinath <rharinath@novell.com>
1742 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1743 control-flow passes through the 'finally' after merging-in all the
1744 control-flows from 'try' and the 'catch' clauses.
1746 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1747 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
1748 always true at the only non-recursive entry point.
1749 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1750 FlowBranchingBreakable.
1751 (FlowBranchingLoop): Remove.
1752 * statement.cs (Return.DoResolve): Update to changes.
1755 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1756 (FlowBranching.CreateBranching): Handle it: create a
1757 FlowBranchingContinuable.
1758 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1759 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1760 except that it handles the 'continue' command.
1761 (FlowBranching.UsageVector.MergeOrigins): Rename from
1763 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1764 except that it overrides AddContinueOrigin.
1765 (FlowBranchingException): Override AddContinueOrigin, similar to
1767 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1768 Create a new branching around the embedded statement.
1769 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
1770 control flow after the embedded statement.
1771 (Continue.Resolve): Move all error checking to AddContinueOrigin.
1773 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1774 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1775 FlowBranchingBreakable.
1776 (FlowBranchingSwitch): Remove.
1779 * statement.cs (Break.Resolve): Simplify. Move responsibility for
1780 error reporting to ...
1781 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1782 Rename from 'AddBreakVector'. Add new location argument. Return
1783 a bool indicating whether the 'break' crosses an unwind-protect.
1784 (FlowBranchingException.AddBreakOrigin): Add.
1785 (FlowBranchingException.Merge): Propagate 'break's to surrounding
1786 flowbranching after updating with the effects of the 'finally'
1788 (FlowBranchingBreakable): New common base class for
1789 FlowBranchingLoop and FlowBranchingSwitch.
1791 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1793 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1795 2006-05-02 Raja R Harinath <rharinath@novell.com>
1797 * statement.cs (Do.Resolve): If the loop is infinite, set the
1799 (While.Resolve, For.Resolve): Set a barrier after the embedded
1800 statement. There's no direct control flow that goes from the end
1801 of the embedded statement to the end of the loop.
1802 * flowanalysis.cs (FlowBranching.Infinite): Remove.
1803 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
1804 above ensure that the reachability is correctly computed.
1806 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1807 (UsageVector.MergeBreakOrigins): If the current path is
1808 unreachable, treat it as if all parameters/locals are initialized.
1809 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
1810 infinite loops before merging-in break origins.
1812 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1813 (Reachability.Reachable): Split part into ...
1814 (Reachability.Unreachable): ... this. Simplify.
1815 (Reachability.IsUnreachable): Use 'Unreachable' instead.
1817 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1818 (Reachability.SetThrowsSometimes): Likewise.
1819 (FlowBranchingBlock.MergeTopBlock): Don't compare against
1820 TriState.Always, use corresponding property.
1821 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1822 (Block.Resolve): Likewise. Remove some redundant checks.
1824 2006-05-02 Raja R Harinath <harinath@gmail.com>
1826 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1827 (Reachability.Meet): Don't bother checking AlwaysThrows --
1828 barrier is always set.
1829 (FlowBranchingBlock.Merge): Likewise.
1831 2006-05-01 Raja R Harinath <harinath@gmail.com>
1833 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1834 checks for unreachable.
1836 2006-05-01 Marek Safar <marek.safar@seznam.cz>
1839 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1841 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1842 whether field is really assigned.
1844 2006-04-30 Raja R Harinath <harinath@gmail.com>
1846 * flowanalysis.cs (Reachability): Make 4-argument constructor
1848 (Reachability.Meet): Rename from 'And'. Remove static variant.
1849 (Reachability.Always): Rename from the highly misleading
1850 'Reachability.Never'.
1851 (FlowBranching.Merge): Update to changes. Mark an impossible
1852 situation with a 'throw'.
1853 (*): Update to changes.
1855 2006-04-29 Raja R Harinath <harinath@gmail.com>
1857 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1859 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1860 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1861 (*): Update to changes.
1862 * statement.cs: Update to changes.
1864 2006-04-28 Marek Safar <marek.safar@seznam.cz>
1867 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1869 2006-04-28 Raja R Harinath <harinath@gmail.com>
1871 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1874 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1875 argument to two arguments: an usage-vector and a bool. Move call
1876 to FlowBranching.Merge () ...
1877 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1879 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1880 handling of loop and switch reachability to ...
1881 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1883 2006-04-27 Raja R Harinath <harinath@gmail.com>
1885 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1886 handling to FlowBranchingLoop.InLoop.
1887 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1889 2006-04-26 Marek Safar <marek.safar@seznam.cz>
1892 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1893 anonymous method is allowed from AnonymousContainer here.
1895 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1897 2006-04-24 Raja R Harinath <rharinath@novell.com>
1900 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1902 2006-04-23 Marek Safar <marek.safar@seznam.cz>
1905 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1906 (DoubleConstant.Reduce): Ditto.
1908 2006-04-23 Raja R Harinath <rharinath@novell.com>
1910 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1911 Remove 'lvalue_right_side' argument. Move parts to ...
1912 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1913 (LocalVariable.DoResolveLValue): ... these.
1915 2006-04-21 Raja R Harinath <rharinath@novell.com>
1918 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1919 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1920 (LocalVariableReference.DoResolveBase): Use it to implement new
1922 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1923 (Argument.Resolve): Simplify. Move CS1510 check ...
1924 * ecore.cs (Expression.ResolveLValue): ... here.
1925 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1926 (PropertyExpr.DoResolveLValue): Likewise.
1927 (FieldExpr.Report_AssignToReadonly): Likewise.
1928 (FieldExpr.DoResolve): Add 'out_access' argument. Use
1929 LValueMemberAccess or LValueMemberOutAccess on instance depending
1931 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1932 DoResolve as appropriate.
1934 2006-04-20 Raja R Harinath <rharinath@novell.com>
1937 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1938 implicit conversions on 'out' and 'ref' arguments.
1940 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1941 improve clarity. Remove dead code.
1944 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1945 (Catch.Resolve): Resolve VarBlock if it exists.
1947 2006-04-19 Miguel de Icaza <miguel@novell.com>
1949 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1950 twice, this was some residual code, the enumerator was emitted
1951 properly in the two branche of if later.
1953 2006-04-19 Raja R Harinath <rharinath@novell.com>
1955 * expression.cs (Cast.ResolveLValue): Remove. The result of a
1956 cast is never an lvalue.
1957 (Cast.DoResolve, Cast.ResolveRest): Combine.
1958 (Argument.Emit): Simplify slightly. Move 'Expr is
1959 IMemoryLocation' check ...
1960 (Argument.Resolve): ... here.
1961 (Argument.Error_LValueRequired): Remove. Inline into only user.
1963 Simplifications. Fix cs0191-2.cs
1964 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1965 CS1649 and CS1651 to ...
1966 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
1967 the actual selection of the error code and message to a lookup
1968 table. Add a dummy return value to simplify callsites.
1969 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1970 readonly fields of other instances of the same type. Move CS0197
1972 * expression.cs (Argument.Resolve): ... here. Simplify code.
1973 Ensure that ec.InRefOutArgumentResolving is only set during LValue
1974 resolution of an out or ref argument. The code simplification
1975 above uses this invariant.
1977 2006-04-18 Raja R Harinath <rharinath@novell.com>
1979 Possibly fix #77752. Fix cs1690-[4-7].cs.
1980 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1981 CheckMarshallByRefAccess. Drop parameter.
1982 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
1984 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1986 * report.cs (AllWarnings): Add CS1690.
1987 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1989 (LocalVariableReference.DoResolveBase): Update.
1991 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1993 * class.cs (MethodOrOperator): Moved common parts from method class.
1994 detect obsolete attributes.
1995 (Method.Define): Simplified as it reuses code from base.
1996 (Constructor.ValidAttributeTargets): Fixed issue found during
1998 (Destructor.ValidAttributeTargets): Fixed issue found during
2000 (Operator): Finished refactoring set off by #78020. Operator class is now
2001 ordinary method class.
2003 * anonymous.cs: Updated.
2005 * decl.cs (DeclSpace): Add IsGeneric
2007 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2009 * class.cs (Constructor.Emit): Don't emit the attributes twice.
2011 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2013 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
2014 detect obsolete attributes.
2015 (Method.CreateEmitContext): Moved to MethodOrOperator.
2017 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2020 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
2021 customized exception to make crash detection easier.
2022 (MethodOrOperator): Started to work on new base class for methods and
2024 (Method): Derives from MethodOrOperator.
2025 (Constructor.Emit): Emits its own attributes.
2026 (AbstractPropertyEventMethod.Emit): Ditto.
2027 (Operator): Derives from MethodOrOperator, will refactor fully in extra
2029 (Operator.Emit): It's temporary more tricky than should be.
2031 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
2033 * report.cs (InternalErrorException): Add ctor with inner exception.
2035 2006-04-08 Marek Safar <marek.safar@seznam.cz>
2038 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
2041 2006-04-07 Marek Safar <marek.safar@seznam.cz>
2044 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
2047 2006-04-06 Marek Safar <marek.safar@seznam.cz>
2049 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
2050 attribute is present and Guid not.
2051 (Interface.ApplyAttributeBuilder): Ditto.
2053 * attribute.cs: Add error message.
2055 2006-04-06 Marek Safar <marek.safar@seznam.cz>
2059 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
2060 sources (it's composite) so hold them in extra array as they are used in
2061 Emit phase only. It worked in the previous versions by mistake.
2062 (Attribute.Emit): Emit attribute for more owners when exist.
2064 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
2065 it has now different behaviour.
2067 2006-04-04 Marek Safar <marek.safar@seznam.cz>
2069 * constant.cs (Constant.IsDefaultInitializer): New method.
2071 * class.cs: Updated.
2073 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
2074 re-initialize default values. It saves KBs almost for every assembly.
2075 Thanks Zoltan for the idea.
2076 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
2077 (ArrayCreation.DoResolve): Resolve only once.
2078 (ArrayCreation.Emit): Emit static initializer only when it is faster.
2079 (ArrayCreation.GetAttributableValue): Cope with optimized values.
2081 2006-04-03 Zoltan Varga <vargaz@gmail.com>
2083 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
2086 2006-04-01 Marek Safar <marek.safar@seznam.cz>
2088 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
2089 in an embedded statement too.
2091 2006-04-01 Raja R Harinath <rharinath@novell.com>
2094 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
2096 2006-04-01 Marek Safar <marek.safar@seznam.cz>
2100 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
2103 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
2105 2006-03-31 Marek Safar <marek.safar@seznam.cz>
2107 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
2110 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
2111 LocalTemporary change.
2113 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
2115 (ClassOrStruct.DefineFieldInitializers): Implemented static field
2116 initializers optimization.
2117 (ClassOrStruct.TypeAttr): Moved from modifiers.
2118 (Constructor.CheckBase): Don't crash when static ctor has parameters.
2119 (FieldBase.ResolveInitializer): Resolves initializer.
2120 (FieldBase.HasDefaultInitializer): New property.
2122 * cs-parser.jay: Removed message.
2124 * expression.cs (CompilerGeneratedThis): New specialization.
2126 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
2128 2006-03-28 Marek Safar <marek.safar@seznam.cz>
2130 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
2132 2006-03-27 Marek Safar <marek.safar@seznam.cz>
2134 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
2135 be now EnumConstants only.
2137 2006-03-27 Marek Safar <marek.safar@seznam.cz>
2139 * attribute.cs, driver.cs: Reset more caches.
2141 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2143 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
2145 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2147 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
2148 for easier reuse. Updated all overrides.
2149 (IntegralConstant): New base class for all integral constants.
2150 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
2151 of the constant range, report custom error.
2152 (UIntConstant.Reduce): Fixed uint conversion.
2154 * ecore.cs, literal.cs: Reduce updates.
2156 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2160 * class.cs (Constructor.Define): Removed extra if for default ctors.
2161 A patch from Atsushi Enomoto.
2163 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2165 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
2166 GetAttributableValue.
2168 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
2171 * convert.cs (ImplicitConversionRequired): Error message moved to
2174 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
2175 automatic implicit conversion of an output value.
2176 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
2178 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
2180 (TypeOf.GetAttributableValue): Add extra handling for object type.
2182 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
2183 special error message.
2185 2006-03-25 Marek Safar <marek.safar@seznam.cz>
2187 * class.cs (Constructor.Emit): Don't crash when struct ctor is
2189 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
2190 compatible with MS runtime.
2192 2006-03-23 Marek Safar <marek.safar@seznam.cz>
2194 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
2195 attribute arguments here.
2197 * class.cs (Indexer.Define): The check was moved to attribute class.
2199 2006-03-22 Marek Safar <marek.safar@seznam.cz>
2201 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
2202 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
2205 2006-03-22 Raja R Harinath <rharinath@novell.com>
2207 Support ParameterDefaultValueAttribute in gmcs. Also applied to
2208 mcs to keep code differences small.
2209 * attribute.cs (Attribute.GetParameterDefaultValue): New.
2210 * typemanager.cs (parameter_default_value_attribute_type): New.
2211 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
2214 2006-03-21 Marek Safar <marek.safar@seznam.cz>
2216 * expression.cs (StringConcat.Append): Reverted back to no warning state.
2218 2006-03-21 Marek Safar <marek.safar@seznam.cz>
2220 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
2222 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
2225 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
2227 * doc-bootstrap.cs : fix build.
2229 2006-03-20 Marek Safar <marek.safar@seznam.cz>
2231 * expression.cs (StringConcat.Append): Issue a warning when empty string
2234 2006-03-20 Marek Safar <marek.safar@seznam.cz>
2236 * assign.cs (CompoundAssign.ResolveSource): Removed.
2238 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
2241 * class.cs (TypeContainer.FindMethods): Removed.
2242 (TypeContainer.CheckMemberUsage): Made static.
2244 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
2246 * constant.cs (CheckRange): Removed unused type argument.
2247 (CheckUnsigned): Removed unused type argument.
2249 * cs-parser.jay: Updated after MemberAccess clean up.
2250 Uses Length for empty string test.
2252 * cs-tokenizer.cs: Uses Length for empty string test.
2253 (IsCastToken): Made static.
2254 (is_hex): Made static.
2255 (real_type_suffix): Made static.
2257 * decl.cs (SetupCache): Made static.
2258 (OnGenerateDocComment): Removed unused ds argument.
2260 * delegate.cs (VerifyDelegate): Removed unused argument.
2262 * doc.cs: Uses Length for empty string test.
2264 * driver.cs: Uses Length for empty string test.
2266 * enum.cs (IsValidEnumType): Made static
2268 * expression.cs (EnumLiftUp): Removed unused argument.
2269 (ResolveMethodGroup): Ditto.
2270 (BetterConversion): Ditto.
2271 (GetVarargsTypes): Ditto.
2272 (UpdateIndices): Ditto.
2273 (ValidateInitializers): Ditto.
2274 (MemberAccess.ctor): Ditto.
2275 (GetIndexersForType): Ditto.
2277 * flowanalysis.cs: (MergeFinally): Removed unused argument.
2279 * iterators.cs: Updated after MemberAccess clean up.
2281 * location.cs: Uses Length for empty string test.
2283 * namespace.cs: Uses Length for empty string test.
2285 * report.cs (CheckWarningCode): Made static.
2287 * statement.cs (LabeledStatement): Removed unused argument.
2289 * typemanager.cs (FilterNone): Removed.
2291 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2293 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
2296 * class.cs: Updated.
2298 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2300 * cs-parser.jay.cs: __arglist is not allowed for delegates.
2302 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2306 * expression.cs (VerifyArgumentsCompat): Reverted to double error
2307 reporting, it's more tricky than I thought.
2309 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2313 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
2315 (AnonymousMethod.ImplicitStandardConversionExists): New method.
2316 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
2317 Add more error reporting; Fixed issue with params.
2319 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
2321 * cs-parser.jay: AnonymousMethod requires host container.
2323 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
2325 2006-03-18 Raja R Harinath <harinath@gmail.com>
2327 * class.cs: Change 'TypeContainer ds' constructor argument to
2328 'DeclSpace parent'. Some classes were missed below due to
2329 different naming convention.
2331 * class.cs (MemberCore.Parent): Delete. This makes the
2332 ParentContainer changes below enforceable by the compiler.
2334 Treat pointers to enclosing declaration space as 'DeclSpace', not
2336 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
2337 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
2339 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
2341 (Block.AddThisVariable): Likewise.
2342 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
2343 (AbstractPropertyEventMethod.Emit): Likewise.
2344 (AbstractPropertyEventMethod.EmitMethod): Likewise.
2345 (GetMethod.Define, SetMethod.Define): Likewise.
2346 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
2347 (DelegateMethod.EmitMethod): Likewise.
2349 Fix regression test-partial-13.cs.
2350 Rationalize use of PartialContainer. Ensure that the partial
2351 class semantics can be tied to type-correctness, i.e., any
2352 violation will cause a compile error.
2353 * class.cs, const.cs: Access all fields that belong to class
2354 TypeContainer via ParentContainer. Arguments of EmitContexts and
2355 Resolve()-like functions still use 'Parent'.
2357 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
2358 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
2359 (PropertyMethod.CheckModifiers): Remove unused argument.
2360 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
2363 2006-03-17 Raja R Harinath <harinath@gmail.com>
2365 Make semantics of PartialContainer simpler.
2366 * decl.cs (DeclSpace.IsPartial): Remove.
2367 * class.cs (TypeContainer.IsPartial): Likewise.
2368 (TypeContainer..ctor): Set PartialContainer to point to self.
2369 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
2370 (TypeContainer.FindNestedType): Likewise.
2371 (MemberCore.ParentContainer): Simplify. Remove deprecation.
2373 2006-03-17 Marek Safar <marek.safar@seznam.cz>
2375 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2377 2006-03-15 Marek Safar <marek.safar@seznam.cz>
2379 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
2382 2006-03-15 Marek Safar <marek.safar@seznam.cz>
2384 * class.cs (Operator.Define): An error for base conversion was not
2387 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
2389 * iterator.cs : yield break is allowed in try statement which has
2390 catch clauses. Fixed bug #77767.
2392 2006-03-13 Marek Safar <marek.safar@seznam.cz>
2394 A fix for #77593, #77574.
2396 * class.cs (MethodCore.CheckBase): Another if for operator.
2398 2006-03-09 Marek Safar <marek.safar@seznam.cz>
2400 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
2403 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
2404 (DelegateCreation.ImplicitStandardConversionExists): New method for just
2407 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
2410 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
2411 Updated after another emitcontext usage was clean up. It should help us to
2412 synchronize with gmcs easier.
2414 2006-03-04 Marek Safar <marek.safar@seznam.cz>
2418 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
2419 (Event.Define): ditto
2420 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
2422 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
2423 Removed redundant code and set NewSlot for Invoke method too.
2425 * parameter.cs (Parameters.ctor): Add custom, type ctor.
2426 (Parameters.MergeGenerated): New method. Use this method when you merge
2427 compiler generated argument with user arguments.
2429 2006-03-03 Marek Safar <marek.safar@seznam.cz>
2431 * attribute.cs (ResolveAsTypeTerminal): Removed.
2433 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
2434 specialization for predefined types; 30% speed up.
2435 Finally placed obsolete check to right place.
2436 (Expression.ResolveType): Removed.
2438 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
2439 Updated after ResolveType was removed.
2441 * expression.cs (Cast.ctor): Check void cast.
2442 (Binary.ResolveAsTypeTerminal): Is never type.
2443 (Conditional.ResolveAsTypeTerminal): Is never type.
2445 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
2447 2006-03-01 Raja R Harinath <rharinath@novell.com>
2450 * expression.cs (ParameterReference.DoResolveBase): Change return
2452 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2456 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2459 * typemanager.cs (GetFullNameSignature): Don't nullref on
2460 protected accessors.
2462 2006-02-27 Marek Safar <marek.safar@seznam.cz>
2464 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
2465 these two separated members to simplify the code.
2466 (Attribute.Resolve): Refactored to use new fields and methods.
2467 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
2468 implemented obsolete attribute checking.
2469 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2470 implemented obsolete checking again. It look line never ending quest ;-)
2471 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2473 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2475 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2477 *class.cs (Property.Define): Add RegisterProperty call.
2479 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2480 argument groups (only 2).
2482 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2483 encoding expression to arguments.
2484 (Expression.ExprClassToResolveFlags): Just turned to property.
2486 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2487 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2488 optimized as well as implemented support for zero-length attributes.
2490 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2491 Add caching of PropertyInfo's.
2493 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2495 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2496 error multiple times.
2498 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2500 New partial class implementation.
2501 A fix for #77027, #77029, #77403
2503 * attribute.cs (Attributable): Made attributes protected.
2505 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2506 the replacements of ClassPart and PartialContainer.
2507 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2508 (TypeContainer.AddInterface): Ditto.
2509 (TypeContainer.AddPartial): The main method for partial classes. It checks
2510 for errors and merges ModFlags and attributes. At the end class is added to
2512 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2514 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2515 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2516 from the rest of partial classes.
2517 (TypeContainer.GetClassBases): Simplified.
2518 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2520 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2521 (TypeContainer.HasExplicitLayout): Uses Flags now.
2522 (PartialContainer): Removed.
2523 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2524 (StaticClass): Was merged with Class.
2525 (Class.GetClassBases): class and static class bases are verified here.
2526 (Class.TypeAttr): Added static attributes when class is static.
2527 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2528 (MemberBase): In some cases we need to call parent container for partial
2529 class. It should be eliminated but it's not easy now.
2531 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2533 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2534 partial classed to accumulate class comments.
2535 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2537 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2539 * driver.cs (MainDriver): Tree.GetDecl was removed.
2541 * modifiers.cs (Modifiers): Add partial modifier.
2543 * tree.cs (Tree.decl): Removed.
2544 (RootTypes): Started to use this class more often for root types
2547 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2551 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2552 external interface does not have an attribute.
2554 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2556 Another prerequisites for new partial classs implementation.
2558 * attribute.cs (Attribute.Equal): Implemented.
2559 (Attribute.Emit): Changed as attributes can be applied more than twice.
2560 (Attributes.Emit): Check for duplicate attributes here.
2562 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2563 as a parameter, clean-up.
2565 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2569 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2570 contains obsolete attribute check which can in some cases look for base
2571 type of current class which is not initialized yet.
2572 (TypeContainer.BaseType): Replacement of ptype.
2574 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2576 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2578 First of prerequisites for new partial classs implemention.
2580 * attribute.cs (Attributable): Extended by ResolveContext;
2581 Attributes finally have correct context for resolving in all cases.
2582 (AttachTo): Attribute owner is assigned here.
2584 * codegen.cs (IResolveContext): Introduce new interface to hold
2585 all information needed in resolving phase.
2586 (EmitContext): Implements IResolveContext; more clean-up needed here.
2588 * decl.cs (MemberCore): Implemented IResolveContext.
2590 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2591 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2592 parameter.cs, statement.cs, tree.cs, typemanager.cs:
2593 Refactored to use new IResolveContext instead of EmitContext; cleanup
2595 2006-02-06 Miguel de Icaza <miguel@novell.com>
2597 * codegen.cs (EmitScopeInitFromBlock): check here the
2598 capture_context, there is no need to make two calls to the
2601 * anonymous.cs: Add some debugging messages that might help me
2602 track other instances of this problem in the future (the
2603 regression of test 467).
2605 * cs-parser.jay: track the variable block, as we need to initalize
2606 any captured variables declared in this block for the "catch"
2607 portion of the "Try" statement.
2609 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2610 scope initialization for captured variables.
2612 Also, move the emit for the variables after the block location has
2615 2006-02-06 Marek Safar <marek.safar@seznam.cz>
2617 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2619 2006-02-02 Miguel de Icaza <miguel@novell.com>
2621 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2622 commit yesterday, the initialization for the roots is necessary.
2623 What is not necessary is the scope activation.
2625 2006-02-02 Raja R Harinath <rharinath@novell.com>
2627 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2628 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2630 (Argument.Resolve): Remove CS0206 checks.
2632 2006-02-01 Miguel de Icaza <miguel@novell.com>
2634 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2635 scopes for all the roots, the scopes will now be emitted when the
2636 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2638 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2639 code. This reduces a lot of existing cruft.
2641 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2642 that the ScopeInfo is generated as we enter the scope, not at the
2643 time of use, which is what we used to do before.
2645 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2646 every time a Block is about to be emitted if we have a
2649 2006-02-01 Raja R Harinath <rharinath@novell.com>
2651 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2653 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2655 * typemanager.cs (cons_param_array_attribute): Make private.
2656 (Reset): Set it to null.
2657 (InitCoreHelpers): Don't initialize it.
2658 (ConsParamArrayAttribute): New. Initialize it as needed.
2659 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2661 2006-01-31 Miguel de Icaza <miguel@novell.com>
2663 * expression.cs: There might be errors reported during the
2664 selection of applicable methods. If there are errors, do not
2665 continue execution as it will lead the compiler to crash.
2667 2006-01-30 Miguel de Icaza <miguel@novell.com>
2669 * expression.cs: Member access is not allowed on anonymous
2670 methods. Fixes #77402.
2672 2006-01-30 Raja R Harinath <rharinath@novell.com>
2675 * cs-parser.jay (VariableDeclaration): Don't set
2676 current_array_type to null.
2677 (field_declaration, event_declaration, declaration_statement):
2678 Set it to null here.
2680 2006-01-28 Raja R Harinath <harinath@gmail.com>
2682 * typemanager.cs (GenericParameterPosition): New.
2685 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
2687 * doc.cs : To process "include" elements, first we should create
2688 another list than XmlNodeList, because it could result in node
2689 removal, which could result in that the XmlNodeList gives up
2692 (Also made code identical to gmcs again.)
2694 2006-01-25 Miguel de Icaza <miguel@novell.com>
2696 * ecore.cs: Introduce an error report that we were not catching
2697 before, if not silent, we must report the error. Gonzalo ran into
2700 2006-01-23 Miguel de Icaza <miguel@novell.com>
2702 A fix for bug: #76957
2704 * iterators.cs (MoveNextMethod.CreateMethodHost): call
2705 ComputeMethodHost before creating the method, this is a new
2708 * anonymous.cs (AnonymousContainer): Now we track all the scopes
2709 that this method references (RegisterScope). The actual scope
2710 where the method is hosted is computed with the ComputeMethodHost
2711 before we create the method.
2713 Moved the Deepest routine here.
2715 (AnonymousContainer.ComputeMethodHost): New routine used to
2716 compute the proper ScopeInfo that will host the anonymous method.
2718 (ScopeInfo): Deal with multiple roots. The problem was that we
2719 did not have a unique root where all ScopeInfos could be hanged
2720 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
2723 Remove AdjustMethodScope which is now computed at the end. Remove
2724 LinkScope which did a partial link, instead link all ScopeInfos
2725 before code generation from the new "LinkScopes" routine.
2727 Simplify all the Add* routines as they no longer need to maintain
2728 the tree, they just need to record that they are using variables
2731 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2732 routines to produce the forest of ScopeInfo trees.
2734 * class.cs (TypeContainer.AppendMethod): This is just like
2735 AddMethod, but ensures that an interface implementation method
2736 (IEnumerable.XXX) is not inserted at the beginning of the queue of
2737 methods, but at the end.
2739 We use this functionality to ensure that the generated MoveNext
2740 method in the iterator class is resolved/emitted before the
2741 enumerator methods created.
2743 This is required because the MoveNext method computes the right
2744 ScopeInfo for the method. And the other methods will eventually
2745 need to resolve and fetch information computed from the anonymous
2748 2006-01-21 Raja R Harinath <harinath@gmail.com>
2749 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2752 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2754 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2755 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2757 2006-01-18 Raja R Harinath <rharinath@novell.com>
2759 Fix #76656, cs0231-2.cs.
2760 * cs-parser.jay (formal_parameter_list): Make error case catch
2762 (parenthesized_expression_0): Add CS1026 check.
2763 (invocation_expression): Remove unused { $$ = lexer.Location }.
2765 2006-01-17 Raja R Harinath <rharinath@novell.com>
2768 * cs-parser.jay (statement_expression): Don't list out the
2769 individual statement-expressions. Convert syntax error into
2772 2006-01-16 Raja R Harinath <rharinath@novell.com>
2775 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2776 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
2777 CheckIntermediateModification.
2778 (FieldExpr.DoResolve): Add new two-argument version that
2779 allows us to resolve the InstanceExpression as an lvalue.
2780 The one-argument variant is now just a wrapper.
2781 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2782 Resolve the lhs as an lvalue if the it has a value type.
2783 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2784 from Assign.DoResolve.
2785 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2786 resolved as an lvalue.
2787 (PropertyExpr.DoResolve): Update.
2788 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2789 has a value type. Move CS1612 check here from
2790 CheckIntermediateModification.
2791 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2792 * expression.cs (EmptyExpression.OutAccess): New. Used as the
2793 'right_side' of a ResolveLValue on an 'out' argument.
2794 (EmptyExpression.LValueMemberAccess): New. Used as the
2795 'right_side' of a propagated ResolveLValue on a value type.
2796 (LocalVariableReference.DoResolveBase): Recognize
2797 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2799 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2800 EmptyExpression.Null.
2802 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
2804 * typemanager.cs : added IsGenericParameter(). In mcs it always
2806 * doc.cs : for generic parameters, use GenericParameterPosition,
2809 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
2811 * expression.cs: Fix Console.WriteLine ((this = x).foo);
2813 2006-01-12 Miguel de Icaza <miguel@novell.com>
2815 This fixes the problem where we used ldfld instead of ldflda to
2816 load the "THIS" pointer on captured parameters, when THIS is a
2817 value type. See bug #77205.
2819 * iterators.cs (CapturedThisReference.Emit): Pass false to
2820 EmitThis (we do not need the address).
2822 * codegen.cs (EmitThis): it needs to know whether we need the
2823 address of `this' or not. This is used by value types.
2825 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2826 every other call passes false.
2828 2006-01-12 Raja R Harinath <rharinath@novell.com>
2831 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2833 * expression.cs (Invocation.OverloadResolve): Update.
2834 (Invocation.DoResolve): Avoid double resolution of invocation.
2836 2006-01-11 Raja R Harinath <rharinath@novell.com>
2839 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2840 unary negation of floating point types as 0-expr; negation cannot
2841 overflow in floating point types.
2844 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2845 on operands of 'void' type.
2848 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2849 and ExclusiveOr for boolean constants too.
2851 2006-01-09 Raja R Harinath <rharinath@novell.com>
2854 * expression.cs (Invocation.OverloadResolve): Replace reflected
2855 override methods with their base virtual methods, rather than
2857 * typemanager.cs (TypeManager.GetOverride): New.
2859 2006-01-05 Jb Evain <jbevain@gmail.com>
2861 * class.cs (Property.Define, Indexer.Define): do not tag the
2862 properties as SpecialName | RTSpecialName.
2864 2006-01-04 Miguel de Icaza <miguel@novell.com>
2866 * class.cs (MethodCore.IsDuplicateImplementation): This method was
2867 doing a low-level comparission of parameter types. It was lacking
2868 a check for __argslist.
2870 2005-12-30 Miguel de Icaza <miguel@novell.com>
2872 * expression.cs (ParameterReference.DoResolveBase): Allow
2873 reference parameters if they are local to this block.
2875 This allows the ref and out parameters of a delegate to be used in
2876 an anonymous method, for example:
2878 delegate void set (out int x);
2880 set s = delegate (out int x){
2884 This is used by functionality introduced late in the C# language.
2886 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2887 method that take ref and out parameters.
2889 Fixes #77119 which was a late change in the spec.
2891 2005-12-23 Miguel de Icaza <miguel@novell.com>
2893 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2894 parent if its the same scope. Fixes #77060.
2896 2005-12-21 Miguel de Icaza <miguel@novell.com>
2898 * driver.cs: Report the case of no source files and no -out:
2901 2005-12-20 Raja R Harinath <rharinath@novell.com>
2904 * expression.cs (ComposedCast.GetSignatureForError): Define.
2906 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2910 * namespace.cs (NamespaceEntry): Add extern_aliases as a
2911 ListDictionary, to contain the ExternAliasEntry entries (in
2912 addition to the NamespaceEntry.aliases hashtable). This field is
2913 shared between the original entry and its doppelganger (bodyless
2915 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2916 extern_aliases field.
2917 (NamespaceEntry.Lookup): Move the IsImplicit check after the
2918 lookup in extern_aliases.
2920 2005-12-16 Raja R Harinath <rharinath@novell.com>
2923 * class.cs (TypeContainer.Mark_HasEquals): New.
2924 (TypeContainer.Mark_HasGetHashCode): New.
2925 (ClassPart): Override them.
2926 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2929 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2930 'parent' argument to the base constructor.
2932 Remove all mention of TypeContainer from decl.cs.
2933 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2934 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2935 (DeclSpace.DeclSpace): Likewise.
2936 (DeclSpace.DefineMembers): Remove unused argument.
2937 * cs-parser.jay (pop_current_class): Update to changes. Simplify
2938 debugging check -- we don't care if the debug code throws an
2939 InvalidCastException instead of an InternalErrorException.
2940 * class.cs (TypeContainer.DefineMembers): Update to changes.
2941 (TypeContainer.DoDefineMembers): Likewise.
2942 (TypeContainer.GetMethods): Likewise.
2943 (PropertyMember.Define): Likewise.
2944 (MemberBase.Parent): New property that forwards to
2945 MemberCore.Parent, but ensures that we get a TypeContainer.
2946 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2947 (RootContext.PopulateTypes): Likewise. Remove special case code
2948 for !RootContext.StdLib: DefineMembers is idempotent.
2950 2005-12-14 Miguel de Icaza <miguel@novell.com>
2952 * convert.cs (ExplicitConversionCore): Check the return value from
2953 ExplicitConversionCore which can return null on failure. Fixes #76914
2955 2005-12-13 Marek Safar <marek.safar@seznam.cz>
2957 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2959 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
2961 * doc.cs : The search for referenced namespace was insufficient to
2962 get global one as it used to do. Fixed bug #76965.
2964 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
2966 * doc.cs : check name in cref in the last phase that whether it is
2969 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2971 * cs-tokenizer.cs : reverted the latest change: it somehow broke
2974 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2976 * doc.cs : so it turned out that we cannot skip override check for
2977 interface members. Fixed bug #76954.
2979 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2981 * cs-tokenizer.cs : fixed bug #75984:
2982 - #warning and #error should not be handled when the source line
2984 - #line is not checked strictly when the source line is disabled.
2985 - #define and #undef is on the other hand checked strictly at any
2988 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
2990 * cs-tokenizer.cs : missing Location (actually, filename) in one of
2993 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2995 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2997 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2999 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
3000 (FieldBase.Initializer): Initializer is now optional.
3001 (EventField.Define): Only event field can have initializer.
3003 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
3005 * const.cs (Const): Reuse initializer.
3007 * cs-parser.jay: Updated after FieldBase changes.
3008 Added current_array_type to simplify array initializers.
3010 * ecore.cs (NullCast.IsDefaultValue): Implemented.
3012 * expression.cs, iterators.cs: Updated.
3014 * namespace.cs (NamespaceEntry): Made UsingFound private.
3016 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3018 * parameterCollection.cs: Obsolete, removed.
3019 * parser.cs: Obsolete, removed.
3021 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3024 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
3026 * enum.cs (Enum.Define): Set obsolete context here.
3028 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
3031 - FindDocumentedMember() now expects 1) paramList as null
3032 when "we don't have to check the number of parameters" and
3033 2) Type.EmptyTypes when "there is no arguments".
3034 - Introduced FoundMember struct to hold the exact type which was
3035 used to find the documented member (the above change broke
3036 test-xml-044; it might be better just to use DeclaringType than
3037 what MS does, like this change does, but it depends on usage.)
3039 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
3041 * doc.cs : documented member might be from DeclaringType for nested
3042 types. Fixed bug #76782.
3044 2005-12-03 Ben Maurer <bmaurer@ximian.com>
3046 * anonymous.cs: Have the param code handle leaving copies on the
3047 stack etc. Allows anonymous params to take part in the assignment
3048 code (++, +=, etc). Fixes bug #76550
3050 * expression.cs: Handle the prepare_for_load/leave_copy by passing
3051 it down to the anon code.
3053 * iterators.cs: Use dummy var here
3055 * codegen.cs: Handle new vars
3057 2005-12-01 Marek Safar <marek.safar@seznam.cz>
3060 * class.cs (MethodData.Define): Set proper Obsolete context.
3062 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
3064 (FieldExpr.DoResolve): Ditto.
3066 2005-12-01 Marek Safar <marek.safar@seznam.cz>
3069 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
3070 parent is not obsolete.
3072 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
3074 * doc.cs : (FindDocumentedMember) find parameterless members first
3075 and get CS0419 in the early stage. Fixed first case of bug #76727.
3077 2005-11-30 Marek Safar <marek.safar@seznam.cz>
3080 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
3081 no error was reported.
3083 *expression.cs (Binary.DoResolve): left can be null.
3085 2005-11-22 Marek Safar <marek.safar@seznam.cz>
3088 * class.cs (MethodData.Emit): Parameters should be labeled first.
3090 2005-11-21 Marek Safar <marek.safar@seznam.cz>
3093 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
3095 2005-11-18 Marek Safar <marek.safar@seznam.cz>
3097 * attribute.cs (AreParametersCompliant): Moved to Parameter.
3099 * class.cs (MethodCore): Parameter clean up.
3100 (IMethodData): Added ParameterInfo.
3101 (MethodData): Parameter clean up.
3102 (Indexer.Define): Parameter clean up.
3114 * typemanager.cs: Parameter clean up.
3116 * delegate.cs (Define): Get rid of duplicated code.
3118 * expression.cs (ParameterReference): Removed useless parameters
3120 (Invocation): Ditto.
3122 * parameter.cs (ParamsParameter): New class, params specialization.
3123 (ArglistParameter): Attemp to separate arglist.
3124 (Parameter): Refactored to be reusable and faster.
3125 (Parameter.Modifier): Made understandable.
3126 (Parameters): Changed to be used as a class for `this' assembly
3127 parameters. Refactored to use new specialized classes.
3129 * support.cs (ParameterData): Added Types property.
3130 (InternalParameters): Deleted.
3132 2005-08-20 Martin Baulig <martin@ximian.com>
3134 Merging this patch from GMCS to fix #75867.
3136 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3137 scope if we don't already have it.
3139 2005-11-17 Martin Baulig <martin@ximian.com>
3142 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
3143 inherit the scope from our parent. Fixes #76653.
3145 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3147 * doc.cs : the previous patch does not actually fix the bug.
3148 PropertyInfo override check is now implemented and really fixed it.
3149 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
3151 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3153 * doc.cs : apply "override filter" also to properties.
3156 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3158 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
3159 no need to check overrides. For classes, omit those results from
3160 interfaces since they must exist in the class. Fixed bug #76726.
3162 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3164 * typemanager.cs : (GetFullNameSignature) differentiate indexers
3165 with different parameters. Fixed the second problem in #76685.
3167 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3169 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3170 get expected 'protected' access in CheckValidFamilyAccess()).
3173 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3175 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3176 Fixed bug #76705. CS1569 was incorrectly commented out.
3178 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3180 * doc.cs : use Invocation.IsOverride() to do real override check.
3181 * expression.cs : made Invocation.IsOverride() internal.
3183 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3185 * doc.cs : use TypeManager.FindMembers() instead of (possible)
3186 TypeBuilder.FindMembers() and filter overriden base members out.
3189 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3191 * doc.cs : ref/out parameters are represented as '@' (instead of
3192 '&' in type FullName). Fixed bug #76630 (additionally crefs).
3194 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3196 * doc.cs : when there was no '.' in cref to methods in doc comment,
3197 then parameters were missing in the output. Fixed bug #76691.
3199 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3201 * driver.cs : don't output docs when there is an error.
3204 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3207 Now it should detect indexers. Fixed primary concern in bug #76685.
3208 Fixed CS0419 message to not show the identical member signature in
3211 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3213 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3214 instead of Type.FindMembers() since it does not handle events.
3217 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
3219 * codegen.cs: Fixed typo (speficied -> specified).
3221 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3224 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3226 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3228 * attribute.cs: Changed error message.
3230 * cs-tokenizer.cs: One more check.
3232 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3234 * statement.cs (Block.Resolve): Ignore empty statement.
3236 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3238 * report.cs: Made error/warning methods more strict to avoid
3241 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3242 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3243 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3244 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3246 2005-11-08 Marek Safar <marek.safar@seznam.cz>
3248 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3249 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3251 * class.cs (TypeContainer.IsComImport): New property.
3252 (Constructor.Define): Create proper ctor for ComImport types.
3254 * expression.cs (New.CheckComImport): Fixed.
3256 2005-11-07 Miguel de Icaza <miguel@novell.com>
3258 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3259 that a parameter has been captured does not mean that we do not
3260 have to do the rest of the processing. This fixes the second part
3261 of #76592. If there was another anonymous method capturing
3262 values in the past, the Scope would never be set for the second
3263 method that captured the same parameter.
3265 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3266 properly manipulate the stack. Second part of fix for #76592.
3268 * expression.cs (New): Add support for invoking "new" on
3269 interfaces that have been flagged with the ComImport attribute and
3270 the CoClass. Fixes #76637
3272 * statement.cs (Try.DoEmit): When a variable is captured, do not
3273 try to emit the vi.LocalBuilder variable as it has been captured.
3274 Create a temporary variable and store the results on the
3275 FieldBuilder. Fixes #76642
3277 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3279 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3281 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3283 * expression.cs (Binary.DoResolve): Added && optimalization.
3285 * typemanager.cs (AddUserType): Removed useless argument.
3287 2005-11-04 Marek Safar <marek.safar@seznam.cz>
3289 * statement.cs (Block.variables): Uses ListDictionary.
3291 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3294 * class.cs (PartialContainer.EmitType): Customized to emit
3295 security attributes.
3296 (ClassPart.ApplyAttributeBuilder): Transform security attribute
3297 for partial classes.
3299 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3302 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3303 access has to be fixed.
3305 * typemanager.cs (IsUnmanagedType): Wrong common field type.
3307 2005-11-01 Marek Safar <marek.safar@seznam.cz>
3310 * ecore.cs (NullCast.Reduce): Implemented.
3312 * expression.cs (ArrayCreation.CheckIndices): Correcly check
3315 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3317 (Foreach.Resolve): Catch null properly.
3319 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3321 * cs-tokenizer.cs: Warning text fix.
3323 * driver.cs: AllWarningNumbers exposed on public interface.
3325 * report.cs (): Reviewed warning numbers.
3326 (IsValidWarning): Use binary search.
3328 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3330 * driver.cs: Implemeted resource visibility.
3331 (Resources): New class for code sharing between /res: and
3334 2005-10-28 Marek Safar <marek.safar@seznam.cz>
3337 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3340 * convert (Convert.ImplicitReferenceConversion): NullCast holds
3343 * ecore.cs (NullCast): Child is contant only.
3345 * literal.cs (NullLiteral.Reduce): null can be converted to any
3348 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
3350 * driver.cs: Use Encoding.Default as default code page instead
3353 2005-10-27 Raja R Harinath <rharinath@novell.com>
3356 * expression.cs (Invocation.Error_InvalidArguments): Handle
3357 __arglist parameters.
3358 (Invocation.VerifyArgumentsCompat): Likewise.
3359 * support.cs (ReflectionParameters.GetSignatureForError): Print
3360 __arglist parameters.
3361 (InternalParamters.GetSignatureForError): Likewise.
3362 * parameter.cs (Parameters.GetSignatureForError): Likewise.
3364 2005-10-26 Marek Safar <marek.safar@seznam.cz>
3366 * attribute.cs (GetPropertyValue): Made public.
3368 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3370 Add new property WrapNonExceptionThrows to handle 2.0 assembly
3372 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3375 * driver.cs: Reflect method name change.
3377 * statement.cs (Try.Resolve): Warn when try has both general
3380 * typemanager.cs: runtime_compatibility_attr_type new predefined
3383 2005-10-26 Raja R Harinath <harinath@gmail.com>
3386 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3387 treat it as an empty parameter list.
3389 2005-10-26 Raja R Harinath <rharinath@novell.com>
3392 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
3393 ResolveAsTypeStep silent.
3394 * statement.cs (Block.AddConstant): Mark block as used.
3395 (Block.ResolveMeta): Avoid piling on error messages
3396 if a constant initializer resolution fails.
3398 2005-10-25 Raja R Harinath <rharinath@novell.com>
3400 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3402 (NamespaceEntry.VerifyAllUsing): New.
3403 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
3404 behaviour. Delegates actual resolution of alias to ...
3405 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
3406 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3408 * driver.cs (Driver.MainDriver): Update.
3410 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3411 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3413 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3415 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3416 RootNamespace.DefineNamespacesForAll.
3418 2005-10-24 Raja R Harinath <harinath@gmail.com>
3420 * typemanager.cs (assemblies, external_aliases, modules)
3421 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3422 (ComputeNamespaces, GetRootNamespace): Remove extra staging
3423 overhead. Move resposibility ...
3424 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
3425 * driver.cs, attribute.cs, codegen.cs: Update to changes.
3427 2005-10-23 Raja R Harinath <harinath@gmail.com>
3429 * namespace.cs (RootNamespace.all_namespaces): Renamed from
3430 cached_namespaces. Improve usage.
3431 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3432 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3433 Move from GlobalRootNamespace and simplify.
3434 (RootNamespace.Global): Make instance variable.
3435 (RootNamespace.RootNamespace): Add "alias name" parameter.
3436 (GlobalRootNamespace): Simplify drastically.
3437 (Namespace.Lookup): Don't use GetNamespace.
3438 * typemanager.cs (GetRootNamespace): Rename from
3439 ComputeNamespaceForAlias.
3440 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3442 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3444 * anonymous.cs (AnonymousContainer): Don't crash when container
3447 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3449 * expression.cs (Binary.DoResolve): Warn when comparing same
3452 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3455 * expression.cs (Binary.DoResolve): It looks like there are no
3456 convetsion rules in enum context.
3458 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3460 Add support for extern alias qualifiers.
3461 * typemanager.cs: Move some LookupTypeReflection code
3462 to namespace.cs, to have cleaner code. Added some methods
3463 to help us keep track of the extern aliased references.
3464 * driver.cs: Add suport for extern alias assemblies on command
3465 line and check for their warnings/errors. Also keep track of the
3466 extern aliased assemblies.
3467 * namespace.cs: Move the global functionality of Namespace
3468 to GlobalRootNamespace/RootNamespace. Now the global namespace
3469 is GlobalRootNamespace.Globa. Also the code moved from
3470 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
3471 Finally added LocalAliasEntry (AliasEntry before) and
3472 ExternAliasEntry, to handle alias statements.
3473 * cs-parser.jay: Add support in the grammar for extern alias
3475 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
3476 Update callings to Namespace (now in GlobalRootNamespace).
3478 2005-10-18 Raja R Harinath <rharinath@novell.com>
3481 * class.cs (TypeContainer.DefineType): Move updating of
3482 topological sort earlier in the code.
3483 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3485 2005-10-18 Marek Safar <marek.safar@seznam.cz>
3488 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3490 * constant.cs (Constant.TryReduce): Moved from Cast class.
3491 (Reduce): Made little bit more OO and fixed missing conversions.
3493 * ecore.cs (Reduce): Implemented.
3494 (Binary.EnumLiftUp): New method to upgrade values to enum values.
3496 * literal.cs (Reduce): Implemented.
3498 * class.cs: Reverted Miguel's wrong commit.
3500 2005-10-14 Miguel de Icaza <miguel@novell.com>
3502 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3504 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
3506 * cs-parser.jay, expression.cs : CS0214 was missing error location
3507 for constants. Fixed bug #76404.
3509 2005-10-11 Marek Safar <marek.safar@seznam.cz>
3512 * convert.cs (ExplicitConversionCore): Fixed object->enum
3515 2005-10-10 Raja R Harinath <rharinath@novell.com>
3517 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3519 (PropertyExpr.EmitCall): Likewise.
3520 * expression.cs (Invocation.EmitArguments): Handle case where
3522 (Invocation.EmitCall): Avoid allocating temporary variable if
3523 there are no arguments.
3525 2005-10-07 Raja R Harinath <rharinath@novell.com>
3528 * convert.cs (ImplicitConversionStandard): Move conversion of
3529 void* to arbitrary pointer types ...
3530 (ExplicitConversionStandard): .. here.
3531 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3532 error to always print typenames.
3534 2005-10-07 Raja R Harinath <rharinath@novell.com>
3536 * convert.cs (GetConversionOperator): Rename from
3537 GetConversionOperators. Move operator selection code from ...
3538 (UserDefinedConversion): ... here.
3540 2005-10-06 Marek Safar <marek.safar@seznam.cz>
3542 * convert.cs (ExplicitConversionCore): Removed duplicate enum
3545 2005-10-05 Marek Safar <marek.safar@seznam.cz>
3547 * assign.cs (Assign.DoResolve): Error method changed.
3549 * cfold.cs (DoConstantNumericPromotions): Error method changed.
3551 * const.cs (ResolveValue): Reset in_transit immediately.
3553 * constant.cs: Error method changed.
3555 * convert.cs: Removed useless location parameter.
3556 (ExplicitNumericConversion): Don't do double enum check.
3557 (ExplicitConversionCore): Renamed from ExplicitConversion.
3558 (ExplicitUnsafe): Extracted from ExplicitConversion.
3559 (ExplicitConversion): Uses for error reporting.
3561 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3563 (ResolveBoolean): Uses common error method.
3564 (CastToDecimal): Get rid of ec.
3565 (CastFromDecimal): Optimized.
3566 (ConvCast): Get rid of ec.
3568 * enum.cs (ResolveValue): Reset in_transit immediately.
3569 (Emit): Return after first error.
3571 * expression.cs: Convert changes.
3573 * literal.cs: Error method changed.
3575 * statement.cs: Error method changed.
3577 2005-10-03 Raja R Harinath <rharinath@novell.com>
3579 * support.cs (SeekableStreamReader.Position): Don't error out when
3580 the requested position is just beyond the end of the current
3583 2005-09-28 Raja R Harinath <rharinath@novell.com>
3585 * support.cs (SeekableStreamReader): Simplify drastically. Don't
3586 try to keep in sync with the byte count of the underlying Stream.
3587 However, this limits us to a window size of 2048 characters: i.e.,
3588 the maximum lookahead of our lexer/parser can be 2048 characters.
3590 2005-09-28 Marek Safar <marek.safar@seznam.cz>
3593 * driver.cs: Fix compilation files with full root path.
3595 2005-09-25 Miguel de Icaza <miguel@novell.com>
3597 * report.cs (SymbolRelatedToPreviousError): Format the output so
3598 it does not use an open parenthesis that is never closed.
3600 * driver.cs: Follow coding guidelines
3602 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3605 * const.cs (Const.ResolveValue): Check for assigning non-null
3606 value to reference type.
3608 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3610 * anonymous.cs: Implemented ExprClassName.
3612 * assign.cs (Assign.DoResolve): Don't chrash when type is not
3615 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3618 * class.cs (StaticClass.DefineContainerMembers): Report protected
3621 * codegen.cs: if(ed) PRODUCTION.
3623 * convert.cs (Error_CannotImplicitConversion): Better error
3626 * cs-parser.jay: More error checks.
3628 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3630 * driver.cs (CSCParseOption): Enabled wrong option check.
3632 * ecore.cs (Expression.ExprClassName): Turned to property.
3633 (MemberExpr.CheckIntermediateModification): For checking boxed
3634 value types modification.
3636 * statement.cs (Fixed.Resolve): Expression type must be
3637 convertible to fixed type.
3638 (CollectionForeach.GetEnumeratorFilter,TryType):
3639 Small refactoring for easier error checking.
3641 2005-09-26 Marek Safar <marek.safar@seznam.cz>
3643 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3646 * class.cs (GeneratedBaseInitializer): New class for customization
3647 compiler generated initializers.
3648 (MemberBase.DoDefine): Check Obsolete attribute here.
3649 (FieldMember.DoDefine): Ditto.
3651 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3654 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3655 (MemberCore.GetObsoleteAttribute): Removed argument.
3656 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3657 (MemberCore.CheckObsoleteType): New helper.
3661 * statement.cs: Updates after MemberCore changes.
3663 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3664 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3666 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3667 obsolete attribute for compiler construct.
3668 (As.DoResolve): Cache result.
3670 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3672 2005-09-26 Raja R Harinath <rharinath@novell.com>
3675 * expression.cs (This.VerifyFixed): In a value type T, the type of
3676 'this' is T&, iow, 'this' is either an out or ref parameter. In a
3677 value type R, 'this' is treated as a value parameter.
3679 2005-09-22 Miguel de Icaza <miguel@novell.com>
3681 * statement.cs (Lock): Use the TemporaryVariable class instead of
3682 manually using local variables as those do not work when variables
3685 * ecore.cs: Moved the TemporaryVariable class from being a nested
3686 class inside Foreach to be a public class that can be employed in
3689 2005-09-19 Marek Safar <marek.safar@seznam.cz>
3691 * cs-parser.jay: interface_accessors replaced by
3692 accessor_declarations.
3694 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3697 * statement.cs (GotoCase.Resolve): Convert null constant to
3699 (SwitchLabel.ResolveAndReduce): Ditto.
3700 (SwitchLabel.NullStringCase): Custom null stamp.
3701 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3703 typemanager.cs (CSharpSignature): Don't skip first argument
3706 2005-09-18 Miguel de Icaza <miguel@novell.com>
3708 * driver.cs: Set InEmacs based on the environment variable EMACS.
3710 * location.cs (InEmacs): in this mode, do not report column
3711 location as it confuses Emacs.
3713 2005-09-16 Marek Safar <marek.safar@seznam.cz>
3715 * cfold.cs, constant.cs, convert.cs, ecore.cs,
3716 expression.cs, iterators.cs, literal.cs: Store constants and
3719 * class.cs (MemberBase.ShortName): Pass location.
3721 * cs-parser.jay: Some location fixes.
3723 * ecore.cs (Expression.Location): Made virtual.
3725 2005-09-05 Miguel de Icaza <miguel@novell.com>
3727 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3728 if the underlying types are the same, otherwise we need to produce
3729 code that will do the proper cast.
3731 This was exposed by Marek's constant rewrite which produced
3732 invalid code for the call site:
3735 void Method (X v) {}
3739 This fixes test-49.cs
3741 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3743 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3744 Type/Object should be allowed as well. Fixed bug #75968.
3746 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3748 * expression.cs : (Binary.DoResolve): when one is enum constant and
3749 another is constant 0, then return enum one *as enum type*.
3752 2005-09-02 Raja R Harinath <rharinath@novell.com>
3754 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3758 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3759 flow-branching for LocalVariableReferences in case we were invoked
3760 from a MemberAccess.
3761 * expression.cs (LocalVariableReference.VerifyAssigned): New.
3763 (LocalVariableReference.DoResolveBase): ... this.
3764 (MemberAccess.Resolve): Do the check that was disabled during
3767 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3770 (PartialContainer.Create): check abstract/sealed/static strictly
3771 but abstract/sealed can exist only at one side. Fixed bug #75883.
3773 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
3776 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3777 specified, don't default to UnmanagedType.I4.
3779 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3781 * expression.cs : conditional operator should check possibly
3782 incorrect assign expression. Fixed bug #75946.
3784 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
3786 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
3787 Reverting the change. gmcs is much complex than mcs on this matter.
3789 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
3791 * cs-tokenizer.cs : To read another token ahead of the actual
3792 consumption, use new SavedToken and cache token instead of moving
3793 back the stream with SeekableStreamReader (it seemed problematic).
3795 driver.cs : Thus use StreamReader directly.
3796 * support.cs : Thus removed SeekableStreamReader.
3798 2005-08-30 Raja R Harinath <rharinath@novell.com>
3801 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3802 (ScopeInfo.EmitScopeType): Use it to construct field names from
3803 names of captured locals.
3806 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3807 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3808 Pass 'target_type' to BoxedCast. Don't default to 'object'.
3809 (ExplicitConversion): Remove enum cases already handled by
3810 implicit conversion. Move implicit conversion check to the beginning.
3811 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3812 * expression.cs (ArrayCreation.EmitDynamicInitializers):
3813 Don't treat System.Enum as a struct.
3815 2005-08-30 Jb Evain <jbevain@gmail.com>
3817 * attribute.cs: handles as expression in parameters.
3819 2005-08-30 Raja R Harinath <rharinath@novell.com>
3822 * class.cs (TypeContainer.VerifyClsName): Don't use a
3823 PartialContainer when verifying CLS compliance.
3824 (AbstractPropertyEventMethod): Set Parent here, ...
3825 (PropertyMethod): ... not here.
3827 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
3829 * attribute.cs : escaped attribute name should not be allowed to be
3830 resolved (e.g. @class as classAttribute). Fixed bug #75930.
3832 2005-08-29 Raja R Harinath <rharinath@novell.com>
3835 * convert.cs (ImplicitStandardConversionExists): Allow zero also
3836 when converting a long constant to unsigned long.
3837 * expression.cs (Invocation.OverloadResolve): Add sanity check to
3838 detect where IsApplicable and VerifyArgumentsCompat disagree.
3840 2005-08-29 Raja R Harinath <rharinath@novell.com>
3841 and Carlos Alberto Cortez <carlos@unixmexico.org>
3844 * class.cs (TypeContainer.CanElideInitializer): New helper.
3845 (TypeContainer.EmitFieldInitializers): Use it to determine if we
3846 can safely emitting the initializer of a field.
3848 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3850 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3851 allowed inside a switch (without loop). Fixed bug #75433.
3853 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3855 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3856 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3858 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3860 * driver.cs : kinda reverting the default encoding changes (not exact
3861 revert since I noticed that "codepage:reset" might not work fine).
3863 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3865 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3866 Location. Now getter and setter store location correctly.
3867 (errors/cs0111-12.cs now reports the expected location.)
3869 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3871 * driver.cs : Use default encoding on the environment.
3872 Removed (now that) extra parameter for SeekableStreamReader.
3873 * support.cs : (SeekableStreamReader) third .ctor() argument for
3874 StreamReader is not required (always true). preamble size could
3875 be acquired in simpler and safe way.
3877 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
3879 * cs-parser.jay: report CS0642 at warning level 3
3880 and report CS0642 for an if else statement also
3881 fixes bug #74745. Patch by John Luke (and a bit
3883 Removed extra CS0642 warning check for "while",
3885 * statement.cs: In Block.Resolve(), CS0642 check
3886 is reimplemented to check a sequence of an empty
3887 statement and a block.
3889 Both fix bug #66777.
3891 2005-08-24 Marek Safar <marek.safar@seznam.cz>
3893 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3894 detection until I fix it.
3896 * cs-tokenizer.cs: Changed error message.
3898 * cs-parser.jay: Fixed 2 error locations.
3900 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3901 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3904 * enum.cs (GetSignatureForError): Fixed.
3906 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3910 * typemanager.cs (RegisterProperty): Removed.
3912 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3914 2005-08-24 Raja R Harinath <rharinath@novell.com>
3917 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3918 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3920 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3922 * expression.cs : tiny fix is required for not warning positive ulong.
3925 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3927 * expression.cs : add CS0652 check for constant and integral
3928 expression. Fixed bug #53974.
3930 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3932 * expression.cs : in DoNumericPromotions(), check if there is implicit
3933 conversion overload for string (to check CS0034). Fixed bug #52492.
3935 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3937 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3939 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3941 * ecore.cs : report location when it is *not* Null.
3943 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3949 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3950 correctly. Fixed bug #75721.
3952 2005-08-23 Raja R Harinath <rharinath@novell.com>
3954 * support.cs (SeekableStreamReader.Position): Avoid an expensive
3955 loop that performs 'min (pos, char_count)'.
3958 * expression.cs (Unary.ResolveOperator): Don't discard implicit
3959 converted value in Operator.OnesComplement.
3961 2005-08-22 Ben Maurer <bmaurer@ximian.com>
3963 * anonymous.cs: If the anon method is pulled into a helper class,
3964 it needs to be `internal' not `private'. Fixes runtime behavior on
3967 2005-08-20 Martin Baulig <martin@ximian.com>
3969 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3970 scope if we don't already have it.
3972 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3973 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3976 2005-08-17 Marek Safar <marek.safar@seznam.cz>
3979 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3982 2005-08-16 Marek Safar <marek.safar@seznam.cz>
3984 The big constants rewrite
3985 Fix #75746, #75685 and more
3986 As a side effect saved 1MB for MWF ;-)
3988 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3989 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3990 enum based for corlib compilation.
3992 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3995 * class.cs (FixedField.Define): Use ResolveAsConstant.
3997 * const.cs (IConstant): Interface constants and enums.
3998 (Const.ResolveValue): New method for constant resolvning.
3999 (ExternalConstant): Constants from imported assemblies.
4001 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4002 conversion; like enums.
4003 (Constant.ToType): Converts this constant to different type.
4004 (Constant.Increment): Adds 1.
4006 * convert.cs (ImplicitConversionRequired): Simplified.
4008 * cs-parser.jay: Create EnumMember directly.
4010 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4012 * doc.cs (GenerateEnumDocComment): Removed.
4014 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4015 (ConvertIntLiteral): Removed.
4016 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4018 * enum.cs (EnumMember): Implement IConstant.
4019 (Enum.IsValidEnumConstant): Removed.
4020 (Enum.GetNextDefaultValue): Removed.
4021 (Enum.FindMembers): Updated.
4022 (Enum.GenerateDocComment): Iterate enum members.
4024 * expression.cs (Cast.TryReduce): Handle enums correctly.
4025 (New.Constantify): Made public.
4026 (MemberAccess.DoResolve): Removed contant specific if(s).
4028 * literal.cs (NullLiteral): Implement new abstract methods.
4030 * statement.cs (GotoCase.Resolve): Use new constant methods.
4031 (SwitchLabel.ResolveAndReduce): Use new constant methods.
4033 * typemanager.cs (LookupEnum): Removed.
4034 (IsEnumType): Fixed to work with corlib.
4035 (RegisterConstant): Removed.
4036 (LookupConstant): Removed.
4037 (GetConstant): Changed to work with IConstant.
4039 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
4041 * location.cs : Fixed overflown (>255) column number.
4043 2005-08-03 Raja R Harinath <rharinath@novell.com>
4045 First cut of the qualified-alias-member feature.
4046 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4048 * cs-parser.jay (DOUBLE_COLON): New token.
4049 (namespace_or_type_name): Add rule for recognizing
4050 qualified-alias-members.
4051 (primary_expression): Likewise.
4052 (element_access): Allow QualifiedAliasMember as a possible
4053 type-bearing expression.
4054 (local_variable_type, local_variable_pointer_type): Likewise.
4055 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
4056 aliases in the current and enclosing namespace declarations.
4057 (NamespaceEntry.UsingAlias): Add CS0440 warning.
4058 * decl.cs (MemberName.is_double_colon): New.
4059 (MemberName.MemberName): Add new constructor for alias-member.
4060 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4061 * expression.cs (QualifiedAliasMember): New expression type.
4063 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4065 * location.cs : it borked when no argument was specified.
4067 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4069 * location.cs : tiny ToString() format fix.
4071 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4073 * statement.cs : oops, it was missing.
4075 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4077 A set of fixes for precise line/column location.
4080 "token" field now holds a file/line "delta", a line number offset
4081 from the segment, and a column number. See also:
4082 http://lists.ximian.com/pipermail/mono-devel-list/2004-
4083 December/009508.html
4084 Removed static IsNull. Use instance IsNull property instead.
4086 For some tokens it stores Location. For Identifier it stores
4087 LocatedToken which is a pair of string name and location.
4088 Column numbers are adjusted only at getChar().
4090 Use Location.ToString() for reporting (it now contains column).
4092 Largely modified to use LocatedToken instead of
4093 string (IDENTIFIER), and to acquire Location from some tokens.
4094 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4095 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4097 Now MemberName holds Location. DeclSpace.ctor() receives Location
4098 as a parameter. Removed extra parameters to all derived classes.
4099 Replaced Location.IsNull() with instance property.
4100 * assign.cs, expression.cs :
4101 Added .ctor() overload that omits Location.
4103 Added "nameEscaped" flag that indicates the identifier was escaped
4104 in the source file. This fixes bug #57047.
4106 2005-08-02 Marek Safar <marek.safar@seznam.cz>
4108 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4109 New method, looking for lo-case imported cls type.
4111 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4114 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4116 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4118 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4120 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4122 Optimized to save 3.5 MB for SWF compilation.
4124 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4126 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4127 (PartialContainer.Create): Moved logic AddToContainer.
4128 (PartialContainer.MarkForDuplicationCheck): Shares name.
4130 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4133 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4135 (Namespace.GetSignatureForError): New method.
4137 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4138 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4140 2005-08-01 Raja R Harinath <rharinath@novell.com>
4143 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4144 member lookup rather than qualifier_type, since qualifier_type can
4147 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4149 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4152 2005-07-31 Miguel de Icaza <miguel@novell.com>
4154 * statement.cs: Copy the local exception into the exception
4155 captured local. Fixes 75674
4157 2005-07-31 Raja R Harinath <harinath@gmail.com>
4160 * expression.cs (Invocation.OverloadResolve): Don't report error
4161 CS1501 if error CS1502 has been reported.
4162 (New.DoResolve): Delegate CS1501 reporting to
4163 Invocation.OverloadResolve.
4166 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4167 invariant-meaning-in-block property in an enclosing block if
4170 2005-07-29 Marek Safar <marek.safar@seznam.cz>
4172 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4173 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4174 (Switch.CheckSwitch): Just save 50kb for SWF.
4176 2005-07-27 Martin Baulig <martin@ximian.com>
4178 * anonymous.cs (CaptureContext.AddField): Added
4179 `AnonymousContainer am' argument; compute its toplevel scope if
4180 it's not already computed. Fixes #75649.
4182 2005-07-26 Raja R Harinath <rharinath@novell.com>
4185 * class.cs (Constructor.Emit): Reset block to null if the block
4188 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4190 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4192 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4194 * class.cs (MethodData.Define): Check whether accessor implementing
4195 interface is public.
4197 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4199 2005-07-22 Marek Safar <marek.safar@seznam.cz>
4202 * namespace.cs (LookupType): Moved same type check to...
4204 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4207 2005-07-21 Raja R Harinath <rharinath@novell.com>
4209 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4210 already found a typebuilder.
4211 * class.cs (MethodCore.IsDuplicateImplementation): Compare
4212 MemberNames, not strings.
4214 * const.cs (Error_ExpressionMustBeConst):
4215 Rename from Error_EpressionMustBeConst.
4216 * const.cs, class.cs, statement.cd: Update.
4218 2005-07-21 Marek Safar <marek.safar@seznam.cz>
4222 * const.cs (Const.LookupConstantValue): Report missing contant expression
4224 (Error_EpressionMustBeConstant): Only one error method.
4226 * class.cs, statement.c: Updated.
4228 2005-07-20 Raja R Harinath <rharinath@novell.com>
4230 * statement.cs (Block.Flags): Add back HasVarargs.
4231 (Block.flags): Make protected.
4232 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4234 * typemanager.cs (types, typecontainers, user_types): Remove.
4235 (UserTypes, TypeContainers): Likewise.
4236 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4237 (CleanUp, Reset): Update.
4238 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
4239 (GetNestedType): Use Type.GetNestedType.
4240 (CoreLookupType): Take two arguments, the namespace and the
4241 basename of the type. Update to use the Namespace.Lookup
4243 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4244 (RealMemberLookup): Use IsNestedChildOf instead of playing with
4245 string concatenation and substring matches.
4246 * class.cs, enum.cs, delegate.cs: Update to changes.
4248 2005-07-20 Marek Safar <marek.safar@seznam.cz>
4250 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4251 Expression and made virtual.
4253 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4254 (ImplicitStandardConversionExists): Fixed `byte' typo ?
4256 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4258 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4261 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4264 2005-07-18 Marek Safar <marek.safar@seznam.cz>
4267 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4268 AssemblyCultureAttribute is not used on executable.
4271 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4273 2005-07-16 Raja R Harinath <rharinath@novell.com>
4276 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4277 New. Reports CS0252/CS0253.
4278 Mostly taken from preliminary patch by Duncak Mak.
4279 (Binary.DoResolveOperator): Store results of operator lookup.
4280 Use them to detect if we need to warn about unintended reference
4283 2005-07-15 Raja R Harinath <rharinath@novell.com>
4286 * namespace.cs (Namespace.Lookup): Add back location parameter.
4287 (Namespace.LookupType): Add CS0436 report. Add location parameter.
4288 * delegate.cs, ecore.cs, expression.cs: Update to changes.
4290 * codegen.cs (EmitContext.DeclSpace): Make readonly.
4291 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4292 (Namespace.LookupType): ... this.
4293 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4295 * typemanager.cs (LookupTypeReflection): Remove buggy code that
4296 purported to handle pointers.
4297 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4300 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4302 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4305 2005-07-15 Raja R Harinath <rharinath@novell.com>
4307 * namespace.cs (Namespace.Lookup): Drop location parameter.
4308 (NamespaceEntry.LookupAlias): Remove. Merge into ...
4309 (NamespaceEntry.Lookup): ... this.
4310 (NamespaceEntry.Error_AmbiguousTypeReference):
4311 Move here from DeclSpace.
4312 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4314 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4315 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4316 Move to NamespaceEntry.
4317 * delegate.cs, expression.cs: Update to changes.
4319 2005-07-14 Marek Safar <marek.safar@seznam.cz>
4321 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4322 CheckAttributeType and refactored.
4323 (Attribute.ResolvePossibleAttributeType): Changed to reuse
4324 ResolveAsTypeTerminal error handling.
4325 (ResolveAsTypeTerminal): Introduced because of global attributes extra
4327 (GetSignatureForError): Print errors in same way.
4330 * codegen.cs: Reflect attribute GetSignatureForError change.
4333 * expression.cs: Add silent parameter to ResolveAsTypeStep.
4335 * namespace.cs (UsingEntry): Refactored to make fields private.
4338 statement.cs: Error_UnexpectedKind has extra parameter.
4340 2005-07-14 Raja R Harinath <rharinath@novell.com>
4342 * ecore.cs (IAlias): Remove.
4343 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
4344 that implement the interface.
4345 * namespace.cs (Namespace): Likewise.
4346 (Namespace.declspaces): Renamed from 'defined_names'.
4347 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
4348 DeclSpace instead of an IAlias.
4349 * tree.cs (Tree.AddDecl): Update.
4351 2005-07-12 Raja R Harinath <rharinath@novell.com>
4353 * statement.cs (Block.Flags); Remove HasVarargs.
4354 (Block.HasVarargs): Move to ToplevelBlock.
4355 (Block.ThisVariable, Block.AddThisVariable): Likewise.
4356 (Block.Variables): Make protected. Initialize variable hashtable
4358 (Block.AddVariable): Update.
4359 (Block.Resolve): Update to changes.
4360 (ToplevelBlock.HasVarargs): New boolean.
4361 (ToplevelBlock.ThisVariable): Move here from Block.
4362 (ToplevelBlock.AddThisVariable): Likewise.
4363 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
4364 * expression.cs (This.ResolveBase): Update to changes.
4365 (ArglistAccess.DoResolve): Likewise.
4367 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4370 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4372 * class.cs (TypeContainer.VerifyMembers): Distinguish between
4373 not used and not used & assigned.
4374 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4376 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4379 * expression.cs (Is.DoResolve): null is never provided type.
4381 2005-07-08 Marek Safar <marek.safar@seznam.cz>
4384 * cs-parser.jay: Less strict event error rule to catch more errors.
4386 2005-07-08 Martin Baulig <martin@ximian.com>
4388 Fix test-iter-10.cs - distinguish whether we `yield' in a property
4389 gettter (allowed) or setter (not allowed).
4391 * class.cs (Accessor): Implement IIteratorContainer.
4392 (Accessor.Yields): New public field.
4393 (PropertyBase.PropertyMethod.Define): Handle iterators on a
4397 (get_accessor_declaration, set_accessor_declaration): Set the
4398 `yields' flag on the accessor, not the property.
4399 (property_declaration): Do the iterators check on a per-accessor
4400 basis and not for the whole property.
4402 2005-07-08 Martin Baulig <martin@ximian.com>
4404 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4405 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4407 2005-07-07 Marek Safar <marek.safar@seznam.cz>
4410 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4411 (ExtractSecurityPermissionSet): Cope with self referencing security
4412 attributes properly.
4414 * driver.cs (SetOutputFile): Made public property OutputFile.
4416 2005-07-07 Raja R Harinath <rharinath@novell.com>
4419 * class.cs (TypeContainer.first_nonstatic_field): Rename from
4420 has_nonstatic_fields. Make into a FieldBase pointer.
4421 (TypeContainer.AddField): Add CS0282 check.
4422 (TypeContainer.EmitType): Update.
4424 2005-07-06 Miguel de Icaza <miguel@novell.com>
4426 * cs-tokenizer.cs (consume_identifier): Do not create strings to
4427 compare if they start with __.
4429 2005-07-06 Raja R Harinath <rharinath@novell.com>
4431 * statement.cs (Switch.SwitchGoverningType): Only look at
4432 UserCasts that don't need implicit standard conversions to one of
4433 the allowed switch types (Fixes test-322.cs).
4434 (LocalInfo.Resolve): Re-enable sanity-test.
4436 2005-07-06 Marek Safar <marek.safar@seznam.cz>
4438 * cs-tokenizer.cs (consume_identifier): Detect double undescores
4440 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4442 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4444 2005-07-06 Raja R Harinath <rharinath@novell.com>
4447 * ecore.cs (SimpleName.GetSignatureForError): Add.
4448 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4449 (MemberAccess.GetSignatureForError): Add.
4451 2005-07-05 Marek Safar <marek.safar@seznam.cz>
4453 The big error and warning messages review.
4483 * typemanager.cs: Updated.
4485 * class.cs: (MethodCore.SetYields): Moved here to share.
4486 (PropertyMethod.Define): Moved iterator setup here.
4488 * iterators.cs: Add orig_method to have full access to parent
4491 2005-07-05 Raja R Harinath <rharinath@novell.com>
4493 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4494 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4495 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4496 variable of struct type.
4497 * expression.cs (Unary.ResolveOperator): Update to change.
4498 (Indirection.VerifyFixed): Likewise.
4499 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4500 (ParameterReference.VerifyFixed): Value parameters are fixed.
4501 (This.VerifyFixed): Treat 'this' as a value parameter.
4502 * statement.cs (LocalInfo.IsFixed): Remove.
4504 2005-07-01 Martin Baulig <martin@ximian.com>
4506 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4507 `ec.EmitThis ()' to get the correct scope.
4509 2005-07-01 Martin Baulig <martin@ximian.com>
4511 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4512 instance is a ParameterReference; fixes #75299.
4514 2005-07-01 Martin Baulig <martin@ximian.com>
4516 Reverted Marek's latest patch (r46725):
4517 - it contains structural changes which are neither mentioned in
4518 the ChangeLog nor explained anywhere; for example the additional
4519 argument of EmitContext's and Iterator's .ctor's and the
4520 TypeContainer.DefineMembers() change.
4521 - structural changes like this should go in in seperate patches
4522 and not be hidden in a huge patch which just seems to affect
4523 warnings and errors.
4524 a big and hard to understand patch.
4525 - it breaks iterators and causes regressions, for instance in
4528 2005-06-30 Raja R Harinath <rharinath@novell.com>
4531 * expression.cs (Indexers.map): Remove.
4532 (Indexers.Append): Filter out inaccessible setters and getters.
4533 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4536 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
4538 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4539 (FieldExpr.Emit, PropertyExpr.Emit): Update.
4540 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4541 * expression.cs (Invocation.EmitCall): Add CS0120 check.
4543 2005-06-30 Marek Safar <marek.safar@seznam.cz>
4546 * class.cs (FieldBase.GetInitializerExpression): One more field
4549 2005-06-28 Miguel de Icaza <miguel@novell.com>
4551 * pending.cs: Do not define a proxy if the base method is virtual,
4552 it will be picked up by the runtime (bug 75270).
4554 2005-06-08 Martin Baulig <martin@ximian.com>
4556 The big Iterators rewrite :-)
4558 * iterators.cs: Rewrite this to use the anonymous methods framework.
4560 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4561 before the TypeContainers; see 2test-21.cs.
4564 (TypeContainer.DefineType): Don't create a new EmitContext if we
4565 already have one (this only happens if we're an Iterator).
4566 (TypeContainer.Define): Also call Define() on all our iterators.
4567 (Method.CreateEmitContext): Added support for iterators.
4570 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4571 (AnonymousContainer.CreateMethodHost): Moved here from
4572 AnonymousMethod and made abstract.
4573 (AnonymousContainer.CreateScopeType): New abstract method.
4574 (AnonymousContainer.IsIterator): New public property.
4575 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4576 get the ScopeTypeBuilder rather than manually defining it here.
4577 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4580 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4581 before RootContext.DefineTypes().
4583 * codegen.cs (EmitContext.RemapToProxy): Removed.
4584 (EmitContext.CurrentAnonymousMethod): Changed type from
4585 AnonymousMethod -> AnonymousContainer.
4586 (EmitContext.ResolveTopBlock): Protect from being called twice.
4587 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4588 (EmitContext.EmitThis): Removed the iterators hacks; use the
4589 anonymous methods framework for that.
4592 (ToplevelBlock.Container): Make this a property, not a field.
4593 (ToplevelBlock.ReParent): New public method; move the
4594 ToplevelBlock into a new container.
4595 (Foreach.TemporaryVariable): Simplify.
4597 2005-06-05 Martin Baulig <martin@ximian.com>
4599 * statement.cs (LocalInfo.CompilerGenerated): New flag.
4600 (Block.AddTemporaryVariable): New public method; creates a new
4601 `LocalInfo' for a temporary variable.
4602 (Block.EmitMeta): Create the LocalBuilders for all the temporary
4604 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4605 non-iterator variables.
4607 2005-06-05 Martin Baulig <martin@ximian.com>
4609 * statement.cs (Foreach.TemporaryVariable): Create the
4610 LocalBuilder in the Emit phase and not in Resolve since in some
4611 situations, we don't have an ILGenerator during Resolve; see
4612 2test-19.cs for an example.
4614 2005-06-04 Martin Baulig <martin@ximian.com>
4616 **** Merged r45395 from GCS ****
4618 The big Foreach rewrite - Part II.
4620 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4621 with `PropertyInfo ienumerator_getcurrent'.
4623 * codegen.cs (VariableStorage): Removed.
4626 (Foreach): Derive from Statement, not ExceptionStatement.
4627 (Foreach.CollectionForeach): New nested class. Moved all the code
4628 dealing with collection foreach here.
4629 (Foreach.ForeachHelperMethods): Removed.
4630 (Foreach.TemporaryVariable): Implement IMemoryLocation.
4632 2005-05-23 Martin Baulig <martin@ximian.com>
4634 * statement.cs (Try.DoResolve): Don't create a `finally' if we
4635 don't need to. Fix #75014.
4637 2005-05-20 Martin Baulig <martin@ximian.com>
4639 Merged r44808 from GMCS.
4641 * class.cs (TypeContainer.CircularDepException): Removed.
4642 (TypeContainer.DefineType): Removed the `InTransit' stuff.
4643 (TypeContainer.CheckRecursiveDefinition): Check for circular class
4644 (CS0146) and interface (CS0529) dependencies here.
4646 2005-06-21 Raja R Harinath <rharinath@novell.com>
4648 * expression.cs (Invocation.EmitCall): Fix initialization
4649 'this_call' to reflect current behaviour. Fix indentation.
4651 * convert.cs (FindMostEncompassedType): Add two trivial special
4652 cases (number_of_types == 0 || number_of_types == 1).
4653 (FindMostEncompasingType): Likewise.
4655 2005-06-17 Raja R Harinath <rharinath@novell.com>
4657 Some cleanups preparing for the fix of #75283.
4658 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4660 (EventExpr.InstanceResolve): Likewise.
4661 (EventExpr.DoResolve): Remove redundant checks.
4663 2005-06-10 Duncan Mak <duncan@novell.com>
4665 * cs-tokenizer.cs (process_directives): New flag for controlling
4666 the processing of preprocessor directives.
4667 (x_token): After seeing a '#', return Token.NONE instead of going
4668 to handle_preprocessing_directive() when not processing
4669 directives. This avoids unnecessary processing during the token peek in
4674 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
4675 the existing error reporting methods instead of Report.Error.
4677 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
4678 after Raja's rewrite.
4680 2005-06-08 Miguel de Icaza <miguel@novell.com>
4682 * class.cs: Small fix.
4684 2005-06-08 Raja R Harinath <rharinath@novell.com>
4687 * class.cs (GetPartialBases): Fix return value check of
4690 2005-06-07 Raja R Harinath <rharinath@novell.com>
4692 Ensure that partial classes are registered in their enclosing
4693 namespace. Initial part of fix of #75160.
4694 * tree.cs (Tree.RecordDecl): Add new namespace argument.
4695 Register declspace with namespace here, not in
4696 DeclSpace.RecordDecl.
4697 * cs-parser.jay: Pass namespace to RecordDecl.
4698 * class.cs (PartialContainer.Create): Likewise.
4699 (ClassPart.DefineType): New sanity-check. Throws an exception if
4701 * decl.cs (Declspace.RecordDecl): Remove.
4702 * namespace.cs (NamespaceEntry.DefineName): Remove.
4704 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4706 * rootcontext.cs: Reset TargetExt as well.
4708 2005-06-03 Raja R Harinath <rharinath@novell.com>
4710 * ecore.cs (Expression.Resolve): Emit CS0654 error when
4713 2005-06-02 Raja R Harinath <rharinath@novell.com>
4715 Fix #75080, cs0119.cs.
4716 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
4718 (Expression.Resolve): ... this. Use it. Remove bogus code
4719 allowing ExprClass.Type and ExprClass.Namespace for
4720 ResolveFlags.VariableOrValue.
4721 (Expression.Resolve) [1-argument variant]: Change default resolve
4722 flags based on language version.
4723 (Expression.Error_UnexpectedKind): Use a simple string array
4724 rather than an ArrayList.
4725 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4727 (TypeOfVoid.DoResolve): Likewise.
4728 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
4729 flags argument -- it always has the same value.
4731 2005-05-31 Raja R Harinath <rharinath@novell.com>
4734 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4735 Use it in the error message.
4736 * assign.cs, expression.cs, statement.cs: Update.
4738 2005-05-30 Raja R Harinath <rharinath@novell.com>
4741 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4742 the "almostMatchedMember" case too.
4743 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4744 that failed the accessibility checks to 'almost_match'.
4746 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
4748 * attribute.cs: Use internal MethodBuilder methods to set
4749 ExactSpelling and SetLastError on PInvoke methods, instead
4750 of passing them via charset. Fixes #75060.
4752 2005-05-27 Raja R Harinath <rharinath@novell.com>
4754 * parameter.cs (Parameter): Remove TODO comment.
4755 (Parameter.DefineParameter): Remove Location parameter.
4756 (Parameters.LabelParameters): Likewise.
4757 * class.cs (Constructor.Emit): Update to change.
4758 (MethodData.Emit): Likewise.
4759 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
4760 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4762 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
4765 Removed Parameters.Location and added Parameter.Location instead.
4766 Removed Location parameter from Emit() and GetSignature().
4773 Modified all related calls.
4775 2005-05-26 Raja R Harinath <rharinath@novell.com>
4777 Improve user-defined conversion handling.
4778 * convert.cs (GetConversionOperators): Rewrite. Return only the
4779 applicable operators.
4780 (AddConversionOperators): New. Helper for GetConversionOperators.
4781 (FindMostEncompassedType, FindMostEncompassingType): Verify that
4782 there is only one most encompassed/encompassing type.
4783 (FindMostSpecificSource, FindMostSpecificTarget): Remove
4784 "applicable operator" handling.
4785 (UserConversion): Move cache here from GetConversionOperators.
4786 Directly cache the chosen operator, rather than the whole
4788 (ExplicitNumericConversion): Fix buggy implementation of Decimal
4789 case. Allow conversion of decimal to sbyte and byte too.
4790 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4791 New static methods. Used to avoid allocating EmptyExpressions in
4794 2005-05-24 Duncan Mak <duncan@novell.com>
4796 * ecore.cs (CastFromDecimal): New class for casting a decimal to
4797 another class, used in Convert.ExplicitNumericConversion.
4798 (CastToDecimal): New class, similar to above, but casts to
4799 System.Decimal, used in Convert.ImplicitNumericConversion and also
4800 in explicit convesion from double/float to decimal.
4802 * convert.cs (ImplicitNumericConversion): Handle implicit
4803 conversions to System.Decimal.
4804 (ExplicitNumericConversion): handle explicit conversions to
4809 2005-05-20 Miguel de Icaza <miguel@novell.com>
4811 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
4812 know the type at this stage, just break through. Fixes #75008
4814 2005-05-19 Martin Baulig <martin@ximian.com>
4817 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4818 to disable error reporting.
4820 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4821 here since we don't want to report an error; see the new test-336.cs.
4823 2005-05-19 Raja R Harinath <rharinath@novell.com>
4825 * statement.cs (ToplevelBlock.GetParameterReference)
4826 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4827 Move here from class Block.
4828 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4829 * expression.cs (ParameterReference.DoResolveBase): Likewise.
4831 2005-05-18 Martin Baulig <martin@ximian.com>
4836 (FlowBranching.Reachability): Add non-static public And() and Or()
4838 (FlowBranchingSwitch): New class; do the `break_origins' thing
4839 like in FlowBranchingLoop.
4840 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4841 reachability, not just locals and parameters.
4842 (FlowBranching.MergeChild): Remove some of the hacks for loop and
4843 switch; MergeBreakOrigins() now takes care of that.
4845 2005-05-18 Martin Baulig <martin@ximian.com>
4847 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4848 a loop and may leave it, reset the barrier; fixes #74974.
4850 2005-05-17 Marek Safar <marek.safar@seznam.cz>
4852 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4855 * cs-parser.jay: Catch more lexical errors.
4857 * report.cs: Add one more Error method.
4860 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4862 2005-05-17 Martin Baulig <martin@ximian.com>
4864 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4867 2005-05-16 Raja R Harinath <rharinath@novell.com>
4869 Fix test-382.cs. Emit values of decimal constants.
4870 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4872 (TypeContainer.AddField): ... this.
4873 (TypeContainer.EmitFieldInitializers): Allow the list of fields
4874 with initializers to include 'Const's.
4875 (ClassPart.RegisterFieldForInitialization): Forward to
4877 * const.cs (Const.Const): Pass initializer to base class.
4878 (Const.Define): In case of decimal constants, register them for
4879 initialization in a static constructor.
4881 2005-05-14 Martin Baulig <martin@ximian.com>
4883 * statement.cs (Block.Resolve): Correctly handle unreachable code;
4884 do not call ResolveUnreachable() on unreachable statements in
4885 here, see the comment in the source code.
4887 2005-05-13 Raja R Harinath <rharinath@novell.com>
4890 * expression.cs (BinaryResolveOperator): If one of the operands of
4891 an equality comparison is 'null' and the other is a pointer type,
4892 convert the null to a NullPointer.
4893 * convert.cs (ImplicitReferenceConversion): If the expression is a
4894 NullLiteral and the target type is a pointer type, return a
4895 NullPointer instead.
4896 (ImplicitConversionStandard): Likewise.
4898 2005-05-13 Marek Safar <marek.safar@seznam.cz>
4900 * cs-parser.jay: Set readonly context based on special constructs.
4902 * expression.cs (LocalVariableReference.DoResolveBase): Improved
4903 readonly variable error handling.
4905 * rootcontext.cs (EmitCode): Don't verify members when error
4908 * statement.cs (LocalInfo): Add reaodnly context information.
4909 (SetReadOnlyContext, GetReadOnlyContext): New methods.
4911 2005-05-13 Raja R Harinath <rharinath@novell.com>
4913 * statement.cs (Block.Resolve): Revert change below. Modify fix
4914 for #74041 to initialize 'resolved' to false only for explicit
4915 blocks. Fixes #74873.
4917 2005-05-12 Raja R Harinath <harinath@gmail.com>
4920 * typemanager.cs (unmanaged_enclosing_types): New.
4921 (IsUnmanagedType): Avoid infloops by using
4922 'unmanaged_enclosing_types' to talk with recursive invocations.
4924 2005-05-13 Martin Baulig <martin@ximian.com>
4926 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4927 instance variable, not a local. Fix #74873.
4928 (Block.ResolveUnreachable): Set it to true here.
4930 2005-05-11 Duncan Mak <duncan@novell.com>
4932 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4933 continuing to process for 'arg'.
4934 (handle_preprocessing_directive): Check the argument of the #endif
4935 directive and report error CS1025 if there are any trailing
4938 According to the C# spec, having even whitespace after the #endif
4939 directive is illegal; however, because we call arg.TrimEnd ()
4940 beforehand, we have the same behavior as csc, allowing whitespace
4941 after the directive.
4945 2005-05-11 Marek Safar <marek.safar@seznam.cz>
4949 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4950 (Constructor.GetObsoleteAttribute): Implemented correctly.
4952 2005-05-10 Martin Baulig <martin@ximian.com>
4954 * support.cs (ReflectionParameters.ParameterModifier): Use
4955 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4956 and `ParameterAttributes.In'. Fixes #74884.
4958 2005-05-10 Marek Safar <marek.safar@seznam.cz>
4960 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4962 * expression.cs (Argument.GetParameterModifier): Turned to property.
4963 (Invocation.Error_InvalidArguments): Add more descriptive errors.
4965 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4968 2005-05-09 Raja R Harinath <rharinath@novell.com>
4971 * decl.cs (MemberCache.AddMethods): Register override methods,
4972 rather than non-override methods.
4973 * typemanager.cs (RegisterOverride): New.
4974 (IsOverride): Update.
4976 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4980 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4981 recursive declaration.
4983 * statement.cs (Block.ResolveMeta): Report any error in resolving.
4985 2005-05-06 Marek Safar <marek.safar@seznam.cz>
4987 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4989 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4991 2005-05-05 Raja R Harinath <rharinath@novell.com>
4994 * decl.cs (DeclSpace.FamilyAccessible):
4995 Use TypeManager.IsNestedFamilyAccessible.
4997 Fix reopened #64812.
4998 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5001 2005-05-04 Raja R Harinath <rharinath@novell.com>
5002 Abin Thomas <projectmonokochi@rediffmail.com>
5003 Anoob V E <projectmonokochi@rediffmail.com>
5004 Harilal P R <projectmonokochi@rediffmail.com>
5007 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5008 allow access to all static members.
5010 2005-05-04 Martin Baulig <martin@ximian.com>
5012 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5014 2005-05-04 Martin Baulig <martin@ximian.com>
5018 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5019 section at the end; make things work if `default' is not the last
5022 2005-05-04 Martin Baulig <martin@ximian.com>
5026 * statement.cs (Switch): Replaced the `got_default' field with a
5027 `default_section' one.
5028 (Switch.CheckSwitch): Set `default_section' here.
5029 (Switch.Resolve): If we're a constant switch and the constant is
5030 not found, use the default section.
5032 2005-05-03 Martin Baulig <martin@ximian.com>
5034 * expression.cs (ArrayAccess.EmitGetLength): New public method.
5036 * statement.cs (Foreach.ArrayForeach): New nested class.
5037 (Foreach.TemporaryVariable): New nested class.
5038 (Foreach.EmitArrayForeach): Removed; this is now in the new
5041 2005-05-03 Raja R Harinath <rharinath@novell.com>
5043 * pending.cs (BaseImplements): Move the #74773 fix here. This is
5045 (VerifyPendingMethods): Revert change below.
5047 * typemanager.cs (IsOverride, RegisterNonOverride): New.
5048 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5049 that used to trigger warning -28. Remove warning -28.
5050 * expression.cs (Invocation.OverloadResolve): Use
5051 TypeManager.IsOverride to distinguish override methods.
5054 * pending.cs (VerifyPendingMethods): If a base type implements the
5055 requested interface, don't bother checking individual methods of
5056 the base type. As a side-effect, this prevents the creation of
5057 unnecessary proxies.
5059 2005-05-02 Martin Baulig <martin@ximian.com>
5063 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5064 Also `And' the locals if the old vector is null.
5065 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5066 null; in this case we basically reset all the variables.
5068 2005-05-02 Martin Baulig <martin@ximian.com>
5072 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5073 Added `FlowBranching branching' argument; always `and' the
5074 variables instead of `or'ing them unless we're an infinite loop.
5076 * statement.cs (While.Resolve): Create a new sibling unless we're
5079 2005-05-02 Martin Baulig <martin@ximian.com>
5083 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5084 arguments; use it instead of creating a new TopLevelBlock.
5085 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5086 our ConstructorInitializer.
5089 (TopLevelBlock.TopLevelBranching): New public property.
5090 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5091 and create our `TopLevelBranching'.
5093 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5094 anonymous method host, use `block.TopLevelBranching' rather than
5095 creating a new branching.
5097 2005-04-20 Miguel de Icaza <miguel@novell.com>
5099 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5100 a ScopeInfo, if any of the current children is a child of the new
5101 entry, move those children there.
5103 2005-04-30 Martin Baulig <martin@ximian.com>
5105 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5106 at the beginning of a SwitchSection. Fix #73335.
5108 2005-04-27 Marek Safar <marek.safar@seznam.cz>
5111 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5113 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5114 (FieldExpr.DoResolve): Obsolete members are ignored for field
5117 2005-04-26 Marek Safar <marek.safar@seznam.cz>
5119 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5120 of arrays detection.
5122 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5124 (Field.VerifyClsCompliance): Volatile fields are not compliant.
5126 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5129 2005-04-25 Ben Maurer <bmaurer@ximian.com>
5131 * cs-parser.jay: Use the prefered version of -unsafe in error
5134 2005-04-22 Marek Safar <marek.safar@seznam.cz>
5136 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5139 2005-04-20 John Luke <john.luke@gmail.com>
5141 * driver.cs: fix typo in error message, --outout to --output
5143 2005-04-20 Marek Safar <marek.safar@seznam.cz>
5145 * codegen.cs (InRefOutArgumentResolving): New field.
5147 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5148 fields outside contructor.
5150 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5152 2005-04-19 Miguel de Icaza <miguel@novell.com>
5154 * anonymous.cs (CaptureContext.EmitParameterInstance): The
5155 parameter code was not completed ever, so it was not as up-to-date
5156 as local variables. Must finish it.
5158 The bug fix was to compare the Toplevel of the block, not the
5159 current block. Thanks for Ben for pointing this out.
5161 2005-04-19 Raja R Harinath <rharinath@novell.com>
5163 * decl.cs (AddMethods): Use the declaring type of the problem
5164 method to determine if we want to squash a warning.
5166 2005-04-19 Marek Safar <marek.safar@seznam.cz>
5168 * attribute.cs: Removed debug output.
5170 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5172 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5175 2005-04-18 Raja R Harinath <rharinath@novell.com>
5178 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5179 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5180 all null comparisons against reference types.
5182 2005-04-18 Marek Safar <marek.safar@seznam.cz>
5185 * class.cs (TypeContainer.CircularDepException) New nested
5187 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5188 (TypeContainer.DefineType): Removed error, reset InTransit before
5190 (Class.DefineType): Throw exception when is in Transit.
5191 Catch exception and report error.
5192 (Struct.DefineType): Throw exception when is in Transit.
5193 Catch exception and report error.
5194 (Interface.DefineType): Throw exception when is in Transit.
5195 Catch exception and report error.
5197 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5198 handle nested exception handlers.
5200 * flowanalysis.cs (InTryWithCatch): New method, search for try with
5203 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5204 InFinally and InCatch storage.
5206 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5207 (Catch.Resolve): Set and Restore ec.InCatch.
5208 (Try.Resolve): Set and Restore ec.InFinally.
5209 (Try.HasCatch): True when try has catch.
5211 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
5213 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5214 for the same event member, so exclude such cases from warning 419.
5217 2005-04-16 Miguel de Icaza <miguel@novell.com>
5219 * expression.cs (Binary.ResolveOperator): Apply patch from John
5220 Luke to fix bug 59864: operators &, | and ^ on enumerations
5221 require that the same enum type on both sides.
5223 * driver.cs: Add warnings to old flag usage, this is to assist
5224 people who produce Makefiles and hope that the Makefiles will be
5227 * class.cs (TypeContainer.EmitType): Moved the definition of the
5228 special $PRIVATE$ field from the resolve phase to the Emit phase.
5229 During resolve we do not know if we are a struct with
5230 HasExplicitLayout, we know this only after the attributes for the
5233 Set the FieldOffset to zero on the dummy field that we create for
5234 the class. Fixes 74590.
5236 2005-04-16 Raja R Harinath <rharinath@novell.com>
5239 * ecore.cs (PropertyExpr.resolved): New.
5240 (DoResolve): Use it to handle a case of double resolution here.
5241 Handle a case of identical-name-and-type-name.
5242 * expression.cs (ArrayCreation.CheckIndices): Avoid double
5243 resolution by storing the results of expression resolution back
5244 into the "probes" array.
5246 2005-04-15 Raja R Harinath <rharinath@novell.com>
5248 Fix cs0208-7.cs and cs0208-8.cs.
5249 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5250 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
5251 error reporting to point out the reason a struct is not unmanaged.
5253 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5255 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
5256 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5258 2005-04-13 Raja R Harinath <rharinath@novell.com>
5261 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5262 IdenticalNameAndTypeName here.
5263 (EventExpr.InstanceResolve): Likewise.
5265 2005-04-13 Marek Safar <marek.safar@seznam.cz>
5267 C# 2.0 DefaultCharSetAttribute implementation
5269 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5270 which allows us to set GlobalNamespace for every resolve.
5271 (Attribute.ResolveArguments): Cut from Resolve.
5272 (Attribute.GetCharSetValue): Returns CharSet named argument.
5273 (Attribute.DefinePInvokeMethod): Gets default charset from
5275 (GlobalAttribute.ResolveAsTypeStep): Override.
5276 (GlobalAttribute.ResolveArguments): Override.
5278 * class.cs (TypeAttr): Is protected.
5280 * codegen.cs (ModuleClass.DefaultCharSet): New member.
5281 (ModuleClass.DefaultCharSetType): New memeber.
5282 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5284 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5285 charset from module.
5287 * delegate.cs (TypeAttr): Override.
5288 (Delegate.DefineType): Use this TypeAttr.
5290 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5291 at very early stage (before types are defined) to resolve model
5292 module attributes. It will probably not work with corlib but it
5295 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5296 charset from module.
5298 * typemanager.cs (default_charset_type): New type.
5300 2005-04-13 Raja R Harinath <rharinath@novell.com>
5302 * decl.cs (MemberCache.AddMethods): Don't warn if
5303 System.Object.Finalize has buggy MethodAttributes.
5305 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5308 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5310 * doc.cs : detect ambiguous reference to overloaded members.
5311 Fixed bug #71603. MS 1.1 csc does not detect it.
5313 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5315 * doc.cs : delegates must not be referenced with parameters.
5318 2005-04-12 Miguel de Icaza <miguel@novell.com>
5320 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5322 2005-04-10 Miguel de Icaza <miguel@novell.com>
5324 * driver.cs (MainDriver): Stop processing if the CLS stage found
5327 (CompilerCallableEntryPoint.InvokeCompiler): Always
5328 reset after execution; Take a TextWriter argument for the
5331 * report.cs: Use the error stream instead of hardcoding stderr.
5333 2005-04-09 Miguel de Icaza <miguel@novell.com>
5335 * class.cs: Reduce code paths to test, too small of an
5336 optimization to make it worth the extra testing. Always perform
5339 2005-04-08 Raja R Harinath <rharinath@novell.com>
5342 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5343 operators that had errors reported on them.
5345 2005-04-08 Marek Safar <marek.safar@seznam.cz>
5347 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5349 (Attribute.Resolve): Add named argument type checking.
5351 * class.cs (FixedField.Define): Use IsPrimitiveType
5353 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5355 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5356 unsafe parameter types.
5358 * statement.cs (Using.ResolveExpression): Add better error description.
5360 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5362 2005-04-08 Raja R Harinath <rharinath@novell.com>
5365 * attribute.cs (Attribute.GetAttributeUsage): Resolve
5366 AttributeUsageAttribute in the emitcontext of the attribute class,
5367 not in the emitcontext of the attributable entity it was attached to.
5368 * cs-parser.jay: Use 'current_class', not 'current_container',
5369 when creating a GlobalAttribute.
5371 2005-04-08 Alp Toker <alp@atoker.com>
5373 * pending.cs: The fix to #58413 failed to compile methods implementing
5374 interfaces with/without params modifiers and vice versa, even though
5375 params modifiers aren't part of the signature. Make the modifier check
5376 less strict as in csc.
5378 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
5379 Anoob V E <projectmonokochi@rediffmail.com>
5380 Harilal P R <projectmonokochi@rediffmail.com>
5383 * pending.cs (TypeAndMethods.mods): New. Store the parameter
5384 modifiers of pending methods.
5385 (PendingImplementation.PendingImplementation): Initialize it.
5386 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5387 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5388 with ParameterData. Add check for modifiers.
5389 * class.cs (MethodData.Define): Update to changes.
5391 2005-04-07 Raja R Harinath <rharinath@novell.com>
5393 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5395 2005-04-07 Marek Safar <marek.safar@seznam.cz>
5397 * class.cs (PropertyMethod.Define): Check private accessor in abstract
5400 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5403 * typemanager.cs: Registered RequiredAttributeAttribute.
5405 2005-04-06 Marek Safar <marek.safar@seznam.cz>
5407 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5408 Warning CS0169 is back at level 3.
5409 (IMethodData.SetMemberIsUsed): New method.
5411 * decl.cs (IsUsed): New value; moved from FieldBase.Status
5412 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5414 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5416 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5418 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5421 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5424 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5425 to avoid the problems with nested types.
5427 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
5428 Anoob V.E <projectmonokochi@rediffmail.com>
5429 Harilal P.R <projectmonokochi@rediffmail.com>
5430 Raja R Harinath <rharinath@novell.com>
5433 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5435 * typemanager (GetConstructor): Make public.
5437 2005-04-05 John Luke <john.luke@gmail.com>
5438 Raja R Harinath <rharinath@novell.com>
5441 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5442 struct too. Return false quicker in a few cases.
5443 (VerifyUnManaged): Use it.
5445 2005-04-05 Raja R Harinath <rharinath@novell.com>
5448 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5449 not 'unreachable_seen'.
5451 2005-04-04 Marek Safar <marek.safar@seznam.cz>
5453 * attribute.cs (Attribute.GetValue): Removed unused.
5455 * codegen.cs (CodeGen.TrimExt): Removed unused.
5457 * cs-parser.jay (output): Removed unused.
5459 * cs-tokenizer.cs (hex_digits): Removed unused.
5461 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5463 * expression.cs (Indirection.LoadExprValue): Removed unused.
5464 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5466 * iterators.cs (Iterator.param_types): Removed unused.
5468 * statement.cs (Goto.block): Removed unused.
5469 (ToplevelBlock.did): Removed unused.
5470 (Switch.ResolveConstantSwitch): Removed unused.
5472 2005-04-01 Ben Maurer <bmaurer@ximian.com>
5474 * rootcontext.cs: Allow mcs to bootstrap with the compilation
5477 2005-04-01 Raja R Harinath <rharinath@novell.com>
5479 Fix #74232 and cs0208-3.cs.
5480 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5481 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5482 unmanaged type. Don't use FieldBuilders when 't' is a
5483 TypeBuilder. Use ModFlags and MemberType fields.
5484 * class.cs (MemberBase.member_type): Rename from MemberType.
5485 (MemberBase.MemberType): New property. Determines member_type on
5487 (MemberBase.DoDefine): Don't initialize MemberType here.
5488 (FieldMember.Define): Likewise.
5490 2005-04-01 Marek Safar <marek.safar@seznam.cz>
5493 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5494 Attributes are emitted there.
5496 2005-04-01 Raja R Harinath <rharinath@novell.com>
5498 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5499 keyword in 'partial enum' too.
5500 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5502 Report from Kamil Skalski <nazgul@omega.pl>.
5505 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5506 have partial containers too.
5508 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5509 in block' checks to Block.CheckInvariantMeaningInBlock.
5510 * statement.cs (Block.GetKnownVariableInfo): Make private.
5511 (Block.IsVariableUsedInChildBlock): Remove.
5512 (Block.IsVariableUsedInBlock): Likewise.
5513 (Block.CheckInvariantMeaningInBlock): New. Show location of
5514 conflicting declaration.
5515 (Block.AddVariable): Make error messages less long-winded and more
5516 specific. Show location of conflicting declaration.
5517 * parameter.cs (Parameters.Location): New readonly property.
5519 2005-03-31 Raja R Harinath <rharinath@novell.com>
5521 Clean up semantics of invoking ResolveMemberAccess.
5522 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5523 can have an instance, ensure that we pass in a non-TypeExpression
5524 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
5525 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5526 argument. Update to changes and simplify.
5527 (FieldExpr.Emitinstance): Remove CS0120 check.
5528 (PropertyExpr.EmitInstance): Likewise.
5529 * expression.cs (Argument.Resolve): Likewise.
5530 (Invocation.DoResolve): Update to changes in semantics of
5533 2005-03-31 Marek Safar <marek.safar@seznam.cz>
5536 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5539 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5541 2005-03-31 Raja R Harinath <rharinath@novell.com>
5543 Fix difference in behaviour with commandline invocation.
5544 * driver.cs (Driver.Reset): New.
5545 (CompilerCallableEntryPoint): Call it.
5547 * statement.cs (If.Resolve): Avoid spurious "uninitialized
5548 variable" warnings if the boolean expression failed to resolve.
5550 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
5552 * attribute.cs: Fix the union of several permissions when some of them
5553 are unrestricted (so the result isn't an unrestricted permission set).
5556 2005-03-30 Raja R Harinath <rharinath@novell.com>
5558 * ecore.cs (MemberExpr): New class. Convert from interface
5560 (MemberExpr.ResolveMemberAccess): Refactor and move here from
5561 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
5563 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5564 (MethodGroupExpr.IsExplicitImpl): Remove.
5565 (Expression.GetFieldFromEvent): Remove.
5566 (SimpleName.MemberStaticCheck): Remove.
5567 (SimpleName.DoSimpleNameResolve): Update to changes.
5568 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5569 (MemberAccess.IdenticalNameAndTypeName): Remove.
5570 (MemberAccess.error176): Move to MemberExpr.
5571 (MemberAccess.DoResolve): Update to changes.
5572 (BaseAccess.DoResolve): Likewise.
5574 2005-03-30 Marek Safar <marek.safar@seznam.cz>
5576 C# 2.0 Conditional attribute class implementation
5578 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5579 Analyzes class whether it has attribute which has ConditionalAttribute
5580 and its condition is not defined.
5582 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5583 (Class.IsExcluded): New method. Search for at least one defined
5584 condition in ConditionalAttribute of attribute class.
5586 2005-03-30 Raja R Harinath <rharinath@novell.com>
5588 * ecore.cs (PropertyExpr): Derive from Expression, not
5589 ExpressionStatement.
5590 (PropertyExpr.EmitStatement): Remove.
5592 2005-03-29 Raja R Harinath <rharinath@novell.com>
5595 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5596 internal field "value__" of an enum be private. The examples for
5597 "value__" that I found on MSDN all used FieldAttributes.Private.
5599 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5600 Don't mention IL method attribute names.
5602 Fix #47991. Remove a TODO.
5603 * statement.cs (Block.Toplevel): Make into a field.
5604 (Block.Parameters): Move into ToplevelBlock.
5605 (Block.known_variables): Rename from child_variable_names.
5606 (Block.Block): Remove variants that take Parameters. Initialize
5607 'Toplevel' with the immediately surrounding toplevel block.
5608 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
5609 LocalInfo parameter.
5610 (Block.GetKnownVariableInfo): New.
5611 (Block.IsVariableNameUsedInChildBlock): Update.
5612 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
5613 the block, even though it may not be in scope.
5614 (Block.AddVariable): Remove Parameters parameter. Use
5615 Toplevel.Parameters instead.
5616 (Block.AddConstant): Remove Parameters parameter.
5617 (Block.GetParameterReference): Update to use Toplevel.Parameters.
5618 (Block.IsParamaterReference): Likewise.
5619 (Block.IsLocalParameter): Likewise. Simplify a lot.
5620 (ToplevelBlock.Parameters): New. Moved from Block.
5621 (ToplevelBlock.ToplevelBlock): Update to changes. Always
5622 initialize Parameters to a non-null value.
5623 * cs-parser.jay: Update to changes.
5624 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5625 simple names that mean different things in the same block. Use
5626 Block.IsVariableNameUsedInBlock.
5628 2005-03-28 Raja R Harinath <rharinath@novell.com>
5630 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5631 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5632 GetTypeHandle. It is possible for a reflected type to derive from
5633 a TypeBuilder (e.g., int[] derives from the TypeBuilder
5634 System.Array during mscorlib compilation).
5635 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5636 contain a method_hash, don't create one either. Don't create a
5637 deep copy of the base cache's method_hash.
5638 (MemberCache.SetupCache): Rename back from DeepCopy.
5639 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5640 already initialized. If we see an override function, add its
5641 underlying base virtual function to the member_hash too.
5643 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5645 2005-03-26 Raja R Harinath <harinath@acm.org>
5648 * assign.cs (Assign.DoResolve): When the RHS of an assignment
5649 fails to resolve, ensure that the LHS is still resolved as an
5652 2005-03-25 Raja R Harinath <harinath@acm.org>
5654 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5656 (Enum.current_ec): Remove.
5657 (Enum.LookupEnumValue): Remove EmitContext argument.
5658 Just uses the one created during DefineType.
5659 (Enum.FindMembers): Update.
5660 * expression.cs (MemberAccess.DoResolve): Update.
5662 2005-03-22 Marek Safar <marek.safar@seznam.cz>
5664 * assign.cs (Assign.DoResolve): Check for CS1717 when
5665 source and target are same (uses Equals).
5667 * expression.cs (LocalVariableReference, ParameterReference,
5668 This): Implemented Equals, GetHashCode.
5670 * statement.cs (Block.GetParameterReference): Removed useless
5673 2005-03-22 Raja R Harinath <rharinath@novell.com>
5676 * statement.cs (Block.AddVariable): Ensure that we skip implicit
5677 blocks before deciding whether the error is cs0136 or cs0128.
5679 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5680 (using_alias_directive, using_namespace_directive): Pass
5681 MemberName, not an expression to Namespace.UsingAlias and
5683 (MakeName): Use the MemberName of the namespace.
5684 * namespace.cs (Namespace.MemberName): New.
5685 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5686 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5688 * decl.cs (MemberName.Name): Make readonly.
5689 (MemberName.FromDotted): New "constructor".
5690 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5691 (MemberCore.Name): Compute from MemberName on demand.
5692 (MemberCore.SetMemberName): Provide a way to change the
5694 (MemberCore.AddToContainer): Don't take a fullname parameter.
5695 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5696 fully qualified name of the container to the member name.
5697 (TypeContainer.AddToTypeContainer): Use a fully qualified name
5698 only if the type is a member of the root container.
5699 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5700 MemberName.Left rather than searching for an embedded ".".
5701 (PartialContainer.CreatePart): Update to changes in RootContext.
5702 (MemberBase.ShortName): Turn into a property. Use
5703 MemberCore.SetMemberName.
5704 (MemberBase.ExplicitInterfaceName): Remove.
5705 (MemberBase.UpdateMemberName): Remove.
5706 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5707 (PropertyBase.SetMemberName): New override.
5708 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5709 (Tree.GetDecl): New.
5710 (Tree.AllDecls): Rename from Decls.
5711 * attribute.cs, enum.cs, report.cs: Update to changes.
5712 * driver.cs (MainDriver): Use MemberName.FromDotted on
5713 RootContext.MainClass.
5715 2005-03-21 Marek Safar <marek.safar@seznam.cz>
5717 * class.cs (FixedField.Define): Check for CS1664 and more sanity
5720 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5722 2005-03-18 Marek Safar <marek.safar@seznam.cz>
5724 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5725 property accessor modifiers.
5727 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5728 fixed buffer attribute (CS1716).
5729 (PropertyMethod.HasCustomAccessModifier): When property accessor
5730 has custom modifier.
5732 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5734 (PropertyExpr.DoResolveLValue): Add CS0272.
5736 2005-03-17 Miguel de Icaza <miguel@novell.com>
5738 * convert.cs: When converting to a pointer, use the proper Conv.U
5739 or Conv.I depending on the source data type.
5741 * cs-tokenizer.cs: Make the size for large decimal constants,
5744 2005-03-17 Martin Baulig <martin@ximian.com>
5746 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5747 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5749 2005-03-17 Martin Baulig <martin@ximian.com>
5751 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5752 to bool so we can return an error condition.
5753 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5756 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
5758 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5761 2005-03-16 Raja R Harinath <rharinath@novell.com>
5763 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5764 Refactor to avoid traversing the list of assemblies, and to avoid
5765 string concatenation.
5766 * typemanager.cs (guid_attr_type): Remove.
5767 (negative_hits, pointers, references): Remove hashes.
5769 (GetConstructedType): New. Uses type_hash to handle constructed
5770 types (arrays, references, pointers).
5771 (GetReferenceType, GetPointerType): Use it.
5772 (GetNestedType): New. Uses type_hash to handle nested types of
5774 (LookupType, LookupTypeDirect): Remove.
5775 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
5776 'types' hash and LookupTypeReflection directly.
5777 (params_string, params_object): Use GetConstructedType.
5778 * namespace.cs (Namespace.cached_types): New. Cache of reflected
5780 (Namespace.Lookup): Use cached_types.
5781 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5782 provided by old TypeManager.LookupType.
5783 * rootcontext.cs (MakeFQN): Remove.
5784 * decl.cs (DeclSpace.MakeFQN): Likewise.
5785 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5786 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5787 TypeManager.GetConstructedType.
5788 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5790 2005-03-15 Marek Safar <marek.safar@seznam.cz>
5792 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
5795 * cs-parser.jay: Reports CS1527 for any namespace element.
5797 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5800 * expression.cs (ParameterReference.IsAssigned): Changed error to
5802 (Error_WrongNumArguments): Moved CS0245 detection here.
5804 * statement.cs (Return.Resolve): Add CS1622 report.
5806 2005-03-11 Marek Safar <marek.safar@seznam.cz>
5808 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5810 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
5812 * attribute.cs expression.cs: Get rid of some allocations.
5814 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
5816 * doc.cs : just eliminate the latest change.
5818 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5820 * doc.cs : commented out the latest change. It breaks xml-030.cs
5822 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5824 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5825 fail. So invoke CreateType() in FindDocumentedType().
5827 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5829 * cs-tokenizer.cs : added IsKeyword().
5830 * doc.cs : Detect keyword incorrectly used as identifier.
5831 Allow identifiers prefixed by @.
5833 2005-03-10 Marek Safar <marek.safar@seznam.cz>
5835 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5836 It caused exception in namespace resolving (again!).
5838 * class.cs (Class.ctor): Removed exit.
5839 (PropertyMethod.ctor): ditto.
5841 * codegen.cs (Codegen.Reset): Reset static data.
5842 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5844 * cs-tokenizer.cs (Cleanup): Removed.
5846 * driver.cs (GetSystemDir): Rewrote to one line command.
5847 It caused problem with unloaded dynamic modules.
5848 (UnixParseOption): Removed Exit.
5849 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5850 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5851 Now can be mcs used as library.
5853 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5856 * location.cs (Reset): Reset static data.
5858 * namespace.cs (Reset): Reset static data.
5860 * report.cs (Report.Reset): Reset static data.
5862 * rootcontext.cs (RootContext.Reset): Reset static data.
5864 * tree.cs (RootTypes.ctor): Use Location.Null
5866 * typemanager.cs (TypeManager.Reset): Reset static data.
5867 (CoreLookupType): Removed Exit.
5868 (TypeHandle.Reset): Reset static data.
5870 2005-03-10 Raja R Harinath <rharinath@novell.com>
5873 * typemanager.cs (ComputeNamespaces): Import namespaces from
5874 referenced modules too.
5876 2005-03-09 Raja R Harinath <rharinath@novell.com>
5878 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5881 2005-03-09 Raja R Harinath <rharinath@novell.com>
5883 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5884 enclosing DeclSpace. This ensures that a name-lookup populates
5885 more caches and there are fewer 'TypeExpression's. Carve out
5886 nested type lookup into ...
5887 (LookupNestedTypeInHierarchy): ... this.
5889 2005-03-09 Raja R Harinath <rharinath@novell.com>
5891 Clean up a few partial-class semantics.
5892 Fixes test-357.cs and cs1618-2.cs.
5893 * cs-parser.jay (struct_declaration): Use 'current_class' as
5894 parent of newly-created struct. Remove call to Register ().
5895 Use 'pop_current_class' to complete handing the current struct.
5896 (interface_declaration): Likewise.
5897 (class_declaration): Likewise.
5898 (enum_declaration): Use 'current_class' as parent of newly created
5900 (delegate_declaration): Likewise.
5901 (pop_current_class): New function. This is used to handle closing
5902 up the 'current_class' and 'current_container', and pointing them
5903 to the enclosing class/container.
5904 (CSharpParser): Initialize 'current_class' too.
5905 * decl.cs (MemberCore): Add check for invariant: a partial
5906 container is not a parsed entity, and thus does not enclose any
5908 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5909 (DeclSpace.BaseTypeExpr): Use it.
5910 (DeclSpace.LookupType): Add check for invariant.
5911 * class.cs (TypeContainer): Add check for invariant: a nested
5912 class should have the same NamespaceEntry as its enclosing class.
5913 (TypeContainer.EmitFieldInitializers): Make virtual.
5914 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5916 (TypeContainer.Register): Remove.
5917 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5918 null. Use TypeResolveEmitContext for resolving base types and
5919 interfaces. Move initialization of Parts.TypeBuilder here from
5921 (TypeContainer.DefineNestedTypes): ... here.
5922 (PartialContainer): Take a Namespace not a NamespaceEntry.
5923 (PartialContainer.Create): Don't use Register. Call the
5924 appropriate Add... function directly.
5925 (ClassPart): Take both the PartialContainer and the enclosing
5926 class as constructor arguments.
5927 (ClassPart.EmitFieldInitializers): Override.
5928 (ClassPart.PartFindNestedTypes): Remove.
5929 (FieldBase.GetInitializerExpression): Resolve the initializer
5930 expression in the emit context of the enclosing class.
5931 * tree.cs (RootTypes): Remove Register ().
5933 2005-03-08 Marek Safar <marek.safar@seznam.cz>
5935 * cs-parser.jay: Removed CS0134.
5937 * driver.cs: Removed CS1901.
5939 * expression.cs (SizeOf.DoResolve): Don't report CS0233
5940 for predefined types.
5942 2005-03-07 Duncan Mak <duncan@novell.com>
5944 * codegen.cs (Save): Catch UnauthorizedAccessException as
5945 well. Fixes bug #73454.
5947 2005-03-07 Marek Safar <marek.safar@seznam.cz>
5949 * cs-tokenizer.cs (xtoken): Add CS1035.
5951 * class.cs (MethodData.Define): Add CS0683.
5952 (FieldMember.ctor): Add CS0681.
5954 2005-03-07 Raja R Harinath <rharinath@novell.com>
5956 * ecore.cs (SimpleName.DoResolve): Rename from
5957 SimpleName.DoResolveAllowStatic.
5958 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5959 Pass 'intermediate' flag to MemberStaticCheck.
5960 (SimpleName.MemberStaticCheck): Skip "static check" only in case
5961 of "intermediate" lookups via MemberAccess.
5962 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
5963 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5965 2005-03-07 Raja R Harinath <rharinath@novell.com>
5968 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5969 slipped in because of variable names that are identical to a
5970 builtin type's BCL equivalent ('string String;', 'int Int32;').
5971 (PropertyExpr.EmitInstance): Likewise.
5973 2005-03-04 Marek Safar <marek.safar@seznam.cz>
5975 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5977 * report.cs (warning_ignore_table): Made public.
5979 2005-03-04 Raja R Harinath <rharinath@novell.com>
5982 * class.cs (MethodData.Emit): Pass 'container' to
5983 container.GetObsoleteAttribute instead of 'container.Parent'.
5985 2005-03-03 Marek Safar <marek.safar@seznam.cz>
5987 * cs-parser.jay: Add 1534 error test.
5989 * iterators.cs (Yield.CheckContext): Add error 1629.
5990 (Iterator.ctor): Save unsafe modifier.
5991 (MoveNextMethod.DoEmit): Restore unsafe context.
5993 * namespace.cs (UsingAlias): Better error message.
5995 2005-03-03 Dan Winship <danw@novell.com>
5997 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5998 the warning message [#73219]
6000 2005-03-03 Raja R Harinath <rharinath@novell.com>
6002 Fix compile with MCS 1.0.0.0.
6003 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6004 w_restore to not depend on string constant folding.
6006 2005-03-03 Raja R Harinath <rharinath@novell.com>
6008 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
6009 CS0246 check to users who passed 'silent = false'.
6010 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6012 (SimpleName.SimpleNameResolve): Update.
6013 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6014 (MemberAccess.IdenticalNameAndTypeName): Update.
6015 * doc.cs (FindDocumentedTypeNonArray): Update.
6017 2005-03-03 Raja R Harinath <rharinath@novell.com>
6019 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6020 * parameters.cs (ComputeAndDefineParameters): Remove.
6021 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6022 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6023 Use GetParameterInfo.
6025 2005-03-02 Marek Safar <marek.safar@seznam.cz>
6027 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6029 2005-03-02 Raja R Harinath <rharinath@novell.com>
6031 Unify DeclSpace.LookupType and DeclSpace.FindType.
6032 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
6033 is in charge of defining nested types on demand.
6034 (DeclSpace.LookupType): Use it when the current_type is a
6035 TypeBuilder. Use LookupTypeDirect for reflected types.
6036 (DeclSpace.FindType): Remove.
6037 (DeclSpace.LookupInterfaceOrClass): Likewise.
6038 (DeclSpace.DefineTypeAndParents): Likewise.
6039 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6040 DeclSpace.LookupType.
6041 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6042 * typemanager.cs (LookupType): Simplify.
6043 (AddUserType): Remove type from negative_hits.
6044 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6045 * class.cs (TypeContainer.FindMembers): Move handling of nested
6047 (TypeContainer.FindMembers_NestedTypes): ... here.
6048 (TypeContainer.FindNestedType): Implement override.
6049 (ClassPart.FindNestedType): Delegate to PartialContainer.
6050 (ClassPart.PartFindNestedType): Looks up the nested types of the
6053 2005-03-02 Martin Baulig <martin@ximian.com>
6055 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6056 static constructor in static classes.
6058 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
6060 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6061 sizeParamIndex is not specified.
6063 2005-03-01 Marek Safar <marek.safar@seznam.cz>
6066 * report.cs (WarningMessage.IsEnabled): Missing null check.
6068 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6070 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6071 in the fields and not in the properties.
6073 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
6075 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
6078 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6080 * attribute.cs: Small refactoring (improved robustness).
6081 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6082 (ValidateGuid): Removed.
6083 (Resolve): Removed referenced to above mentioned.
6084 (GetAttributeUsage): Made private and changed to work without
6086 (GetIndexerAttributeValue): Don't crash.
6087 (GetConditionalAttributeValue): Ditto.
6088 (GetClsCompliantAttributeValue): Ditto.
6089 (ExtractSecurityPermissionSet): All attributes exceptions are
6091 (GetPropertyValue): New helper.
6092 (GetMethodImplOptions): New method.
6093 (DefinePInvokeMethod): Reuse common code. Implemented handling of
6094 some missing properties.
6096 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6097 (Method.ApplyAttributeBuilder): Updated.
6099 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6102 2005-02-28 Raja R Harinath <rharinath@novell.com>
6105 * report.cs (Report.SymbolRelatedToPreviousError): Handle
6106 non-simple types (array, pointer, reference).
6108 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6110 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6112 * class.cs (MethodCore.IsDuplicateImplementation): Special error
6114 (Method.CheckBase): Catch wrong destructor here.
6115 (MethodData.Define): Add errors 550, 668.
6117 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6119 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6121 * pending.cs (VerifyPendingMethods): Add error 551.
6123 * typemanager.cs (CSharpName): Next error report helper.
6125 2005-02-25 Marek Safar <marek.safar@seznam.cz>
6127 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6128 attributes. Removed useless attribute double check.
6129 It saves almost 2MBs for corlib.
6131 2005-02-25 Raja R Harinath <rharinath@novell.com>
6134 * statement.cs (ExpressionStatement.Resolve): Make robust to being
6135 called twice in case of error.
6137 2005-02-23 Chris Toshok <toshok@ximian.com>
6139 Fix compiler portions of #72827.
6140 * statement.cs (Block.Emit): call Begin/EndScope on the
6141 EmitContext instead of the ILGenerator.
6143 * codegen.cs (EmitContext.BeginScope): new method, call
6144 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6146 (EmitContext.BeginScope): same, but EndScope and CloseScope
6148 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6149 offset and call the superclass's OpenScope(int) with it.
6150 (SymbolWriter.CloseScope): get the current il
6151 offset and call superclass's CloseScope(int) with it.
6153 2005-02-23 Marek Safar <marek.safar@seznam.cz>
6155 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6156 CS1677 for out and ref as well.
6158 * class.cs (Method.Define): Add error CS1599 detection.
6160 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6162 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6164 * delegate.cs (Delegate.Define): Add error CS1599 detection.
6166 * support.cs.cs (ModifierDesc): New helper method.
6168 2005-02-23 Raja R Harinath <rharinath@novell.com>
6169 Abin Thomas <projectmonokochi@rediffmail.com>
6170 Anoob V E <projectmonokochi@rediffmail.com>
6171 Harilal P R <projectmonokochi@rediffmail.com>
6174 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6175 MemberLookup (used for error reporting) actually returns a result.
6176 Fix error report number (122, not 112).
6178 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
6179 Anoob V E <projectmonokochi@rediffmail.com>
6180 Harilal P R <projectmonokochi@rediffmail.com>
6183 * pending.cs (PendingImplementation.GetAbstractMethods):
6184 Find NonPublic members too.
6186 2005-02-22 Marek Safar <marek.safar@seznam.cz>
6188 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6191 * class.cs (MethodCore.CheckMethodAgainstBase):
6192 Add error 239 report.
6194 2005-02-21 Raja R Harinath <rharinath@novell.com>
6197 * expression.cs (Invocation.IsApplicable): Make public.
6198 (Invocation.IsParamsMethodApplicable): Likewise.
6199 * delegate.cs (Delegate.VerifyApplicability): Don't use
6200 Invocation.VerifyArgumentCompat for parameter applicability
6201 testing. Use Invocation.IsApplicable and
6202 Invocation.IsParamsMethodApplicable.
6204 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6206 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6208 * class.cs (Operator.Define): Add error 217 report.
6210 2005-02-21 Raja R Harinath <rharinath@novell.com>
6212 * namespace.cs (UsingEntry.Resolve): Undo change below.
6214 2005-02-21 Raja R Harinath <rharinath@novell.com>
6217 * ecore.cs (Expression.MemberLookupFailed): Add argument to
6218 disable the error message when the extended MemberLookup also
6220 (Expression.MemberLookupFinal): Update.
6221 (SimpleName.DoSimpleNameResolve): Update.
6222 * expression.cs (MemberAccess.ResolveNamespaceOrType):
6223 Don't use MemberLookupFinal.
6224 (New.DoResolve): Update.
6225 (BaseAccess.CommonResolve): Update.
6227 2005-02-21 Raja R Harinath <rharinath@novell.com>
6230 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6231 occured previously, don't resolve again.
6233 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6236 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6237 argument. Call ResolveAttributeUsage for unresolved.
6238 when types doesn't match ctor arguments.
6240 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6241 for nested attribute classes.
6242 (Class.attribute_usage): Removed.
6243 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6244 for attribute class.
6246 * ecore.cs (IsAttribute): Removed.
6248 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6250 * rootcontext.cs (RegisterAttribute): Removed, attributes are
6252 (attribute_types): Removed.
6253 (EmitCode): Global attributes are emited as the latest.
6255 2005-02-18 Marek Safar <marek.safar@seznam.cz>
6257 * class.cs (EmitFieldInitializers): Don't emit field initializer
6258 for default values when optimilization is on.
6260 * constant.cs (Constant.IsDefaultValue): New property.
6262 * driver.cs: Add /optimize handling.
6266 * literal.cs: Implement new IsDefaultValue property.
6268 * rootcontext.cs (Optimize): New field, holds /optimize option.
6270 2005-02-18 Raja R Harinath <rharinath@novell.com>
6272 Fix crasher in re-opened #72347.
6273 * namespace.cs (Namespace.Lookup): Return null if
6274 DeclSpace.DefineType returns null.
6277 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6279 2005-02-18 Raja R Harinath <rharinath@novell.com>
6281 Fix remainder of #63202. Change semantics of DoResolveLValue: it
6282 now returns null if it cannot resolve to an lvalue.
6283 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6284 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6285 returned null. Remove check for SimpleName.
6286 (EventExpr.DoResolveLValue): New.
6287 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6288 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
6290 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
6292 (Unary.ResolveOperator): Move CS0211 check ...
6293 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
6295 (Unary.DoResolveLValue): Simplify.
6296 (AddressOf.DoResolveLValue): New.
6297 (ArrayAccess.DoResolveLValue): New.
6299 2005-02-16 Marek Safar <marek.safar@seznam.cz>
6301 * attribute.cs (Attribute.Resolve): Add arguments casting for
6302 when types doesn't match ctor arguments.
6304 2005-02-16 Raja R Harinath <rharinath@novell.com>
6306 Fix parts of #63202.
6307 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6308 lookup of operator in base type. Ensure that all checks happen
6309 when the operator resolves to an "op_..." method.
6311 2005-02-15 Raja R Harinath <rharinath@novell.com>
6314 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6315 'ignore_cs0104' parameter. Pass it to ...
6316 (NamespaceEntry.Lookup): ... this.
6317 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6318 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6319 (TypeLookupExpression.DoResolveAsTypeStep): Update.
6320 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6321 Update. Request that cs0104 errors be ignored.
6322 (ComposedCast.ResolveAsTypeStep): Update.
6324 2005-02-14 Raja R Harinath <rharinath@novell.com>
6327 * expression.cs (Invocation.BetterFunction): Remove support for
6328 comparing virtual functions and their overrides.
6329 (Invocation.IsOverride): New.
6330 (Invocation.OverloadResolve): Don't consider 'override' functions
6331 during candidate selection. Store them in a lookaside list.
6332 If the selected method is a 'virtual' function, use the list to
6333 find any overrides that are closer to the LHS type.
6335 2005-02-14 Marek Safar <marek.safar@seznam.cz>
6337 * expression.cs (New.DoResolve): Add complex core type reduction.
6338 (New.Constantify): Converts complex core type syntax like 'new int ()'
6341 2005-02-14 Raja R Harinath <rharinath@novell.com>
6343 * decl.cs (EntryType.EntryType): New constructor to create an
6344 updated copy of a cache entry.
6345 (MemberCache.AddMethods): Use it.
6346 (MemberCache.ClearDeclaredOnly): Remove.
6347 (MemberCache.MemberCache): Update.
6349 2005-02-11 Miguel de Icaza <miguel@novell.com>
6351 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6352 variable. This one is represents the actual low-level declaration
6353 of the method, as opposed to the semantic level `IsStatic'.
6355 An anonymous method which is hosted into a static method might be
6356 actually an instance method. IsStatic would reflect the
6357 container, while MethodIsStatic represents the actual code
6360 * expression.cs (ParameterReference): Use the new MethodIsStatic
6361 instead of IsStatic.
6363 * anonymous.cs (AnonymousMethod.Compatible): Pass the
6364 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6365 set on the current EmitContext.
6367 * expression.cs (Cast): Overload DoResolveLValue so we can pass
6368 resolve our casted expression as an LValue. This triggers the
6369 proper LValue processing that is later required by Assign.
6373 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6375 2005-02-11 Marek Safar <marek.safar@seznam.cz>
6377 C# 2.0 Fixed buffer implementation
6379 * anonymous.cs: Update after RegisterHelperClass renaming.
6381 * attribute.cs (AttributeTester.fixed_buffer_cache):
6382 Cache of external fixed buffers.
6383 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6384 implementation if field is fixed buffer else null.
6387 (TypeContainer.AddField): Accept FieldMember instead of Field.
6388 (FieldBase.IsFieldClsCompliant): Extracted code from
6389 VerifyClsCompliance descendant customization.
6390 (FixedField): New class handles fixed buffer fields.
6391 (FixedFieldExternal): Keeps information about imported fixed
6393 (IFixedField): Make access to internal or external fixed buffer
6396 * cs-parser.jay: Add fixed buffer parsing.
6398 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6401 * expression.cs (Indirection): Extended implementation to accept
6403 (PointerArithmetic.Emit): Get element from fixed buffer as well.
6404 (ElementAccess.MakePointerAccess): Get type as parameter.
6405 (DoResolve): Add fixed buffer field expression conversion.
6406 (DoResolveLValue): Ditto.
6407 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6408 (ArrayPtr): Derives from FixedBufferPtr.
6409 (ArrayPtr.Emit): Add extra emit for array elements.
6411 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6413 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6414 for compiler generated types.
6415 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6417 * statement.cs (Fixed): Refactored to be easier add fixed buffer
6418 and consume less memory.
6419 (Fixed.Resolve): Add fixed buffer case.
6421 * typemanager.cs (compiler_generated_attr_ctor,
6422 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6423 (HasElementType): Add our own implementation to work on every
6426 2005-02-11 Miguel de Icaza <miguel@novell.com>
6428 * anonymous.cs (CaptureContext): Track whether `this' has been
6431 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
6432 only captured `this' if it was implicitly done (instance
6433 methods/variables were used).
6435 * codegen.cs (EmitContext.CaptureThis): New method to flag that
6436 `this' must be captured.
6438 2005-01-30 Miguel de Icaza <miguel@novell.com>
6440 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6441 is null it means that there has been no need to capture anything,
6442 so we just create a sibling.
6444 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6446 Just a partial fix. The other half is fairly elusive.
6448 2005-02-10 Raja R Harinath <rharinath@novell.com>
6450 Fix #52586, cs0121-4.cs.
6451 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
6452 and return a hashtable.
6453 (MemberCache.ClearDeclaredOnly): New.
6454 (MemberCache.MemberCache): Update to change. Make a deep copy of
6455 the method_hash of a base type too.
6456 (MemberCache.AddMethods): Adapt to having a deep copy of the base
6457 type methods. Overwrite entries with the same MethodHandle so
6458 that the ReflectedType is correct. The process leaves in base
6459 virtual functions and their overrides as distinct entries.
6460 (CacheEntry): Now a class instead of a struct. It shouldn't alter
6461 matters since it was boxed in a ArrayList before.
6462 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6464 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
6465 case of a virtual function and its override (choose the overload
6467 (Invocation.OverloadResolve): Avoid 'override' members during
6468 'applicable_type' calculation.
6470 2005-02-09 Raja R Harinath <rharinath@novell.com>
6472 Combine two near-redundant caches.
6473 * typemanager.cs (method_params): Rename from method_internal_params.
6474 (TypeManager.GetParameterData): New. Replace
6475 Invocation.GetParameterData.
6476 (TypeManager.LookupParametersByBuilder): Remove.
6477 * expression.cs (Invocation.method_parameter_cache): Remove.
6478 (Invocation.GetParameterData): Remove.
6480 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6483 2005-02-08 Raja R Harinath <rharinath@novell.com>
6486 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6487 TypeManager.multicast_delegate_type is null, resolve it by looking
6488 up "System.MulticastDelegate".
6489 * rootcontext.cs (RootContext.ResolveCore): Simplify.
6491 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
6492 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
6493 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
6496 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6497 (LabeledStatement.AddReference): New. Set 'referenced'.
6498 (Goto.Resolve): Use it.
6500 2005-02-05 John Luke <john.luke@gmail.com>
6502 * driver.cs: remove duplicate -doc line in Usage ()
6504 2005-02-04 Raja R Harinath <rharinath@novell.com>
6506 * location.cs (Location.AddFile): Fix CS2002 error report.
6508 2005-02-02 Martin Baulig <martin@ximian.com>
6510 * delegate.cs (Delegate.DefineType): Report an internal error if
6511 TypeManager.multicast_delegate_type is null. See bug #72015 for
6514 2005-02-02 Raja R Harinath <rharinath@novell.com>
6516 Fix a crasher in a variant of #31984.
6517 * const.cs (Constant.CheckBase): New override that defers the
6518 new-or-override check in case the base type hasn't been populated
6520 (Constant.Define): Ensure the new-or-override check is performed.
6522 2005-02-01 Duncan Mak <duncan@ximian.com>
6524 * const.cs (LookupConstantValue): Check that `ce' is not null
6525 before calling GetValue ().
6527 2005-02-01 Raja R Harinath <rharinath@novell.com>
6529 Fix test-334.cs (#69519).
6530 * cs-parser.jay (using_alias_directive): Pass in an expression to
6531 NamespaceEntry.UsingAlias.
6532 (using_namespace_directive): Pass in an expression to
6533 NamespaceEntry.Using.
6534 (namespace_name): Don't flatten to a string.
6535 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6536 (NamespaceEntry.AliasEntry.Resolve): Lookup using
6538 (NamespaceEntry.UsingEntry): Likewise.
6539 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6541 (NamespaceEntry.LookupForUsing): Remove.
6542 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6544 (NamespaceEntry.Lookup): Remove support for dotted names.
6546 2005-02-01 Raja R Harinath <rharinath@novell.com>
6548 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6550 (NamespaceEntry.ImplicitParent): Compute on demand.
6551 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6552 parallels the current.
6553 (NamespaceEntry.LookupForUsing): Use it.
6554 (NamespaceEntry.Lookup): If the current namespace-entry is
6555 implicit, don't search aliases and using tables.
6557 2005-02-01 Raja R Harinath <rharinath@novell.com>
6560 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6562 (TypeContainer.BaseCache): Compute on demand.
6563 (TypeContainer.FindMembers): Define constants and types if they're
6564 not already created.
6565 (FieldMember.Define): Move resetting of ec.InUnsafe before error
6567 * const.cs (Constant.Define): Make idempotent.
6569 2005-01-29 Miguel de Icaza <miguel@novell.com>
6571 * pending.cs: Produce better code (no nops produced by using Ldarg
6574 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6575 i - 1' it should be arg + 1.
6579 2005-01-28 Raja R Harinath <rharinath@novell.com>
6581 * attribute.cs (Attribute.CheckAttributeType): Make private
6583 (Attribute.ResolveType): Make virtual.
6584 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6585 handling of RootContext.Tree.Types.
6587 2005-01-27 Raja R Harinath <rharinath@novell.com>
6589 Update attribute-handling to use the SimpleName/MemberAccess
6591 * cs-parser.jay (attribute): Pass in an expression to the
6592 constructors of Attribute and GlobalAttribute.
6593 * attribute.cs (Attribute): Take an expression for the name.
6594 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
6595 passed in attribute name expression.
6596 (Attribute.CheckAttributeType): Use it.
6597 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6598 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6599 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
6600 argument to prevent error messages if the lookup fails.
6602 2005-01-27 Marek Safar <marek.safar@seznam.cz>
6604 * expression.cs (Indirection): Implemented IVariable interface
6605 to support indirection in AddressOf operator.
6606 (PointerArithmetic.Emit): Add optimalization for case where
6607 result can be precomputed.
6609 2005-01-26 Martin Baulig <martin@ximian.com>
6611 * class.cs (TypeContainer.AttributeTargets): Return the correct
6612 AttributeTargets depending on our `Kind' instead of throwing an
6613 exception; fixes #71632.
6615 2005-01-26 Marek Safar <marek.safar@seznam.cz>
6618 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6621 2005-01-25 Raja R Harinath <rharinath@novell.com>
6624 * expression.cs (MemberAccess.DoResolve): Don't complain with
6625 cs0572 when the LHS of a member access has identical name and type
6628 2005-01-25 Marek Safar <marek.safar@seznam.cz>
6631 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6633 Create custom PermissionSet only for PermissionSetAttribute.
6635 2005-01-24 Marek Safar <marek.safar@seznam.cz>
6638 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6639 delegates in static class.
6641 2005-01-24 Martin Baulig <martin@ximian.com>
6643 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6644 merging an implicit block, just use its reachability.
6646 * statement.cs (Block.Resolve): Make the unreachable code check
6647 work wrt. implicit blocks; see test-337 from #63842.
6649 2005-01-21 Alp Toker <alp@atoker.com>
6651 * cs-parser.jay: destructor_declaration's container is PartialContainer
6652 not Class when partial types are used, so use Kind prop instead of
6655 2005-01-22 Miguel de Icaza <miguel@ximian.com>
6657 * cs-parser.jay: Improve error reporting when an interface
6660 2005-01-20 Dick Porter <dick@ximian.com>
6662 * support.cs: SeekableStreamReader fix from Sandor Dobos
6663 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6664 chars are read. Fixes bug 70369.
6666 2005-01-20 Raja R Harinath <rharinath@novell.com>
6668 * cs-parser.jay (catch_clause): Simplify current_block handling
6671 2005-01-17 Miguel de Icaza <miguel@ximian.com>
6673 * convert.cs (ImplicitStandardConversionExists): Synchronize the
6674 code with ImplicitStandardConversion to handle the implicit
6675 conversion of method groups into valid delegate invocations.
6677 The problem is that in parameter handling we were using this code
6678 path. Fixes bug #64698
6680 2005-01-19 Raja R Harinath <rharinath@novell.com>
6682 * cs-parser.jay: Fix several infelicities.
6683 - Avoid assigning to the parser value stack. Code like
6684 '$3 = null' is unclean. Synthesize a value for the code block
6686 - Avoid using oob_stack for storing location information. Use ...
6687 (_mark_): ... this. New (empty) rule. Saves the current location
6689 (foreach_statement): Avoid using oob_stack for current_block
6690 handling. Use technique used in for_statement and
6691 using_statement. Synthesize a value for the code block to store
6692 additional intermediate information.
6694 2005-01-13 Miguel de Icaza <miguel@ximian.com>
6696 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6697 of a different type is only allowed to private fields of a
6698 containing type, not on fields of a base class.
6700 See test-174.cs and error cs0122-9.cs
6702 2005-01-13 Raja R Harinath <rharinath@novell.com>
6704 Fix test-335.cs (bug #58126).
6705 * cs-parser.jay (argument): Split out non-expression parts of the
6706 rule into 'non_simple_argument'.
6707 (invocation_expression): Support parenthesized invocations with
6708 multiple arguments, and with single non-simple arguments.
6710 2005-01-13 Raja R Harinath <rharinath@novell.com>
6712 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6715 2005-01-12 Raja R Harinath <rharinath@novell.com>
6717 Fix cs0038-1.cs, cs1640-6.cs.
6718 * ecore.cs (Expression.Resolve): Remove special-case for
6719 SimpleName in error-handling.
6720 (Expression.almostMatchedMembers): Relax access permission to
6722 (Expression.MemberLookupFailed): Handle duplicates in
6723 almostMatchedMembers list.
6724 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6725 * expression.cs (New.DoResolve): Report CS1540 for more cases.
6726 * typemanager.cs (GetFullNameSignature): Use the MethodBase
6727 overload if the passed in MemberInfo is a MethodBase.
6729 2005-01-12 Marek Safar <marek.safar@seznam.cz>
6732 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6733 for non-CAS & merge permission sets properly.
6735 2005-01-11 Raja R Harinath <rharinath@novell.com>
6737 Improve standard-compliance of simple name and member access
6738 resolution. Fixes bugs #52697, #57200, #67520, #69519.
6739 * ecore.cs (FullNamedExpression): New abstract base class
6740 for Namespaces and TypeExpressions.
6741 (ResolveFlags.SimpleName): Remove.
6742 (SimpleName): Remove support for dotted names.
6743 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
6744 DeclSpace.FindType and DeclSpace.LookupType.
6745 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6746 (Expression.ExprClassName): Make member function.
6747 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6748 a namespace. Remove creation of dotted "SimpleName"s.
6749 (MemberAccess.DoResolve): Likewise.
6750 * decl.cs (DeclSpace.Cache): Make private.
6751 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6752 (DeclSpace.FindType): Update.
6753 (DeclSpace.LookupType): Move here from RootContext. Return a
6754 FullNamedExpression.
6755 * namespace.cs (Namespace): Derive from FullNamedExpression
6756 so that it can be part of expression resolution.
6757 (Namespace.Lookup): Return an FullNamedExpression.
6758 (NamespaceEntry.LookupAlias): Lookup aliases only in current
6760 * rootcontext.cs (NamespaceLookup): Remove.
6761 (LookupType): Move to DeclSpace.
6762 * attribute.cs (CheckAttributeType): Update.
6763 * doc.cs (FindDocumentedType): Remove allowAlias argument.
6764 (FindDocumentedTypeNonArray): Likewise.
6766 2005-01-11 Raja R Harinath <rharinath@novell.com>
6768 Fix cs0509.cs, cs1632.cs.
6769 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6770 is the same as IsInterface.
6771 (TypeContainer.GetClassBases): Likewise.
6772 * statement.cs (LabeledStatement.ig): New field.
6773 (LabeledStatement.LabelTarget): Save ILGenerator which created the
6775 (LabeledStatement.DoEmit): Check that the label was created with
6776 the same ILGenerator.
6778 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6781 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6782 accessors to its properties.
6784 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6785 from accessors to property.
6787 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6790 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6793 2005-01-08 Miguel de Icaza <miguel@ximian.com>
6795 * attribute.cs: Check for null and empty strings.
6797 I have lost another battle to Paolo.
6799 2005-01-07 Marek Safar <marek.safar@seznam.cz>
6802 * class.cs (PropertyMethod): Set Parent field in ctors.
6803 (SetMethod.InternalParameters): Add unsafe switch hack.
6804 Override MarkForDuplicationCheck where it is appropriate.
6806 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6807 It says whether container allows members with the same name.
6809 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6810 Removed is_method parameter.
6812 2005-01-06 Duncan Mak <duncan@ximian.com>
6814 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6815 because the previous change led to incorrect reporting of CS1032
6816 ("Cannot define/undefine preprocessor symbols after first token in
6817 file"). Instead of using `tokens_seen' as the only flag that
6818 triggers CS1040, introduce `comments_seen'. This new flag is used
6819 to signify having seen comments on the current line, so it is
6820 unset after a newline.
6822 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6824 * doc.cs : When searching for a type, find nested type too.
6825 This fixes bug #71040.
6827 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6830 - Warn missing member comment on those classes which also does not
6831 have doc comments. Fixed bug #71041.
6832 - Don't warn missing doc comment on default constructor.
6835 2005-01-06 Duncan Mak <duncan@ximian.com>
6837 * cs-tokenizer.cs (xtoken): After handling traditional C-style
6838 comments, set `tokens_seen' to true. This allows us to detect
6839 misplaced preprocessor directives (i.e. not at the beginning of
6840 the a line, nor after whitespaces). In that case, report error
6841 CS1040. This fixes bug #56460.
6843 * cs-parser.jay (interface_member_declaration): Add checks for
6844 IsExplicitImpl, and report CS0541 error if an interface member is
6845 defined as an explicit interface declaration.
6847 2005-01-06 Marek Safar <marek.safar@seznam.cz>
6850 * class.cs (PropertyMethod): Set Parent field in ctors.
6851 (SetMethod.InternalParameters): Add unsafe switch hack.
6853 * decl.cs (MemberCore.Parent): Cannot be readonly.
6855 2005-01-06 Raja R Harinath <rharinath@novell.com>
6857 * decl.cs (DeclSpace.ResolveType): Remove.
6858 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6859 Merge in code from ...
6860 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
6861 * class.cs, enum.cs: Update to changes.
6863 2005-01-06 Miguel de Icaza <miguel@ximian.com>
6865 * anonymous.cs: Ensure that we init the scope of our parent if it
6866 has not been initialized yet.
6868 2004-12-30 Duncan Mak <duncan@ximian.com>
6870 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6871 if field.FieldBuilder is null. Fixes #70758.
6873 * convert.cs: Fixed some typos and updated some of the comments.
6874 (ImplicitStandardConversionExists):
6875 (TryImplicitIntConversion): If `target_type' is an interface and
6876 the type of `ic' implements this interface, return true or a new
6877 BoxedCast instead of null. This fixes #70468.
6879 2004-12-29 Duncan Mak <duncan@ximian.com>
6881 * expression.cs (Argument.Emit): Check that Expr is
6882 IMemoryLocation before casting to it, and report CS1510 otherwise.
6886 2004-12-21 Ben Maurer <bmaurer@ximian.com>
6888 * statement.cs (Block.ThisVariable): remove the recursion here, to
6889 make the --profile more sane.
6891 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
6893 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6894 assembly, by JB Evain.
6896 2004-12-17 Raja R Harinath <rharinath@novell.com>
6898 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
6899 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6900 "parent" refers to enclosing type/class. "base" refers to superclass.
6902 2004-12-17 Raja R Harinath <rharinath@novell.com>
6904 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6905 Ensure that we only have GlobalAttributes.
6906 * attribute.cs (Attribute.Emit): Make non-virtual.
6907 (GlobalAttribute.Emit): Remove.
6908 (Attribute.Resolve): Make virtual.
6909 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
6910 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6911 the argument. Don't create one.
6912 (Attribute.GetObsoleteAttribute): Likewise.
6913 (Attribute.GetClsCompliantAttributeValue): Likewise.
6914 * class.cs, decl.cs: Update to changes.
6916 2004-12-17 Marek Safar <marek.safar@seznam.cz>
6918 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6920 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6922 * statement.cs (Foreach.Resolve): Add error 186 report.
6924 2004-12-16 Marek Safar <marek.safar@seznam.cz>
6926 * expression.cs (Conditional.DoResolve): Add warning 429.
6928 * statement.cs (If.Resolve): Add warning 665.
6930 2004-12-16 Raja R Harinath <rharinath@novell.com>
6932 New invariant: RootContext.Tree.Types.NamespaceEntry == null
6933 except when in the parser, and in GlobalAttribute.
6934 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6935 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6936 RootContext.Tree.Types.NamespaceEntry once work is done.
6937 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
6938 and resets RootContext.Tree.Types.NamespaceEntry.
6940 2004-12-15 Marek Safar <marek.safar@seznam.cz>
6942 * cs-parser.jay: Don't create a block for every variable.
6944 2004-12-14 Miguel de Icaza <miguel@ximian.com>
6946 * location.cs: Provide extra information.
6948 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6949 variables from the captured environment, it is the ldarg_0.
6951 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6953 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6956 * class.cs: Changed warning level for 169 to avoid developer
6957 displeasure from warning flooding. It will be changed back when they
6958 fix most of current BCL warnings.
6960 * RootContext.cs: Pushed default WarningLevel to 3.
6962 * statement.cs: Removed unused variable.
6964 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6966 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6967 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6968 Add error 502 report.
6969 (StaticClass.DefineType): Add error 441 report.
6970 (Class.AllowedModifiersProp): New virtual property as temporary
6971 extension to AllowedModifiers.
6972 (Class.DefineType): Add error 418 report. Moved ModFlags check here
6973 to share implementation with StaticClass and don't call virtual
6976 * driver.cs (MainDriver): Add error 1558 test.
6978 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6979 report. Moved error 36 test here.
6981 * statement.cs (Throw.Resolve): Add error 724 report.
6983 * typemanager.cs: Add out_attribute_type core type.
6985 2004-12-13 Marek Safar <marek.safar@seznam.cz>
6987 * class.cs (TypeContainer.VerifyClsCompliance): Add error
6989 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6991 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6994 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6996 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
6997 Add error 3023 report.
6998 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7000 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7003 2004-12-12 John Luke <john.luke@gmail.com>
7005 * driver.cs (AddArgs): take -- into account when
7006 adding arguments, fixes bug 65710
7008 2004-12-12 Martin Baulig <martin@ximian.com>
7010 * expression.cs (Unary.TryReduceNegative): Added support for
7011 SByteConstant and ByteConstant.
7012 (Unary.Reduce): Check error values from TryReduceNegative().
7014 2004-12-10 Marek Safar <marek.safar@seznam.cz>
7016 * attributes.cs (Attribute.Resolve): Avoid multiple error report
7017 and report exception as error 182.
7019 2004-12-10 Raja R Harinath <rharinath@novell.com>
7021 * driver.cs (Main): Fix message when there are warnings.
7023 2004-12-09 Miguel de Icaza <miguel@ximian.com>
7025 * delegate.cs: Fixed my fix from yesterday, sorry about that.
7027 2004-12-09 Marek Safar <marek.safar@seznam.cz>
7029 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
7030 Reduced number of warnings.
7032 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7034 2004-12-08 Miguel de Icaza <miguel@ximian.com>
7036 * driver.cs: Removed message.
7038 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7040 2004-12-08 <vargaz@freemail.hu>
7042 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7044 2004-12-08 Martin Baulig <martin@ximian.com>
7046 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7047 instead of a CS3002 for properties and indexer.
7049 2004-12-08 Martin Baulig <martin@ximian.com>
7051 * decl.cs (MemberName.ToString): Make this work again.
7053 2004-12-08 Marek Safar <marek.safar@seznam.cz>
7055 * attribute.cs (Resolve): Add error 591 detection.
7057 * class.cs (FieldMember.Define): Add error 1547 detection.
7058 (Indexer.Define): Add error 620 detection.
7059 (Operator.Define): Add error 590 detection.
7061 * ecore.cs: Missing argument for error 79.
7063 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7066 2004-12-07 Marek Safar <marek.safar@seznam.cz>
7069 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7072 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7074 * cs-parser.jay : handle doc comments on implicit/explicit operators.
7075 Some operator comments were suppressed.
7076 * doc.cs : Implicit/explicit operator name in doc comments are like
7077 "op_Explicit(type)~returnType", so added suffix handling.
7079 2004-12-07 Martin Baulig <martin@ximian.com>
7082 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7083 (MemberCore.GetClsCompliantAttributeValue): Likewise.
7084 (DeclSpace.ec): New protected field; store the EmitContext here.
7085 (DeclSpace.EmitContext): New public property; moved here from
7087 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7090 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7091 (Enum.Emit): Don't create a new EmitContext.
7093 * delegate.cs (Delegate.DefineType): Always create the
7096 * iterators.cs (Iterators.DefineIterator): Create a new
7097 EmitContext and store it in `ec'.
7099 2004-08-24 Martin Baulig <martin@ximian.com>
7102 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7103 this for accessibility checks.
7104 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7105 IsNestedFamilyAccessible.
7106 (TypeManager.IsSubclassOf): New method, do what the name actually
7109 2004-12-06 Raja R Harinath <rharinath@novell.com>
7111 Fix crash on cs0657-17.cs.
7112 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7113 Use RootContext.Tree.Types, not 'new RootTypes ()'.
7114 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7115 the case where the NamespaceEntry gets overwritten.
7117 2004-12-06 Marek Safar <marek.safar@seznam.cz>
7119 Fixed #69195, #56821
7120 * ecore.cs (ResolveBoolean): Tiny refactoring.
7122 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7123 of right expression resolving when left is false constant and
7124 operator is LogicalAnd OR true constant and operator is LogicalOr.
7126 * statement.cs (ResolveUnreachable): Always reports warning.
7128 2004-12-05 Miguel de Icaza <miguel@ximian.com>
7130 * class.cs: Distinguish between 1721 and 1722 (just a little help
7131 for the programmer).
7133 2004-12-03 Miguel de Icaza <miguel@ximian.com>
7135 * delegate.cs: Only allow this on new versions of the language.
7137 2004-12-02 Duncan Mak <duncan@ximian.com>
7139 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7141 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7142 here as a static method. Take an additional bool out parameter
7143 `must_do_cs1540_check' for signaling to InstanceResolve.
7144 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7145 member field from PropertyExpr class and made it an argument of
7147 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7148 check for MarshalByRefObject, and report CS0122 instead of CS1540.
7149 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7150 and `remove_accessor' as well as InstanceResolve: report CS0122
7155 2004-12-03 Raja R Harinath <rharinath@novell.com>
7157 Fix test-327.cs, test-328.cs, and put in early infrastructure
7158 for eventually fixing #52697.
7159 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7160 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7162 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7163 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7164 (VerifyUsing, error246): Update.
7165 * rootcontext.cs (RootContext.NamespaceLookup): Just use
7166 'NamespaceEntry.LookupNamespaceOrType'.
7168 2004-12-03 Martin Baulig <martin@ximian.com>
7170 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7171 method as our child, call AnonymousMethod.Compatible() on it.
7173 2004-12-03 Raja R Harinath <rharinath@novell.com>
7175 Disable XML documentation support in 'basic' profile.
7176 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
7177 Redirect XmlElement to System.Object.
7178 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
7179 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
7180 * mcs.exe.sources: Add doc-bootstrap.cs.
7181 * doc-bootstrap.cs: New file. Contains empty stub implementation
7184 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
7186 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7187 comments are allowed.
7189 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7191 * delegate.cs: Add checks for subtypes in paramaters and return values
7192 in VerifyMethod () to add support for Covariance/Contravariance
7195 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7197 * report.cs: Remove extra closing parenthesis.
7199 * convert.cs (Error_CannotImplicitConversion): If the name of the
7200 types are the same, provide some extra information.
7202 * class.cs (FieldBase): Use an unused bit field from the field to
7203 encode the `has_offset' property from the FieldMember. This saves
7204 a couple of Ks on bootstrap compilation.
7206 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7207 method as our child, return the AnonymousMethod resolved
7210 * expression.cs (New.DoResolve): Allow return values from
7211 NewDelegate to also include AnonymousMethods.
7215 2004-12-02 Marek Safar <marek.safar@seznam.cz>
7218 * attribute.cs (Resolve): Improved implementation of params
7219 attribute arguments.
7221 * support.cs (ParameterData): Add HasParams to be faster.
7223 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
7225 all things are for /doc support:
7227 * doc.cs: new file that supports XML documentation generation.
7228 * mcs.exe.sources: added doc.cs.
7230 Handle /doc command line option.
7231 Report error 2006 instead of 5 for missing file name for /doc.
7232 Generate XML documentation when required, after type resolution.
7234 Added support for picking up documentation (/// and /** ... */),
7235 including a new XmlCommentState enumeration.
7237 Added lines to fill Documentation element for field, constant,
7238 property, indexer, method, constructor, destructor, operator, event
7239 and class, struct, interface, delegate, enum.
7240 Added lines to warn incorrect comment.
7242 Added Documentation field (passed only when /doc was specified).
7244 Added DocComment, DocCommentHeader, GenerateDocComment() and
7245 OnGenerateDocComment() and some supporting private members for
7246 /doc feature to MemberCore.
7248 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7250 Added overriden DocCommentHeader.
7252 Added overriden DocCommentHeader and GenerateDocComment().
7254 2004-12-01 Miguel de Icaza <miguel@ximian.com>
7256 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7257 unwrapping the enumeration values, chain to
7258 DoConstantNumericPromotions again, so we can promote things to the
7259 fundamental types (takes care of enums that are bytes, sbytes).
7263 2004-12-01 Raja R Harinath <rharinath@novell.com>
7265 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7266 Fix long-standing bug in type-lookup. Use FindType instead of
7267 LookupType when ec.ResolvingTypeTree.
7268 (Attribute.ResolveType, Attribute.Resolve)
7269 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7271 (Attributes.Search): Remove internal version. Update.
7272 (Attributes.SearchMulti): Update.
7273 (Attributes.GetClsCompliantAttribute): Remove.
7274 (Attributes.GetIndexerNameAttribute): Remove.
7275 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7276 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7277 * class.cs (Indexer.Define): Likewise.
7279 2004-12-01 Marek Safar <marek.safar@seznam.cz>
7282 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7283 MarshallByReference members access.
7285 * expression.cs: Use CheckMarshallByRefAccess;
7286 Better error CS0197 message.
7288 * report.cs: Print whole related error message.
7290 2004-11-30 Raja R Harinath <rharinath@novell.com>
7292 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
7293 the current directory to help debugging.
7295 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7297 * class (GetClassBases): Better error 60 report.
7298 (EventProperty): Disabled warning 67 detection.
7300 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7303 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7305 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7308 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7311 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7313 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7315 2004-11-26 Miguel de Icaza <miguel@ximian.com>
7317 * attribute.cs (Attribute.Resolve): Refine error reporting and
7318 report a cs0117 if the identifier does not exist, to distinguish
7319 from 0617 which is a miss-use of the actual identifier.
7321 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7322 between cs0070 and cs0079.
7324 * class.cs (MemberBase.DoDefine): When reporting a wrong
7325 accessibility level, we use MethodCore to compare instead of
7326 Method (this was a regression in some refactoring effort).
7328 So now we correctly report cs0056 again.
7330 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7331 testing the target_type (which was known to be object_type) and
7332 not the source type (which is anonymous_method).
7334 Fixed reporting of error cs1660.
7336 * expression.cs (UserCast.Source): Expose the underlying cast.
7338 * statement.cs (Switch.SwitchGoverningType): Sort the list of
7339 allowed types to find a match to int32 first (most common).
7341 In addition, it ignores any ImplicitUserConversions that did an
7342 internal implicit conversion (as the switch statement allows only
7343 one integral conversion to exist).
7345 * class.cs (PartialContainer.Create): rename `name' to
7346 `member_name' for clarity. Then replace the string calls with a
7347 call to MemberName.GetPartialName, as now using
7348 MemberName.ToString is an error (this is due to the side effects
7349 it had, that were fixed in the past).
7351 This will restore the error reporting on a number of partial class
7352 errors that were missusing this (and getting an exception as a
7353 results, which is now just a plain textual warning, because
7354 yyparse debug output would crash otherwise).
7356 2004-11-26 Raja R Harinath <rharinath@novell.com>
7358 * Makefile (PROGRAM_INSTALL_DIR): Remove.
7360 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7362 * rootcontext.cs (LookupType): Make sure to cache lookups that
7363 don't give us a negative result. This saves about 5% of corlib
7366 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7368 * report.cs (AbstractMessage.Print): messages are sent to stderr
7370 * class.cs (TypeContainer.GetClassBases): It is an error to have a
7371 non-interface in the list of interfaces (at this point, either
7372 parent was properly set, or a base class is being listed in the
7373 interfaces section).
7375 This flags error 1722, and resolves the crash from bug 69259.
7377 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7379 * statement.cs (Using.EmitExpressionFinally): make this work right
7380 for valuetypes. Fixes 69926.
7382 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7384 * const.cs (Const.ChangeType): Cope with the "0 literal can be
7385 converted to an enum" here, before we try to change the underlying
7386 type. This code exists, but it is a different code path than the
7387 one used while encoding constants.
7389 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7390 old bug: when converting from the null literal to a pointer,
7391 return an EmptyCast, not the NullLiteral.
7393 This fixes #69921, the recent null_type changes probably made this
7396 (ImplicitReferenceConversionExists): In addition, resynchronized
7397 the code here, so it matches the same code in
7398 ImplicitReferenceConversionExists for the `from any class-type S
7399 to any interface-type T'.
7402 2004-11-25 Marek Safar <marek.safar@seznam.cz>
7404 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7406 2004-11-24 Miguel de Icaza <miguel@ximian.com>
7408 * cs-parser.jay: Use verbosity accordingly.
7410 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7412 * expression.cs (Unary.ResolveOperator): Do not report warning;
7413 AddressOf reads from variable.
7415 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7417 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7421 * attribute.cs (Attributable): Removed CheckTargets.
7422 (Attributes.Emit): Explicit attribute targets are tested here.
7424 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7425 not enabled for interfaces.
7427 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7428 (GetAssemblyName): Ouch next bug there.
7430 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7432 * expression.cs: Error 275 added.
7434 2004-11-23 Marek Safar <marek.safar@seznam.cz>
7436 Fix bug #69177 (Implemented decimal constant support)
7438 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7439 (BinaryFold): Add DecimalConstant.
7441 * const.cs (Define): Decimal constant
7443 (ChangeType): Add decimal type handling.
7444 (LookupConstantValue): Don't set value for decimal type but
7445 emit DecimalConstantAttribute. Needed for constant optimization.
7447 * constant.cs (ToDecimal): New method.
7448 (ConvertToDecimal): New method.
7449 (IntConstant): Implemented ConvertToDecimal.
7450 (DecimalConstant.Emit): Emit optimized version for decimals in
7453 * expression.cs (ResolveOperator): Changed order of constant
7454 reduction to work correctly with native types which have
7455 overloaded operators.
7456 (ResolveMemberAccess): Extract constant value from attribute
7459 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7461 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7462 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7463 (ChangeType): Decimal is special.
7464 (TypeToCoreType): Add decimal type.
7466 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7468 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7471 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7473 * class.cs (EventField.ApplyAttributeBuilder): Fix error
7476 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7478 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7480 * pending.cs (PendingImplementation): Grab only interfaces.
7482 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7484 * statement.cs (ForeachHelperMethods): Add location member and
7485 error 202 detection.
7487 2004-11-19 Raja R Harinath <rharinath@novell.com>
7489 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
7490 automatically handled by executable.make.
7491 (PROGRAM): Make profile-specific.
7493 2004-11-18 Marek Safar <marek.safar@seznam.cz>
7495 * expression.cs (DoResolveBase): Fixed wrong warning for out
7498 2004-11-18 Martin Baulig <martin@ximian.com>
7500 Merged latest changes into gmcs. Please keep this comment in
7501 here, it makes it easier for me to see what changed in MCS since
7502 the last time I merged.
7504 2004-11-17 Raja R Harinath <rharinath@novell.com>
7506 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7507 (TypeHandle.GetMemberCache): New.
7508 (TypeHandle.TypeHandle): Update.
7509 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7510 (TypeManager.LookupParentInterfacesCache):
7511 Rename from LookupInterfaceCache. Optimize slightly.
7512 (TypeManager.MemberLookup_FindMembers): Update.
7513 * decl.cs (MemberCache.MemberCache): Set Container to null in the
7515 (AddCacheContents): Rename from AddHashtable.
7516 * class.cs (TypeContainer.parent_container): Remove.
7517 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7518 (TypeContainer.DoDefineMembers): Don't initialize it.
7519 Update to name changes.
7521 2004-11-17 Miguel de Icaza <miguel@ximian.com>
7523 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7524 that factors the code to check access modifiers on override.
7526 (PropertyBase): Use the code here.
7528 Patch from Lluis S'anchez, fixes bug #69361.
7530 2004-11-15 Miguel de Icaza <miguel@ximian.com>
7532 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7533 routine that is used to report the use of a captured variable
7534 whose address has been taken.
7536 There are two checks: one when variables are being captured and
7537 the other check is when the address of a variable is taken.
7539 (because an anonymous methods might be resolved before *or* after
7540 the address has been taken) and
7542 * expression.cs (Conditional.DoResolve): Remove the special
7543 casing that Martin added to trueExpr and falseExpr being both
7544 NullLiteral. We get the right behavior now just by introducing
7545 the null_type into the compiler.
7547 * convert.cs (ExplicitConversion): Change the code to use
7548 null_type instead of testing `expr is NullLiteral'.
7549 (ImplicitConversionStandard): use null_type too.
7550 (ImplicitReferenceConversionExists): use null_type too.
7551 (ImplicitReferenceConversion): use null_type too.
7553 * literal.cs: The type of `NullLiteral' is now null_type instead
7555 (Resolve): Set the type here.
7557 * typemanager.cs: Introduce null_type.
7559 2004-11-17 Martin Baulig <martin@ximian.com>
7561 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7562 direction, like FindMembers() does. Fixes #69546, testcase is in
7565 2004-11-16 Martin Baulig <martin@ximian.com>
7567 This is based on a patch from Marek Safar, see bug #69082.
7568 Fixes bugs #63705 and #67130.
7570 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7571 method; create a MemberCache for an interface type and cache the
7574 * decl.cs (IMemberContainer.ParentContainer): Removed.
7575 (IMemberContainer.ParentCache): New property.
7576 (MemberCache.SetupCacheForInterface): Removed.
7577 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7578 to create a cache for an interface's "parent".
7580 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7583 2004-11-16 Martin Baulig <martin@ximian.com>
7585 Merged back from gmcs; these changes already went into gmcs a
7586 couple of weeks ago.
7589 (TypeManager.AddUserType): Removed the `ifaces' argument.
7590 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
7592 (TypeManager.AddUserInterface): Removed.
7593 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
7595 (TypeManager.GetInterfaces): Likewise.
7596 (TypeManager.GetExplicitInterfaces): Likewise.
7598 * ecore.cs (TypeExpr.GetInterfaces): Removed.
7600 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
7601 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
7603 2004-11-14 Ben Maurer <bmaurer@ximian.com>
7605 * statement.cs: Avoid adding bools to a hashtable.
7607 2004-11-07 Miguel de Icaza <miguel@ximian.com>
7609 * expression.cs (Invocation.OverloadResolve): Flag error if we are
7610 calling an unsafe method from a safe location.
7612 2004-11-06 Marek Safar <marek.safar@seznam.cz>
7615 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7617 2004-11-06 Miguel de Icaza <miguel@ximian.com>
7619 * namespace.cs (VerifyUsing): use GetPartialName instead of
7622 2004-11-05 Miguel de Icaza <miguel@ximian.com>
7624 * statement.cs (Return.Resolve): Fix regression in typo: if
7625 `in_exc', we have to request a NeedReturnLabel, this was a typo
7626 introduced in the anonymous method check-in. Fixes #69131.
7628 * Indexers were using the ShortName when defining themselves,
7629 causing a regression in the compiler bootstrap when applying the
7630 patch from 2004-11-02 (first part), now they use their full name
7631 and the bug is gone.
7633 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
7635 * driver.cs: Strip the path from the names of embedded resources. Fixes
7638 2004-11-04 Raja R Harinath <rharinath@novell.com>
7640 Fix error message regression: cs0104-2.cs.
7641 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7642 (AliasEntry.Resolve): Update.
7643 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
7645 (RootContext.LookupType): Update.
7647 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
7649 * cs-parser.jay: Add support for handling accessor modifiers
7650 * class: Add support port accessor modifiers and error checking,
7651 define PropertyMethod.Define as virtual (not abstract anymore)
7652 * ecore.cs: Add checking for proeprties access with access modifiers
7653 * iterators.cs: Modify Accessor constructor call based in the modified
7655 2004-11-02 Ben Maurer <bmaurer@ximian.com>
7657 * expression.cs (StringConcat): Handle being called twice,
7658 as when we have a concat in a field init with more than two
7661 2004-11-02 Miguel de Icaza <miguel@ximian.com>
7663 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7664 special case explicit implementations, we should always produce
7665 the .property or .event declaration.
7667 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7668 since it will not return correct data if people use this
7669 unresolved in the presence of using statements (see test-313).
7671 * class.cs (MethodData.Define): If we are an explicit interface
7672 implementation, set the method name to the full name of the
7673 interface plus the name of the method.
7675 Notice that using the method.MethodName.GetFullName() does not
7676 work, as it will only contain the name as declared on the source
7677 file (it can be a shorthand in the presence of using statements)
7678 and not the fully qualifed type name, for example:
7682 class D : ICloneable {
7683 object ICloneable.Clone () {
7687 Would produce a method called `ICloneable.Clone' instead of
7688 `System.ICloneable.Clone'.
7690 * namespace.cs (Alias.Resolve): Use GetPartialName.
7692 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7694 * cs-parser.jay: Add error 1055 report.
7696 2004-11-01 Miguel de Icaza <miguel@ximian.com>
7698 * assign.cs (Assign.DoResolve): Only do the transform of
7699 assignment into a New if the types are compatible, if not, fall
7700 through and let the implicit code deal with the errors and with
7701 the necessary conversions.
7703 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7705 * cs-parser.jay: Add error 1031 report.
7707 * cs-tokenizer.cs: Add location for error 1038.
7709 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7711 * cs-parser.jay: Add error 1016 report.
7713 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7715 * cs-parser.jay: Add errors 1575,1611 report.
7717 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7719 * cs-parser.jay: Add error 1001 report.
7721 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7724 * attribute.cs (GetMarshal): Add method argument for
7725 caller identification.
7727 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7728 agument for GetMarshal and RuntimeMissingSupport.
7730 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7732 * attribute.cs (ExtractSecurityPermissionSet): Removed
7733 TypeManager.code_access_permission_type.
7735 * typemanager.cs: Removed TypeManager.code_access_permission_type.
7737 2004-10-27 Miguel de Icaza <miguel@ximian.com>
7739 * expression.cs (LocalVariableReference.DoResolveLValue): Check
7740 for obsolete use of a variable here. Fixes regression on errors
7741 cs0619-25 and cs0619-26.
7743 2004-10-27 Marek Safar <marek.safar@seznam.cz>
7745 Fix #62358, implemented security attribute encoding.
7747 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7748 Tests permitted SecurityAction for assembly or other types.
7749 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7750 data from SecurityPermissionAttribute to PermisionSet class.
7752 * class.cs (ApplyAttributeBuilder): Added special handling
7753 for System.Security.Permissions.SecurityAttribute based types.
7755 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7756 special handling for System.Security.Permissions.SecurityAttribute
7759 * enum.cs (ApplyAttributeBuilder): Added special handling
7760 for System.Security.Permissions.SecurityAttribute based types.
7762 * parameter.cs (ApplyAttributeBuilder): Added special handling
7763 for System.Security.Permissions.SecurityAttribute based types.
7765 * rootcontext.cs: Next 2 core types.
7767 * typemanager.cs (TypeManager.security_permission_attr_type):
7768 Built in type for the SecurityPermission Attribute.
7769 (code_access_permission_type): Build in type.
7771 2004-10-17 Miguel de Icaza <miguel@ximian.com>
7773 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7774 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7775 all of this information into
7776 EmitContext.EmitCapturedVariableInstance.
7778 * codegen.cs (EmitCapturedVariableInstance): move here the
7779 funcionality of emitting an ldarg.0 in the presence of a
7780 remapping. This centralizes the instance emit code.
7782 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7783 then emit a load of this: it means that we have reached the
7784 topmost ScopeInfo: the one that contains the pointer to the
7785 instance of the class hosting the anonymous method.
7787 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7788 captures to the topmost CaptureContext.
7790 2004-10-12 Miguel de Icaza <miguel@ximian.com>
7792 * expression.cs (LocalVariableReference): Move the knowledge about
7793 the iterators into codegen's EmitCapturedVariableInstance.
7795 2004-10-11 Miguel de Icaza <miguel@ximian.com>
7797 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7798 all code paths return a value from an anonymous method (it is the
7799 same as the 161 error, but for anonymous methods).
7801 2004-10-08 Miguel de Icaza <miguel@ximian.com>
7803 The introduction of anonymous methods in the compiler changed
7804 various ways of doing things in the compiler. The most
7805 significant one is the hard split between the resolution phase
7806 and the emission phases of the compiler.
7808 For instance, routines that referenced local variables no
7809 longer can safely create temporary variables during the
7810 resolution phase: they must do so from the emission phase,
7811 since the variable might have been "captured", hence access to
7812 it can not be done with the local-variable operations from the runtime.
7816 (Block.Flags): New flag `IsTopLevel' to indicate that this block
7817 is a toplevel block.
7819 (ToplevelBlock): A new kind of Block, these are the blocks that
7820 are created by the parser for all toplevel method bodies. These
7821 include methods, accessors and anonymous methods.
7823 These contain some extra information not found in regular blocks:
7824 A pointer to an optional CaptureContext (for tracking captured
7825 local variables and parameters). A pointer to the parent
7828 (Return.Resolve): Catch missmatches when returning a value from an
7829 anonymous method (error 1662).
7830 Invoke NeedReturnLabel from the Resolve phase instead of the emit
7833 (Break.Resolve): ditto.
7835 (SwitchLabel): instead of defining the labels during the
7836 resolution phase, we now turned the public ILLabel and ILLabelCode
7837 labels into methods called GetILLabelCode() and GetILLabel() that
7838 only define the label during the Emit phase.
7840 (GotoCase): Track the SwitchLabel instead of the computed label
7841 (its contained therein). Emit the code by using
7842 SwitchLabel.GetILLabelCode ().
7844 (LocalInfo.Flags.Captured): A new flag has been introduce to track
7845 whether the Local has been captured or not.
7847 (LocalInfo.IsCaptured): New property, used to tell whether the
7848 local has been captured.
7850 * anonymous.cs: Vastly updated to contain the anonymous method
7853 The main classes here are: CaptureContext which tracks any
7854 captured information for a toplevel block and ScopeInfo used to
7855 track the activation frames for various local variables.
7857 Each toplevel block has an optional capture context associated
7858 with it. When a method contains an anonymous method both the
7859 toplevel method and the anonymous method will create a capture
7860 context. When variables or parameters are captured, they are
7861 recorded on the CaptureContext that owns them, for example:
7865 MyDelegate d = delegate {
7870 Here `a' will be recorded as captured on the toplevel
7871 CapturedContext, the inner captured context will not have anything
7872 (it will only have data if local variables or parameters from it
7873 are captured in a nested anonymous method.
7875 The ScopeInfo is used to track the activation frames for local
7876 variables, for example:
7878 for (int i = 0; i < 10; i++)
7879 for (int j = 0; j < 10; j++){
7880 MyDelegate d = delegate {
7885 At runtime this captures a single captured variable `i', but it
7886 captures 10 different versions of the variable `j'. The variable
7887 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7888 recorded on a child.
7890 The toplevel ScopeInfo will also track information like the `this'
7891 pointer if instance variables were referenced (this is necessary
7892 as the anonymous method lives inside a nested class in the host
7893 type of the method).
7895 (AnonymousMethod): Expanded to track the Toplevel, implement
7896 `AnonymousMethod.Compatible' to tell whether an anonymous method
7897 can be converted to a target delegate type.
7899 The routine now also produces the anonymous method content
7901 (AnonymousDelegate): A helper class that derives from
7902 DelegateCreation, this is used to generate the code necessary to
7903 produce the delegate for the anonymous method that was created.
7905 * assign.cs: API adjustments for new changes in
7906 Convert.ImplicitStandardConversionExists.
7908 * class.cs: Adjustments to cope with the fact that now toplevel
7909 blocks are of type `ToplevelBlock'.
7911 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7912 insteda of standard blocks.
7914 Flag errors if params arguments are passed to anonymous methods.
7916 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7917 `CurrentAnonymousMethod' which points to the current Anonymous
7918 Method. The variable points to the AnonymousMethod class that
7919 holds the code being compiled. It is set in the new EmitContext
7920 created for the anonymous method.
7922 (EmitContext.Phase): Introduce a variable and an enumeration to
7923 assist in enforcing some rules about when and where we are allowed
7924 to invoke certain methods (EmitContext.NeedsReturnLabel is the
7925 only one that enfonces this right now).
7927 (EmitContext.HaveCaptureInfo): new helper method that returns
7928 whether we have a CapturedContext initialized.
7930 (EmitContext.CaptureVariable): New method used to register that a
7931 LocalInfo must be flagged for capturing.
7933 (EmitContext.CapturedParameter): New method used to register that a
7934 parameters must be flagged for capturing.
7936 (EmitContext.CapturedField): New method used to register that a
7937 field must be flagged for capturing.
7939 (EmitContext.HaveCapturedVariables,
7940 EmitContext.HaveCapturedFields): Return whether there are captured
7941 variables or fields.
7943 (EmitContext.EmitMethodHostInstance): This is used to emit the
7944 instance for the anonymous method. The instance might be null
7945 (static methods), this (for anonymous methods that capture nothing
7946 and happen to live side-by-side with the current method body) or a
7947 more complicated expression if the method has a CaptureContext.
7949 (EmitContext.EmitTopBlock): Routine that drives the emission of
7950 code: it will first resolve the top block, then emit any metadata
7951 and then emit the code. The split is done so that we can extract
7952 any anonymous methods and flag any captured variables/parameters.
7954 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7955 during this phase, the ILGenerator should not be used as labels
7956 and local variables declared here might not be accessible to any
7957 code that is part of an anonymous method.
7959 Exceptions to this include the temporary variables that are
7960 created by some statements internally for holding temporary
7963 (EmitContext.EmitMeta): New routine, in charge of emitting all the
7966 (EmitContext.TemporaryReturn): This method is typically called
7967 from the Emit phase, and its the only place where we allow the
7968 ReturnLabel to be defined other than the EmitMeta. The reason is
7969 that otherwise we would have to duplicate a lot of logic in the
7970 Resolve phases of various methods that today is on the Emit
7973 (EmitContext.NeedReturnLabel): This no longer creates the label,
7974 as the ILGenerator is not valid during the resolve phase.
7976 (EmitContext.EmitThis): Extended the knowledge in this class to
7977 work in anonymous methods in addition to iterators.
7979 (EmitContext.EmitCapturedVariableInstance): This emits whatever
7980 code is necessary on the stack to access the instance to a local
7981 variable (the variable will be accessed as a field).
7983 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7984 EmitContext.EmitAddressOfParameter): Routines to support
7985 parameters (not completed at this point).
7987 Removals: Removed RemapLocal and RemapLocalLValue. We probably
7988 will also remove the parameters.
7990 * convert.cs (Convert): Define a `ConstantEC' which points to a
7991 null. This is just to prefity some code that uses
7992 ImplicitStandardConversion code and do not have an EmitContext
7995 The idea is to flag explicitly that at that point in time, it is
7996 known that the conversion will not trigger the delegate checking
7997 code in implicit conversions (which requires a valid
8000 Everywhere: pass new EmitContext parameter since
8001 ImplicitStandardConversionExists now requires it to check for
8002 anonymous method conversions.
8004 (Convert.ImplicitStandardConversionExists): If the type of an
8005 expression is the anonymous_method_type, and the type is a
8006 delegate, we invoke the AnonymousMethod.Compatible method to check
8007 whether an implicit conversion is possible.
8009 (Convert.ImplicitConversionStandard): Only do implicit method
8010 group conversions if the language level is not ISO_1.
8012 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8013 MethodInfo for the Invoke method. used by Delegate and
8016 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8017 method conversions if the target type is a delegate.
8019 Removed extra debugging nops.
8021 (LocalVariableReference): Turn the `local_info' into a public
8024 Add `prepared' field, the same hack used for FieldExprs to cope
8025 with composed assignments, as Local variables do not necessarily
8026 operate purely on the stack as they used to: they can be captured
8029 Add `temp' for a temporary result, like fields.
8031 Refactor DoResolve and DoResolveLValue into DoResolveBase.
8033 It now copes with Local variables that are captured and emits the
8034 proper instance variable to load it from a field in the captured
8037 (ParameterReference.DoResolveBase): During the resolve phase,
8038 capture parameters if we are in an anonymous method.
8040 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8041 anonymous method, use the EmitContext helper routines to emit the
8042 parameter reference.
8044 * iterators.cs: Set RemapToProxy to true/false during the
8047 * parameters.cs (GetParameterByName): New helper method.
8049 * typemanager.cs (anonymous_method_type) a new type that
8050 represents an anonyous method. This is always an internal type,
8051 used as a fencepost to test against the anonymous-methodness of an
8054 2004-10-20 Marek Safar <marek.safar@seznam.cz>
8056 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8058 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8060 2004-10-18 Martin Baulig <martin@ximian.com>
8062 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8063 `Type' directly, but call ResolveType() on it.
8064 (Catch.Resolve): Likewise.
8065 (Foreach.Resolve): Likewise.
8067 2004-10-18 Martin Baulig <martin@ximian.com>
8069 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8070 `Type' directly, but call ResolveType() on it.
8071 (Probe.DoResolve): Likewise.
8072 (ArrayCreation.LookupType): Likewise.
8073 (TypeOf.DoResolve): Likewise.
8074 (SizeOf.DoResolve): Likewise.
8076 2004-10-18 Martin Baulig <martin@ximian.com>
8078 * expression.cs (Invocation.BetterFunction): Put back
8079 TypeManager.TypeToCoreType().
8081 2004-10-18 Raja R Harinath <rharinath@novell.com>
8083 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8086 2004-10-18 Martin Baulig <martin@ximian.com>
8088 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
8089 `Type' directly, but call ResolveType() on it.
8091 2004-10-18 Martin Baulig <martin@ximian.com>
8093 * class.cs (FieldMember.Define): Don't access the TypeExpr's
8094 `Type' directly, but call ResolveType() on it.
8095 (MemberBase.DoDefine): Likewise.
8097 * expression.cs (New.DoResolve): Don't access the TypeExpr's
8098 `Type' directly, but call ResolveType() on it.
8099 (ComposedCast.DoResolveAsTypeStep): Likewise.
8101 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8102 `Type' directly, but call ResolveType() on it.
8104 2004-10-17 John Luke <john.luke@gmail.com>
8106 * class.cs (Operator.GetSignatureForError): use CSharpName
8108 * parameter.cs (Parameter.GetSignatureForError): Returns
8109 correct name even if was not defined.
8111 2004-10-13 Raja R Harinath <rharinath@novell.com>
8114 * class.cs (TypeContainer.EmitContext): New property.
8115 (DefineNestedTypes): Create an emitcontext for each part.
8116 (MethodCore.DoDefineParameters): Use container's emitcontext.
8117 Pass type array to InternalParameters.
8118 (MemberBase.DoDefine): Use container's emitcontext.
8119 (FieldMember.Define): Likewise.
8120 (Event.Define): Likewise.
8121 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8122 Pass type array to InternalParameters.
8123 (SetIndexerMethod.GetParameterInfo): Likewise.
8124 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8125 * delegate.cs (Define): Pass emitcontext to
8126 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8127 array to InternalParameters.
8128 * expression.cs (ParameterReference.DoResolveBase): Pass
8129 emitcontext to GetParameterInfo.
8130 (ComposedCast.DoResolveAsTypeStep): Remove check on
8131 ec.ResolvingTypeTree.
8132 * parameter.cs (Parameter.Resolve): Change argument to
8133 EmitContext. Use ResolveAsTypeTerminal.
8134 (Parameter.GetSignature): Change argument to EmitContext.
8135 (Parameters.ComputeSignature): Likewise.
8136 (Parameters.ComputeParameterTypes): Likewise.
8137 (Parameters.GetParameterInfo): Likewise.
8138 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8139 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8140 * support.cs (InternalParameters..ctor): Remove variant that takes
8142 * typemanager.cs (system_intptr_expr): New.
8143 (InitExpressionTypes): Initialize it.
8145 2004-10-12 Chris Toshok <toshok@ximian.com>
8147 * cs-parser.jay: fix location for try_statement and catch_clause.
8149 2004-10-11 Martin Baulig <martin@ximian.com>
8151 * report.cs: Don't make --fatal abort on warnings, we have
8152 -warnaserror for that.
8154 2004-10-07 Raja R Harinath <rharinath@novell.com>
8156 More DeclSpace.ResolveType avoidance.
8157 * decl.cs (MemberCore.InUnsafe): New property.
8158 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
8159 with newly created EmitContext.
8160 (FieldMember.Define): Likewise.
8161 * delegate.cs (Delegate.Define): Likewise.
8162 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8163 only if normal name-lookup fails.
8164 (TypeExpr.DoResolve): Enable error-checking.
8165 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8166 (SizeOf.DoResolve): Likewise.
8167 (ComposedCast.DoResolveAsTypeStep): Likewise.
8168 (StackAlloc.DoResolve): Likewise.
8169 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8170 (Block.Unsafe): New property.
8171 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8172 (Unsafe): Set 'unsafe' flag of contained block.
8173 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8174 (Fixed.Resolve): Likewise.
8175 (Catch.Resolve): Likewise.
8176 (Using.ResolveLocalVariableDecls): Likewise.
8177 (Foreach.Resolve): Likewise.
8179 2004-10-05 John Luke <john.luke@gmail.com>
8181 * cs-parser.jay: add location to error CS0175
8183 2004-10-04 Miguel de Icaza <miguel@ximian.com>
8185 * ecore.cs (Expression.Constantity): Add support for turning null
8188 * const.cs (Const.Define): Allow constants to be reference types
8189 as long as the value is Null.
8191 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
8193 * namespace.cs (NamespaceEntry.Using): No matter which warning
8194 level is set, check if this namespace name has already been added.
8196 2004-10-03 Ben Maurer <bmaurer@ximian.com>
8198 * expression.cs: reftype [!=]= null should always use br[true,false].
8201 2004-10-03 Marek Safar <marek.safar@seznam.cz>
8204 * attribute.cs: Enum conversion moved to
8205 GetAttributeArgumentExpression to be applied to the all
8208 2004-10-01 Raja R Harinath <rharinath@novell.com>
8210 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8211 * class.c (TypeContainer.DefineType): Flag error if
8212 base types aren't accessible due to access permissions.
8213 * decl.cs (DeclSpace.ResolveType): Move logic to
8214 Expression.ResolveAsTypeTerminal.
8215 (DeclSpace.ResolveTypeExpr): Thin layer over
8216 Expression.ResolveAsTypeTerminal.
8217 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8218 Refactor code into NestedAccess. Use it.
8219 (DeclSpace.NestedAccess): New.
8220 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8221 argument to silence errors. Check access permissions.
8222 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8223 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8224 (Cast.DoResolve): Likewise.
8225 (New.DoResolve): Likewise.
8226 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8227 (TypeOf.DoResolve): Likewise.
8229 * expression.cs (Invocation.BetterConversion): Return the Type of
8230 the better conversion. Implement section 14.4.2.3 more faithfully.
8231 (Invocation.BetterFunction): Make boolean. Make correspondence to
8232 section 14.4.2.2 explicit.
8233 (Invocation.OverloadResolve): Update.
8234 (Invocation): Remove is_base field.
8235 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
8236 (Invocation.Emit): Likewise.
8238 2004-09-27 Raja R Harinath <rharinath@novell.com>
8240 * README: Update to changes.
8242 2004-09-24 Marek Safar <marek.safar@seznam.cz>
8244 * cs-parser.jay: Reverted 642 warning fix.
8246 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8249 * decl.cs (FindMemberWithSameName): Indexer can have more than
8252 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8254 * expression.cs (LocalVariableReference.DoResolveLValue):
8255 Do not report warning 219 for out values.
8256 (EmptyExpression.Null): New member to avoid extra allocations.
8258 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8260 * cs-parser.jay: Fix wrong warning 642 report.
8262 * cs-tokenizer.cs (CheckNextToken): New helper;
8263 Inspect next character if is same as expected.
8265 2004-09-23 Martin Baulig <martin@ximian.com>
8267 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8268 (Convert.ImplicitReferenceConversionExists): Likewise.
8270 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8272 * class.cs (Operator.Define): Add error 448 and 559 report.
8274 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8276 * class.cs (MemberBase.IsTypePermitted): New protected
8277 method for checking error CS0610.
8279 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8281 * class.cs (TypeContainer.HasExplicitLayout): New property
8282 Returns whether container has StructLayout attribute set Explicit.
8283 (FieldMember): New abstract class for consts and fields.
8284 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8285 (Field): Reuse FieldMember.
8287 * const.cs (Const): Reuse FieldMember.
8289 * rootcontext.cs: EmitConstants call moved to class.
8291 2004-09-22 Martin Baulig <martin@ximian.com>
8293 Thanks to Peter Sestoft for this bug report.
8295 * expression.cs (Conditional): If both the `trueExpr' and the
8296 `falseExpr' is a NullLiteral, return a NullLiteral.
8298 2004-09-22 Martin Baulig <martin@ximian.com>
8300 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8301 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8302 for the "get_Current" call.
8304 2004-09-22 Martin Baulig <martin@ximian.com>
8306 Marek and me just fixed one of our oldest bugs: #28562 :-)
8308 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8310 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8311 we're an EnumConstant, just return that.
8312 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8313 an EnumConstant. In this case, we need to use GetValueAsEnumType()
8314 to get the value which'll actually be written into the attribute.
8315 However, we have to use GetValue() to access the attribute's value
8318 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8320 * constant.cs (Constant.IsNegative): New abstract property
8323 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8324 (StackAlloc.DoResolve): Reused IsNegative.
8326 2004-09-21 Martin Baulig <martin@ximian.com>
8328 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
8329 if we're used in an iterator, we may be called from different
8332 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
8333 we actually have an exception block.
8335 2004-09-20 John Luke <jluke@cfl.rr.com>
8337 * class.cs, cs-parser.jay: Improve the error report for 1520:
8338 report the actual line where the error happens, not where the
8341 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
8342 Pass location information that was available elsewhere.
8344 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
8346 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
8347 runtime to delay sign assemblies.
8349 2004-09-19 Miguel de Icaza <miguel@ximian.com>
8351 * cs-parser.jay: Do not report the stack trace, this is barely
8354 2004-08-22 John Luke <john.luke@gmail.com>
8356 * driver.cs : check that a resource id is not already used
8357 before adding it, report CS1508 if it is, bug #63637
8359 2004-09-19 Miguel de Icaza <miguel@ximian.com>
8361 * ecore.cs: Removed dead code.
8363 2004-09-18 Marek Safar <marek.safar@seznam.cz>
8365 * class.cs: Do not report warning CS0067 on the interfaces.
8367 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8369 * cs-parser.jay: Add error 504 report.
8371 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8373 * rootcontext.cs: WarningLevel is 4 by default now.
8375 * statement.cs (Fixed.Resolve): Do not null
8378 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8381 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
8382 deep search when property is not virtual.
8383 (PropertyExpr.ResolveAccessors): Make one call for both
8386 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8389 * statement.cs: Error 152 report constains also location.
8391 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8394 * const.cs: Explicitly set constant as static.
8396 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8399 * cs-parser.jay: Add error 1017 report.
8401 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8403 Fixed bug #59980, #64224
8404 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
8406 * typemanager.cs (IsSpecialMethod): Simplified
8408 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8410 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
8411 condition with better params.
8413 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8416 * attribute.cs (Resolve): Property has to have both
8419 2004-09-14 Martin Baulig <martin@ximian.com>
8421 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8423 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8426 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8427 called and is obsolete then this member suppress message
8428 when call is inside next [Obsolete] method or type.
8430 * expression.cs: Use TestObsoleteMethodUsage member.
8432 2004-09-14 Martin Baulig <martin@ximian.com>
8434 * cs-parser.jay: Sync a bit with the GMCS version.
8436 2004-09-14 Martin Baulig <martin@ximian.com>
8438 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
8439 (CSharpParser.yacc_verbose_flag): New public field.
8441 * genericparser.cs: Removed.
8443 2004-09-14 Raja R Harinath <rharinath@novell.com>
8445 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
8447 2004-09-13 Marek Safar <marek.safar@seznam.cz>
8449 * class.cs (MethodCore.CheckBase): Fix bug #65757.
8451 2004-09-10 Martin Baulig <martin@ximian.com>
8453 Backported my MemberName changes from GMCS into MCS.
8455 - we are now using a special `MemberName' class instead of using
8456 strings; in GMCS, the `MemberName' also contains the type
8459 - changed the grammar rules a bit:
8460 * the old `member_name' is now a `namespace_or_type_name':
8461 The rule is that we use `namespace_or_type_name' everywhere
8462 where we expect either a "member name" (GetEnumerator) or a
8463 "member name" with an explicit interface name
8464 (IEnumerable.GetEnumerator).
8465 In GMCS, the explicit interface name may include type arguments
8466 (IEnumerable<T>.GetEnumerator).
8467 * we use `member_name' instead of just `IDENTIFIER' for
8469 The rule is that we use `member_name' wherever a member may
8470 have type parameters in GMCS.
8472 * decl.cs (MemberName): New public class.
8473 (MemberCore.MemberName): New public readonly field.
8474 (MemberCore.ctor): Take a `MemberName' argument, not a string.
8475 (DeclSpace): Likewise.
8477 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
8478 * enum.cs (Enum.ctor): Likewise.
8480 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
8482 (AliasEntry.ctor): Take a MemberName, not an Expression.
8483 (AliasEntry.UsingAlias): Likewise.
8485 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
8486 (IMethodData.MemberName): Changed type from string to MemberName.
8487 (MemberBase.ExplicitInterfaceName): Likewise.
8488 (AbstractPropertyEventMethod.SetupName): Make this private.
8489 (AbstractPropertyEventMethod.ctor): Added `string prefix'
8490 argument; compute the member name here.
8491 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
8492 on the `member.MemberName' and the `prefix'.
8494 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
8496 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
8497 thus, we get a `MemberName' instead of a `string'. These
8498 declarations may have type parameters in GMCS.
8499 (interface_method_declaration, delegate_declaration): Likewise.
8500 (class_declaration, interface_declaration): Likewise.
8501 (method_header): Use `namespace_or_type_name' instead of
8502 `member_name'. We may be an explicit interface implementation.
8503 (property_declaration, event_declaration): Likewise.
8504 (member_name): This is now just an `IDENTIFIER', not a
8505 `namespace_or_type_name'.
8506 (type_name, interface_type): Removed.
8507 (namespace_or_type_name): Return a MemberName, not an Expression.
8508 (primary_expression): Use `member_name' instead of `IDENTIFIER';
8509 call GetTypeExpression() on the MemberName to get an expression.
8510 (IndexerDeclaration.interface_type): Changed type from string to
8512 (MakeName): Operate on MemberName's instead of string's.
8514 2004-09-13 Raja R Harinath <rharinath@novell.com>
8517 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
8518 (NamespaceEntry.Lookup): Add new argument to flag if we want the
8519 lookup to avoid symbols introduced by 'using'.
8520 * rootcontext.cs (NamespaceLookup): Update.
8522 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8524 * class.cs (TypeContainer.DoDefineMembers): Do not call
8525 DefineDefaultConstructor for static classes.
8527 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8529 * attribute.cs (Attribute.Resolve): Add error 653 report.
8531 * class.cs (Class.ApplyAttributeBuilder): Add error 641
8533 (Method.ApplyAttributeBuilder): Add error 685 report.
8534 (Operator.Define): Add error 564 report.
8536 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8538 * expression.cs (Invocation.DoResolve): Add error
8541 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8544 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8546 * class.cs (ConstructorInitializer.Resolve):
8547 Wrong error number (515->516).
8549 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8551 * class.cs (Indexer.Define): Add error 631 report.
8553 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8555 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8557 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8559 * expression.cs (Probe.DoResolve): Add error CS0241 report.
8561 2004-09-10 Marek Safar <marek.safar@seznam.cz>
8563 * cs-parser.jay: Added error CS0241 report.
8565 2004-09-10 Raja R Harinath <rharinath@novell.com>
8567 * cs-parser.jay (fixed_statement): Introduce a scope for the
8568 declaration in the 'fixed' statement.
8570 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8572 * cs-parser.jay: Added CS0230 error report.
8574 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8576 * cs-parser.jay: Added errors CS0231 and CS0257 report.
8578 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8580 * expression.cs (Argument.Resolve): Added error CS0192 and
8583 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8585 C# 2.0 #pragma warning feature
8587 * cs-tokenizer.cs (PreProcessPragma): New method;
8588 Handles #pragma directive.
8590 * report.cs (WarningRegions): New class; Support
8591 class for #pragma warning directive. It tests whether
8592 warning is enabled for a given line.
8594 2004-09-08 Miguel de Icaza <miguel@ximian.com>
8596 * const.cs: Add more descriptive error report, tahnks to
8599 2004-09-08 Marek Safar <marek.safar@seznam.cz>
8601 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8603 2004-09-07 Miguel de Icaza <miguel@ximian.com>
8605 * expression.cs: Apply patch from Ben: Remove dead code from
8606 ArrayCreation, and remove the TurnintoConstant call in const.cs,
8607 as that code just threw an exception anwyays.
8609 * const.cs: Remove the call to the turnintoconstant, for details
8612 * literal.cs: The type of the null-literal is the null type; So
8613 we use a placeholder type (literal.cs:System.Null, defined here)
8616 * expression.cs (Conditional.DoResolve): Remove some old code that
8617 is no longer needed, conversions have been fixed.
8619 (ArrayCreationExpression.DoResolve): Return false if we fail to
8620 resolve the inner expression.
8622 2004-09-07 Raja R Harinath <rharinath@novell.com>
8625 * cs-parser.jay (delegate_declaration): Record a delegate
8626 declaration as a type declaration.
8627 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8629 2004-09-06 Miguel de Icaza <miguel@ximian.com>
8631 * parameter.cs: Do not crash if the type can not be resolved.
8633 * expression.cs: Report errors with unsafe pointers, fixes #64896
8635 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
8637 * expression.cs: Pointer arith always needs to do a conv.i
8638 if the operand is a long. fix 65320
8640 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8642 Fixed cs0619-37.cs, cs0619-38.cs
8644 * enum.cs (GetObsoleteAttribute): Removed.
8646 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8647 on Enum member is double staged. The first is tested member
8650 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8652 Fixed #56986, #63631, #65231
8654 * class.cs: (TypeContainer.AddToMemberContainer): New method,
8655 adds member to name container.
8656 (TypeContainer.AddToTypeContainer): New method, adds type to
8658 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8659 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8660 AddOperator): Simplified by reusing AddToMemberContainer.
8661 (TypeContainer.UserDefinedStaticConstructor): Changed to property
8663 (Method.CheckForDuplications): Fixed implementation to test all
8665 (MemberBase): Detection whether member is explicit interface
8666 implementation is now in constructor.
8667 (MemberBase.UpdateMemberName): Handles IndexerName.
8668 (Accessor): Changed to keep also location information.
8669 (AbstractPropertyEventMethod): Is derived from MemberCore.
8670 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8671 will be emited or not.
8672 (PropertyBase.AreAccessorsDuplicateImplementation):
8673 Tests whether accessors are not in collision with some method.
8674 (Operator): Is derived from MethodCore to simplify common
8677 * decl.cs (Flags.TestMethodDuplication): Test for duplication
8679 (DeclSpace.AddToContainer): Adds the member to defined_names
8680 table. It tests for duplications and enclosing name conflicts.
8682 * enum.cs (EnumMember): Clean up to reuse the base structures
8684 2004-09-03 Martin Baulig <martin@ximian.com>
8686 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8687 into TypeContainer, to make partial classes work again.
8689 2004-09-03 Martin Baulig <martin@ximian.com>
8691 * rootcontext.cs (RootContext.V2): Removed.
8693 2004-03-23 Martin Baulig <martin@ximian.com>
8695 * expression.cs (Invocation.OverloadResolve): Added `bool
8696 may_fail' argument and use it instead of the Location.IsNull() hack.
8698 2004-09-03 Martin Baulig <martin@ximian.com>
8700 Merged latest changes into gmcs. Please keep this comment in
8701 here, it makes it easier for me to see what changed in MCS since
8702 the last time I merged.
8704 2004-09-03 Raja R Harinath <rharinath@novell.com>
8707 * expression.cs (BetterConversion): Don't allow either conversion
8708 to be null. Remove redundant implicit conversion test when 'q ==
8709 null' -- when this function is invoked, we already know that the
8710 implicit conversion exists.
8711 (BetterFunction): Assume that 'best' is non-null. Remove
8712 redundant reimplementation of IsApplicable when 'best' is null.
8713 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8714 number of arguments.
8715 (IsAncestralType): Extract from OverloadResolve.
8716 (OverloadResolve): Make robust to the MethodGroupExpr being
8717 unsorted. Implement all the logic of Section 14.5.5.1, and
8718 support overloading of methods from multiple applicable types.
8719 Clean up logic somewhat. Don't pass null methods to BetterFunction.
8721 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8722 (RealError, Warning): Append type of report to related symbol.
8724 2004-09-03 Marek Safar <marek.safar@seznam.cz>
8726 * enum.cs: Fixed CLS-Compliance checks for enum members.
8727 Error tests cs3008-8.cs, cs3014-8.cs
8729 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8731 Fixed bug #62342, #63102
8732 * class.cs: ImplementIndexer uses member.IsExplicitImpl
8733 like ImplementMethod.
8735 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8737 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8740 2004-09-02 Martin Baulig <martin@ximian.com>
8742 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8743 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8746 2004-09-01 Marek Safar <marek.safar@seznam.cz>
8748 C# 2.0 Static classes implemented
8750 * class.cs (TypeContainer): instance_constructors,
8751 initialized_fields, initialized_static_fields,
8752 default_constructor, base_inteface_types are protected to be
8753 accessible from StaticClass.
8754 (TypeContainer.DefineDefaultConstructor): New virtual method
8755 for custom default constructor generating
8756 (StaticClass): New class to handle "Static classes" feature.
8758 * cs-parser.jay: Handle static keyword on class like instance
8761 * driver.cs: Added "/langversion" command line switch with two
8762 options (iso-1, default).
8764 2004-08-31 Marek Safar <marek.safar@seznam.cz>
8766 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8768 2004-08-31 Miguel de Icaza <miguel@ximian.com>
8770 * delegate.cs: Style.
8772 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
8774 * delegate.cs: Add seperate instance expr field for miguel.
8776 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8778 * PointerArithmetic (Resolve): make sure we are not doing
8779 pointer arith on void*. Also, make sure we are resolved
8780 by not setting eclass until resolve.
8782 All callers: Make sure that PointerArithmetic gets resolved.
8784 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8786 * ArrayCreation (LookupType): If the type does not resolve
8787 to an array, give an error.
8789 2004-08-27 Marek Safar <marek.safar@seznam.cz>
8791 * statement.cs (Try.Resolve): Fixed bug #64222
8793 2004-08-27 Martin Baulig <martin@ximian.com>
8796 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8799 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8801 * ecore.cs (Constantify): Get underlying type via
8802 System.Enum.GetUnderlyingType to avoid StackOverflow on the
8803 Windows in special cases.
8805 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8807 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8808 for obtaining also private methods.
8809 (GetRemoveMethod): Used GetRemoveMethod (true)
8810 for obtaining also private methods.
8812 2004-08-24 Martin Baulig <martin@ximian.com>
8814 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8815 MethodAttributes.HideBySig for operators.
8817 2004-08-23 Martin Baulig <martin@ximian.com>
8819 Back to the old error reporting system :-)
8821 * report.cs (Message): Removed.
8822 (Report.MessageData, ErrorData, WarningData): Removed.
8823 (Report.Error, Warning): Back to the old system.
8825 2004-08-23 Martin Baulig <martin@ximian.com>
8827 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8829 * class.cs (TypeContainer.ParentContainer): New public virtual
8830 method; replaces the explicit interface implementation.
8831 (ClassPart.ParentContainer): Override.
8833 2004-08-23 Martin Baulig <martin@ximian.com>
8835 * statement.cs (Switch): Added support for constant switches; see
8836 #59428 or test-285.cs.
8838 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8841 * statement.cs (GetEnumeratorFilter): Removed useless
8842 logic because C# specs is strict. GetEnumerator must be
8845 2004-08-22 Martin Baulig <martin@ximian.com>
8847 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8848 a switch and may break, reset the barrier. Fixes #59867.
8850 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8852 CLS-Compliance speed up (~5% for corlib)
8854 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8855 New method. Tests container for CLS-Compliant names
8857 * class.cs (TypeContainer.VerifyClsName): New method.
8858 Checks whether container name is CLS Compliant.
8859 (Constructor): Implements IMethodData.
8861 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8862 low-case table for CLS Compliance test.
8863 (MemberCache.VerifyClsParameterConflict): New method.
8864 Checks method parameters for CS3006 error.
8866 * enum.cs (EnumMember): Is derived from MemberCore.
8867 (Enum.VerifyClsName): Optimized for better performance.
8869 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8871 * report.cs: Renamed Error_T to Error and changed all
8874 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8876 * class.cs (TypeContainer.IndexerArrayList): New inner class
8877 container for indexers.
8878 (TypeContainer.DefaultIndexerName): New constant for default
8879 indexer name. Replaced all "Item" with this constant.
8880 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8882 * typemanager.cs (TypeManager.default_member_ctor): Cache here
8883 DefaultMemberAttribute constructor.
8885 2004-08-05 Martin Baulig <martin@ximian.com>
8887 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8890 2004-08-05 Marek Safar <marek.safar@seznam.cz>
8892 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8893 multi platforms problem.
8895 * compiler.csproj: Included shared files.
8897 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8899 Fix bug 60333, 55971 in the more general way
8900 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8901 Added arg_type argument for constant conversion.
8902 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8904 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8907 * class.cs (TypeContainer ): New inner classes MethodArrayList,
8908 OperatorArrayList, MethodCoreArrayList for typecontainer
8909 containers. Changed class member types to these new types.
8910 (MethodArrayList.DefineMembers): Added test for CS0659.
8912 2004-08-04 Miguel de Icaza <miguel@ximian.com>
8914 * cfold.cs: Synchronize the folding with the code in expression.cs
8915 Binary.DoNumericPromotions for uint operands.
8917 * attribute.cs: Revert patch from Raja, it introduced a regression
8918 while building Blam-1.2.1 (hard to isolate a test case).
8920 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8924 (TypeContainer.Define): Renamed to DefineContainerMembers because of
8926 (MethodCore.parent_method): New member. The method we're overriding
8927 if this is an override method.
8928 (MethodCore.CheckBase): Moved from Method class and made common.
8929 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8931 (MethodCore.CheckForDuplications): New abstract method. For custom
8932 member duplication search in a container
8933 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8934 method and its return type.
8935 (Event.conflict_symbol): New member. Symbol with same name in the
8939 (MemberCache.FindMemberWithSameName): New method. The method
8940 is looking for conflict with inherited symbols.
8942 2004-08-04 Martin Baulig <martin@ximian.com>
8944 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8946 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8948 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8950 * report.cs (Message): New enum for better error, warning reference in
8952 (MessageData): New inner abstract class. It generally handles printing of
8953 error and warning messages.
8954 Removed unused Error, Warning, Message methods.
8956 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8958 Fix for cs0592-8.cs test
8960 (Attributable.ValidAttributeTargets): Made public.
8961 (Attribute.ExplicitTarget): New member for explicit target value.
8962 (Attribute.CheckTargets): Now we translate explicit attribute
8963 target to Target here.
8965 2004-08-03 Ben Maurer <bmaurer@ximian.com>
8967 * ecore.cs (MethodGroupExpr): new IsBase property.
8969 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8971 * delegate.cs (DelegateCreation): store a MethodGroupExpr
8972 rather than an instance expr.
8974 (DelegateCreation.Emit): Use the method group rather than
8975 the instance expression. Also, if you have base.Foo as the
8976 method for a delegate, make sure to emit ldftn, not ldftnvirt.
8978 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
8980 (NewDelegate.DoResolve): Only check for the existance of Invoke
8981 if the method is going to be needed. Use MethodGroupExpr.
8983 (NewDelegate.Emit): Remove, DelegateCreation implements this.
8985 * expression.cs: For pointer arith., make sure to use
8986 the size of the type, not the size of the pointer to
8989 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8992 * class.cs (Class): Added error CS0502 test.
8994 2004-08-03 John Luke <jluke@cfl.rr.com>
8995 Raja R Harinath <rharinath@novell.com>
8998 * attribute.cs (Attribute.complained_before): New flag.
8999 (Attribute.ResolveType, Attribute.Resolve),
9000 (Attribute.DefinePInvokeMethod): Set it.
9001 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9003 2004-08-03 Martin Baulig <martin@ximian.com>
9005 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9006 use a user-defined operator; we still need to do numeric
9007 promotions in case one argument is a builtin type and the other
9008 one has an implicit conversion to that type. Fixes #62322.
9010 2004-08-02 Martin Baulig <martin@ximian.com>
9012 * statement.cs (LocalInfo.Flags): Added `IsThis'.
9013 (LocalInfo.IsThis): New public property.
9014 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9016 2004-08-01 Martin Baulig <martin@ximian.com>
9018 * class.cs (TypeContainer.GetClassBases): Don't set the default
9019 here since we may get called from GetPartialBases().
9020 (TypeContainer.DefineType): If GetClassBases() didn't return a
9021 parent, use the default one.
9023 2004-07-30 Duncan Mak <duncan@ximian.com>
9025 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
9027 2004-07-30 Martin Baulig <martin@ximian.com>
9029 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9031 * class.cs (SourceMethod): New public class, derive from the
9032 symbol writer's ISourceMethod.
9033 (Method): Use the new symbol writer API.
9035 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9036 as argument and use the new symbol writer.
9039 (SourceFile): Implement the symbol writer's ISourceFile.
9040 (Location.SymbolDocument): Removed.
9041 (Location.SourceFile): New public property.
9043 * symbolwriter.cs: Use the new symbol writer API.
9045 2004-07-30 Raja R Harinath <rharinath@novell.com>
9047 * Makefile (install-local): Remove. Functionality moved to
9050 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
9052 * Makefile: Install mcs.exe.config file together with mcs.exe.
9053 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9054 correct runtime version.
9056 2004-07-25 Martin Baulig <martin@ximian.com>
9059 (TypeContainer.RegisterOrder): Removed, this was unused.
9060 (TypeContainer, interface_order): Removed.
9061 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9062 TypeContainer as argument since we can also be called with a
9063 `PartialContainer' for a partial class/struct/interface.
9064 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9065 of checking whether we're an `Interface' - we could be a
9067 (PartialContainer.Register): Override; call
9068 AddClass()/AddStruct()/AddInterface() on our parent.
9070 * cs-parser.jay (interface_member_declaration): Add things to the
9071 `current_container', not the `current_class'.
9073 * rootcontext.cs (RegisterOrder): The overloaded version which
9074 takes an `Interface' was unused, removed.
9076 * typemanager.cs (TypeManager.LookupInterface): Return a
9077 `TypeContainer', not an `Interface'.
9078 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9079 contain a `PartialContainer' for an interface, so check it's
9080 `Kind' to figure out what it is.
9082 2004-07-25 Martin Baulig <martin@ximian.com>
9084 * class.cs (Class.DefaultTypeAttributes): New public constant.
9085 (Struct.DefaultTypeAttributes): Likewise.
9086 (Interface.DefaultTypeAttributes): Likewise.
9087 (PartialContainer.TypeAttr): Override this and add the
9088 DefaultTypeAttributes.
9090 2004-07-25 Martin Baulig <martin@ximian.com>
9092 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9093 we can just use the `Parent' field instead.
9095 2004-07-25 Martin Baulig <martin@ximian.com>
9097 * class.cs (TypeContainer.Emit): Renamed to EmitType().
9099 2004-07-25 Martin Baulig <martin@ximian.com>
9101 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9102 our parts before defining any methods.
9103 (TypeContainer.VerifyImplements): Make this virtual.
9104 (ClassPart.VerifyImplements): Override and call VerifyImplements()
9105 on our PartialContainer.
9107 2004-07-25 Martin Baulig <martin@ximian.com>
9109 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9111 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9112 argument, we can just use the `Parent' field instead.
9115 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
9116 (MemberBase.DoDefine): Likewise.
9118 2004-07-24 Martin Baulig <martin@ximian.com>
9120 * decl.cs (MemberCore.Parent): New public field.
9121 (DeclSpace.Parent): Moved to MemberCore.
9123 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9124 (MemberBase.ctor): Added TypeContainer argument, pass it to our
9126 (FieldBase, Field, Operator): Likewise.
9127 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9128 (EventField, Event): Likewise.
9130 2004-07-23 Martin Baulig <martin@ximian.com>
9132 * class.cs (PartialContainer): New public class.
9133 (ClassPart): New public class.
9134 (TypeContainer): Added support for partial classes.
9135 (TypeContainer.GetClassBases): Splitted some of the functionality
9136 out into GetNormalBases() and GetPartialBases().
9138 * cs-tokenizer.cs (Token.PARTIAL): New token.
9139 (Tokenizer.consume_identifier): Added some hacks to recognize
9140 `partial', but only if it's immediately followed by `class',
9141 `struct' or `interface'.
9143 * cs-parser.jay: Added support for partial clases.
9145 2004-07-23 Martin Baulig <martin@ximian.com>
9147 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9148 a `DeclSpace' and also made it readonly.
9149 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9150 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9151 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9153 * cs-parser.jay: Pass the `current_class', not the
9154 `current_container' (at the moment, this is still the same thing)
9155 to a new Method, Property, Event, Indexer or Constructor.
9157 2004-07-23 Martin Baulig <martin@ximian.com>
9159 * cs-parser.jay (CSharpParser): Added a new `current_class' field
9160 and removed the `current_interface' one.
9161 (struct_declaration, class_declaration, interface_declaration):
9162 Set `current_class' to the newly created class/struct/interface;
9163 set their `Bases' and call Register() before parsing their body.
9165 2004-07-23 Martin Baulig <martin@ximian.com>
9167 * class.cs (Kind): New public enum.
9168 (TypeContainer): Made this class abstract.
9169 (TypeContainer.Kind): New public readonly field.
9170 (TypeContainer.CheckDef): New public method; moved here from
9172 (TypeContainer.Register): New public abstract method.
9173 (TypeContainer.GetPendingImplementations): New public abstract
9175 (TypeContainer.GetClassBases): Removed the `is_class' and
9176 `is_iface' parameters.
9177 (TypeContainer.DefineNestedTypes): Formerly known as
9179 (ClassOrStruct): Made this class abstract.
9181 * tree.cs (RootTypes): New public type.
9183 2004-07-20 Martin Baulig <martin@ximian.com>
9185 * tree.cs (Tree.RecordNamespace): Removed.
9186 (Tree.Namespaces): Removed.
9188 * rootcontext.cs (RootContext.IsNamespace): Removed.
9190 * cs-parser.jay (namespace_declaration): Just create a new
9191 NamespaceEntry here.
9193 2004-07-20 Martin Baulig <martin@ximian.com>
9195 * statement.cs (ExceptionStatement): New abstract class. This is
9196 now used as a base class for everyone who's using `finally'.
9197 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
9198 our local variables before using them.
9200 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
9201 virtual method. This is used by Yield.Resolve() to "steal" an
9202 outer block's `finally' clauses.
9203 (FlowBranchingException): The .ctor now takes an ExceptionStatement
9206 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
9207 version which takes an ExceptionStatement. This version must be
9208 used to create exception branchings.
9211 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
9212 (Iterator.EmitMoveNext): Added exception support; protect the
9213 block with a `fault' clause, properly handle 'finally' clauses.
9214 (Iterator.EmitDispose): Run all the `finally' clauses here.
9216 2004-07-20 Martin Baulig <martin@ximian.com>
9218 * iterator.cs: This is the first of a set of changes in the
9219 iterator code. Match the spec more closely: if we're an
9220 IEnumerable, then GetEnumerator() must be called. The first time
9221 GetEnumerator() is called, it returns the current instance; all
9222 subsequent invocations (if any) must create a copy.
9224 2004-07-19 Miguel de Icaza <miguel@ximian.com>
9226 * expression.cs: Resolve the constant expression before returning
9229 2004-07-19 Martin Baulig <martin@ximian.com>
9231 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
9232 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
9233 the return type of the new EmitContext.
9235 2004-07-18 Martin Baulig <martin@ximian.com>
9237 * class.cs (Property.Define): Fix iterators.
9239 * iterators.cs (Iterator.Define): Moved the
9240 `container.AddInterator (this)' call here from the .ctor; only do
9241 it if we resolved successfully.
9243 2004-07-17 Miguel de Icaza <miguel@ximian.com>
9245 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
9246 `true' for preprocessing directives that we parse. The return
9247 value indicates whether we should return to regular tokenizing or
9248 not, not whether it was parsed successfully.
9250 In the past if we were in: #if false ... #line #endif, we would
9251 resume parsing after `#line'. See bug 61604.
9253 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
9254 building: IsEnumType should return true only for enums, not for
9255 enums or System.Enum itself. This fixes #61593.
9257 Likely what happened is that corlib was wrong: mcs depended on
9258 this bug in some places. The bug got fixed, we had to add the
9259 hack, which caused bug 61593.
9261 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
9262 that was a workaround for the older conditions.
9264 2004-07-16 Ben Maurer <bmaurer@ximian.com>
9266 * assign.cs: IAssignMethod has a new interface, as documented
9267 inline. All assignment code now uses this new api.
9269 * ecore.cs, expression.cs: All classes which implement
9270 IAssignMethod now use the new interface.
9272 * expression.cs (Invocation): add a hack to EmitCall so that
9273 IndexerAccess can be the target of a compound assignment without
9274 evaluating its arguments twice.
9276 * statement.cs: Handle changes in Invocation api.
9278 2004-07-16 Martin Baulig <martin@ximian.com>
9280 * iterators.cs: Rewrote this. We're now using one single Proxy
9281 class for both the IEnumerable and the IEnumerator interface and
9282 `Iterator' derives from Class so we can use the high-level API.
9284 * class.cs (TypeContainer.AddIterator): New method.
9285 (TypeContainer.DoDefineType): New protected virtual method, which
9286 is called from DefineType().
9287 (TypeContainer.DoDefineMembers): Call DefineType() and
9288 DefineMembers() on all our iterators.
9289 (TypeContainer.Emit): Call Emit() on all our iterators.
9290 (TypeContainer.CloseType): Call CloseType() on all our iterators.
9292 * codegen.cs (EmitContext.CurrentIterator): New public field.
9294 2004-07-15 Martin Baulig <martin@ximian.com>
9297 (TypeManager.not_supported_exception_type): New type.
9299 2004-07-14 Martin Baulig <martin@ximian.com>
9301 * iterators.cs: Use real error numbers.
9303 2004-07-14 Martin Baulig <martin@ximian.com>
9305 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9306 requires this to be a System.Collection.IEnumerable and not a
9307 class implementing that interface.
9308 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
9310 2004-07-13 Marek Safar <marek.safar@seznam.cz>
9312 * class.cs: Fixed previous fix, it broke some error tests.
9314 2004-07-12 Martin Baulig <martin@ximian.com>
9316 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9319 2004-07-09 Miguel de Icaza <miguel@ximian.com>
9321 * assign.cs (LocalTemporary): Add new argument: is_address,If
9322 `is_address' is true, then the value that we store is the address
9323 to the real value, and not the value itself.
9325 * ecore.cs (PropertyExpr): use the new local temporary
9326 stuff to allow us to handle X.Y += z (where X is a struct)
9328 2004-07-08 Martin Baulig <martin@ximian.com>
9330 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9331 not always return, just like we're doing in Using.Resolve().
9333 2004-07-07 Miguel de Icaza <miguel@ximian.com>
9335 * cs-parser.jay (fixed_statement): flag this as Pinned.
9337 2004-07-06 Miguel de Icaza <miguel@ximian.com>
9339 * typemanager.cs (TypeManager): Removed MakePinned method, this
9340 mechanism is replaced with the .NET 2.x compatible mechanism of
9341 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9343 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
9344 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9345 `IsFixed' property which has a different meaning.
9347 2004-07-02 Raja R Harinath <rharinath@novell.com>
9349 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9350 visible from inside a nested class, not just the names of the
9351 immediately enclosing class.
9354 2004-06-24 Raja R Harinath <rharinath@novell.com>
9356 * expression.cs (BetterConversion): Remove buggy special-case
9357 handling of "implicit constant expression conversions". At this
9358 point, we already know that the conversion is possible -- we're
9359 only checking to see which is better.
9361 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9363 * cs-parser.jay: Added error CS0210 test.
9365 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9367 * cs-parser.jay: Added error CS0134 test.
9369 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9372 * cs-parser.jay: Added error CS0145 test.
9374 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9376 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9378 2004-06-23 Ben Maurer <bmaurer@ximian.com>
9380 * expression.cs (StackAlloc.Resolve): The argument may not
9381 be a constant; deal with this case.
9383 2004-06-23 Marek Safar <marek.safar@seznam.cz>
9385 * attribute.cs (IndexerName_GetIndexerName): Renamed to
9386 GetIndexerAttributeValue.
9387 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9389 * class.cs (Indexer.Define): Added error tests for CS0415,
9392 2004-06-23 Miguel de Icaza <miguel@ximian.com>
9394 * attribute.cs (Attribute.Resolve): Keep field code in sync with
9397 2004-06-23 Martin Baulig <martin@ximian.com>
9399 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9400 neither return nor throw, reset the barrier as well. Fixes #60457.
9402 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
9404 * class.cs : EventAttributes is now set to None by default.
9405 This fixes bug #60459.
9407 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9410 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9411 Don't throw exception but return null (it's sufficient now).
9413 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9415 * typemanager.cs (GetArgumentTypes): Faster implementation.
9417 2004-06-18 Martin Baulig <martin@ximian.com>
9419 * attribute.cs (Attribute.Resolve): Check whether we're an
9420 EmptyCast which a Constant child. Fixes #60333.
9422 2004-06-17 Ben Maurer <bmaurer@ximian.com>
9424 * statement.cs (EmitCollectionForeach): Account for the fact that
9425 not all valuetypes are in areas which we can take the address of.
9426 For these variables, we store to a temporary variable. Also, make
9427 sure that we dont emit a `callvirt' on a valuetype method.
9429 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9431 * expression.cs (StackAlloc.DoReSolve): Added test for
9432 negative parameter (CS0247).
9434 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9437 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9439 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9442 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9445 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9447 Fix bug #58254 & cs1555.cs, cs1556.cs
9448 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9450 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9452 * cs-parser.jay: Added error CS1669 test for indexers.
9454 2004-06-11 Martin Baulig <martin@ximian.com>
9456 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9457 call this twice: for params and varargs methods.
9459 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9462 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9464 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9466 * attribute.cs (Attribute.GetValidTargets): Made public.
9469 (AbstractPropertyEventMethod): New class for better code sharing.
9470 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9472 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9474 2004-06-11 Raja R Harinath <rharinath@novell.com>
9477 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
9478 that the call to Resolve is part of a MemberAccess.
9479 (Expression.Resolve): Use it for SimpleName resolution.
9480 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
9481 Add 'intermediate' boolean argument.
9482 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
9483 error message when the SimpleName can be resolved ambiguously
9484 between an expression and a type.
9485 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
9487 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
9488 call on the left-side.
9490 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9493 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
9495 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9497 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
9499 2004-06-11 Martin Baulig <martin@ximian.com>
9501 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
9502 varargs methods if applicable.
9504 2004-06-11 Martin Baulig <martin@ximian.com>
9506 * expression.cs (Invocation.EmitCall): Don't use
9507 `method.CallingConvention == CallingConventions.VarArgs' since the
9508 method could also have `CallingConventions.HasThis'.
9510 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9512 * class.cs (Event.GetSignatureForError): Implemented.
9513 Fixed crash in error test cs3010.cs
9515 2004-06-10 Miguel de Icaza <miguel@ximian.com>
9517 * cs-tokenizer.cs: Change the way we track __arglist to be
9518 consistent with the other keywords.
9520 2004-06-09 Miguel de Icaza <miguel@ximian.com>
9522 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
9525 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
9527 * codegen.cs: Check that all referenced assemblies have a strongname
9528 before strongnaming the compiled assembly. If not report error CS1577.
9529 Fix bug #56563. Patch by Jackson Harper.
9530 * typemanager.cs: Added a method to return all referenced assemblies.
9531 Fix bug #56563. Patch by Jackson Harper.
9533 2004-06-08 Marek Safar <marek.safar@seznam.cz>
9536 (Method.ApplyAttributeBuilder): Moved and added conditional
9537 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
9540 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
9542 2004-06-08 Marek Safar <marek.safar@seznam.cz>
9545 * class.cs: (EventField.attribute_targets): Changed default target.
9547 2004-06-08 Martin Baulig <martin@ximian.com>
9549 * expression.cs (Invocation.EmitCall): Enable varargs methods.
9551 2004-06-08 Martin Baulig <martin@ximian.com>
9553 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
9555 2004-06-07 Martin Baulig <martin@ximian.com>
9557 Added support for varargs methods.
9559 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
9562 * cs-parser.jay: Added support for `__arglist'.
9564 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
9566 * expression.cs (Argument.AType): Added `ArgList'.
9567 (Invocation): Added support for varargs methods.
9568 (ArglistAccess): New public class.
9569 (Arglist): New public class.
9571 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
9573 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
9574 a method's top-level block if the method has varargs.
9576 * support.cs (ReflectionParameters, InternalParameters): Added
9577 support for varargs methods.
9579 2004-06-07 Miguel de Icaza <miguel@ximian.com>
9581 * class.cs: Provide location in indexer error report.
9583 * driver.cs: Use standard names.
9585 * namespace.cs: Catch the use of using after a namespace has been
9586 declared also on using aliases.
9588 2004-06-03 Raja R Harinath <rharinath@novell.com>
9591 * typemanager.cs (closure_private_ok, closure_invocation_type)
9592 (closure_qualifier_type, closure_invocation_assembly)
9593 (FilterWithClosure): Move to ...
9594 (Closure): New internal nested class.
9595 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
9596 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
9597 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
9598 (MemberLookup, MemberLookupFailed): Use it.
9599 * expression.cs (New.DoResolve): Treat the lookup for the
9600 constructor as being qualified by the 'new'ed type.
9601 (Indexers.GetIndexersForTypeOrInterface): Update.
9603 2004-06-03 Marek Safar <marek.safar@seznam.cz>
9606 (GetConditionalAttributeValue): New method. Returns
9607 condition of ConditionalAttribute.
9608 (SearchMulti): New method. Returns all attributes of type 't'.
9609 Use it when attribute is AllowMultiple = true.
9610 (IsConditionalMethodExcluded): New method.
9613 (Method.IsExcluded): Implemented. Returns true if method has conditional
9614 attribute and the conditions is not defined (method is excluded).
9615 (IMethodData): Extended interface for ConditionalAttribute support.
9616 (PropertyMethod.IsExcluded): Implemented.
9619 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
9622 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
9625 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
9627 * expression.cs (ArrayCreationExpression): Make this just an
9628 `expression'. It can't be a statement, so the code here was
9631 2004-06-02 Marek Safar <marek.safar@seznam.cz>
9634 * typemanager.cs (GetFullNameSignature): New method for
9637 2004-06-02 Marek Safar <marek.safar@seznam.cz>
9640 * class.cs (MemberBase.GetSignatureForError): New virtual method.
9641 Use this method when MethodBuilder is null.
9642 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
9643 Added test for error CS0626 (MONO reports error for this situation).
9644 (IMethodData.GetSignatureForError): Extended interface.
9646 2004-06-01 Marek Safar <marek.safar@seznam.cz>
9649 (AttributeTester.GetObsoleteAttribute): Returns instance of
9650 ObsoleteAttribute when type is obsolete.
9653 (TypeContainer.VerifyObsoleteAttribute): Override.
9654 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9655 (MethodCode.VerifyObsoleteAttribute): Override.
9656 (MemberBase.VerifyObsoleteAttribute): Override.
9659 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9660 and report proper error.
9663 Delegate.VerifyObsoleteAttribute): Override.
9666 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9667 and report proper error.
9668 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9671 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9675 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9676 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9677 Added test for ObsoleteAttribute.
9680 (Catch): Derived from Statement.
9682 2004-06-01 Marek Safar <marek.safar@seznam.cz>
9684 Fixed bug #59071 & cs0160.cs
9686 * statement.cs (Try.Resolve): Check here whether order of catch
9687 clauses matches their dependencies.
9689 2004-05-31 Miguel de Icaza <miguel@ximian.com>
9691 * Reverted patch to namespace.cs (Use lookuptypedirect). This
9692 caused a regression: #59343. Referencing nested classes from an
9693 assembly stopped working.
9695 2004-05-31 Martin Baulig <martin@ximian.com>
9697 MCS is now frozen for beta 2.
9699 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9701 * convert.cs: add a trivial cache for overload operator resolution.
9703 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9705 * decl.cs: If possible, use lookuptypedirect here. We can only do
9706 this if there is no `.' after the namespace. Avoids using
9707 LookupType, which does lots of slow processing.
9708 (FindNestedType) New method, does what it says :-).
9709 * namespace.cs: use LookupTypeDirect.
9710 * rootcontext.cs: use membercache, if possible.
9711 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9713 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9716 According to the spec,
9718 In a member access of the form E.I, if E is a single identifier,
9719 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9720 field, property, localvariable, or parameter with the same type as
9721 the meaning of E as a type-name (§3.8), then both possible
9722 meanings of E are permitted.
9724 We did not check that E as a simple-name had the same type as E as
9727 This trivial check gives us 5-7% on bootstrap time.
9729 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9731 * expression.cs (Invocation.OverloadResolve): Avoid the
9732 use of hashtables and boxing here by allocating on demand.
9734 2004-05-30 Martin Baulig <martin@ximian.com>
9736 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9737 we're doing a silent lookup. Don't try to lookup nested types in
9738 TypeManager.object_type (thanks to Ben Maurer).
9740 2004-05-30 Martin Baulig <martin@ximian.com>
9742 Committing a patch from Ben Maurer.
9744 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9746 2004-05-29 Martin Baulig <martin@ximian.com>
9748 * class.cs (IMethodData.ShouldIgnore): New method.
9750 * typemanager.cs (TypeManager.MethodFlags): Don't take a
9751 `Location' argument, we don't need it anywhere. Use
9752 `IMethodData.ShouldIgnore ()' instead of
9753 `MethodData.GetMethodFlags ()'.
9754 (TypeManager.AddMethod): Removed.
9755 (TypeManager.AddMethod2): Renamed to AddMethod.
9757 2004-05-29 Martin Baulig <martin@ximian.com>
9759 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9761 * convert.cs (Convert.ImplicitReferenceConversion): If we're
9762 converting from a class type S to an interface type and we already
9763 have an object on the stack, don't box it again. Fixes #52578.
9765 2004-05-29 Martin Baulig <martin@ximian.com>
9767 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9768 Added support for `params' parameters. Fixes #59267.
9770 2004-05-29 Martin Baulig <martin@ximian.com>
9772 * literal.cs (NullPointer): Provide a private .ctor which sets
9773 `type' to TypeManager.object_type. Fixes #59048.
9775 2004-05-29 Martin Baulig <martin@ximian.com>
9777 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9778 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
9780 * ecore.cs (EventExpr.instance_expr): Make the field private.
9782 2004-05-26 Marek Safar <marek.safar@seznam.cz>
9784 Fixed bug #50080 & cs0214-2.cs
9785 * expression.cs (Cast.DoResolve): Check unsafe context here.
9787 * statement.cs (Resolve.DoResolve): Likewise.
9789 2004-05-26 Martin Baulig <martin@ximian.com>
9791 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9793 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9794 (RootContext.LookupType): Pass down the `silent' flag.
9796 2004-05-25 Martin Baulig <martin@ximian.com>
9799 (MethodGroupExpr.IdenticalTypeName): New public property.
9800 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9801 expression actually refers to a type.
9803 2004-05-25 Martin Baulig <martin@ximian.com>
9805 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9806 for #56176 and made it actually work.
9808 2004-05-25 Martin Baulig <martin@ximian.com>
9810 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9811 (FieldExpr, PropertyExpr): Override and implement
9812 CacheTemporaries. Fixes #52279.
9814 2004-05-25 Miguel de Icaza <miguel@ximian.com>
9816 * location.cs: In the new compiler listing a file twice is a
9817 warning, not an error.
9819 2004-05-24 Martin Baulig <martin@ximian.com>
9821 * enum.cs (Enum.DefineType): For the `BaseType' to be a
9822 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
9824 2004-05-24 Martin Baulig <martin@ximian.com>
9826 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9827 walking the `using' list. Fixes #53921.
9829 2004-05-24 Martin Baulig <martin@ximian.com>
9831 * const.cs (Const.LookupConstantValue): Added support for
9832 EmptyCast's; fixes #55251.
9834 2004-05-24 Martin Baulig <martin@ximian.com>
9836 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9837 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9838 which does the CS0135 check. The reason is that we first need to
9839 check whether the variable actually exists.
9841 2004-05-24 Martin Baulig <martin@ximian.com>
9843 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9844 than RootContext.LookupType() to find the explicit interface
9847 2004-05-24 Raja R Harinath <rharinath@novell.com>
9849 * Makefile: Simplify. Use executable.make.
9850 * mcs.exe.sources: New file. List of sources of mcs.exe.
9852 2004-05-24 Anders Carlsson <andersca@gnome.org>
9856 Use the invariant culture when doing String.Compare for CLS case
9859 2004-05-23 Martin Baulig <martin@ximian.com>
9861 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9862 don't have any dots. Fixes #52622, added cs0246-8.cs.
9864 * namespace.cs (NamespaceEntry.Lookup): Likewise.
9866 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9868 * class.cs (MemberBase.Define): Reuse MemberType member for
9869 resolved type. Other methods can use it too.
9871 2004-05-23 Martin Baulig <martin@ximian.com>
9873 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9874 the variable also exists in the current block (otherwise, we need
9875 to report a CS0103). Fixes #58670.
9877 2004-05-23 Martin Baulig <martin@ximian.com>
9879 * flowanalysis.cs (Reachability.Reachable): Compute this
9880 on-the-fly rather than storing it as a field.
9882 2004-05-23 Martin Baulig <martin@ximian.com>
9884 * flowanalysis.cs (Reachability.And): Manually compute the
9885 resulting `barrier' from the reachability.
9887 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9890 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9891 instance of ObsoleteAttribute when symbol is obsolete.
9894 (IMethodData): Extended interface for ObsoleteAttribute support.
9896 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9898 * attribute.cs: Fix bug #55970
9900 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9904 (GetObsoleteAttribute): New method. Creates the instance of
9906 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9907 ObsoleteAttribute when member is obsolete.
9908 (AttributeTester.Report_ObsoleteMessage): Common method for
9909 Obsolete error/warning reporting.
9912 (TypeContainer.base_classs_type): New member for storing parent type.
9915 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9916 for this MemberCore.
9918 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9920 * attribute.cs, const.cs: Fix bug #58590
9922 2004-05-21 Martin Baulig <martin@ximian.com>
9924 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9925 out parameters if the end of the method is unreachable. Fixes
9928 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9930 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9931 Hari was right, why extra method.
9933 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9935 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9937 2004-05-20 Martin Baulig <martin@ximian.com>
9939 Merged this back from gmcs to keep the differences to a minumum.
9941 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
9942 instead of a Declspace.
9943 (Attribute.ResolveType): Likewise.
9944 (Attributes.Search): Likewise.
9945 (Attributes.Contains): Likewise.
9946 (Attributes.GetClsCompliantAttribute): Likewise.
9948 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
9950 (MethodData.ApplyAttributes): Take an EmitContext instead of a
9953 2004-05-19 Marek Safar <marek.safar@seznam.cz>
9955 Fix bug #58688 (MCS does not report error when the same attribute
9958 * attribute.cs (Attribute.Emit): Distinction between null and default.
9960 2004-05-19 Raja R Harinath <rharinath@novell.com>
9962 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9963 of a top-level attribute without an attribute target.
9964 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
9966 (Attribute.Conditional_GetConditionName),
9967 (Attribute.Obsolete_GetObsoleteMessage): Update.
9968 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
9969 part of ScanForIndexerName.
9970 (Attribute.CanIgnoreInvalidAttribute): New function.
9971 (Attribute.ScanForIndexerName): Move to ...
9972 (Attributes.ScanForIndexerName): ... here.
9973 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9974 (Attributes.Search): New internal variant that can choose not to
9975 complain if types aren't resolved. The original signature now
9977 (Attributes.GetClsCompliantAttribute): Use internal variant, with
9978 complaints suppressed.
9979 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9980 only if it not useful.
9981 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9982 top-level for attributes that are shared between the assembly
9983 and a top-level class.
9984 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9985 * class.cs: Update to reflect changes.
9986 (DefineIndexers): Fuse loops.
9987 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
9988 a couple more variants of attribute names.
9990 2004-05-18 Marek Safar <marek.safar@seznam.cz>
9992 Fix bug #52585 (Implemented explicit attribute declaration)
9995 (Attributable.ValidAttributeTargets): New abstract method. It gets
9996 list of valid attribute targets for explicit target declaration.
9997 (Attribute.Target): It holds target itself.
9998 (AttributeSection): Removed.
9999 (Attribute.CheckTargets): New method. It checks whether attribute
10000 target is valid for the current element.
10003 (EventProperty): New class. For events that are declared like
10004 property (with add and remove accessors).
10005 (EventField): New class. For events that are declared like field.
10008 * cs-parser.jay: Implemented explicit attribute target declaration.
10010 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
10011 Override ValidAttributeTargets.
10014 (ReturnParameter): Class for applying custom attributes on
10016 (ParameterAtribute): New class. Class for applying custom
10017 attributes on the parameter type.
10019 2004-05-17 Miguel de Icaza <miguel@ximian.com>
10021 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10024 (Method): Allow UNSAFE here.
10026 * modifiers.cs: Support unsafe reporting.
10028 2004-05-17 Marek Safar <marek.safar@seznam.cz>
10030 * decl.cs: Fix bug #58478.
10032 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10034 * statement.cs: When checking for unreachable code on an EmptyStatement,
10035 set the location. Fixes bug #58488.
10037 2004-05-13 Miguel de Icaza <miguel@ximian.com>
10039 * driver.cs: Add -pkg handling.
10041 From Gonzalo: UseShelLExecute=false
10043 2004-05-12 Marek Safar <marek.safar@seznam.cz>
10046 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10048 (Attribute.IsClsCompliaceRequired): Moved to base for better
10050 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10051 when attribute is AttributeUsageAttribute.
10052 (Attribute.GetValidTargets): Simplified.
10053 (Attribute.GetAttributeUsage): New method returns AttributeUsage
10054 attribute for this type.
10055 (Attribute.ApplyAttributes): Method renamed to Emit and make
10057 (GlobalAttributeSection): New class for special handling of global
10058 attributes (assembly, module).
10059 (AttributeSection.Emit): New method.
10061 * class.cs: Implemented Attributable abstract methods.
10062 (MethodCore.LabelParameters): Moved to Parameter class.
10063 (Accessor): Is back simple class.
10064 (PropertyMethod): Implemented Attributable abstract class.
10065 (DelegateMethod): Implemented Attributable abstract class.
10066 (Event): New constructor for disctintion between normal Event
10067 and Event with accessors.
10069 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10071 * codegen.cs, const.cs, decl.cs, delegate.cs:
10072 (CommonAssemblyModulClass): Implemented Attributable abstract class
10075 * enum.cs: Implement IAttributeSupport interface.
10076 (EnumMember): New class for emum members. Implemented Attributable
10080 (ParameterBase): Is abstract.
10081 (ReturnParameter): New class for easier [return:] attribute handling.
10083 * typemanager.cs: Removed builder_to_attr.
10085 2004-05-11 Raja R Harinath <rharinath@novell.com>
10088 * attribute.cs (Attribute.GetPositionalValue): New function.
10089 * class.cs (TypeContainer.VerifyMembers): New function.
10090 (TypeContainer.Emit): Use it.
10091 (ClassOrStruct): New base class for Class and Struct.
10092 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
10093 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10095 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10096 then each non-static field should have a FieldOffset attribute.
10097 Otherwise, none of the fields should have a FieldOffset attribute.
10098 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
10099 and FieldOffset attributes.
10100 * typemanager.cs (TypeManager.struct_layout_attribute_type)
10101 (TypeManager.field_offset_attribute_type): New core types.
10102 (TypeManager.InitCoreTypes): Initialize them.
10104 2004-05-11 Michal Moskal <malekith@pld-linux.org>
10106 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10107 Return correct type.
10110 2004-05-09 Miguel de Icaza <miguel@ximian.com>
10112 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10113 be implicitly converted to ulong.
10115 * expression.cs: The logic for allowing operator &, | and ^ worked
10116 was wrong, it worked before because we did not report an error in
10117 an else branch. Fixes 57895.
10119 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10120 allow volatile fields to be reference types.
10122 2004-05-07 Miguel de Icaza <miguel@ximian.com>
10124 * driver.cs: Add support for /debug-
10126 2004-05-07 Raja R Harinath <rharinath@novell.com>
10128 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
10129 Add a 'complain' parameter to silence errors.
10130 (Attribute.Resolve): Update to changes. Put in sanity check to catch
10131 silently overlooked type-resolutions.
10132 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10133 to reflect changes.
10134 (Attributes.Search): New function.
10135 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10136 (Attributes.GetAttributeFullName): Remove hack.
10137 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
10138 Update to reflect changes.
10139 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10140 Use Attributes.Search instead of nested loops.
10142 2004-05-07 Marek Safar <marek.safar@seznam.cz>
10145 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10146 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10147 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10149 * report.cs: (Report.Warning): Renamed to Warning_T because of
10150 parameter collision.
10152 2004-05-05 Raja R Harinath <rharinath@novell.com>
10154 * expression.cs (MemberAccess.ResolveMemberAccess):
10155 Exit with non-zero status after Report.Error.
10156 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10158 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10160 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10162 * support.cs: Don't hang when the file is empty.
10164 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10166 * support.cs: In SeekableStreamReader, compute the preamble size of the
10167 underlying stream. Position changes should take into account that initial
10170 2004-05-03 Todd Berman <tberman@sevenl.net>
10172 * driver.cs: remove unused GetSysVersion function.
10174 2004-05-03 Todd Berman <tberman@sevenl.net>
10176 * driver.cs: Remove the hack from saturday, as well as the hack
10177 from jackson (LoadAssemblyFromGac), also adds the CWD to the
10178 link_paths to get that bit proper.
10180 2004-05-01 Todd Berman <tberman@sevenl.net>
10182 * driver.cs: Try a LoadFrom before a Load, this checks the current
10183 path. This is currently a bug in mono that is be fixed, however, this
10184 provides a workaround for now. This will be removed when the bug
10187 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
10189 * CryptoConvert.cs: Updated to latest version. Fix issue with
10190 incomplete key pairs (#57941).
10192 2004-05-01 Todd Berman <tberman@sevenl.net>
10194 * driver.cs: Remove '.' from path_chars, now System.* loads properly
10197 2004-04-30 Jackson Harper <jackson@ximian.com>
10199 * codegen.cs: Open keys readonly.
10201 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10203 * typemanager.cs: don't report cyclic struct layout when a struct
10204 contains 2 or more fields of the same type. Failed for Pango.AttrShape
10205 which has 2 Pango.Rectangle fields.
10207 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
10209 * expression.cs: Handle IntPtr comparisons with IL code
10210 rather than a method call.
10212 2004-04-29 Martin Baulig <martin@ximian.com>
10214 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
10215 the list of PropertyInfo's in class hierarchy and find the
10216 accessor. Fixes #56013.
10218 2004-04-29 Martin Baulig <martin@ximian.com>
10220 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10222 2004-04-29 Martin Baulig <martin@ximian.com>
10224 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10226 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10228 2004-04-29 Martin Baulig <martin@ximian.com>
10230 * class.cs (ConstructorInitializer.Resolve): Check whether the
10231 parent .ctor is accessible. Fixes #52146.
10233 2004-04-29 Martin Baulig <martin@ximian.com>
10235 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10237 * statement.cs (Using.EmitLocalVariableDecls): Use
10238 TypeManager.idisposable_type, not typeof (IDisposable).
10239 (Foreach.EmitCollectionForeach): Added support for valuetypes.
10241 2004-04-29 Martin Baulig <martin@ximian.com>
10243 * class.cs (Event.Define): Don't emit the field and don't set
10244 RTSpecialName and SpecialName for events on interfaces. Fixes
10247 2004-04-29 Raja R Harinath <rharinath@novell.com>
10249 Refactor Attribute.ApplyAttributes.
10250 * attribute.cs (Attributable): New base class for objects that can
10251 have Attributes applied on them.
10252 (Attribute): Make AttributeUsage fields public.
10253 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10254 (Attribute.IsInternalCall): New property.
10255 (Attribute.UsageAttr): Convert to a public read-only property.
10256 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10257 (Attribute.ResolveType, Attribute.Resolve)
10258 (Attribute.ScanForIndexerName): Update to reflect changes.
10259 (Attribute.CheckAttributeTarget): Re-format.
10260 (Attribute.ApplyAttributes): Refactor, to various
10261 Attributable.ApplyAttributeBuilder methods.
10262 * decl.cs (MemberCore): Make Attributable.
10263 * class.cs (Accessor): Make Attributable.
10264 (MethodData.ApplyAttributes): Use proper attribute types, not
10266 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10267 (TypeContainer.ApplyAttributeBuilder)
10268 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10269 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
10270 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10271 (Operator.ApplyAttributeBuilder): New factored-out methods.
10272 * const.cs (Const.ApplyAttributeBuilder): Likewise.
10273 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10274 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10275 * parameter.cs (ParameterBase): New Attributable base class
10276 that can also represent Return types.
10277 (Parameter): Update to the changes.
10279 2004-04-29 Jackson Harper <jackson@ximian.com>
10281 * driver.cs: Prefer the corlib system version when looking for
10282 assemblies in the GAC. This is still a hack, but its a better hack
10285 2004-04-29 Marek Safar <marek.safar@seznam.cz>
10287 * decl.cs, enum.cs: Improved error 3005 reporting.
10289 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10290 (related_symbols): New private member for list of symbols
10291 related to reported error/warning.
10293 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10295 2004-04-29 Martin Baulig <martin@ximian.com>
10297 * ecore.cs (Expression.Constantify): If we're an enum and
10298 TypeManager.TypeToCoreType() doesn't give us another type, use
10299 t.UnderlyingSystemType. Fixes #56178.
10301 2004-04-29 Martin Baulig <martin@ximian.com>
10303 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10304 interfaces and for each interface, only add members directly
10305 declared in that interface. Fixes #53255.
10307 2004-04-28 Martin Baulig <martin@ximian.com>
10309 * expression.cs (ConditionalLogicalOperator): Use a temporary
10310 variable for `left' to avoid that we evaluate it more than once;
10313 2004-04-28 Martin Baulig <martin@ximian.com>
10315 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10318 2004-04-28 Martin Baulig <martin@ximian.com>
10320 * statement.cs (LocalInfo.Resolve): Check whether the type is not
10323 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10324 whether the type is not void (CS1547).
10326 2004-04-28 Martin Baulig <martin@ximian.com>
10328 * expression.cs (Unary.DoResolveLValue): Override this and report
10329 CS0131 for anything but Operator.Indirection.
10331 2004-04-28 Martin Baulig <martin@ximian.com>
10333 Committing a patch from Ben Maurer; see bug #50820.
10335 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10338 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10341 2004-04-28 Martin Baulig <martin@ximian.com>
10343 Committing a patch from Ben Maurer; see bug #50820.
10345 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10348 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10351 2004-04-28 Martin Baulig <martin@ximian.com>
10353 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10354 (Block.AddLabel): Call DoLookupLabel() to only search in the
10357 2004-04-28 Martin Baulig <martin@ximian.com>
10359 * cfold.cs (ConstantFold.BinaryFold): Added special support for
10360 comparing StringConstants and NullLiterals in Equality and Inequality.
10362 2004-04-28 Jackson Harper <jackson@ximian.com>
10364 * driver.cs: Attempt to load referenced assemblies from the
10365 GAC. This is the quick and dirty version of this method that
10366 doesnt take into account versions and just takes the first
10367 canidate found. Will be good enough for now as we will not have more
10368 then one version installed into the GAC until I update this method.
10370 2004-04-28 Martin Baulig <martin@ximian.com>
10372 * typemanager.cs (TypeManager.CheckStructCycles): New public
10373 static method to check for cycles in the struct layout.
10375 * rootcontext.cs (RootContext.PopulateTypes): Call
10376 TypeManager.CheckStructCycles() for each TypeContainer.
10377 [Note: We only need to visit each type once.]
10379 2004-04-28 Martin Baulig <martin@ximian.com>
10381 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10383 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10384 success and added `out object value'. Use a `bool resolved' field
10385 to check whether we've already been called rather than
10386 `ConstantValue != null' since this breaks for NullLiterals.
10388 2004-04-28 Raja R Harinath <rharinath@novell.com>
10390 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10391 setting of this flag, since the 'set' method may be non-public.
10393 2004-04-28 Raja R Harinath <rharinath@novell.com>
10395 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10396 check on current_vector.Block.
10398 2004-04-27 Martin Baulig <martin@ximian.com>
10400 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10401 a field initializer. Fixes #56459.
10403 2004-04-27 Martin Baulig <martin@ximian.com>
10405 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10406 we're not attempting to use an indexer. Fixes #52154.
10408 2004-04-27 Martin Baulig <martin@ximian.com>
10410 * statement.cs (Return): Don't create a return label if we don't
10411 need it; reverts my change from January 20th. Thanks to Ben
10414 2004-04-27 Martin Baulig <martin@ximian.com>
10416 According to the spec, `goto' can only leave a nested scope, but
10419 * statement.cs (Block.LookupLabel): Only lookup in the current
10420 block, don't recurse into parent or child blocks.
10421 (Block.AddLabel): Check in parent and child blocks, report
10422 CS0140/CS0158 if we find a duplicate.
10423 (Block): Removed this indexer for label lookups.
10424 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10425 this already does the error reporting for us.
10428 (FlowBranching.UsageVector.Block): New public variable; may be null.
10429 (FlowBranching.CreateSibling): Added `Block' argument.
10430 (FlowBranching.LookupLabel): New public virtual method. Lookup a
10431 label for the target of a `goto' and check whether we're not
10432 leaving a `finally'.
10434 2004-04-27 Martin Baulig <martin@ximian.com>
10436 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10437 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10440 2004-04-27 Martin Baulig <martin@ximian.com>
10442 * statement.cs (Block.AddLabel): Also check for implicit blocks
10443 and added a CS0158 check.
10445 2004-04-27 Martin Baulig <martin@ximian.com>
10447 * flowanalysis.cs (FlowBranchingLoop): New class.
10448 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10449 UsageVector's instead of an ArrayList.
10450 (FlowBranching.Label): Likewise.
10451 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10452 (FlowBranching.AddBreakVector): New method.
10454 2004-04-27 Miguel de Icaza <miguel@ximian.com>
10456 * attribute.cs: Small regression fix: only convert the type if we
10457 the type is different, fixes System.Drawing build.
10459 2004-04-27 Martin Baulig <martin@ximian.com>
10461 * attribute.cs (Attribute.Resolve): If we have a constant value
10462 for a named field or property, implicity convert it to the correct
10465 2004-04-27 Raja R Harinath <rharinath@novell.com>
10467 * statement.cs (Block.Block): Implicit blocks share
10468 'child_variable_names' fields with parent blocks.
10469 (Block.AddChildVariableNames): Remove.
10470 (Block.AddVariable): Mark variable as "used by a child block" in
10471 every surrounding block.
10472 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10473 been used in a child block, complain about violation of "Invariant
10474 meaning in blocks" rule.
10475 * cs-parser.jay (declare_local_variables): Don't use
10476 AddChildVariableNames.
10477 (foreach_statement): Don't create an implicit block: 'foreach'
10478 introduces a scope.
10480 2004-04-23 Miguel de Icaza <miguel@ximian.com>
10482 * convert.cs (ImplicitNumericConversion): 0 is also positive when
10483 converting from 0L to ulong. Fixes 57522.
10485 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10487 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10488 derived class hides via 'new' keyword field from base class (test-242.cs).
10489 TODO: Handle this in the more general way.
10491 * class.cs (CheckBase): Ditto.
10493 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10495 * decl.cs (caching_flags): New member for storing cached values
10497 (MemberCore.Flags): New enum where bit flags for caching_flags
10499 (MemberCore.cls_compliance): Moved to caching_flags.
10500 (DeclSpace.Created): Moved to caching_flags.
10502 * class.cs: Use caching_flags instead of DeclSpace.Created
10504 2004-04-21 Miguel de Icaza <miguel@ximian.com>
10506 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10507 if we are only a derived class, not a nested class.
10509 * typemanager.cs: Same as above, but do this at the MemberLookup
10510 level (used by field and methods, properties are handled in
10511 PropertyExpr). Allow for the qualified access if we are a nested
10514 2004-04-21 Marek Safar <marek.safar@seznam.cz>
10516 * class.cs: Refactoring.
10517 (IMethodData): New inteface; Holds links to parent members
10518 to avoid member duplication (reduced memory allocation).
10519 (Method): Implemented IMethodData interface.
10520 (PropertyBase): New inner classes for get/set methods.
10521 (PropertyBase.PropertyMethod): Implemented IMethodData interface
10522 (Event): New inner classes for add/remove methods.
10523 (Event.DelegateMethod): Implemented IMethodData interface.
10525 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10526 EmitContext (related to class.cs refactoring).
10528 2004-04-21 Raja R Harinath <rharinath@novell.com>
10530 * delegate.cs (Delegate.VerifyApplicability): If the number of
10531 arguments are the same as the number of parameters, first try to
10532 verify applicability ignoring any 'params' modifier on the last
10536 2004-04-16 Raja R Harinath <rharinath@novell.com>
10538 * class.cs (TypeContainer.AddIndexer): Use
10539 'ExplicitInterfaceName' to determine if interface name was
10540 explicitly specified. 'InterfaceType' is not initialized at this time.
10541 (TypeContainer.DefineIndexers): Remove use of temporary list. The
10542 Indexers array is already in the required order. Initialize
10543 'IndexerName' only if there are normal indexers.
10544 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10545 (TypeContainer.Emit): Emit DefaultMember attribute only if
10546 IndexerName is initialized.
10549 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
10551 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10554 2004-04-15 Raja R Harinath <rharinath@novell.com>
10556 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10560 * attribute.cs (Attribute.Resolve): Check for duplicate named
10564 2004-04-15 Miguel de Icaza <miguel@ximian.com>
10566 * iterators.cs (MarkYield): track whether we are in an exception,
10567 and generate code accordingly. Use a temporary value to store the
10568 result for our state.
10570 I had ignored a bit the interaction of try/catch with iterators
10571 since their behavior was not entirely obvious, but now it is
10572 possible to verify that our behavior is the same as MS .NET 2.0
10576 2004-04-14 Miguel de Icaza <miguel@ximian.com>
10578 * iterators.cs: Avoid creating temporaries if there is no work to
10581 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10582 Enumerations, use TypeManager.EnumToUnderlying and call
10585 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10588 (This.Emit): Use EmitContext.EmitThis to emit our
10591 (This.EmitAssign): Ditto.
10593 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10594 codepaths, we will move all the functionality into
10597 (FieldExpr.EmitAssign): Ditto.
10599 This fixes several hidden bugs that I uncovered while doing a code
10600 review of this today.
10602 * codegen.cs (EmitThis): reworked so the semantics are more clear
10603 and also support value types "this" instances.
10605 * iterators.cs: Changed so that for iterators in value types, we
10606 do not pass the value type as a parameter.
10608 Initialization of the enumerator helpers is now done in the caller
10609 instead of passing the parameters to the constructors and having
10610 the constructor set the fields.
10612 The fields have now `assembly' visibility instead of private.
10614 2004-04-11 Miguel de Icaza <miguel@ximian.com>
10616 * expression.cs (Argument.Resolve): Check if fields passed as ref
10617 or out are contained in a MarshalByRefObject.
10619 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10620 another compiler type.
10622 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
10624 * class.cs (Indexer.Define): use the new name checking method.
10625 Also, return false on an error.
10626 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10627 (is_identifier_[start/part]_character): make static.
10629 2004-04-10 Miguel de Icaza <miguel@ximian.com>
10631 * expression.cs (Binary.ResolveOperator): Do no append strings
10632 twice: since we can be invoked more than once (array evaluation)
10633 on the same concatenation, take care of this here. Based on a fix
10634 from Ben (bug #56454)
10636 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10638 * codegen.cs: Fix another case where CS1548 must be reported (when
10639 delay-sign isn't specified and no private is available #56564). Fix
10640 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10641 error when MCS is used on the MS runtime and we need to delay-sign
10642 (which seems unsupported by AssemblyBuilder - see #56621).
10644 2004-04-08 Marek Safar <marek.safar@seznam.cz>
10646 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10647 (TypeManager.ComputeNamespaces): Faster implementation for
10650 * compiler.csproj: Updated AssemblyName to mcs.
10652 2004-04-07 Miguel de Icaza <miguel@ximian.com>
10654 * rootcontext.cs: Add new types to the boot resolution.
10656 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10657 MulticastDelegate is not allowed.
10659 * typemanager.cs: Add new types to lookup: System.TypedReference
10662 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10663 check for TypedReference or ArgIterator, they are not allowed.
10665 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10666 makes us properly catch 1510 in some conditions (see bug 56016 for
10669 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
10671 * CryptoConvert.cs: update from corlib version
10674 2004-04-05 Miguel de Icaza <miguel@ximian.com>
10676 * class.cs (Indexer.Define): Check indexername declaration
10678 2004-04-05 Marek Safar <marek.safar@seznam.cz>
10680 * attribute.cs (IsClsCompliant): Fixed problem with handling
10681 all three states (compliant, not-compliant, undetected).
10683 2004-03-30 Marek Safar <marek.safar@seznam.cz>
10685 * attribute.cs (Attribute): Location is now public.
10686 (Resolve): Store resolved arguments (pos_values) in attribute class.
10687 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10688 (GetClsCompliantAttributeValue): New method that gets
10689 CLSCompliantAttribute value.
10690 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10691 if exists else null.
10692 (AttributeTester): New class for CLS-Compliant verification routines.
10694 * class.cs (Emit): Add CLS-Compliant verification.
10695 (Method.GetSignatureForError): Implemented.
10696 (Constructor.GetSignatureForError): Implemented
10697 (Constructor.HasCompliantArgs): Returns if constructor has
10698 CLS-Compliant arguments.
10699 (Constructor.Emit): Override.
10700 (Construcor.IsIdentifierClsCompliant): New method; For constructors
10701 is needed to test only parameters.
10702 (FieldBase.GetSignatureForError): Implemented.
10703 (TypeContainer): New member for storing base interfaces.
10704 (TypeContainer.FindMembers): Search in base interfaces too.
10706 * codegen.cs (GetClsComplianceAttribute): New method that gets
10707 assembly or module CLSCompliantAttribute value.
10708 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10710 (ModuleClass.Emit): Add error 3012 test.
10712 * const.cs (Emit): Override and call base for CLS-Compliant tests.
10714 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10715 state for all decl types.
10716 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10717 if CLS-Compliant tests are required.
10718 (IsClsCompliaceRequired): New method. Analyze whether code
10719 must be CLS-Compliant.
10720 (IsExposedFromAssembly): New method. Returns true when MemberCore
10721 is exposed from assembly.
10722 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10723 value or gets cached value.
10724 (HasClsCompliantAttribute): New method. Returns true if MemberCore
10725 is explicitly marked with CLSCompliantAttribute.
10726 (IsIdentifierClsCompliant): New abstract method. This method is
10727 used to testing error 3005.
10728 (IsIdentifierAndParamClsCompliant): New method. Common helper method
10729 for identifier and parameters CLS-Compliant testing.
10730 (VerifyClsCompliance): New method. The main virtual method for
10731 CLS-Compliant verifications.
10732 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10733 null. I don't know why is null (too many public members !).
10734 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10735 and get value of first CLSCompliantAttribute that found.
10737 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10738 (VerifyClsCompliance): Override and add extra tests.
10740 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10741 clscheck- disable CLS-Compliant verification event if assembly is has
10742 CLSCompliantAttribute(true).
10744 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10745 ApllyAttribute is now called in emit section as in the other cases.
10746 Possible future Emit integration.
10747 (IsIdentifierClsCompliant): New override.
10748 (VerifyClsCompliance): New override.
10749 (GetEnumeratorName): Returns full enum name.
10751 * parameter.cs (GetSignatureForError): Implemented.
10753 * report.cs (WarningData): New struct for Warning message information.
10754 (LocationOfPreviousError): New method.
10755 (Warning): New method. Reports warning based on the warning table.
10756 (Error_T): New method. Reports error based on the error table.
10758 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10759 verifications are done here.
10761 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10763 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10764 CLSCompliantAttribute.
10765 (all_imported_types): New member holds all imported types from other
10767 (LoadAllImportedTypes): New method fills static table with exported types
10768 from all referenced assemblies.
10769 (Modules): New property returns all assembly modules.
10771 2004-03-30 Miguel de Icaza <miguel@ximian.com>
10773 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10774 throwing a parser error.
10776 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10777 which removes the hardcoded get_/set_ prefixes for properties, as
10778 IL allows for the properties to be named something else.
10782 * expression.cs: Do not override operand before we know if it is
10783 non-null. Fix 56207
10785 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10787 * typemanager.cs: support for pinned variables.
10789 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10791 * decl.cs, typemanager.cs: Avoid using an arraylist
10792 as a buffer if there is only one result set.
10794 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10796 * expression.cs: Make sure you cant call a static method
10797 with an instance expression, bug #56174.
10799 2004-03-29 Miguel de Icaza <miguel@ximian.com>
10801 * class.cs (IsDuplicateImplementation): Improve error reporting to
10802 flag 663 (method only differs in parameter modifier).
10804 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10805 in preprocessor directives.
10807 * location.cs (LookupFile): Allow for the empty path.
10809 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
10810 better approach for some of that patch, but its failing with the
10811 CharSet enumeration. For now try/catch will do.
10813 * typemanager.cs: Do not crash if a struct does not have fields.
10816 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10818 * expression.cs: cs0213, cant fix a fixed expression.
10821 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10823 * cs-parser.jay: detect invalid embeded statements gracefully.
10826 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10828 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10831 the invocation type may not be a subclass of the tye of the item/
10832 The type of the item must be a subclass of the invocation item.
10837 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
10839 * attribute.cs: Added methods to get a string and a bool from an
10840 attribute. Required to information from AssemblyKeyFileAttribute,
10841 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10842 * codegen.cs: Modified AssemblyName creation to include support for
10843 strongnames. Catch additional exceptions to report them as CS1548.
10844 * compiler.csproj: Updated include CryptoConvert.cs.
10845 * compiler.csproj.user: Removed file - user specific configuration.
10846 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
10847 Mono.Security assembly. The original class is maintained and tested in
10848 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10849 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10850 like CSC 8.0 (C# v2) supports.
10851 * Makefile: Added CryptoConvert.cs to mcs sources.
10852 * rootcontext.cs: Added new options for strongnames.
10854 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
10856 * driver.cs: For --expect-error, report error code `2'
10857 if the program compiled with no errors, error code `1' if
10858 it compiled with an error other than the one expected.
10860 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
10862 * compiler.csproj: Updated for Visual Studio .NET 2003.
10863 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10864 * compiler.sln: Updated for Visual Studio .NET 2003.
10866 2004-03-24 Ravi Pratap M <ravi@ximian.com>
10868 * expression.cs: Fix bug #47234. We basically need to apply the
10869 rule that we prefer the conversion of null to a reference type
10870 when faced with a conversion to 'object' (csc behaviour).
10872 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10874 * statement.cs: Shorter form for foreach, eliminates
10875 a local variable. r=Martin.
10877 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10879 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10880 checks if we can use brtrue/brfalse to test for 0.
10881 * expression.cs: use the above in the test for using brtrue/brfalse.
10882 cleanup code a bit.
10884 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10886 * expression.cs: Rewrite string concat stuff. Benefits:
10888 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10889 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10890 rather than a concat chain.
10892 * typemanager.cs: Add lookups for more concat overloads.
10894 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10896 * expression.cs: Emit shorter il code for array init.
10913 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
10915 * statement.cs: Before, two switch blocks would be merged if the
10916 total size of the blocks (end_item - begin_item + 1) was less than
10917 two times the combined sizes of the blocks.
10919 Now, it will only merge if after the merge at least half of the
10924 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
10926 * class.cs : csc build fix for GetMethods(). See bug #52503.
10928 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
10930 * expression.cs: Make sure fp comparisons work with NaN.
10931 This fixes bug #54303. Mig approved this patch a long
10932 time ago, but we were not able to test b/c the runtime
10935 2004-03-19 Miguel de Icaza <miguel@ximian.com>
10937 * ecore.cs (TypExpr.GetHashCode): implement this overload.
10939 2004-03-19 Martin Baulig <martin@ximian.com>
10941 * class.cs (MemberCore.IsDuplicateImplementation): Report the
10942 error here and not in our caller.
10944 2004-03-19 Martin Baulig <martin@ximian.com>
10946 * interface.cs: Completely killed this file.
10947 (Interface): We're now a TypeContainer and live in class.cs.
10949 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10950 argument; we're now also called for interfaces.
10951 (TypeContainer.DefineMembers): Allow this method being called
10953 (TypeContainer.GetMethods): New public method; formerly known as
10954 Interface.GetMethod(). This is used by PendingImplementation.
10955 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10956 it's now private and non-static.
10957 (Interface): Moved this here; it's now implemented similar to
10959 (Method, Property, Event, Indexer): Added `bool is_interface'
10960 argument to their .ctor's.
10961 (MemberBase.IsInterface): New public field.
10963 * cs-parser.jay: Create normal Method, Property, Event, Indexer
10964 instances instead of InterfaceMethod, InterfaceProperty, etc.
10965 (opt_interface_base): Removed; we now use `opt_class_base' instead.
10966 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10968 2004-03-19 Martin Baulig <martin@ximian.com>
10970 * class.cs (MethodCore.IsDuplicateImplementation): New private
10971 method which does the CS0111 checking.
10972 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10973 Use IsDuplicateImplementation().
10975 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
10977 * decl.cs (FindMemberToOverride): New method to find the correct
10978 method or property to override in the base class.
10980 - Make Method/Property use the above method to find the
10981 version in the base class.
10982 - Remove the InheritableMemberSignatureCompare as it is now
10985 This patch makes large code bases much faster to compile, as it is
10986 O(n) rather than O(n^2) to do this validation.
10988 Also, it fixes bug 52458 which is that nested classes are not
10989 taken into account when finding the base class member.
10991 Reviewed/Approved by Martin.
10993 2004-03-17 Marek Safar <marek.safar@seznam.cz>
10995 * interface.cs: In all interface classes removed redundant
10996 member initialization.
10998 2004-03-16 Martin Baulig <martin@ximian.com>
11000 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11002 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11004 * decl.cs (DefineTypeAndParents): New helper method to define a
11005 type's containers before the type itself is defined; This is a
11006 bug exposed by the recent changes to Windows.Forms when an
11007 implemented interface was defined inside a class that had not been
11010 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11012 (Check): Loop correctly to report errors modifiers
11013 (UNSAFE was not in the loop, since it was the same as TOP).
11015 * interface.cs: Every interface member now takes a ModFlags,
11016 instead of a "is_new" bool, which we set on the base MemberCore.
11018 Every place where we called "UnsafeOk" in the interface, now we
11019 call the proper member (InterfaceMethod.UnsafeOK) instead to get
11020 the unsafe settings from the member declaration instead of the
11021 container interface.
11023 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
11025 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11026 `set_indexer_name' to the pending bits (one per type).
11028 We fixed a bug today that was picking the wrong method to
11029 override, since for properties the existing InterfaceMethod code
11030 basically ignored the method name. Now we make sure that the
11031 method name is one of the valid indexer names.
11033 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
11035 * support.cs (SeekableStreamReader): Keep track of stream byte
11036 positions and don't mix them with character offsets to the buffer.
11038 Patch from Gustavo Giráldez
11040 2004-03-15 Marek Safar <marek.safar@seznam.cz>
11042 * interface.cs (InterfaceSetGetBase): Removed double member
11043 initialization, base class does it as well.
11045 2004-03-13 Martin Baulig <martin@ximian.com>
11047 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11048 when compiling corlib.
11050 2004-03-13 Miguel de Icaza <miguel@ximian.com>
11052 * convert.cs (ExplicitConversion): We were reporting an error on
11053 certain conversions (object_type source to a value type, when the
11054 expression was `null') before we had a chance to pass it through
11055 the user defined conversions.
11057 * driver.cs: Replace / and \ in resource specifications to dots.
11060 * class.cs: Add check for duplicate operators. Fixes 52477
11062 2004-03-11 Miguel de Icaza <miguel@ximian.com>
11064 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11065 that are in the middle of the statements, not only at the end.
11068 * class.cs (TypeContainer.AddField): No longer set the
11069 `HaveStaticConstructor' flag, now we call it
11070 `UserDefineStaticConstructor' to diferentiate the slightly
11071 semantic difference.
11073 The situation is that we were not adding BeforeFieldInit (from
11074 Modifiers.TypeAttr) to classes that could have it.
11075 BeforeFieldInit should be set to classes that have no static
11080 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11082 And most importantly Zoltan's comment:
11084 http://bugzilla.ximian.com/show_bug.cgi?id=44229
11086 "I think beforefieldinit means 'it's ok to initialize the type sometime
11087 before its static fields are used', i.e. initialization does not need
11088 to be triggered by the first access to the type. Setting this flag
11089 helps the JIT to compile better code, since it can run the static
11090 constructor at JIT time, and does not need to generate code to call it
11091 (possibly lots of times) at runtime. Unfortunately, mcs does not set
11092 this flag for lots of classes like String.
11094 csc sets this flag if the type does not have an explicit static
11095 constructor. The reasoning seems to be that if there are only static
11096 initalizers for a type, and no static constructor, then the programmer
11097 does not care when this initialization happens, so beforefieldinit
11100 This bug prevents the AOT compiler from being usable, since it
11101 generates so many calls to mono_runtime_class_init that the AOT code
11102 is much slower than the JITted code. The JITted code is faster,
11103 because it does not generate these calls if the vtable is type is
11104 already initialized, which is true in the majority of cases. But the
11105 AOT compiler can't do this."
11107 2004-03-10 Miguel de Icaza <miguel@ximian.com>
11109 * class.cs (MethodData.Emit): Refactor the code so symbolic
11110 information is generated for destructors; For some reasons we
11111 were taking a code path that did not generate symbolic information
11114 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
11116 * class.cs: Create a Constructor.CheckBase method that
11117 takes care of all validation type code. The method
11118 contains some code that was moved from Define.
11120 It also includes new code that checks for duplicate ctors.
11121 This fixes bug #55148.
11123 2004-03-09 Joshua Tauberer <tauberer@for.net>
11125 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11126 a { ... }-style array creation invokes EmitStaticInitializers
11127 which is not good for reference-type arrays. String, decimal
11128 and now null constants (NullCast) are not counted toward
11129 static initializers.
11131 2004-03-05 Martin Baulig <martin@ximian.com>
11133 * location.cs (SourceFile.HasLineDirective): New public field;
11134 specifies whether the file contains or is referenced by a "#line"
11136 (Location.DefineSymbolDocuments): Ignore source files which
11137 either contain or are referenced by a "#line" directive.
11139 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
11141 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11142 direct access to our parent, so check the method inline there.
11144 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
11146 * expression.cs (Invocation.EmitCall): Miguel's last commit
11147 caused a regression. If you had:
11152 In Foo the implict this would be null.
11154 2004-02-27 Miguel de Icaza <miguel@ximian.com>
11156 * expression.cs (Invocation.EmitCall): If the method is not
11157 virtual, do not emit a CallVirt to it, use Call.
11159 * typemanager.cs (GetFullNameSignature): Improve the method to
11160 cope with ".ctor" and replace it with the type name.
11162 * class.cs (ConstructorInitializer.Resolve): Now the method takes
11163 as an argument the ConstructorBuilder where it is being defined,
11164 to catch the recursive constructor invocations.
11166 2004-02-26 Miguel de Icaza <miguel@ximian.com>
11168 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11169 routines to check if a type is an enumerable/enumerator allow
11170 classes that implement the IEnumerable or IEnumerator interfaces.
11172 * class.cs (Property, Operator): Implement IIteratorContainer, and
11173 implement SetYields.
11175 (Property.Define): Do the block swapping for get_methods in the
11176 context of iterators. We need to check if Properties also
11177 include indexers or not.
11179 (Operator): Assign the Block before invoking the
11180 OperatorMethod.Define, so we can trigger the Iterator code
11183 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
11184 Property and Operator classes are not created when we parse the
11185 declarator but until we have the block completed, so we use a
11186 singleton SimpleIteratorContainer.Simple to flag whether the
11187 SetYields has been invoked.
11189 We propagate this setting then to the Property or the Operator to
11190 allow the `yield' to function.
11192 2004-02-25 Marek Safar <marek.safar@seznam.cz>
11194 * codegen.cs: Implemented attribute support for modules.
11195 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11196 Assembly/Module functionality.
11198 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11199 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11200 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11202 2004-02-16 Marek Safar <marek.safar@seznam.cz>
11204 * interface.cs (FindMembers): The operation is performed on all base
11205 interfaces and not only on the first. It is required for future CLS Compliance patch.
11207 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
11209 * statement.cs, codegen.cs:
11210 This patch deals with patterns such as:
11212 public class List : IEnumerable {
11214 public MyEnumerator GetEnumerator () {
11215 return new MyEnumerator(this);
11218 IEnumerator IEnumerable.GetEnumerator () {
11222 public struct MyEnumerator : IEnumerator {
11227 Before, there were a few things we did wrong:
11228 1) we would emit callvirt on a struct, which is illegal
11229 2) we emited ldarg when we needed to emit ldarga
11230 3) we would mistakenly call the interface methods on an enumerator
11231 type that derived from IEnumerator and was in another assembly. For example:
11233 public class MyEnumerator : IEnumerator
11235 Would have the interface methods called, even if there were public impls of the
11236 method. In a struct, this lead to invalid IL code.
11238 2004-02-11 Marek Safar <marek.safar@seznam.cz>
11240 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11243 * delegate.cs (Define): Fixed crash when delegate type is undefined.
11245 2004-02-11 Miguel de Icaza <miguel@ximian.com>
11247 * cs-parser.jay: Fix small regression: we were not testing V2
11248 compiler features correctly.
11250 * interface.cs: If the emit context is null, then create one
11252 2004-02-09 Marek Safar <marek.safar@seznam.cz>
11254 * decl.cs (GetSignatureForError): New virtual method to get full name
11255 for error messages.
11257 * attribute.cs (IAttributeSupport): New interface for attribute setting.
11258 Now it is possible to rewrite ApplyAttributes method to be less if/else.
11260 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11261 Duplicated members and code in these classes has been removed.
11262 Better encapsulation in these classes.
11264 2004-02-07 Miguel de Icaza <miguel@ximian.com>
11266 * assign.cs (Assign.DoResolve): When dealing with compound
11267 assignments, there is a new rule in ECMA C# 2.4 (might have been
11268 there before, but it is documented here) that states that in:
11272 If b is of type int, and the `op' is a shift-operator, then the
11273 above is evaluated as:
11277 * expression.cs (Binary.ResolveOperator): Instead of testing for
11278 int/uint/long/ulong, try to implicitly convert to any of those
11279 types and use that in pointer arithmetic.
11281 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11282 method to print information for from the type, not from the
11283 null-method we were given.
11285 2004-02-01 Duncan Mak <duncan@ximian.com>
11287 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11288 parsing for cmd, fixes bug #53694.
11290 2004-02-04 Marek Safar <marek.safar@seznam.cz>
11292 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11293 in the member name duplication tests. Property and operator name duplication
11294 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11296 2004-02-03 Marek Safar <marek.safar@seznam.cz>
11298 * interface.cs (PopulateMethod): Fixed crash when interface method
11299 returns not existing type (error test cs0246-3.cs).
11301 2004-02-02 Ravi Pratap M <ravi@ximian.com>
11303 * cs-parser.jay (interface_accessors): Re-write actions to also
11304 store attributes attached to get and set methods. Fix spelling
11307 (inteface_property_declaration): Modify accordingly.
11309 (InterfaceAccessorInfo): New helper class to store information to pass
11310 around between rules that use interface_accessors.
11312 * interface.cs (Emit): Apply attributes on the get and set
11313 accessors of properties and indexers too.
11315 * attribute.cs (ApplyAttributes): Modify accordingly to use the
11316 right MethodBuilder when applying attributes to the get and set accessors.
11318 2004-01-31 Miguel de Icaza <miguel@ximian.com>
11320 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11322 2004-01-26 Miguel de Icaza <miguel@ximian.com>
11324 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11326 2004-01-25 Miguel de Icaza <miguel@ximian.com>
11328 * cs-parser.jay: Remove YIELD token, instead use the new grammar
11329 changes that treat `yield' specially when present before `break'
11330 or `return' tokens.
11332 * cs-tokenizer.cs: yield is no longer a keyword.
11334 2004-01-23 Marek Safar <marek.safar@seznam.cz>
11336 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11337 setting for default constructors.
11338 For default constructors are almost every time set wrong Modifier. The
11339 generated IL code has been alright. But inside mcs this values was
11340 wrong and this was reason why several of my CLS Compliance tests
11343 2004-01-22 Martin Baulig <martin@ximian.com>
11345 * cs-parser.jay (namespace_or_type_name): Return an Expression,
11346 not a QualifiedIdentifier. This is what `type_name_expression'
11347 was previously doing.
11348 (type_name_expression): Removed; the code is now in
11349 `namespace_or_type_name'.
11350 (qualified_identifier): Removed, use `namespace_or_type_name'
11352 (QualifiedIdentifier): Removed this class.
11354 2004-01-22 Martin Baulig <martin@ximian.com>
11356 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11357 not a string as alias name.
11359 2004-01-21 Miguel de Icaza <miguel@ximian.com>
11361 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11362 #52730 bug, and instead compute correctly the need to use a
11363 temporary variable when requesting an address based on the
11364 static/instace modified of the field and the constructor.
11366 2004-01-21 Martin Baulig <martin@ximian.com>
11368 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11369 class and namespace before looking up aliases. Fixes #52517.
11371 2004-01-21 Martin Baulig <martin@ximian.com>
11373 * flowanalysis.cs (UsageVector.Merge): Allow variables being
11374 assinged in a 'try'; fixes exception4.cs.
11376 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11377 * class.cs : Implemented parameter-less constructor for TypeContainer
11379 * decl.cs: Attributes are now stored here. New property OptAttributes
11381 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11383 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11385 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11387 * typemanager.cs (CSharpSignature): Now reports also inner class name.
11388 (CSharpSignature): New method for indexer and property signature.
11390 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11392 * pending.cs (IsVirtualFilter): Faster implementation.
11394 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11396 * typemanager.cs: Avoid inclusion of same assembly more than once.
11398 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11400 * cs-parser.jay: Fixed problem where the last assembly attribute
11401 has been applied also to following declaration (class, struct, etc.)
11403 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11405 * class.cs: Added error CS0538, CS0539 reporting.
11406 Fixed crash on Microsoft runtime when field type is void.
11408 * cs-parser.jay: Added error CS0537 reporting.
11410 * pending.cs: Added error CS0535 reporting.
11411 Improved error report for errors CS0536, CS0534.
11413 2004-01-20 Miguel de Icaza <miguel@ximian.com>
11415 Merge a few bits from the Anonymous Method MCS tree.
11417 * statement.cs (ToplevelBlock): New class for toplevel methods,
11418 will hold anonymous methods, lifted variables.
11420 * cs-parser.jay: Create toplevel blocks for delegates and for
11421 regular blocks of code.
11423 2004-01-20 Martin Baulig <martin@ximian.com>
11425 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11426 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11427 and `NeedExplicitReturn'; added `IsLastStatement'.
11428 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11429 have a `ReturnLabel' or we're not unreachable.
11431 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11432 child's reachability; don't just override ours with it. Fixes
11433 #58058 (lluis's example).
11434 (FlowBranching): Added public InTryOrCatch(), InCatch(),
11435 InFinally(), InLoop(), InSwitch() and
11436 BreakCrossesTryCatchBoundary() methods.
11438 * statement.cs (Return): Do all error checking in Resolve().
11439 Unless we are the last statement in a top-level block, always
11440 create a return label and jump to it.
11441 (Break, Continue): Do all error checking in Resolve(); also make
11442 sure we aren't leaving a `finally'.
11443 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11444 statement in a top-level block.
11445 (Block.Flags): Added `IsDestructor'.
11446 (Block.IsDestructor): New public property.
11448 2004-01-20 Martin Baulig <martin@ximian.com>
11450 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11452 2004-01-20 Martin Baulig <martin@ximian.com>
11454 * statement.cs (Statement.ResolveUnreachable): New public method.
11455 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11456 (Block.Resolve): Resolve unreachable statements.
11458 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11460 * expression.cs: We need to fix the case where we do
11461 not have a temp variable here.
11463 * assign.cs: Only expression compound assignments need
11464 temporary variables.
11466 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11468 * flowanalysis.cs: Reduce memory allocation in a few ways:
11469 - A block with no variables should not allocate a bit
11471 - A method with no out parameters does not need any tracking
11472 for assignment of the parameters, so we need not allocate
11475 public readonly Type[] VariableTypes;
11476 public readonly string[] VariableNames;
11477 Are redundant. The data is already stored in the variable
11478 map, so we need not allocate another array for it.
11479 - We need to add alot of checks for if (params | locals) == null
11480 due to the first two changes.
11482 2004-01-18 Miguel de Icaza <miguel@ximian.com>
11484 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11485 implement IMemoryLocation, we store a copy on a local variable and
11486 take the address of it. Patch from Benjamin Jemlich
11488 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11489 to use a special "type_name_expression" rule which reduces the
11490 number of "QualifiedIdentifier" classes created, and instead
11491 directly creates MemberAccess expressions.
11493 2004-01-17 Miguel de Icaza <miguel@ximian.com>
11495 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11496 that fixes #52853. Null literal assignment to ValueType
11498 * class.cs (MethodData.Emit): Instead of checking the name of the
11499 method to determine if its a destructor, create a new derived
11500 class from Method called Destructor, and test for that.
11502 * cs-parser.jay: Create a Destructor object instead of a Method.
11504 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11508 2004-01-16 Miguel de Icaza <miguel@ximian.com>
11510 * expression.cs (Binary.ResolveOperator): Perform an implicit
11511 conversion from MethodGroups to their delegate types on the
11512 Addition operation.
11514 * delegate.cs: Introduce a new class DelegateCreation that is the
11515 base class for `NewDelegate' and `ImplicitDelegateCreation',
11516 factor some code in here.
11518 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11519 conversion from MethodGroups to compatible delegate types.
11521 * ecore.cs (Expression.Resolve): Do not flag error 654
11522 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11523 we allow conversions from MethodGroups to delegate types now.
11525 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11526 assignments in v2 either.
11528 2004-01-10 Miguel de Icaza <miguel@ximian.com>
11530 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11531 static read-only fields in ctors.
11533 Applied patch from Benjamin Jemlich
11535 * expression.cs (UnaryMutator): Avoid leaking local variables.
11537 2004-01-09 Miguel de Icaza <miguel@ximian.com>
11539 * cs-tokenizer.cs (IsCastToken): Allow the various native types
11540 here to return true, as they can be used like this:
11542 (XXX) int.MEMBER ()
11544 Fixed 49836 and all the other dups
11546 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
11548 * driver.cs: Implement /win32res and /win32icon.
11550 2004-01-08 Miguel de Icaza <miguel@ximian.com>
11552 * cs-parser.jay: Add a rule to improve error handling for the
11553 common mistake of placing modifiers after the type.
11555 2004-01-07 Miguel de Icaza <miguel@ximian.com>
11557 * cs-parser.jay (interface_event_declaration): Catch
11558 initialization of events on interfaces, and report cs0068
11560 * cs-parser.jay (interface_event_declaration): Catch
11561 initialization of events.
11563 * ecore.cs: Better report missing constructors.
11565 * expression.cs (Binary.ResolveOperator): My previous bug fix had
11566 the error reporting done in the wrong place. Fix.
11568 * expression.cs (Binary.ResolveOperator): Catch the
11569 operator + (E x, E y) error earlier, and later allow for implicit
11570 conversions in operator +/- (E e, U x) from U to the underlying
11573 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11574 52596, if the container class is abstract, the default constructor
11575 is protected otherwise its public (before, we were always public).
11577 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11580 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11581 Jemlich that fixes bug #52597, MCS was generating invalid code for
11582 idisposable structs. Thanks to Ben for following up with this
11585 2004-01-06 Miguel de Icaza <miguel@ximian.com>
11587 * driver.cs: Allow assemblies without code to be generated, fixes
11590 2004-01-07 Nick Drochak <ndrochak@gol.com>
11592 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11594 2004-01-05 Miguel de Icaza <miguel@ximian.com>
11596 * cs-parser.jay: Add rules to improve error reporting if fields or
11597 methods are declared at the namespace level (error 116)
11599 * Add rules to catch event add/remove
11601 2004-01-04 David Sheldon <dave-mono@earth.li>
11603 * expression.cs: Added matching ")" to error message for
11606 2004-01-03 Todd Berman <tberman@gentoo.org>
11608 * ecore.cs, attribute.cs:
11609 Applying fix from #52429.
11611 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11613 * ecore.cs, expression.cs, statement.cs:
11614 Total rewrite of how we handle branching. We
11615 now handle complex boolean expressions with fewer
11616 jumps. As well if (x == 0) no longer emits a ceq.
11618 if (x is Foo) is much faster now, because we generate
11621 Overall, we get a pretty big improvement on our benchmark
11622 tests. The code we generate is smaller and more readable.
11624 I did a full two-stage bootstrap. The patch was reviewed
11625 by Martin and Miguel.
11627 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11629 * cs-parser.jay: Make primary_expression not take a QI.
11630 we dont need this because the member_access rule covers
11631 us here. So we replace the rule with just IDENTIFIER.
11633 This has two good effects. First, we remove a s/r conflict.
11634 Second, we allocate many fewer QualifiedIdentifier objects.
11636 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11638 * attribute.cs: Handle MarshalAs attributes as pseudo, and
11639 set the correct information via SRE. This prevents
11640 hanging on the MS runtime. Fixes #29374.
11642 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11644 * convert.cs: correctly handle conversions to value types
11645 from Enum and ValueType as unboxing conversions.
11647 Fixes bug #52569. Patch by Benjamin Jemlich.
11649 2004-01-02 Ravi Pratap <ravi@ximian.com>
11651 * expression.cs (BetterConversion): Prefer int -> uint
11652 over int -> ulong (csc's behaviour). This fixed bug #52046.
11654 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
11656 * decl.cs (MemberCache.FindMembers): now returns a
11659 * typemanager.cs: In general, go with with ^^.
11660 (CopyNewMethods): take an IList.
11661 (RealMemberLookup): Only allocate an arraylist
11662 if we copy from two sets of methods.
11664 This change basically does two things:
11665 1) Fewer array lists allocated due to CopyNewMethods.
11666 2) the explicit cast in MemberList costed ALOT.
11668 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
11670 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11671 a hashtable to avoid needless string allocations when an identifier is
11672 used more than once (the common case).
11674 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11676 * pending.cs: MS's TypeBuilder.GetInterfaces ()
11677 is broken, it will not return anything. So, we
11678 have to use the information we have in mcs to
11681 * typemanager.cs: Add a cache for GetInterfaces,
11682 since this will now be used more often (due to ^^)
11684 (GetExplicitInterfaces) New method that gets the
11685 declared, not effective, interfaces on a type
11686 builder (eg, if you have interface IFoo, interface
11687 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11690 This patch makes MCS able to bootstrap itself on
11693 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11695 * expression.cs: Remove the Nop's that Miguel put
11698 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11700 * report.cs, codegen.cs: Give the real stack trace to
11701 the error when an exception is thrown.
11703 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11705 * decl.cs: only allocate hashtables for ifaces if
11708 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11710 * expression.cs: fix the error from cs0121-2.cs
11711 (a parent interface has two child interfaces that
11712 have a function with the same name and 0 params
11713 and the function is called through the parent).
11715 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
11717 * class.cs, rootcontext.cs, typmanager.cs: do not
11720 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
11722 * codegen.cs: remove stack for the ec flow branching.
11723 It is already a linked list, so no need.
11725 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
11727 * Makefile: Allow custom profiler here.
11729 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11731 * typemanager.cs (LookupType):
11732 - Use a static char [], because split takes
11733 a param array for args, so it was allocating
11735 - Do not store true in a hashtable, it boxes.
11737 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11739 * flowanalysis.cs: bytify common enums.
11741 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11743 * modifiers.cs: Add a new set of flags for the
11744 flags allowed on explicit interface impls.
11745 * cs-parser.jay: catch the use of modifiers in
11746 interfaces correctly.
11747 * class.cs: catch private void IFoo.Blah ().
11749 All related to bug #50572.
11751 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11753 * decl.cs: Rewrite the consistant accessability checking.
11754 Accessability is not linear, it must be implemented in
11755 a tableish way. Fixes #49704.
11757 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11759 * expression.cs: Handle negation in a checked context.
11760 We must use subtraction from zero. Fixes #38674.
11762 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11764 * class.cs: Ignore static void main in DLLs.
11765 * rootcontext.cs: Handle the target type here,
11766 since we are have to access it from class.cs
11767 * driver.cs: account for the above.
11769 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11771 * report.cs: Give line numbers and files if available.
11773 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
11775 * driver.cs: Implement /addmodule.
11777 * typemanager.cs: Change 'modules' field so it now contains Modules not
11780 2003-12-20 Martin Baulig <martin@ximian.com>
11782 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11783 (FieldBase.IsAssigned): Removed this field.
11784 (FieldBase.SetAssigned): New public method.
11785 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11787 2003-12-20 Martin Baulig <martin@ximian.com>
11789 * expression.cs (LocalVariableReference.DoResolve): Don't set
11790 `vi.Used' if we're called from DoResolveLValue().
11792 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11793 returns the usage vector it just merged into the current one -
11794 pass this one to UsageWarning().
11795 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11796 of the `EmitContext', don't call this recursively on our children.
11798 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
11800 * driver.cs: Implement /target:module.
11802 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
11804 * support.cs (CharArrayHashtable): New helper class.
11806 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
11807 char arrays, not strings, so we can avoid creating a string in
11808 consume_identifier if the identifier is a keyword.
11810 2003-12-16 Martin Baulig <martin@ximian.com>
11812 * statement.cs (LocalInfo.Assigned): Removed this property.
11813 (LocalInfo.Flags): Removed `Assigned'.
11814 (LocalInfo.IsAssigned): New public method; takes the EmitContext
11815 and uses flow analysis.
11816 (Block.UsageWarning): Made this method private.
11817 (Block.Resolve): Call UsageWarning() if appropriate.
11819 * expression.cs (LocalVariableReference.DoResolve): Always set
11820 LocalInfo.Used here.
11822 2003-12-13 Martin Baulig <martin@ximian.com>
11824 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11825 any value here; we're now using flow analysis to figure out
11826 whether a statement/block returns a value.
11828 2003-12-13 Martin Baulig <martin@ximian.com>
11830 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11832 (FlowBranching.MergeFinally): Don't call
11833 `branching.CheckOutParameters()' here, this is called in
11835 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11836 when adding the `finally' vector.
11838 2003-12-13 Martin Baulig <martin@ximian.com>
11841 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11842 actually work and also fix #48962.
11844 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
11846 * decl.cs: Do not check System.Object for nested types,
11847 since we know it does not have any. Big bang for buck:
11850 Run 1: 8.35 seconds
11851 Run 2: 8.32 seconds
11852 corlib: 17.99 seconds
11854 Run 1: 8.17 seconds
11855 Run 2: 8.17 seconds
11856 corlib: 17.39 seconds
11858 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
11860 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11861 time we are returning 0 members, so we save alot here.
11863 2003-12-11 Martin Baulig <martin@ximian.com>
11865 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11866 `MergeChild()', also just take the `FlowBranching' as argument;
11867 call Merge() on it and return the result.
11868 (FlowBranching.Merge): We don't need to do anything if we just
11871 2003-12-11 Martin Baulig <martin@ximian.com>
11873 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11874 them in an `ArrayList' to reduce memory usage. Thanks to Ben
11875 Maurer for this idea.
11877 2003-12-11 Martin Baulig <martin@ximian.com>
11879 * flowanalysis.cs (MergeResult): This class is now gone; we now
11880 use the `UsageVector' for this. The reason for this is that if a
11881 branching just has one sibling, we don't need to "merge" them at
11882 all - that's the next step to do.
11883 (FlowBranching.Merge): We now return a `UsageVector' instead of a
11886 2003-12-11 Martin Baulig <martin@ximian.com>
11888 Reworked flow analyis and made it more precise and bug-free. The
11889 most important change is that we're now using a special `Reachability'
11890 class instead of having "magic" meanings of `FlowReturns'. I'll
11891 do some more cleanups and optimizations and also add some more
11892 documentation this week.
11894 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11895 largely reworked this class.
11896 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11897 the new `Reachability' class instead of having "magic" values here.
11898 (FlowBranching): We're now using an instance of `Reachability'
11899 instead of having separate `Returns', `Breaks' etc. fields.
11901 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11902 based on flow analysis; ignore the return value of block.Emit ().
11904 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
11906 * driver.cs typemanager.cs: Find the mono extensions to corlib even
11907 if they are private.
11909 2003-12-09 Martin Baulig <martin@ximian.com>
11911 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11912 call them directly on the UsageVector.
11914 2003-12-09 Martin Baulig <martin@ximian.com>
11916 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11917 Changed return type from `FlowReturns' to `Reachability'.
11919 2003-12-09 Martin Baulig <martin@ximian.com>
11921 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11922 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11923 `Reachable' fields with a single `Reachability' one.
11925 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11927 * class.cs (FindMembers): Remove foreach's.
11932 Run 1: 8.74 seconds
11933 Run 2: 8.71 seconds
11936 Run 1: 8.64 seconds
11937 Run 2: 8.58 seconds
11940 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11945 This patch does a few things:
11946 1. EmptyStatement is now a singleton, so it is never reallocated.
11947 2. All blah is EmptyStatement constructs have been changed to
11948 blah == EmptyStatement.Value, which is much faster and valid
11949 now that EmptyStatement is a singleton.
11950 3. When resolving a block, rather than allocating a new array for
11951 the non-empty statements, empty statements are replaced with
11952 EmptyStatement.Value
11953 4. Some recursive functions have been made non-recursive.
11954 Mainly the performance impact is from (3), however (1) and (2) are needed for
11955 this to work. (4) does not make a big difference in normal situations, however
11956 it makes the profile look saner.
11961 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11962 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11963 Total memory allocated: 56397 KB
11966 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11967 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11968 Total memory allocated: 55666 KB
11970 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11972 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11973 than the hashtable in a hashtable version
11975 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11976 we always end up concating a string. This results in a huge perf
11977 loss, because many strings have to be tracked by the GC. In this
11978 patch, we first use a hashtable that works with two keys, so that
11979 the strings do not need to be concat'ed.
11983 Run 1: 8.74 seconds
11984 Run 2: 8.71 seconds
11987 Run 1: 8.65 seconds
11988 Run 2: 8.56 seconds
11990 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11992 * Makefile: Add a new target `do-time' that does a quick and simple
11993 profile, leaving easy to parse output.
11995 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
11997 * codegen.cs (Init): Create the dynamic assembly with
11998 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12000 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
12002 * support.cs: Make the PtrHashtable use only one
12003 instance of its comparer.
12005 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
12007 * typemanager.cs: Fix lookup of GetNamespaces.
12009 2003-11-29 Miguel de Icaza <miguel@ximian.com>
12011 * expression.cs: Removed redundant line.
12013 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12014 ArrayLists, use for loops with bounds.
12016 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12019 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12020 arraylists, use for loop with bounds.
12022 The above three changes give us a 0.071 second performance
12023 improvement out of 3.294 seconds down to 3.223. On my machine
12024 the above changes reduced the memory usage by 1,387 KB during
12025 compiler bootstrap.
12027 * cs-parser.jay (QualifiedIdentifier): New class used to represent
12028 QualifiedIdentifiers. Before we created a new string through
12029 concatenation, and mostly later on, the result would be
12030 manipulated by DecomposeQI through string manipulation.
12032 This reduced the compiler memory usage for bootstrapping from
12033 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12034 compile times in 0.05 seconds.
12036 2003-11-28 Dick Porter <dick@ximian.com>
12038 * support.cs: Do string compares with the Invariant culture.
12046 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12047 the comparison is done with the Invariant culture.
12049 2003-11-27 Miguel de Icaza <miguel@ximian.com>
12051 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12052 GetEnumerator method.
12054 (ProbeCollectionType): Iterate starting at the most specific type
12055 upwards looking for a GetEnumerator
12057 * expression.cs: Shift count can be up to 31 for int/uint and 63
12060 2003-11-26 Miguel de Icaza <miguel@ximian.com>
12062 * statement.cs (Block.LookupLabel): Also look for the label on the
12063 children blocks. Use a hash table to keep track of visited
12066 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12067 we actually did transform the other operand, otherwise fall back
12068 to the common codepath that casts to long.
12070 * cs-tokenizer.cs: Use the same code pattern as the int case.
12071 Maybe I should do the parsing myself, and avoid depending on the
12072 Parse routines to get this done.
12074 2003-11-25 Miguel de Icaza <miguel@ximian.com>
12076 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12077 which fixes bug 51347. This time test it.
12079 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12080 attributes for example can not tell the difference between these.
12081 The difference was only a syntax feature of the language.
12083 * attribute.cs: Apply attributes to delegates.
12085 * delegate.cs: Call the apply attributes method.
12087 2003-11-24 Miguel de Icaza <miguel@ximian.com>
12089 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12090 comparing 0 vs Byte.MinValue, not the value
12092 (ImplicitConversionRequired): When reporting a conversion error,
12093 use error 31 to print out the constant error instead of the
12096 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12097 which fixes bug 51347.
12099 2003-11-22 Miguel de Icaza <miguel@ximian.com>
12101 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
12102 which fixes the -warnaserror command line option.
12104 2003-11-21 Miguel de Icaza <miguel@ximian.com>
12106 * cfold.cs (DoNumericPromotions): During constant folding of
12107 additions on UIntConstant, special case intconstants with
12108 IntConstants like we do on the expression binary operator.
12110 2003-11-12 Miguel de Icaza <miguel@ximian.com>
12112 * convert.cs (ImplicitReferenceConversion): We were missing a case
12113 (System.Enum are not value types or class types, so we need to
12114 classify them separatedly).
12116 * driver.cs: We do not support error 2007.
12118 2003-11-12 Jackson Harper <jackson@ximian.com>
12120 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12121 system directory. Also use the full file name so users can
12122 libraries names mscorlib-o-tron.dll in a non system dir.
12124 2003-11-10 Martin Baulig <martin@ximian.com>
12126 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12127 (TypeManager.InitCoreTypes): Initialize them here, but instead of
12128 calling `ResolveType()' on them, directly assign their `Type'.
12130 2003-11-08 Martin Baulig <martin@ximian.com>
12132 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12133 return value and the `out parent' parameter.
12134 (TypeContainer.DefineType): Moved the CS0644 check into
12135 GetClassBases(). Don't pass the interface types to the
12136 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12137 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12139 * ecore.cs (TypeExpr.IsAttribute): New property.
12140 (TypeExpr.GetInterfaces): New method.
12142 * interface.cs (Interface.GetInterfaceTypeByName): Return a
12143 TypeExpr instead of a Type.
12144 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12145 (Interface.DefineType): Don't pass the interface types to the
12146 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12147 them later and then call `TypeBulider.AddInterfaceImplementation()'.
12149 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12150 instead of a `Type[]'.
12151 (TypeManager.RegisterBuilder): Likewise.
12152 (TypeManager.AddUserInterface): Likewise.
12153 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12154 `Type[]' and also return a `TypeExpr[]'.
12155 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12157 2003-11-08 Martin Baulig <martin@ximian.com>
12159 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12162 2003-11-08 Martin Baulig <martin@ximian.com>
12164 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12165 TypeManager.ResolveExpressionTypes().
12167 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12168 instead of an Expression.
12169 (TypeExpr): This is now an abstract base class for `TypeExpression'.
12170 (TypeExpression): New public class; formerly known as `TypeExpr'.
12172 * expression.cs (ComposedCast): Derive from TypeExpr.
12174 * typemanager.cs (TypeManager.system_*_expr): These are now
12175 TypExpr's instead of Expression's.
12176 (TypeManager.ResolveExpressionTypes): New public static function;
12177 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12180 2003-11-06 Miguel de Icaza <miguel@ximian.com>
12182 * expression.cs (New.DoResolve): Do not dereference value that
12183 might be a null return.
12185 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12186 sure that the constant value has the right type. Fixes an
12187 unreported bug, similar to 50425.
12189 * const.cs (Const.LookupConstantValue): Call
12190 ImplicitStandardConversionExists before doing a conversion to
12191 avoid havng the TypeManager.ChangeType do conversions.
12193 Reduced the number of casts used
12195 (Const.ChangeType): New routine to enable reuse of the constant
12196 type changing code from statement.
12198 * typemanager.cs (ChangeType): Move common initialization to
12199 static global variables.
12203 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12204 every value type to go through, even if it was void. Fix that.
12206 * cs-tokenizer.cs: Use is_identifier_start_character on the start
12207 character of the define, and the is_identifier_part_character for
12208 the rest of the string.
12210 2003-11-05 Miguel de Icaza <miguel@ximian.com>
12212 * expression.cs (UnaryMutator.EmitCode): When I updated
12213 LocalVariableReference.DoResolve, I overdid it, and dropped an
12214 optimization done on local variable references.
12216 2003-11-04 Miguel de Icaza <miguel@ximian.com>
12218 * ecore.cs: Convert the return from Ldlen into an int.
12220 2003-10-20 Miguel de Icaza <miguel@ximian.com>
12222 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12223 the accessibility, this is a special case for toplevel non-public
12224 classes (internal for instance).
12226 2003-10-20 Nick Drochak <ndrochak@gol.com>
12228 * ecore.cs: Fix typo and build. Needed another right paren.
12230 2003-10-19 Miguel de Icaza <miguel@ximian.com>
12232 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
12233 `internal' case regular and protected, but not allowing protected
12234 to be evaluated later. Bug 49840
12236 2003-10-15 Miguel de Icaza <miguel@ximian.com>
12238 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12239 to kb.Nlast, and not the kb.nFirst to isolate the switch
12242 Extract the underlying type, so enumerations of long/ulong are
12243 treated like long/ulong.
12245 2003-10-14 Miguel de Icaza <miguel@ximian.com>
12247 * expression.cs (New): Overload the meaning of RequestedType to
12248 track the possible creation of the NewDelegate type, since
12249 DoResolve is invoked more than once for new constructors on field
12252 See bugs: #48800 and #37014
12254 * cs-parser.jay (declare_local_constants): Take an arraylist
12255 instead of a single constant.
12257 (local_constant_declaration): It should take a
12258 constant_declarators, not a constant_declarator. Fixes 49487
12260 * convert.cs: Fix error report.
12262 2003-10-13 Jackson Harper <jackson@ximian.com>
12264 * typemanager.cs (TypeToCoreType): Add float and double this fixes
12267 2003-10-09 Martin Baulig <martin@ximian.com>
12269 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12271 (MethodCore.DoDefineParameters): Removed the TypeContainer
12272 argument; use the DeclSpace which was passed to the .ctor instead.
12273 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12274 TypeContainer; we only need a DeclSpace here.
12276 2003-10-09 Martin Baulig <martin@ximian.com>
12278 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12280 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12281 EmitContext's .ctor.
12283 2003-10-09 Martin Baulig <martin@ximian.com>
12285 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12286 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12287 AsAccessible(), moved them as well.
12289 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12291 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12293 * cs-parser.jay : Renamed yyName to yyNames related to jay.
12295 2003-10-07 Miguel de Icaza <miguel@ximian.com>
12297 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12298 generation for >=, as spotted by Paolo, bug 48679.
12299 Patch from David Waite.
12301 * cs-tokenizer.cs: Add handling for #pragma.
12303 * cs-parser.jay: Allow for both yield and yield return in the
12304 syntax. The anti-cobolization of C# fight will go on!
12306 * class.cs (TypeBuilder.DefineType): Catch error condition here
12307 (Parent.DefineType erroring out and returning null).
12309 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12310 coping with enumerations variables, we were mistakenly processing
12311 them as a regular value type instead of built-in types. Fixes the
12314 * typemanager.cs (IsBuiltinOrEnum): New method.
12316 2003-09-30 Miguel de Icaza <miguel@ximian.com>
12318 * cs-parser.jay: Upgrade: yield now needs the return clause.
12320 2003-09-19 Martin Baulig <martin@ximian.com>
12322 * decl.cs (MemberCache.SetupCacheForInterface): Take a
12323 `MemberCache parent' argument. Normally, an interface doesn't
12324 have a parent type except System.Object, but we use this in gmcs
12325 for generic type parameters.
12327 2003-09-18 Martin Baulig <martin@ximian.com>
12329 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12330 on `type.IsInterface'; don't check whether the type has a parent
12331 to determine whether it's an interface.
12333 2003-09-15 Martin Baulig <martin@ximian.com>
12335 * class.cs (TypeContainer.DefineType): Added an error flag to
12336 avoid reporting duplicate CS0146's ("class definition is
12339 * driver.cs (Driver.MainDriver): Abort if
12340 RootContext.ResolveTree() reported any errors.
12342 2003-09-07 Martin Baulig <martin@ximian.com>
12344 * report.cs (Error, Warning): Added overloaded versions which take
12345 a `params object[] args' and call String.Format().
12347 2003-09-07 Martin Baulig <martin@ximian.com>
12349 * decl.cs (DeclSpace..ctor): Don't call
12350 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12351 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
12352 (DeclSpace.RecordDecl): New method.
12354 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12356 2003-09-02 Ravi Pratap <ravi@ximian.com>
12358 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12359 value attributes to be applied to ParameterBuilders.
12361 * class.cs (MethodCore.LabelParameters): Make static and more
12362 generic so that it can be used from other places - like interface
12363 methods, for instance.
12365 * interface.cs (Interface.Emit): Call LabelParameters before
12366 emitting attributes on the InterfaceMethod.
12368 2003-08-26 Martin Baulig <martin@ximian.com>
12370 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12371 resolving aliases; fixes #47927.
12373 2003-08-26 Martin Baulig <martin@ximian.com>
12375 * statement.cs (Using.DoResolve): This is internally emitting a
12376 try/finally clause, so we need to set ec.NeedExplicitReturn if we
12377 do not always return. Fixes #47681.
12379 2003-08-26 Martin Baulig <martin@ximian.com>
12381 * decl.cs (MemberCore): Moved WarningNotHiding(),
12382 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12384 (AdditionResult): Make this nested in DeclSpace.
12385 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12386 argument; call NamespaceEntry.Define() unless we're nested in a
12389 * namespace.cs (Namespace.DefineName): New public function. This
12390 is called from DeclSpace's .ctor to add
12391 (Namespace.Lookup): Include DeclSpaces in the lookup.
12393 * class.cs (Operator): Derive from MemberBase, not MemberCore.
12395 * const.cs (Const): Derive from MemberBase, not MemberCore.
12397 2003-08-25 Martin Baulig <martin@ximian.com>
12399 * convert.cs (Convert.ExplicitReferenceConversion): When
12400 converting from an interface type to a class, unbox if the target
12401 type is a struct type. Fixes #47822.
12403 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12405 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12408 2003-08-22 Martin Baulig <martin@ximian.com>
12410 * class.cs (TypeManager.DefineType): When defining a nested type,
12411 call DefineType() on our parent; fixes #47801.
12413 2003-08-22 Martin Baulig <martin@ximian.com>
12415 * class.cs (MethodData.Define): While checking if a method is an
12416 interface implementation, improve the test a bit more to fix #47654.
12418 2003-08-22 Martin Baulig <martin@ximian.com>
12420 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12421 correctly; fixes #47722.
12423 2003-08-22 Martin Baulig <martin@ximian.com>
12425 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12426 LocalVariableReference, ensure it's not read-only. Fixes #47536.
12428 * statement.cs (Fixed.DoResolve): Make all variables read-only.
12430 2003-08-22 Martin Baulig <martin@ximian.com>
12432 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12433 can only be assigned in static constructors. Fixes #47161.
12435 2003-08-22 Martin Baulig <martin@ximian.com>
12437 Rewrote and improved the flow analysis code.
12439 * flowbranching.cs (FlowBranching): Make this class abstract.
12440 (FlowBranching.CreateBranching): New static function to create a
12441 new flow branching.
12442 (FlowBranchingBlock, FlowBranchingException): New classes.
12443 (FlowBranching.UsageVector.Type): New public readonly field.
12444 (FlowBranching.UsageVector.Breaks): Removed the setter.
12445 (FlowBranching.UsageVector.Returns): Removed the setter.
12446 (FlowBranching.UsageVector): Added Break(), Return(),
12447 NeverReachable() and Throw() methods to modify the reachability.
12448 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12449 done by FlowBranching.Merge().
12450 (FlowBranching.UsageVector.MergeChild): New method; merges the
12451 merge result into the current vector.
12452 (FlowBranching.Merge): New abstract method to merge a branching.
12454 2003-08-12 Martin Baulig <martin@ximian.com>
12456 * expression.cs (Indirection.CacheTemporaries): Create the
12457 LocalTemporary with the pointer type, not its element type.
12459 2003-08-10 Miguel de Icaza <miguel@ximian.com>
12461 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12462 token was a keyword or not.
12464 Add `error' options where an IDENTIFIER was expected; Provide
12465 CheckToken and CheckIdentifierToken convenience error reporting
12468 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12470 * decl.cs: Rename `NamespaceEntry Namespace' public field into
12471 NameSpaceEntry NameSpaceEntry.
12473 (LookupInterfaceOrClass): Avoid creating a full qualified name
12474 from namespace and name: avoid doing lookups when we know the
12475 namespace is non-existant. Use new Tree.LookupByNamespace which
12476 looks up DeclSpaces based on their namespace, name pair.
12478 * driver.cs: Provide a new `parser verbose' to display the
12479 exception thrown during parsing. This is turned off by default
12480 now, so the output of a failure from mcs is more graceful.
12482 * namespace.cs: Track all the namespaces defined in a hashtable
12485 (IsNamespace): New method
12487 2003-08-09 Miguel de Icaza <miguel@ximian.com>
12489 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
12490 we know that we need to concatenate (full typename can never be
12495 * statement.cs: Use a bitfield; Do not initialize to null things
12496 which are done by the constructor by default.
12498 * cs-parser.jay: bug fix, parameter was 4, not 3.
12500 * expression.cs: Just use the property;
12502 * statement.cs: No need for GetVariableInfo method.
12504 2003-08-08 Martin Baulig <martin@ximian.com>
12506 * flowanalysis.cs (FlowReturns): This is now nested in the
12507 `FlowBranching' class.
12508 (MyBitVector): Moved this here from statement.cs.
12509 (FlowBranching.SiblingType): New enum type.
12510 (FlowBranching.CreateSibling): Added `SiblingType' argument.
12512 2003-08-07 Martin Baulig <martin@ximian.com>
12514 * flowanalysis.cs (FlowBranchingType): This is now nested in the
12515 `FlowBranching' class and called `BranchingType'.
12517 2003-08-07 Martin Baulig <martin@ximian.com>
12519 * flowanalysis.cs: Moved all the control flow analysis code into
12522 2003-08-07 Martin Baulig <martin@ximian.com>
12524 * assign.cs (Assign.DoResolve): `target' must either be an
12525 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
12528 2003-08-07 Miguel de Icaza <miguel@ximian.com>
12530 * expression.cs (BinaryMethod): This kind of expression is created by the
12531 Binary class if it determines that the operator has to be handled
12534 (BinaryDelegate): This kind of expression is created if we are
12535 dealing with a + or - operator on delegates.
12537 (Binary): remove method, argumetns, and DelegateOperator: when
12538 dealing with methods,
12540 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12542 * statement.cs (Block): use bitfields for the three extra booleans
12543 we had in use. Remove unused topblock parameter.
12545 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12547 * assign.cs: Drop extra unneeded tests.
12549 2003-08-06 Miguel de Icaza <miguel@ximian.com>
12551 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12553 * statement.cs (Foreach): Use VariableStorage instead of
12556 * codegen.cs (VariableStorage): New class used by clients that
12557 require a variable stored: locals or fields for variables that
12558 need to live across yield.
12560 Maybe provide a convenience api for EmitThis+EmitLoad?
12562 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12565 2003-08-05 Miguel de Icaza <miguel@ximian.com>
12567 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12568 RemapParameterLValue): New methods that are used to turn a
12569 precomputed FieldInfo into an expression like this:
12573 The idea is to use this instead of making LocalVariableReference
12574 have more than one meaning.
12576 * cs-parser.jay: Add error production to BASE.
12578 * ecore.cs: Deal with TypeManager.GetField returning null, which
12579 is now a valid return value.
12581 (FieldExprNoAddress): New expression for Fields whose address can
12584 * expression.cs (LocalVariableReference): During the resolve
12585 phases, create new expressions if we are in a remapping context.
12586 Remove code that dealt with remapping here.
12588 (ParameterReference): same.
12590 (ProxyInstance): New expression, like the `This' expression, but
12591 it is born fully resolved. We know what we are doing, so remove
12592 the errors that are targeted to user-provided uses of `this'.
12594 * statement.cs (Foreach): our variable is now stored as an
12595 Expression; During resolution, follow the protocol, dont just
12596 assume it will return this.
12598 2003-08-06 Martin Baulig <martin@ximian.com>
12600 * support.cs (SeekableStreamReader.cs): New public class.
12602 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12603 SeekableStreamReader instead of the normal StreamReader.
12605 2003-08-04 Martin Baulig <martin@ximian.com>
12607 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12608 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12609 deambiguate casts and delegate invocations.
12610 (parenthesized_expression): Use the new tokens to ensure this is
12611 not a cast of method invocation.
12613 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12614 when reading a `)' and Deambiguate_CloseParens () was previously
12617 * expression.cs (ParenthesizedExpression): New class. This is
12618 just used for the CS0075 test.
12619 (Binary.DoResolve): Check for CS0075.
12621 2003-07-29 Ravi Pratap <ravi@ximian.com>
12623 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12624 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12625 reference comparison.
12627 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12628 examine the ReturnType for equality - this is necessary in the
12629 cases of implicit and explicit operators whose signature also
12630 includes the return type.
12632 2003-07-26 Miguel de Icaza <miguel@ximian.com>
12634 * namespace.cs: Cache the result of the namespace computation,
12635 instead of computing it every time.
12637 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12639 * decl.cs: Use a global arraylist that we reuse over invocations
12640 to avoid excesive memory consumption. Reduces memory usage on an
12641 mcs compile by one meg (45 average).
12643 * typemanager.cs (LookupTypeReflection): In .NET pointers are
12644 private, work around that.
12646 2003-07-23 Miguel de Icaza <miguel@ximian.com>
12648 * literal.cs (IntLiteral): Define Zero and One static literals.
12650 * cs-parser.jay (integer_literal): use static literals to reduce
12651 memory usage for the most used literals (0, 1 and -1). 211kb
12652 reduced in memory usage.
12654 Replace all calls to `new ArrayList' with `new
12655 ArrayList(4)' which is a good average number for most allocations,
12656 and also requires only 16 bytes of memory for its buffer by
12659 This reduced MCS memory usage in seven megabytes for the RSS after
12662 2003-07-28 Ravi Pratap <ravi@ximian.com>
12664 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12665 handle params methods the correct way by forming only one
12666 applicable set with params and normal methods in them. Earlier we
12667 were looking at params methods only if we found no normal methods
12668 which was not the correct thing to do.
12670 (Invocation.BetterFunction): Take separate arguments indicating
12671 when candidate and the best method are params methods in their
12674 This fixes bugs #43367 and #46199.
12676 * attribute.cs: Documentation updates.
12678 (CheckAttribute): Rename to CheckAttributeTarget.
12679 (GetValidPlaces): Rename to GetValidTargets.
12681 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12682 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12686 2003-07-28 Martin Baulig <martin@ximian.com>
12688 * class.cs (TypeContainer.DefineMembers): Use the base type's full
12689 name when looking up the base class of a nested class. Fixes #46977.
12691 2003-07-26 Martin Baulig <martin@ximian.com>
12693 * expression.cs (Indexers.Indexer): New nested struct; contains
12694 getter, setter and the indexer's type.
12695 (Indexers.Properties): This is now an ArrayList of
12696 Indexers.Indexer's.
12697 (IndexerAccess.DoResolveLValue): Correctly set the type if the
12698 indexer doesn't have any getters.
12700 * assign.cs (Assign.DoResolve): Also do the implicit conversions
12701 for embedded property and indexer assignments.
12703 2003-07-26 Martin Baulig <martin@ximian.com>
12705 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
12706 preprocessor directive is not the first non-whitespace character
12709 2003-07-26 Martin Baulig <martin@ximian.com>
12711 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
12712 namespace parsing, follow the spec more closely.
12714 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
12715 NamespaceEntry.Lookup().
12717 2003-07-25 Martin Baulig <martin@ximian.com>
12719 * MethodCore.cs (OverridesSomething): New public field; it's set
12720 from TypeContainer.DefineMembers if this method overrides
12721 something (which doesn't need to be a method). Fix #39462.
12723 2003-07-25 Ravi Pratap <ravi@ximian.com>
12725 * typemanager.cs (GetMembers): Ensure that the list of members is
12726 reversed. This keeps things in sync.
12728 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
12729 find an AttributeUsage attribute.
12731 * expression.cs (Invocation.OverloadResolve): Perform the check
12732 which disallows Invoke to be directly called on a Delegate.
12734 (Error_InvokeOnDelegate): Report error cs1533.
12736 2003-07-25 Martin Baulig <martin@ximian.com>
12738 * expression.cs (Indexers.GetIndexersForType): Only look in the
12739 interface hierarchy if the requested type is already an
12740 interface. Fixes #46788 while keeping #46502 fixed.
12742 2003-07-25 Martin Baulig <martin@ximian.com>
12744 * class.cs (TypeContainer.DefineMembers): Check whether all
12745 readonly fields have been assigned and report warning CS0649 if
12748 * statement.cs (LocalInfo.IsFixed): Always return true if this is
12751 2003-07-24 Ravi Pratap <ravi@ximian.com>
12753 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
12754 returned from GetMethods to make things consistent with the
12755 assumptions MCS makes about ordering of methods.
12757 This should comprehensively fix bug #45127 and it does :-)
12759 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
12760 ordering is actually reverse.
12762 * Clean up some debug messages I left lying around.
12764 * interface.cs (Populate*): Get rid of code which emits attributes
12765 since the stage in which we emit attributes is the 'Emit' stage,
12766 not the define stage.
12768 (Emit): Move attribute emission for interface members here.
12770 2003-07-22 Ravi Pratap <ravi@ximian.com>
12772 * expression.cs (Invocation.OverloadResolve): Follow the spec more
12773 closely: we eliminate methods in base types when we have an
12774 applicable method in a top-level type.
12776 Please see section 14.5.5.1 for an exact description of what goes
12779 This fixes bug #45127 and a host of other related to corlib compilation.
12781 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12782 array is the method corresponding to the top-level type (this is
12783 because of the changes made to icall.c) so we change this
12786 (MethodGroupExpr.Name): This too.
12788 * typemanager.cs (GetElementType): New method which does the right
12789 thing when compiling corlib.
12791 * everywhere: Make use of the above in the relevant places.
12793 2003-07-22 Martin Baulig <martin@ximian.com>
12795 * cs-parser.jay (invocation_expression): Moved
12796 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12797 `cast_expression', but create a InvocationOrCast which later
12798 resolves to either an Invocation or a Cast.
12800 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12801 method; call this before EmitStatement() to make sure that this
12802 expression can be used as a statement.
12804 * expression.cs (InvocationOrCast): New class; resolves to either
12805 an Invocation or a Cast.
12807 * statement.cs (StatementExpression): Call ResolveStatement() on
12808 the ExpressionStatement before emitting it.
12810 2003-07-21 Martin Baulig <martin@ximian.com>
12812 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12813 `ref' and `out' attributes match; fixes #46220.
12814 (MemberAccess.ResolveMemberAccess): You can't reference a type
12815 through an expression; fixes #33180.
12816 (Indexers.GetIndexersForType): Don't return the indexers from
12817 interfaces the class implements; fixes #46502.
12819 2003-07-21 Martin Baulig <martin@ximian.com>
12821 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12822 CS0661 checks; fixes bug #30442.
12824 2003-07-21 Martin Baulig <martin@ximian.com>
12826 * decl.cs (AdditionResult): Added `Error'.
12828 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12830 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
12831 makes cs0031.cs actually work.
12833 2003-07-20 Martin Baulig <martin@ximian.com>
12835 * namespace.cs: Fixed that bug which caused a crash when compiling
12836 the debugger's GUI.
12838 2003-07-20 Miguel de Icaza <miguel@ximian.com>
12840 * typemanager.cs (LookupTypeReflection): Never expose types which
12841 are NotPublic, NestedPrivate, NestedAssembly, or
12842 NestedFamANDAssem. We used to return these, and later do a check
12843 that would report a meaningful error, but the problem is that we
12844 would not get the real match, if there was a name override.
12846 2003-07-18 Miguel de Icaza <miguel@ximian.com>
12848 * namespace.cs (Namespace, Name): Do not compute the namespace
12849 name dynamically, compute it in the constructor. This reduced
12850 memory usage by 1697 KB.
12852 * driver.cs: Use --pause to pause at the end.
12854 2003-07-17 Peter Williams <peter@newton.cx>
12856 * Makefile: Change the name of the test target so that it doesn't
12857 conflict with the recursive test target.
12859 2003-07-17 Miguel de Icaza <miguel@ximian.com>
12861 * expression.cs (LocalVariableReference.Emit, EmitAssign,
12862 AddressOf): Do not use EmitThis, that was wrong, use the actual
12865 2003-07-15 Miguel de Icaza <miguel@ximian.com>
12867 * class.cs (MethodData.Define): While checking if a method is an
12868 interface implementation, improve the test: If we are not public
12869 (use new test here: use the computed MethodAttributes directly,
12870 instead of the parsed modifier flags) check if the `implementing'
12871 method comes from an interface or not.
12873 * pending.cs (VerifyPendingMethods): Slightly better error
12876 * makefile: add test target that does the mcs bootstrap.
12878 2003-07-16 Ravi Pratap <ravi@ximian.com>
12880 * interface.cs (Define): Do nothing here since there are no
12881 members to populate etc. Move the attribute emission out of here
12882 since this was just totally the wrong place to put it. Attribute
12883 application happens during the 'Emit' phase, not in the 'Define'
12886 (Emit): Add this method and move the attribute emission here
12888 * rootcontext.cs (EmitCode): Call the Emit method on interface
12891 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12893 * expression.cs (OverloadResolve): Report error only if Location
12894 is not 'Null' which means that there was a probe going on.
12896 2003-07-14 Martin Baulig <martin@ximian.com>
12898 * expression.cs (ConditionalLogicalOperator): New public class to
12899 implement user defined conditional logical operators.
12900 This is section 14.11.2 in the spec and bug #40505.
12902 2003-07-14 Martin Baulig <martin@ximian.com>
12904 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12906 2003-07-14 Martin Baulig <martin@ximian.com>
12908 * codegen.cs (EmitContext.InFixedInitializer): New public field.
12910 * ecore.cs (IVariable.VerifyFixed): New interface method.
12912 * expression.cs (Unary.ResolveOperator): When resolving the `&'
12913 operator, check whether the variable is actually fixed. Fixes bug
12914 #36055. Set a variable definitely assigned when taking its
12915 address as required by the spec.
12917 * statement.cs (LocalInfo.IsFixed): New field.
12918 (LocalInfo.MakePinned): Set `IsFixed' to true.
12920 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12922 * attribute.cs (Attribute.Resolve): While doing a Member lookup
12923 for .ctors, ensure that we only ask for members declared in the
12924 attribute type (BindingFlags.DeclaredOnly).
12928 * expression.cs (Error_WrongNumArguments): Report error 1501
12929 correctly the way CSC does.
12931 2003-07-13 Martin Baulig <martin@ximian.com>
12933 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12934 lookup on the fully qualified name, to make things like "X.X" work
12935 where "X.X" is a fully qualified type name, but we also have a
12936 namespace "X" in the using list. Fixes #41975.
12938 2003-07-13 Martin Baulig <martin@ximian.com>
12940 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12941 function. If we're a CompoundAssign, we need to create an embedded
12942 CompoundAssign, not an embedded Assign.
12943 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12946 2003-07-13 Martin Baulig <martin@ximian.com>
12948 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12949 work to fix bug #46088.
12951 2003-07-13 Ravi Pratap <ravi@ximian.com>
12953 * class.cs (Operator.Emit): Do not emit attributes here - it is
12954 taken care of by the Method class that we delegate too. This takes
12955 care of bug #45876.
12957 2003-07-10 Martin Baulig <martin@ximian.com>
12959 * expression.cs (TypeOfVoid): New class.
12960 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
12962 2003-07-10 Martin Baulig <martin@ximian.com>
12964 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12967 2003-07-10 Martin Baulig <martin@ximian.com>
12969 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12970 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12972 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12974 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12976 2003-07-10 Martin Baulig <martin@ximian.com>
12978 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12979 of decimal. Fixes #42850.
12981 NOTE: I also fixed the created byte blob, but this doesn't work on
12982 the MS runtime and csc never produces any byte blobs for decimal
12985 2003-07-10 Martin Baulig <martin@ximian.com>
12987 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12988 structs; fixes #32068.
12989 (Block.AddChildVariableNames): Fixed #44302.
12991 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12993 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12995 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12997 * attribute.cs: And this test is onger needed.
12999 2003-07-08 Martin Baulig <martin@ximian.com>
13001 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13002 inaccessible types. Fixes #36313.
13004 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13006 * namespace.cs (NamespaceEntry): Create implicit entries for all
13007 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13008 implicit entries for N1.N2 and N1.
13010 2003-07-08 Martin Baulig <martin@ximian.com>
13012 Rewrote the handling of namespaces to fix a lot of the issues
13013 wrt. `using' aliases etc.
13015 * namespace.cs (Namespace): Splitted this class into a
13016 per-assembly `Namespace' and a per-file `NamespaceEntry'.
13018 * typemanager.cs (TypeManager.IsNamespace): Removed.
13019 (TypeManager.ComputeNamespaces): Only compute namespaces from
13020 loaded assemblies here, not the namespaces from the assembly we're
13021 currently compiling.
13023 2003-07-08 Martin Baulig <martin@ximian.com>
13025 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13027 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13029 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13032 I thought about the memory savings here, but LookupTypeReflection
13033 is used under already very constrained scenarios. Compiling
13034 corlib or mcs only exposes one hit, so it would not really reduce
13035 any memory consumption.
13037 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13039 * typemanager.cs: fixes bug #45889 by only adding public types from
13040 other assemblies to the list of known types.
13042 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13044 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13045 on the type we resolved.
13047 2003-07-05 Martin Baulig <martin@ximian.com>
13049 * pending.cs (PendingImplementation.ParentImplements): Don't
13050 create the proxy if the parent is abstract.
13052 * class.cs (TypeContainer.DefineIndexers): Process explicit
13053 interface implementations first. Fixes #37714.
13055 2003-07-04 Miguel de Icaza <miguel@ximian.com>
13057 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13058 defined recursively; but since we modify the input parameters
13059 (left is set to `this' temporarily), we reset this value if the
13060 left_is_explicit is false, which gives the original semantics to
13063 * literal.cs (NullPointer): new class used to represent a null
13064 literal in a pointer context.
13066 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13067 type is a pointer, use a NullPointer object instead of a
13068 NullLiteral. Closes 43687
13070 (ExplicitConversion): Convert pointer values using
13071 the conv opcode to the proper type.
13073 * ecore.cs (New): change ValueTypeVariable property into a method,
13074 that returns whether the valuetype is suitable for being used.
13076 * expression.cs (Binary.DoNumericPromotions): Only return if we
13077 the int constant was a valid uint, and we can return both left and
13078 right as uints. If not, we continue processing, to trigger the
13079 type conversion. This fixes 39018.
13081 * statement.cs (Block.EmitMeta): During constant resolution, set
13082 the CurrentBlock property on the emitcontext, so that we resolve
13083 constants propertly.
13085 2003-07-02 Martin Baulig <martin@ximian.com>
13087 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13088 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13090 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13091 than emitting it here.
13093 * statement.cs: Fixed some more flow analysis bugs.
13095 2003-07-02 Martin Baulig <martin@ximian.com>
13097 * class.cs (MethodData.Define): When implementing interface
13098 methods, set Final unless we're Virtual.
13100 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13101 check work for interface methods.
13103 2003-07-01 Martin Baulig <martin@ximian.com>
13105 * ecore.cs (EmitContext.This): Replaced this property with a
13106 GetThis() method which takes a Location argument. This ensures
13107 that we get the correct error location for a CS0188.
13109 2003-07-01 Miguel de Icaza <miguel@ximian.com>
13111 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13112 ImplicitStandardConversion.
13114 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13116 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
13118 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13121 2003-06-30 Miguel de Icaza <miguel@ximian.com>
13123 * class.cs (Constructor.Define): Turn off initlocals for unsafe
13126 (MethodData.Define): Turn off initlocals for unsafe methods.
13128 2003-06-29 Miguel de Icaza <miguel@ximian.com>
13130 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13131 complete; Fixes #37521.
13133 * delegate.cs: Use Modifiers.TypeAttr to compute the
13134 TypeAttributes, instead of rolling our own. This makes the flags
13135 correct for the delegates.
13137 2003-06-28 Miguel de Icaza <miguel@ximian.com>
13139 * class.cs (Constructor.Define): Set the private flag for static
13140 constructors as well.
13142 * cs-parser.jay (statement_expression): Set the return value to
13143 null, to avoid a crash when we catch an error.
13145 2003-06-24 Miguel de Icaza <miguel@ximian.com>
13147 * cs-parser.jay: Applied patch from Jackson that adds support for
13148 extern and unsafe modifiers to destructor declarations.
13150 * expression.cs: Report error 21 if the user is trying to index a
13153 * driver.cs: Add an error message, suggested by the bug report.
13155 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13156 if we do not have a ": this ()" constructor initializer. Fixes 45149
13158 2003-06-14 Miguel de Icaza <miguel@ximian.com>
13160 * namespace.cs: Add some information to reduce FAQs.
13162 2003-06-13 Miguel de Icaza <miguel@ximian.com>
13164 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13165 underlying enumeration types. Fixes #43915.
13167 * expression.cs: Treat ushort/short as legal values to be used in
13168 bitwise operations.
13170 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13172 * delegate.cs: transfer custom attributes for paramenters from
13173 the delegate declaration to Invoke and BeginInvoke.
13175 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13177 * attribute.cs: handle custom marshalers and emit marshal info
13180 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
13182 * makefile.gnu: Added anonymous.cs to the compiler sources.
13184 2003-05-28 Miguel de Icaza <miguel@ximian.com>
13186 * iterators.cs: Change the name of the proxy class to include two
13189 * cs-parser.jay: Update grammar to include anonymous methods.
13191 * anonymous.cs: new file.
13193 2003-05-27 Miguel de Icaza <miguel@ximian.com>
13195 * class.cs (Field.Define): Add missing test for pointers and
13198 2003-05-27 Ravi Pratap <ravi@ximian.com>
13200 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13201 we use the stobj opcode.
13203 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13204 since it wasn't the correct fix.
13206 It still is puzzling that we are required to use stobj for IntPtr
13207 which seems to be a ValueType.
13209 2003-05-26 Miguel de Icaza <miguel@ximian.com>
13211 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13212 during regular simple name resolution. Now, the trick is that
13213 instead of returning for processing the simplename, we do a
13214 TypeManager.LookupType (ie, a rooted lookup as opposed to a
13215 contextual lookup type). If a match is found, return that, if
13216 not, return for further composition.
13218 This fixes long-standing 30485.
13220 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13221 using the address to initialize an object, do an Stobj instead of
13222 using the regular Stelem.
13224 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13225 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13226 Because if we are a BaseIndexerAccess that value will be true.
13229 * statement.cs (GotoCase.Resolve): Return after reporting an
13230 error, do not attempt to continue.
13232 * expression.cs (PointerArithmetic.Emit): If our operand is a
13233 long, convert our constants to match the operand before
13234 multiplying. Convert to I type before adding. Fixes 43670.
13236 2003-05-14 Ravi Pratap <ravi@ximian.com>
13238 * enum.cs (ImplicitConversionExists) : Rename to
13239 ImplicitEnumConversionExists to remove ambiguity.
13241 * ecore.cs (NullCast): New type of cast expression class which
13242 basically is very similar to EmptyCast with the difference being
13243 it still is a constant since it is used only to cast a null to
13245 (eg. (string) null)
13247 * convert.cs (ImplicitReferenceConversion): When casting a null
13248 literal, we return a NullCast.
13250 * literal.cs (NullLiteralTyped): Remove - I don't see why this
13251 should be around anymore.
13253 The renaming (reported was slightly wrong). Corrections:
13255 ConvertImplicitStandard -> ImplicitConversionStandard
13256 ConvertExplicitStandard -> ExplicitConversionStandard
13258 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13259 before passing them in !
13261 * convert.cs (ImplicitConversionStandard): When comparing for
13262 equal expr and target types, ensure that expr is not a
13265 In general, we must not be checking (expr_type ==
13266 target_type) in the top level conversion methods
13267 (ImplicitConversion, ExplicitConversion etc). This checking is
13268 done in the methods that they delegate to.
13270 2003-05-20 Miguel de Icaza <miguel@ximian.com>
13272 * convert.cs: Move Error_CannotConvertType,
13273 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13274 ImplicitNumericConversion, ImplicitConversionExists,
13275 ImplicitUserConversionExists, StandardConversionExists,
13276 FindMostEncompassedType, FindMostSpecificSource,
13277 FindMostSpecificTarget, ImplicitUserConversion,
13278 ExplicitUserConversion, GetConversionOperators,
13279 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13280 TryImplicitIntConversion, Error_CannotConvertImplicit,
13281 ConvertImplicitRequired, ConvertNumericExplicit,
13282 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13283 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13286 Perform the following renames:
13288 StandardConversionExists -> ImplicitStandardConversionExists
13289 ConvertImplicit -> ImplicitConversion
13290 ConvertImplicitStandard -> ImplicitStandardConversion
13291 TryImplicitIntConversion -> ImplicitIntConversion
13292 ConvertImplicitRequired -> ImplicitConversionRequired
13293 ConvertNumericExplicit -> ExplicitNumericConversion
13294 ConvertReferenceExplicit -> ExplicitReferenceConversion
13295 ConvertExplicit -> ExplicitConversion
13296 ConvertExplicitStandard -> ExplicitStandardConversion
13298 2003-05-19 Martin Baulig <martin@ximian.com>
13300 * statement.cs (TypeInfo.StructInfo): Made this type protected.
13301 (TypeInfo): Added support for structs having structs as fields.
13303 * ecore.cs (FieldExpr): Implement IVariable.
13304 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13305 VariableInfo for the field.
13307 2003-05-18 Martin Baulig <martin@ximian.com>
13309 * expression.cs (This.DoResolve): Report a CS0027 if we're
13310 emitting a field initializer.
13312 2003-05-18 Martin Baulig <martin@ximian.com>
13314 * expression.cs (This.ResolveBase): New public function.
13315 (This.DoResolve): Check for CS0188.
13317 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13320 * ecore.cs (MethodGroupExpr.DoResolve): Set the
13321 `instance_expression' to null if we don't have any non-static
13324 2003-05-18 Martin Baulig <martin@ximian.com>
13326 Reworked the way how local variables and parameters are handled by
13327 the flow analysis code.
13329 * statement.cs (TypeInfo, VariableMap): New public classes.
13330 (VariableInfo): New public class. This is now responsible for
13331 checking whether a variable has been assigned. It is used for
13332 parameters and local variables.
13333 (Block.EmitMeta): Take the InternalParameters as argument; compute
13334 the layout of the flow vectors here.
13335 (Block.LocalMap, Block.ParameterMap): New public properties.
13336 (FlowBranching): The .ctor doesn't get the InternalParameters
13337 anymore since Block.EmitMeta() now computes the layout of the flow
13339 (MyStructInfo): This class is now known as `StructInfo' and nested
13340 in `TypeInfo'; we don't access this directly anymore.
13342 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13343 property and removed IsAssigned(), IsFieldAssigned(),
13344 SetAssigned() and SetFieldAssigned(); we now call them on the
13345 VariableInfo so we don't need to duplicate this code everywhere.
13347 * expression.cs (ParameterReference): Added `Block block' argument
13349 (LocalVariableReference, ParameterReference, This): The new
13350 VariableInfo class is now responsible for all the definite
13353 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13354 IsParameterAssigned, SetParameterAssigned): Removed.
13356 2003-05-18 Martin Baulig <martin@ximian.com>
13358 * typemanager.cs (InitCoreTypes): Try calling
13359 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13360 the 3-args-version. Corlib now also needs our `void_type'.
13361 (GetMethod): Added overloaded version which takes an optional
13362 `bool report_errors' to allow lookups of optional methods.
13364 2003-05-12 Martin Baulig <martin@ximian.com>
13366 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13367 only used for locals and not for parameters.
13369 2003-05-12 Miguel de Icaza <miguel@ximian.com>
13371 * support.cs (InternalParameters.ParameterType): Return the
13372 ExternalType of the parameter.
13374 * parameter.cs (Parameter.ExternalType): drop the two arguments,
13377 2003-05-11 Miguel de Icaza <miguel@ximian.com>
13379 * class.cs (MethodData.Define): Do not set the `newslot' on
13380 interface members, if they are also flagged as "override".
13382 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13383 better code for ++i and i++. This only works for static fields
13384 and local variables.
13386 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13387 want to pull the DeclSpace out of the builder_to_declspace instead
13388 of the TypeBuilder (like in TypeContainer.FindMembers).
13390 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13391 instead of LookupTypeContainer. Fixes the crash on .NET for
13392 looking up interface members.
13394 * const.cs: Create our own emit context during the Definition
13395 stage, so that constants are evaluated in the proper context, when
13396 a recursive definition happens.
13398 2003-05-11 Martin Baulig <martin@ximian.com>
13400 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
13401 new block for a switch section.
13402 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13403 the adding/lookup in the switch block. Fixes #39828.
13405 2003-05-09 Miguel de Icaza <miguel@ximian.com>
13407 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13408 functionality: I needed to convert the data after I had performed
13409 the add/sub operation into the operands type size.
13411 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13412 pass the type for the box operation, otherwise the resulting
13413 object would have been of type object.
13415 (BoxedCast): Add constructor to specify the type to box as.
13417 2003-05-07 Miguel de Icaza <miguel@ximian.com>
13419 * iterators.cs: I was reusing the `count' variable inadvertently,
13420 take steps to not allow this to happen.
13422 2003-05-06 Miguel de Icaza <miguel@ximian.com>
13424 * attribute.cs (Attribute.Resolve): Params attributes are encoded
13425 by creating an array at the point where the params starts and
13426 putting all those arguments there, then adjusting the size of the
13429 2003-05-05 Miguel de Icaza <miguel@ximian.com>
13431 * expression.cs (New.AddressOf): Implement interface
13432 IMemoryLocation. This is used when the `new' operator is used in
13433 the context of an invocation to a method on a value type.
13435 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13438 * namespace.cs: Also check the using aliases here.
13440 * driver.cs: Move the test for using validity after the types have
13441 been entered, so we do a single pass that also includes the using
13444 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13445 in the regular case. CreateSiblingForFinally is doing extra
13448 * attribute.cs (GetAttributeArgumentExpression): Store the result
13449 on an out value, and use the return value to indicate failure
13450 instead of using null (which is a valid return for Constant.GetValue).
13452 * statement.cs: Perform the analysis flow for the increment
13453 portion after the statement, because this will be the real flow of
13454 execution. Fixes #42385
13456 * codegen.cs (EmitContext.EmitArgument,
13457 EmitContext.EmitStoreArgument): New helper functions when the
13458 RemapToProxy flag is set.
13460 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13463 Add support for remapping parameters.
13465 * iterators.cs: Propagate parameter values; Store parameter
13466 values in the proxy classes.
13468 2003-05-04 Miguel de Icaza <miguel@ximian.com>
13470 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
13471 need a proxy reference; I do not know what I was thinking
13473 * cs-parser.jay (constructor_initializer): catch another error,
13474 and display nice message.
13476 (field_declaration): catch void field declaration
13477 to flag a better error.
13479 * class.cs (MemberBase.CheckBase): Report an error instead of a
13480 warning if a new protected member is declared in a struct.
13481 (Field.Define): catch the error of readonly/volatile.
13483 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13485 (FieldExpr.AddressOf): ditto. Catch error where the address of a
13486 volatile variable is taken
13488 2003-05-02 Miguel de Icaza <miguel@ximian.com>
13490 * statement.cs (Fixed.Resolve): Report an error if we are not in
13493 2003-05-01 Miguel de Icaza <miguel@ximian.com>
13495 * typemanager.cs: reuse the code that handles type clashes for
13496 delegates and enumerations.
13498 * class.cs (Report28): Always report.
13500 * expression.cs (EncodeAsAttribute): Allow nulls here.
13502 2003-04-28 Miguel de Icaza <miguel@ximian.com>
13504 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13505 the functionality for testing whether an expression is valid for
13506 an attribute here. Also handle the case of arrays of elements
13509 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13510 encoding a linear array into an array of objects that are suitable
13511 to be passed to an CustomAttributeBuilder.
13513 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13515 * ecore.cs: (FieldExpr): Handle field remapping here.
13517 * iteratators.cs: Pass the instance variable (if the method is an
13518 instance method) to the constructors, so we can access the field
13519 variables on the class.
13521 TODO: Test this with structs. I think the THIS variable on
13522 structs might have to be a pointer, and not a refenrece
13524 2003-04-27 Miguel de Icaza <miguel@ximian.com>
13526 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13527 local variables to fields in a proxy class.
13529 * iterators.cs (PopulateProxy): Rename our internal fields to
13531 Create a <THIS> field if we are an instance method, so we can
13532 reference our parent container variables.
13533 (MapVariable): Called back from the EmitContext code to enter a
13534 new variable to field mapping into the proxy class (we just create
13538 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13539 for using the remapped locals to fields.
13541 I placed the code here, because that gives the same semantics to
13542 local variables, and only changes the Emit code.
13544 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13545 statements inside iterators.
13546 (VariableInfo): Add a FieldBuilder for the cases when we are
13547 remapping local variables to fields in a proxy class
13549 * ecore.cs (SimpleNameResolve): Avoid testing two times for
13550 current_block != null.
13552 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13553 not cope with strings, as it has been moved to the
13554 TableSwitchEmit. Fixed bug in switch generation.
13556 * expression.cs (New.DoResolve): Provide more context for the user
13557 when reporting an error.
13559 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13562 * expression.cs (MemberAccess.DoResolve): When we get a type back,
13563 check the permissions for it. Note than in a type-resolution
13564 context the check was already present in DeclSpace.ResolveType,
13565 but was missing from the MemberAccess.
13567 (ArrayCreation.CheckIndices): warn if the user has
13568 more nested levels of expressions, but there are no more
13569 dimensions specified. Avoids crash on bug 41906.
13571 2003-04-26 Miguel de Icaza <miguel@ximian.com>
13573 * statement.cs (Block): replace Implicit bool, for a generic
13575 New flag: `Unchecked'. This is used during the EmitMeta phase
13576 (which is out-of-line with the regular Resolve/Emit process for a
13577 statement, as this is done ahead of time, but still gets a chance
13578 to call constant resolve).
13580 (Block.Flags): new enum for adding a new flag.
13582 (Block.EmitMeta): track the state of unchecked.
13584 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13585 to enable constant resolution to work there as well.
13587 2003-04-22 Miguel de Icaza <miguel@ximian.com>
13589 * typemanager.cs (ienumerable_type): Also look up
13590 System.Collections.IEnumerable.
13592 2003-04-21 Miguel de Icaza <miguel@ximian.com>
13594 TODO: Test more than one conditional per method.
13596 * class.cs (Indexer.Define): Report the location where the user is
13597 referencing the unsupported feature.
13599 (MethodData): Overload the use of `conditionals' to
13600 minimize the creation of needless ArrayLists. This saves roughly
13601 212kb on my machine.
13603 (Method): Implement the new IIteratorContainer interface.
13604 (Method.SetYields): Implement the method by setting the ModFlags
13605 to contain METHOD_YIELDS.
13607 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13608 which just got set to null.
13610 * iterators.cs: New file.
13612 (Yield, YieldBreak): New statements.
13614 * statement.cs (Return.Resolve): Flag an error if we are used in
13615 an iterator method.
13617 * codegen.cs (InIterator): New flag set if the code is being
13618 compiled in an iterator method.
13620 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
13621 internal modifier, and we just use it to avoid adding extra
13622 fields, as this is seldom used.
13624 * cs-parser.jay: Add yield_statement (yield and yield break).
13626 * driver.cs: New flag -v2 to turn on version 2 features.
13628 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13629 hashtable when v2 is enabled.
13631 2003-04-20 Miguel de Icaza <miguel@ximian.com>
13633 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13634 there is already a namespace defined with this name.
13636 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13637 people upgraded their corlibs.
13639 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13640 always use fully qualified types, no need to use the compiler
13643 (TypeManager.IsNamespace): Use binarysearch.
13645 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13646 AddDelegate): I did not quite use the new IsValid API properly: I
13647 have to pass the short-name and the fullname. I was passing only
13648 the basename instead of the fullname sometimes.
13650 (TypeContainer.DefineType): call NamespaceClash.
13652 * interface.cs (Interface.DefineType): use NamespaceClash before
13655 * delegate.cs (Delegate.DefineType): use NamespaceClash before
13658 * enum.cs: (Enum.DefineType): use NamespaceClash before
13661 * typemanager.cs (: 3-line patch that gives us some tasty 11%
13662 speed increase. First, use the negative_hits cache when we get a
13663 negative. Second, add the type with its full original name
13664 instead of the new . and + encoded name (reflection uses + to
13665 separate type from a nested type). Use LookupTypeReflection
13666 directly which bypasses the type->name hashtable (that we already
13667 know does not contain the type.
13669 * decl.cs (DeclSpace.ResolveTypeExpr): track the
13670 location/container type.
13672 * driver.cs: When passing utf8, use directly the UTF8Encoding.
13674 2003-04-19 Miguel de Icaza <miguel@ximian.com>
13676 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13678 * delegate.cs (NewDelegate.Resolve): Test whether an instance
13679 method is being referenced in the method group from a static
13680 context, and report error 120 if so.
13682 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13685 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13686 is created, we create the A namespace).
13688 * cs-parser.jay: A namespace also introduces a DeclarationFound.
13691 2003-04-18 Miguel de Icaza <miguel@ximian.com>
13693 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13694 invocation to ModuleBuilder.GetType with the same values will
13695 return a new type instance, so we need to cache its return
13698 * expression.cs (Binary.ResolveOperator): Only allow the compare
13699 operators on enums if they are of the same type.
13701 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13702 types of ValueType on their own case. Before we were giving them
13703 the same treatment as objects.
13705 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13706 fullname. Short name is used to compare against container name.
13707 Fullname is used to check against defined namespace names.
13709 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13710 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13712 (Method.CheckBase): Call parent.
13713 (MemberBase.CheckBase): Check for protected members on sealed
13715 (PropertyBase.CheckBase): Call parent.
13716 (Field.Define): Call parent.
13718 * report.cs: Negative error codes are now mapped to 8000 - code,
13719 so that the display is render more nicely.
13721 * typemanager.cs: Do not use try/catch, instead report a regular
13724 (GetPointerType, GetReferenceType): These methods provide
13725 mechanisms to obtain the T* and T& from a T. We had the code
13726 previously scattered around the code base, and it also used
13727 TypeManager.LookupType that would go through plenty of caches.
13728 This one goes directly to the type source.
13730 In some places we did the Type.GetType followed by
13731 ModuleBuilder.GetType, but not in others, so this unifies the
13732 processing as well.
13734 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13735 statements now that we have namespace information.
13737 * typemanager.cs (IsNamespace): New method, returns whether the
13738 string presented is a namespace or not.
13740 (ComputeNamespaces): New public entry point, computes the list of
13741 available namespaces, using the GetNamespaces API call in Mono, or
13742 the slower version in MS.NET.
13744 Now before we start the semantic analysis phase, we have a
13745 complete list of namespaces including everything that the user has
13748 Deleted old code to cache namespaces in .nsc files.
13750 2003-04-17 Miguel de Icaza <miguel@ximian.com>
13752 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13753 class/struct location definition Location for the implicit
13754 constructor location.
13756 (Operator.Define): Use the location of the operator for the
13757 implicit Method definition.
13759 (Constructor.Emit): use the constructor location for the implicit
13760 base initializer constructor.
13762 * ecore.cs: Remove ITypeExpression. This interface is now gone,
13763 and the Expression class now contains two new methods:
13765 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
13766 isolate type lookup from the rest of the resolution process.
13768 Since we use Expressions to hold type definitions due to the way
13769 we parse the input we have historically overloaded Resolve to
13770 perform the Type lookups if a special flag is passed. Now this is
13771 eliminated and two methods take their place.
13773 The differences in the two methods between xStep and xTerminal is
13774 that xStep is involved in our current lookup system that uses
13775 SimpleNames to compose a name, while xTerminal is used just to
13776 catch the case where the simplename lookup failed.
13778 2003-04-16 Miguel de Icaza <miguel@ximian.com>
13780 * expression.cs (ResolveMemberAccess): Remove redundant code.
13781 TypeExpr expressions are always born fully resolved.
13783 * interface.cs (PopulateMethod): Do not lookup the types twice.
13784 We were doing it once during SemanticAnalysis and once during
13787 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13788 in local variable type definitions, were being returned as a
13789 SimpleName (we decomposed everything into a string), that is
13790 because primary_expression was being used instead of a type in the
13791 grammar (reduce/reduce conflicts).
13793 The part that was wrong is that we converted the expression into a
13794 string (an oversimplification in one hand, compounded with primary
13795 expressions doing string concatenation).
13801 Would return "A.B.C[]" as a SimpleName. This stopped things like
13802 using clauses from working on this particular context. And a type
13803 was being matched directly against "A.B.C[]".
13805 We now use the correct approach, and allow for ComposedCast to be
13806 part of the unary expression. So the "A.B.C []" become a composed
13807 cast of "A.B.C" (as a nested group of MemberAccess with a
13808 SimpleName at the end) plus the rank composition "[]".
13812 2003-04-10 Miguel de Icaza <miguel@ximian.com>
13814 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13815 for the access level checking.
13817 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
13818 `TypeContainer container', because I kept getting confused when I
13819 was debugging this code.
13821 * expression.cs (Indexers): Instead of tracking getters/setters,
13822 we now track them in parallel. We create one arraylist less, but
13823 most importantly it is possible now for the LValue code to find a
13824 matching get for a set.
13826 (IndexerAccess.DoResolveLValue): Update the code.
13827 GetIndexersForType has been modified already to extract all the
13828 indexers from a type. The code assumed it did not.
13830 Also make the code set the correct return type for the indexer.
13831 This was fixed a long time ago for properties, but was missing for
13832 indexers. It used to be void_type.
13834 (Binary.Emit): Test first for doubles instead of
13835 floats, as they are more common.
13837 (Binary.EmitBranchable): Use the .un version of the branch opcodes
13838 when dealing with floats and the <=, >= operators. This fixes bug
13841 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13842 to load the array value by emitting a load on the foreach variable
13843 type. This was incorrect.
13845 We now emit the code to load an element using the the array
13846 variable type, and then we emit the conversion operator.
13850 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
13852 * attribute.cs: Avoid allocation of ArrayLists in the common case.
13854 2003-04-09 Miguel de Icaza <miguel@ximian.com>
13856 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13857 test for protection before we test for signatures.
13859 (MethodSignature.ToString): implement.
13861 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13862 to the case where we reduced into a LongConstant.
13864 * decl.cs (CheckAccessLevel): If the type is an array, we can not
13865 depend on whether the information is acurrate, because the
13866 Microsoft runtime will always claim that the array type is public,
13867 regardless of the real state.
13869 If the type is a pointer, another problem happens: the type is
13870 reported as non-public in Microsoft.
13872 In both cases we have to call CheckAccessLevel recursively with
13873 the underlying type as the argument to be tested.
13875 2003-04-08 Miguel de Icaza <miguel@ximian.com>
13877 * assign.cs (Assign.Emit): If we are dealing with a compound
13878 assignment expression, we should use the code path that stores the
13879 intermediate result in a temporary value. This fixes #40903.
13881 *expression.cs (Indirection.ToString): Provide ToString method for
13884 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
13886 * class.cs: Null out fields holding references to Block objects so
13887 they can be garbage collected.
13889 * expression.cs (OverloadResolve): Remove unused local.
13891 2003-04-07 Martin Baulig <martin@ximian.com>
13893 * codegen.cs (EmitContext.CurrentFile): New public field.
13894 (EmitContext.Mark): Use the CurrentFile to check whether the
13895 location is in the correct file.
13896 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13898 2003-04-07 Martin Baulig <martin@ximian.com>
13900 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13902 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13903 location. [FIXME: The location argument which gets passed to this
13904 method is sometimes wrong!]
13906 2003-04-07 Nick Drochak <ndrochak@gol.com>
13908 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13910 2003-04-07 Miguel de Icaza <miguel@ximian.com>
13912 * expression.cs (Indirection.EmitAssign): We were using the
13913 temporary, but returning immediately instead of continuing the
13916 2003-04-06 Martin Baulig <martin@ximian.com>
13918 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13919 if it's a nested child, but also deriving from the outer class.
13922 * typemanager.cs (IsNestedChildOf): Make this work if it's a
13923 nested child, but also deriving from the outer class. See
13925 (FilterWithClosure): We may access private members of the outer
13926 class if we're a nested child and deriving from the outer class.
13927 (RealMemberLookup): Only set `closure_private_ok' if the
13928 `original_bf' contained BindingFlags.NonPublic.
13930 2003-04-05 Martin Baulig <martin@ximian.com>
13932 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
13934 2003-04-02 Miguel de Icaza <miguel@ximian.com>
13936 * class.cs (Event.Define): Do not allow abstract events to have
13939 2003-04-01 Miguel de Icaza <miguel@ximian.com>
13941 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13942 block in event declarations.
13944 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13945 value type, get its address.
13947 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13948 leaving a class on the stack instead of a boolean value (int
13949 0/1). Change the code so we compare against null, and then the
13950 result against zero.
13952 * class.cs (TypeContainer.GetClassBases): We were checking for the
13953 parent class being sealed too late.
13955 * expression.cs (Binary.Emit): For <= and >= when dealing with
13956 floating point values, use cgt.un and clt.un instead of cgt and
13959 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
13961 * statement.cs: Apply the same optimization as MS: skip the
13962 GetEnumerator returning an IEnumerator, and use the one returning a
13963 CharEnumerator instead. This allows us to avoid the try-finally block
13966 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
13968 * cs-parser.jay: Attributes cannot be applied to
13969 namespaces. Fixes #40473
13971 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13974 (Add*): check if the name is valid using the full name for constants,
13975 fields, properties and events.
13977 2003-03-28 Miguel de Icaza <miguel@ximian.com>
13979 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13980 char constants to be part of the enumeration.
13982 * expression.cs (Conditional.DoResolve): Add support for operator
13983 true. Implements the missing functionality from 14.12
13985 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13986 operator true/false as required by the spec.
13988 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13989 implicit conversion to boolean.
13991 * statement.cs (Statement.ResolveBoolean): A boolean expression is
13992 also one where the type implements `operator true'.
13994 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13995 get an expression that will invoke operator true based on an
13998 (GetConversionOperators): Removed the hack that called op_True
14001 (Expression.ResolveBoolean): Move this from Statement.
14003 2003-03-17 Miguel de Icaza <miguel@ximian.com>
14005 * ecore.cs (FieldExpr): do not allow initialization of initonly
14006 fields on derived classes
14008 2003-03-13 Martin Baulig <martin@ximian.com>
14010 * statement.cs (Block.Emit): Call ig.BeginScope() and
14011 ig.EndScope() when compiling with debugging info; call
14012 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14014 2003-03-08 Miguel de Icaza <miguel@ximian.com>
14016 * expression.cs (Indexers): Do not construct immediately, allow
14017 for new members to be appended as we go. Fixes 38143
14019 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14021 * expression.cs: save/restore context when resolving an unchecked
14024 2003-03-05 Miguel de Icaza <miguel@ximian.com>
14026 * cfold.cs: Catch division by zero in modulus operator during
14029 2003-03-03 Miguel de Icaza <miguel@ximian.com>
14031 * interface.cs (Interface.DefineMembers): Avoid defining members
14034 2003-02-27 Miguel de Icaza <miguel@ximian.com>
14036 * driver.cs: handle the +/- options for -noconfig
14038 * statement.cs (Unckeched.Resolve): Also track the state of
14039 unchecked in the Resolve phase.
14041 2003-02-27 Martin Baulig <martin@ximian.com>
14043 * ecore.cs (Expression.MemberLookup): Don't create a
14044 MethodGroupExpr for something which is not a method. Fixes #38291.
14046 2003-02-25 Miguel de Icaza <miguel@ximian.com>
14048 * class.cs (MemberBase.CheckParameters): Also check that the type
14049 is unmanaged if it is a pointer.
14051 * expression.cs (SizeOf.Resolve): Add location information.
14053 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14054 a managed type is declared.
14056 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14057 parameter modifiers as well. Fixes bug 38606
14059 * class.cs: Very sad. Am backing out the speed up changes
14060 introduced by the ArrayList -> Array in the TypeContainer, as they
14061 were not actually that much faster, and introduced a bug (no error
14062 reports on duplicated methods).
14064 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14065 source first, this will guarantee that we have a valid expression
14066 before calling in lower levels functions that will require a
14067 resolved object. Then use this original_source in the
14068 target.ResolveLValue instead of the original source that was
14071 Another change. Use target.Resolve instead of LValueResolve.
14072 Although we are resolving for LValues, we will let the Assign code
14073 take care of that (it will be called again from Resolve). This
14074 basically allows code like this:
14076 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14077 class Y { void A (X x) { x [0] += o; }
14079 The problem was that the indexer was trying to resolve for
14080 set_Item (idx, object o) and never finding one. The real set_Item
14081 was set_Item (idx, X). By delaying the process we get the right
14086 2003-02-23 Martin Baulig <martin@ximian.com>
14088 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14089 while calling DoEmit ().
14091 * codegen.cs (EmitContext.Mark): Don't mark locations in other
14092 source files; if you use the #line directive inside a method, the
14093 compiler stops emitting line numbers for the debugger until it
14094 reaches the end of the method or another #line directive which
14095 restores the original file.
14097 2003-02-23 Martin Baulig <martin@ximian.com>
14099 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14101 2003-02-23 Martin Baulig <martin@ximian.com>
14103 * statement.cs (Block.AddChildVariableNames): We need to call this
14104 recursively, not just for our immediate children.
14106 2003-02-23 Martin Baulig <martin@ximian.com>
14108 * class.cs (Event.Define): Always make the field private, like csc does.
14110 * typemanager.cs (TypeManager.RealMemberLookup): Make events
14111 actually work, fixes bug #37521.
14113 2003-02-23 Miguel de Icaza <miguel@ximian.com>
14115 * delegate.cs: When creating the various temporary "Parameters"
14116 classes, make sure that we call the ComputeAndDefineParameterTypes
14117 on those new parameters (just like we do with the formal ones), to
14118 allow them to be resolved in the context of the DeclSpace.
14120 This fixes the bug that Dick observed in Bugzilla #38530.
14122 2003-02-22 Miguel de Icaza <miguel@ximian.com>
14124 * expression.cs (ResolveMemberAccess): When resolving a constant,
14125 do not attempt to pull a constant if the value was not able to
14126 generate a valid constant.
14128 * const.cs (LookupConstantValue): Do not report more errors than required.
14130 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14132 * expression.cs: fixes bug #38328.
14134 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14136 * class.cs: Changed all the various members that can be part of a
14137 class from being an ArrayList to be an Array of the right type.
14138 During the DefineType type_list, interface_list, delegate_list and
14139 enum_list are turned into types, interfaces, delegates and enums
14142 And during the member population, indexer_list, event_list,
14143 constant_list, field_list, instance_constructor_list, method_list,
14144 operator_list and property_list are turned into their real arrays.
14146 Although we could probably perform this operation earlier, for
14147 good error reporting we need to keep the lists and remove the
14148 lists for longer than required.
14150 This optimization was triggered by Paolo profiling the compiler
14151 speed on the output of `gen-sample-program.pl' perl script.
14153 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14154 not crash in methods like MemberLookupFailed that use this field.
14156 This problem arises when the compiler fails to resolve a type
14157 during interface type definition for example.
14159 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14161 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14162 inherit from System.Object, so we have to stop at null, not only
14163 when reaching System.Object.
14165 2003-02-17 Miguel de Icaza <miguel@ximian.com>
14167 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14168 DeclaredOnly because the parent indexer might have had a different
14169 name, but did not loop until the top of the hierarchy was reached.
14171 The problem this one fixes is 35492: when a class implemented an
14172 indexer from an interface, we were getting the interface method
14173 (which was abstract) and we were flagging an error (can not invoke
14176 This also keeps bug 33089 functioning, and test-148 functioning.
14178 * typemanager.cs (IsSpecialMethod): The correct way of figuring
14179 out if a method is special is to see if it is declared in a
14180 property or event, or whether it is one of the predefined operator
14181 names. This should fix correctly #36804.
14183 2003-02-15 Miguel de Icaza <miguel@ximian.com>
14185 The goal here is to remove the dependency on EmptyCast.Peel ().
14186 Killing it completely.
14188 The problem is that currently in a number of places where
14189 constants are expected, we have to "probe" for an EmptyCast, and
14190 Peel, which is not the correct thing to do, as this will be
14191 repetitive and will likely lead to errors.
14193 The idea is to remove any EmptyCasts that are used in casts that
14194 can be reduced to constants, so we only have to cope with
14197 This bug hunt was triggered by Bug 37363 and the desire to remove
14198 the duplicate pattern where we were "peeling" emptycasts to check
14199 whether they were constants. Now constants will always be
14202 * ecore.cs: Use an enumconstant here instead of wrapping with
14205 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14206 throwing me off. By handling this we can get rid of a few hacks.
14208 * statement.cs (Switch): Removed Peel() code.
14210 2003-02-14 Miguel de Icaza <miguel@ximian.com>
14212 * class.cs: Location information for error 508
14214 * expression.cs (New.DoResolve): Add a guard against double
14215 resolution of an expression.
14217 The New DoResolve might be called twice when initializing field
14218 expressions (see EmitFieldInitializers, the call to
14219 GetInitializerExpression will perform a resolve on the expression,
14220 and later the assign will trigger another resolution
14222 This leads to bugs (#37014)
14224 * delegate.cs: The signature for EndInvoke should contain any ref
14225 or out parameters as well. We were not doing this in the past.
14227 * class.cs (Field.Define): Do not overwrite the type definition
14228 inside the `volatile' group. Turns out that volatile enumerations
14229 were changing the type here to perform a validity test, which
14232 2003-02-12 Miguel de Icaza <miguel@ximian.com>
14234 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14235 and structs, we do not want to load the instance variable
14237 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14238 enum_type has to be handled like an object reference (implicit
14239 conversions exists from this to object), but the regular IsClass
14240 and IsValueType tests will never return true for this one.
14242 Also we use TypeManager.IsValueType instead of type.IsValueType,
14243 just for consistency with the rest of the code (this is only
14244 needed if we ever use the construct exposed by test-180.cs inside
14245 corlib, which we dont today).
14247 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
14249 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14252 2003-02-09 Martin Baulig <martin@ximian.com>
14254 * namespace.cs (Namespace..ctor): Added SourceFile argument.
14255 (Namespace.DefineNamespaces): New static public method; this is
14256 called when we're compiling with debugging to add all namespaces
14257 to the symbol file.
14259 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14260 pass it to the Namespace's .ctor.
14262 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14263 and MethodBase arguments; pass the namespace ID to the symwriter;
14264 pass the MethodBase instead of the token to the symwriter.
14265 (SymbolWriter.DefineNamespace): New method to add a namespace to
14268 2003-02-09 Martin Baulig <martin@ximian.com>
14270 * symbolwriter.cs: New file. This is a wrapper around
14271 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
14272 methods here in near future.
14274 2003-02-09 Martin Baulig <martin@ximian.com>
14276 * codegen.cs (EmitContext.Mark): Just pass the arguments to
14277 ILGenerator.MarkSequencePoint() which are actually used by the
14280 2003-02-09 Martin Baulig <martin@ximian.com>
14282 * location.cs (SourceFile): New public sealed class. This
14283 contains the name and an index which is used in the location's token.
14284 (Location): Reserve an appropriate number of bits in the token for
14285 the source file instead of walking over that list, this gives us a
14286 really huge performance improvement when compiling with debugging.
14288 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14289 `SourceFile' argument instead of a string.
14290 (Driver.ProcessFile): Add all the files via Location.AddFile(),
14291 but don't parse/tokenize here, we need to generate the list of all
14292 source files before we do that.
14293 (Driver.ProcessFiles): New static function. Parses/tokenizes all
14296 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14297 instead of a string.
14299 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14302 2003-02-09 Martin Baulig <martin@ximian.com>
14304 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14305 filename on `#line default'.
14307 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14309 * statement.cs: don't clear the pinned var when the fixed statement
14310 returns from the method (fixes bug#37752).
14312 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14314 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
14317 2003-02-07 Martin Baulig <martin@ximian.com>
14319 * driver.cs: Removed the `--debug-args' command line argument.
14321 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14322 automatically by the AsssemblyBuilder.
14323 (CodeGen.InitializeSymbolWriter): We don't need to call any
14324 initialization function on the symbol writer anymore. This method
14325 doesn't take any arguments.
14327 2003-02-03 Miguel de Icaza <miguel@ximian.com>
14329 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14330 from referenced assemblies as well.
14332 2003-02-02 Martin Baulig <martin@ximian.com>
14334 * class.cs (MethodData.Emit): Generate debugging info for external methods.
14336 2003-02-02 Martin Baulig <martin@ximian.com>
14338 * class.cs (Constructor.Emit): Open the symbol writer before
14339 emitting the constructor initializer.
14340 (ConstructorInitializer.Emit): Call ec.Mark() to allow
14341 single-stepping through constructor initializers.
14343 2003-01-30 Miguel de Icaza <miguel@ximian.com>
14345 * class.cs: Handle error 549: do not allow virtual methods in
14348 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14350 * decl.cs: Check access levels when resolving types
14352 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14354 * statement.cs: Add parameters and locals set in catch blocks that might
14355 return to set vector
14357 2003-01-29 Miguel de Icaza <miguel@ximian.com>
14359 * class.cs (Operator): Set the SpecialName flags for operators.
14361 * expression.cs (Invocation.DoResolve): Only block calls to
14362 accessors and operators on SpecialName methods.
14364 (Cast.TryReduce): Handle conversions from char constants.
14367 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14369 * statement.cs: small memory and time optimization in FlowBranching.
14371 2003-01-28 Pedro Mart <yoros@wanadoo.es>
14373 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14374 problem that the last fix but in the other sid (Set).
14376 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14377 access when there is no indexer in the hierarchy.
14379 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14381 * class.cs: Combine some if statements.
14383 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14385 * driver.cs: fixed bug #37187.
14387 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
14389 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14390 any indexer, it's needed to build a list with all the indexers in the
14391 hierarchy (AllGetters), else we have problems. Fixes #35653.
14393 2003-01-23 Miguel de Icaza <miguel@ximian.com>
14395 * class.cs (MethodData.Define): It is wrong for an interface
14396 implementation to be static in both cases: explicit and implicit.
14397 We were only handling this in one case.
14399 Improve the if situation there to not have negations.
14401 * class.cs (Field.Define): Turns out that we do not need to check
14402 the unsafe bit on field definition, only on usage. Remove the test.
14404 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14406 * driver.cs: use assembly.Location instead of Codebase (the latest
14407 patch made mcs fail when using MS assemblies).
14409 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
14411 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14412 get the path to *corlib.dll.
14414 2003-01-21 Nick Drochak <ndrochak@gol.com>
14418 * typemanager.cs: Remove compiler warnings
14420 2003-01-20 Duncan Mak <duncan@ximian.com>
14422 * AssemblyInfo.cs: Bump the version number to 0.19.
14424 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14426 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14428 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
14430 * class.cs (Constructor::Emit): Emit debugging info for constructors.
14432 2003-01-17 Miguel de Icaza <miguel@ximian.com>
14434 * cs-parser.jay: Small fix: we were not comparing the constructor
14435 name correctly. Thanks to Zoltan for the initial pointer.
14437 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14439 * cs-tokenizer.cs: Set file name when specified with #line
14441 2003-01-15 Miguel de Icaza <miguel@ximian.com>
14443 * cs-parser.jay: Only perform the constructor checks here if we
14444 are named like the class; This will help provider a better
14445 error. The constructor path is taken when a type definition is
14446 not found, but most likely the user forgot to add the type, so
14447 report that rather than the constructor error.
14449 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14451 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14454 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14456 * cs-parser.jay: Add cleanup call.
14458 2003-01-13 Duncan Mak <duncan@ximian.com>
14460 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14461 consistent with other methods.
14463 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14465 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14467 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14469 * attribute.cs: only set GuidAttr to true when we have a
14472 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14476 * typemanager.cs: fixes to allow mcs compile corlib with the new
14477 Type.IsSubclassOf fix.
14479 2003-01-08 Miguel de Icaza <miguel@ximian.com>
14481 * expression.cs (LocalVariableReference.DoResolve): Classify a
14482 constant as a value, not as a variable. Also, set the type for
14485 * cs-parser.jay (fixed_statement): take a type instead of a
14486 pointer_type, so we can produce a better error message later.
14488 * statement.cs (Fixed.Resolve): Flag types that are not pointers
14491 (For.DoEmit): Make inifinite loops have a
14492 non-conditional branch back.
14494 (Fixed.DoEmit): First populate the pinned variables, then emit the
14495 statement, then clear the variables. Before I was emitting the
14496 code once for each fixed piece.
14499 2003-01-08 Martin Baulig <martin@ximian.com>
14501 * statement.cs (FlowBranching.MergeChild): A break in a
14502 SWITCH_SECTION does not leave a loop. Fixes #36155.
14504 2003-01-08 Martin Baulig <martin@ximian.com>
14506 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14507 lives in the same number space than `param_map'. Fixes #36154.
14509 2003-01-07 Miguel de Icaza <miguel@ximian.com>
14511 * cs-parser.jay (constructor_declaration): Set the
14512 Constructor.ModFlags before probing for it. This makes the
14513 compiler report 514, 515 and 132 (the code was there, but got
14516 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14517 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14518 (GotoCase.Resolve): Set `Returns' to ALWAYS.
14520 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14522 * enum.cs: create the enum static fields using the enum type.
14524 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14526 * class.cs: don't try to create the ParamBuilder for the return
14527 type if it's not needed (and handle it breaking for the ms runtime
14530 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14532 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14534 2002-12-29 Miguel de Icaza <miguel@ximian.com>
14536 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14537 the command. This showed up while compiling the JANET source
14538 code, which used \r as its only newline separator.
14540 2002-12-28 Miguel de Icaza <miguel@ximian.com>
14542 * class.cs (Method.Define): If we are an operator (because it
14543 reuses our code), then set the SpecialName and HideBySig. #36128
14545 2002-12-22 Miguel de Icaza <miguel@ximian.com>
14547 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14548 exception, report error 120 `object reference required'.
14550 * driver.cs: Add --pause option, used during to measure the size
14551 of the process as it goes with --timestamp.
14553 * expression.cs (Invocation.DoResolve): Do not allow methods with
14554 SpecialName to be invoked.
14556 2002-12-21 Miguel de Icaza <miguel@ximian.com>
14558 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14559 number before adding it.
14561 2002-12-21 Ravi Pratap <ravi@ximian.com>
14563 * ecore.cs (StandardImplicitConversion): When in an unsafe
14564 context, we allow conversion between void * to any other pointer
14565 type. This fixes bug #35973.
14567 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14569 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14570 is not thrown when extensionless outputs are used
14572 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14574 * rootcontext.cs: fixed compilation of corlib.
14576 2002-12-19 Miguel de Icaza <miguel@ximian.com>
14578 * attribute.cs (Attributes.Contains): Add new method.
14580 * class.cs (MethodCore.LabelParameters): if the parameter is an
14581 `out' parameter, check that no attribute `[In]' has been passed.
14583 * enum.cs: Handle the `value__' name in an enumeration.
14585 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
14587 * decl.cs: Added special case to allow overrides on "protected
14590 2002-12-18 Ravi Pratap <ravi@ximian.com>
14592 * attribute.cs (Attributes.AddAttributeSection): Rename to this
14593 since it makes much more sense.
14595 (Attributes.ctor): Don't require a Location parameter.
14597 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14599 * attribute.cs (ApplyAttributes): Remove extra Location parameters
14600 since we already have that information per attribute.
14602 * everywhere : make appropriate changes.
14604 * class.cs (LabelParameters): Write the code which actually
14605 applies attributes to the return type. We can't do this on the MS
14606 .NET runtime so we flag a warning in the case an exception is
14609 2002-12-18 Miguel de Icaza <miguel@ximian.com>
14611 * const.cs: Handle implicit null conversions here too.
14613 2002-12-17 Ravi Pratap <ravi@ximian.com>
14615 * class.cs (MethodCore.LabelParameters): Remove the extra
14616 Type [] parameter since it is completely unnecessary. Instead
14617 pass in the method's attributes so that we can extract
14618 the "return" attribute.
14620 2002-12-17 Miguel de Icaza <miguel@ximian.com>
14622 * cs-parser.jay (parse): Use Report.Error to flag errors instead
14623 of ignoring it and letting the compile continue.
14625 * typemanager.cs (ChangeType): use an extra argument to return an
14626 error condition instead of throwing an exception.
14628 2002-12-15 Miguel de Icaza <miguel@ximian.com>
14630 * expression.cs (Unary.TryReduce): mimic the code for the regular
14631 code path. Perform an implicit cast in the cases where we can
14632 implicitly convert to one of the integral types, and then reduce
14633 based on that constant. This fixes bug #35483.
14635 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14637 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14639 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14641 * namespace.cs: fixed bug #35489.
14643 2002-12-12 Miguel de Icaza <miguel@ximian.com>
14645 * class.cs: Remove some dead code.
14647 * cs-parser.jay: Estimate the number of methods needed
14648 (RootContext.MethodCount);
14650 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14651 numbers instead of StringBuilders.
14653 * support.cs (PtrHashtable): Add constructor with initial size;
14654 We can now reduce reallocations of the method table.
14656 2002-12-10 Ravi Pratap <ravi@ximian.com>
14658 * attribute.cs (ApplyAttributes): Keep track of the emitted
14659 attributes on a per-target basis. This fixes bug #35413.
14661 2002-12-10 Miguel de Icaza <miguel@ximian.com>
14663 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14664 default to the Windows 1252 encoding.
14666 (UnixParseOption): Support version, thanks to Alp for the missing
14669 * AssemblyInfo.cs: Add nice assembly information.
14671 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14674 * cs-parser.jay: Allow a trailing comma before the close bracked
14675 in the attribute_section production.
14677 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14678 address of the instance was being taken, I will take this out,
14679 because we take the address of the object immediately here.
14681 2002-12-09 Ravi Pratap <ravi@ximian.com>
14683 * typemanager.cs (AreMultipleAllowed): Take care of the most
14684 obvious case where attribute type is not in the current assembly -
14687 2002-12-08 Miguel de Icaza <miguel@ximian.com>
14689 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14690 definitions, instead of doing that afterwards.
14692 Also we use a nice little hack, depending on the constructor, we
14693 know if we are a "composed" name or a simple name. Hence, we
14694 avoid the IndexOf test, and we avoid
14696 * codegen.cs: Add code to assist in a bug reporter to track down
14697 the source of a compiler crash.
14699 2002-12-07 Ravi Pratap <ravi@ximian.com>
14701 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14702 types have been emitted for a given element and flag an error
14703 if something which does not have AllowMultiple set is used more
14706 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14707 attribute types and their corresponding AllowMultiple properties
14709 (AreMultipleAllowed): Check the property for a given type.
14711 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14712 property in the case we have a TypeContainer.
14714 (Attributes.AddAttribute): Detect duplicates and just skip on
14715 adding them. This trivial fix catches a pretty gross error in our
14716 attribute emission - global attributes were being emitted twice!
14718 Bugzilla bug #33187 is now fixed.
14720 2002-12-06 Miguel de Icaza <miguel@ximian.com>
14722 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14723 instead of pp_and).
14725 * expression.cs (Binary.ResolveOperator): I can only use the
14726 Concat (string, string, string) and Concat (string, string,
14727 string, string) if the child is actually a concatenation of
14730 2002-12-04 Miguel de Icaza <miguel@ximian.com>
14732 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14733 context where we need a 2-character lookahead.
14735 * pending.cs (PendingImplementation): Rework so we can keep track
14736 of interface types all the time, and flag those which were
14737 implemented by parents as optional.
14739 2002-12-03 Miguel de Icaza <miguel@ximian.com>
14741 * expression.cs (Binary.ResolveOperator): Use
14742 String.Concat(string,string,string) or
14743 String.Concat(string,string,string,string) when possible.
14745 * typemanager: More helper methods.
14748 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14750 * pending.cs: remove the bogus return from GetMissingInterfaces()
14751 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14753 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14755 * namespace.cs: avoid duplicated 'using xxx' being added to
14756 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14757 when we get more than one 'using' statement for the same namespace.
14758 Report a CS0105 warning for it.
14760 2002-11-30 Miguel de Icaza <miguel@ximian.com>
14762 * cs-tokenizer.cs (consume_identifier): use read directly, instead
14763 of calling getChar/putback, uses internal knowledge of it.
14765 (xtoken): Reorder tokenizer so most common patterns are checked
14766 first. This reduces the compilation time in another 5% (from 8.11s
14767 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14769 The parsing time is 22% of the compilation in mcs, and from that
14770 64% is spent on the tokenization process.
14772 I tried using a binary search for keywords, but this is slower
14773 than the hashtable. Another option would be to do a couple of
14776 * Not use a StringBuilder, instead use an array of chars,
14777 with a set value. Notice that this way we could catch
14778 the 645 error without having to do it *afterwards*.
14780 * We could write a hand-parser to avoid the hashtable
14781 compares altogether.
14783 The identifier consumption process takes 37% of the tokenization
14784 time. Another 15% is spent on is_number. 56% of the time spent
14785 on is_number is spent on Int64.Parse:
14787 * We could probably choose based on the string length to
14788 use Int32.Parse or Int64.Parse and avoid all the 64-bit
14791 Another 3% is spend on wrapping `xtoken' in the `token' function.
14793 Handle 0xa0 as whitespace (#34752)
14795 2002-11-26 Miguel de Icaza <miguel@ximian.com>
14797 * typemanager.cs (IsCLRType): New routine to tell whether a type
14798 is one of the builtin types.
14800 Maybe it needs to use TypeCodes to be faster. Maybe we could use
14801 typecode in more places instead of doing pointer comparissions.
14802 We could leverage some knowledge about the way the typecodes are
14805 New code to cache namespaces in assemblies, it is currently not
14806 invoked, to be used soon.
14808 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14810 * expression.cs (Binary.ResolveOperator): specially handle
14811 strings, and do not perform user-defined operator overloading for
14814 2002-11-24 Miguel de Icaza <miguel@ximian.com>
14816 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14817 internalcall as it is a pretty simple operation; Avoid whenever
14818 possible to call Char.IsLetter.
14820 (consume_identifier): Cut by half the number of
14821 hashtable calls by merging the is_keyword and GetKeyword behavior.
14823 Do not short-circuit, because if we do, we
14824 report errors (ie, #if false && true would produce an invalid
14828 2002-11-24 Martin Baulig <martin@ximian.com>
14830 * expression.cs (Cast.TryReduce): If we're in checked syntax,
14831 check constant ranges and report a CS0221. Fixes #33186.
14833 2002-11-24 Martin Baulig <martin@ximian.com>
14835 * cs-parser.jay: Make this work for uninitialized variable
14836 declarations in the `for' initializer. Fixes #32416.
14838 2002-11-24 Martin Baulig <martin@ximian.com>
14840 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14841 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
14843 2002-11-24 Martin Baulig <martin@ximian.com>
14845 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14846 argument; if true, we also check for user-defined conversions.
14847 This is only needed if both arguments are of a user-defined type.
14848 Fixes #30443, added test-175.cs.
14849 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14851 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14853 2002-11-24 Martin Baulig <martin@ximian.com>
14855 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14856 function to get the store opcode.
14857 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14858 only emit the Ldelema if the store opcode is Stobj. You must run
14859 both test-34 and test-167 to test this. Fixes #34529.
14861 2002-11-23 Martin Baulig <martin@ximian.com>
14863 * ecore.cs (Expression.MemberLookup): Added additional
14864 `qualifier_type' argument which is used when we're being called
14865 from MemberAccess.DoResolve() and null if we're called from a
14867 (Expression.MemberLookupFailed): New method to report errors; this
14868 does the CS1540 check and reports the correct error message.
14870 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14871 argument for the CS1540 check and redone the way how we're dealing
14872 with private members. See the comment in the source code for details.
14873 (FilterWithClosure): Reverted this back to revision 1.197; renamed
14874 `closure_start_type' to `closure_qualifier_type' and check whether
14875 it's not null. It was not this filter being broken, it was just
14876 being called with the wrong arguments.
14878 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14879 and pass it the correct `qualifier_type'; this also does the error
14882 2002-11-22 Miguel de Icaza <miguel@ximian.com>
14884 * expression.cs (Invocation.EmitParams): If the we are dealing
14885 with a non-built-in value type, load its address as well.
14887 (ArrayCreation): Use a a pretty constant instead
14888 of the hardcoded value 2. Use 6 instead of 2 for the number of
14889 static initializers.
14891 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14892 because they are not really value types, just glorified integers.
14894 * driver.cs: Do not append .exe, the CSC compiler does not do it.
14896 * ecore.cs: Remove redundant code for enumerations, make them use
14897 the same code path as everything else, fixes the casting issue
14898 with enumerations in Windows.Forms.
14900 * attribute.cs: Do only cast to string if it is a string, the
14901 validation happens later.
14903 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14904 people upgrade their corlibs.
14906 * ecore.cs: Oops, enumerations were not following the entire code path
14908 2002-11-21 Miguel de Icaza <miguel@ximian.com>
14910 * typemanager.cs (FilterWithClosure): Commented out the test for
14911 1540 in typemanager.cs, as it has problems when accessing
14912 protected methods from a parent class (see test-174.cs).
14914 * attribute.cs (Attribute.ValidateGuid): new method.
14915 (Attribute.Resolve): Use above.
14917 2002-11-19 Miguel de Icaza <miguel@ximian.com>
14919 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14921 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14922 handling for enumerations, as we only needed the TypeContainer
14923 functionality to begin with (this is required for the fix below to
14924 work for enums that reference constants in a container class for
14927 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14929 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14930 a valid TypeBuilder to perform lookups on.o
14932 * class.cs (InheritableMemberSignatureCompare): Use true in the
14933 call to GetGetMethod and GetSetMethod, because we are comparing
14934 the signature, and we need to get the methods *even* if they are
14937 (PropertyBase.CheckBase): ditto.
14939 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14940 GotoCase.Resolve): Use Peel on EmpytCasts.
14942 * ecore.cs (EmptyCast): drop child, add Peel method.
14944 2002-11-17 Martin Baulig <martin@ximian.com>
14946 * ecore.cs (EmptyCast.Child): New public property.
14948 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14949 label resolved to an EmptyCast. Fixes #34162.
14950 (GotoCase.Resolve): Likewise.
14951 (Block.EmitMeta): Likewise.
14953 2002-11-17 Martin Baulig <martin@ximian.com>
14955 * expression.cs (Invocation.BetterConversion): Prefer int over
14956 uint; short over ushort; long over ulong for integer literals.
14957 Use ImplicitConversionExists instead of StandardConversionExists
14958 since we also need to check for user-defined implicit conversions.
14959 Fixes #34165. Added test-173.cs.
14961 2002-11-16 Martin Baulig <martin@ximian.com>
14963 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14964 with the `true' and `false' literals. Fixes #33151.
14966 2002-11-16 Martin Baulig <martin@ximian.com>
14968 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14969 October 22nd; don't do the cs1540 check for static members.
14971 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14972 now using our own filter here and doing the cs1540 check again.
14974 2002-11-16 Martin Baulig <martin@ximian.com>
14976 * support.cs (InternalParameters): Don't crash if we don't have
14977 any fixed parameters. Fixes #33532.
14979 2002-11-16 Martin Baulig <martin@ximian.com>
14981 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14982 when looking up static methods to make this work on Windows.
14985 2002-11-16 Martin Baulig <martin@ximian.com>
14987 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14988 a setter rather than using PropertyInfo.CanWrite.
14990 2002-11-15 Nick Drochak <ndrochak@gol.com>
14992 * class.cs: Allow acces to block member by subclasses. Fixes build
14995 2002-11-14 Martin Baulig <martin@ximian.com>
14997 * class.cs (Constructor.Emit): Added the extern/block check.
15000 2002-11-14 Martin Baulig <martin@ximian.com>
15002 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15003 iteration while looking for indexers, this is needed because the
15004 indexer may have a different name in our base classes. Fixed the
15005 error reporting (no indexers at all, not get accessor, no
15006 overloaded match). Fixes bug #33089.
15007 (IndexerAccess.DoResolveLValue): Likewise.
15009 2002-11-14 Martin Baulig <martin@ximian.com>
15011 * class.cs (PropertyBase.CheckBase): Make this work for multiple
15012 indexers. Fixes the first part of bug #33089.
15013 (MethodSignature.InheritableMemberSignatureCompare): Added support
15016 2002-11-13 Ravi Pratap <ravi@ximian.com>
15018 * attribute.cs (Attribute.Resolve): Catch the
15019 NullReferenceException and report it since it isn't supposed to
15022 2002-11-12 Miguel de Icaza <miguel@ximian.com>
15024 * expression.cs (Binary.EmitBranchable): Also handle the cases for
15025 LogicalOr and LogicalAnd that can benefit from recursively
15026 handling EmitBranchable. The code now should be nice for Paolo.
15028 2002-11-08 Miguel de Icaza <miguel@ximian.com>
15030 * typemanager.cs (LookupType): Added a negative-hit hashtable for
15031 the Type lookups, as we perform quite a number of lookups on
15032 non-Types. This can be removed once we can deterministically tell
15033 whether we have a type or a namespace in advance.
15035 But this might require special hacks from our corlib.
15039 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15040 and double which avoids a conversion from an integer to a double.
15042 * expression.cs: tiny optimization, avoid calling IsConstant,
15043 because it effectively performs the lookup twice.
15045 2002-11-06 Miguel de Icaza <miguel@ximian.com>
15047 But a bogus return here to keep the semantics of the old code
15048 until the Mono runtime is fixed.
15050 * pending.cs (GetMissingInterfaces): New method used to remove all
15051 the interfaces that are already implemented by our parent
15052 classes from the list of pending methods.
15054 * interface.cs: Add checks for calls after ResolveTypeExpr.
15056 2002-11-05 Miguel de Icaza <miguel@ximian.com>
15058 * class.cs (Class.Emit): Report warning 67: event not used if the
15059 warning level is beyond 3.
15061 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15062 being a NullLiteral.
15064 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15067 * class.cs (TypeContainer.GetClassBases): Cover a missing code
15068 path that might fail if a type can not be resolved.
15070 * expression.cs (Binary.Emit): Emit unsigned versions of the
15073 * driver.cs: use error 5.
15075 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15077 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15079 2002-11-01 Miguel de Icaza <miguel@ximian.com>
15081 * cs-parser.jay (switch_section): A beautiful patch from Martin
15082 Baulig that fixed 33094.
15084 2002-10-31 Miguel de Icaza <miguel@ximian.com>
15086 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15087 Check whether the base is abstract and report an error if so.
15089 * expression.cs (IndexerAccess.DoResolveLValue,
15090 IndexerAccess.DoResolve): ditto.
15092 (Invocation.DoResolve): ditto.
15094 (Invocation.FullMethodDesc): Improve the report string.
15096 * statement.cs (Block): Eliminate IsVariableDefined as it is
15097 basically just a wrapper for GetVariableInfo.
15099 * ecore.cs (SimpleName): Use new
15101 * support.cs (ReflectionParamter.ParameterType): We unwrap the
15102 type, as we return the actual parameter ref/unref state on a
15105 2002-10-30 Miguel de Icaza <miguel@ximian.com>
15107 * support.cs: Return proper flags REF/OUT fixing the previous
15110 * expression.cs: Reverted last patch, that was wrong. Is_ref is
15111 not used to mean `ref' but `ref or out' in ParameterReference
15113 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15114 full type signature instead of calling TypeManger.CSharpName
15117 * support.cs (InternalParameters.ParameterDesc): Do not compare
15118 directly to the modflags, because REF/OUT will actually be bitsets
15121 * delegate.cs (VerifyMethod): Check also the modifiers.
15123 * cs-tokenizer.cs: Fix bug where floating point values with an
15124 exponent where a sign was missing was ignored.
15126 * driver.cs: Allow multiple assemblies to be specified in a single
15129 2002-10-28 Miguel de Icaza <miguel@ximian.com>
15131 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
15132 because identifiers after a parenthesis would end up in this kind
15133 of production, and we needed to desamiguate it for having casts
15136 (UserDefinedType *) xxx
15138 2002-10-24 Miguel de Icaza <miguel@ximian.com>
15140 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15141 we should set on the Bindingflags.NonPublic, but not turn on
15142 private_ok. private_ok controls whether a Private member is
15143 returned (this is chekced on the filter routine), while the
15144 BindingFlags.NonPublic just controls whether private/protected
15145 will be allowed. This fixes the problem part of the problem of
15146 private properties being allowed to be used in derived classes.
15148 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15149 so we can call the children DoResolveLValue method (this will
15150 properly signal errors on lvalue assignments to base properties)
15152 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15153 getter are null, and we have a property info, we know that this
15154 happened because the lookup failed, so we report an error 122 for
15155 protection level violation.
15157 We also silently return if setter and getter are null in the
15158 resolve functions, this condition only happens if we have flagged
15159 the error before. This is the other half of the problem.
15161 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15162 not have accessibility information, that is why we were returning
15163 true in the filter function in typemanager.cs.
15165 To properly report 122 (property is inaccessible because of its
15166 protection level) correctly, we report this error in ResolveAccess
15167 by failing if both the setter and the getter are lacking (ie, the
15170 DoResolve and DoLResolve have been modified to check for both
15171 setter/getter being null and returning silently, the reason being
15172 that I did not want to put the knowledge about this error in upper
15175 int old = Report.Errors;
15176 x = new PropertyExpr (...);
15177 if (old != Report.Errors)
15182 So the property expr is returned, but it is invalid, so the error
15183 will be flagged during the resolve process.
15185 * class.cs: Remove InheritablePropertySignatureCompare from the
15186 class, as we no longer depend on the property signature to compute
15187 whether it is possible to implement a method or not.
15189 The reason is that calling PropertyInfo.GetGetMethod will return
15190 null (in .NET, in Mono it works, and we should change this), in
15191 cases where the Get Method does not exist in that particular
15196 class X { public virtual int A { get { return 1; } } }
15198 class Z : Y { public override int A { get { return 2; } } }
15200 Would fail in Z because the parent (Y) would not have the property
15201 defined. So we avoid this completely now (because the alternative
15202 fix was ugly and slow), and we now depend exclusively on the
15205 (PropertyBase.CheckBase): Use a method-base mechanism to find our
15206 reference method, instead of using the property.
15208 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15209 routines are gone now.
15211 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15212 names, they were incorrectly named.
15214 * cs-tokenizer.cs: Return are more gentle token on failure.
15216 * pending.cs (PendingImplementation.InterfaceMethod): This routine
15217 had an out-of-sync index variable, which caused it to remove from
15218 the list of pending methods the wrong method sometimes.
15220 2002-10-22 Miguel de Icaza <miguel@ximian.com>
15222 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15223 CanWrite, because those refer to this particular instance of the
15224 property, and do not take into account the fact that we can
15225 override single members of a property.
15227 Constructor requires an EmitContext. The resolution process does
15228 not happen here, but we need to compute the accessors before,
15229 because the resolution does not always happen for properties.
15231 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15232 subclass, before we did not update this flag, but we did update
15235 (GetAccessors): Drop this routine, as it did not work in the
15236 presence of partially overwritten set/get methods.
15238 Notice that this broke the cs1540 detection, but that will require
15241 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15245 * driver.cs: issue a warning instead of an error if we don't support
15246 debugging for the platform. Also ignore a couple of errors that may
15247 arise when trying to write the symbols. Undo my previous patch.
15249 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15251 * driver.cs: ignore /debug switch except for Unix platforms.
15253 2002-10-23 Nick Drochak <ndrochak@gol.com>
15255 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15257 2002-10-21 Miguel de Icaza <miguel@ximian.com>
15259 * driver.cs: Do not make mcs-debug conditional, so we do not break
15260 builds that use it.
15262 * statement.cs (UsageVector.MergeChildren): I would like Martin to
15263 review this patch. But basically after all the children variables
15264 have been merged, the value of "Breaks" was not being set to
15265 new_breaks for Switch blocks. I think that it should be set after
15266 it has executed. Currently I set this to the value of new_breaks,
15267 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15268 conservative, but I do not understand this code very well.
15270 I did not break anything in the build, so that is good ;-)
15272 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15274 2002-10-20 Mark Crichton <crichton@gimp.org>
15276 * cfold.cs: Fixed compile blocker. Really fixed it this time.
15278 2002-10-20 Nick Drochak <ndrochak@gol.com>
15280 * cfold.cs: Fixed compile blocker.
15282 2002-10-20 Miguel de Icaza <miguel@ximian.com>
15284 * driver.cs: I was chekcing the key, not the file.
15286 2002-10-19 Ravi Pratap <ravi@ximian.com>
15288 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15289 message that we were generating - we just need to silently return
15292 2002-10-19 Miguel de Icaza <miguel@ximian.com>
15294 * class.cs (Event.Define): Change my previous commit, as this
15295 breaks the debugger. This is a temporary hack, as it seems like
15296 the compiler is generating events incorrectly to begin with.
15298 * expression.cs (Binary.ResolveOperator): Added support for
15299 "U operator - (E x, E y)"
15301 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15304 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15305 init-only variables, but this path did not take into account that
15306 there might be also instance readonly variables. Correct this
15309 This fixes bug 32253
15311 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15314 * driver.cs: Change the extension for modules to `netmodule'
15316 * cs-parser.jay: Improved slightly the location tracking for
15317 the debugger symbols.
15319 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15320 modifiers that were specified instead of the hardcoded value
15321 (FamAndAssem). This was basically ignoring the static modifier,
15322 and others. Fixes 32429.
15324 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15325 fixed a bug in the process (32476)
15327 * expression.cs (ArrayAccess.EmitAssign): Patch from
15328 hwang_rob@yahoo.ca that fixes bug 31834.3
15330 2002-10-18 Miguel de Icaza <miguel@ximian.com>
15332 * driver.cs: Make the module extension .netmodule.
15334 2002-10-16 Miguel de Icaza <miguel@ximian.com>
15336 * driver.cs: Report an error if the resource file is not found
15337 instead of crashing.
15339 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15340 false, like Emit does.
15342 2002-10-16 Nick Drochak <ndrochak@gol.com>
15344 * typemanager.cs: Remove unused private member. Also reported mcs
15345 bug to report this as a warning like csc.
15347 2002-10-15 Martin Baulig <martin@gnome.org>
15349 * statement.cs (Statement.Emit): Made this a virtual method; emits
15350 the line number info and calls DoEmit().
15351 (Statement.DoEmit): New protected abstract method, formerly knows
15352 as Statement.Emit().
15354 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15356 2002-10-11 Miguel de Icaza <miguel@ximian.com>
15358 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15359 have fixed a remaining problem: not every AddXXXX was adding a
15360 fully qualified name.
15362 Now everyone registers a fully qualified name in the DeclSpace as
15363 being defined instead of the partial name.
15365 Downsides: we are slower than we need to be due to the excess
15366 copies and the names being registered this way.
15368 The reason for this is that we currently depend (on the corlib
15369 bootstrap for instance) that types are fully qualified, because
15370 we dump all the types in the namespace, and we should really have
15371 types inserted into the proper namespace, so we can only store the
15372 basenames in the defined_names array.
15374 2002-10-10 Martin Baulig <martin@gnome.org>
15376 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15377 from bug #31834, see the bug report for a testcase which is
15380 2002-10-10 Martin Baulig <martin@gnome.org>
15382 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15383 flow analysis code for this.
15385 * statement.cs (Do, While, For): Tell the flow analysis code about
15387 (FlowBranching.UsageVector): Added support for infinite loops.
15388 (Block.Resolve): Moved the dead code elimination here and use flow
15391 2002-10-09 Miguel de Icaza <miguel@ximian.com>
15393 * class.cs (Field.Define): Catch cycles on struct type
15396 * typemanager.cs (IsUnmanagedtype): Do not recursively check
15397 fields if the fields are static. We only need to check instance
15400 * expression.cs (As.DoResolve): Test for reference type.
15402 * statement.cs (Using.ResolveExpression): Use
15403 ConvertImplicitRequired, not ConvertImplicit which reports an
15405 (Using.ResolveLocalVariableDecls): ditto.
15407 * expression.cs (Binary.ResolveOperator): Report errors in a few
15408 places where we had to.
15410 * typemanager.cs (IsUnmanagedtype): Finish implementation.
15412 2002-10-08 Miguel de Icaza <miguel@ximian.com>
15414 * expression.cs: Use StoreFromPtr instead of extracting the type
15415 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
15417 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15418 an enumeration value to a System.Enum, but System.Enum is not a
15419 value type, but an class type, so we need to box.
15421 (Expression.ConvertExplicit): One codepath could return
15422 errors but not flag them. Fix this. Fixes #31853
15424 * parameter.cs (Resolve): Do not allow void as a parameter type.
15426 2002-10-06 Martin Baulig <martin@gnome.org>
15428 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15429 if it's a class type and not a struct. Fixes #31815.
15431 2002-10-06 Martin Baulig <martin@gnome.org>
15433 * statement.cs: Reworked the flow analysis code a bit to make it
15434 usable for dead code elimination.
15436 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15438 * cs-parser.jay: allow empty source files. Fixes bug #31781.
15440 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15442 * expression.cs (ComposedCast.DoResolveType): A quick workaround
15443 to fix the test 165, will investigate deeper.
15445 2002-10-04 Martin Baulig <martin@gnome.org>
15447 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15448 finally blocks actually work.
15449 (Try.Resolve): We don't need to create a sibling for `finally' if
15450 there is no finally block.
15452 2002-10-04 Martin Baulig <martin@gnome.org>
15454 * class.cs (Constructor.Define): The default accessibility for a
15455 non-default constructor is private, not public.
15457 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15459 * class.cs (Constructor): Make AllowedModifiers public, add
15462 * cs-parser.jay: Perform the modifiers test here, as the
15463 constructor for the Constructor class usually receives a zero
15464 because of the way we create it (first we create, later we
15465 customize, and we were never checking the modifiers).
15467 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15468 is a version of LookupTypeReflection that includes the type-name
15469 cache. This can be used as a fast path for functions that know
15470 the fully qualified name and are only calling into *.GetType() to
15471 obtain a composed type.
15473 This is also used by TypeManager.LookupType during its type
15476 (LookupType): We now also track the real type name, as sometimes
15477 we can get a quey for the real type name from things like
15478 ComposedCast. This fixes bug 31422.
15480 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15481 complete type fullname, it does not have to go through the type
15482 resolution system to obtain the composed version of the type (for
15483 obtaining arrays or pointers).
15485 (Conditional.Emit): Use the EmitBoolExpression to
15486 generate nicer code, as requested by Paolo.
15488 (ArrayCreation.CheckIndices): Use the patch from
15489 hwang_rob@yahoo.ca to validate the array initializers.
15491 2002-10-03 Miguel de Icaza <miguel@ximian.com>
15493 * class.cs (ConstructorInitializer.Emit): simplify code by using
15494 Invocation.EmitCall, and at the same time, fix the bugs in calling
15495 parent constructors that took variable arguments.
15497 * ecore.cs (Expression.ConvertNumericExplicit,
15498 Expression.ImplicitNumericConversion): Remove the code that
15499 manually wrapped decimal (InternalTypeConstructor call is now gone
15502 * expression.cs (Cast.TryReduce): Also handle decimal types when
15503 trying to perform a constant fold on the type.
15505 * typemanager.cs (IsUnmanagedtype): Partially implemented.
15507 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15508 that only turned off an error report, and did nothing else.
15510 2002-10-02 Miguel de Icaza <miguel@ximian.com>
15512 * driver.cs: Handle and ignore /fullpaths
15514 2002-10-01 Miguel de Icaza <miguel@ximian.com>
15516 * expression.cs (Binary.ResolveOperator): Catch the case where
15517 DoNumericPromotions returns true,
15519 (Binary.DoNumericPromotions): Simplify the code, and the tests.
15521 2002-09-27 Miguel de Icaza <miguel@ximian.com>
15523 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15526 2002-09-26 Miguel de Icaza <miguel@ximian.com>
15528 * ecore.cs (ConvertNumericExplicit): It is not enough that the
15529 conversion exists, but it is also required that the conversion be
15530 performed. This manifested in "(Type64Enum) 2".
15532 * class.cs (TypeManager.AddMethod): The fix is not to change
15533 AddEnum, because that one was using a fully qualified name (every
15534 DeclSpace derivative does), but to change the AddMethod routine
15535 that was using an un-namespaced name. This now correctly reports
15536 the duplicated name.
15538 Revert patch until I can properly fix it. The issue
15539 is that we have a shared Type space across all namespaces
15540 currently, which is wrong.
15542 Options include making the Namespace a DeclSpace, and merge
15543 current_namespace/current_container in the parser.
15545 2002-09-25 Miguel de Icaza <miguel@ximian.com>
15547 * cs-parser.jay: Improve error reporting when we get a different
15548 kind of expression in local_variable_type and
15549 local_variable_pointer_type.
15551 Propagate this to avoid missleading errors being reported.
15553 * ecore.cs (ImplicitReferenceConversion): treat
15554 TypeManager.value_type as a target just like object_type. As
15559 Is valid, and needs to result in the int 1 being boxed before it
15560 is assigned to the value type v.
15562 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15563 to validate the enumeration name.
15565 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15566 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
15567 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15569 * ecore.cs (TryImplicitIntConversion): When doing an
15570 implicit-enumeration-conversion, check if the type is 64-bits and
15571 perform a conversion before passing to EnumConstant.
15573 2002-09-23 Miguel de Icaza <miguel@ximian.com>
15575 * decl.cs (Error_AmbiguousTypeReference); New routine used to
15576 report ambiguous type references. Unlike the MS version, we
15577 report what the ambiguity is. Innovation at work ;-)
15579 (DeclSpace.FindType): Require a location argument to
15580 display when we display an ambiguous error.
15582 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15584 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15586 * expression.cs (EmitDynamicInitializers): Apply patch from
15587 hwang_rob@yahoo.ca that fixes the order in which we emit our
15590 2002-09-21 Martin Baulig <martin@gnome.org>
15592 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15593 delegate takes no arguments.
15595 2002-09-20 Miguel de Icaza <miguel@ximian.com>
15597 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15600 * expression.cs: Extract the underlying type.
15602 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15604 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15606 2002-09-19 Miguel de Icaza <miguel@ximian.com>
15608 * class.cs (TypeContainer.DefineType): We can not use the nice
15609 PackingSize with the size set to 1 DefineType method, because it
15610 will not allow us to define the interfaces that the struct
15613 This completes the fixing of bug 27287
15615 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15616 means also structs. This fixes part of the problem.
15617 (Expresion.ImplicitReferenceConversionExists): ditto.
15619 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15620 error if there were no errors reported during the type lookup
15621 process, to avoid duplicates or redundant errors. Without this
15622 you would get an ambiguous errors plus a type not found. We have
15623 beaten the user enough with the first error.
15625 (DeclSparce.FindType): Emit a warning if we have an ambiguous
15628 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15629 during the resolution process, stop the lookup, this avoids
15630 repeated error reports (same error twice).
15632 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15634 * typemanager.cs (LookupType): Redo the type lookup code to match
15635 the needs of System.Reflection.
15637 The issue is that System.Reflection requires references to nested
15638 types to begin with a "+" sign instead of a dot. So toplevel
15639 types look like: "NameSpace.TopLevelClass", and nested ones look
15640 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15643 2002-09-19 Martin Baulig <martin@gnome.org>
15645 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15646 says that a method always returns or always throws an exception,
15647 don't report the CS0161.
15649 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15650 set `Returns = new_returns'.
15652 2002-09-19 Martin Baulig <martin@gnome.org>
15654 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15655 to an enum constant, check for a CS0176.
15657 2002-09-18 Miguel de Icaza <miguel@ximian.com>
15659 * class.cs (TypeContainer.CheckPairedOperators): Now we check
15660 for operators that must be in pairs and report errors.
15662 * ecore.cs (SimpleName.DoResolveType): During the initial type
15663 resolution process, when we define types recursively, we must
15664 check first for types in our current scope before we perform
15665 lookups in the enclosing scopes.
15667 * expression.cs (MakeByteBlob): Handle Decimal blobs.
15669 (Invocation.VerifyArgumentsCompat): Call
15670 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15671 I thought we were supposed to always call this, but there are a
15672 few places in the code where we dont do it.
15674 2002-09-17 Miguel de Icaza <miguel@ximian.com>
15676 * driver.cs: Add support in -linkres and -resource to specify the
15677 name of the identifier.
15679 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15681 * ecore.cs (StandardConversionExists): Sync with the conversion
15682 code: allow anything-* to void* conversions.
15684 (FindMostSpecificSource): Use an Expression argument
15685 instead of a Type, because we might be handed over a Literal which
15686 gets a few more implicit conversions that plain types do not. So
15687 this information was being lost.
15689 Also, we drop the temporary type-holder expression when not
15692 2002-09-17 Martin Baulig <martin@gnome.org>
15694 * class.cs (PropertyBase.CheckBase): Don't check the base class if
15695 this is an explicit interface implementation.
15697 2002-09-17 Martin Baulig <martin@gnome.org>
15699 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15700 different `IndexerName' attributes.
15702 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15703 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15704 virtual CommonResolve().
15706 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15708 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15709 and convert that to the UnderlyingType.
15711 * statement.cs (Foreach.Resolve): Indexers are just like variables
15712 or PropertyAccesses.
15714 * cs-tokenizer.cs (consume_string): Track line numbers and columns
15715 inside quoted strings, we were not doing this before.
15717 2002-09-16 Martin Baulig <martin@gnome.org>
15719 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15720 resolve it. This is needed for the definite assignment check of the
15721 instance expression, fixes bug #29846.
15722 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15724 2002-09-16 Nick Drochak <ndrochak@gol.com>
15726 * parameter.cs: Fix compile error. Cannot reference static member
15727 from an instance object. Is this an mcs bug?
15729 2002-09-14 Martin Baulig <martin@gnome.org>
15731 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15732 multiple times. Fixes bug #30295, added test-166.cs.
15734 2002-09-14 Martin Baulig <martin@gnome.org>
15736 * statement.cs (Block.Emit): Don't emit unreachable code.
15737 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15738 `break' statements.
15739 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15741 2002-09-14 Martin Baulig <martin@gnome.org>
15743 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15746 2002-09-14 Martin Baulig <martin@gnome.org>
15748 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15749 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15750 be false on the ms runtime.
15752 2002-09-13 Martin Baulig <martin@gnome.org>
15754 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15755 the CS0038 error message.
15757 2002-09-12 Miguel de Icaza <miguel@ximian.com>
15759 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15760 constant inside, return it.
15762 2002-09-12 Martin Baulig <martin@gnome.org>
15764 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15765 implicit conversion can be done between enum types.
15767 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15768 check whether an implicit conversion to the current enum's UnderlyingType
15769 exists and report an error if not.
15771 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15772 without debugging support.
15774 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15775 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
15777 2002-09-12 Martin Baulig <martin@gnome.org>
15779 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15781 * ecore.cs (IMemberExpr.DeclaringType): New property.
15782 (SimpleName.SimpleNameResolve): Check whether we're accessing a
15783 nonstatic member of an outer type (CS0038).
15785 2002-09-11 Miguel de Icaza <miguel@ximian.com>
15787 * driver.cs: Activate the using-error detector at warning level
15788 4 (at least for MS-compatible APIs).
15790 * namespace.cs (VerifyUsing): Small buglett fix.
15792 * pending.cs (PendingImplementation): pass the container pointer.
15794 * interface.cs (GetMethods): Allow for recursive definition. Long
15795 term, I would like to move every type to support recursive
15796 definitions, not the current ordering mechanism that we have right
15799 The situation is this: Attributes are handled before interfaces,
15800 so we can apply attributes to interfaces. But some attributes
15801 implement interfaces, we will now handle the simple cases
15802 (recursive definitions will just get an error).
15804 * parameter.cs: Only invalidate types at the end if we fail to
15807 2002-09-09 Martin Baulig <martin@gnome.org>
15809 * ecore.cs (PropertyExpr.Emit): Also check for
15810 TypeManager.system_int_array_get_length so this'll also work when
15811 compiling corlib. Fixes #30003.
15813 2002-09-09 Martin Baulig <martin@gnome.org>
15815 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15816 and throw an exception if we can't get the type's size. Fixed #30040,
15819 2002-09-09 Martin Baulig <martin@gnome.org>
15821 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15823 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15824 context. Fixes bug #30027.
15826 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15827 virtual functions. Fixes bug #30043, added test-164.cs.
15829 2002-09-08 Ravi Pratap <ravi@ximian.com>
15831 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15833 2002-09-08 Nick Drochak <ndrochak@gol.com>
15835 * driver.cs: Use an object to get the windows codepage since it's not a
15838 2002-09-08 Miguel de Icaza <miguel@ximian.com>
15840 * statement.cs (For.Emit): for infinite loops (test == null)
15841 return whether there is a break inside, not always "true".
15843 * namespace.cs (UsingEntry): New struct to hold the name of the
15844 using definition, the location where it is defined, and whether it
15845 has been used in a successful type lookup.
15847 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15852 2002-09-06 Ravi Pratap <ravi@ximian.com>
15854 * attribute.cs : Fix incorrect code which relied on catching
15855 a NullReferenceException to detect a null being passed in
15856 where an object was expected.
15858 2002-09-06 Miguel de Icaza <miguel@ximian.com>
15860 * statement.cs (Try): flag the catch variable as assigned
15862 * expression.cs (Cast): Simplified by using ResolveType instead of
15863 manually resolving.
15865 * statement.cs (Catch): Fix bug by using ResolveType.
15867 2002-09-06 Ravi Pratap <ravi@ximian.com>
15869 * expression.cs (BetterConversion): Special case for when we have
15870 a NullLiteral as the argument and we have to choose between string
15871 and object types - we choose string the way csc does.
15873 * attribute.cs (Attribute.Resolve): Catch the
15874 NullReferenceException and report error #182 since the Mono
15875 runtime no more has the bug and having this exception raised means
15876 we tried to select a constructor which takes an object and is
15879 2002-09-05 Ravi Pratap <ravi@ximian.com>
15881 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15882 message (1502, 1503) when we can't locate a method after overload
15883 resolution. This is much more informative and closes the bug
15886 * interface.cs (PopulateMethod): Return if there are no argument
15887 types. Fixes a NullReferenceException bug.
15889 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15890 expressions too. Previously we were checking only in one place for
15891 positional arguments leaving out named arguments.
15893 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15894 type to the enum type is not allowed. Remove code corresponding to
15897 (ConvertNumericExplicit): Allow explicit conversions from
15898 the underlying type to enum type. This precisely follows the spec
15899 and closes a bug filed by Gonzalo.
15901 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15904 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15906 2002-09-03 Miguel de Icaza <miguel@ximian.com>
15908 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15909 it was important that we stored the right value after the
15910 reduction in `converted'.
15912 2002-09-04 Martin Baulig <martin@gnome.org>
15914 * location.cs (Location.SymbolDocument): Use full pathnames for the
15917 2002-08-30 Miguel de Icaza <miguel@ximian.com>
15919 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15920 of the expression resolve mechanism, because that will catch the
15921 SimpleName error failures.
15923 (Conditional): If we can not resolve the
15924 expression, return, do not crash.
15926 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15929 (location): display token name instead of its number.
15931 2002-08-28 Martin Baulig <martin@gnome.org>
15933 * expression.cs (Binary.ResolveOperator): Don't silently return
15934 but return an error if an operator cannot be applied between two
15937 2002-08-28 Martin Baulig <martin@gnome.org>
15939 * class.cs (Constructor.Define): Set the permission attributes
15940 correctly instead of making all constructors public.
15942 2002-08-28 Martin Baulig <martin@gnome.org>
15944 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15945 for private members before reporting a CS0103; if we find anything,
15948 2002-08-28 Martin Baulig <martin@gnome.org>
15950 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15951 to check whether `closure_start_type == closure_invocation_type',
15952 we also need to check whether `m.DeclaringType == closure_invocation_type'
15953 before bypassing the permission checks. We might be accessing
15954 protected/private members from the base class.
15955 (TypeManager.RealMemberLookup): Only set private_ok if private
15956 members were requested via BindingFlags.NonPublic.
15958 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15960 * expression.cs (MemberAccess.ResolveMemberAccess): Set
15961 MethodGroupExpr.IsExplicitImpl if appropriate.
15962 (Invocation.DoResolve): Don't report the CS0120 for explicit
15963 interface implementations.
15965 2002-08-27 Martin Baulig <martin@gnome.org>
15967 * expression.cs (Invocation.DoResolve): If this is a static
15968 method and we don't have an InstanceExpression, we must report
15971 2002-08-25 Martin Baulig <martin@gnome.org>
15973 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15974 `==' between a valuetype and an object.
15976 2002-08-25 Miguel de Icaza <miguel@ximian.com>
15978 * ecore.cs (TypeExpr): Provide a ToString method.
15980 2002-08-24 Martin Baulig <martin@gnome.org>
15982 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15983 now called proggie.dbg and it's a binary file.
15985 2002-08-23 Martin Baulig <martin@gnome.org>
15987 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15989 2002-08-23 Martin Baulig <martin@gnome.org>
15991 * struct.cs (MyStructInfo.ctor): Make this work with empty
15992 structs; it's not allowed to use foreach() on null.
15994 2002-08-23 Martin Baulig <martin@gnome.org>
15996 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15997 writer the full pathname of the generated assembly.
15999 2002-08-23 Martin Baulig <martin@gnome.org>
16001 * statements.cs (FlowBranching.UsageVector.MergeChildren):
16002 A `finally' block never returns or breaks; improved handling of
16005 2002-08-23 Martin Baulig <martin@gnome.org>
16007 * statement.cs (Throw.Resolve): Allow `throw null'.
16009 2002-08-23 Martin Baulig <martin@gnome.org>
16011 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16012 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16013 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
16014 MemberLookup would return a wrong event if this is an explicit
16015 interface implementation and the class has an event with the same
16018 2002-08-23 Martin Baulig <martin@gnome.org>
16020 * statement.cs (Block.AddChildVariableNames): New public method.
16021 (Block.AddChildVariableName): Likewise.
16022 (Block.IsVariableNameUsedInChildBlock): Likewise.
16023 (Block.AddVariable): Check whether a variable name has already
16024 been used in a child block.
16026 * cs-parser.jay (declare_local_variables): Mark all variable names
16027 from the current block as being used in a child block in the
16030 2002-08-23 Martin Baulig <martin@gnome.org>
16032 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16033 find the symbol writer.
16035 * driver.cs: csc also allows the arguments to /define being
16036 separated by commas, not only by semicolons.
16038 2002-08-23 Martin Baulig <martin@gnome.org>
16040 * interface.cs (Interface.GetMembers): Added static check for events.
16042 2002-08-15 Martin Baulig <martin@gnome.org>
16044 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16045 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16047 * ecore.cs (Expression.MemberLookup): Added documentation and explained
16048 why the MethodData.EmitDestructor() change was necessary.
16050 2002-08-20 Martin Baulig <martin@gnome.org>
16052 * class.cs (TypeContainer.FindMembers): Added static check for events.
16054 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16056 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16057 use Type.GetEvents(), not Type.FindMembers().
16059 2002-08-20 Martin Baulig <martin@gnome.org>
16061 * decl.cs (MemberCache): Added a special method cache which will
16062 be used for method-only searched. This ensures that a method
16063 search will return a MethodInfo with the correct ReflectedType for
16066 2002-08-20 Martin Baulig <martin@gnome.org>
16068 * decl.cs (DeclSpace.FindMembers): Made this public.
16070 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16072 * delegate.cs: fixed build on windows.
16073 [FIXME: Filed as bug #29150: MCS must report these errors.]
16075 2002-08-19 Ravi Pratap <ravi@ximian.com>
16077 * ecore.cs (StandardConversionExists): Return a false
16078 if we are trying to convert the void type to anything else
16079 since that is not allowed.
16081 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16082 we flag error 70 in the event an event is trying to be accessed
16083 directly from outside the declaring type.
16085 2002-08-20 Martin Baulig <martin@gnome.org>
16087 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16088 MemberCache from typemanager.cs to decl.cs.
16090 2002-08-19 Martin Baulig <martin@gnome.org>
16092 * class.cs (TypeContainer): Implement IMemberContainer.
16093 (TypeContainer.DefineMembers): Create the MemberCache.
16094 (TypeContainer.FindMembers): Do better BindingFlags checking; only
16095 return public members if BindingFlags.Public was given, check
16096 whether members are static.
16098 2002-08-16 Martin Baulig <martin@gnome.org>
16100 * decl.cs (DeclSpace.Define): Splitted this in Define and
16101 DefineMembers. DefineMembers is called first and initializes the
16104 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
16105 DefineMembers() on all our DeclSpaces.
16107 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16108 but call DefineMembers() on all nested interfaces. We call their
16109 Define() in our new Define() function.
16111 * interface.cs (Interface): Implement IMemberContainer.
16112 (Interface.Define): Moved all code except the attribute stuf to
16114 (Interface.DefineMembers): Initialize the member cache.
16116 * typemanager.cs (IMemberFinder): Removed this interface, we don't
16117 need this anymore since we can use MemberCache.FindMembers directly.
16119 2002-08-19 Martin Baulig <martin@gnome.org>
16121 * typemanager.cs (MemberCache): When creating the cache for an
16122 interface type, add all inherited members.
16123 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16124 to `out bool used_cache' and documented it.
16125 (TypeManager.MemberLookup): If we already used the cache in the first
16126 iteration, we don't need to do the interfaces check.
16128 2002-08-19 Martin Baulig <martin@gnome.org>
16130 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
16131 here from IMemberFinder and don't implement this interface anymore.
16132 (DeclSpace.MemberCache): Moved here from IMemberFinder.
16134 * typemanager.cs (IMemberFinder): This interface is now only used by
16135 classes which actually support the member cache.
16136 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16137 since we only put DeclSpaces into this Hashtable.
16138 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16139 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16141 2002-08-16 Martin Baulig <martin@gnome.org>
16143 * typemanager.cs (ICachingMemberFinder): Removed.
16144 (IMemberFinder.MemberCache): New property.
16145 (TypeManager.FindMembers): Merged this with RealFindMembers().
16146 This function will never be called from TypeManager.MemberLookup()
16147 so we can't use the cache here, just the IMemberFinder.
16148 (TypeManager.MemberLookup_FindMembers): Check whether the
16149 IMemberFinder has a MemberCache and call the cache's FindMembers
16151 (MemberCache): Rewrote larger parts of this yet another time and
16152 cleaned it up a bit.
16154 2002-08-15 Miguel de Icaza <miguel@ximian.com>
16156 * driver.cs (LoadArgs): Support quoting.
16158 (Usage): Show the CSC-like command line arguments.
16160 Improved a few error messages.
16162 2002-08-15 Martin Baulig <martin@gnome.org>
16164 * typemanager.cs (IMemberContainer.Type): New property.
16165 (IMemberContainer.IsInterface): New property.
16167 The following changes are conditional to BROKEN_RUNTIME, which is
16168 defined at the top of the file.
16170 * typemanager.cs (MemberCache.MemberCache): Don't add the base
16171 class'es members, but add all members from TypeHandle.ObjectType
16172 if we're an interface.
16173 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16174 is the current type.
16175 (MemberCache.CacheEntry.Container): Removed this field.
16176 (TypeHandle.GetMembers): Include inherited members.
16178 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16180 * typemanager.cs: fixed compilation and added a comment on a field that
16183 2002-08-15 Martin Baulig <martin@gnome.org>
16185 * class.cs (ConstructorInitializer.Resolve): In the
16186 Expression.MemberLookup call, use the queried_type as
16189 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16190 declared' attribute, it's always true.
16191 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16192 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16193 temporary wrapper for FindMembers which tells MemberLookup whether
16194 members from the base classes are included in the return value.
16195 This will go away soon.
16196 (TypeManager.MemberLookup): Use this temporary hack here; once the
16197 new MemberCache is completed, we don't need to do the DeclaredOnly
16198 looping here anymore since the MemberCache will take care of this.
16199 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16200 (MemberCache): When creating the MemberCache for a class, get
16201 members from the current class and all its base classes.
16202 (MemberCache.CacheEntry.Container): New field. This is a
16203 temporary hack until the Mono runtime is fixed to distinguish
16204 between ReflectedType and DeclaringType. It allows us to use MCS
16205 with both the MS runtime and the unfixed Mono runtime without
16206 problems and without accecting performance.
16207 (MemberCache.SearchMembers): The DeclaredOnly looping from
16208 TypeManager.MemberLookup is now done here.
16210 2002-08-14 Martin Baulig <martin@gnome.org>
16212 * statement.cs (MyStructInfo.MyStructInfo): Don't call
16213 Type.GetFields on dynamic types but get the fields from the
16214 corresponding TypeContainer.
16215 (MyStructInfo.GetStructInfo): Added check for enum types.
16217 * typemanager.cs (MemberList.IsSynchronized): Implemented.
16218 (MemberList.SyncRoot): Implemented.
16219 (TypeManager.FilterWithClosure): No need to check permissions if
16220 closure_start_type == closure_invocation_type, don't crash if
16221 closure_invocation_type is null.
16223 2002-08-13 Martin Baulig <martin@gnome.org>
16225 Rewrote TypeContainer.FindMembers to use a member cache. This
16226 gives us a speed increase of about 35% for the self-hosting MCS
16227 build and of about 15-20% for the class libs (both on GNU/Linux).
16229 * report.cs (Timer): New class to get enhanced profiling. This
16230 whole class is "TIMER" conditional since it remarkably slows down
16233 * class.cs (MemberList): New class. This is an IList wrapper
16234 which we're now using instead of passing MemberInfo[]'s around to
16235 avoid copying this array unnecessarily.
16236 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16237 (ICachingMemberFinder, IMemberContainer): New interface.
16238 (TypeManager.FilterWithClosure): If `criteria' is null, the name
16239 has already been checked, otherwise use it for the name comparision.
16240 (TypeManager.FindMembers): Renamed to RealMemberFinder and
16241 provided wrapper which tries to use ICachingMemberFinder.FindMembers
16242 if possible. Returns a MemberList, not a MemberInfo [].
16243 (TypeHandle): New class, implements IMemberContainer. We create
16244 one instance of this class per type, it contains a MemberCache
16245 which is used to do the member lookups.
16246 (MemberCache): New class. Each instance of this class contains
16247 all members of a type and a name-based hash table.
16248 (MemberCache.FindMembers): This is our new member lookup
16249 function. First, it looks up all members of the requested name in
16250 the hash table. Then, it walks this list and sorts out all
16251 applicable members and returns them.
16253 2002-08-13 Martin Baulig <martin@gnome.org>
16255 In addition to a nice code cleanup, this gives us a performance
16256 increase of about 1.4% on GNU/Linux - not much, but it's already
16257 half a second for the self-hosting MCS compilation.
16259 * typemanager.cs (IMemberFinder): New interface. It is used by
16260 TypeManager.FindMembers to call FindMembers on a TypeContainer,
16261 Enum, Delegate or Interface.
16262 (TypeManager.finder_to_member_finder): New PtrHashtable.
16263 (TypeManager.finder_to_container): Removed.
16264 (TypeManager.finder_to_delegate): Removed.
16265 (TypeManager.finder_to_interface): Removed.
16266 (TypeManager.finder_to_enum): Removed.
16268 * interface.cs (Interface): Implement IMemberFinder.
16270 * delegate.cs (Delegate): Implement IMemberFinder.
16272 * enum.cs (Enum): Implement IMemberFinder.
16274 * class.cs (TypeContainer): Implement IMemberFinder.
16276 2002-08-12 Martin Baulig <martin@gnome.org>
16278 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16280 2002-08-12 Martin Baulig <martin@gnome.org>
16282 * ecore.cs (ITypeExpression): New interface for expressions which
16284 (TypeExpression): Renamed to TypeLookupExpression.
16285 (Expression.DoResolve): If we're doing a types-only lookup, the
16286 expression must implement the ITypeExpression interface and we
16287 call DoResolveType() on it.
16288 (SimpleName): Implement the new ITypeExpression interface.
16289 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16290 hack, the situation that we're only looking up types can't happen
16291 anymore when this method is called. Moved the type lookup code to
16292 DoResolveType() and call it.
16293 (SimpleName.DoResolveType): This ITypeExpression interface method
16294 is now doing the types-only lookup.
16295 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16296 (ResolveFlags): Added MaskExprClass.
16298 * expression.cs (MemberAccess): Implement the ITypeExpression
16300 (MemberAccess.DoResolve): Added support for a types-only lookup
16301 when we're called via ITypeExpression.DoResolveType().
16302 (ComposedCast): Implement the ITypeExpression interface.
16304 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
16305 Expression.Resolve() with ResolveFlags.Type instead.
16307 2002-08-12 Martin Baulig <martin@gnome.org>
16309 * interface.cs (Interface.Define): Apply attributes.
16311 * attribute.cs (Attribute.ApplyAttributes): Added support for
16312 interface attributes.
16314 2002-08-11 Martin Baulig <martin@gnome.org>
16316 * statement.cs (Block.Emit): Only check the "this" variable if we
16317 do not always throw an exception.
16319 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16320 whether the property has a set accessor.
16322 2002-08-11 Martin Baulig <martin@gnome.org>
16324 Added control flow analysis support for structs.
16326 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16327 with control flow analysis turned off.
16328 (IVariable): New interface.
16329 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16330 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16331 (FieldExpr.DoResolve): Resolve the instance expression with flow
16332 analysis turned off and do the definite assignment check after the
16333 resolving when we know what the expression will resolve to.
16335 * expression.cs (LocalVariableReference, ParameterReference):
16336 Implement the new IVariable interface, only call the flow analysis
16337 code if ec.DoFlowAnalysis is true.
16338 (This): Added constructor which takes a Block argument. Implement
16339 the new IVariable interface.
16340 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16341 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16342 This does the definite assignment checks for struct members.
16344 * class.cs (Constructor.Emit): If this is a non-static `struct'
16345 constructor which doesn't have any initializer, call
16346 Block.AddThisVariable() to tell the flow analysis code that all
16347 struct elements must be initialized before control returns from
16350 * statement.cs (MyStructInfo): New public class.
16351 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16352 argument to this indexer. If non-zero, check an individual struct
16353 member, not the whole struct.
16354 (FlowBranching.CheckOutParameters): Check struct members.
16355 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16356 overloaded versions of these methods which take an additional
16357 `int field_idx' argument to check struct members.
16358 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16359 overloaded versions of these methods which take an additional
16360 `string field_name' argument to check struct member.s
16361 (VariableInfo): Implement the IVariable interface.
16362 (VariableInfo.StructInfo): New public property. Returns the
16363 MyStructInfo instance of the variable if it's a struct or null.
16364 (Block.AddThisVariable): New public method. This is called from
16365 Constructor.Emit() for non-static `struct' constructor which do
16366 not have any initializer. It creates a special variable for the
16367 "this" instance variable which will be checked by the flow
16368 analysis code to ensure that all of the struct's fields are
16369 initialized before control returns from the constructor.
16370 (UsageVector): Added support for struct members. If a
16371 variable/parameter is a struct with N members, we reserve a slot
16372 in the usage vector for each member. A struct is considered fully
16373 initialized if either the struct itself (slot 0) or all its
16374 members are initialized.
16376 2002-08-08 Martin Baulig <martin@gnome.org>
16378 * driver.cs (Driver.MainDriver): Only report an error CS5001
16379 if there were no compilation errors.
16381 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16382 `UnsafeContext' property to determine whether the parent is in
16383 unsafe context rather than checking the parent's ModFlags:
16384 classes nested in an unsafe class are unsafe as well.
16386 2002-08-08 Martin Baulig <martin@gnome.org>
16388 * statement.cs (UsageVector.MergeChildren): Distinguish between
16389 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16390 we return. Added test17() and test18() to test-154.cs.
16392 2002-08-08 Martin Baulig <martin@gnome.org>
16394 * typemanager.cs (TypeManager.FilterWithClosure): If we have
16395 Family access, make sure the invoking type isn't a subclass of the
16396 queried type (that'd be a CS1540).
16398 * ecore.cs (Expression.MemberLookup): Added overloaded version of
16399 this method which takes an additional `Type invocation_type'.
16401 * expression.cs (BaseAccess.DoResolve): Use the base type as
16402 invocation and query type.
16403 (MemberAccess.DoResolve): If the lookup failed and we're about to
16404 report a CS0122, try a lookup with the ec.ContainerType - if this
16405 succeeds, we must report a CS1540.
16407 2002-08-08 Martin Baulig <martin@gnome.org>
16409 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16410 (MethodGroupExpr): Implement the IMemberExpr interface.
16412 * expression (MemberAccess.ResolveMemberAccess): No need to have
16413 any special code for MethodGroupExprs anymore, they're now
16416 2002-08-08 Martin Baulig <martin@gnome.org>
16418 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16419 Family, FamANDAssem and FamORAssem permissions.
16420 (TypeManager.IsSubclassOrNestedChildOf): New public method.
16422 2002-08-08 Martin Baulig <martin@gnome.org>
16424 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16425 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16428 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16430 * driver.cs: implemented /resource option to embed managed resources.
16432 2002-08-07 Martin Baulig <martin@gnome.org>
16434 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16435 (FieldBase.HasFieldInitializer): New public property.
16436 (FieldBase.GetInitializerExpression): New public method. Resolves and
16437 returns the field initializer and makes sure it is only resolved once.
16438 (TypeContainer.EmitFieldInitializers): Call
16439 FieldBase.GetInitializerExpression to get the initializer, this ensures
16440 that it isn't resolved multiple times.
16442 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
16443 the resolving process (SimpleName/MemberLookup) that we're currently
16444 emitting a field initializer (which must not access any instance members,
16445 this is an error CS0236).
16447 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16448 argument, if the `IsFieldInitializer' flag is set, we must report and
16449 error CS0236 and not an error CS0120.
16451 2002-08-07 Martin Baulig <martin@gnome.org>
16453 * ecore.cs (IMemberExpr): New public interface.
16454 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16455 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16456 if the expression is an IMemberExpr.
16458 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16459 to be null, implicitly default to `this' if we're non-static in
16460 this case. Simplified the code a lot by using the new IMemberExpr
16461 interface. Also fixed bug #28176 here.
16463 2002-08-06 Martin Baulig <martin@gnome.org>
16465 * cs-parser.jay (SimpleLookup): Removed. We need to create
16466 ParameterReferences during semantic analysis so that we can do a
16467 type-only search when resolving Cast, TypeOf and SizeOf.
16468 (block): Pass the `current_local_parameters' to the Block's
16471 * class.cs (ConstructorInitializer): Added `Parameters parameters'
16472 argument to the constructor.
16473 (ConstructorInitializer.Resolve): Create a temporary implicit
16474 block with the parameters.
16476 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16477 references here if we aren't doing a type-only search.
16479 * statement.cs (Block): Added constructor which takes a
16480 `Parameters parameters' argument.
16481 (Block.Parameters): New public property.
16483 * support.cs (InternalParameters.Parameters): Renamed `parameters'
16484 to `Parameters' and made it public readonly.
16486 2002-08-06 Martin Baulig <martin@gnome.org>
16488 * ecore.cs (Expression.Warning): Made this public as well.
16490 * report.cs (Report.Debug): Print the contents of collections.
16492 2002-08-06 Martin Baulig <martin@gnome.org>
16494 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
16495 used to tell Resolve() which kinds of expressions it may return.
16496 (Expression.Resolve): Added overloaded version of this method which
16497 takes a `ResolveFlags flags' argument. This can be used to tell
16498 Resolve() which kinds of expressions it may return. Reports a
16500 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16501 ResolveFlags.SimpleName.
16502 (Expression.Error118): Added overloaded version of this method which
16503 takes a `ResolveFlags flags' argument. It uses the flags to determine
16504 which kinds of expressions are allowed.
16506 * expression.cs (Argument.ResolveMethodGroup): New public method.
16507 Resolves an argument, but allows a MethodGroup to be returned.
16508 This is used when invoking a delegate.
16510 * TODO: Updated a bit.
16512 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16514 Fixed compilation with csc.
16516 * ecore.cs: Expression.Error made public. Is this correct? Should
16517 Warning be made public too?
16519 * expression.cs: use ea.Location instead of ea.loc.
16520 [FIXME: Filed as bug #28607: MCS must report these errors.]
16522 2002-08-06 Martin Baulig <martin@gnome.org>
16524 * ecore.cs (Expression.loc): Moved the location here instead of
16525 duplicating it in all derived classes.
16526 (Expression.Location): New public property.
16527 (Expression.Error, Expression.Warning): Made them non-static and
16528 removed the location argument.
16529 (Expression.Warning): Added overloaded version which takes an
16530 `int level' argument.
16531 (Expression.Error118): Make this non-static and removed the
16532 expression and location arguments.
16533 (TypeExpr): Added location argument to the constructor.
16535 * expression.cs (StaticCallExpr): Added location argument to
16537 (Indirection, PointerArithmetic): Likewise.
16538 (CheckedExpr, UnCheckedExpr): Likewise.
16539 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16540 (StringPtr): Likewise.
16543 2002-08-05 Martin Baulig <martin@gnome.org>
16545 * expression.cs (BaseAccess.DoResolve): Actually report errors.
16547 * assign.cs (Assign.DoResolve): Check whether the source
16548 expression is a value or variable.
16550 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16551 while resolving the corresponding blocks.
16553 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16554 an error, don't silently return null.
16556 * statement.cs (Block.AddVariable): Do the error reporting here
16557 and distinguish between CS0128 and CS0136.
16558 (Block.DoResolve): Report all unused labels (warning CS0164).
16559 (LabeledStatement): Pass the location to the constructor.
16560 (LabeledStatement.HasBeenReferenced): New property.
16561 (LabeledStatement.Resolve): Set it to true here.
16563 * statement.cs (Return.Emit): Return success even after reporting
16564 a type mismatch error (CS0126 or CS0127), this is what csc does and
16565 it avoids confusing the users with any consecutive errors.
16567 2002-08-05 Martin Baulig <martin@gnome.org>
16569 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16571 * const.cs (Const.LookupConstantValue): Catch circular definitions.
16573 * expression.cs (MemberAccess.DoResolve): Silently return if an
16574 error has already been reported.
16576 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16577 error has already been reported.
16579 2002-08-05 Martin Baulig <martin@gnome.org>
16581 * statement.cs (UsageVector): Only initialize the `parameters'
16582 vector if we actually have any "out" parameters.
16584 2002-08-05 Martin Baulig <martin@gnome.org>
16586 * expression.cs (Binary.ResolveOperator): When combining delegates,
16587 they must have the same type.
16589 2002-08-05 Martin Baulig <martin@gnome.org>
16591 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16592 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16593 work with the ms runtime and we also don't need it: if we're a
16594 PropertyBuilder and not in the `indexer_arguments' hash, then we
16595 are a property and not an indexer.
16597 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16598 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16599 since the latter one doesn't work with the ms runtime.
16601 2002-08-03 Martin Baulig <martin@gnome.org>
16603 Fixed bugs #27998 and #22735.
16605 * class.cs (Method.IsOperator): New public field.
16606 (Method.CheckBase): Report CS0111 if there's already a method
16607 with the same parameters in the current class. Report CS0508 when
16608 attempting to change the return type of an inherited method.
16609 (MethodData.Emit): Report CS0179 if a method doesn't have a body
16610 and it's not marked abstract or extern.
16611 (PropertyBase): New abstract base class for Property and Indexer.
16612 (PropertyBase.CheckBase): Moved here from Property and made it work
16614 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16615 the same so we can reuse it there.
16616 (Property, Indexer): Derive from PropertyBase.
16617 (MethodSignature.inheritable_property_signature_filter): New delegate
16618 to find properties and indexers.
16620 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16621 argument and improved error reporting.
16623 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16624 EmptyReadOnlyParameters and made it a property.
16626 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16627 version of this method which takes a `PropertyInfo indexer'.
16628 (TypeManager.RegisterIndexer): New method.
16630 * class.cs: Added myself as author of this file :-)
16632 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16634 * class.cs: fixed compilation on windoze.
16636 2002-08-03 Martin Baulig <martin@gnome.org>
16638 * interface.cs (Interface.GetInterfaceBases): Check whether all
16639 base interfaces are at least as accessible than the current one.
16641 * class.cs (TypeContainer.GetClassBases): Check whether base types
16642 are at least as accessible than the current type.
16643 (TypeContainer.AsAccessible): Implemented and made non-static.
16644 (MemberBase.CheckParameters): Report errors if the accessibility
16647 * delegate.cs (Delegate.Delegate): The default visibility is
16648 internal for top-level types and private for nested types.
16649 (Delegate.Define): Report errors if the accessibility checks fail.
16651 * enum.cs (Enum.Enum): The default visibility is internal for
16652 top-level types and private for nested types.
16653 (Enum.DefineType): Compute the correct visibility.
16655 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16656 function which takes a `bool is_toplevel' instead of a TypeContainer.
16658 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16661 2002-08-02 Martin Baulig <martin@gnome.org>
16663 * expression.cs (LocalVariableReferenc): Added constructor which
16664 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16665 (LocalVariableReference.IsReadOnly): New property.
16666 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16667 variable is readonly, use our own readonly flag to do this; you can
16668 use the new constructor to get a writable reference to a read-only
16671 * cs-parser.jay (foreach_statement, using_statement): Get a writable
16672 reference to the local variable.
16674 2002-08-01 Miguel de Icaza <miguel@ximian.com>
16676 * rootcontext.cs (ResolveCore): Also include System.Exception
16678 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16679 we reach an EmptyStatement.
16681 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16684 * expression.cs (Binary.ResolveOperator): Check error result in
16687 use brtrue/brfalse directly and avoid compares to null.
16689 2002-08-02 Martin Baulig <martin@gnome.org>
16691 * class.cs (TypeContainer.Define): Define all nested interfaces here.
16692 Fixes bug #28407, added test-155.cs.
16694 2002-08-01 Martin Baulig <martin@gnome.org>
16696 * class.cs (Event.EmitDefaultMethod): Make this work with static
16697 events. Fixes #28311, added verify-3.cs.
16699 2002-08-01 Martin Baulig <martin@gnome.org>
16701 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16702 `is_disposable' fields.
16703 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16704 `hm.is_disposable' if we're using the collection pattern.
16705 (Foreach.EmitCollectionForeach): Use the correct type for the
16706 enumerator's local variable, only emit the try/finally block if
16707 necessary (fixes #27713).
16709 2002-08-01 Martin Baulig <martin@gnome.org>
16711 * ecore.cs (Expression.report118): Renamed to Error118 and made
16714 * statement.cs (Throw.Resolve): Check whether the expression is of
16715 the correct type (CS0118) and whether the type derives from
16716 System.Exception (CS0155).
16717 (Catch.Resolve): New method. Do the type lookup here and check
16718 whether it derives from System.Exception (CS0155).
16719 (Catch.CatchType, Catch.IsGeneral): New public properties.
16721 * typemanager.cs (TypeManager.exception_type): Added.
16723 2002-07-31 Miguel de Icaza <miguel@ximian.com>
16725 * driver.cs: Updated About function.
16727 2002-07-31 Martin Baulig <martin@gnome.org>
16729 Implemented Control Flow Analysis.
16731 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16732 (EmitContext.CurrentBranching): Added.
16733 (EmitContext.StartFlowBranching): Added.
16734 (EmitContext.EndFlowBranching): Added.
16735 (EmitContext.KillFlowBranching): Added.
16736 (EmitContext.IsVariableAssigned): Added.
16737 (EmitContext.SetVariableAssigned): Added.
16738 (EmitContext.IsParameterAssigned): Added.
16739 (EmitContext.SetParameterAssigned): Added.
16740 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16741 Added control flow analysis stuff here.
16743 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16744 resolve the expression as lvalue.
16745 (LocalVariableReference.DoResolve): Check whether the variable has
16746 already been assigned.
16747 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16748 the parameter as assigned here.
16749 (ParameterReference.DoResolve): Check whether the parameter has already
16751 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16752 expression as lvalue.
16754 * statement.cs (FlowBranching): New class for the flow analysis code.
16755 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16756 (LabeledStatement.IsDefined): New public property.
16757 (LabeledStatement.AddUsageVector): New public method to tell flow
16758 analyis that the label may be reached via a forward jump.
16759 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16761 (VariableInfo.Number): New public field. This is used by flow analysis
16762 to number all locals of a block.
16763 (Block.CountVariables): New public property. This is the number of
16764 local variables in this block (including the locals from all parent
16766 (Block.EmitMeta): Number all the variables.
16768 * statement.cs: Added flow analysis support to all classes.
16770 2002-07-31 Martin Baulig <martin@gnome.org>
16772 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16773 To get debugging messages, compile mcs with /define:MCS_DEBUG and
16774 then use this argument.
16776 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16778 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16779 use this to specify /define options.
16781 2002-07-29 Martin Baulig <martin@gnome.org>
16783 * statement.cs (Fixed): Moved all code that does variable lookups
16784 and resolvings from Emit to Resolve.
16786 * statement.cs (For): Moved all code that does variable lookups
16787 and resolvings from Emit to Resolve.
16789 * statement.cs (Using): Moved all code that does variable lookups
16790 and resolvings from Emit to Resolve.
16792 2002-07-29 Martin Baulig <martin@gnome.org>
16794 * attribute.cs (Attribute.Resolve): Explicitly catch a
16795 System.NullReferenceException when creating the
16796 CustromAttributeBuilder and report a different warning message.
16798 2002-07-29 Martin Baulig <martin@gnome.org>
16800 * support.cs (ParameterData.ParameterName): Added method to
16801 get the name of a parameter.
16803 * typemanager.cs (TypeManager.IsValueType): New public method.
16805 2002-07-29 Martin Baulig <martin@gnome.org>
16807 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
16808 is a flag which specifies that it's either ref or out.
16809 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16810 the out parameter to `out Parameter.Modifier mod', also set the
16811 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16813 * support.cs (InternalParameters.ParameterModifier): Distinguish
16814 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16815 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16817 * expression.cs (Argument.GetParameterModifier): Distinguish
16818 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16819 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16821 2002-07-29 Martin Baulig <martin@gnome.org>
16823 * expression.cs (ParameterReference.ParameterReference): Added
16824 `Location loc' argument to the constructor.
16826 * cs-parser.jay: Pass location to ParameterReference.
16828 2002-07-28 Miguel de Icaza <miguel@ximian.com>
16830 * statement.cs (Try): Initialize the location.
16832 * cs-parser.jay: pass location to Try.
16834 * expression.cs (Unary.Reduce): Change the prototype to return
16835 whether a constant fold could be performed or not. The result is
16836 returned in an out parameters. In the case of Indirection and
16837 AddressOf, we want to perform the full tests.
16839 2002-07-26 Miguel de Icaza <miguel@ximian.com>
16841 * statement.cs (Statement.Emit): Flag dead code.
16843 2002-07-27 Andrew Birkett <andy@nobugs.org>
16845 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16847 2002-07-27 Martin Baulig <martin@gnome.org>
16849 * class.cs (MethodData.Define): Put back call to
16850 TypeManager.AddMethod(), accidentally commented this out.
16852 * report.cs (Debug): New public method to print debugging information,
16853 this is `[Conditional ("DEBUG")]'.
16855 2002-07-26 Martin Baulig <martin@gnome.org>
16857 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16858 (switch_statement): Push the current_block to the switch_stack and
16859 pop it again when we're done with the switch.
16860 (switch_section): The new block is a child of the current_block.
16861 Fixes bug #24007, added test-152.cs.
16863 2002-07-27 Martin Baulig <martin@gnome.org>
16865 * expression.cs (Invocation.EmitArguments): When calling a varargs
16866 function with only its fixed arguments, we need to pass an empty
16869 2002-07-27 Martin Baulig <martin@gnome.org>
16871 Mono 0.13 has been released.
16873 2002-07-25 Miguel de Icaza <miguel@ximian.com>
16875 * driver.cs: Rename --resource to --linkres, because that is what
16876 we do currently, we dont support --resource yet.
16878 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16880 2002-07-25 Martin Baulig <martin@gnome.org>
16882 * class.cs (MethodData): New public class. This is a `method builder'
16883 class for a method or one accessor of a Property/Indexer/Event.
16884 (MethodData.GetMethodFlags): Moved here from MemberBase.
16885 (MethodData.ApplyAttributes): Likewise.
16886 (MethodData.ApplyObsoleteAttribute): Likewise.
16887 (MethodData.ApplyConditionalAttribute): Likewise.
16888 (MethodData.ApplyDllImportAttribute): Likewise.
16889 (MethodData.CheckAbstractAndExternal): Likewise.
16890 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16891 (MethodData.Emit): Formerly known as Method.Emit().
16892 (MemberBase): Moved everything which was specific to a single
16893 accessor/method to MethodData.
16894 (Method): Create a new MethodData and call Define() and Emit() on it.
16895 (Property, Indexer, Event): Create a new MethodData objects for each
16896 accessor and call Define() and Emit() on them.
16898 2002-07-25 Martin Baulig <martin@gnome.org>
16900 Made MethodCore derive from MemberBase to reuse the code from there.
16901 MemberBase now also checks for attributes.
16903 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16904 (MemberBase.GetMethodFlags): Moved here from class Method and marked
16906 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16907 `CallingConventions cc' and `Attributes opt_attrs' arguments.
16908 (MemberBase.ApplyAttributes): New virtual method; applies the
16909 attributes to a method or accessor.
16910 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16911 (MemberBase.ApplyConditionalAttribute): Likewise.
16912 (MemberBase.ApplyDllImportAttribute): Likewise.
16913 (MemberBase.CheckAbstractAndExternal): Likewise.
16914 (MethodCore.ParameterTypes): This is now a property instead of a
16915 method, it's initialized from DoDefineParameters().
16916 (MethodCore.ParameterInfo): Removed the set accessor.
16917 (MethodCore.DoDefineParameters): New protected virtual method to
16918 initialize ParameterTypes and ParameterInfo.
16919 (Method.GetReturnType): We can now simply return the MemberType.
16920 (Method.GetMethodFlags): Override the MemberBase version and add
16921 the conditional flags.
16922 (Method.CheckBase): Moved some code from Define() here, call
16923 DoDefineParameters() here.
16924 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16925 here to avoid some larger code duplication.
16926 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16927 ensure that abstract and external accessors don't declare a body.
16929 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16930 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16931 lookup in the attribute's parent classes, so we need to abort as soon
16932 as we found the first match.
16933 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16934 the attribute has no arguments.
16936 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16939 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16941 * cs-parser.jay: reverted previous patch.
16943 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16945 * cs-parser.jay: fixed bug #22119.
16947 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16949 * attribute.cs: fixed compilation. The error was:
16950 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
16951 be assigned to before control leaves the current method."
16952 [FIXME: Filed as bug #28186: MCS must report this error.]
16954 2002-07-25 Martin Baulig <martin@gnome.org>
16956 * attribute.cs (Attribute.Conditional_GetConditionName): New static
16957 method to pull the condition name ouf of a Conditional attribute.
16958 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16959 the obsolete message and error flag out of an Obsolete attribute.
16961 * class.cs (Method.GetMethodFlags): New public method to get the
16962 TypeManager.MethodFlags for this method.
16963 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16965 (Method.Define): Get and apply the Obsolete and Conditional attributes;
16966 if we're overriding a virtual function, set the new private variable
16967 `parent_method'; call the new TypeManager.AddMethod().
16969 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
16970 the MethodBuilder and the Method in a PtrHashtable.
16971 (TypeManager.builder_to_method): Added for this purpose.
16972 (TypeManager.MethodFlags): Added IsObsoleteError.
16973 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
16974 Obsolete and Conditional arguments in MethodBuilders. If we discover
16975 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16976 the message from the attribute.
16978 2002-07-24 Martin Baulig <martin@gnome.org>
16980 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16981 preprocessor directives, ensure that the argument to #define/#undef is
16982 exactly one identifier and that it's actually an identifier.
16984 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16987 2002-07-24 Martin Baulig <martin@gnome.org>
16989 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16990 initialize it to TypeManager.object_type in the constructor.
16991 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16992 of the `hm.get_current' method if we're using the collection pattern.
16993 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16994 for the explicit conversion to make it work when we're using the collection
16995 pattern and the `Current' property has a different return type than `object'.
16998 2002-07-24 Martin Baulig <martin@gnome.org>
17000 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17001 does not match, but don't report any errors. This method is called in
17002 order for all methods in a MethodGroupExpr until a matching method is
17003 found, so we don't want to bail out if the first method doesn't match.
17004 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17005 matches, report the 123. Fixes #28070.
17007 2002-07-24 Martin Baulig <martin@gnome.org>
17009 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17010 TypeManager.TypeToCoreType() to the top of the method so the
17011 following equality checks will work. Fixes #28107.
17013 2002-07-24 Martin Baulig <martin@gnome.org>
17015 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17016 operand is of type uint, and the other operand is of type sbyte,
17017 short or int, the operands are converted to type long." -
17018 Actually do what this comment already told us. Fixes bug #28106,
17021 2002-07-24 Martin Baulig <martin@gnome.org>
17023 * class.cs (MethodBase): New abstract class. This is now a base
17024 class for Property, Indexer and Event to avoid some code duplication
17025 in their Define() and DefineMethods() methods.
17026 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17027 generic methods for Define() and DefineMethods().
17028 (FieldBase): Derive from MemberBase, not MemberCore.
17029 (Property): Derive from MemberBase, not MemberCore.
17030 (Property.DefineMethod): Moved all the code from this method to the
17031 new MethodBase.DefineAccessor(), just call it with appropriate
17033 (Property.Define): Call the new Property.DoDefine(), this does some
17034 sanity checks and we don't need to duplicate the code everywhere.
17035 (Event): Derive from MemberBase, not MemberCore.
17036 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17037 accessors, this will also make them work with interface events.
17038 (Indexer): Derive from MemberBase, not MemberCore.
17039 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17040 (Indexer.Define): Use the new MethodBase functions.
17042 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17043 argument to the constructor.
17044 (Interface.FindMembers): Added support for interface events.
17045 (Interface.PopluateEvent): Implemented.
17047 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
17049 2002-07-22 Miguel de Icaza <miguel@ximian.com>
17051 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17052 but this is required to check for a method name being the same as
17053 the containing class.
17057 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17059 * interface.cs: initialize variable.
17061 2002-07-23 Martin Baulig <martin@gnome.org>
17063 Implemented the IndexerName attribute in interfaces.
17065 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17066 name if this is an explicit interface implementation.
17067 (Indexer.InterfaceIndexerName): New public variable. If we're
17068 implementing an interface indexer, this is the IndexerName in that
17069 interface. Otherwise, it's the IndexerName.
17070 (Indexer.DefineMethod): If we're implementing interface indexer,
17071 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
17072 and Pending.ImplementIndexer methods.
17073 (Indexer.Define): Also define the PropertyBuilder if we're
17074 implementing an interface indexer and this is neither an explicit
17075 interface implementation nor do the IndexerName match the one in
17078 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17079 If a method is defined here, then we always need to create a proxy
17080 for it. This is used when implementing interface indexers.
17081 (Pending.IsInterfaceIndexer): New public method.
17082 (Pending.ImplementIndexer): New public method.
17083 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17084 This is used when implementing interface indexers to define a proxy
17086 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17087 define a proxy if necessary.
17089 * interface.cs (Interface.IndexerName): New public variable.
17090 (Interface.PopulateIndexer): Set the IndexerName.
17091 (Interface.DefineIndexers): New private method. Populate all the
17092 indexers and make sure their IndexerNames match.
17094 * typemanager.cs (IndexerPropertyName): Added support for interface
17097 2002-07-22 Martin Baulig <martin@gnome.org>
17099 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17100 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17101 ret if HasReturnLabel.
17102 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17105 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17106 and set the ec.LoopBeginTryCatchLevel.
17107 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17108 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17109 the current ec.TryCatchLevel, the branch goes out of an exception
17110 block. In this case, we need to use Leave and not Br.
17112 2002-07-22 Martin Baulig <martin@gnome.org>
17114 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17115 block unless the block does not always return or it is contained in
17116 another try { ... } catch { ... } block. Fixes bug #26506.
17117 Added verify-1.cs to the test suite.
17119 2002-07-22 Martin Baulig <martin@gnome.org>
17121 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17122 then we do not always return. Fixes bug #24985.
17124 2002-07-22 Martin Baulig <martin@gnome.org>
17126 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17127 lookup on a per-class level; ie. walk up the class hierarchy until we
17128 found at least one applicable method, then choose the best among them.
17129 Fixes bug #24463 and test-29.cs.
17131 2002-07-22 Martin Baulig <martin@gnome.org>
17133 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17134 return types of the methods. The return type is not part of the
17135 signature and we must not check it to make the `new' modifier work.
17136 Fixes bug #27999, also added test-147.cs.
17137 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17139 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17140 on the method's return type.
17142 2002-07-21 Martin Baulig <martin@gnome.org>
17144 * assign.cs: Make this work if the rightmost source is a constant and
17145 we need to do an implicit type conversion. Also adding a few more tests
17146 to test-38.cs which should have caught this.
17148 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17149 target in the makefile for this. The makefile.gnu is primarily intended
17150 for end-users who don't want to debug the compiler.
17152 2002-07-21 Martin Baulig <martin@gnome.org>
17154 * assign.cs: Improved the Assign class so it can now handle embedded
17155 assignments (X = Y = Z = something). As a side-effect this'll now also
17156 consume less local variables. test-38.cs now passes with MCS, added
17157 a few new test cases to that test.
17159 2002-07-20 Martin Baulig <martin@gnome.org>
17161 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17162 instructions. Fixes bug #27977, also added test-146.cs.
17164 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17166 * cs-tokenizer.cs: fixed getHex ().
17168 2002-07-19 Martin Baulig <martin@gnome.org>
17170 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17171 not Type.GetType() to lookup the array type. This is needed when
17172 we're constructing an array of a user-defined type.
17173 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17174 single-dimensional arrays, but also for single-dimensial arrays of
17177 2002-07-19 Martin Baulig <martin@gnome.org>
17179 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17180 this function is called, it's not allowed to share LocalBuilders
17181 among ILGenerators.
17183 2002-07-19 Martin Baulig <martin@gnome.org>
17185 * expression.cs (Argument.Resolve): Report an error 118 when trying
17186 to pass a type as argument.
17188 2002-07-18 Martin Baulig <martin@gnome.org>
17190 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17191 Conv_R_Un for the signed `long' type.
17193 2002-07-15 Miguel de Icaza <miguel@ximian.com>
17195 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17196 `expr' for the temporary result, as that will fail if we do
17197 multiple resolves on the same expression.
17199 2002-07-05 Miguel de Icaza <miguel@ximian.com>
17201 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17202 ec.TypeContainer for looking up aliases.
17204 * class.cs (TypeContainer): Remove LookupAlias from here.
17206 * decl.cs (DeclSpace); Move here.
17208 2002-07-01 Miguel de Icaza <miguel@ximian.com>
17210 * class.cs (FindMembers): Only call filter if the constructor
17211 bulider is not null.
17213 Also handle delegates in `NestedTypes' now. Now we will perform
17214 type lookups using the standard resolution process. This also
17217 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17218 This uses Expressions (the limited kind that can be parsed by the
17219 tree) instead of strings.
17221 * expression.cs (ComposedCast.ToString): Implement, used to flag
17222 errors since now we have to render expressions.
17224 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
17227 * ecore.cs (SimpleName.ToString): ditto.
17229 * cs-parser.jay: Instead of using strings to assemble types, use
17230 Expressions to assemble the type (using SimpleName, ComposedCast,
17231 MemberAccess). This should fix the type lookups in declarations,
17232 because we were using a different code path for this.
17234 * statement.cs (Block.Resolve): Continue processing statements
17235 even when there is an error.
17237 2002-07-17 Miguel de Icaza <miguel@ximian.com>
17239 * class.cs (Event.Define): Also remove the `remove' method from
17240 the list of pending items.
17242 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17243 generate more compact code.
17245 2002-07-17 Martin Baulig <martin@gnome.org>
17247 * const.cs (Const.LookupConstantValue): Add support for constant
17248 `unchecked' and `checked' expressions.
17249 Also adding test case test-140.cs for this.
17251 2002-07-17 Martin Baulig <martin@gnome.org>
17253 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17254 check whether mi.ReturnType implements the IEnumerator interface; the
17255 `==' and the IsAssignableFrom() will fail in this situation.
17257 2002-07-16 Ravi Pratap <ravi@ximian.com>
17259 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
17262 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17264 * expression.cs: fixed bug #27811.
17266 2002-07-14 Miguel de Icaza <miguel@ximian.com>
17268 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17269 Molaro: when we are a ref, the value already contains a pointer
17270 value, do not take the address of it.
17272 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17273 * removed mb-parser.jay and mb-tokenizer.cs
17275 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17277 * expression.cs: check against the building corlib void type.
17279 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17281 * ecore.cs: fix for valuetype static readonly fields: when
17282 initializing them, we need their address, not the address of a copy.
17284 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17286 * typemanager.cs: register also enum_type in corlib.
17288 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17290 * class.cs: allow calling this (but not base) initializers in structs.
17292 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17294 * ecore.cs: make sure we compare against the building base types
17297 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17299 * typemanager.cs: fix TypeToCoreType() to handle void and object
17300 (corlib gets no more typerefs after this change).
17302 2002-07-12 Miguel de Icaza <miguel@ximian.com>
17304 * expression.cs (ArrayCreation.EmitArrayArguments): use
17305 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17307 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17308 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
17309 array indexes, the runtime actually forbids them.
17311 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17312 for array arguments here.
17314 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17315 instead of the default for ValueTypes.
17317 (New.DoEmit): Use IsValueType instead of
17318 IsSubclassOf (value_type)
17319 (New.DoResolve): ditto.
17320 (Invocation.EmitCall): ditto.
17322 * assign.cs (Assign): ditto.
17324 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17325 Statements *are* currently doing part of their resolution during
17328 Expressions do always resolve during resolve, but statements are
17329 only required to propagate resolution to their children.
17331 2002-07-11 Miguel de Icaza <miguel@ximian.com>
17333 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17335 (LoadAssembly): Do not add the dll if it is already specified
17337 (MainDriver): Add the System directory to the link path at the end,
17338 after all the other -L arguments.
17340 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17341 wrong opcode for loading bytes and bools (ldelem.i1 instead of
17342 ldelem.u1) and using the opposite for sbytes.
17344 This fixes Digger, and we can finally run it.
17346 * driver.cs (UnixParseOption): Move the option parsing here.
17347 (CSCParseOption): Implement CSC-like parsing of options.
17349 We now support both modes of operation, the old Unix way, and the
17350 new CSC-like way. This should help those who wanted to make cross
17351 platform makefiles.
17353 The only thing broken is that /r:, /reference: and /lib: are not
17354 implemented, because I want to make those have the same semantics
17355 as the CSC compiler has, and kill once and for all the confussion
17356 around this. Will be doing this tomorrow.
17358 * statement.cs (Unsafe.Resolve): The state is checked during
17359 resolve, not emit, so we have to set the flags for IsUnsfe here.
17361 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17363 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17364 not catch the Error_ObjectRefRequired in SimpleName (as it is
17365 possible to have a class/instance variable name that later gets
17366 deambiguated), we have to check this here.
17368 2002-07-10 Ravi Pratap <ravi@ximian.com>
17370 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17371 make static and put into Expression.
17373 (Event.Define): Register the private field of the event with the
17374 TypeManager so that GetFieldFromEvent can get at it.
17376 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17377 keep track of the private field associated with an event which
17380 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17383 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17385 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17387 * expression.cs (Binary.EmitBranchable): this routine emits the
17388 Binary expression in a branchable context. This basically means:
17389 we need to branch somewhere, not just get the value on the stack.
17391 This works together with Statement.EmitBoolExpression.
17393 * statement.cs (Statement.EmitBoolExpression): Use
17396 2002-07-09 Miguel de Icaza <miguel@ximian.com>
17398 * statement.cs (For): Reduce the number of jumps in loops.
17400 (For): Implement loop inversion for the For statement.
17402 (Break): We can be breaking out of a Try/Catch controlled section
17403 (foreach might have an implicit try/catch clause), so we need to
17404 use Leave instead of Br.
17406 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17407 now). If the instace expression supports IMemoryLocation, we use
17408 the AddressOf method from the IMemoryLocation to extract the
17409 address instead of emitting the instance.
17411 This showed up with `This', as we were emitting the instance
17412 always (Emit) instead of the Address of This. Particularly
17413 interesting when This is a value type, as we dont want the Emit
17414 effect (which was to load the object).
17416 2002-07-08 Miguel de Icaza <miguel@ximian.com>
17418 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17420 * statement.cs (Checked): Set the CheckedState during the resolve
17421 process too, as the ConvCast operations track the checked state on
17422 the resolve process, and not emit.
17424 * cs-parser.jay (namespace_member_declaration): Flag that we have
17425 found a declaration when we do. This is used to flag error 1529
17427 * driver.cs: Report ok when we display the help only.
17429 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
17431 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17433 2002-07-04 Miguel de Icaza <miguel@ximian.com>
17435 * cs-tokenizer.cs (define): We also have to track locally the
17436 defines. AllDefines is just used for the Conditional Attribute,
17437 but we also need the local defines for the current source code.
17439 2002-07-03 Miguel de Icaza <miguel@ximian.com>
17441 * statement.cs (While, For, Do): These loops can exit through a
17442 Break statement, use this information to tell whether the
17443 statement is the last piece of code.
17445 (Break): Flag that we break.
17447 * codegen.cs (EmitContexts): New `Breaks' state variable.
17449 2002-07-03 Martin Baulig <martin@gnome.org>
17451 * class.cs (TypeContainer.MethodModifiersValid): Allow override
17452 modifiers in method declarations in structs. Otherwise, you won't
17453 be able to override things like Object.Equals().
17455 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17457 * class.cs (Method, Property, Indexer): Do not allow the public
17458 modifier to be used in explicit interface implementations.
17460 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17461 override modifiers in method declarations in structs
17463 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
17465 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17466 integer or real overflow, report an error
17468 2002-07-02 Martin Baulig <martin@gnome.org>
17470 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17471 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17472 to tell the runtime about our newly created System.Object and
17473 System.ValueType types.
17475 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17477 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17478 struct instead of Ldarg/Starg.
17480 2002-07-02 Martin Baulig <martin@gnome.org>
17482 * expression.cs (Indirection.Indirection): Call
17483 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17485 2002-07-02 Martin Baulig <martin@gnome.org>
17487 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17488 ValueType, call TypeManager.TypeToCoreType() on it.
17489 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17490 the OpCodes.Newarr argument.
17492 2002-07-02 Martin Baulig <martin@gnome.org>
17494 * expression.cs (Invocation.EmitCall): When compiling corlib,
17495 replace all calls to the system's System.Array type to calls to
17496 the newly created one.
17498 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17499 System.Array methods.
17500 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17501 from the system's System.Array type which must be replaced.
17503 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17505 * typemanager.cs: load unverifiable_code_ctor so we can build
17506 corlib using the correct type. Avoid using GetTypeCode() with
17508 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17509 TypeManager.object_type to allow building corlib.
17511 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17513 * ecore.cs: handle System.Enum separately in LoadFromPtr().
17515 2002-07-01 Martin Baulig <martin@gnome.org>
17517 * class.cs: Make the last change actually work, we need to check
17518 whether `ifaces != null' to avoid a crash.
17520 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17522 * class.cs: when we build structs without fields that implement
17523 interfaces, we need to add the interfaces separately, since there is
17524 no API to both set the size and add the interfaces at type creation
17527 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17529 * expression.cs: the dimension arguments to the array constructors
17530 need to be converted if they are a long.
17532 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17534 * class.cs: don't emit ldarg.0 if there is no parent constructor
17535 (fixes showstopper for corlib).
17537 2002-06-29 Martin Baulig <martin@gnome.org>
17539 MCS now compiles corlib on GNU/Linux :-)
17541 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17542 ie. check for MethodImplOptions.InternalCall.
17544 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17545 and TypeManager.attribute_type are null, so we must explicitly check
17546 whether parent is not null to find out whether it's an attribute type.
17547 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17548 and SetBuilder, not only if the property is neither abstract nor external.
17549 This is necessary to set the MethodImplOptions on the accessor methods.
17550 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17551 SetBuilder, see Property.Emit().
17553 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17554 populate "System.Object", "System.ValueType" and "System.Attribute" since
17555 they've already been populated from BootCorlib_PopulateCoreTypes().
17557 2002-06-29 Martin Baulig <martin@gnome.org>
17559 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17560 is the NullLiteral, we also need to make sure that target_type is not
17563 2002-06-29 Martin Baulig <martin@gnome.org>
17565 * rootcontext.cs (RootContext.ResolveCore): We must initialize
17566 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17567 before calling BootstrapCorlib_ResolveDelegate ().
17569 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17571 * statement.cs: fixed build-breaker. All tests passed ok.
17573 2002-06-27 Martin Baulig <martin@gnome.org>
17575 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17576 for System.Decimal when compiling corlib.
17578 2002-06-27 Martin Baulig <martin@gnome.org>
17580 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17581 switch blocks which contain nothing but a default clause.
17583 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
17585 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17587 2002-06-27 Martin Baulig <martin@gnome.org>
17589 * ecore.cs (PropertyExpr.PropertyExpr): Call
17590 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17592 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17593 is already a TypeBuilder.
17595 2002-06-27 Martin Baulig <martin@gnome.org>
17597 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17598 `target_type == TypeManager.array_type', not IsAssignableFrom() in
17599 the "from an array-type to System.Array" case. This makes it work
17600 when compiling corlib.
17602 2002-06-27 Martin Baulig <martin@gnome.org>
17604 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17605 non-static PropertyExpr, set its InstanceExpression. This makes
17606 the `ICollection.Count' property work in System/Array.cs.
17608 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
17610 * driver.cs: Made error handling more consistent. Errors now
17611 tracked by Report class, so many methods which used to return int
17612 now return void. Main() now prints success/failure and
17613 errors/warnings message.
17615 Renamed '--probe' compiler argument to '--expect-error'. Removed
17616 the magic number return values (123 and 124). Now, if the
17617 expected error occurs, the compiler exits with success (exit value
17618 0). If the compilation completes without seeing that particular
17619 error, the compiler exits with failure (exit value 1). The
17620 makefile in mcs/errors has been changed to handle the new behaviour.
17622 * report.cs: Made 'expected error' number a property and renamed
17623 it from 'Probe' to 'ExpectedError'.
17625 * genericparser.cs: Removed error handling support, since it is
17626 now all done by Report class.
17628 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17629 class, so parse() no longer returns an int.
17631 * namespace.cs: Use Report.Error instead of GenericParser.error
17633 2002-06-22 Miguel de Icaza <miguel@ximian.com>
17635 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17636 TypeContainer.AddOperator): At the front of the list put the
17637 explicit implementations, so they get resolved/defined first.
17639 2002-06-21 Miguel de Icaza <miguel@ximian.com>
17641 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17642 interface type is implemented by this TypeContainer. Used during
17643 explicit interface implementation.
17645 (Property.Define, Indexer.Define, Method.Define): Validate that
17646 the given interface in the explicit implementation is one of the
17647 base classes for the containing type.
17649 Also if we are explicitly implementing an interface, but there is
17650 no match in the pending implementation table, report an error.
17652 (Property.Define): Only define the property if we are
17653 not explicitly implementing a property from an interface. Use the
17654 correct name also for those properties (the same CSC uses,
17655 although that is really not needed).
17657 (Property.Emit): Do not emit attributes for explicitly implemented
17658 properties, as there is no TypeBuilder.
17660 (Indexer.Emit): ditto.
17662 Hiding then means that we do not really *implement* a pending
17663 implementation, which makes code fail.
17665 2002-06-22 Martin Baulig <martin@gnome.org>
17667 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17668 the return value of Object.GetType(). [FIXME: we need to do this whenever
17669 we get a type back from the reflection library].
17671 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17673 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17675 2002-06-20 Miguel de Icaza <miguel@ximian.com>
17677 * attribute.cs: Return null if we can not look up the type.
17679 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17680 the interface types found.
17682 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17683 interface types found.
17685 * typemanager.cs (GetInterfaces): Make this routine returns alll
17686 the interfaces and work around the lame differences between
17687 System.Type and System.Reflection.Emit.TypeBuilder in the results
17688 result for GetInterfaces.
17690 (ExpandInterfaces): Given an array of interface types, expand and
17691 eliminate repeated ocurrences of an interface. This expands in
17692 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17695 2002-06-21 Martin Baulig <martin@gnome.org>
17697 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17700 2002-06-21 Martin Baulig <martin@gnome.org>
17702 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
17703 and called with one of the core types, return the corresponding typebuilder for
17706 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17709 2002-06-21 Martin Baulig <martin@gnome.org>
17711 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17712 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17713 (Expression.ConvertReferenceExplicit): Likewise.
17715 * expression.cs (ElementAccess.DoResolve): Likewise.
17716 (ElementAccess.DoResolveLValue): Likewise.
17718 2002-06-10 Martin Baulig <martin@gnome.org>
17720 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17721 add the "value" parameter to the parameter list.
17723 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17726 2002-06-19 Miguel de Icaza <miguel@ximian.com>
17728 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17729 the argument to an int, uint, long or ulong, per the spec. Also
17730 catch negative constants in array creation.
17732 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17734 * class.cs: do not allow the same interface to appear twice in
17735 the definition list.
17737 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17739 * ecore.cs: don't use ldlen with System.Array.
17741 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17743 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17745 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17747 * modifiers.cs: produce correct field attributes for protected
17748 internal. Easy fix so miguel can work on ther harder stuff:-)
17750 2002-06-18 Miguel de Icaza <miguel@ximian.com>
17752 * pending.cs: New file. Move the code from class.cs here.
17753 Support clearning the pending flag for all methods (when not doing
17754 explicit interface implementation).
17756 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17758 * rootcontext.cs: added a couple more types needed to bootstrap.
17760 2002-06-17 Miguel de Icaza <miguel@ximian.com>
17762 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17763 constructor in the type, instead of any constructor in the type
17764 hierarchy. Thanks to Paolo for finding this bug (it showed up as
17765 a bug in the Mono runtime when applying the params attribute).
17767 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17768 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17770 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
17772 * expression.cs (Unary.ResolveOperator): Use TypeManager
17773 to resolve the type.
17775 2002-06-13 Ravi Pratap <ravi@ximian.com>
17777 * cs-parser.jay (enum_member_declaration): Pass in the attributes
17780 * enum.cs (AddEnumMember): Add support to store the attributes associated
17781 with each member too.
17783 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17784 field builders too - this takes care of the enum member case.
17786 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
17788 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17789 address-of operator on both value types and pointers.
17791 2002-06-10 Martin Baulig <martin@gnome.org>
17793 * interface.cs (Interface.PopulateIndexer): Add the indexer's
17794 PropertyBuilder to the `property_builders' list.
17796 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17797 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17798 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
17799 find any indexers which are inherited from an interface.
17801 2002-06-09 Martin Baulig <martin@gnome.org>
17803 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17804 the same type as the constant if necessary. There's also a test-130.cs
17807 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17809 * typemanager.cs (TypeManager.ChangeType): Previously known as
17810 Enum.ChangeEnumType().
17812 2002-06-09 Martin Baulig <martin@gnome.org>
17814 * expression.cs (Cast.TryReduce): Added support for consts.
17816 2002-06-08 Ravi Pratap <ravi@ximian.com>
17818 * class.cs (Accessor): Hold attributes information so we can pass
17821 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17822 Modify to pass in attributes attached to the methods.
17824 (add_accessor_declaration, remove_accessor_declaration): Ditto.
17826 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17827 to handle the Accessor kind :-)
17829 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17831 2002-06-08 Martin Baulig <martin@gnome.org>
17833 * expression.cs (Unary.TryReduceNegative): Added support for
17836 2002-06-08 Martin Baulig <martin@gnome.org>
17838 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17839 name can't be found in the `defined_names' - the caller will do a
17840 MemberLookup in this case and thus find methods in System.Enum
17841 such as Enum.IsDefined().
17843 2002-06-08 Martin Baulig <martin@gnome.org>
17845 * enum.cs (Enum.ChangeEnumType): This is a custom version of
17846 Convert.ChangeType() which works with TypeBuilder created types.
17847 (Enum.LookupEnumValue, Enum.Define): Use it here.
17849 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17850 `TypeBuilder.BaseType != null' check.
17851 (TypeContainer.FindMembers): Only lookup parent members if we
17852 actually have a parent.
17853 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17854 (ConstructorInitializer.Resolve): Likewise.
17856 * interface.cs (Interface.FindMembers): Added
17857 `TypeBuilder.BaseType != null' check.
17859 * rootcontext.cs (RootContext.ResolveCore): Added
17860 "System.Runtime.CompilerServices.IndexerNameAttribute" to
17861 classes_second_stage.
17863 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17864 debug_type and trace_type when compiling with --nostdlib.
17866 2002-06-07 Martin Baulig <martin@gnome.org>
17868 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17869 (AddField): Set it to true when adding a non-static field.
17870 (DefineType): Use `have_nonstatic_fields' to find out whether we
17871 have non-static fields, not `Fields != null'.
17873 2002-06-02 Miguel de Icaza <miguel@ximian.com>
17875 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17876 dereferencing a null on the static-field code path)
17878 2002-05-30 Martin Baulig <martin@gnome.org>
17880 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17881 to take command line arguments. Use reflection to call the new
17882 custom `Initialize' function on the symbol writer and pass it the
17883 command line arguments.
17885 * driver.cs (--debug-args): New command line argument to pass command
17886 line arguments to the symbol writer.
17888 2002-05-28 Miguel de Icaza <miguel@ximian.com>
17890 * assign.cs (DoResolve): Forgot to do the implicit conversion to
17891 the target type for indexers and properties. Thanks to Joe for
17894 2002-05-27 Miguel de Icaza <miguel@ximian.com>
17896 * typemanager.cs (MethodFlags): returns the method flags
17897 (Obsolete/ShouldIgnore) that control warning emission and whether
17898 the invocation should be made, or ignored.
17900 * expression.cs (Invocation.Emit): Remove previous hack, we should
17901 not do this on matching a base type, we should do this based on an attribute
17903 Only emit calls to System.Diagnostics.Debug and
17904 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17905 on the command line.
17907 * rootcontext.cs: Global settings for tracing and debugging.
17909 * cs-tokenizer.cs (define): New utility function to track
17910 defines. Set the global settings for TRACE and DEBUG if found.
17912 2002-05-25 Ravi Pratap <ravi@ximian.com>
17914 * interface.cs (Populate*): Pass in the TypeContainer as well as
17915 the DeclSpace as parameters so that we can create EmitContexts and
17916 then use that to apply attributes etc.
17918 (PopulateMethod, PopulateEvent, PopulateProperty)
17919 (PopulateIndexer): Apply attributes everywhere.
17921 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17924 (ApplyAttributes): Update accordingly.
17926 We now apply interface attributes for all members too.
17928 2002-05-26 Miguel de Icaza <miguel@ximian.com>
17930 * class.cs (Indexer.Define); Correctly check if we are explicit
17931 implementation (instead of checking the Name for a ".", we
17932 directly look up if the InterfaceType was specified).
17934 Delay the creation of the PropertyBuilder.
17936 Only create the PropertyBuilder if we are not an explicit
17937 interface implementation. This means that explicit interface
17938 implementation members do not participate in regular function
17939 lookups, and hence fixes another major ambiguity problem in
17940 overload resolution (that was the visible effect).
17942 (DefineMethod): Return whether we are doing an interface
17945 * typemanager.cs: Temporary hack until we get attributes in
17946 interfaces (Ravi is working on that) and we get IndexerName
17947 support in interfaces.
17949 * interface.cs: Register the indexers as properties.
17951 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17952 warning, I have verified that this is a bug in the .NET runtime
17953 (JavaScript suffers of the same problem).
17955 * typemanager.cs (MemberLookup): When looking up members for
17956 interfaces, the parent of an interface is the implicit
17957 System.Object (so we succeed in searches of Object methods in an
17958 interface method invocation. Example: IEnumerable x; x.ToString
17961 2002-05-25 Miguel de Icaza <miguel@ximian.com>
17963 * class.cs (Event): Events should also register if they do
17964 implement the methods that an interface requires.
17966 * typemanager.cs (MemberLookup); use the new GetInterfaces
17969 (GetInterfaces): The code used to lookup interfaces for a type is
17970 used in more than one place, factor it here.
17972 * driver.cs: Track the errors at the bottom of the file, we kept
17975 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17976 instance if the method we are calling is static!
17978 2002-05-24 Miguel de Icaza <miguel@ximian.com>
17980 * attribute.cs (ApplyAttributes): Make this function filter out
17981 the IndexerName attribute (as that attribute in reality is never
17982 applied) and return the string constant for the IndexerName
17985 * class.cs (TypeContainer.Emit): Validate that all the indexers
17986 have the same IndexerName attribute, and if so, set the
17987 DefaultName attribute on the class.
17989 * typemanager.cs: The return value might contain other stuff (not
17990 only methods). For instance, consider a method with an "Item"
17991 property and an Item method.
17993 * class.cs: If there is a problem with the parameter types,
17996 2002-05-24 Ravi Pratap <ravi@ximian.com>
17998 * ecore.cs (ImplicitConversionExists): Wrapper function which also
17999 looks at user defined conversion after making a call to
18000 StandardConversionExists - we need this for overload resolution.
18002 * expression.cs : Update accordingly the various method calls.
18004 This fixes 2 bugs filed against implicit user defined conversions
18006 2002-05-22 Miguel de Icaza <miguel@ximian.com>
18008 * statement.cs: Track the result of the assignment.
18010 2002-05-21 Miguel de Icaza <miguel@ximian.com>
18012 * expression.cs (MemberAccess): Improved error reporting for
18013 inaccessible members.
18015 2002-05-22 Martin Baulig <martin@gnome.org>
18017 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
18018 itself with debugging support.
18020 2002-05-22 Martin Baulig <martin@gnome.org>
18022 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18023 Removed, this isn't needed anymore.
18025 2002-05-20 Martin Baulig <martin@gnome.org>
18027 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18028 be underlying type for an enum.
18030 2002-05-20 Miguel de Icaza <miguel@ximian.com>
18032 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18033 that splits out the loading of just the core types.
18035 * rootcontext.cs (ResolveCore): Split the struct resolution in
18036 two, so we can load the enumeration underlying types before any
18039 * expression.cs (Is): Bandaid until we fix properly Switch (see
18040 bug #24985 for details).
18042 * typemanager.cs (ImplementsInterface): The hashtable will contain
18043 a null if there are no interfaces implemented.
18045 2002-05-18 Miguel de Icaza <miguel@ximian.com>
18047 * cs-parser.jay (indexer_declarator): It is fine to have array
18050 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18052 * typemanager.cs: (RegisterBuilder): New function used to register
18053 TypeBuilders that implement interfaces. Since
18054 TypeBuilder.GetInterfaces (as usual) does not work with lame
18056 (AddUserType): register interfaces.
18058 (ImplementsInterface): Use the builder_to_ifaces hash if we are
18059 dealing with TypeBuilder. Also, arrays are showing up as
18060 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18061 methods can not be invoked on them!
18063 * ecore.cs (ExplicitReferenceConversionExists): Made public.
18064 (ImplicitReferenceConversionExists): Split out from
18065 StandardConversionExists.
18067 * expression.cs (As): We were only implementing one of the three
18068 cases for the as operator. We now implement them all.
18069 (Is): Implement the various other cases for Is as well.
18071 * typemanager.cs (CACHE): New define used to control if we want or
18072 not the FindMembers cache. Seems to have a negative impact on
18073 performance currently
18075 (MemberLookup): Nested types have full acess to
18076 enclosing type members
18078 Remove code that coped with instance/static returns for events, we
18079 now catch this in RealFindMembers.
18081 (RealFindMembers): only perform static lookup if the instance
18082 lookup did not return a type or an event.
18084 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18086 * assign.cs (CompoundAssign): We pass more semantic information
18087 now to Compound Assignments than we did before: now we have all
18088 the information at hand, and now we resolve the target *before* we
18089 do the expression expansion, which allows the "CacheValue" method
18090 to have the effect we intended (before, a [x] += 1 would generate
18091 two differen ArrayAccess expressions from the ElementAccess,
18092 during the resolution process).
18094 (CompoundAssign.DoResolve): Resolve target and original_source here.
18096 2002-05-16 Miguel de Icaza <miguel@ximian.com>
18098 * expression.cs (ArrayAccess): dropped debugging information.
18100 * typemanager.cs: Small bug fix: I was always returning i_members,
18101 instead of one of i_members or s_members (depending on which had
18104 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
18105 method is invoked before any code generation takes place, and it
18106 is a mechanism to inform that the expression will be invoked more
18107 than once, and that the method should use temporary values to
18108 avoid having side effects
18110 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18112 * ecore.cs (Expression.CacheTemporaries): Provide empty default
18115 * expression.cs (Indirection, ArrayAccess): Add support for
18116 CacheTemporaries in these two bad boys.
18118 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18119 ldobj or ldind_ref.
18120 (StoreFromPtr): Handle stobj as well.
18122 * expression.cs (UnaryMutator): Share more code.
18124 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18125 down: I was not tracking the Filter function as well, which
18126 was affecting the results of the cache.
18128 2002-05-15 Miguel de Icaza <miguel@ximian.com>
18130 * attribute.cs: Remove the hack to handle the CharSet property on
18133 2002-05-14 Miguel de Icaza <miguel@ximian.com>
18135 * attribute.cs (DoResolve): More uglyness, we now only try to
18136 resolve the attribute partially, to extract the CharSet
18137 information (only if we are a StructLayout attribute). Otherwise
18139 (GetExtraTypeInfo): Add some code to conditionally kill in the
18140 future this. I am more and more convinced that the .NET
18141 framework has special code to handle the attribute setting on
18144 * expression.cs (IsParamsMethodApplicable): Revert my previous
18145 foreach change here, it was wrong.
18147 2002-05-13 Miguel de Icaza <miguel@ximian.com>
18149 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18150 (pp_expr): do not abort on unknown input, just return.
18151 (eval): abort if there are pending chars.
18153 * attribute.cs (Attribute.Resolve): Positional parameters are
18154 optional. Deal with that case.
18156 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18157 the Ansi/Unicode/Auto information for the type.
18159 (TypeContainer.DefineType): instantiate the EmitContext here, as
18160 we will be using it during the type definition (to resolve
18161 attributes) and during the emit phase.
18163 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18164 to pull type information out of the attributes
18166 (Attribute.Resolve): track the constructor builder, and allow for
18167 multiple invocations (structs and classes will use this).
18169 * ecore.cs (MemberLookupFinal): new version with all the
18170 parameters customizable.
18172 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18173 constructors. Return if the result value is null (as the error
18174 would have been flagged already by MemberLookupFinal)
18176 Do not allow instances of abstract classes or interfaces to be
18179 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18180 We have to compare the assembly property here when dealing with
18181 FamANDAssem and Assembly access modifiers, because we might be
18182 creating an assembly from *modules* (that means that we are not
18183 getting TypeBuilders for types defined in other modules that are
18184 part of this assembly).
18186 (Method.Emit): If the method is marked abstract and has a body,
18189 (TypeContainer.DefineMembers): If both the defined member and the
18190 parent name match are methods, then do not emit any warnings: let
18191 the Method.Define routine take care of flagging warnings. But if
18192 there is a mismatch (method overrides something else, or method is
18193 overriwritten by something, then emit warning).
18195 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18196 set to null, this means `do not check for the return type on the
18199 (Method.Define): set the return type for the method signature to
18200 null, so that we get methods with the same name and parameters and
18201 different return types. This is used to flag warning 114 (you are
18202 hiding a method, and you probably want to use the new/override
18205 * typemanager.cs (MemberLookup): Implemented proper access
18206 control, closing a long standing set of bug reports. The problem
18207 was that the Framework only has two bits: Public and NonPublic,
18208 and NonPublic includes private and protected methods, but we need
18209 to enforce the FamANDAssem, FamOrAssem and Family.
18211 2002-05-11 Miguel de Icaza <miguel@ximian.com>
18213 * statement.cs (GotoCase): Return true: Ammounts to giving up
18214 knowledge on whether we return or not, and letting the other case
18215 be responsible for it.
18217 2002-05-10 Miguel de Icaza <miguel@ximian.com>
18219 * driver.cs: Do not load directories for each file processed, only
18220 do it if there is a pattern.
18222 * ecore.cs: Report readonly assigns here as well, as we might have
18223 been resolved only by MemberAccess.
18225 (SimpleName.SimpleNameResolve): Also be useful for LValue
18226 resolution. We need this to propagate assign to local readonly variables
18228 * typemanager.cs: Use a ptrhashtable for the criteria, because we
18229 do not want to reuse potential criteria memory.
18231 * class.cs (MyEventBuilder): Set reflected_type;
18233 * ecore.cs (Constantify): Added support for constifying bools.
18235 (RootContext.LookupType): Added a cache for values looked up in
18236 the declaration space.
18238 * typemanager.cs (FindMembers): Now is a front-end to
18239 RealFindMembers, and provides a two-level hashtable-based cache to
18242 15% performance improvement: from 22.5 to 19.2 seconds.
18244 * expression.cs (IsParamsMethodApplicable): use foreach.
18245 (Invocation.DoResolve): ditto.
18246 (New.DoResolve): ditto.
18247 (ArrayCreation.DoResolve): ditto.
18249 * ecore.cs (FindMostEncompassingType): use foreach.
18251 * delegate.cs (NewDelegate.DoResolve): Use foreach
18253 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18254 (RemoveMethods): use foreach.
18256 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18257 nested foreach statements instead of for, and also break out of
18258 the inner loop once a match is found.
18260 (Invocation.OverloadResolve): Use foreach, simplify the code.
18262 2002-05-08 Miguel de Icaza <miguel@ximian.com>
18264 * cfold.cs (BinaryFold): During an enumeration evaluation context,
18265 we actually unwrap the expression to allow for extra information
18268 * expression.cs: Use Shr_Un on unsigned operations.
18270 2002-05-08 Ravi Pratap <ravi@ximian.com>
18272 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
18273 applicable operators was not being considered correctly. This closes
18274 the bug Miguel reported.
18276 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18278 * attribute.cs: check that the type derives from System.Attribute
18279 and report the correct error in that case (moved the duplicate code to
18280 its own method, too).
18282 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18284 * attribute.cs: lookup attribute type name as the spec says: first the
18285 bare attribute name and then name + "Attribute" (nant compiles with
18286 mcs after this fix).
18288 2002-05-07 Miguel de Icaza <miguel@ximian.com>
18290 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
18291 Because of the way we parse things, we should try to see if a
18292 UIntConstant can fit in an integer.
18294 2002-05-07 Ravi Pratap <ravi@ximian.com>
18296 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18297 when we are in an explicit context.
18299 (ConvertReferenceExplicit): When converting from Iface type S to Class
18300 T make sure the rules are implemented as an OR.
18302 * parameter.cs (ParameterType): Make it a property for now although the
18303 purpose really isn't anything immediate.
18305 * expression.cs (Is*Applicable): Do better checking on the parameter type
18306 of a ref/out parameter. The ones from the system assemblies are already
18307 marked with the correct type so we don't need to do any correction.
18309 * ecore.cs (StandardConversionExists): Conversion from Interface types to
18310 the object type is standard too so include that.
18312 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18314 * ecore.cs (StandardConversionExists): Augment with missing code:
18315 deal with IntConstant, LongConstants and Enumerations.
18317 * assign.cs: Report the error, instead of failing silently
18319 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18320 typecontainer that they are declared, because the
18321 typecontainer/namespace will have the list of using clauses that
18322 need to be applied.
18324 Assembly Attributes were escaping the normal registration
18327 (EmitCode): Apply attributes within an EmitContext that represents
18328 the container they were declared on.
18330 * cs-parser.jay: Track bases for structs. How did I get this wrong?
18332 2002-05-06 Ravi Pratap <ravi@ximian.com>
18334 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18335 Revamp completely - make much cleaner as we now operate only
18338 (FindMostSpecificSource, FindMostSpecificTarget): New methods
18339 to implement the logic detailed in the spec more correctly.
18341 (UserDefinedConversion): Update accordingly.
18343 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18345 * statement.cs: Return flow analysis information up.
18347 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18350 (token): Do not consume an extra character before calling
18353 2002-05-06 Piers Haken <piersh@friskit.com>
18355 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18357 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18359 * class.cs (Constructor.Emit): Set the IsStatic flag in the
18360 EmitContext during the instance constructor initializer
18361 resolution, to stop access to instance variables.
18363 This is mandated by the spec, last paragraph of the `constructor
18364 initializers' section.
18366 2002-05-05 Miguel de Icaza <miguel@ximian.com>
18368 * cs-parser.jay, class.cs (Accessor): new class used to represent
18369 an accessor (get or set). In the past we used `null' to represent
18370 a missing accessor. But this is ambiguous because there was no
18371 way to tell in abstract indexers/properties if one of them was
18374 Now there is a way of addressing that.
18376 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18377 instead of FindMembers.
18379 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18380 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18382 * attribute.cs: Treat indexers and properties as the same in terms
18383 of applying attributes
18385 * ecore.cs (FindMostEncompassedType): Use statically initialized
18386 EmptyExpressions()s like we do elsewhere to avoid creating useless
18387 objects (and we take this out of the tight loop).
18389 (GetConversionOperators): Move the code to extract the actual
18390 operators to a separate routine to clean things up.
18392 2002-05-04 Miguel de Icaza <miguel@ximian.com>
18394 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18395 events are always registered FieldBuilders.
18397 * class.cs (FieldBase): New class shared by Fields
18399 * delegate.cs: If we are a toplevel delegate, use our full name.
18400 If we are a nested delegate, then only use our tail name.
18402 2002-05-02 Ravi Pratap <ravi@ximian.com>
18404 * expression.cs (IsApplicable): Ensure that we add the "&" to
18405 ref/out types before comparing it with the type of the argument.
18407 (IsParamsMethodApplicable): Ditto.
18409 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
18412 * delegate.cs : Handle the case when we have more than one applicable
18413 method. Flag an error only when we finish checking all.
18415 2002-05-02 Miguel de Icaza <miguel@ximian.com>
18417 * expression.cs: Add support for boolean static initializers.
18419 2002-05-01 Miguel de Icaza <miguel@ximian.com>
18421 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18423 * parameter.cs (ComputeParameterTypes,
18424 ComputeAndDefineParameterTypes): Better error handling: now we
18425 clear the `types' cache if we fail during any of the type lookups.
18426 We also return the status code correctly to our caller
18428 * delegate.cs: If we fail to define a delegate, abort the extra
18431 * expression.cs (Binary.ResolveOperator): for
18432 operator==(object,object) and operator !=(object, object) we also
18433 have to verify that there is an implicit conversion from one to
18436 (ArrayAccess.DoResolve): Array Access can operate on
18439 2002-04-30 Miguel de Icaza <miguel@ximian.com>
18441 * assign.cs (CompoundAssign): A new class used as a "flag" that
18442 the assignment actually is happening as part of a compound
18443 assignment operator.
18445 During compound assignment, a few new rules exist to enable things
18452 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18453 to the type of x) if y is implicitly convertible to the type of x,
18454 and the operator is a builtin operator and the return type of the
18455 operator is explicitly convertible to the type of x.
18457 * rootcontext.cs: Reset warning level to 2. 4 catches various
18458 "interesting" features in mcs, we must clean this up at some
18459 point, but currently am trying to kill other bugs ;-)
18461 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18462 in container classes as well.
18464 * expression.cs (Binary.ResolveOperator): Handle string case
18465 before anything else (as operator overloading does emit an error
18466 before doing anything else).
18468 This code could go away when we move to a table driven model, but
18469 i could not come up with a good plan last night.
18471 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
18473 * typemanager.cs (CSharpName): reimplementation using regex.
18474 * class.cs: added null check for fields in Emit
18475 * rootcontext.cs: set warninglevel to 4
18477 2002-04-29 Miguel de Icaza <miguel@ximian.com>
18479 * typemanager.cs (CSharpName): reimplemented with Lupus
18482 2002-04-28 Miguel de Icaza <miguel@ximian.com>
18484 * statement.cs (If): correclty implement Resolve, because we were
18485 not catching sem errors in there. The same process is needed
18487 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18490 (Statement.Warning_DeadCodeFound): Factorize code.
18491 (While): Report dead code here too.
18493 (Statement): Added Resolve virtual method to allow
18494 for resolution split from the emit code.
18496 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18498 * statement.cs (EmitBoolExpression): No longer try to resolve the
18500 (MakeBoolean): New utility function that resolve, implicitly
18501 converts to boolean and tags the expression.
18504 (If, Do): Implement dead code elimination.
18505 (While): Implement loop inversion
18507 (Do, While, For, If): Resolve the expression prior to calling our
18510 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
18513 - added method Report28 (warning: program has more than one entry point)
18514 - added method IsEntryPoint, implements paragraph 10.1 of the spec
18515 - modified method Method.Define, the part at the end of the method
18517 * rootcontext.cs: added static public Location EntryPointLocation;
18519 * ../errors/cs0028.cs : Add test case for the above warning.
18522 - modified method CSharpName to allow arrays of primitive type to
18523 be printed nicely (e.g. instead of System.Int32[][] it now prints
18525 - added method CSharpSignature: returns the signature of a method
18526 in string format to be used in reporting errors, warnings, etc.
18528 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18531 2002-04-26 Ravi Pratap <ravi@ximian.com>
18533 * delegate.cs (Define): Fix extremely silly bug where I was
18534 setting the type of the 'object' parameter of the BeginInvoke
18535 method to System.IAsyncResult instead of System.Object ;-)
18537 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18539 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18542 (Constructor.Emit): return if we fail to initialize the
18543 constructor. Another door closed!
18545 * expression.cs (New.DoResolve): Improve error message (from -6 to
18546 1501). Use DeclaredOnly lookup to find the exact constructor.
18548 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18549 loop. This is useful.
18551 * cs-parser.jay: Adjust the default parameters so that destructors
18552 have the proper signature.
18554 2002-04-26 Martin Baulig <martin@gnome.org>
18556 * driver.cs (LoadAssembly): If `assembly' contains any characters
18557 which are only valid in path names and not in assembly names
18558 (currently slash, backslash and point), use Assembly.LoadFrom ()
18559 instead of Assembly.Load () on the `assembly' (before iteration
18560 over the link_paths).
18562 2002-04-26 Martin Baulig <martin@gnome.org>
18564 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18566 2002-04-25 Miguel de Icaza <miguel@ximian.com>
18568 * class.cs (Property): use the new typemanager.MemberLookup
18570 (TypeContainer.MemberLookup): Implement using the
18571 TypeManager.MemberLookup now.
18573 * typemanager.cs: Make MemberLookup a function of the TypeManager,
18574 and return MemberInfos, so that these can be used without an
18575 EmitContext (what we had before).
18577 2002-04-24 Miguel de Icaza <miguel@ximian.com>
18579 * expression.cs: Fix the case where the argument to params if the
18580 type of the params. I omitted handling this before. Fixed
18582 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18584 * driver.cs: Call BootCorlib_PopulateCoreType
18586 * class.cs (Property.CheckBase): Check for properties only, not
18589 * interface.cs: Temporary hack: try/catch around the
18590 CustomAttributeBuilder, because I am getting an exception that I
18593 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18594 types whose definitions are required to be there (attributes are
18595 defined before standard types).
18597 Compute definitions as we boot the various types, as they are used
18598 immediately (value_type class will need object_type, but if we do
18599 not initialize object_type, we will pass a null, which will let
18600 the runtime pick the System.Object from the existing corlib, which
18601 is not what we want).
18603 2002-04-22 Patrik Torstensson <totte@labs2.com>
18605 * cs-tokenizer.cs: fixed a number of trim() issues.
18607 2002-04-22 Ravi Pratap <ravi@ximian.com>
18609 * expression.cs (Argument.Type): Ensure that we return the correct
18610 type when we have out or ref parameters [in which case we
18613 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18615 * class.cs (Property, Indexer): Allow extern modifier in there.
18617 * typemanager.cs (InitBaseTypes): Initializes object_type and
18618 value_type, since those will be used early on during the bootstrap
18619 process to compile corlib.
18621 (InitCoreTypes): Move code from here to InitBaseTypes.
18623 2002-04-21 Miguel de Icaza <miguel@ximian.com>
18625 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18626 single-dimension arrays as using the ldlen opcode.
18628 Daniel Lewis discovered this optimization.
18630 * typemanager.cs: Add signature for System.Array::get_Length
18632 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18634 * statement.cs: report the error when the foreach does not apply to an
18635 array nor a collection.
18637 2002-04-19 Miguel de Icaza <miguel@ximian.com>
18639 * expression.cs: Add implicit conversions to the operator ~.
18641 * constant.cs (DecimalConstant.Emit): Emit decimal value.
18643 * typemanager.cs: Locate the decimal constructor.
18645 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18647 * attribute.cs: use the new property of TypeOf.
18648 * expression.cs: added 'get' property around typearg.
18650 These changes fix a build breaker reported by NickD. Is this the
18651 correct way to fix? If not, please, revert my changes and make it
18654 2002-04-17 Miguel de Icaza <miguel@ximian.com>
18656 * attribute.cs: Add support for typeof in attribute invocations.
18657 I am not sure that this is right though.
18659 2002-04-14 Duncan Mak <duncan@ximian.com>
18661 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18662 Binary.Operator.Division case.
18664 2002-04-13 Ravi Pratap <ravi@ximian.com>
18666 * class.cs (DefineType): Ensure that we do a proper check on
18667 attribute types and also register it with the TypeManager.
18669 (TypeContainer.Targets): The default for attribute types is
18670 AttributeTargets.All.
18672 * attribute.cs (ApplyAttributes): Registering the attribute type
18673 is done elsewhere, not when we discover we have a Usage attribute.
18675 2002-04-12 Ravi Pratap <ravi@ximian.com>
18677 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18678 and get rid of is_delegate parameter.
18680 * everywhere : update.
18682 2002-04-12 Ravi Pratap <ravi@ximian.com>
18684 * cs-parser.jay (compilation_unit): Revamp completely to use
18685 some new ideas that I got from Rhys' grammar to solve the problems
18686 with assembly level attributes.
18688 (outer_declaration): New grammar production.
18690 (attribute_sections): Add.
18692 (opt_attributes): Base on attribute_sections
18694 (namespace_declaration): Allow opt_attributes to tackle the case
18695 when we have assembly level attributes - we are clever in this
18698 * attribute.cs (ApplyAttributes): Do not worry about assembly
18699 attributes in the non-global context.
18701 * rootcontext.cs (AddGlobalAttributes): Go back to using this
18702 instead of SetGlobalAttributes.
18704 * class.cs, rootcontext.cs : Ensure we define and generate
18705 attribute types before anything else.
18707 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18708 and flag the new error -20 for the case when the attribute type
18709 does not have valid targets specified. csc does not catch this.
18711 * ../errors/errors.txt : update for error # -20
18713 2002-04-11 Ravi Pratap <ravi@ximian.com>
18715 * support.cs (InternalParameters.ParameterModifier): Do some null
18716 checking and return sane values.
18718 * class.cs (Method.Define): If we are a PInvoke method, ensure
18719 that we are static and extern. Report error # 601
18721 * ../errors/cs0601.cs : Add test case for the above error.
18723 2002-04-07 Ravi Pratap <ravi@ximian.com>
18725 * rootcontext.cs (attribute_types): We need to keep type of
18726 all attribute types separately and emit code for them first.
18728 (RegisterAttribute) : Implement.
18730 * class.cs (DefineType): Check if the current Type is a custom
18731 attribute type and register it accordingly.
18733 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18734 adding the first attribute twice and rename to
18736 (SetGlobalAttributes): this.
18738 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18741 * attribute.cs (ApplyAttributes): Take an additional argument telling us
18742 if we are processing global arguments. Hmm, I am unsure of this.
18744 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18746 * expression.cs: added static array of strings to avoid calling
18747 Enum.ToString () for Operator in Binary. Significant recover of
18750 2002-04-10 Miguel de Icaza <miguel@ximian.com>
18752 * class.cs (FindMembers): Allow the Builders of the various
18753 members to be null. If they are skip them. This only happens
18754 during the PInvoke declaration.
18756 2002-04-09 Miguel de Icaza <miguel@ximian.com>
18758 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18759 failure, so we do not keep going afterwards.
18761 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18762 wanted to pass `false' as the `is_delegate' argument. If this is
18763 the case, why not use delegate_type == null to mean `is_delegate =
18764 false' and anything else as is_delegate = true.
18766 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
18768 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18769 code for the section, not the beginning of the tests.
18771 2002-04-08 Miguel de Icaza <miguel@ximian.com>
18773 * cfold.cs: Handle operator + (Enum x, Underlying x)
18775 * expression.cs (Binary): same. Warn about errors where we have
18776 Enum/Enum in operator + as well.
18778 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
18781 - added support for switch(bool)
18782 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18783 - add TableSwitchEmit() to handle table-based switch statements
18785 2002-04-05 Ravi Pratap <ravi@ximian.com>
18787 * expression.cs (Invocation.OverloadResolve): Factor out code which
18788 does parameter compatibility checking with arguments so that we can
18789 re-use the code even from Delegate.VerifyApplicability
18791 (VerifyArgumentsCompat): Move above code here.
18793 * delegate.cs (VerifyApplicability): Get rid of duplicate code
18794 and instead make a call to the above method.
18796 2002-03-31 Ravi Pratap <ravi@ximian.com>
18798 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18799 We use it to keep track of classes which are attribute types.
18801 2002-04-02 Miguel de Icaza <miguel@ximian.com>
18803 * delegate.cs (Delegate.Define): Correctly define the types in the
18804 presence of fixed and array parameters.
18806 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18809 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18810 include NonPublic after the first iteration.
18812 * class.cs (Indexer.CheckBase): Only check if both parents are
18815 * cs-parser.jay (accessor_body): If empty, set to null.
18817 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18818 same code path here to resolve constants names that we did have in
18819 MemberAccess.DoResolve. There is too much code duplicated here.
18821 2002-04-01 Miguel de Icaza <miguel@ximian.com>
18823 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18825 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18828 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18829 tokens, numbers and strings.
18831 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18834 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18835 asyncronous parameters and the regular parameters.
18837 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18838 specify the target directory.
18840 * expression.cs: (This.DoResolve): Simplify
18841 (As.Emit): Optimize, do not generate IsInst if the expression is
18842 always of the given type.
18844 (Is.DoResolve): Bug fix, we were reporting both always/never for
18847 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18848 creating too many unnecessary arrays.
18850 2002-03-31 Miguel de Icaza <miguel@ximian.com>
18852 * class.cs (EmitFieldInitializer): Use Assign expression to assign
18853 fields instead of rolling our own initializer. Takes care of all
18854 implicit conversions, and drops unnecessary static checks/argument.
18856 2002-03-31 Dick Porter <dick@ximian.com>
18858 * driver.cs: use the GetDirectories() return values properly, and
18859 use "/" as path separator.
18861 2002-03-30 Miguel de Icaza <miguel@ximian.com>
18863 * expression.cs (Unary): Optimize - - expr into expr.
18864 (Binary): Optimize a + (-b) into a -b.
18866 * codegen.cs (CodeGen): Made all methods static.
18868 2002-03-29 Miguel de Icaza <miguel@ximian.com>
18872 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18873 TypeBuilder property.
18875 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18878 * tree.cs: Removed the various RecordXXXX, and replaced with a
18879 single RecordDecl. Removed all the accessor methods, and just
18880 left a single access point Type
18882 * enum.cs: Rename DefineEnum to DefineType.
18884 * decl.cs: New abstract method `DefineType' used to unify the
18885 Defines for Enumerations, Interfaces, TypeContainers and
18888 (FindType): Moved LookupInterfaceOrClass here. Moved the
18889 LookupBaseClasses method that used to live in class.cs and
18890 interface.cs here, and renamed to FindType.
18892 * delegate.cs: Implement DefineType. Take advantage of the
18893 refactored pattern for locating the parent builder without taking
18894 the parent_builder argument (which we know does not work if we are
18895 nested, and triggering a toplevel definition).
18897 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18899 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18900 accessibility of a member has changed during override and report
18903 * class.cs (Method.Define, Property.Define): Only complain on
18904 overrides if the method is private, any other accessibility is
18905 fine (and since we just checked the permission is the same, we are
18908 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18909 and elif are processed always. The other pre-processing
18910 directives are only processed if we are "taking" the path
18912 2002-03-29 Martin Baulig <martin@gnome.org>
18914 * class.cs (Method.Emit): Only emit symbolic debugging info if the
18915 current location is not Null.
18917 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18918 a separate method so we can profile it.
18920 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18921 `span.Seconds' are just seconds, but no minutes or hours.
18922 (MainDriver): Profile the CodeGen.SaveSymbols calls.
18924 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18926 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18927 Remove the gratuitous set of Final:
18929 // If an interface implementation, then we can set Final.
18930 if (((flags & MethodAttributes.Abstract) == 0) &&
18931 implementing.DeclaringType.IsInterface)
18932 flags |= MethodAttributes.Final;
18934 I do not know what I was smoking when I used that.
18937 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18938 step into fixing the name resolution issues for delegates and
18939 unifying the toplevel name resolution.
18941 2002-03-28 Martin Baulig <martin@gnome.org>
18943 * class.cs (Method.Emit): If we have a symbol writer, call its
18944 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18945 tell it about the current method.
18947 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18948 writer that we're going to emit the first byte of IL code for a new
18949 statement (a new source line).
18950 (EmitContext.EmitTopBlock): If we have a symbol writer, call
18951 EmitContext.Mark() before emitting any code.
18953 * location.cs (SymbolDocument): Return null when we're Null.
18955 * statement.cs (Statement): Moved the `Location loc' variable here.
18956 (Statement.EmitBoolExpression): If we have a symbol writer, call
18957 ec.Mark() before emitting any code to tell it that we're at the
18958 beginning of a new statement.
18959 (StatementExpression): Added `Location' argument to the constructor.
18960 (Block): Added public readonly variable `StartLocation' and public
18961 variable `EndLocation'. The latter is to be set using SetEndLocation().
18962 (Block): Added constructor which takes a start and end location.
18963 (Block.SetEndLocation): New method. This sets the end location.
18964 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18965 local variables we create.
18966 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18967 each statement and do also mark the begin and end of the block.
18969 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18970 tell it the current lexer.Location, use Location.Null for the end of the
18972 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18973 current block, set its end location using SetEndLocation().
18974 (statement_expression): StatementExpression constructor now takes the
18975 lexer.Location as additional argument.
18976 (for_statement, declare_local_variables): Likewise.
18977 (declare_local_variables): When creating a new implicit block, use the
18978 new Block constructor and pass it the lexer.Location.
18980 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18982 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18983 members also on the parent interfaces recursively.
18985 2002-03-27 Miguel de Icaza <miguel@ximian.com>
18987 * report.cs: Use new formats, since Gonzalo finished the missing
18990 * expression.cs (Binary.ResolveOperator): added missing operator|
18991 operator& and operator^ for bool/bool.
18993 * cs-parser.jay: CheckDef now takes a Location argument that is
18994 used to report errors more precisly (instead of reporting the end
18995 of a definition, we try to track something which is a lot closer
18996 to the source of the problem).
18998 * cs-tokenizer.cs: Track global token use, so we can properly flag
18999 the use of #define/#undef after the first token has been seen.
19001 Also, rename the reportXXXX to Error_DescriptiveName
19003 * decl.cs (DeclSpace.IsTopLevel): Move property here from
19004 TypeContainer, so that Enum and Interface can use this too.
19006 * class.cs (TypeContainer.LookupInterfaceOrClass,
19007 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19008 `builder' argument. Typically this was used to pass the parent
19009 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19012 The problem is that a nested class could trigger the definition of
19013 a toplevel class, and the builder would be obviously wrong in that
19016 So we drop this argument, and we compute dynamically the
19017 TypeBuilder/ModuleBuilder (the correct information was available
19018 to us anyways from DeclSpace.Parent)
19020 * interface.cs (Interface.DefineInterface): Drop builder
19021 parameter cleanup like class.cs
19023 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
19026 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19029 (Try.Emit): Propagate the returns value from the statement.
19031 (Return.Emit): Even if we are leavning
19033 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19035 * modifiers.cs: Fix the computation of MethodAttributes flags.
19037 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19039 * driver.cs: allow compilation of files that start with '/'.
19040 Add a default case when checking the argument of --target.
19042 2002-03-25 Miguel de Icaza <miguel@ximian.com>
19044 * interface.cs: Implement the same search algorithm for types in
19045 the interface code.
19047 * delegate.cs: Do not allow multiple definition.
19049 * Recovered ChangeLog that got accidentally amputated
19051 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19053 * rootcontext.cs: Load manually enum to allow core classes to
19054 contain enumerations.
19056 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19057 Update to new static methods in TypeManager.
19059 * typemanager.cs (GetMethod, GetConstructor): Use our
19060 implementation of FindMembers to find the members, since during
19061 corlib compilation, the types are TypeBuilders and GetMethod and
19062 GetConstructor do not work.
19064 Make all methods in TypeManager static.
19066 (InitCodeHelpers): Split the functionality from
19067 the InitCodeTypes function.
19069 * driver.cs: Call InitCodeHelpers after we have populated the
19072 * cs-parser.jay (delegate_declaration): we did not used to compute
19073 the delegate name correctly for void delegates.
19075 2002-03-24 Miguel de Icaza <miguel@ximian.com>
19077 * rootcontext.cs (RootContext): Init the interface_resolve_order
19078 and type_container_resolve_order always.
19080 (ResolveCore, BootstrapCorlib_ResolveClass,
19081 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19082 compiler when compiling with --nostdlib
19084 * class.cs (TypeContainer.DefineType): Check that our parent is
19085 not null. This test is most important when we are bootstraping
19088 * codegen.cs: Split out the symbol writing code.
19090 2002-03-25 Martin Baulig <martin@gnome.org>
19092 * driver.cs (-g): Made -g an alias for --debug.
19094 2002-03-24 Martin Baulig <martin@gnome.org>
19096 * codegen.cs (SymbolWriter): New public variable. Returns the
19097 current symbol writer.
19098 (CodeGen): Added `bool want_debugging_support' argument to the
19099 constructor. If true, tell the ModuleBuild that we want debugging
19100 support and ask it for the ISymbolWriter.
19101 (Save): If we have a symbol writer, call it's Close() method after
19102 saving the assembly.
19104 * driver.c (--debug): New command line argument to create a
19105 debugger information file.
19107 * location.cs (SymbolDocument): New public property. Returns an
19108 ISymbolDocumentWriter object for the current source file or null
19109 if we don't have a symbol writer.
19111 2002-03-21 Miguel de Icaza <miguel@ximian.com>
19113 * driver.cs (LoadAssembly): Correctly return when all the paths
19114 have been tried and not before.
19116 * statement.cs (Switch.Emit): return the actual coverage for this
19117 statement (returns/not-returns)
19119 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19120 switch of the statement if we are the last switch section. That
19121 kills two problems: try/catch problems (we used to emit an empty
19122 nop at the end) and switch statements where all branches would
19125 2002-03-19 Miguel de Icaza <miguel@ximian.com>
19127 * driver.cs: Add default assemblies (the equivalent to the
19128 Microsoft CSC.RSP file)
19130 * cs-tokenizer.cs: When updating `cols and setting it to zero,
19131 also update tokens_seen and set it to false.
19133 * driver.cs: Implement --recurse for Mike.
19135 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19136 correctly splitting out the paths.
19138 2002-03-18 Miguel de Icaza <miguel@ximian.com>
19140 * interface.cs (Interface.PopulateProperty): Instead of using
19141 `parent' as the declaration space for the set parameters, use
19144 * support.cs (InternalParameters): InternalParameters constructor
19145 takes a DeclSpace instead of a TypeContainer.
19147 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19148 types are being initialized, load the address of it before calling
19151 (New): Provide a mechanism to disable the generation of local
19152 value type temporaries when the caller will be providing us with
19153 an address to store it.
19155 (ArrayCreation.EmitDynamicInitializers): Use it.
19157 2002-03-17 Miguel de Icaza <miguel@ximian.com>
19159 * expression.cs (Invocation.EmitArguments): Only probe for array
19160 property if there is more than one argument. Sorry about that.
19162 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19163 empty param arrays.
19165 * class.cs (Method.LabelParameters): Fix incorrect code path that
19166 prevented the `ParamArrayAttribute' from being applied to the
19169 2002-03-16 Miguel de Icaza <miguel@ximian.com>
19171 * support.cs (ReflectionParameters): Correctly compute whether the
19172 last argument is a params array. Fixes the problem with
19175 * typemanager.cs: Make the assemblies array always be non-null
19176 (empty, but non-null)
19178 * tree.cs (RecordDecl): New function that abstracts the recording
19179 of names. This reports error 101, and provides a pointer to the
19180 previous declaration. Fixes a crash in the compiler.
19182 * cs-parser.jay (constructor_declaration): Update to new grammar,
19183 and provide a constructor_body that can be empty.
19185 2002-03-15 Miguel de Icaza <miguel@ximian.com>
19187 * driver.cs: Add support for --resources.
19189 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19190 Make all types for the various array helper methods be integer.
19192 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19193 CheckState to ConvCast.
19195 (ConvCast): Now it takes a `checked' state argument, to avoid
19196 depending on the emit context for the conversion, and just using
19197 the resolve time setting.
19199 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19200 instead of Invocation.EmitArguments. We do not emit the original
19201 arguments, instead we emit those which have been converted to
19202 unsigned int expressions.
19204 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19206 * codegen.cs: ditto.
19208 * expression.cs (LocalVariableReference): Drop the use of the
19209 Store function that depended on the variable index.
19211 * statement.cs (VariableInfo): Drop the `Idx' property from this
19212 class, as this is not taking into account the indexes for
19213 temporaries tat we generate during the execution, getting the
19216 * class.cs: First emit class initializers, then call the parent
19219 * expression.cs (Binary): Fix opcode emision.
19220 (UnaryMutator.EmitCode): Support checked code generation
19222 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19223 matches for events for both the Static and Instance scans,
19224 pointing to the same element. Fix that.
19226 2002-03-14 Miguel de Icaza <miguel@ximian.com>
19228 * rootcontext.cs (ResolveTree): Always set the
19229 interface_resolve_order, because nested interfaces will be calling
19232 * class.cs (GetInterfaceOrClass): Track the same resolution
19233 process used by TypeManager.LookupType. This fixes the nested
19234 type lookups in class declarations (separate path from
19237 (TypeContainer.DefineType): Also define nested interfaces.
19238 (TypeContainer.RegisterOrder): New public function used to
19239 register the order in which child interfaces need to be closed.
19241 Nested interfaces need to be closed after their parents have been
19244 * interface.cs (InterfaceAttr): Put all the logic for computing
19245 the interface attribute here.
19247 (DefineInterface): Register our interface order with the
19248 RootContext or with the TypeContainer depending on the case.
19250 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19252 * cs-parser.jay: rework foreach statement to work with the new
19253 changes to the policy on SimpleNames.
19255 * report.cs: support Stacktrace on warnings as well.
19257 * makefile: drop --unsafe and /unsafe from the compile.
19259 2002-03-13 Ravi Pratap <ravi@ximian.com>
19261 * ecore.cs (StandardConversionExists): Modify to take an Expression
19262 as the first parameter. Ensure we do null -> reference type conversion
19265 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19266 temporary Expression objects.
19268 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19270 * interface.cs: workaround bug in method overloading resolution
19271 (there is already a bugzilla bug for it).
19273 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19275 We could also solve this problem by having a separate path for
19276 performing type lookups, instead of DoResolve, we could have a
19277 ResolveType entry point, and only participating pieces of the
19278 production (simplename, deref, array) would implement this.
19280 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19281 signal SimpleName to only resolve type names and not attempt to
19282 resolve anything else.
19284 * expression.cs (Cast): Set the flag.
19286 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19288 * class.cs: Only report 108 if there is no `new' modifier.
19290 * cs-parser.jay: rework foreach statement to work with the new
19291 changes to the policy on SimpleNames.
19293 * report.cs: support Stacktrace on warnings as well.
19295 * makefile: drop --unsafe and /unsafe from the compile.
19297 2002-03-11 Miguel de Icaza <miguel@ximian.com>
19299 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19300 lookups here, instead of doing that at parse time. This means
19301 that our grammar will not introduce `LocalVariableReferences' as
19302 expressions at this point. That solves the problem of code like
19306 static void Main ()
19310 This is only half the fix. The full fix requires parameters to
19311 also be handled in this way.
19313 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19314 makes the use more obvious of the DeclSpace. The
19315 ec.TypeContainer.TypeBuilder is now only used to pull the
19316 TypeBuilder for it.
19318 My theory is that I can get rid of the TypeBuilder completely from
19319 the EmitContext, and have typecasts where it is used (from
19320 DeclSpace to where it matters).
19322 The only pending problem is that the code that implements Aliases
19323 is on TypeContainer, and probably should go in DeclSpace.
19325 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19326 lookups here, instead of doing that at parse time. This means
19327 that our grammar will not introduce `LocalVariableReferences' as
19328 expressions at this point. That solves the problem of code like
19332 static void Main ()
19336 This is only half the fix. The full fix requires parameters to
19337 also be handled in this way.
19339 * class.cs (Property.DefineMethod): When implementing an interface
19340 method, set newslot, when implementing an abstract method, do not
19341 set the flag (before we tried never setting it, or always setting
19342 it, which is the difference).
19343 (Indexer.DefineMethod): same.
19344 (Method.DefineMethod): same.
19346 * ecore.cs: Only set the status used flag if we get back a Field.
19348 * attribute.cs: Temporary hack, so Paolo can keep working.
19350 2002-03-08 Ravi Pratap <ravi@ximian.com>
19352 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19353 the unmanaged type in the case we have a MarshalAs attribute.
19355 (Resolve): Handle the case when we are parsing the special MarshalAs
19356 attribute [we need to store the unmanaged type to use later]
19358 * typemanager.cs (marshal_as_attr_type): Built in type for the
19359 MarshalAs Attribute.
19361 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
19362 on parameters and accordingly set the marshalling info.
19364 2002-03-09 Miguel de Icaza <miguel@ximian.com>
19366 * class.cs: Optimizing slightly by removing redundant code after
19367 we switched to the `NoTypes' return value.
19368 (Property.DefineMethod): use NoTypes here too.
19370 This fixes the bug I introduced in my last batch of changes.
19372 2002-03-05 Ravi Pratap <ravi@ximian.com>
19374 * tree.cs (RecordEnum): Add. We now keep track of enums too.
19376 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19377 Enums since those are types too.
19379 * cs-parser.jay (enum_declaration): Record enums as we parse them.
19381 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
19382 thanks to a call during the lookup process.
19384 2002-03-07 Miguel de Icaza <miguel@ximian.com>
19386 * statement.cs (Foreach): Lots of work to accomodate a particular
19387 kind of foreach statement that I had not kept in mind. It is
19388 possible to have foreachs on classes that provide a GetEnumerator
19389 method that return objects that implement the "pattern" for using
19390 a foreach, there is no need to support GetEnumerator
19393 This is needed to compile nant.
19395 * decl.cs: Only report 114 if the member is not `Finalize' and if
19396 the warning level is at least 2.
19398 * class.cs: Moved the compare function from Method to
19401 (MethodSignature.InheritableMemberSignatureCompare): Add new
19402 filter function that is used to extract inheritable methods from a
19405 (Method.Define): Use the new `inheritable_method_signature_filter'
19408 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19411 2002-03-06 Miguel de Icaza <miguel@ximian.com>
19413 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19415 * cs-parser.jay: Add opt_semicolon to the interface declaration.
19417 * expression.cs: Pass location information to
19418 ConvertImplicitStandard.
19420 * class.cs: Added debugging code to track return values from
19423 2002-03-05 Miguel de Icaza <miguel@ximian.com>
19425 * expression.cs (Is.DoResolve): If either side of the `is' is an
19426 interface, do not flag the warning.
19428 * ecore.cs (ImplicitReferenceConversion): We need a separate test
19431 * report.cs: Allow for --fatal to be used with --probe.
19433 * typemanager.cs (NoTypes): Move the definition for the empty Type
19436 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19438 (TypeContainer.DefineProxy): New function used to proxy to parent
19439 implementations when implementing interfaces.
19440 (TypeContainer.ParentImplements): used to lookup if our parent
19441 implements a public function that is required by an interface.
19442 (TypeContainer.VerifyPendingMethods): Hook this up.
19444 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19445 `modules' and `assemblies' arraylists into arrays. We only grow
19446 these are the very early start up of the program, so this improves
19447 the speedof LookupType (nicely measured).
19449 * expression.cs (MakeByteBlob): Replaced unsafe code with
19450 BitConverter, as suggested by Paolo.
19452 * cfold.cs (ConstantFold.Binary): Special case: perform constant
19453 folding of string concatenation, but if either side is a string,
19454 and the other is not, then return null, and let the runtime use
19455 the concatenation on the string plus the object (using
19456 `Object.ToString').
19458 2002-03-04 Miguel de Icaza <miguel@ximian.com>
19460 Constant Folding has been implemented now.
19462 * expression.cs (Unary.Reduce): Do not throw an exception, catch
19463 the error instead on types that are not supported in one's
19466 * constant.cs (Constant and all children): New set of functions to
19467 perform implict and explicit conversions.
19469 * ecore.cs (EnumConstant): Implement the new functions to perform
19470 conversion by proxying to the child expression.
19472 * codegen.cs: (ConstantCheckState): Constant evaluation has its
19473 own separate setting that can not be turned off from the command
19474 line using --unchecked or --checked and is only controlled using
19475 the checked/unchecked statements and expressions. This setting is
19476 used by the constant folder to flag errors.
19478 * expression.cs (CheckedExpr, UncheckedExpr): Set the
19479 ConstantCheckState as well.
19481 During Resolve, they also have to flag the state, because the
19482 constant folder runs completely in the Resolve phase.
19484 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19487 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19489 * cfold.cs: New file, this file contains the constant folder.
19491 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19492 argument to track whether we are using the resulting address to
19493 load or store a value and provide better error messages.
19495 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19496 new AddressOf arguments.
19498 * statement.cs (Foreach.EmitCollectionForeach): Update
19500 * expression.cs (Argument.Emit): Call AddressOf with proper
19501 arguments to track usage.
19503 (New.DoEmit): Call AddressOf with new arguments.
19505 (Unary.Emit): Adjust AddressOf call.
19507 2002-03-01 Ravi Pratap <ravi@ximian.com>
19509 * cs-parser.jay (member_access): Change the case for pre-defined types
19510 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
19513 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19516 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19517 essentially like methods and apply attributes like MethodImplOptions to them too.
19519 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19522 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19523 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19526 * Update code everywhere accordingly.
19528 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19530 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19532 2002-02-28 Ravi Pratap <ravi@ximian.com>
19534 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19535 try performing lookups against those instead of jumping straight into using
19536 the 'using' clauses.
19538 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19540 (LookupType): Perform lookups in implicit parents too.
19542 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19543 sequence as RootContext.LookupType.
19545 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
19546 the various cases of namespace lookups into this method.
19548 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19550 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19551 in positional arguments)
19553 * class.cs (Operator): Update the AllowedModifiers to contain
19556 * cs-parser.jay: Update operator declaration to allow for the
19557 operator body to be empty.
19559 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19562 2002-02-27 Miguel de Icaza <miguel@ximian.com>
19564 * class.cs (Method.Emit): Label parameters.
19566 * driver.cs: Return 1 or 0 as the program exit code.
19568 2002-02-26 Miguel de Icaza <miguel@ximian.com>
19570 * expression.cs: Special case the `null' object when trying to
19571 auto-compute the type, as anything can be explicitly converted to
19574 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19575 spotting this Paolo.
19577 (Expression.ImplicitNumericConversion): Perform comparissions of
19578 the type using the underlying type in the case of an enumeration
19579 rather than using the enumeration type for the compare.
19581 Cope with the underlying == type case, which is not possible to
19584 (Expression.ConvertNumericExplicit): Perform comparissions of
19585 the type using the underlying type in the case of an enumeration
19586 rather than using the enumeration type for the compare.
19588 * driver.cs: If the user does not supply an extension, assume .exe
19590 * cs-parser.jay (if_statement): Rewrote so that we can track the
19591 location for the if statement.
19593 * expression.cs (Binary.ConstantFold): Only concat strings when
19594 the operation is "+", not everything ;-)
19596 * statement.cs (Statement.EmitBoolExpression): Take a location
19598 (If, While, Do): Track location.
19600 * expression.cs (Binary.ResolveOperator): In the object + string
19601 case, I was missing a call to ConvertImplicit
19603 2002-02-25 Ravi Pratap <ravi@ximian.com>
19605 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19606 Location arguments. Ensure we use RootContext.LookupType to do our work
19607 and not try to do a direct Type.GetType and ModuleBuilder.GetType
19609 * interface.cs (PopulateMethod): Handle the type of the parameter being
19612 * expression.cs (Invocation.BetterFunction): Handle the case when we
19613 have a params method with no fixed arguments and a call is made with no
19616 2002-02-25 Miguel de Icaza <miguel@ximian.com>
19618 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19619 the verbatim-string-literal
19621 * support.cs (InternalParameters.ParameterModifier): handle null
19623 (InternalParameters.ParameterType): ditto.
19625 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19626 duplicating the name of the variable parameter.
19627 (GetParameterByName): Fix bug where we were not looking up array
19628 paramters if they were the only present (thanks Paolo!).
19629 (GetParameterInfo): We only have an empty set of types if both
19630 fixed and array are set to null.
19631 (GetParameterInfo-idx): Handle FixedParameter == null
19633 * cs-parser.jay: Handle the case where there is no catch
19634 statements (missing null test).
19636 2002-02-22 Miguel de Icaza <miguel@ximian.com>
19638 * driver.cs (MainDriver): Be conservative on our command line
19641 Catch DirectoryNotFoundException when calling GetFiles.
19643 (SplitPathAndPattern): Used to split the input specification into
19644 a path and a pattern that we can feed to Directory.GetFiles.
19646 2002-02-21 Miguel de Icaza <miguel@ximian.com>
19648 * statement.cs (Fixed): Implement the last case of the Fixed
19649 statement (string handling).
19651 * expression.cs (StringPtr): New class used to return a char * to
19652 a string; Used by the Fixed statement.
19654 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
19656 * expression.cs (Binary.ResolveOperator): Remove redundant
19657 MemberLookup pn parent type.
19658 Optimize union call, we do not need a union if the types are the same.
19659 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19662 Specialize the use of MemberLookup everywhere, instead of using
19663 the default settings.
19665 (StackAlloc): Implement stackalloc keyword.
19667 * cs-parser.jay: Add rule to parse stackalloc.
19669 * driver.cs: Handle /h, /help, /?
19671 * expression.cs (MakeByteBlob): Removed the hacks we had in place
19672 before we supported unsafe code.
19674 * makefile: add --unsafe to the self compilation of mcs.
19676 2002-02-20 Miguel de Icaza <miguel@ximian.com>
19678 * expression.cs (PointerArithmetic): New class that is used to
19679 perform pointer arithmetic.
19680 (Binary.Resolve): Handle pointer arithmetic
19681 Handle pointer comparission.
19682 (ArrayPtr): Utility expression class that is used to take the
19683 address of an array.
19685 (ElementAccess): Implement array access for pointers
19687 * statement.cs (Fixed): Implement fixed statement for arrays, we
19688 are missing one more case before we are done.
19690 * expression.cs (Indirection): Implement EmitAssign and set the
19691 ExprClass to Variable. This allows pointer dereferences to be
19692 treated as variables, and to have values assigned to them.
19694 * ecore.cs (Expression.StoreFromPtr): New utility function to
19695 store values dereferencing.
19697 2002-02-20 Ravi Pratap <ravi@ximian.com>
19699 * expression.cs (Binary.ResolveOperator): Ensure that we are
19700 not trying to operate on a void type - this fixes the reported
19703 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19704 the parent implementation is sealed.
19706 * ../errors/cs0239.cs : Add.
19708 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19710 * typemanager.cs (unverifiable_code_type): Corresponds to
19711 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19712 which have unsafe code in them.
19714 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
19717 2002-02-19 Miguel de Icaza <miguel@ximian.com>
19719 * cs-tokenizer.cs: Add support for @"litreal strings"
19721 Make tokenizer accept pre-processor directives
19722 on any column (remove the old C-like limitation).
19724 * rootcontext.cs (EmitCode): Emit any global attributes.
19725 (AddGlobalAttributes): Used to keep track of assembly attributes.
19727 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19729 * cs-parser.jay: Add support for global attributes.
19731 2002-02-17 Miguel de Icaza <miguel@ximian.com>
19733 * expression.cs (Indirection): New helper class. Unary will
19734 create Indirection classes to be able to implement the
19735 IMemoryLocation interface on it.
19737 2002-02-16 Miguel de Icaza <miguel@ximian.com>
19739 * cs-parser.jay (fixed_statement): reference the right statement.
19741 * statement.cs (Fixed.Emit): Finish implementing the fixed
19742 statement for the &x case.
19744 2002-02-14 Miguel de Icaza <miguel@ximian.com>
19746 * class.cs (Property.Define, Method.Define): Remove newslot when
19749 * modifiers.cs: My use of NewSlot when `Abstract' was set was
19750 wrong. NewSlot should only be used if the `new' keyword is present.
19752 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19753 locating our system dir. Sorry about this.
19755 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19757 * driver.cs (GetSystemDir): Compute correctly the location of our
19758 system assemblies. I was using the compiler directory instead of
19759 the library directory.
19761 2002-02-13 Ravi Pratap <ravi@ximian.com>
19763 * expression.cs (BetterFunction): Put back in what Miguel commented out
19764 since it is the correct fix. The problem is elsewhere ;-)
19766 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19767 parameters of the parms method are themselves compatible or not !
19769 (StandardConversionExists): Fix very dangerous bug where we were forgetting
19770 to check that a class implements an interface before saying that an implicit
19771 conversion was allowed. Use ImplementsInterface to do the checking.
19773 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19775 * class.cs (Method.Define): Track whether we are an explicit
19776 implementation or not. And only call DefineMethodOverride if we
19777 are an explicit implementation.
19779 (Property.DefineMethod): Ditto.
19781 2002-02-11 Ravi Pratap <ravi@ximian.com>
19783 * expression.cs (BetterFunction): Catch hideous bug which was
19784 preventing us from detecting ambiguous calls due to implicit casts i.e
19787 2002-01-29 Miguel de Icaza <miguel@ximian.com>
19789 * support.cs (Pair): Remove un-needed method. I figured why I was
19790 getting the error in cs-parser.jay, the variable in a foreach loop
19791 is readonly, and the compiler does not really treat this as a variable.
19793 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
19794 instead of EQUALS in grammar.
19796 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19798 * expression.cs (Unary.DoResolve): Check whether the argument is
19801 2002-01-28 Miguel de Icaza <miguel@ximian.com>
19803 * support.cs: Api for Pair to set a value. Despite the fact that
19804 the variables are public the MS C# compiler refuses to compile
19805 code that accesses the field if the variable is part of a foreach
19808 * statement.cs (Fixed): Begin implementation of the fixed
19811 (Block.AddVariable): Return the VariableInfo on success and null
19812 on failure instead of true/false.
19814 * cs-parser.jay (foreach): Catch errors on variables already
19815 defined (we were ignoring this value before) and properly unwind
19816 the block hierarchy
19818 (fixed_statement): grammar for the fixed statement.
19820 2002-01-25 Miguel de Icaza <miguel@ximian.com>
19822 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19823 pointer types to be incretemented.
19825 (SizeOf): Implement.
19827 * cs-parser.jay (pointer_member_access): Implement
19828 expr->IDENTIFIER production.
19830 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19831 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19834 (Unary): Implement indirection.
19836 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19837 use in non-unsafe context).
19839 (SimpleName.DoResolve): Check for pointers in field access on safe
19842 (Expression.LoadFromPtr): Factor the load-indirect code in this
19843 function. This was duplicated in UnboxCast and ParameterReference
19845 2002-01-24 Miguel de Icaza <miguel@ximian.com>
19847 * expression.cs (ComposedCast): report an error if a pointer cast
19848 is used in a safe region.
19850 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19851 pointer type casts in unsafe context.
19853 * codegen.cs (EmitContext): Set up IsUnsafe.
19855 * cs-parser.jay (non_expression_type): Add productions for pointer
19858 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19859 code. We should not use force into static mode if the method is
19860 not virtual. Fixes bug in MIS
19862 * statement.cs (Do.Emit, While.Emit, For.Emit,
19863 Statement.EmitBoolExpression): Add support to Do and While to
19864 propagate infinite loop as `I do return' semantics.
19866 Improve the For case to also test for boolean constants.
19868 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19869 to the list of attributes we can add.
19871 Remove `EmitContext' argument.
19873 * class.cs (Method.Define): Apply parameter attributes.
19874 (Constructor.Define): Apply parameter attributes.
19875 (MethodCore.LabelParameters): Move here the core of labeling
19878 * support.cs (ReflectionParameters.ParameterModifier,
19879 InternalParameters.ParameterModifier): Use IsByRef on the type and
19880 only return the OUT bit for these parameters instead of in/out/ref
19883 This is because I miss-understood things. The ParameterInfo.IsIn
19884 and IsOut represent whether the parameter has the [In] and [Out]
19887 2002-01-22 Miguel de Icaza <miguel@ximian.com>
19889 * ecore.cs (FieldExpr.Emit): Release temporaries.
19891 * assign.cs (LocalTemporary.Release): new function.
19893 * codegen.cs (EmitContext.GetTemporaryStorage,
19894 EmitContext.FreeTemporaryStorage): Rework the way we deal with
19895 temporary storage. Now we can "put back" localbuilders when we
19898 2002-01-21 Miguel de Icaza <miguel@ximian.com>
19900 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19901 need to make a copy of the variable to generate verifiable code.
19903 2002-01-19 Miguel de Icaza <miguel@ximian.com>
19905 * driver.cs: Compute dynamically the system directory.
19907 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19908 Slower, but more generally useful. Used by the abstract
19909 registering implementation.
19911 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19912 the rules for the special rule on Type/instances. First check if
19913 we have the same name, and if so, try that special static path
19914 rather than the instance path.
19916 2002-01-18 Miguel de Icaza <miguel@ximian.com>
19918 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19921 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19922 Enum, ValueType, Delegate or Array for non-corlib compiles.
19924 * cs-tokenizer.cs: Catch long identifiers (645)
19926 * typemanager.cs (IndexerPropetyName): Ravi never tested this
19929 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19930 fix, we were returning too early, so we were not registering
19931 pending methods from abstract classes.
19933 Do not register pending methods if the class is abstract.
19935 * expression.cs (Conditional.DoResolve): Report circular implicit
19936 conversions when we neecd to compute it for conditional
19939 (Is.DoResolve): If the expression is always of the provided type,
19940 flag warning 183. If the expression can not ever be of the
19941 provided type flag warning 184.
19943 * class.cs: Catch 169 as well.
19945 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19948 2002-01-18 Nick Drochak <ndrochak@gol.com>
19950 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
19952 2002-01-17 Miguel de Icaza <miguel@ximian.com>
19954 * interface.cs: (PopulateMethod): Check for pointers being defined
19955 only if the unsafe context is active.
19956 (PopulateProperty): ditto.
19957 (PopulateIndexer): ditto.
19959 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19960 specified. If pointers are present, make sure that they are
19961 present in an unsafe context.
19962 (Constructor, Constructor.Define): ditto.
19963 (Field, Field.Define): ditto.
19964 (Property, Property.Define): ditto.
19965 (Event, Event.Define): ditto.
19967 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19968 hashtable if there are classes or structs defined.
19970 * expression.cs (LocalVariableReference.DoResolve): Simplify this
19971 code, as the constant resolution moved.
19973 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19974 the metadata, so we can flag error 133.
19976 * decl.cs (MemberCore.UnsafeOK): New function to test that a
19977 pointer is being declared in an unsafe context.
19979 2002-01-16 Miguel de Icaza <miguel@ximian.com>
19981 * modifiers.cs (Modifiers.Check): Require a Location argument.
19982 Report error 227 for Unsafe use.
19984 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19986 * statement.cs (For.Emit): If the test is null, then report that
19987 we do `return', as we wont reach anything afterwards.
19989 (Switch.SwitchGoverningType): Track the expression that matched
19992 * driver.cs: Allow negative numbers as an error code to flag.
19994 * cs-parser.jay: Handle 1551.
19996 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19998 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20000 * cs-parser.jay: Report 1518 (type declaration can only contain
20001 class, struct, interface, enum or delegate)
20003 (switch_label): Report 1523 (keywords `case' or `default' must
20006 (opt_switch_sections): Report 1522 (empty switch)
20008 * driver.cs: Report 1515 (response file specified multiple times)
20009 Report 1516 (Source file specified multiple times).
20011 * expression.cs (Argument.Resolve): Signal 1510
20013 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20014 access not allowed in static code)
20016 2002-01-11 Ravi Pratap <ravi@ximian.com>
20018 * typemanager.cs (IsPointerType): Utility method which we are going
20021 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20022 the object type, so we take care of that.
20024 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20026 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20027 added to non-params parameters :-)
20029 * typemanager.cs (CSharpName): Include 'void' type too.
20031 (void_ptr_type): Include in the set of core types.
20033 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
20036 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
20039 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
20040 completely forgotten about it.
20042 2002-01-10 Ravi Pratap <ravi@ximian.com>
20044 * cs-parser.jay (pointer_type): Add. This begins our implementation
20045 of parsing rules for unsafe code.
20047 (unsafe_statement): Implement.
20049 (embedded_statement): Modify to include the above.
20051 * statement.cs (Unsafe): Implement new class for unsafe blocks.
20053 * codegen.cs (EmitContext.InUnsafe): Add. This determines
20054 if the current context is an unsafe one.
20056 * cs-parser.jay (local_variable_pointer_type): Since local variable types
20057 are handled differently, we need separate rules for them.
20059 (local_variable_declaration): Update to use local_variable_pointer_type
20060 to allow variable declarations of unmanaged pointer types.
20062 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20063 in unsafe contexts.
20065 * ../errors/cs0214.cs : Add.
20067 2002-01-16 Nick Drochak <ndrochak@gol.com>
20069 * makefile: remove 'response' file when cleaning.
20071 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20073 * cs-parser.jay: Report 1524.
20075 2002-01-14 Miguel de Icaza <miguel@ximian.com>
20077 * typemanager.cs (RegisterMethod): drop checking if we have
20078 registered this from here
20080 2002-01-12 Miguel de Icaza <miguel@ximian.com>
20082 * class.cs (Method.EmitDestructor): Implement calling our base
20085 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20086 value of InFinally.
20088 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20089 this routine and will wrap the call in a try/catch block. Deal
20092 2002-01-11 Miguel de Icaza <miguel@ximian.com>
20094 * ecore.cs (Expression.MemberLookup): instead of taking a
20095 parameter `same_type' that was used to tell whether we could
20096 access private members we compute our containing type from the
20099 (FieldExpr): Added partial support for volatile fields. This does
20100 not work for volatile fields exposed from assemblies, as I can not
20101 figure out how to extract the modreq from it.
20103 Updated all the source files to use this.
20105 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20106 because it is referenced by MemberLookup very often.
20108 2002-01-09 Ravi Pratap <ravi@ximian.com>
20110 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20111 TypeBuilder.GetCustomAttributes to retrieve what we need.
20113 Get rid of redundant default_member_attr_type as this is the same as
20114 default_member_type which already exists.
20116 * interface.cs, attribute.cs : Update accordingly.
20118 2002-01-08 Miguel de Icaza <miguel@ximian.com>
20120 * typemanager.cs: Enable IndexerPropertyName again. It does not
20121 work for TYpeBuilders though. Ravi, can you please fix this?
20123 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20125 * expression.cs (Argument.Emit): Handle the case of ref objects
20126 being passed to ref functions;
20128 (ParameterReference.EmitLoad): Loads the content of the pointer
20129 without dereferencing.
20131 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20133 * cs-tokenizer.cs: Implemented the pre-processing expressions.
20135 2002-01-08 Ravi Pratap <ravi@ximian.com>
20137 * class.cs (Indexer.DefineMethod): Incorporate the interface
20138 type in the name of the method if we are doing explicit interface
20141 * expression.cs (ConversionExists): Remove as it is completely obsolete.
20143 (BetterConversion): Fix extremely trivial bug where we were referring to
20144 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20147 * ../errors/bug16.cs : Add although we have fixed it.
20149 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20151 * expression.cs (BaseIndexer): Begin implementation.
20153 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20155 * cs-parser.jay (indexer_declarator): Use qualified_identifier
20156 production directly to remove a shift/reduce, and implement
20157 explicit interface implementation.
20159 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20160 after a floating point suffix.
20162 * expression.cs (DoNumericPromotions): Improved the conversion for
20163 uint/uint. If we have a constant, we avoid doing a typecast to a
20166 * class.cs (Indexer): Implement explicit interface implementation
20169 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20171 * class.cs: make the default instance constructor public and hidebysig.
20173 2001-01-03 Ravi Pratap <ravi@ximian.com>
20175 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20176 so we can call it from elsewhere.
20178 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20179 we emit it internally if the class has a defined indexer; otherwise the user
20180 emits it by decorating the class definition with the DefaultMemberAttribute.
20182 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20183 attribute is not used on a type which defines an indexer.
20185 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20186 character when we skip whitespace.
20188 * ../errors/cs0646.cs : Add.
20190 2002-01-03 Miguel de Icaza <miguel@ximian.com>
20192 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20195 * makefile: Add practical target `mcs3.exe' which builds the third
20196 generation compiler.
20198 * expression.cs (New): Fix structures constructor calling.
20200 * class.cs (Property, Method, Indexer): Emit Final flag on the
20201 method if we are an interface implementation and we are not
20204 * ecore.cs (PropertyExpr): New public field `IsBase', tells
20205 whether this property is referencing a `base' method.
20207 * expression.cs (Invocation.EmitCall): take an extra argument:
20208 is_base, this is used to determine whether the `call' or
20209 `callvirt' opcode should be used.
20212 * delegate.cs: update EmitCall.
20214 * class.cs (Method.Define): Set NewSlot for the cases where we are
20215 not implementing an interface method.
20217 (Property.Define): ditto.
20219 2002-01-02 Miguel de Icaza <miguel@ximian.com>
20221 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20222 'r'. Allows mcs to parse itself fully.
20224 2002-01-02 Ravi Pratap <ravi@ximian.com>
20226 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20227 of the number of initializers that require the InitializeArray method.
20229 (CheckIndices): Store the Expression in all cases - not the plain value. Also
20230 update the above field where necessary.
20232 (MakeByteBlob): Update accordingly.
20234 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
20237 (EmitDynamicInitializers): Update in accordance with the new optimization.
20239 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20240 same OpCode applies.
20242 * cs-parser.jay : Fix some glaring errors I introduced.
20244 2002-01-01 Ravi Pratap <ravi@ximian.com>
20246 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20247 so that we can check for name clashes there too.
20249 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20250 for interface indexers.
20252 * interfaces.cs (Define): Emit the default member attribute.
20254 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20255 variable was being referred to while setting the value ;-)
20257 2002-01-01 Miguel de Icaza <miguel@ximian.com>
20259 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20260 byte-by-byte information when we know the data is zero.
20262 Make the block always a multiple of 4, because
20263 DefineInitializedData has a bug.
20265 * assign.cs: Fix, we should assign from the temporary, not from
20268 * expression.cs (MakeByteBlob): Fix my incorrect code.
20270 2001-12-31 Miguel de Icaza <miguel@ximian.com>
20272 * typemanager.cs (EnumToUnderlying): This function is used to get
20273 the underlying type from an enumeration, because it does not
20276 * constant.cs: Use the I4_S form for values between -128 and 127.
20278 * statement.cs (Block.LookupLabel): Looks up a label.
20279 (Block): Drop support for labeled blocks.
20281 (LabeledStatement): New kind of statement that represents a label
20284 (Goto): Finally implement this bad boy.
20286 * cs-parser.jay: Update to reflect new mechanism to implement
20289 2001-12-30 Miguel de Icaza <miguel@ximian.com>
20291 * codegen.cs (EmitContext.This): a codegen property that keeps the
20292 a single instance of this instead of creating many different this
20295 * delegate.cs (Delegate.DoResolve): Update to use the property;
20297 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20299 * expression.cs (BaseAccess.DoResolve): Ditto.
20301 2001-12-29 Ravi Pratap <ravi@ximian.com>
20303 * typemanager.cs (methodimpl_attr_type): Add to hold the type
20304 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20306 (InitCoreTypes): Update accordingly.
20308 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20309 so we can quickly store the state.
20311 (ApplyAttributes): Set the correct implementation flags
20312 for InternalCall methods.
20314 2001-12-29 Miguel de Icaza <miguel@ximian.com>
20316 * expression.cs (EmitCall): if a method is not virtual, then do
20317 not use callvirt on it.
20319 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20320 user defined stuff) requires the use of stobj, which takes an
20321 address on the stack instead of an array and an index. So emit
20322 the Ldelema operation for it.
20324 (EmitStoreOpcode): Use stobj for valuetypes.
20326 (UnaryMutator.EmitCode): Use the right 1 value depending on
20327 whether we are dealing with int64/uint64, float or doubles.
20329 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20330 constructors that I implemented last night.
20332 (Constructor.IsDefault): Fix to work properly for static
20335 * cs-parser.jay (CheckDef): report method signature errors.
20336 Update error number 103 to be 132.
20338 * decl.cs: New AdditionResult enumeration value: MethodExists.
20339 Although we do this check for methods later on in the semantic
20340 analysis, catching repeated default constructors is so easy that
20341 we catch these here.
20343 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20346 (ParameterReference.EmitAssign, Emit): handle
20349 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20350 (ArrayAccess.EmitStoreOpcode): ditto.
20352 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20354 * expression.cs (MakeByteBlob): Complete all the missing types
20355 (uint, short, ushort, byte, sbyte)
20357 * class.cs: Only init instance field initializers on instance
20360 Rename `constructors' to instance_constructors.
20362 (TypeContainer.AddConstructor): Only add constructors to the list
20363 if it is not static.
20365 Make sure that we handle default_static_constructor independently
20366 everywhere where we handle instance_constructors
20368 2001-12-28 Miguel de Icaza <miguel@ximian.com>
20370 * class.cs: Do not lookup or create a base initializer for a
20371 static constructor.
20373 (ConstructorInitializer.Resolve): use the proper type to lookup
20376 * cs-parser.jay: Report error 1585 (modifiers between type and name).
20378 * enum.cs, interface.cs: Remove CloseType, this is taken care by
20381 * decl.cs: CloseType is now an virtual method, the default
20382 implementation just closes this type.
20384 2001-12-28 Ravi Pratap <ravi@ximian.com>
20386 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20387 to PreserveSig by default. Also emit HideBySig on such methods.
20389 Basically, set the defaults to standard values.
20391 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20392 argument, if candidate is better, it can't be worse than the best !
20394 (Invocation): Re-write bits to differentiate between methods being
20395 applicable in their expanded form and their normal form - for params
20398 Get rid of use_standard everywhere as only standard conversions are allowed
20399 in overload resolution.
20401 More spec conformance.
20403 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20405 * driver.cs: Add --timestamp, to see where the compiler spends
20408 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20409 `this' in static code.
20411 (SimpleName.DoResolve): Implement in terms of a helper function
20412 that allows static-references to be passed upstream to
20415 (Expression.ResolveWithSimpleName): Resolve specially simple
20416 names when called by MemberAccess to implement the special
20419 (Expression.ImplicitReferenceConversion): Handle conversions from
20420 Null to reference types before others, as Null's type is
20423 * expression.cs (Invocation.EmitCall): Handle the special case of
20424 calling methods declared on a reference type from a ValueType
20425 (Base classes System.Object and System.Enum)
20427 (MemberAccess.Resolve): Only perform lookups on Enumerations if
20428 the left hand side is a TypeExpr, not on every enumeration.
20430 (Binary.Resolve): If types are reference types, then do a cast to
20431 object on operators != and == of both arguments.
20433 * typemanager.cs (FindMembers): Extract instance and static
20434 members if requested.
20436 * interface.cs (PopulateProperty): Use void_type instead of null
20437 as the return type for the setter method.
20439 (PopulateIndexer): ditto.
20441 2001-12-27 Ravi Pratap <ravi@ximian.com>
20443 * support.cs (ReflectionParameters): Fix minor bug where we
20444 were examining the wrong parameter for the ParamArray attribute.
20446 Cope with requests for the type of the parameter at position
20447 greater than the params parameter's. We now return the element
20448 type of the params array as that makes more sense.
20450 * expression.cs (Invocation.IsParamsMethodApplicable): Update
20451 accordingly as we no longer have to extract the element type
20454 (Invocation.OverloadResolve): Update.
20456 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20458 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20459 against IEnumerator, test whether the return value is a descendant
20460 of the IEnumerator interface.
20462 * class.cs (Indexer.Define): Use an auxiliary method to implement
20463 the other bits of the method definition. Begin support for
20464 explicit interface implementation.
20466 (Property.DefineMethod): Use TypeManager.void_type instead of null
20467 for an empty return value.
20469 2001-12-26 Miguel de Icaza <miguel@ximian.com>
20471 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20472 dealing with a FieldExpr which is composed of a FieldBuilder, in
20473 the code path we did extract the constant, but we should have
20474 obtained the underlying value to be able to cast it (otherwise we
20475 end up in an infinite loop, this is what Ravi was running into).
20477 (ArrayCreation.UpdateIndices): Arrays might be empty.
20479 (MemberAccess.ResolveMemberAccess): Add support for section
20480 14.5.4.1 that deals with the special case of E.I when E is a type
20481 and something else, that I can be a reference to a static member.
20483 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20484 handle a particular array type to create byte blobs, it is just
20485 something we dont generate byteblobs for.
20487 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20490 * location.cs (Push): remove the key from the hashtable that we
20491 are about to add. This happens for empty files.
20493 * driver.cs: Dispose files after we have parsed them.
20495 (tokenize): new function that only runs the tokenizer on its
20496 input, for speed testing.
20498 2001-12-26 Ravi Pratap <ravi@ximian.com>
20500 * class.cs (Event.Define): Define the private field only if there
20501 are no accessors defined.
20503 * expression.cs (ResolveMemberAccess): If there is no associated
20504 field with the event, that means we have an event defined with its
20505 own accessors and we should flag error cs0070 since transforming
20506 ourselves into a field is not valid in that case.
20508 * ecore.cs (SimpleName.DoResolve): Same as above.
20510 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20511 and charset to sane values.
20513 2001-12-25 Ravi Pratap <ravi@ximian.com>
20515 * assign.cs (DoResolve): Perform check on events only if they
20516 are being accessed outside the declaring type.
20518 * cs-parser.jay (event_declarations): Update rules to correctly
20519 set the type of the implicit parameter etc.
20521 (add_accessor, remove_accessor): Set current local parameters.
20523 * expression.cs (Binary): For delegate addition and subtraction,
20524 cast the return value from the method into the appropriate delegate
20527 2001-12-24 Ravi Pratap <ravi@ximian.com>
20529 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20530 of these as the workaround is unnecessary.
20532 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20533 delegate data - none of that is needed at all.
20535 Re-write bits to extract the instance expression and the delegate method
20538 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
20541 * attribute.cs (ApplyAttributes): New method to take care of common tasks
20542 of attaching attributes instead of duplicating code everywhere.
20544 * everywhere : Update code to do attribute emission using the above method.
20546 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20548 * expression.cs (IsParamsMethodApplicable): if there are not
20549 parameters, return immediately.
20551 * ecore.cs: The 0 literal can be implicity converted to an enum
20554 (SimpleName.DoResolve): First lookup the type, then lookup the
20557 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20558 want to get its address. If the InstanceExpression is not
20559 addressable, store the result in a temporary variable, then get
20562 * codegen.cs: Only display 219 errors on warning level or above.
20564 * expression.cs (ArrayAccess): Make it implement the
20565 IMemoryLocation interface.
20567 (Binary.DoResolve): handle the operator == (object a, object b)
20568 and operator != (object a, object b) without incurring into a
20569 BoxedCast (because 5 != o should never be performed).
20571 Handle binary enumerator operators.
20573 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20574 value type, otherwise use Ldelem_ref.
20576 Use precomputed names;
20578 (AddressOf): Implement address of
20580 * cs-parser.jay (labeled_statement): Fix recursive block
20581 addition by reworking the production.
20583 * expression.cs (New.DoEmit): New has a special case:
20585 If we are dealing with a ValueType, we have a few
20586 situations to deal with:
20588 * The target of New is a ValueType variable, that is
20589 easy, we just pass this as the variable reference
20591 * The target of New is being passed as an argument,
20592 to a boxing operation or a function that takes a
20595 In this case, we need to create a temporary variable
20596 that is the argument of New.
20599 2001-12-23 Ravi Pratap <ravi@ximian.com>
20601 * rootcontext.cs (LookupType): Check that current_type is not null before
20602 going about looking at nested types.
20604 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20605 not implement the IAssignMethod interface any more.
20607 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20608 where we tranform them into FieldExprs if they are being resolved from within
20609 the declaring type.
20611 * ecore.cs (SimpleName.DoResolve): Do the same here.
20613 * assign.cs (DoResolve, Emit): Clean up code considerably.
20615 * ../errors/bug10.cs : Add.
20617 * ../errors/cs0070.cs : Add.
20619 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20621 * assign.cs : Get rid of EventIsLocal everywhere.
20623 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20625 * ecore.cs (ConvertIntLiteral): finished the implementation.
20627 * statement.cs (SwitchLabel): Convert the value we are using as a
20628 key before looking up the table.
20630 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20632 * codegen.cs (EmitTopBlock): Require a Location argument now.
20634 * cs-parser.jay (constructor_declarator): We need to setup
20635 current_local_parameters before we parse the
20636 opt_constructor_initializer, to allow the variables to be bound
20637 to the constructor arguments.
20639 * rootcontext.cs (LookupType): First lookup nested classes in our
20640 class and our parents before we go looking outside our class.
20642 * expression.cs (ConstantFold): Extract/debox the values at the
20645 * rootcontext.cs (EmitCode): Resolve the constants first before we
20646 resolve the types. This is not really needed, but it helps debugging.
20648 * statement.cs: report location.
20650 * cs-parser.jay: pass location to throw statement.
20652 * driver.cs: Small bug fix.
20654 * report.cs: Updated format to be 4-zero filled digits.
20656 2001-12-22 Ravi Pratap <ravi@ximian.com>
20658 * expression.cs (CheckIndices): Fix minor bug where the wrong
20659 variable was being referred to ;-)
20661 (DoEmit): Do not call EmitStaticInitializers when the
20662 underlying type is System.Object.
20664 2001-12-21 Ravi Pratap <ravi@ximian.com>
20666 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20667 and do the usual workaround for SRE.
20669 * class.cs (MyEventBuilder.EventType): New member to get at the type
20670 of the event, quickly.
20672 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20674 * assign.cs (Assign.DoResolve): Handle the case when the target
20675 is an EventExpr and perform the necessary checks.
20677 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20680 (SimpleName.MemberStaticCheck): Include check for EventExpr.
20682 (EventExpr): Set the type in the constructor itself since we
20683 are meant to be born fully resolved.
20685 (EventExpr.Define): Revert code I wrote earlier.
20687 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20688 instance expression is null. The instance expression is a This in that case
20689 or a null, depending on whether it is a static method or not.
20691 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20692 refers to more than one method.
20694 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20695 and accordingly flag errors.
20697 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20699 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20701 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20703 * location.cs (ToString): Provide useful rutine.
20705 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20707 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20708 objects, return the actual integral boxed.
20710 * statement.cs (SwitchLabel): define an ILLabel for each
20713 (Switch.CheckSwitch): If the value is a Literal, extract
20714 the underlying literal.
20716 Also in the unused hashtable we had, add the SwitchLabel so we can
20717 quickly look this value up.
20719 * constant.cs: Implement a bunch of new constants. Rewrite
20720 Literal based on this. Made changes everywhere to adapt to this.
20722 * expression.cs (Expression.MakeByteBlob): Optimize routine by
20723 dereferencing array only once, and also copes with enumrations.
20725 bytes are two bytes wide, not one.
20727 (Cast): Perform constant conversions.
20729 * ecore.cs (TryImplicitIntConversion): Return literals instead of
20730 wrappers to the literals here.
20732 * expression.cs (DoNumericPromotions): long literals can converted
20733 to ulong implicity (this is taken care of elsewhere, but I was
20734 missing this spot).
20736 * ecore.cs (Expression.Literalize): Make the return type Literal,
20737 to improve type checking.
20739 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20741 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20743 * literal.cs: Revert code from ravi that checked the bounds. The
20744 bounds are sane by the definition of the type itself.
20746 * typemanager.cs: Fix implementation of ImplementsInterface. We
20747 need to actually look up in our parent hierarchy for interfaces
20750 * const.cs: Use the underlying type for enumerations
20752 * delegate.cs: Compute the basename for the delegate creation,
20753 that should fix the delegate test case, and restore the correct
20754 Type Lookup semantics in rootcontext
20756 * rootcontext.cs: Revert Ravi's last patch. The correct way of
20757 referencing a nested type with the Reflection API is using the "+"
20760 * cs-parser.jay: Do not require EOF token at the end.
20762 2001-12-20 Ravi Pratap <ravi@ximian.com>
20764 * rootcontext.cs (LookupType): Concatenate type names with
20765 a '.' instead of a '+' The test suite passes again.
20767 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20768 field of the enumeration.
20770 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20771 the case when the member is an EventExpr.
20773 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20774 static has an associated instance expression.
20776 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20778 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20780 * class.cs (Event.Define): Register event and perform appropriate checks
20783 We define the Add and Remove methods even if the use provides none because
20784 in that case, we provide default implementations ourselves.
20786 Define a private field of the type of the event. This is done by the CSC compiler
20787 and we should be doing it too ;-)
20789 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20790 More methods we use in code we generate.
20792 (multicast_delegate_type, delegate_type): Two separate types since the distinction
20795 (InitCoreTypes): Update accordingly for the above.
20797 * class.cs (Event.Emit): Generate code for default accessors that we provide
20799 (EmitDefaultMethod): Do the job in the above.
20801 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
20804 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20806 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20807 builders even if we were missing one.
20809 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20810 pass the Basename as our class name instead of the Name. The
20811 basename will be correctly composed for us.
20813 * parameter.cs (Paramters): Now takes a Location argument.
20815 * decl.cs (DeclSpace.LookupType): Removed convenience function and
20816 make all the code call directly LookupType in RootContext and take
20817 this chance to pass the Location information everywhere.
20819 * Everywhere: pass Location information.
20821 2001-12-19 Miguel de Icaza <miguel@ximian.com>
20823 * class.cs (Constructor.Define): Updated way of detecting the
20824 length of the parameters.
20826 (TypeContainer.DefineType): Use basename as the type name for
20829 (TypeContainer.Define): Do not recursively define types here, as
20830 definition is taken care in order by the RootContext.
20832 * tree.cs: Keep track of namespaces in a per-file basis.
20834 * parameter.cs (Parameter.ComputeSignature): Update to use
20837 (Parameters.GetSignature): ditto.
20839 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20840 instead of a TypeContainer.
20842 (Interface.SemanticAnalysis): Use `this' instead of our parent to
20843 resolve names. Because we need to be resolve in our context, not
20846 * driver.cs: Implement response files.
20848 * class.cs (TypeContainer.DefineType): If we are defined, do not
20849 redefine ourselves.
20851 (Event.Emit): Emit the code for add/remove handlers.
20852 (Event.Define): Save the MethodBuilders for add/remove.
20854 * typemanager.cs: Use pair here too.
20856 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20857 DictionaryEntry requires the first argument to be non-null.
20859 (enum_declaration): Compute full name for registering the
20862 (delegate_declaration): Instead of using
20863 formal_parameter_list, use opt_formal_parameter_list as the list
20866 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20867 (EventParsing): New property that controls whether `add' and
20868 `remove' are returned as tokens or identifiers (for events);
20870 2001-12-19 Ravi Pratap <ravi@ximian.com>
20872 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20873 use MyEventBuilder only and let it wrap the real builder for us.
20875 (MyEventBuilder): Revamp constructor etc.
20877 Implement all operations that we perform on EventBuilder in precisely the same
20880 (FindMembers): Update to use the EventBuilder member.
20882 (Event.Emit): Update accordingly.
20884 2001-12-18 Ravi Pratap <ravi@ximian.com>
20886 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20887 by calling the appropriate methods.
20889 (GetCustomAttributes): Make stubs as they cannot possibly do anything
20892 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20894 2001-12-17 Ravi Pratap <ravi@ximian.com>
20896 * delegate.cs (Delegate.Populate): Check that the return type
20897 and various parameters types are indeed accessible.
20899 * class.cs (Constructor.Define): Same here.
20901 (Field.Define): Ditto.
20903 (Event.Define): Ditto.
20905 (Operator.Define): Check that the underlying Method defined itself
20906 correctly - so it's MethodBuilder should not be null.
20908 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20909 expression happens to be null.
20911 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20912 members but as of now we don't seem to be able to do anything really useful with it.
20914 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20915 not the EventBuilder.
20917 2001-12-18 Miguel de Icaza <miguel@ximian.com>
20919 * cs-tokenizer.cs: Add support for defines.
20920 Add support for #if, #elif, #else, #endif
20922 (eval_var): evaluates a variable.
20923 (eval): stubbed for evaluating functions.
20925 * cs-parser.jay: Pass the defines information
20927 * driver.cs: Add --define command line option.
20929 * decl.cs: Move MemberCore here.
20931 Make it the base class for DeclSpace. This allows us to catch and
20932 report 108 and 109 for everything now.
20934 * class.cs (TypeContainer.Define): Extract all the members
20935 before populating and emit the warning 108 (new keyword required
20936 to override) instead of having each member implement this.
20938 (MemberCore.Define): New abstract method, we will be using this in
20939 the warning reporting engine in Populate.
20941 (Operator.Define): Adjust to new MemberCore protocol.
20943 * const.cs (Const): This does not derive from Expression, it is a
20944 temporary object we use to create fields, it is a MemberCore.
20946 * class.cs (Method.Define): Allow the entry point to be in a
20949 * driver.cs: Rewrite the argument handler to clean it up a bit.
20951 * rootcontext.cs: Made it just an auxiliary namespace feature by
20952 making everything static.
20954 * driver.cs: Adapt code to use RootContext type name instead of
20957 * delegate.cs: Remove RootContext argument.
20959 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20962 * class.cs (Event.Define): The lookup can fail.
20964 * cs-tokenizer.cs: Begin implementation of pre-procesor.
20966 * expression.cs: Resolve the this instance before invoking the code.
20968 2001-12-17 Miguel de Icaza <miguel@ximian.com>
20970 * cs-parser.jay: Add a production in element_access that allows
20971 the thing to become a "type" reference. This way we can parse
20972 things like "(string [])" as a type.
20974 Note that this still does not handle the more complex rules of
20978 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
20980 * ecore.cs: (CopyNewMethods): new utility function used to
20981 assemble the list of methods from running FindMembers.
20983 (MemberLookup): Rework FindMembers so that
20985 2001-12-16 Miguel de Icaza <miguel@ximian.com>
20987 * class.cs (TypeContainer): Remove Delegates who fail to be
20990 * delegate.cs (Populate): Verify that we dont get null return
20991 values. TODO: Check for AsAccessible.
20993 * cs-parser.jay: Use basename to emit error 574 (destructor should
20994 have the same name as container class), not the full name.
20996 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20997 possible representation.
20999 Also implements integer type suffixes U and L.
21001 2001-12-15 Miguel de Icaza <miguel@ximian.com>
21003 * expression.cs (ArrayCreation.DoResolve): We need to do the
21004 argument resolution *always*.
21006 * decl.cs: Make this hold the namespace. Hold the root context as
21008 (LookupType): Move here.
21010 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21012 * location.cs (Row, Name): Fixed the code, it was always returning
21013 references to the first file.
21015 * interface.cs: Register properties defined through interfaces.
21017 * driver.cs: Add support for globbing on the command line
21019 * class.cs (Field): Make it derive from MemberCore as well.
21022 2001-12-15 Ravi Pratap <ravi@ximian.com>
21024 * class.cs (Event::Define): Check that the type of the event is a delegate
21025 type else flag error #66.
21027 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21030 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21031 values of EntryPoint, CharSet etc etc.
21033 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21035 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21036 be null and we should ignore this. I am not sure if this is really clean. Apparently,
21037 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21038 which needs this to do its work.
21040 * ../errors/cs0066.cs : Add.
21042 2001-12-14 Miguel de Icaza <miguel@ximian.com>
21044 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21047 * class.cs: (MethodSignature.MethodSignature): Removed hack that
21048 clears out the parameters field.
21049 (MemberSignatureCompare): Cleanup
21051 (MemberCore): New base class used to share code between MethodCore
21054 (RegisterRequiredImplementations) BindingFlags.Public requires
21055 either BindingFlags.Instace or Static. Use instance here.
21057 (Property): Refactored code to cope better with the full spec.
21059 * parameter.cs (GetParameterInfo): Return an empty array instead
21062 * class.cs (Property): Abstract or extern properties have no bodies.
21064 * parameter.cs (GetParameterInfo): return a zero-sized array.
21066 * class.cs (TypeContainer.MethodModifiersValid): Move all the
21067 method modifier validation to the typecontainer so we can reuse
21068 this on properties.
21070 (MethodCore.ParameterTypes): return an empty sized array of types.
21072 (Property.Define): Test property modifier validity.
21074 Add tests for sealed/override too.
21076 (Method.Emit): abstract or extern methods have no bodies.
21078 2001-12-14 Ravi Pratap <ravi@ximian.com>
21080 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21083 (Method::Define, ::Emit): Modify accordingly.
21085 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21087 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21089 * makefile: Pass in /unsafe.
21091 2001-12-13 Miguel de Icaza <miguel@ximian.com>
21093 * class.cs (MakeKey): Kill routine.
21095 * class.cs (TypeContainer.Define): Correctly define explicit
21096 method implementations (they require the full interface name plus
21099 * typemanager.cs: Deply the PtrHashtable here and stop using the
21100 lame keys. Things work so much better.
21102 This of course broke everyone who depended on `RegisterMethod' to
21103 do the `test for existance' test. This has to be done elsewhere.
21105 * support.cs (PtrHashtable): A hashtable that avoid comparing with
21106 the object stupid Equals method (because, that like fails all over
21107 the place). We still do not use it.
21109 * class.cs (TypeContainer.SetRequiredInterface,
21110 TypeContainer.RequireMethods): Killed these two routines and moved
21111 all the functionality to RegisterRequiredImplementations.
21113 (TypeContainer.RegisterRequiredImplementations): This routine now
21114 registers all the implementations required in an array for the
21115 interfaces and abstract methods. We use an array of structures
21116 which can be computed ahead of time to reduce memory usage and we
21117 also assume that lookups are cheap as most classes will not
21118 implement too many interfaces.
21120 We also avoid creating too many MethodSignatures.
21122 (TypeContainer.IsInterfaceMethod): Update and optionally does not
21123 clear the "pending" bit if we find that there are problems with
21126 (TypeContainer.VerifyPendingMethods): Update to report errors of
21127 methods that look like implementations but are not.
21129 (TypeContainer.Define): Add support for explicit interface method
21132 2001-12-12 Miguel de Icaza <miguel@ximian.com>
21134 * typemanager.cs: Keep track of the parameters here instead of
21135 being a feature of the TypeContainer.
21137 * class.cs: Drop the registration of parameters here, as
21138 InterfaceMethods are also interface declarations.
21140 * delegate.cs: Register methods with the TypeManager not only with
21141 the TypeContainer. This code was buggy.
21143 * interface.cs: Full registation here.
21145 2001-12-11 Miguel de Icaza <miguel@ximian.com>
21147 * expression.cs: Remove reducer for binary expressions, it can not
21150 * const.cs: Put here the code that used to go into constant.cs
21152 * constant.cs: Put here the code for constants, this is a new base
21153 class for Literals.
21155 * literal.cs: Make Literal derive from Constant.
21157 2001-12-09 Miguel de Icaza <miguel@ximian.com>
21159 * statement.cs (Return.Emit): Report error 157 if the user
21160 attempts to return from a finally block.
21162 (Return.Emit): Instead of emitting a return, jump to the end of
21165 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21166 LocalBuilder to store the result of the function. ReturnLabel is
21167 the target where we jump.
21170 2001-12-09 Radek Doulik <rodo@ximian.com>
21172 * cs-parser.jay: remember alias in current namespace
21174 * ecore.cs (SimpleName::DoResolve): use aliases for types or
21177 * class.cs (LookupAlias): lookup alias in my_namespace
21179 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21181 (LookupAlias): lookup alias in this and if needed in parent
21184 2001-12-08 Miguel de Icaza <miguel@ximian.com>
21188 * rootcontext.cs: (ModuleBuilder) Made static, first step into
21189 making things static. I need this to avoid passing the
21190 TypeContainer when calling ParameterType.
21192 * support.cs (InternalParameters.ParameterType): Remove ugly hack
21193 that did string manipulation to compute the type and then call
21194 GetType. Use Parameter.ParameterType instead.
21196 * cs-tokenizer.cs: Consume the suffix for floating values.
21198 * expression.cs (ParameterReference): figure out whether this is a
21199 reference parameter or not. Kill an extra variable by computing
21200 the arg_idx during emission.
21202 * parameter.cs (Parameters.GetParameterInfo): New overloaded
21203 function that returns whether a parameter is an out/ref value or not.
21205 (Parameter.ParameterType): The type of the parameter (base,
21206 without ref/out applied).
21208 (Parameter.Resolve): Perform resolution here.
21209 (Parameter.ExternalType): The full type (with ref/out applied).
21211 * statement.cs (Using.Emit, Using.EmitExpression): Implement
21212 support for expressions on the using statement.
21214 2001-12-07 Miguel de Icaza <miguel@ximian.com>
21216 * statement.cs (Using.EmitLocalVariableDecls): Split the
21217 localvariable handling of the using statement.
21219 (Block.EmitMeta): Keep track of variable count across blocks. We
21220 were reusing slots on separate branches of blocks.
21222 (Try.Emit): Emit the general code block, we were not emitting it.
21224 Check the type of the declaration to be an IDisposable or
21225 something that can be implicity converted to it.
21227 Emit conversions if required.
21229 * ecore.cs (EmptyExpression): New utility class.
21230 (Expression.ImplicitConversionExists): New utility function.
21232 2001-12-06 Miguel de Icaza <miguel@ximian.com>
21234 * statement.cs (Using): Implement.
21236 * expression.cs (LocalVariableReference): Support read only variables.
21238 * statement.cs: Remove the explicit emit for the Leave opcode.
21239 (VariableInfo): Add a readonly field.
21241 2001-12-05 Miguel de Icaza <miguel@ximian.com>
21243 * ecore.cs (ConvCast): new class used to encapsulate the various
21244 explicit integer conversions that works in both checked and
21245 unchecked contexts.
21247 (Expression.ConvertNumericExplicit): Use new ConvCast class to
21248 properly generate the overflow opcodes.
21250 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21252 * statement.cs: The correct type for the EmptyExpression is the
21253 element_type, not the variable type. Ravi pointed this out.
21255 2001-12-04 Ravi Pratap <ravi@ximian.com>
21257 * class.cs (Method::Define): Handle PInvoke methods specially
21258 by using DefinePInvokeMethod instead of the usual one.
21260 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21261 above to do the task of extracting information and defining the method.
21263 2001-12-04 Ravi Pratap <ravi@ximian.com>
21265 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21266 of the condition for string type.
21268 (Emit): Move that here.
21270 (ArrayCreation::CheckIndices): Keep string literals in their expression
21273 (EmitDynamicInitializers): Handle strings appropriately.
21275 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21277 * codegen.cs (EmitContext): Replace multiple variables with a
21278 single pointer to the current Switch statement.
21280 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21283 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21287 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21290 (Foreach.Emit): Foreach on arrays was not setting
21291 up the loop variables (for break/continue).
21293 (GotoCase): Semi-implented.
21295 2001-12-03 Ravi Pratap <ravi@ximian.com>
21297 * attribute.cs (CheckAttribute): Handle system attributes by using
21298 Attribute.GetAttributes to examine information we need.
21300 (GetValidPlaces): Same here.
21302 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21304 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21306 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21308 (Method::Define): Set appropriate flags if we have a DllImport attribute.
21310 (Method::Emit): Handle the case when we are a PInvoke method.
21312 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21314 * expression.cs: Use ResolveWithSimpleName on compound names.
21316 2001-12-02 Ravi Pratap <ravi@ximian.com>
21318 * constant.cs (EmitConstant): Make sure we resolve the associated expression
21319 before trying to reduce it.
21321 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21323 * constant.cs (LookupConstantValue): Implement.
21325 (EmitConstant): Use the above in emitting the constant.
21327 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21328 that are user-defined by doing a LookupConstantValue on them.
21330 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21333 2001-11-29 Miguel de Icaza <miguel@ximian.com>
21335 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21337 (BaseAccess.DoResolve): Implement.
21339 (MemberAccess.DoResolve): Split this routine into a
21340 ResolveMemberAccess routine that can be used independently
21342 2001-11-28 Miguel de Icaza <miguel@ximian.com>
21344 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21345 As that share bits of the implementation. Is returns a boolean,
21346 while As returns the Type that is being probed.
21348 2001-12-01 Ravi Pratap <ravi@ximian.com>
21350 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21351 instead of a Literal - much easier.
21353 (EnumInTransit): Remove - utterly useless :-)
21355 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21357 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21359 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21360 chain when we have no associated expression.
21362 2001-11-30 Ravi Pratap <ravi@ximian.com>
21364 * constant.cs (Define): Use Location while reporting the errror.
21366 Also emit a warning when 'new' is used and there is no inherited
21369 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
21372 (LookupEnumValue): Implement to lookup an enum member's value and define it
21375 (Populate): Re-write accordingly to use the above routine.
21377 2001-11-27 Miguel de Icaza <miguel@ximian.com>
21379 * expression.cs (This): Fix prototype for DoResolveLValue to
21380 override the base class DoResolveLValue.
21382 * cs-parser.cs: Report errors cs574 and cs575 (destructor
21385 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21386 (we need to load the address of the field here). This fixes
21389 (FieldExpr.DoResolveLValue): Call the DoResolve
21390 function to initialize the Instance expression.
21392 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21393 correctly the GetEnumerator operation on a value type.
21395 * cs-parser.jay: Add more simple parsing error catches.
21397 * statement.cs (Switch): Add support for string switches.
21398 Handle null specially.
21400 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
21402 2001-11-28 Ravi Pratap <ravi@ximian.com>
21404 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21406 (declare_local_constant): New helper function.
21408 * statement.cs (AddConstant): Keep a separate record of constants
21410 (IsConstant): Implement to determine if a variable is a constant.
21412 (GetConstantExpression): Implement.
21414 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21416 * statement.cs (IsVariableDefined): Re-write.
21418 2001-11-27 Ravi Pratap <ravi@ximian.com>
21420 * class.cs (TypeContainer::FindMembers): Look for constants
21421 in the case when we are looking for MemberTypes.Field
21423 * expression.cs (MemberAccess::DoResolve): Check that in the
21424 case we are a FieldExpr and a Literal, we are not being accessed
21425 by an instance reference.
21427 * cs-parser.jay (local_constant_declaration): Implement.
21429 (declaration_statement): Implement for constant declarations.
21431 2001-11-26 Miguel de Icaza <miguel@ximian.com>
21433 * statement.cs (Switch): Catch double defaults.
21435 (Switch): More work on the switch() statement
21436 implementation. It works for integral values now, need to finish
21440 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21442 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21443 integer literals into other integer literals. To be used by
21446 2001-11-24 Ravi Pratap <ravi@ximian.com>
21448 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21451 (EmitDynamicInitializers): Cope with the above since we extract data
21452 directly from ArrayData now.
21454 (ExpectInitializers): Keep track of whether initializers are mandatory
21457 (Bounds): Make it a hashtable to prevent the same dimension being
21458 recorded for every element in that dimension.
21460 (EmitDynamicInitializers): Fix bug which prevented the Set array method
21463 Also fix bug which was causing the indices to be emitted in the reverse
21466 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21468 * expression.cs (ArrayCreation): Implement the bits that Ravi left
21469 unfinished. They do not work, because the underlying code is
21472 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21474 * cs-parser.jay: Remove bogus fixme.
21476 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21477 on Switch statement.
21479 2001-11-23 Ravi Pratap <ravi@ximian.com>
21481 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21484 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21485 parameter. Apparently, any expression is allowed.
21487 (ValidateInitializers): Update accordingly.
21489 (CheckIndices): Fix some tricky bugs thanks to recursion.
21491 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
21492 I was being completely brain-dead.
21494 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21495 and re-write acordingly.
21497 (DelegateInvocation): Re-write accordingly.
21499 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21501 (MakeByteBlob): Handle types more correctly.
21503 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21504 initialization from expressions but it is incomplete because I am a complete
21507 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21509 * statement.cs (If.Emit): Fix a bug that generated incorrect code
21510 on If. Basically, we have to return `true' (ie, we do return to
21511 our caller) only if both branches of the if return.
21513 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21514 short-circuit operators, handle them as short circuit operators.
21516 (Cast.DoResolve): Resolve type.
21517 (Cast.Cast): Take an expression as the target type.
21519 * cs-parser.jay (cast_expression): Remove old hack that only
21520 allowed a limited set of types to be handled. Now we take a
21521 unary_expression and we resolve to a type during semantic
21524 Use the grammar productions from Rhys to handle casts (this is
21525 not complete like Rhys syntax yet, we fail to handle that corner
21526 case that C# has regarding (-x), but we will get there.
21528 2001-11-22 Ravi Pratap <ravi@ximian.com>
21530 * class.cs (EmitFieldInitializer): Take care of the case when we have a
21531 field which is an array type.
21533 * cs-parser.jay (declare_local_variables): Support array initialization too.
21535 * typemanager.cs (MakeKey): Implement.
21537 (everywhere): Use the above appropriately.
21539 * cs-parser.jay (for_statement): Update for array initialization while
21540 declaring variables.
21542 * ecore.cs : The error message was correct, it's the variable's names that
21543 were misleading ;-) Make the code more readable.
21545 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21546 the correct type etc.
21548 (ConvertExplicit): Handle Enum types by examining the underlying type.
21550 2001-11-21 Ravi Pratap <ravi@ximian.com>
21552 * parameter.cs (GetCallingConvention): Always return
21553 CallingConventions.Standard for now.
21555 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21557 * expression.cs (Binary.ResolveOperator): Update the values of `l'
21558 and `r' after calling DoNumericPromotions.
21560 * ecore.cs: Fix error message (the types were in the wrong order).
21562 * statement.cs (Foreach.ProbeCollectionType): Need to pass
21563 BindingFlags.Instance as well
21565 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21566 implicit int literal conversion in an empty cast so that we
21567 propagate the right type upstream.
21569 (UnboxCast): new class used to unbox value types.
21570 (Expression.ConvertExplicit): Add explicit type conversions done
21573 (Expression.ImplicitNumericConversion): Oops, forgot to test for
21574 the target type before applying the implicit LongLiterals to ULong
21577 2001-11-21 Miguel de Icaza <miguel@ximian.com>
21579 * cs-parser.jay (for_statement): Reworked the way For works: now
21580 we declare manually any variables that are introduced in
21581 for_initializer to solve the problem of having out-of-band code
21582 emition (that is what got for broken).
21584 (declaration_statement): Perform the actual variable declaration
21585 that used to be done in local_variable_declaration here.
21587 (local_variable_declaration): Do not declare anything, just pass
21588 the information on a DictionaryEntry
21590 2001-11-20 Ravi Pratap <ravi@ximian.com>
21592 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21593 re-write of the logic to now make it recursive.
21595 (UpdateIndices): Re-write accordingly.
21597 Store element data in a separate ArrayData list in the above methods.
21599 (MakeByteBlob): Implement to dump the array data into a byte array.
21601 2001-11-19 Ravi Pratap <ravi@ximian.com>
21603 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21606 * constant.cs (Define): Implement.
21608 (EmitConstant): Re-write fully.
21610 Pass in location info.
21612 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21615 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21616 DictionaryEntry since we need location info too.
21618 (constant_declaration): Update accordingly.
21620 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21621 code into another method : UpdateIndices.
21623 2001-11-18 Ravi Pratap <ravi@ximian.com>
21625 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21626 some type checking etc.
21628 2001-11-17 Ravi Pratap <ravi@ximian.com>
21630 * expression.cs (ArrayCreation::ValidateInitializers): Implement
21631 bits to provide dimension info if the user skips doing that.
21633 Update second constructor to store the rank correctly.
21635 2001-11-16 Ravi Pratap <ravi@ximian.com>
21637 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21638 and try to implement.
21640 * ../errors/cs0150.cs : Add.
21642 * ../errors/cs0178.cs : Add.
21644 2001-11-16 Miguel de Icaza <miguel@ximian.com>
21646 * statement.cs: Implement foreach on multi-dimensional arrays.
21648 * parameter.cs (Parameters.GetParameterByName): Also lookup the
21649 name of the params argument.
21651 * expression.cs: Use EmitStoreOpcode to get the right opcode while
21652 initializing the array.
21654 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21655 we can use this elsewhere.
21657 * statement.cs: Finish implementation of foreach for single
21660 * cs-parser.jay: Use an out-of-band stack to pass information
21661 around, I wonder why I need this.
21663 foreach_block: Make the new foreach_block the current_block.
21665 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21666 function used to return a static Parameters structure. Used for
21667 empty parameters, as those are created very frequently.
21669 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21671 2001-11-15 Ravi Pratap <ravi@ximian.com>
21673 * interface.cs : Default modifier is private, not public. The
21674 make verify test passes again.
21676 2001-11-15 Ravi Pratap <ravi@ximian.com>
21678 * support.cs (ReflectionParameters): Fix logic to determine
21679 whether the last parameter is a params one. Test 9 passes again.
21681 * delegate.cs (Populate): Register the builders we define with
21682 RegisterParameterForBuilder. Test 19 passes again.
21684 * cs-parser.jay (property_declaration): Reference $6 instead
21685 of $$ to get at the location.
21687 (indexer_declaration): Similar stuff.
21689 (attribute): Ditto.
21691 * class.cs (Property): Register parameters for the Get and Set methods
21692 if they exist. Test 23 passes again.
21694 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21695 call to EmitArguments as we are sure there aren't any params arguments.
21696 Test 32 passes again.
21698 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21699 IndexOutOfRangeException.
21701 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21702 Test 33 now passes again.
21704 2001-11-15 Miguel de Icaza <miguel@ximian.com>
21706 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21707 broke a bunch of things. Will have to come up with a better way
21708 of tracking locations.
21710 * statement.cs: Implemented foreach for single dimension arrays.
21712 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21714 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21715 an error. This removes the lookup from the critical path.
21717 * cs-parser.jay: Removed use of temporary_loc, which is completely
21720 2001-11-14 Miguel de Icaza <miguel@ximian.com>
21722 * support.cs (ReflectionParameters.ParameterModifier): Report
21723 whether the argument is a PARAMS argument or not.
21725 * class.cs: Set the attribute `ParamArrayAttribute' on the
21726 parameter argument.
21728 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21729 and cons_param_array_attribute (ConstructorInfo for
21730 ParamArrayAttribute).,
21732 * codegen.cs: Emit the return using the `Return' statement, that
21733 way we can report the error correctly for missing return values.
21735 * class.cs (Method.Emit): Clean up.
21737 * expression.cs (Argument.Resolve): Take another argument: the
21738 location where this argument is used. Notice that this is not
21739 part of the "Argument" class as to reduce the size of the
21740 structure (we know the approximate location anyways).
21742 Test if the argument is a variable-reference, if not, then
21743 complain with a 206.
21745 (Argument.Emit): Emit addresses of variables.
21747 (Argument.FullDesc): Simplify.
21749 (Invocation.DoResolve): Update for Argument.Resolve.
21751 (ElementAccess.DoResolve): ditto.
21753 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21754 method should be virtual, as this method is always virtual.
21756 (NewDelegate.DoResolve): Update for Argument.Resolve.
21758 * class.cs (ConstructorInitializer.DoResolve): ditto.
21760 * attribute.cs (Attribute.Resolve): ditto.
21762 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21764 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21766 * expression.cs (ParameterReference): Drop IStackStorage and implement
21767 IAssignMethod instead.
21769 (LocalVariableReference): ditto.
21771 * ecore.cs (FieldExpr): Drop IStackStorage and implement
21772 IAssignMethod instead.
21774 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21776 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21777 enumerations that are used in heavily used structures derive from
21778 byte in a laughable and pathetic attempt to reduce memory usage.
21779 This is the kind of pre-optimzations that you should not do at
21780 home without adult supervision.
21782 * expression.cs (UnaryMutator): New class, used to handle ++ and
21783 -- separatedly from the other unary operators. Cleans up the
21784 code, and kills the ExpressionStatement dependency in Unary.
21786 (Unary): Removed `method' and `Arguments' from this class, making
21787 it smaller, and moving it all to SimpleCall, so I can reuse this
21788 code in other locations and avoid creating a lot of transient data
21789 strucutres when not required.
21791 * cs-parser.jay: Adjust for new changes.
21793 2001-11-11 Miguel de Icaza <miguel@ximian.com>
21795 * enum.cs (Enum.Populate): If there is a failure during
21798 * cs-parser.jay (opt_enum_base): we used to catch type errors
21799 here, but this is really incorrect. The type error should be
21800 catched during semantic analysis.
21802 2001-12-11 Ravi Pratap <ravi@ximian.com>
21804 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21805 current_local_parameters as expected since I, in my stupidity, had forgotten
21808 * attribute.cs (GetValidPlaces): Fix stupid bug.
21810 * class.cs (Method::Emit): Perform check on applicability of attributes.
21812 (Constructor::Emit): Ditto.
21814 (Field::Emit): Ditto.
21816 (Field.Location): Store location information.
21818 (Property, Event, Indexer, Operator): Ditto.
21820 * cs-parser.jay (field_declaration): Pass in location for each field.
21822 * ../errors/cs0592.cs : Add.
21824 2001-11-12 Ravi Pratap <ravi@ximian.com>
21826 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21828 (InitCoreTypes): Update accordingly.
21830 (RegisterAttrType, LookupAttr): Implement.
21832 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21833 info about the same.
21835 (Resolve): Update to populate the above as necessary.
21837 (Error592): Helper.
21839 (GetValidPlaces): Helper to the above.
21841 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21843 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21845 2001-11-12 Ravi Pratap <ravi@ximian.com>
21847 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21849 * ../errors/cs0617.cs : Add.
21851 2001-11-11 Ravi Pratap <ravi@ximian.com>
21853 * enum.cs (Emit): Rename to Populate to be more consistent with what
21854 we expect it to do and when exactly it is called.
21856 * class.cs, rootcontext.cs : Update accordingly.
21858 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21859 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21861 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21863 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21864 of a fieldinfo using the above, when dealing with a FieldBuilder.
21866 2001-11-10 Ravi Pratap <ravi@ximian.com>
21868 * ../errors/cs0031.cs : Add.
21870 * ../errors/cs1008.cs : Add.
21872 * ../errrors/cs0543.cs : Add.
21874 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21877 (FindMembers): Implement.
21879 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21880 enums and delegates too.
21882 (enum_types): Rename to builder_to_enum.
21884 (delegate_types): Rename to builder_to_delegate.
21886 * delegate.cs (FindMembers): Implement.
21888 2001-11-09 Ravi Pratap <ravi@ximian.com>
21890 * typemanager.cs (IsEnumType): Implement.
21892 * enum.cs (Emit): Re-write parts to account for the underlying type
21893 better and perform checking etc.
21895 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21896 of the underlying type.
21898 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21901 * enum.cs (error31): Helper to report error #31.
21903 * cs-parser.jay (enum_declaration): Store location of each member too.
21905 * enum.cs (member_to_location): New hashtable.
21907 (AddEnumMember): Update location hashtable.
21909 (Emit): Use the location of each member while reporting errors.
21911 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21913 * cs-parser.jay: A for_initializer if is a
21914 local_variable_declaration really ammount to have an implicit
21915 block with the variable declaration and no initializer for for.
21917 * statement.cs (For.Emit): Cope with null initializers.
21919 This fixes the infinite loop on for initializers.
21921 2001-11-08 Miguel de Icaza <miguel@ximian.com>
21923 * enum.cs: More cleanup.
21925 * ecore.cs: Remove dead code.
21927 * class.cs (Property.Emit): More simplification.
21928 (Event.Emit): ditto.
21930 Reworked to have less levels of indentation.
21932 2001-11-08 Ravi Pratap <ravi@ximian.com>
21934 * class.cs (Property): Emit attributes.
21944 * enum.cs (Emit): Ditto.
21946 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21949 * class.cs (Field, Event, etc.): Move attribute generation into the
21950 Emit method everywhere.
21952 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21953 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21954 as we had no way of defining nested enums !
21956 * rootcontext.cs : Adjust code accordingly.
21958 * typemanager.cs (AddEnumType): To keep track of enum types separately.
21960 2001-11-07 Ravi Pratap <ravi@ximian.com>
21962 * expression.cs (EvalConstantExpression): Move into ecore.cs
21964 * enum.cs (Enum): Rename some members and make them public and readonly
21965 according to our convention.
21967 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21970 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21972 (Enum::Emit): Write a simple version for now which doesn't try to compute
21973 expressions. I shall modify this to be more robust in just a while.
21975 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21977 (TypeContainer::CloseType): Create the Enum types too.
21979 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21981 * expression.cs (EvalConstantExpression): Get rid of completely.
21983 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21984 user-defined values and other cases.
21986 (IsValidEnumLiteral): Helper function.
21988 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
21989 out there in the case we had a literal FieldExpr.
21991 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21993 (Literalize): Revamp a bit to take two arguments.
21995 (EnumLiteral): New class which derives from Literal to wrap enum literals.
21997 2001-11-06 Ravi Pratap <ravi@ximian.com>
21999 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22001 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22003 (Resolve): Use the above to ensure we have proper initializers.
22005 2001-11-05 Ravi Pratap <ravi@ximian.com>
22007 * expression.cs (Expression::EvalConstantExpression): New method to
22008 evaluate constant expressions.
22010 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22012 2001-11-07 Miguel de Icaza <miguel@ximian.com>
22014 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22017 (Binary.ResolveOperator): Handle operator != (object a, object b)
22018 and operator == (object a, object b);
22020 (Binary.DoNumericPromotions): Indicate whether the numeric
22021 promotion was possible.
22023 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22026 Made the ArrayAccess implement interface IAssignMethod instead of
22027 IStackStore as the order in which arguments are passed reflects
22030 * assign.cs: Instead of using expr.ExprClass to select the way of
22031 assinging, probe for the IStackStore/IAssignMethod interfaces.
22033 * typemanager.cs: Load InitializeArray definition.
22035 * rootcontext.cs (RootContext.MakeStaticData): Used to define
22036 static data that can be used to initialize arrays.
22038 2001-11-05 Miguel de Icaza <miguel@ximian.com>
22040 * expression.cs: Handle operator== and operator!= for booleans.
22042 (Conditioal.Reduce): Implement reducer for the ?: operator.
22044 (Conditional.Resolve): Implement dead code elimination.
22046 (Binary.Resolve): Catch string literals and return a new
22047 concatenated string.
22049 (Unary.Reduce): Implement reduction of unary expressions.
22051 * ecore.cs: Split out the expression core handling here.
22053 (Expression.Reduce): New method used to perform constant folding
22054 and CSE. This is needed to support constant-expressions.
22056 * statement.cs (Statement.EmitBoolExpression): Pass true and false
22057 targets, and optimize for !x.
22059 2001-11-04 Ravi Pratap <ravi@ximian.com>
22061 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22062 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22063 set custom atttributes.
22065 * literal.cs (Literal::GetValue): New abstract method to return the actual
22066 value of the literal, cast as an object.
22068 (*Literal): Implement GetValue method.
22070 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22071 expressions to the arraylist but objects of type Argument.
22073 * class.cs (TypeContainer::Emit): Emit our attributes too.
22075 (Method::Emit, Constructor::Emit): Ditto.
22077 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22078 to be ignoring earlier.
22080 2001-11-03 Ravi Pratap <ravi@ximian.com>
22082 * attribute.cs (AttributeSection::Define): Implement to do the business
22083 of constructing a CustomAttributeBuilder.
22085 (Attribute): New trivial class. Increases readability of code.
22087 * cs-parser.jay : Update accordingly.
22089 (positional_argument_list, named_argument_list, named_argument): New rules
22091 (attribute_arguments): Use the above so that we are more correct.
22093 2001-11-02 Ravi Pratap <ravi@ximian.com>
22095 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22096 to perform all checks for a method with a params parameter.
22098 (Invocation::OverloadResolve): Update to use the above method and therefore
22099 cope correctly with params method invocations.
22101 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
22104 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22105 constructors in our parent too because we can't afford to miss out on
22108 * attribute.cs (AttributeSection): New name for the class Attribute
22110 Other trivial changes to improve readability.
22112 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22113 use the new class names.
22115 2001-11-01 Ravi Pratap <ravi@ximian.com>
22117 * class.cs (Method::Define): Complete definition for params types too
22119 (Indexer::Define): Ditto.
22121 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22122 Cope everywhere with a request for info about the array parameter.
22124 2001-11-01 Ravi Pratap <ravi@ximian.com>
22126 * tree.cs (RecordNamespace): Fix up to check for the correct key.
22128 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
22129 local_variable_type to extract the string corresponding to the type.
22131 (local_variable_type): Fixup the action to use the new helper method.
22133 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
22136 * expression.cs : Clean out code which uses the above.
22138 2001-10-31 Ravi Pratap <ravi@ximian.com>
22140 * typemanager.cs (RegisterMethod): Check if we already have an existing key
22141 and bale out if necessary by returning a false.
22143 (RegisterProperty): Ditto.
22145 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22146 and print out appropriate error messages.
22148 * interface.cs (everywhere): Ditto.
22150 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22151 location to constructor.
22153 * class.cs (Property, Event, Indexer): Update accordingly.
22155 * ../errors/cs111.cs : Added.
22157 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22158 of a method, as laid down by the spec.
22160 (Invocation::OverloadResolve): Use the above method.
22162 2001-10-31 Ravi Pratap <ravi@ximian.com>
22164 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22165 now take a TypeContainer and a Parameters object.
22167 (ParameterData): Modify return type of ParameterModifier method to be
22168 Parameter.Modifier and not a string.
22170 (ReflectionParameters, InternalParameters): Update accordingly.
22172 * expression.cs (Argument::GetParameterModifier): Same here.
22174 * support.cs (InternalParameters::ParameterType): Find a better way of determining
22175 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22176 symbol in it at all so maybe this is only for now.
22178 2001-10-30 Ravi Pratap <ravi@ximian.com>
22180 * support.cs (InternalParameters): Constructor now takes an extra argument
22181 which is the actual Parameters class.
22183 (ParameterDesc): Update to provide info on ref/out modifiers.
22185 * class.cs (everywhere): Update call to InternalParameters to pass in
22186 the second argument too.
22188 * support.cs (ParameterData): Add ParameterModifier, which is a method
22189 to return the modifier info [ref/out etc]
22191 (InternalParameters, ReflectionParameters): Implement the above.
22193 * expression.cs (Argument::ParameterModifier): Similar function to return
22194 info about the argument's modifiers.
22196 (Invocation::OverloadResolve): Update to take into account matching modifiers
22199 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22200 a new SetFormalParameters object which we pass to InternalParameters.
22202 2001-10-30 Ravi Pratap <ravi@ximian.com>
22204 * expression.cs (NewArray): Merge into the ArrayCreation class.
22206 2001-10-29 Ravi Pratap <ravi@ximian.com>
22208 * expression.cs (NewArray): Merge classes NewBuiltinArray and
22209 NewUserdefinedArray into one as there wasn't much of a use in having
22212 * expression.cs (Argument): Change field's name to ArgType from Type.
22214 (Type): New readonly property which returns the proper type, taking into
22215 account ref/out modifiers.
22217 (everywhere): Adjust code accordingly for the above.
22219 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22220 whether we are emitting for a ref or out parameter.
22222 * expression.cs (Argument::Emit): Use the above field to set the state.
22224 (LocalVariableReference::Emit): Update to honour the flag and emit the
22227 * parameter.cs (Attributes): Set the correct flags for ref parameters.
22229 * expression.cs (Argument::FullDesc): New function to provide a full desc.
22231 * support.cs (ParameterData): Add method ParameterDesc to the interface.
22233 (ReflectionParameters, InternalParameters): Implement the above method.
22235 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22238 (Invocation::FullMethodDesc): Ditto.
22240 2001-10-29 Miguel de Icaza <miguel@ximian.com>
22242 * cs-parser.jay: Add extra production for the second form of array
22245 * expression.cs (ArrayCreation): Update to reflect the above
22248 * Small changes to prepare for Array initialization.
22250 2001-10-28 Miguel de Icaza <miguel@ximian.com>
22252 * typemanager.cs (ImplementsInterface): interface might be null;
22253 Deal with this problem;
22255 Also, we do store negative hits on the cache (null values), so use
22256 this instead of calling t.GetInterfaces on the type everytime.
22258 2001-10-28 Ravi Pratap <ravi@ximian.com>
22260 * typemanager.cs (IsBuiltinType): New method to help determine the same.
22262 * expression.cs (New::DoResolve): Get rid of array creation code and instead
22263 split functionality out into different classes.
22265 (New::FormArrayType): Move into NewBuiltinArray.
22267 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22270 (NewBuiltinArray): New class to handle creation of built-in arrays.
22272 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22273 account creation of one-dimensional arrays.
22275 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22277 (NewUserdefinedArray::DoResolve): Implement.
22279 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22281 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22282 we maintain inside the TypeManager. This is necessary to perform lookups on the
22285 (LookupType): Update to perform GetType on the module builders too.
22287 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22289 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22291 2001-10-23 Ravi Pratap <ravi@ximian.com>
22293 * expression.cs (New::DoResolve): Implement guts of array creation.
22295 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22297 2001-10-27 Miguel de Icaza <miguel@ximian.com>
22299 * expression.cs: Fix bug I introduced lsat night that broke
22302 (Expression.Resolve): Report a 246 error (can not resolve name)
22303 if we find a SimpleName in the stream.
22305 (Expression.ResolveLValue): Ditto.
22307 (Expression.ResolveWithSimpleName): This function is a variant of
22308 ResolveName, this one allows SimpleNames to be returned without a
22309 warning. The only consumer of SimpleNames is MemberAccess
22311 2001-10-26 Miguel de Icaza <miguel@ximian.com>
22313 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22314 might arrive here. I have my doubts that this is correct.
22316 * statement.cs (Lock): Implement lock statement.
22318 * cs-parser.jay: Small fixes to support `lock' and `using'
22320 * cs-tokenizer.cs: Remove extra space
22322 * driver.cs: New flag --checked, allows to turn on integer math
22325 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22326 Threading.Monitor.Exit
22328 2001-10-23 Miguel de Icaza <miguel@ximian.com>
22330 * expression.cs (IndexerAccess::DoResolveLValue): Set the
22331 Expression Class to be IndexerAccess.
22333 Notice that Indexer::DoResolve sets the eclass to Value.
22335 2001-10-22 Miguel de Icaza <miguel@ximian.com>
22337 * class.cs (TypeContainer::Emit): Emit code for indexers.
22339 * assign.cs (IAssignMethod): New interface implemented by Indexers
22340 and Properties for handling assignment.
22342 (Assign::Emit): Simplify and reuse code.
22344 * expression.cs (IndexerAccess, PropertyExpr): Implement
22345 IAssignMethod, clean up old code.
22347 2001-10-22 Ravi Pratap <ravi@ximian.com>
22349 * typemanager.cs (ImplementsInterface): New method to determine if a type
22350 implements a given interface. Provides a nice cache too.
22352 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22355 (ConvertReferenceExplicit): Ditto.
22357 * delegate.cs (Delegate::Populate): Update to define the parameters on the
22358 various methods, with correct names etc.
22360 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
22361 Operator.UnaryNegation.
22363 * cs-parser.jay (operator_declarator): Be a little clever in the case where
22364 we have a unary plus or minus operator.
22366 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
22369 * everywhere : update accordingly.
22371 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22374 * class.cs (Method::Define): For the case where we are implementing a method
22375 inherited from an interface, we need to set the MethodAttributes.Final flag too.
22376 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22378 2001-10-21 Ravi Pratap <ravi@ximian.com>
22380 * interface.cs (FindMembers): Implement to work around S.R.E
22383 * typemanager.cs (IsInterfaceType): Implement.
22385 (FindMembers): Update to handle interface types too.
22387 * expression.cs (ImplicitReferenceConversion): Re-write bits which
22388 use IsAssignableFrom as that is not correct - it doesn't work.
22390 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22391 and accordingly override EmitStatement.
22393 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22394 using the correct logic :-)
22396 2001-10-19 Ravi Pratap <ravi@ximian.com>
22398 * ../errors/cs-11.cs : Add to demonstrate error -11
22400 2001-10-17 Miguel de Icaza <miguel@ximian.com>
22402 * assign.cs (Assign::Resolve): Resolve right hand side first, and
22403 then pass this as a hint to ResolveLValue.
22405 * expression.cs (FieldExpr): Add Location information
22407 (FieldExpr::LValueResolve): Report assignment to readonly
22410 (Expression::ExprClassFromMemberInfo): Pass location information.
22412 (Expression::ResolveLValue): Add new method that resolves an
22415 (Expression::DoResolveLValue): Default invocation calls
22418 (Indexers): New class used to keep track of indexers in a given
22421 (IStackStore): Renamed from LValue, as it did not really describe
22422 what this did. Also ResolveLValue is gone from this interface and
22423 now is part of Expression.
22425 (ElementAccess): Depending on the element access type
22427 * typemanager.cs: Add `indexer_name_type' as a Core type
22428 (System.Runtime.CompilerServices.IndexerNameAttribute)
22430 * statement.cs (Goto): Take a location.
22432 2001-10-18 Ravi Pratap <ravi@ximian.com>
22434 * delegate.cs (Delegate::VerifyDelegate): New method to verify
22435 if two delegates are compatible.
22437 (NewDelegate::DoResolve): Update to take care of the case when
22438 we instantiate a delegate from another delegate.
22440 * typemanager.cs (FindMembers): Don't even try to look up members
22441 of Delegate types for now.
22443 2001-10-18 Ravi Pratap <ravi@ximian.com>
22445 * delegate.cs (NewDelegate): New class to take care of delegate
22448 * expression.cs (New): Split the delegate related code out into
22449 the NewDelegate class.
22451 * delegate.cs (DelegateInvocation): New class to handle delegate
22454 * expression.cs (Invocation): Split out delegate related code into
22455 the DelegateInvocation class.
22457 2001-10-17 Ravi Pratap <ravi@ximian.com>
22459 * expression.cs (New::DoResolve): Implement delegate creation fully
22460 and according to the spec.
22462 (New::DoEmit): Update to handle delegates differently.
22464 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22465 because of which we were printing out arguments in reverse order !
22467 * delegate.cs (VerifyMethod): Implement to check if the given method
22468 matches the delegate.
22470 (FullDelegateDesc): Implement.
22472 (VerifyApplicability): Implement.
22474 * expression.cs (Invocation::DoResolve): Update to accordingly handle
22475 delegate invocations too.
22477 (Invocation::Emit): Ditto.
22479 * ../errors/cs1593.cs : Added.
22481 * ../errors/cs1594.cs : Added.
22483 * delegate.cs (InstanceExpression, TargetMethod): New properties.
22485 2001-10-16 Ravi Pratap <ravi@ximian.com>
22487 * typemanager.cs (intptr_type): Core type for System.IntPtr
22489 (InitCoreTypes): Update for the same.
22491 (iasyncresult_type, asynccallback_type): Ditto.
22493 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22496 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22499 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22500 the builders for the 4 members of a delegate type :-)
22502 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22505 * expression.cs (New::DoResolve): Implement guts for delegate creation.
22507 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22509 2001-10-15 Miguel de Icaza <miguel@ximian.com>
22511 * statement.cs (Break::Emit): Implement.
22512 (Continue::Emit): Implement.
22514 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
22515 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
22516 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
22517 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
22520 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22521 properties that track the label for the current loop (begin of the
22522 loop and end of the loop).
22524 2001-10-15 Ravi Pratap <ravi@ximian.com>
22526 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22527 use of emitting anything at all.
22529 * class.cs, rootcontext.cs : Get rid of calls to the same.
22531 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22533 (Populate): Define the constructor correctly and set the implementation
22536 * typemanager.cs (delegate_types): New hashtable to hold delegates that
22539 (AddDelegateType): Implement.
22541 (IsDelegateType): Implement helper method.
22543 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22545 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22546 and accordingly handle it.
22548 * delegate.cs (Populate): Take TypeContainer argument.
22549 Implement bits to define the Invoke method. However, I still haven't figured out
22550 how to take care of the native int bit :-(
22552 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
22553 Qualify the name of the delegate, not its return type !
22555 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22558 (StandardConversionExists): Checking for array types turns out to be recursive.
22560 (ConvertReferenceExplicit): Implement array conversion.
22562 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22564 2001-10-12 Ravi Pratap <ravi@ximian.com>
22566 * cs-parser.jay (delegate_declaration): Store the fully qualified
22567 name as it is a type declaration.
22569 * delegate.cs (ReturnType, Name): Rename members to these. Make them
22572 (DefineDelegate): Renamed from Define. Does the same thing essentially,
22573 as TypeContainer::DefineType.
22575 (Populate): Method in which all the definition of the various methods (Invoke)
22578 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22581 (CloseDelegate): Finally creates the delegate.
22583 * class.cs (TypeContainer::DefineType): Update to define delegates.
22584 (Populate, Emit and CloseType): Do the same thing here too.
22586 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22587 delegates in all these operations.
22589 2001-10-14 Miguel de Icaza <miguel@ximian.com>
22591 * expression.cs: LocalTemporary: a new expression used to
22592 reference a temporary that has been created.
22594 * assign.cs: Handle PropertyAccess back here, so that we can
22595 provide the proper semantic access to properties.
22597 * expression.cs (Expression::ConvertReferenceExplicit): Implement
22598 a few more explicit conversions.
22600 * modifiers.cs: `NEW' modifier maps to HideBySig.
22602 * expression.cs (PropertyExpr): Make this into an
22603 ExpressionStatement, and support the EmitStatement code path.
22605 Perform get/set error checking, clean up the interface.
22607 * assign.cs: recognize PropertyExprs as targets, and if so, turn
22608 them into toplevel access objects.
22610 2001-10-12 Miguel de Icaza <miguel@ximian.com>
22612 * expression.cs: PropertyExpr::PropertyExpr: use work around the
22615 * typemanager.cs: Keep track here of our PropertyBuilders again to
22616 work around lameness in SRE.
22618 2001-10-11 Miguel de Icaza <miguel@ximian.com>
22620 * expression.cs (LValue::LValueResolve): New method in the
22621 interface, used to perform a second resolution pass for LValues.
22623 (This::DoResolve): Catch the use of this in static methods.
22625 (This::LValueResolve): Implement.
22627 (This::Store): Remove warning, assigning to `this' in structures
22630 (Invocation::Emit): Deal with invocation of
22631 methods on value types. We need to pass the address to structure
22632 methods rather than the object itself. (The equivalent code to
22633 emit "this" for structures leaves the entire structure on the
22634 stack instead of a pointer to it).
22636 (ParameterReference::DoResolve): Compute the real index for the
22637 argument based on whether the method takes or not a `this' pointer
22638 (ie, the method is static).
22640 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22641 value types returned from functions when we need to invoke a
22642 method on the sturcture.
22645 2001-10-11 Ravi Pratap <ravi@ximian.com>
22647 * class.cs (TypeContainer::DefineType): Method to actually do the business of
22648 defining the type in the Modulebuilder or Typebuilder. This is to take
22649 care of nested types which need to be defined on the TypeBuilder using
22650 DefineNestedMethod.
22652 (TypeContainer::GetClassBases): Implement. Essentially the code from the
22653 methods in RootContext, only ported to be part of TypeContainer.
22655 (TypeContainer::GetInterfaceOrClass): Ditto.
22657 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22659 * interface.cs (Interface::DefineInterface): New method. Does exactly
22660 what RootContext.CreateInterface did earlier, only it takes care of nested types
22663 (Interface::GetInterfaces): Move from RootContext here and port.
22665 (Interface::GetInterfaceByName): Same here.
22667 * rootcontext.cs (ResolveTree): Re-write.
22669 (PopulateTypes): Re-write.
22671 * class.cs (TypeContainer::Populate): Populate nested types too.
22672 (TypeContainer::Emit): Emit nested members too.
22674 * typemanager.cs (AddUserType): Do not make use of the FullName property,
22675 instead just use the name argument passed in as it is already fully
22678 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22679 to TypeContainer mapping to see if a type is user-defined.
22681 * class.cs (TypeContainer::CloseType): Implement.
22683 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22684 the default constructor.
22686 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22689 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22691 * interface.cs (CloseType): Create the type here.
22693 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22696 Remove all the methods which are now in TypeContainer.
22698 2001-10-10 Ravi Pratap <ravi@ximian.com>
22700 * delegate.cs (Define): Re-write bits to define the delegate
22703 2001-10-10 Miguel de Icaza <miguel@ximian.com>
22705 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22707 * expression.cs (ImplicitReferenceConversion): handle null as well
22708 as a source to convert to any reference type.
22710 * statement.cs (Return): Perform any implicit conversions to
22711 expected return type.
22713 Validate use of return statement.
22715 * codegen.cs (EmitContext): Pass the expected return type here.
22717 * class.cs (Method, Constructor, Property): Pass expected return
22718 type to EmitContext.
22720 2001-10-09 Miguel de Icaza <miguel@ximian.com>
22722 * expression.cs: Make DoResolve take an EmitContext instead of a
22725 Replaced `l' and `location' for `loc', for consistency.
22727 (Error, Warning): Remove unneeded Tc argument.
22729 * assign.cs, literal.cs, constant.cs: Update to new calling
22732 * codegen.cs: EmitContext now contains a flag indicating whether
22733 code is being generated in a static method or not.
22735 * cs-parser.jay: DecomposeQI, new function that replaces the old
22736 QualifiedIdentifier. Now we always decompose the assembled
22737 strings from qualified_identifier productions into a group of
22740 2001-10-08 Miguel de Icaza <miguel@ximian.com>
22742 * rootcontext.cs: Deal with field-less struct types correctly now
22743 by passing the size option to Define Type.
22745 * class.cs: Removed hack that created one static field.
22747 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22749 * statement.cs: Moved most of the code generation here.
22751 2001-10-09 Ravi Pratap <ravi@ximian.com>
22753 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22756 (ElementAccess): Remove useless bits for now - keep checks as the spec
22759 2001-10-08 Ravi Pratap <ravi@ximian.com>
22761 * expression.cs (ElementAccess::DoResolve): Remove my crap code
22762 and start performing checks according to the spec.
22764 2001-10-07 Ravi Pratap <ravi@ximian.com>
22766 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22767 rank_specifiers instead.
22769 (rank_specifiers): Change the order in which the rank specifiers are stored
22771 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22773 * expression.cs (ElementAccess): Implement the LValue interface too.
22775 2001-10-06 Ravi Pratap <ravi@ximian.com>
22777 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22778 except that user defined conversions are not included.
22780 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
22781 perform the conversion of the return type, if necessary.
22783 (New::DoResolve): Check whether we are creating an array or an object
22784 and accordingly do the needful.
22786 (New::Emit): Same here.
22788 (New::DoResolve): Implement guts of array creation.
22790 (New::FormLookupType): Helper function.
22792 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22794 * codegen.cs: Removed most of the code generation here, and move the
22795 corresponding code generation bits to the statement classes.
22797 Added support for try/catch/finalize and throw.
22799 * cs-parser.jay: Added support for try/catch/finalize.
22801 * class.cs: Catch static methods having the flags override,
22802 virtual or abstract.
22804 * expression.cs (UserCast): This user cast was not really doing
22805 what it was supposed to do. Which is to be born in fully resolved
22806 state. Parts of the resolution were being performed at Emit time!
22810 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22812 * expression.cs: Implicity convert the result from UserCast.
22814 2001-10-05 Ravi Pratap <ravi@ximian.com>
22816 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22817 prevented it from working correctly.
22819 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22820 merely ConvertImplicit.
22822 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22824 * typemanager.cs: Make the LookupTypeContainer function static,
22825 and not per-instance.
22827 * class.cs: Make static FindMembers (the one that takes a Type
22830 * codegen.cs: Add EmitForeach here.
22832 * cs-parser.jay: Make foreach a toplevel object instead of the
22833 inline expansion, as we need to perform semantic analysis on it.
22835 2001-10-05 Ravi Pratap <ravi@ximian.com>
22837 * expression.cs (Expression::ImplicitUserConversion): Rename to
22838 UserDefinedConversion.
22840 (Expression::UserDefinedConversion): Take an extra argument specifying
22841 whether we look for explicit user conversions too.
22843 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22845 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22847 (ExplicitUserConversion): Make it a call to UserDefinedConversion
22848 with the appropriate arguments.
22850 * cs-parser.jay (cast_expression): Record location too.
22852 * expression.cs (Cast): Record location info.
22854 (Expression::ConvertExplicit): Take location argument.
22856 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22857 to determine if we are doing explicit conversions.
22859 (UserCast::Emit): Update accordingly.
22861 (Expression::ConvertExplicit): Report an error if everything fails.
22863 * ../errors/cs0030.cs : Add.
22865 2001-10-04 Miguel de Icaza <miguel@ximian.com>
22867 * modifiers.cs: If the ABSTRACT keyword is present, also set the
22868 virtual and newslot bits.
22870 * class.cs (TypeContainer::RegisterRequiredImplementations):
22871 Record methods we need.
22873 (TypeContainer::MakeKey): Helper function to make keys for
22874 MethodBases, since the Methodbase key is useless.
22876 (TypeContainer::Populate): Call RegisterRequiredImplementations
22877 before defining the methods.
22879 Create a mapping for method_builders_to_methods ahead of time
22880 instead of inside a tight loop.
22882 (::RequireMethods): Accept an object as the data to set into the
22883 hashtable so we can report interface vs abstract method mismatch.
22885 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22887 * report.cs: Make all of it static.
22889 * rootcontext.cs: Drop object_type and value_type computations, as
22890 we have those in the TypeManager anyways.
22892 Drop report instance variable too, now it is a global.
22894 * driver.cs: Use try/catch on command line handling.
22896 Add --probe option to debug the error reporting system with a test
22899 * report.cs: Add support for exiting program when a probe
22900 condition is reached.
22902 2001-10-03 Ravi Pratap <ravi@ximian.com>
22904 * expression.cs (Binary::DoNumericPromotions): Fix the case when
22905 we do a forcible conversion regardless of type, to check if
22906 ForceConversion returns a null.
22908 (Binary::error19): Use location to report error.
22910 (Unary::error23): Use location here too.
22912 * ../errors/cs0019.cs : Check in.
22914 * ../errors/cs0023.cs : Check in.
22916 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22917 case of a non-null MethodInfo object with a length of 0 !
22919 (Binary::ResolveOperator): Flag error if overload resolution fails to find
22920 an applicable member - according to the spec :-)
22921 Also fix logic to find members in base types.
22923 (Unary::ResolveOperator): Same here.
22925 (Unary::report23): Change name to error23 and make first argument a TypeContainer
22926 as I was getting thoroughly confused between this and error19 :-)
22928 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22929 (::FindMostEncompassedType): Implement.
22930 (::FindMostEncompassingType): Implement.
22931 (::StandardConversionExists): Implement.
22933 (UserImplicitCast): Re-vamp. We now need info about most specific
22934 source and target types so that we can do the necessary conversions.
22936 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22937 mathematical union with no duplicates.
22939 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22941 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22942 in order from base classes to child classes, so that we can in
22943 child classes look up in our parent for method names and
22944 attributes (required for handling abstract, virtual, new, override
22945 constructs: we need to instrospect our base class, and if we dont
22946 populate the classes in order, the introspection might be
22947 incorrect. For example, a method could query its parent before
22948 the parent has any methods and would determine that the parent has
22949 no abstract methods (while it could have had them)).
22951 (RootContext::CreateType): Record the order in which we define the
22954 2001-10-02 Miguel de Icaza <miguel@ximian.com>
22956 * class.cs (TypeContainer::Populate): Also method definitions can
22957 fail now, keep track of this.
22959 (TypeContainer::FindMembers): Implement support for
22960 DeclaredOnly/noDeclaredOnly flag.
22962 (Constructor::Emit) Return the ConstructorBuilder.
22964 (Method::Emit) Return the MethodBuilder.
22965 Check for abstract or virtual methods to be public.
22967 * rootcontext.cs (RootContext::CreateType): Register all the
22968 abstract methods required for the class to be complete and the
22969 interface methods that must be implemented.
22971 * cs-parser.jay: Report error 501 (method requires body if it is
22972 not marked abstract or extern).
22974 * expression.cs (TypeOf::Emit): Implement.
22976 * typemanager.cs: runtime_handle_type, new global type.
22978 * class.cs (Property::Emit): Generate code for properties.
22980 2001-10-02 Ravi Pratap <ravi@ximian.com>
22982 * expression.cs (Unary::ResolveOperator): Find operators on base type
22983 too - we now conform exactly to the spec.
22985 (Binary::ResolveOperator): Same here.
22987 * class.cs (Operator::Define): Fix minor quirk in the tests.
22989 * ../errors/cs0215.cs : Added.
22991 * ../errors/cs0556.cs : Added.
22993 * ../errors/cs0555.cs : Added.
22995 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22997 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22998 single integer which is really efficient
23000 2001-10-01 Ravi Pratap <ravi@ximian.com>
23002 * expression.cs (Expression::ImplicitUserConversion): Use location
23003 even in the case when we are examining True operators.
23005 * class.cs (Operator::Define): Perform extensive checks to conform
23006 with the rules for operator overloading in the spec.
23008 * expression.cs (Expression::ImplicitReferenceConversion): Implement
23009 some of the other conversions mentioned in the spec.
23011 * typemanager.cs (array_type): New static member for the System.Array built-in
23014 (cloneable_interface): For System.ICloneable interface.
23016 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23017 we start resolving the tree and populating types.
23019 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23021 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23023 * expression.cs (Expression::ExprClassFromMemberInfo,
23024 Expression::Literalize): Create literal expressions from
23025 FieldInfos which are literals.
23027 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23028 type casts, because they were wrong. The test suite in tests
23031 (ImplicitNumericConversion): ushort to ulong requires a widening
23034 Int32 constant to long requires widening cast as well.
23036 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23037 for integers because the type on the stack is not i4.
23039 2001-09-30 Miguel de Icaza <miguel@ximian.com>
23041 * expression.cs (report118): require location argument.
23043 * parameter.cs: Do not dereference potential null value.
23045 * class.cs: Catch methods that lack the `new' keyword when
23046 overriding a name. Report warnings when `new' is used without
23047 anything being there to override.
23049 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23051 * class.cs: Only add constructor to hashtable if it is non-null
23052 (as now constructors can fail on define).
23054 (TypeManager, Class, Struct): Take location arguments.
23056 Catch field instance initialization in structs as errors.
23058 accepting_filter: a new filter for FindMembers that is static so
23059 that we dont create an instance per invocation.
23061 (Constructor::Define): Catch errors where a struct constructor is
23064 * cs-parser.jay: Pass location information for various new
23067 * delegate.cs (Delegate): take a location argument.
23069 * driver.cs: Do not call EmitCode if there were problesm in the
23070 Definition of the types, as many Builders wont be there.
23072 * decl.cs (Decl::Decl): Require a location argument.
23074 * cs-tokenizer.cs: Handle properly hex constants that can not fit
23075 into integers, and find the most appropiate integer for it.
23077 * literal.cs: Implement ULongLiteral.
23079 * rootcontext.cs: Provide better information about the location of
23080 failure when CreateType fails.
23082 2001-09-29 Miguel de Icaza <miguel@ximian.com>
23084 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23087 * expression.cs (Binary::CheckShiftArguments): Add missing type
23089 (Binary::ResolveOperator): Add type to the logical and and logical
23090 or, Bitwise And/Or and Exclusive Or code paths, it was missing
23093 (Binary::DoNumericPromotions): In the case where either argument
23094 is ulong (and most signed types combined with ulong cause an
23095 error) perform implicit integer constant conversions as well.
23097 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23099 * expression.cs (UserImplicitCast): Method should always be
23101 (Invocation::BetterConversion): Simplified test for IntLiteral.
23103 (Expression::ImplicitNumericConversion): Split this routine out.
23104 Put the code that performs implicit constant integer conversions
23107 (Expression::Resolve): Become a wrapper around DoResolve so we can
23108 check eclass and type being set after resolve.
23110 (Invocation::Badness): Remove this dead function
23112 (Binary::ResolveOperator): Do not compute the expensive argumnets
23113 unless we have a union for it.
23115 (Probe::Emit): Is needs to do an isinst and then
23116 compare against null.
23118 (::CanConvert): Added Location argument. If the Location argument
23119 is null (Location.Null), then we do not report errors. This is
23120 used by the `probe' mechanism of the Explicit conversion. We do
23121 not want to generate an error for something that the user
23122 explicitly requested to be casted. But the pipeline for an
23123 explicit cast first tests for potential implicit casts.
23125 So for now, if the Location is null, it means `Probe only' to
23126 avoid adding another argument. Might have to revise this
23129 (ClassCast): New class used to type cast objects into arbitrary
23130 classes (used in Explicit Reference Conversions).
23132 Implement `as' as well.
23134 Reverted all the patches from Ravi below: they were broken:
23136 * The use of `level' as a mechanism to stop recursive
23137 invocations is wrong. That was there just to catch the
23138 bug with a strack trace but not as a way of addressing
23141 To fix the problem we have to *understand* what is going
23142 on and the interactions and come up with a plan, not
23143 just get things going.
23145 * The use of the type conversion cache that I proposed
23146 last night had an open topic: How does this work across
23147 protection domains. A user defined conversion might not
23148 be public in the location where we are applying the
23149 conversion, a different conversion might be selected
23150 (ie, private A->B (better) but public B->A (worse),
23151 inside A, A->B applies, but outside it, B->A will
23154 * On top of that (ie, even if the above is solved),
23155 conversions in a cache need to be abstract. Ie, `To
23156 convert from an Int to a Short use an OpcodeCast', not
23157 `To convert from an Int to a Short use the OpcodeCast on
23158 the variable 5' (which is what this patch was doing).
23160 2001-09-28 Ravi Pratap <ravi@ximian.com>
23162 * expression.cs (Invocation::ConversionExists): Re-write to use
23163 the conversion cache
23165 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23166 cache all conversions done, not just user-defined ones.
23168 (Invocation::BetterConversion): The real culprit. Use ConversionExists
23169 to determine if a conversion exists instead of acutually trying to
23170 perform the conversion. It's faster too.
23172 (Expression::ConvertExplicit): Modify to use ConversionExists to check
23173 and only then attempt the implicit conversion.
23175 2001-09-28 Ravi Pratap <ravi@ximian.com>
23177 * expression.cs (ConvertImplicit): Use a cache for conversions
23178 already found. Check level of recursion and bail out if necessary.
23180 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23182 * typemanager.cs (string_concat_string_string, string_concat_object_object):
23183 Export standard methods that we expect for string operations.
23185 * statement.cs (Block::UsageWarning): Track usage of variables and
23186 report the errors for not used variables.
23188 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23191 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23193 * codegen.cs: remove unnneded code
23195 * expression.cs: Removed BuiltinTypeAccess class
23197 Fix the order in which implicit conversions are
23200 The previous fixed dropped support for boxed conversions (adding a
23201 test to the test suite now)
23203 (UserImplicitCast::CanConvert): Remove test for source being null,
23204 that code is broken. We should not feed a null to begin with, if
23205 we do, then we should track the bug where the problem originates
23206 and not try to cover it up here.
23208 Return a resolved expression of type UserImplicitCast on success
23209 rather than true/false. Ravi: this is what I was talking about,
23210 the pattern is to use a static method as a "constructor" for
23213 Also, do not create arguments until the very last minute,
23214 otherwise we always create the arguments even for lookups that
23215 will never be performed.
23217 (UserImplicitCast::Resolve): Eliminate, objects of type
23218 UserImplicitCast are born in a fully resolved state.
23220 * typemanager.cs (InitCoreTypes): Init also value_type
23221 (System.ValueType).
23223 * expression.cs (Cast::Resolve): First resolve the child expression.
23225 (LValue): Add new method AddressOf to be used by
23228 Change the argument of Store to take an EmitContext instead of an
23229 ILGenerator, because things like FieldExpr need to be able to call
23230 their children expression to generate the instance code.
23232 (Expression::Error, Expression::Warning): Sugar functions for
23235 (Expression::MemberLookup): Accept a TypeContainer instead of a
23236 Report as the first argument.
23238 (Expression::ResolvePrimary): Killed. I still want to improve
23239 this as currently the code is just not right.
23241 (Expression::ResolveMemberAccess): Simplify, but it is still
23244 (Unary::Resolve): Catch errors in AddressOf operators.
23246 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23247 index to a byte for the short-version, or the compiler will choose
23248 the wrong Emit call, which generates the wrong data.
23250 (ParameterReference::Emit, ::Store): same.
23252 (FieldExpr::AddressOf): Implement.
23254 * typemanager.cs: TypeManager: made public variable instead of
23257 * driver.cs: document --fatal.
23259 * report.cs (ErrorMessage, WarningMessage): new names for the old
23260 Error and Warning classes.
23262 * cs-parser.jay (member_access): Turn built-in access to types
23263 into a normal simplename
23265 2001-09-27 Ravi Pratap <ravi@ximian.com>
23267 * expression.cs (Invocation::BetterConversion): Fix to cope
23268 with q being null, since this was introducing a bug.
23270 * expression.cs (ConvertImplicit): Do built-in conversions first.
23272 2001-09-27 Ravi Pratap <ravi@ximian.com>
23274 * expression.cs (UserImplicitCast::Resolve): Fix bug.
23276 2001-09-27 Ravi Pratap <ravi@ximian.com>
23278 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23279 I had introduced long ago (what's new ?).
23281 * expression.cs (UserImplicitCast::CanConvert): Static method to do
23282 the work of all the checking.
23283 (ConvertImplicit): Call CanConvert and only then create object if necessary.
23284 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23286 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23287 that is the right way.
23289 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
23290 overloading resolution. Use everywhere instead of cutting and pasting code.
23292 (Binary::ResolveOperator): Use MakeUnionSet.
23294 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
23295 we have to convert to bool types. Not complete yet.
23297 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23299 * typemanager.cs (TypeManager::CSharpName): support ushort.
23301 * expression.cs (Expression::TryImplicitIntConversion): Attempts
23302 to provide an expression that performsn an implicit constant int
23303 conversion (section 6.1.6).
23304 (Expression::ConvertImplicitRequired): Reworked to include
23305 implicit constant expression conversions.
23307 (Expression::ConvertNumericExplicit): Finished.
23309 (Invocation::Emit): If InstanceExpression is null, then it means
23310 that we perform a call on this.
23312 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23314 * expression.cs (Unary::Emit): Remove some dead code.
23315 (Probe): Implement Resolve and Emit for `is'.
23316 (Expression::ConvertImplicitRequired): Attempt to do constant
23317 expression conversions here. Maybe should be moved to
23318 ConvertImplicit, but I am not sure.
23319 (Expression::ImplicitLongConstantConversionPossible,
23320 Expression::ImplicitIntConstantConversionPossible): New functions
23321 that tell whether is it possible to apply an implicit constant
23322 expression conversion.
23324 (ConvertNumericExplicit): Started work on explicit numeric
23327 * cs-parser.jay: Update operator constants.
23329 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23330 (Parameters::GetSignature): Hook up VerifyArgs here.
23331 (Parameters::VerifyArgs): Verifies that no two arguments have the
23334 * class.cs (Operator): Update the operator names to reflect the
23335 ones that the spec expects (as we are just stringizing the
23338 * expression.cs (Unary::ResolveOperator): Fix bug: Use
23339 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23340 previous usage did only work for our methods.
23341 (Expression::ConvertImplicit): Handle decimal implicit numeric
23342 conversions as well.
23343 (Expression::InternalTypeConstructor): Used to invoke constructors
23344 on internal types for default promotions.
23346 (Unary::Emit): Implement special handling for the pre/post
23347 increment/decrement for overloaded operators, as they need to have
23348 the same semantics as the other operators.
23350 (Binary::ResolveOperator): ditto.
23351 (Invocation::ConversionExists): ditto.
23352 (UserImplicitCast::Resolve): ditto.
23354 2001-09-26 Ravi Pratap <ravi@ximian.com>
23356 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23357 operator, return after emitting body. Regression tests pass again !
23359 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23360 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23361 (Invocation::OverloadResolve): Ditto.
23362 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23364 * everywhere : update calls to the above methods accordingly.
23366 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23368 * assign.cs (Assign): Make it inherit from ExpressionStatement.
23370 * expression.cs (ExpressionStatement): New base class used for
23371 expressions that can appear in statements, so that we can provide
23372 an alternate path to generate expression that do not leave a value
23375 (Expression::Emit, and all the derivatives): We no longer return
23376 whether a value is left on the stack or not. Every expression
23377 after being emitted leaves a single value on the stack.
23379 * codegen.cs (EmitContext::EmitStatementExpression): Use the
23380 facilties of ExpressionStatement if possible.
23382 * cs-parser.jay: Update statement_expression.
23384 2001-09-25 Miguel de Icaza <miguel@ximian.com>
23386 * driver.cs: Change the wording of message
23388 2001-09-25 Ravi Pratap <ravi@ximian.com>
23390 * expression.cs (Binary::ResolveOperator): Had forgottten to set
23391 the type of the expression to the return type of the method if
23392 we have an overloaded operator match ! The regression tests pass again !
23393 (Unary::ResolveOperator): Ditto.
23395 * expression.cs (Invocation::ConversionExists): Correct the member lookup
23396 to find "op_Implicit", not "implicit" ;-)
23397 (UserImplicitCast): New class to take care of user-defined implicit conversions.
23398 (ConvertImplicit, ForceConversion): Take TypeContainer argument
23400 * everywhere : Correct calls to the above accordingly.
23402 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23403 (ConvertImplicit): Do user-defined conversion if it exists.
23405 2001-09-24 Miguel de Icaza <miguel@ximian.com>
23407 * assign.cs: track location.
23408 (Resolve): Use implicit conversions on assignment.
23410 * literal.cs: Oops. Not good, Emit of short access values should
23411 pass (Bytes) or the wrong argument will be selected.
23413 * expression.cs (Unary::Emit): Emit code for -expr.
23415 (Unary::ResolveOperator): Handle `Substract' for non-constants
23416 (substract from zero from the non-constants).
23417 Deal with Doubles as well.
23419 (Expression::ConvertImplicitRequired): New routine that reports an
23420 error if no implicit conversion exists.
23422 (Invocation::OverloadResolve): Store the converted implicit
23423 expressions if we make them
23425 2001-09-24 Ravi Pratap <ravi@ximian.com>
23427 * class.cs (ConstructorInitializer): Take a Location argument.
23428 (ConstructorBaseInitializer): Same here.
23429 (ConstructorThisInitializer): Same here.
23431 * cs-parser.jay : Update all calls accordingly.
23433 * expression.cs (Unary, Binary, New): Take location argument.
23434 Update accordingly everywhere.
23436 * cs-parser.jay : Update all calls to the above to take a location
23439 * class.cs : Ditto.
23441 2001-09-24 Ravi Pratap <ravi@ximian.com>
23443 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23444 (Invocation::BetterConversion): Same here
23445 (Invocation::ConversionExists): Ditto.
23447 (Invocation::ConversionExists): Implement.
23449 2001-09-22 Ravi Pratap <ravi@ximian.com>
23451 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23452 Also take an additional TypeContainer argument.
23454 * All over : Pass in TypeContainer as argument to OverloadResolve.
23456 * typemanager.cs (CSharpName): Update to check for the string type and return
23459 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23462 2001-09-21 Ravi Pratap <ravi@ximian.com>
23464 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23465 (Invocation::BetterFunction): Implement.
23466 (Invocation::BetterConversion): Implement.
23467 (Invocation::ConversionExists): Skeleton, no implementation yet.
23469 Okay, things work fine !
23471 2001-09-21 Miguel de Icaza <miguel@ximian.com>
23473 * typemanager.cs: declare and load enum_type, delegate_type and
23476 * expression.cs (Expression::Emit): Now emit returns a value that
23477 tells whether a value is left on the stack or not. This strategy
23478 might be reveted tomorrow with a mechanism that would address
23479 multiple assignments.
23480 (Expression::report118): Utility routine to report mismatches on
23483 (Unary::Report23): Report impossible type/operator combination
23486 (Unary::IsIncrementableNumber): Whether the type can be
23487 incremented or decremented with add.
23488 (Unary::ResolveOperator): Also allow enumerations to be bitwise
23490 (Unary::ResolveOperator): Implement ++, !, ~,
23492 (Invocation::Emit): Deal with new Emit convetion.
23494 * All Expression derivatives: Updated their Emit method to return
23495 whether they leave values on the stack or not.
23497 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23498 stack for expressions that are statements.
23500 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23502 * expression.cs (LValue): New interface. Must be implemented by
23504 (LocalVariableReference, ParameterReference, FieldExpr): Implement
23507 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23508 interface for generating code, simplifies the code.
23510 2001-09-20 Ravi Pratap <ravi@ximian.com>
23512 * expression.cs (everywhere): Comment out return statements in ::Resolve
23513 methods to avoid the warnings.
23515 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23517 * driver.cs (parse): Report error 2001 if we can not open the
23520 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23523 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23526 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23527 otherwise nested blocks end up with the same index.
23529 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23531 * expression.cs: Instead of having FIXMEs in the Resolve
23532 functions, throw exceptions so it is obvious that we are facing a
23535 * cs-parser.jay (invocation_expression): Pass Location information.
23537 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23538 Use a basename for those routines because .NET does not like paths
23541 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23544 2001-09-19 Miguel de Icaza <miguel@ximian.com>
23546 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23547 are loading the correct data types (throws an exception if not).
23548 (TypeManager::InitCoreTypes): Use CoreLookupType
23550 * expression.cs (Unary::ResolveOperator): return the child
23551 expression for expressions which are just +expr.
23552 (Unary::ResolveOperator): Return negative literals for -LITERAL
23553 expressions (otherwise they are Unary {Literal}).
23554 (Invocation::Badness): Take into account `Implicit constant
23555 expression conversions'.
23557 * literal.cs (LongLiteral): Implement long literal class.
23558 (IntLiteral): export the `Value' of the intliteral.
23560 2001-09-19 Ravi Pratap <ravi@ximian.com>
23562 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23564 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
23565 instead of 'Operator'
23567 * expression.cs (Binary::ResolveOperator): Update accordingly.
23568 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23571 * cs-parser.jay (unary_expression): Update to use the new names.
23573 * gen-treedump.cs (GetUnary): Same here.
23575 * expression.cs (Unary::Resolve): Implement.
23576 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
23577 operators are found instead of making noise ;-)
23578 (Unary::ResolveOperator): New method to do precisely the same thing which
23579 Binary::ResolveOperator does for Binary expressions.
23580 (Unary.method, .Arguments): Add.
23581 (Unary::OperName): Implement.
23582 (Unary::ForceConversion): Copy and Paste !
23584 * class.cs (Operator::Define): Fix a small bug for the case when we have
23587 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23588 for the inbuilt operators. Only overloading works for now ;-)
23590 2001-09-18 Miguel de Icaza <miguel@ximian.com>
23592 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23593 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23595 * expression.cs (This::Emit): Implement.
23596 (This::Resolve): Implement.
23597 (TypeOf:Resolve): Implement.
23598 (Expression::ResolveSimpleName): Add an implicit this to instance
23600 (MemberAccess::Resolve): Deal with Parameters and Fields.
23601 Bind instance variable to Field expressions.
23602 (FieldExpr::Instance): New field used to track the expression that
23603 represents the object instance.
23604 (FieldExpr::Resolve): Track potential errors from MemberLookup not
23606 (FieldExpr::Emit): Implement.
23608 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23609 the last instruction contains a return opcode to avoid generating
23610 the last `ret' instruction (this generates correct code, and it is
23611 nice to pass the peverify output).
23613 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23614 initializer for static and instance variables.
23615 (Constructor::Emit): Allow initializer to be null in the case of
23616 static constructors. Only emit initializer for instance
23619 (TypeContainer::FindMembers): Return a null array if there are no
23622 Also fix the code for the MemberTypes.Method branch, as it was not
23623 scanning that for operators (or tried to access null variables before).
23625 * assign.cs (Assign::Emit): Handle instance and static fields.
23629 * driver.cs: Stop compilation if there are parse errors.
23631 * cs-parser.jay (constructor_declaration): Provide default base
23632 initializer for non-static constructors.
23633 (constructor_declarator): Do not provide a default base
23634 initializers if none was specified.
23635 Catch the fact that constructors should not have parameters.
23637 * class.cs: Do not emit parent class initializers for static
23638 constructors, that should be flagged as an error.
23640 2001-09-18 Ravi Pratap <ravi@ximian.com>
23642 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23643 Move back code into TypeContainer::Populate.
23645 2001-09-18 Ravi Pratap <ravi@ximian.com>
23647 * class.cs (TypeContainer::AddConstructor): Fix the check to
23648 compare against Name, not Basename.
23649 (Operator::OpType): Change Plus and Minus to Add and Subtract.
23651 * cs-parser.jay : Update accordingly.
23653 * class.cs (TypeContainer::FindMembers): For the case where we are searching
23654 for methods, don't forget to look into the operators too.
23655 (RegisterMethodBuilder): Helper method to take care of this for
23656 methods, constructors and operators.
23657 (Operator::Define): Completely revamp.
23658 (Operator.OperatorMethod, MethodName): New fields.
23659 (TypeContainer::Populate): Move the registering of builders into
23660 RegisterMethodBuilder.
23661 (Operator::Emit): Re-write.
23663 * expression.cs (Binary::Emit): Comment out code path to emit method
23664 invocation stuff for the case when we have a user defined operator. I am
23665 just not able to get it right !
23667 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23669 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23672 (Expression::MemberLookup): Provide a version that allows to
23673 specify the MemberTypes and BindingFlags.
23675 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23676 so it was not fetching variable information from outer blocks.
23678 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23679 Beforefieldinit as it was buggy.
23681 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23682 that Ravi put here.
23684 * class.cs (Constructor::Emit): Only emit if block is not null.
23685 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23686 deal with this by semantically definining it as if the user had
23689 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23690 constructors as we now "emit" them at a higher level.
23692 (TypeContainer::DefineDefaultConstructor): Used to define the
23693 default constructors if none was provided.
23695 (ConstructorInitializer): Add methods Resolve and Emit.
23697 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23699 2001-09-17 Ravi Pratap <ravi@ximian.com>
23701 * class.cs (TypeContainer::EmitDefaultConstructor): Register
23702 the default constructor builder with our hashtable for methodbuilders
23705 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23706 and argument_count is 0 in which case we have a match.
23707 (Binary::ResolveOperator): More null checking and miscellaneous coding
23710 2001-09-17 Ravi Pratap <ravi@ximian.com>
23712 * rootcontext.cs (IsNameSpace): Compare against null.
23714 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23716 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23717 and Unary::Operator.
23719 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23722 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23723 we have overloaded operators.
23724 (Binary::ResolveOperator): Implement the part which does the operator overload
23727 * class.cs (Operator::Emit): Implement.
23728 (TypeContainer::Emit): Emit the operators we have too.
23730 * expression.cs (Binary::Emit): Update to emit the appropriate code for
23731 the case when we have a user-defined operator.
23733 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23735 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23737 2001-09-16 Ravi Pratap <ravi@ximian.com>
23739 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23740 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23741 (Constructor::Emit): Implement.
23742 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23743 if we have no work to do.
23744 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
23747 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23748 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23750 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23753 2001-09-15 Ravi Pratap <ravi@ximian.com>
23755 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23757 (Tree::RecordNamespace): Method to do what the name says ;-)
23758 (Tree::Namespaces): Property to get at the namespaces hashtable.
23760 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
23763 * rootcontext.cs (IsNamespace): Fixed it :-)
23765 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23767 * class.cs (TypeContainer::FindMembers): Add support for
23769 (MethodCore): New class that encapsulates both the shared aspects
23770 of a Constructor and a Method.
23771 (Method, Constructor): Factored pieces into MethodCore.
23773 * driver.cs: Added --fatal which makes errors throw exceptions.
23774 Load System assembly as well as part of the standard library.
23776 * report.cs: Allow throwing exceptions on errors for debugging.
23778 * modifiers.cs: Do not use `parent', instead use the real type
23779 container to evaluate permission settings.
23781 * class.cs: Put Ravi's patch back in. He is right, and we will
23782 have to cope with the
23784 2001-09-14 Ravi Pratap <ravi@ximian.com>
23786 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23787 FamORAssem, not FamANDAssem.
23789 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23791 * driver.cs: Added --parse option that only parses its input files
23794 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
23795 incorrect. IsTopLevel is not used to tell whether an object is
23796 root_types or not (that can be achieved by testing this ==
23797 root_types). But to see if this is a top-level *class* (not
23798 necessarly our "toplevel" container).
23800 2001-09-14 Ravi Pratap <ravi@ximian.com>
23802 * enum.cs (Enum::Define): Modify to call the Lookup method on the
23803 parent instead of a direct call to GetType.
23805 2001-09-14 Ravi Pratap <ravi@ximian.com>
23807 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23808 Modifiers.TypeAttr. This should just be a call to that method.
23810 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23811 object so that we can determine if we are top-level or not.
23813 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
23816 * enum.cs (Enum::Define): Ditto.
23818 * modifiers.cs (FieldAttr): Re-write.
23820 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23821 (TypeContainer::HaveStaticConstructor): New property to provide access
23822 to precisely that info.
23824 * modifiers.cs (MethodAttr): Re-write.
23825 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23827 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23828 of top-level types as claimed.
23830 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23832 * expression.cs (MemberLookup): Fruitless attempt to lookup
23833 constructors. Maybe I need to emit default constructors? That
23834 might be it (currently .NET emits this for me automatically).
23835 (Invocation::OverloadResolve): Cope with Arguments == null.
23836 (Invocation::EmitArguments): new function, shared by the new
23837 constructor and us.
23838 (Invocation::Emit): Handle static and instance methods. Emit
23839 proper call instruction for virtual or non-virtual invocations.
23840 (New::Emit): Implement.
23841 (New::Resolve): Implement.
23842 (MemberAccess:Resolve): Implement.
23843 (MethodGroupExpr::InstanceExpression): used conforming to the spec
23844 to track instances.
23845 (FieldExpr::Resolve): Set type.
23847 * support.cs: Handle empty arguments.
23849 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23850 SimpleLookup): Auxiliary routines to help parse a qualifier
23853 Update qualifier_identifier rule.
23855 * codegen.cs: Removed debugging messages.
23857 * class.cs: Make this a global thing, this acts just as a "key" to
23858 objects that we might have around.
23860 (Populate): Only initialize method_builders_to_methods once.
23862 * expression.cs (PropertyExpr): Initialize type from the
23865 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23866 Resolve pattern. Attempt to implicitly convert value to boolean.
23869 * expression.cs: Set the type for the int32/int32 argument case.
23870 (Binary::ResolveOperator): Set the return type to boolean for
23871 comparission operators
23873 * typemanager.cs: Remove debugging print code.
23875 (Invocation::Resolve): resolve type.
23877 * class.cs: Allocate a MemberInfo of the correct size, as the code
23878 elsewhere depends on the test to reflect the correct contents.
23880 (Method::) Keep track of parameters, due to System.Reflection holes
23882 (TypeContainer::Populate): Keep track of MethodBuilders to Method
23885 (TypeContainer::FindMembers): Use ArrayList and then copy an array
23886 of the exact size and return that.
23888 (Class::LookupMethodByBuilder): New function that maps
23889 MethodBuilders to its methods. Required to locate the information
23890 on methods because System.Reflection bit us again.
23892 * support.cs: New file, contains an interface ParameterData and
23893 two implementations: ReflectionParameters and InternalParameters
23894 used to access Parameter information. We will need to grow this
23897 * expression.cs (Invocation::GetParameterData): implement a cache
23898 and a wrapper around the ParameterData creation for methods.
23899 (Invocation::OverloadResolve): Use new code.
23901 2001-09-13 Ravi Pratap <ravi@ximian.com>
23903 * class.cs (TypeContainer::EmitField): Remove and move into
23904 (Field::Define): here and modify accordingly.
23905 (Field.FieldBuilder): New member.
23906 (TypeContainer::Populate): Update accordingly.
23907 (TypeContainer::FindMembers): Implement.
23909 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23911 * statement.cs: (VariableInfo::VariableType): New field to be
23912 initialized with the full type once it is resolved.
23914 2001-09-12 Miguel de Icaza <miguel@ximian.com>
23916 * parameter.cs (GetParameterInfo): Use a type cache to compute
23917 things only once, and to reuse this information
23919 * expression.cs (LocalVariableReference::Emit): Implement.
23920 (OpcodeCast::Emit): fix.
23922 (ParameterReference::Resolve): Implement.
23923 (ParameterReference::Emit): Implement.
23925 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23926 that are expressions need to stay as Expressions.
23928 * typemanager.cs (CSharpName): Returns the C# name of a type if
23931 * expression.cs (Expression::ConvertImplicit): New function that
23932 implements implicit type conversions.
23934 (Expression::ImplicitReferenceConversion): Implements implicit
23935 reference conversions.
23937 (EmptyCast): New type for transparent casts.
23939 (OpcodeCast): New type for casts of types that are performed with
23940 a sequence of bytecodes.
23942 (BoxedCast): New type used for casting value types into reference
23943 types. Emits a box opcode.
23945 (Binary::DoNumericPromotions): Implements numeric promotions of
23946 and computation of the Binary::Type.
23948 (Binary::EmitBranchable): Optimization.
23950 (Binary::Emit): Implement code emission for expressions.
23952 * typemanager.cs (TypeManager): Added two new core types: sbyte
23955 2001-09-12 Ravi Pratap <ravi@ximian.com>
23957 * class.cs (TypeContainer::FindMembers): Method which does exactly
23958 what Type.FindMembers does, only we don't have to use reflection. No
23959 implementation yet.
23961 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23962 typecontainer objects as we need to get at them.
23963 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23965 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23966 typecontainer object.
23968 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23969 of just a Report object.
23971 2001-09-11 Ravi Pratap <ravi@ximian.com>
23973 * class.cs (Event::Define): Go back to using the prefixes "add_" and
23975 (TypeContainer::Populate): Now define the delegates of the type too.
23976 (TypeContainer.Delegates): Property to access the list of delegates defined
23979 * delegates.cs (Delegate::Define): Implement partially.
23981 * modifiers.cs (TypeAttr): Handle more flags.
23983 2001-09-11 Ravi Pratap <ravi@ximian.com>
23985 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23987 (Operator::Define): Re-write logic to get types by using the LookupType method
23988 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23989 (Indexer::Define): Ditto.
23990 (Event::Define): Ditto.
23991 (Property::Define): Ditto.
23993 2001-09-10 Ravi Pratap <ravi@ximian.com>
23995 * class.cs (TypeContainer::Populate): Now define operators too.
23996 (TypeContainer.Operators): New property to access the list of operators
23998 (Operator.OperatorMethodBuilder): New member to hold the method builder
23999 for the operator we are defining.
24000 (Operator::Define): Implement.
24002 2001-09-10 Ravi Pratap <ravi@ximian.com>
24004 * class.cs (Event::Define): Make the prefixes of the accessor methods
24005 addOn_ and removeOn_
24007 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24008 of the location being passed in too. Ideally, this should go later since all
24009 error reporting should be done through the Report object.
24011 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24012 (Populate): Iterate thru the indexers we have and define them too.
24013 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24014 for the get and set accessors.
24015 (Indexer::Define): Implement.
24017 2001-09-09 Miguel de Icaza <miguel@ximian.com>
24019 * expression.cs (Binary::Resolve): Beginning of it. I scratched
24020 my previous implementation, did not work.
24022 * typemanager.cs: Add a couple of missing types (the longs).
24024 * literal.cs: Use TypeManager.bool_type instead of getting it.
24026 * expression.cs (EventExpr): New kind of expressions.
24027 (Expressio::ExprClassFromMemberInfo): finish
24029 2001-09-08 Miguel de Icaza <miguel@ximian.com>
24031 * assign.cs: Emit stores to static fields differently.
24033 2001-09-08 Ravi Pratap <ravi@ximian.com>
24035 * Merge in changes and adjust code to tackle conflicts. Backed out my
24036 code in Assign::Resolve ;-)
24038 2001-09-08 Ravi Pratap <ravi@ximian.com>
24040 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24041 instead Report.Error and also pass in the location.
24042 (CSharpParser::Lexer): New readonly property to return the reference
24043 to the Tokenizer object.
24044 (declare_local_variables): Use Report.Error with location instead of plain
24048 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24049 (Operator.CheckBinaryOperator): Ditto.
24051 * cs-parser.jay (operator_declarator): Update accordingly.
24053 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24054 (CheckBinaryOperator): Same here.
24056 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24057 on the name without any prefixes of namespace names etc. This is because we
24058 already might have something already fully qualified like
24059 'System.Console.WriteLine'
24061 * assign.cs (Resolve): Begin implementation. Stuck ;-)
24063 2001-09-07 Ravi Pratap <ravi@ximian.com>
24065 * cs-tokenizer.cs (location): Return a string which also contains
24068 * expression.cs (ElementAccess): New class for expressions of the
24069 type 'element access.'
24070 (BaseAccess): New class for expressions of the type 'base access.'
24071 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24074 * cs-parser.jay (element_access): Implement action.
24075 (base_access): Implement actions.
24076 (checked_expression, unchecked_expression): Implement.
24078 * cs-parser.jay (local_variable_type): Correct and implement.
24079 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24081 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24083 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24084 name and the specifiers.
24086 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24088 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
24089 making them all public ;-)
24091 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24094 2001-09-07 Miguel de Icaza <miguel@ximian.com>
24096 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24098 (FieldExpr, PropertyExprs): New resolved expressions.
24099 (SimpleName::MemberStaticCheck): Perform static checks for access
24100 to non-static fields on static methods. Maybe this should be
24101 generalized for MemberAccesses.
24102 (SimpleName::ResolveSimpleName): More work on simple name
24105 * cs-parser.jay (primary_expression/qualified_identifier): track
24106 the parameter index.
24108 * codegen.cs (CodeGen::Save): Catch save exception, report error.
24109 (EmitContext::EmitBoolExpression): Chain to expression generation
24110 instead of temporary hack.
24111 (::EmitStatementExpression): Put generic expression code generation.
24113 * assign.cs (Assign::Emit): Implement variable assignments to
24114 local variables, parameters and fields.
24116 2001-09-06 Miguel de Icaza <miguel@ximian.com>
24118 * statement.cs (Block::GetVariableInfo): New method, returns the
24119 VariableInfo for a variable name in a block.
24120 (Block::GetVariableType): Implement in terms of GetVariableInfo
24122 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24123 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24125 2001-09-06 Ravi Pratap <ravi@ximian.com>
24127 * cs-parser.jay (operator_declaration): Continue on my quest : update
24128 to take attributes argument.
24129 (event_declaration): Ditto.
24130 (enum_declaration): Ditto.
24131 (indexer_declaration): Ditto.
24133 * class.cs (Operator::Operator): Update constructor accordingly.
24134 (Event::Event): Ditto.
24136 * delegate.cs (Delegate::Delegate): Same here.
24138 * enum.cs (Enum::Enum): Same here.
24140 2001-09-05 Ravi Pratap <ravi@ximian.com>
24142 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24144 * ../tests/cs0658.cs : New file to demonstrate error 0658.
24146 * attribute.cs (Attributes): New class to encapsulate all attributes which were
24147 being passed around as an arraylist.
24148 (Attributes::AddAttribute): Method to add attribute sections.
24150 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24151 (struct_declaration): Update accordingly.
24152 (constant_declaration): Update.
24153 (field_declaration): Update.
24154 (method_header): Update.
24155 (fixed_parameter): Update.
24156 (parameter_array): Ditto.
24157 (property_declaration): Ditto.
24158 (destructor_declaration): Ditto.
24160 * class.cs (Struct::Struct): Update constructors accordingly.
24161 (Class::Class): Ditto.
24162 (Field::Field): Ditto.
24163 (Method::Method): Ditto.
24164 (Property::Property): Ditto.
24165 (TypeContainer::OptAttribute): update property's return type.
24167 * interface.cs (Interface.opt_attributes): New member.
24168 (Interface::Interface): Update to take the extra Attributes argument.
24170 * parameter.cs (Parameter::Parameter): Ditto.
24172 * constant.cs (Constant::Constant): Ditto.
24174 * interface.cs (InterfaceMemberBase): New OptAttributes field.
24175 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
24176 the attributes as a parameter.
24177 (InterfaceProperty): Update constructor call.
24178 (InterfaceEvent): Ditto.
24179 (InterfaceMethod): Ditto.
24180 (InterfaceIndexer): Ditto.
24182 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
24183 pass the attributes too.
24184 (interface_event_declaration): Ditto.
24185 (interface_property_declaration): Ditto.
24186 (interface_method_declaration): Ditto.
24187 (interface_declaration): Ditto.
24189 2001-09-05 Miguel de Icaza <miguel@ximian.com>
24191 * class.cs (Method::Define): Track the "static Main" definition to
24192 create an entry point.
24194 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24195 EntryPoint if we find it.
24197 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24198 (EmitContext::ig): Make this variable public.
24200 * driver.cs: Make the default output file be the first file name
24201 with the .exe extension.
24203 Detect empty compilations
24205 Handle various kinds of output targets. Handle --target and
24206 rename -t to --dumper.
24208 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24209 methods inherited from Expression return now an Expression. This
24210 will is used during the tree rewriting as we resolve them during
24213 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24214 the spec. Missing entirely is the information about
24215 accessability of elements of it.
24217 (Expression::ExprClassFromMemberInfo): New constructor for
24218 Expressions that creates a fully initialized Expression based on
24219 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24222 (Invocation::Resolve): Begin implementing resolution of invocations.
24224 * literal.cs (StringLiteral): Implement Emit.
24226 2001-09-05 Ravi Pratap <ravi@ximian.com>
24228 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24231 2001-09-04 Ravi Pratap <ravi@ximian.com>
24233 * cs-parser.jay (attribute_arguments): Implement actions.
24234 (attribute): Fix bug in production. Implement action.
24235 (attribute_list): Implement.
24236 (attribute_target): Implement.
24237 (attribute_target_specifier, opt_target_specifier): Implement
24238 (CheckAttributeTarget): New method to check if the attribute target
24240 (attribute_section): Implement.
24241 (opt_attributes): Implement.
24243 * attribute.cs : New file to handle attributes.
24244 (Attribute): Class to hold attribute info.
24246 * cs-parser.jay (opt_attribute_target_specifier): Remove production
24247 (attribute_section): Modify production to use 2 different rules to
24248 achieve the same thing. 1 s/r conflict down !
24249 Clean out commented, useless, non-reducing dimension_separator rules.
24251 * class.cs (TypeContainer.attributes): New member to hold list
24252 of attributes for a type.
24253 (Struct::Struct): Modify to take one more argument, the attribute list.
24254 (Class::Class): Ditto.
24255 (Field::Field): Ditto.
24256 (Method::Method): Ditto.
24257 (Property::Property): Ditto.
24259 * cs-parser.jay (struct_declaration): Update constructor call to
24260 pass in the attributes too.
24261 (class_declaration): Ditto.
24262 (constant_declaration): Ditto.
24263 (field_declaration): Ditto.
24264 (method_header): Ditto.
24265 (fixed_parameter): Ditto.
24266 (parameter_array): Ditto.
24267 (property_declaration): Ditto.
24269 * constant.cs (Constant::Constant): Update constructor similarly.
24270 Use System.Collections.
24272 * parameter.cs (Parameter::Parameter): Update as above.
24274 2001-09-02 Ravi Pratap <ravi@ximian.com>
24276 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24277 (TypeContainer.delegates): New member to hold list of delegates.
24279 * cs-parser.jay (delegate_declaration): Implement the action correctly
24280 this time as I seem to be on crack ;-)
24282 2001-09-02 Miguel de Icaza <miguel@ximian.com>
24284 * rootcontext.cs (RootContext::IsNamespace): new function, used to
24285 tell whether an identifier represents a namespace.
24287 * expression.cs (NamespaceExpr): A namespace expression, used only
24288 temporarly during expression resolution.
24289 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24290 utility functions to resolve names on expressions.
24292 2001-09-01 Miguel de Icaza <miguel@ximian.com>
24294 * codegen.cs: Add hook for StatementExpressions.
24296 * class.cs: Fix inverted test for static flag in methods.
24298 2001-09-02 Ravi Pratap <ravi@ximian.com>
24300 * class.cs (Operator::CheckUnaryOperator): Correct error number used
24301 to make it coincide with MS' number.
24302 (Operator::CheckBinaryOperator): Ditto.
24304 * ../errors/errors.txt : Remove error numbers added earlier.
24306 * ../errors/cs1019.cs : Test case for error # 1019
24308 * ../errros/cs1020.cs : Test case for error # 1020
24310 * cs-parser.jay : Clean out commented cruft.
24311 (dimension_separators, dimension_separator): Comment out. Ostensibly not
24312 used anywhere - non-reducing rule.
24313 (namespace_declarations): Non-reducing rule - comment out.
24315 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24316 with TypeContainer::AddEnum.
24318 * delegate.cs : New file for delegate handling classes.
24319 (Delegate): Class for declaring delegates.
24321 * makefile : Update.
24323 * cs-parser.jay (delegate_declaration): Implement.
24325 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
24327 * class.cs (Event::Define): Implement.
24328 (Event.EventBuilder): New member.
24330 * class.cs (TypeContainer::Populate): Update to define all enums and events
24332 (Events): New property for the events arraylist we hold. Shouldn't we move to using
24333 readonly fields for all these cases ?
24335 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24337 * class.cs (Property): Revamp to use the convention of making fields readonly.
24338 Accordingly modify code elsewhere.
24340 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24341 the Define method of the Property class.
24343 * class.cs : Clean up applied patch and update references to variables etc. Fix
24345 (TypeContainer::Populate): Update to define all the properties we have. Also
24346 define all enumerations.
24348 * enum.cs (Define): Implement.
24350 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24352 * cs-parser.jay (overloadable_operator): The semantic value is an
24353 enum of the Operator class.
24354 (operator_declarator): Implement actions.
24355 (operator_declaration): Implement.
24357 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24358 validity of definitions.
24359 (Operator::CheckBinaryOperator): Static method to check for binary operators
24360 (TypeContainer::AddOperator): New method to add an operator to a type.
24362 * cs-parser.jay (indexer_declaration): Added line to actually call the
24363 AddIndexer method so it gets added ;-)
24365 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
24366 already taken care of by the MS compiler ?
24368 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24370 * class.cs (Operator): New class for operator declarations.
24371 (Operator::OpType): Enum for the various operators.
24373 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24375 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24376 ostensibly handle this in semantic analysis.
24378 * cs-parser.jay (general_catch_clause): Comment out
24379 (specific_catch_clauses, specific_catch_clause): Ditto.
24380 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24381 (catch_args, opt_catch_args): New productions.
24382 (catch_clause): Rewrite to use the new productions above
24383 (catch_clauses): Modify accordingly.
24384 (opt_catch_clauses): New production to use in try_statement
24385 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24386 and re-write the code in the actions to extract the specific and
24387 general catch clauses by being a little smart ;-)
24389 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24390 Hooray, try and catch statements parse fine !
24392 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24394 * statement.cs (Block::GetVariableType): Fix logic to extract the type
24395 string from the hashtable of variables.
24397 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24398 I end up making that mistake ;-)
24399 (catch_clauses): Fixed gross error which made Key and Value of the
24400 DictionaryEntry the same : $1 !!
24402 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24404 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24406 * cs-parser.jay (event_declaration): Correct to remove the semicolon
24407 when the add and remove accessors are specified.
24409 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24411 * cs-parser.jay (IndexerDeclaration): New helper class to hold
24412 information about indexer_declarator.
24413 (indexer_declarator): Implement actions.
24414 (parsing_indexer): New local boolean used to keep track of whether
24415 we are parsing indexers or properties. This is necessary because
24416 implicit_parameters come into picture even for the get accessor in the
24417 case of an indexer.
24418 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24420 * class.cs (Indexer): New class for indexer declarations.
24421 (TypeContainer::AddIndexer): New method to add an indexer to a type.
24422 (TypeContainer::indexers): New member to hold list of indexers for the
24425 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24427 * cs-parser.jay (add_accessor_declaration): Implement action.
24428 (remove_accessor_declaration): Implement action.
24429 (event_accessors_declaration): Implement
24430 (variable_declarators): swap statements for first rule - trivial.
24432 * class.cs (Event): New class to hold information about event
24434 (TypeContainer::AddEvent): New method to add an event to a type
24435 (TypeContainer::events): New member to hold list of events.
24437 * cs-parser.jay (event_declaration): Implement actions.
24439 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24441 * cs-parser.jay (dim_separators): Implement. Make it a string
24442 concatenating all the commas together, just as they appear.
24443 (opt_dim_separators): Modify accordingly
24444 (rank_specifiers): Update accordingly. Basically do the same
24445 thing - instead, collect the brackets here.
24446 (opt_rank_sepcifiers): Modify accordingly.
24447 (array_type): Modify to actually return the complete type string
24448 instead of ignoring the rank_specifiers.
24449 (expression_list): Implement to collect the expressions
24450 (variable_initializer): Implement. We make it a list of expressions
24451 essentially so that we can handle the array_initializer case neatly too.
24452 (variable_initializer_list): Implement.
24453 (array_initializer): Make it a list of variable_initializers
24454 (opt_array_initializer): Modify accordingly.
24456 * expression.cs (New::NType): Add enumeration to help us
24457 keep track of whether we have an object/delegate creation
24458 or an array creation.
24459 (New:NewType, New::Rank, New::Indices, New::Initializers): New
24460 members to hold data about array creation.
24461 (New:New): Modify to update NewType
24462 (New:New): New Overloaded contructor for the array creation
24465 * cs-parser.jay (array_creation_expression): Implement to call
24466 the overloaded New constructor.
24468 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
24470 * class.cs (TypeContainer::Constructors): Return member
24471 constructors instead of returning null.
24473 2001-08-26 Miguel de Icaza <miguel@ximian.com>
24475 * typemanager.cs (InitCoreTypes): Initialize the various core
24476 types after we have populated the type manager with the user
24477 defined types (this distinction will be important later while
24478 compiling corlib.dll)
24480 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24481 on Expression Classification. Now all expressions have a method
24482 `Resolve' and a method `Emit'.
24484 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24485 generation from working. Also add some temporary debugging
24488 2001-08-24 Miguel de Icaza <miguel@ximian.com>
24490 * codegen.cs: Lots of code generation pieces. This is only the
24491 beginning, will continue tomorrow with more touches of polish. We
24492 handle the fundamentals of if, while, do, for, return. Others are
24493 trickier and I need to start working on invocations soon.
24495 * gen-treedump.cs: Bug fix, use s.Increment here instead of
24498 * codegen.cs (EmitContext): New struct, used during code
24499 emission to keep a context. Most of the code generation will be
24502 * cs-parser.jay: Add embedded blocks to the list of statements of
24503 this block. So code generation proceeds in a top down fashion.
24505 2001-08-23 Miguel de Icaza <miguel@ximian.com>
24507 * statement.cs: Add support for multiple child blocks.
24509 2001-08-22 Miguel de Icaza <miguel@ximian.com>
24511 * codegen.cs (EmitCode): New function, will emit the code for a
24512 Block of code given a TypeContainer and its ILGenerator.
24514 * statement.cs (Block): Standard public readonly optimization.
24515 (Block::Block constructors): Link children.
24516 (Block::Child): Child Linker.
24517 (Block::EmitVariables): Emits IL variable declarations.
24519 * class.cs: Drop support for MethodGroups here, delay until
24521 (Method::): Applied the same simplification that I did before, and
24522 move from Properties to public readonly fields.
24523 (Method::ParameterTypes): Returns the parameter types for the
24524 function, and implements a cache that will be useful later when I
24525 do error checking and the semantic analysis on the methods is
24527 (Constructor::GetCallingConvention): Renamed from CallingConvetion
24528 and made a method, optional argument tells whether this is a class
24529 or a structure to apply the `has-this' bit.
24530 (Method::GetCallingConvention): Implement, returns the calling
24532 (Method::Define): Defines the type, a second pass is performed
24533 later to populate the methods.
24535 (Constructor::ParameterTypes): implement a cache similar to the
24536 one on Method::ParameterTypes, useful later when we do semantic
24539 (TypeContainer::EmitMethod): New method. Emits methods.
24541 * expression.cs: Removed MethodGroup class from here.
24543 * parameter.cs (Parameters::GetCallingConvention): new method.
24545 2001-08-21 Miguel de Icaza <miguel@ximian.com>
24547 * class.cs (TypeContainer::Populate): Drop RootContext from the
24550 (Constructor::CallingConvention): Returns the calling convention.
24551 (Constructor::ParameterTypes): Returns the constructor parameter
24554 (TypeContainer::AddConstructor): Keep track of default constructor
24555 and the default static constructor.
24557 (Constructor::) Another class that starts using `public readonly'
24558 instead of properties.
24560 (Constructor::IsDefault): Whether this is a default constructor.
24562 (Field::) use readonly public fields instead of properties also.
24564 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24565 track of static constructors; If none is used, turn on
24566 BeforeFieldInit in the TypeAttributes.
24568 * cs-parser.jay (opt_argument_list): now the return can be null
24569 for the cases where there are no arguments.
24571 (constructor_declarator): If there is no implicit `base' or
24572 `this', then invoke the default parent constructor.
24574 * modifiers.cs (MethodAttr): New static function maps a set of
24575 modifiers flags into a MethodAttributes enum
24576 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
24577 MethodAttr, TypeAttr to represent the various mappings where the
24578 modifiers are used.
24579 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
24581 2001-08-19 Miguel de Icaza <miguel@ximian.com>
24583 * parameter.cs (GetParameterInfo): Fix bug where there would be no
24586 * interface.cs (PopulateIndexer): Implemented the code generator
24587 for interface indexers.
24589 2001-08-17 Miguel de Icaza <miguel@ximian.com>
24591 * interface.cs (InterfaceMemberBase): Now we track the new status
24594 (PopulateProperty): Implement property population. Woohoo! Got
24595 Methods and Properties going today.
24597 Removed all the properties for interfaces, and replaced them with
24598 `public readonly' fields.
24600 2001-08-16 Miguel de Icaza <miguel@ximian.com>
24602 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24603 initialize their hashtables/arraylists only when they are needed
24604 instead of doing this always.
24606 * parameter.cs: Handle refs and out parameters.
24608 * cs-parser.jay: Use an ArrayList to construct the arguments
24609 instead of the ParameterCollection, and then cast that to a
24612 * parameter.cs: Drop the use of ParameterCollection and use
24613 instead arrays of Parameters.
24615 (GetParameterInfo): Use the Type, not the Name when resolving
24618 2001-08-13 Miguel de Icaza <miguel@ximian.com>
24620 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24621 and instead use public readonly fields.
24623 * class.cs: Put back walking code for type containers.
24625 2001-08-11 Miguel de Icaza <miguel@ximian.com>
24627 * class.cs (MakeConstant): Code to define constants.
24629 * rootcontext.cs (LookupType): New function. Used to locate types
24632 2001-08-08 Miguel de Icaza <miguel@ximian.com>
24634 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
24635 this System.Reflection code is. Kudos to Microsoft
24637 * typemanager.cs: Implement a type cache and avoid loading all
24638 types at boot time. Wrap in LookupType the internals. This made
24639 the compiler so much faster. Wow. I rule!
24641 * driver.cs: Make sure we always load mscorlib first (for
24642 debugging purposes, nothing really important).
24644 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
24645 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
24647 * rootcontext.cs: Lookup types on their namespace; Lookup types
24648 on namespaces that have been imported using the `using' keyword.
24650 * class.cs (TypeContainer::TypeAttr): Virtualize.
24651 (Class::TypeAttr): Return attributes suitable for this bad boy.
24652 (Struct::TypeAttr): ditto.
24653 Handle nested classes.
24654 (TypeContainer::) Remove all the type visiting code, it is now
24655 replaced with the rootcontext.cs code
24657 * rootcontext.cs (GetClassBases): Added support for structs.
24659 2001-08-06 Miguel de Icaza <miguel@ximian.com>
24661 * interface.cs, statement.cs, class.cs, parameter.cs,
24662 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24663 Drop use of TypeRefs, and use strings instead.
24665 2001-08-04 Miguel de Icaza <miguel@ximian.com>
24669 * class.cs (Struct::Struct): set the SEALED flags after
24670 checking the modifiers.
24671 (TypeContainer::TypeAttr): new property, returns the
24672 TypeAttributes for a class.
24674 * cs-parser.jay (type_list): Oops, list production was creating a
24675 new list of base types.
24677 * rootcontext.cs (StdLib): New property.
24678 (GetInterfaceTypeByName): returns an interface by type name, and
24679 encapsulates error handling here.
24680 (GetInterfaces): simplified.
24681 (ResolveTree): Encapsulated all the tree resolution here.
24682 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24685 * driver.cs: Add support for --nostdlib, to avoid loading the
24686 default assemblies.
24687 (Main): Do not put tree resolution here.
24689 * rootcontext.cs: Beginning of the class resolution.
24691 2001-08-03 Miguel de Icaza <miguel@ximian.com>
24693 * rootcontext.cs: Provide better error reporting.
24695 * cs-parser.jay (interface_base): set our $$ to be interfaces.
24697 * rootcontext.cs (CreateInterface): Handle the case where there
24698 are no parent interfaces.
24700 (CloseTypes): Routine to flush types at the end.
24701 (CreateInterface): Track types.
24702 (GetInterfaces): Returns an array of Types from the list of
24703 defined interfaces.
24705 * typemanager.c (AddUserType): Mechanism to track user types (puts
24706 the type on the global type hash, and allows us to close it at the
24709 2001-08-02 Miguel de Icaza <miguel@ximian.com>
24711 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24712 RecordInterface instead.
24714 * cs-parser.jay: Updated to reflect changes above.
24716 * decl.cs (Definition): Keep track of the TypeBuilder type that
24717 represents this type here. Not sure we will use it in the long
24718 run, but wont hurt for now.
24720 * driver.cs: Smaller changes to accomodate the new code.
24722 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24725 * rootcontext.cs (CreateInterface): New method, used to create
24726 the System.TypeBuilder type for interfaces.
24727 (ResolveInterfaces): new entry point to resolve the interface
24729 (CodeGen): Property, used to keep track of the code generator.
24731 2001-07-26 Miguel de Icaza <miguel@ximian.com>
24733 * cs-parser.jay: Add a second production for delegate_declaration
24736 (enum_body): Put an opt_comma here instead of putting it on
24737 enum_body or enum_member_declarations so we can handle trailing
24738 commas on enumeration members. Gets rid of a shift/reduce.
24740 (type_list): Need a COMMA in the middle.
24742 (indexer_declaration): Tell tokenizer to recognize get/set
24744 * Remove old targets.
24746 * Re-add the parser target.
24748 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24750 * cs-parser.jay: Add precendence rules for a number of operators
24751 ot reduce the number of shift/reduce conflicts in the grammar.
24753 2001-07-17 Miguel de Icaza <miguel@ximian.com>
24755 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24758 Get rid of old crufty code.
24760 * rootcontext.cs: Use this to keep track of the parsed
24761 representation and the defined types available to the program.
24763 * gen-treedump.cs: adjust for new convention.
24765 * type.cs: Split out the type manager, and the assembly builder
24768 * typemanager.cs: the type manager will live here now.
24770 * cil-codegen.cs: And the code generator here.
24772 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
24774 * makefile: Fixed up for easy making.
24776 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24778 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24781 (unary_expression): Expand pre_increment_expression and
24782 post_decrement_expression to reduce a shift/reduce.
24784 2001-07-11 Simon Cozens
24786 * cs-tokenizer.cs: Hex numbers should begin with a 0.
24788 Improve allow_keyword_as_indent name.
24790 2001-06-19 Miguel de Icaza <miguel@ximian.com>
24792 * Adjustments for Beta2.
24794 2001-06-13 Miguel de Icaza <miguel@ximian.com>
24796 * decl.cs: Added `Define' abstract method.
24797 (InTransit): new property, used to catch recursive definitions.
24799 * interface.cs: Implement `Define'.
24801 * modifiers.cs: Map Modifiers.constants to
24802 System.Reflection.TypeAttribute flags.
24804 * class.cs: Keep track of types and user-defined types.
24805 (BuilderInit): New method for creating an assembly
24806 (ResolveType): New function to launch the resolution process, only
24807 used by interfaces for now.
24809 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24810 that are inserted into the name space.
24812 2001-06-08 Miguel de Icaza <miguel@ximian.com>
24814 * ARGH. I have screwed up my tree so many times due to the use of
24815 rsync rather than using CVS. Going to fix this at once.
24817 * driver.cs: Objetify driver. Load assemblies, use assemblies to
24820 2001-06-07 Miguel de Icaza <miguel@ximian.com>
24822 * Experiment successful: Use System.Type rather that our own
24825 2001-05-25 Miguel de Icaza <miguel@ximian.com>
24827 * cs-parser.jay: Removed nsAliases from here.
24829 Use new namespaces, handle `using XXX;'
24831 * namespace.cs: Reimplemented namespace handling, use a recursive
24832 definition of the class. Now we can keep track of using clauses
24833 and catch invalid using clauses.
24835 2001-05-24 Miguel de Icaza <miguel@ximian.com>
24837 * gen-treedump.cs: Adapted for all the renaming.
24839 * expression.cs (Expression): this class now has a Type property
24840 which returns an expression Type.
24842 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24843 `Type', as this has a different meaning now in the base
24845 2001-05-22 Miguel de Icaza <miguel@ximian.com>
24847 * interface.cs, class.cs: Removed from all the sources the
24848 references to signature computation, as we can not do method
24849 signature computation during the parsing time, as we are not
24850 trying to solve at that point distinguishing:
24854 void a (NS.Blah x) {}
24857 Which depending on the context might be valid or not, as we do not
24858 know if Blah is the same thing as NS.Blah at that point.
24860 * Redid everything so the code uses TypeRefs now instead of
24861 Types. TypeRefs are just temporary type placeholders, that need
24862 to be resolved. They initially have a pointer to a string and the
24863 current scope in which they are used. This is used later by the
24864 compiler to resolve the reference to an actual Type.
24866 * DeclSpace is no longer a CIR.Type, and neither are
24867 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
24868 are all DeclSpaces, but no Types.
24870 * type.cs (TypeRefManager): This implements the TypeRef manager,
24871 which keeps track of all the types that need to be resolved after
24872 the parsing has finished.
24874 2001-05-13 Miguel de Icaza <miguel@ximian.com>
24876 * ARGH. We are going to have to store `foreach' as a class rather
24877 than resolving it, as we need to verify error 1579 after name
24878 resolution. *OR* we could keep a flag that says `This request to
24879 IEnumerator comes from a foreach statement' which we can then use
24880 to generate the error.
24882 2001-05-10 Miguel de Icaza <miguel@ximian.com>
24884 * class.cs (TypeContainer.AddMethod): we now add methods to the
24885 MethodGroup instead of the method hashtable.
24887 * expression.cs: Add MethodGroup abstraction, which gets us one
24888 step closer to the specification in the way we handle method
24891 * cs-parser.jay (primary_expression): qualified_identifier now
24892 tried to match up an identifier to a local variable reference or
24893 to a parameter reference.
24895 current_local_parameters is now a parser global variable that
24896 points to the current parameters for the block, used during name
24899 (property_declaration): Now creates an implicit `value' argument to
24902 2001-05-09 Miguel de Icaza <miguel@ximian.com>
24904 * parameter.cs: Do not use `param' arguments as part of the
24905 signature, per the spec.
24907 2001-05-08 Miguel de Icaza <miguel@ximian.com>
24909 * decl.cs: Base class for classes, structs and interfaces. This
24910 is the "Declaration Space"
24912 * cs-parser.jay: Use CheckDef for checking declaration errors
24913 instead of having one on each function.
24915 * class.cs: Factor out some code for handling error handling in
24916 accordance to the "Declarations" section in the "Basic Concepts"
24917 chapter in the ECMA C# spec.
24919 * interface.cs: Make all interface member classes derive from
24920 InterfaceMemberBase.
24922 2001-05-07 Miguel de Icaza <miguel@ximian.com>
24924 * Many things: all interfaces are parsed and generated in
24925 gen-treedump. Support for member variables, constructors,
24926 destructors, properties, constants is there.
24928 Beginning of the IL backend, but very little done, just there for
24931 2001-04-29 Miguel de Icaza <miguel@ximian.com>
24933 * cs-parser.jay: Fix labeled statement.
24935 * cs-tokenizer.cs (escape): Escape " and ' always.
24936 ref_line, ref_name: keep track of the line/filename as instructed
24937 by #line by the compiler.
24940 2001-04-27 Miguel de Icaza <miguel@ximian.com>
24942 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24943 to match the values in System.CodeDOM.
24945 Divid renamed to Divide.
24947 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24949 (Statements.set): remove.
24951 * System.CodeDOM/CodeCatchClause.cs: always have a valid
24954 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24955 falseStatements always have valid values.
24957 * cs-parser.jay: Use System.CodeDOM now.