1 2007-02-12 Marek Safar <marek.safar@gmail.com>
4 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
7 * class.cs (DefineFieldInitializers): Each initializer can has different
12 2007-02-11 Miguel de Icaza <miguel@novell.com>
14 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
15 now all the heavy lifting to check that embedded statements or
16 expressions have the right form is done in the ContextualReturn.
18 (ContextualReturn): New class.
20 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
21 method that can be invoked to report 201, so we do not replicate
24 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
26 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
27 treating tabs as spaces.
29 2007-02-09 Marek Safar <marek.safar@gmail.com>
31 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
32 * assign.cs: Use full implicit conversion for right side check.
34 2007-02-09 Marek Safar <marek.safar@gmail.com>
36 * statement.cs (Switch): Switch over boolean type is not standardized.
38 2007-02-08 Marek Safar <marek.safar@gmail.com>
41 * decl.cs (FindBaseEvent): Don't use method cache for events.
43 2007-02-07 Marek Safar <marek.safar@gmail.com>
45 * cs-parser.jay: Better syntax error handling.
47 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
48 instead of underlying type value.
50 2007-02-06 Marek Safar <marek.safar@gmail.com>
52 * driver.cs: Check define identifier before is registered.
54 * namespace.cs: Use existing error message.
56 * report.cs: New warning.
58 2007-02-06 Marek Safar <marek.safar@gmail.com>
61 * expression.cs: Delegate Invoke method can be called directly.
63 2007-02-06 Marek Safar <marek.safar@gmail.com>
66 * class.cs (IsEntryPoint): The Main method can have params modifier.
68 2007-02-04 Miguel de Icaza <miguel@novell.com>
70 * parameter.cs (Parameter, Parameters): Add Clone method.
72 * anonymous.cs (Compatible): Turn method into virtual method, so
73 LambdaExpression can implement a different behavior.
75 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
76 out the basic checking here, so it can be used by
79 * lambda.cs: Introduce "Compatible" function that will do the
82 2007-02-02 Marek Safar <marek.safar@gmail.com>
84 * attribute.cs: Unified one error message.
86 * class.cs (Class): Use type attributes and not properties to test static
88 (IsEntryPoint): Don's pass local variable.
90 * convert.cs: Removed duplicate check.
92 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
94 * driver.cs: Don't crash when soft reference does not exist.
96 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
97 (UsingEntry): Removed redundant allocation.
99 * parameter.cs: Add fast path for type parameters.
101 * support.cs: Don't allocate attribute when it's not used.
103 2007-01-30 Miguel de Icaza <miguel@novell.com>
106 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
107 this into a virtual method, so we can override it in LambdaExpression.
109 * driver.cs: Improve diagnostics in case of failure.
111 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
112 write a function that is slightly more complex and that parses:
114 type identifier [, type identifier]* )
116 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
119 (canEmpty ? i >= 0 : i > 0)
121 2007-01-30 Raja R Harinath <rharinath@novell.com>
123 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
124 exception on possibly valid code.
126 2007-01-29 Raja R Harinath <rharinath@novell.com>
128 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
130 (parse_opt_type_arguments): Remove. It's almost the same as
132 (parse_namespace_or_typename): Use parse_less_than.
134 2007-01-28 Miguel de Icaza <miguel@novell.com>
136 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
137 this bug took a few hours to find, because the state saved and
138 restored by PushPosition and PopPosition was ignoring the state of
139 parse_generic_less_than.
141 I can also now remove the handling of OP_LT and OP_GT, this solves
144 * cs-tokenizer.cs: store the location for the ARROW token, we use
147 (PushPosition, PopPosition): save/restore also `current_token',
148 restore `parse_generic_less_than' (was missing).
150 (parse_opt_type_arguments): use parse_type, not
151 parse_namespace_or_typename to parse types.
153 * lambda.cs: Empty new file, will eventually have the lambda
154 expression implementation.
156 * lambda.test: used to test the internal tokenizer.
158 * report.cs (FeatureIsNotISO1): Rename from
159 FeatureIsNotStandardized, because it was about the language level
160 (1 vs 2) it was not about standarization.
162 (FeatureRequiresLINQ): New.
164 * support.cs (SeekableStreamReader): Only require that the reader
165 is a TextReader, not a StreamReader, so we can plug StringReader.
167 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
168 given position in the input stream the following tokens can be
169 parsed as a type followed by an identifier.
171 (is_punct): after a '(' if parse_type_and_parameter returns true,
172 then return a special token OPEN_PARENS_LAMBDA which is used to
173 avoid reduce/reduce errors in the grammar for the
174 lambda_expression rules.
176 (parse_type): implement a type parser inside the
177 tokenizer, the parser only returns true or false depending on
178 whether the input at a given position can be parsed as a type.
180 (peek_token): new method used during type parsing.
182 2007-01-28 Raja R Harinath <rharinath@novell.com>
185 * anonymous.cs (ScopeInfo.InflateParameters): New.
186 (AnonymousContainer.Resolve): Use it to redirect types of
189 2007-01-27 Raja R Harinath <rharinath@novell.com>
192 * expression.cs (Error_InvalidArguments): Don't use two different
193 messages for CS1503. Use ExtraInformation and
194 SymbolRelatedToPreviousError instead.
197 * decl.cs (DeclSpace.initialize_type_params): Don't access
198 'type_params' of a partial class directly.
200 2007-01-26 Miguel de Icaza <miguel@novell.com>
202 * constant.cs: Removed a handful of out-of-range checks that were
205 2007-01-25 Marek Safar <marek.safar@gmail.com>
207 * expression.cs (CheckUselessComparison): Add additional check for char
210 * namespace.cs: Fixed typo.
212 2007-01-23 Miguel de Icaza <miguel@novell.com>
214 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
215 gone, instead we inline the test, preventing the needless casts to
216 longs, ulongs and doubles for the parameters, avoiding calls to
217 methods that overchecked stuff, and instead inlined things
220 2007-01-20 Marek Safar <marek.safar@gmail.com>
222 * cs-parser.jay: Better parameter error handling.
224 2007-01-17 Marek Safar <marek.safar@gmail.com>
226 A fix for bug #80368, #80522
227 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
228 whether array initializer contains constants only.
229 (ArrayCreation.Emit): Use better formula to decide when
230 are array initializers for static initialization.
231 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
232 have to emit even constants otherwise they are pre-initialized.
234 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
235 Raja R Harinath <rharinath@novell.com>
237 Fix emit order of 'get' vs. 'set'.
238 * support.cs (Accessors): New.
239 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
240 Note the order in which accessors are declared in the source.
241 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
242 Refactored from Property.Define and Indexer.Define.
243 (PropertyBase.DefineAccessors): New helper that calls the above in
244 appropriate order as noted by the parser.
245 (Property.Define, Indexer.Define): Update to changes.
246 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
248 2007-01-17 Raja R Harinath <rharinath@novell.com>
250 Fix cs0029-6.cs and gcs0029-2.cs (regression)
251 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
252 there's an implicit conversion from the current type to the target
253 type before converting the underlying constant.
255 2007-01-16 Marek Safar <marek.safar@gmail.com>
257 * const.cs (ResolveValue): Updated after constant conversion was made more
260 * constant.cs (GetAttributableValue): constant to object conversion is
261 used for attributes only.
262 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
263 constant conversions.
264 (LongConstant.ConvertImplicitly): Ditto.
266 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
267 (ImplicitConversionStandard): Handle constant conversion as extra step.
268 It solves the issue when constant conversion was called indirectly like
269 inside array initializer and constant folding was skipped.
271 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
274 * statement.cs(ImplicitConversionStandard): Updated after constant
275 conversion was made more generic.
277 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
279 * expression.cs (As.DoResolve): Use GenericConstraints instead of
280 Constraints, solves the problem where the compiler incorrectly
281 reported that a type parameter was not constrained to a class (Bug
284 2007-01-14 Marek Habersack <grendello@gmail.com>
286 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
288 2007-01-14 Marek Safar <marek.safar@gmail.com>
291 * assign.cs (FieldInitializer): New class implements field
292 initializer statement.
294 * attribute.cs: Update after FieldMember rename.
296 * class.cs (PropertyBasedMember): New common class for property based
298 (InterfaceMemberBase): New base class for all members which can be used as
299 an interface members.
300 (MethodCore): Moved really common code to InterfaceMemberBase.
301 (Method.Define): Equal and GetHasCode detection is relevant for methods
303 (MethodData.Define): Don't assume that public event implements an
304 interface automatically.
305 (MethodData.DefineMethodBuilder): Issue an error even if only extern
307 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
308 (FieldMember): Merged with FieldBase.
309 (EventProperty.AEventPropertyAccessor): New specialization to check whether
310 event extern modifier can be used.
311 (EventField.EventFieldAccessor): Moved event field specific code here.
312 (Event.AllowedModifiers): Even event can be extern.
313 (Event.FindOutBaseMethod): New override specific to events.
314 (Indexer.parameters): Reintroduce parameters because base class holds
315 only properties common data.
316 (Indexer.CheckForDuplications): Indexers are threated as methods so we
317 need do extra parameters check.
319 * const.cs: Update after FieldMember rename.
321 * decl.cs (MemberCache.FindBaseEvent): New method.
323 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
324 to reflect that indexer is now derived from PropertyBased.
326 * ecore.cs (GetMemberType): Made public.
327 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
330 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
332 * typemanager.cs (CSharpSignature): Correctly print event accessors.
333 (RegisterEvent): Removed.
334 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
335 (GetPrivateFieldOfEvent): Renamed to GetEventField.
337 2007-01-11 Raja R Harinath <rharinath@novell.com>
340 * statement.cs (CollectionForeach.TryType): Prefer generic
341 GetEnumerator over non-generic variant. Fix code to follow comments.
343 2007-01-09 Raja R Harinath <rharinath@novell.com>
346 * support.cs (ReflectionParameter): Don't use an invalid index on
347 the generic parameter data.
349 2007-01-08 Miguel de Icaza <miguel@novell.com>
351 * driver.cs: Just add a tiny bit of infrastructure.
353 2007-01-02 Marek Safar <marek.safar@gmail.com>
355 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
356 where field type is struct from current assembly.
358 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
361 2007-01-02 Marek Safar <marek.safar@gmail.com>
364 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
367 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
369 (Namespace.LookupType): Always use core types from corlib when speficied.
371 * report.cs: A new warning.
373 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
374 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
375 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
377 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
378 (InitCoreTypes): Set expression type of object_type and value_type
379 immediately after lookup.
381 2007-01-01 Miguel de Icaza <miguel@novell.com>
383 * cs-tokenizer.cs: Accept Pc class characters (Connector
384 Punctuation) as valid identifiers. Fixes #78259
386 * expression.cs (Invocation.DoResolve): Moved the check for the
387 use of `this' for doing method calls to the Invocation resolution
388 step, after overload resolution has taken place instead of doing
389 the check at the low-level `This.DoResolve' level.
391 The `This.DoResolve'Â happens before overload resolution, so it has
392 no way of knowing if the method that will be called will be
393 instace or static, triggering an erroneous report for cs0188 (Bug
396 We now do the check for instance method invocations after we know
397 what method will be called.
399 (This.CheckThisUsage): Move the actual use of this structure
400 checking into its own method and expose it.
402 * Everywhere that called Error_ValueCannotBeConverted: pass a new
405 Exceptions: Null.ConvertImplicitly,
406 Constant.ImplicitConversionRequired as there are too many call
407 sites for passing the ec.
409 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
410 EmitContext, if the value is null, then we do not try to provide
411 the extra information from the error (If a userdefined conversion
412 exists, as UserDefinedConversion requires a non null-EmitContext).
416 2006-12-30 Raja R Harinath <rharinath@novell.com>
418 * flowanalysis.cs (MyBitVector): Document some invariants.
419 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
420 introduced below, and add a couple of others,
422 2006-12-30 Marek Safar <marek.safar@gmail.com>
424 * attribute.cs (GetMethodObsoleteAttribute): Uses new
425 GetPropertyFromAccessor and GetEventFromAccessor.
427 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
428 overrides non-obsolete one.
429 (Indexer.Define): Error message has been moved to the parser.
431 * cs-parser.jay: Better syntax errors handling.
433 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
434 when an invocation has no arguments.
436 * ecore.cs: Removed not used caching.
438 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
441 * report.cs: Add a new warning.
443 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
445 * typemanager.cs (enumeration_type): Removed.
446 (CSharpSignature): Reuses IsSpecialMethod.
447 (IsEqual): Hack for MS BCL.
448 (GetPropertyFromAccessor): New method.
449 (GetEventFromAccessor): New method.
450 (IsSpecialMethod): Fixed to handle more cases.
452 2006-12-30 Marek Safar <marek.safar@gmail.com>
454 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
455 Made white spaces array static.
457 * ecore.cs (RemoveGenericArity): Optimized.
459 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
461 (MyBitVector.initialize_vector): Simplified.
463 2006-12-22 Miguel de Icaza <miguel@novell.com>
465 * ecore.cs: Am not entirely happy with this hack, but it seems to
466 address the issue in 80257 (a small test case for
469 I set the MethodGroupExpr.Type to an internal compiler type
470 (itself in this case) to force the resolution to take place. Why
471 it does not take place with a null is beyond me.
473 2006-12-20 Marek Safar <marek.safar@gmail.com>
476 * expression.cs (ResolveOperator): Consider user defined conversion for
477 logical and operator too.
478 (EmitBranchable): Optimization for logical and when full constant folding
479 could not be applied but one operand is constant.
481 2006-12-19 Marek Safar <marek.safar@gmail.com>
483 * class.cs (GetClassBases): Write 5 times every day, will never use
484 FullName for error reporting.
486 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
488 2006-12-19 Martin Baulig <martin@ximian.com>
490 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
491 the symbol file info here.
493 2006-12-18 Marek Safar <marek.safar@gmail.com>
495 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
496 of `elseif' is taking then following sections are not taking.
497 Fixes an issue reported on mono mailing list.
499 2006-12-18 Marek Safar <marek.safar@gmail.com>
502 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
503 a caller is not taking.
505 2006-12-18 Raja R Harinath <rharinath@novell.com>
507 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
508 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
509 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
510 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
511 * class.cs: Update to changes.
513 2006-12-17 Marek Safar <marek.safar@gmail.com>
516 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
519 * class.cs (ResolveMembers): Register an iterator in current container and
522 2006-12-16 Raja R Harinath <rharinath@novell.com>
525 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
526 satisfy a params annotated parameter.
528 2006-12-16 Marek Safar <marek.safar@gmail.com>
531 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
532 paramters correctly and not rely on hacks in Parameters class.
533 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
535 (Invocation.VerifyArgumentsCompat): Ditto.
536 (Invocation.EmitArguments): Changed to correctly emit params arguments at
539 * parameter.cs (HasParams): Don't assume that params is the last one.
541 * support.cs (ReflectionParameters.ctor): Look for params attribute
543 (ReflectionParameters.ParameterType): Removed hack when we returned last
544 parameter for out of range parameters.
545 (ParameterName, ParameterModifier): Ditto.
547 2006-12-14 Marek Safar <marek.safar@gmail.com>
550 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
551 when assembly is not CLS compliant but type is. I have no idea why is this
554 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
556 2006-12-13 Miguel de Icaza <miguel@novell.com>
558 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
559 in struct constructors, they are basically no-ops.
561 2006-12-12 Marek Safar <marek.safar@gmail.com>
563 * cs-tokenizer.cs (Position): Save preprocessor status too.
565 2006-12-12 Marek Safar <marek.safar@gmail.com>
568 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
570 2006-12-12 Marek Safar <marek.safar@gmail.com>
572 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
574 (pp_expr): Report error for an invalid expression.
575 (handle_preprocessing_directive): Simplified; add more error checking.
577 2006-12-11 Marek Safar <marek.safar@gmail.com>
580 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
583 2006-12-10 Marek Safar <marek.safar@gmail.com>
585 A fix for bugs #80093, and #75984
586 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
587 logic, it seems to me as it worked before "by coincidence".
588 (xtoken): Simplified to use reworked handle_preprocessing_directive.
589 (cleanup): Enabled endif check.
591 2006-12-09 Marek Safar <marek.safar@gmail.com>
594 * statement.cs (CollectionForeach.TryType): Generics and non-generics
595 enumerators are never ambiguous.
597 2006-12-08 Raja R Harinath <rharinath@novell.com>
600 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
602 2006-12-06 Marek Safar <marek.safar@gmail.com>
605 * class.cs (EventProperty.Define): Explicit implementation means
606 that an even is used.
608 2006-12-06 Marek Safar <marek.safar@gmail.com>
610 Fixes the operators implementation (part II)
612 * cfold.cs (DoConstantNumericPromotions): Renamed to
613 DoBinaryNumericPromotions and simplified.
614 (BinaryFold): Couple of conversion fixes; simplified.
616 * constant.cs, ecore.cs, literal.cs
617 (ToType): Renamed to ConvertImplicitly.
618 (Reduce): Renamed to ConvertExplicitly.
620 * class.cs, convert.cs: Updated.
622 * expression.cs: TryReduce doesn't throw an exception.
624 2006-12-01 Marek Safar <marek.safar@gmail.com>
627 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
630 2006-11-30 Marek Safar <marek.safar@gmail.com>
632 Fixes unary operators implementation (part I)
635 * cfold.cs (Error_CompileTimeOverflow): Made internal
637 * const.cs (IConstant): Changed to use reference to constant and
639 Updated IConstant implementations.
641 * constant.cs (CreateConstant): New factory method.
642 Updated IConstant implementation.
644 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
646 * ecore.cs: Updated to use CreateConstantReference.
648 * enum.cs: Reflects IConstant changes.
650 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
652 * literal.cs (NullConstant): Change to be independently usable.
654 2006-11-29 Martin Baulig <martin@ximian.com>
656 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
657 we need to emit the scope initializer before calling the base .ctor.
659 * anonymous.cs: Merged back from the new anonymous methods branch.
660 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
662 * expression.cs (ParameterReference.DoResolveBase): Create a
663 "normal" ScopeInfo when capturing parameters rather than using the
664 root scope; this makes things work with anonymous methods having
668 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
670 2006-11-22 Marek Safar <marek.safar@gmail.com>
673 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
674 check to a base class.
675 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
676 only when assembly has missing attribute.
679 2006-11-21 Marek Safar <marek.safar@gmail.com>
681 * cs-tokenizer.cs: Merged with gmcs version.
683 2006-11-20 Marek Safar <marek.safar@gmail.com>
686 * cs-parser.jay: Better error message when partial keyword is misplaced.
688 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
691 report.cs: CS1058 only applies to 2.0 profile (gmcs).
692 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
693 a RuntimeWrappedException by default.
695 2006-11-18 Marek Safar <marek.safar@gmail.com>
698 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
700 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
702 2006-11-18 Marek Safar <marek.safar@gmail.com>
704 * driver.cs, namespace.cs: Uses faster IndexOf version.
706 2006-11-17 Marek Safar <marek.safar@gmail.com>
709 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
711 (Operator.Define): Implicit/Explicit operator of same type is duplicate
712 even if internal name is different.
713 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
714 (UserDefinedConversion): Simplified as the operators cannot be internal.
715 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
717 (MethodLookup): Replaced EmitContext with parentType.
718 * expression.cs: Updated.
720 2006-11-09 Raja R Harinath <rharinath@novell.com>
722 * driver.cs (BadAssembly): Handle all the ugliness of
723 DefineDynamicAssembly.
725 2006-11-08 Raja R Harinath <rharinath@novell.com>
727 Address parts of #58244 -- most of what's left is in the runtime
728 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
729 CS1509 error checks, and handle them for all assembly loads, not
730 just the first invocation.
731 (LoadModule): Likewise. Move handling of 'adder_method' ...
732 * codegen.cs (AssemblyClass.AddModule): ... here.
734 2006-11-02 Marek Safar <marek.safar@gmail.com>
736 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
737 IEnumerable<T> is ambiguous.
739 2006-10-31 Marek Safar <marek.safar@gmail.com>
742 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
743 GetEnumerator is ambiguous.
745 * report.cs: Add new warning.
747 2006-10-29 Marek Safar <marek.safar@gmail.com>
750 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
751 to protected member can be nested type.
753 2006-10-28 Marek Safar <marek.safar@gmail.com>
756 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
757 to protected member must derive from current type.
759 2006-10-27 Marek Safar <marek.safar@gmail.com>
761 assign.cs: Reuses error method.
763 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
764 instead of type for constants.
765 (Expression.Error_ValueAssignment): Common error method.
767 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
770 2006-10-27 Marek Safar <marek.safar@gmail.com>
773 * expression.cs (MemberAccess.DoResolve): Check nested type
776 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
778 * doc.cs : nested delegates were not handled. Fixed bug #79754.
780 2006-10-26 Marek Safar <marek.safar@gmail.com>
783 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
785 2006-10-26 Marek Safar <marek.safar@gmail.com>
787 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
788 type forwarder of the same type multiple times.
790 2006-10-26 Raja R Harinath <rharinath@novell.com>
793 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
794 instance as an rvalue, even when we later resolve as an lvalue.
796 2006-10-25 Martin Baulig <martin@ximian.com>
798 * anonymous.cs: Fix #79673.
800 2006-10-24 Marek Safar <marek.safar@seznam.cz>
803 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
804 ignored when is optimized (= default value) as its value is already set.
806 2006-10-23 Marek Safar <marek.safar@seznam.cz>
809 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
810 TypeContainer for type lookup.
812 2006-10-23 Marek Safar <marek.safar@seznam.cz>
815 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
816 * expression.cs (OverloadResolve): Always convert type name for
818 (ResolveNamespaceOrType): Don't confuse a nested type with any
821 2006-10-18 Martin Baulig <martin@ximian.com>
823 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
825 2006-10-17 Miguel de Icaza <miguel@novell.com>
827 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
828 an int32, but requesting an int64 from the conversion
830 2006-10-12 Martin Baulig <martin@ximian.com>
833 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
835 2006-10-12 Martin Baulig <martin@ximian.com>
838 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
840 2006-10-11 Miguel de Icaza <miguel@novell.com>
842 * convert.cs: Remove broken code: I was doing the "Existance"
843 tests for Implicit conversions.
845 2006-10-10 Miguel de Icaza <miguel@novell.com>
847 * convert.cs: Added one missing case in
848 ImplicitStandardConversionExists uint64 to intptr.
852 * typemanager.cs (uintptr_type): another core known type.
854 * ecore.cs (OperatorCast): routine used to do cast operations that
855 depend on op_Explicit. We could change some of the Decimal
856 conversions to use this.
858 This one has a probe mechanism that checks both types for an op_
859 which it coudl be used to eliminate two classes: CastToDecimal
862 * convert.cs: Implement the conversions documented in #59800
864 2006-10-10 Martin Baulig <martin@ximian.com>
866 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
867 before RootScope.ResolveMembers().
869 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
870 `CurrentType' if appropriate.
872 2006-10-09 Marek Safar <marek.safar@seznam.cz>
875 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
876 when contains binary operators.
877 * cs-parser.jay: Updated.
879 2006-10-09 Martin Baulig <martin@ximian.com>
882 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
883 moved that into Define() and also do the other type parameter
884 checks there. Fixes #79094. Added gtest-292.cs.
887 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
888 since that doesn't include type parameters; don't use `Ldelema'
889 for type parameters. Fixes #78980. Added gtest-293.cs.
891 2006-10-08 Marek Safar <marek.safar@seznam.cz>
894 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
895 conversion is allowed.
897 2006-10-06 Marek Safar <marek.safar@seznam.cz>
899 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
900 error reporting when no error occurs.
902 2006-10-06 Marek Safar <marek.safar@seznam.cz>
904 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
907 2006-10-06 Raja R Harinath <rharinath@novell.com>
910 * class.cs (DefineTypeBuilder): Check circular dependencies before
911 setting the parent of the TypeBuilder.
912 (CheckRecursiveDefinition): Don't use 'BaseType', since
913 it may not be valid until after DefineTypeBuilder. Use
916 2006-10-04 Martin Baulig <martin@ximian.com>
918 Merged the Anonymous Methods patch.
920 * anonymous.cs, iterators.cs: The new anonymous methods code.
922 * statement.cs (Variable): New public abstract class.
923 (LocalInfo.Variable): New public property.
924 (LocalInfo.ResolveVariable): New public method.
925 (Block.Flags): Add `IsIterator'.
926 (Block.AddVariable): Improved the CS0136 check.
927 (Block.AnonymousChildren): New public property.
928 (Block.AddAnonymousChild): New public method.
929 (ToplevelBlock): Update to use the new anonymous method framework.
930 (ToplevelBlock.ctor): `container' is now a `Block' and not a
931 `ToplevelBlock'; this is required to correctly implement the
933 (Fixed, Using): Use `TemporaryVariable' instead of directly
934 creating the `LocalBuilder'.
936 * parameter.cs (Parameter.ResolveVariable): New public method.
937 (Parameters.ResolveVariable): Likewise.
939 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
941 * class.cs (TypeContainer): Replaced the `iterators' list and
942 corresponding methods with a list of `CompilerGeneratedClass'es.
943 (TypeContainer.ResolveMembers): New public method.
944 (Method): `IIteratorContainer' has been replaced by
947 * expression.cs (VariableReference): New public abstract base
948 class for `LocalVariableReference', `ParameterReference' and
951 * codegen.cs (EmitContext): Removed `capture_context',
952 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
953 (EmitContext.EmitThis): Removed.
955 * cs-parser.jay: Replace `iterator_container' with
958 2006-10-04 Martin Baulig <martin@ximian.com>
960 * generic.cs (GenericMethod): Don't make this abstract.
961 (Constraints.Clone): Added dummy implementation.
963 2006-10-04 Raja R Harinath <harinath@gmail.com>
966 * namespace.cs (LookForAnyGenericType): Avoid nullref on
967 'declspaces'. Avoid allocating arrays willy-nilly.
970 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
971 cases out of the switch.
973 2006-09-28 Marek Safar <marek.safar@seznam.cz>
975 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
976 message when non-generic type is used with the type arguments.
977 * expression.cs: Updated.
979 2006-09-28 Raja R Harinath <rharinath@novell.com>
982 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
983 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
984 Change semantics slightly. Don't insist on having only one
985 temporary EmptyExpression -- just throttle the creation of new ones.
988 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
989 non-interfaces too. If no methods are found, don't try to create
992 2006-09-28 Marek Safar <marek.safar@seznam.cz>
994 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
997 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
998 us produce better error message.
1000 2006-09-27 Marek Safar <marek.safar@seznam.cz>
1002 * expression.cs (Binary.ResolveOperator): Warn about a side effect
1003 of the `|' operator.
1005 * report.cs: A new warning added.
1007 2006-09-27 Martin Baulig <martin@ximian.com>
1009 * generic.cs (GenericMethod): Don't make this abstract.
1011 2006-09-27 Martin Baulig <martin@ximian.com>
1014 (InternalErrorException): Added overloaded ctor taking a params array.
1016 2006-09-26 Marek Safar <marek.safar@seznam.cz>
1018 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
1019 Fixed the cases when same error was reported twice.
1021 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
1022 now report symbol information.
1024 2006-09-25 Martin Baulig <martin@ximian.com>
1026 * class.cs: Completely unified with the gmcs version.
1028 2006-09-25 Martin Baulig <martin@ximian.com>
1030 * typemanager.cs (TypeManager.IsNullableType): New public function.
1031 (TypeManager.IsNullableTypeOf): Likewise.
1032 (TypeManager.IsNullableValueType): Likewise.
1034 * class.cs (MethodCore): Added the `GenericMethod' argument from
1035 gmcs and also unified all classes derived from `MethodCore' with gmcs.
1037 2006-09-24 Raja R Harinath <harinath@gmail.com>
1039 * convert.cs: Unify with gmcs version.
1041 2006-09-24 Marek Safar <marek.safar@seznam.cz>
1043 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
1044 verify them as well.
1046 * report.cs: New warning.
1048 2006-09-24 Marek Safar <marek.safar@seznam.cz>
1050 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
1051 for anonymous block with out argument.
1053 2006-09-24 Marek Safar <marek.safar@seznam.cz>
1055 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
1056 not used private events only.
1058 2006-09-23 Marek Safar <marek.safar@seznam.cz>
1060 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
1062 * const.cs (Const.Define): Check for constant type.
1063 (Const.IsConstantTypeValid): Looks for valid constant types.
1065 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
1067 * ecore.cs (EmptyConstantCast): New common class for all constant based
1070 * expression.cs (Is.DoResolve): Handle null constant especially.
1071 (New.DoResolve): Check for new void().
1072 (MemberAccess.DoResolve): Cope with all kind of nulls.
1074 * literal.cs (NullConstant): Uses EmptyConstantCast.
1075 (NullDefault): Based on EmptyConstantCast.
1076 (NullLiteral): Uses EmptyConstantCast.
1078 * statement.cs (Block.ResolveMeta): Check for constant type.
1080 2006-09-22 Martin Baulig <martin@ximian.com>
1082 * delegate.cs, attribute.cs: Merged with the gmcs versions.
1084 2006-09-22 Raja R Harinath <rharinath@novell.com>
1086 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
1090 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
1091 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
1094 2006-09-22 Martin Baulig <martin@ximian.com>
1096 * ecore.cs: Merged with the gmcs version.
1098 * generic.cs (ConstructedType): New dummy class.
1099 (TypeArguments): Don't make this abstract.
1102 (TypeManager.IsGenericTypeDefinition): New method.
1103 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
1105 2006-09-22 Raja R Harinath <rharinath@novell.com>
1107 * expression.cs (ComposedCast): Check for arrays of TypedReference
1108 before creating the type, not after.
1110 2006-09-21 Marek Safar <marek.safar@seznam.cz>
1112 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
1113 after ToType change.
1115 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
1116 when constant must be implicitly convertible.
1118 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
1120 * ecore.cs (NullCast): Derives from NullConstant.
1122 * expression.cs (Is.DoResolve): Removed useless variables.
1123 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
1124 (New.Constantify): Add enum support.
1125 (MemberAccess.DoResolve): Add warning when accessing null constant or
1128 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
1131 * literal.cs (NullConstant): New abstract class with common
1132 functionality for all null specializations.
1133 (NullDefault): Represents default(X) when result can be
1135 (NullLiteral): Updated.
1137 * report.cs: Add new warning.
1139 2006-09-21 Martin Baulig <martin@ximian.com>
1141 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
1143 2006-09-21 Martin Baulig <martin@ximian.com>
1145 * generic.cs (GenericConstraints): New dummy class.
1146 (Constraints): Likewise.
1147 (TypeParameter): Likewise.
1148 (TypeParameterName): Likewise.
1149 (GenericMethod): Likewise.
1151 * typemanager.cs (TypeManager.GetGenericArguments): New method.
1153 * decl.cs: Merged with the gmcs version.
1155 2006-09-21 Raja R Harinath <rharinath@novell.com>
1157 * generic.cs (TypeParameter): Implement IMemberContainer.
1158 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
1160 * rootcontext.cs: Unify with gmcs version.
1162 * report.cs: Unify with gmcs version.
1163 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
1164 from gmcs/generics.cs.
1165 * generics.cs (TypeParameter): New dummy class.
1167 * support.cs: Unify with gmcs version.
1169 2006-09-20 Raja R Harinath <rharinath@novell.com>
1171 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
1172 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
1174 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
1175 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
1176 * mcs.exe.sources: Add generic.cs.
1178 * codegen.cs: Unify with gmcs version.
1180 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
1181 (EmitContext): Add GenericDeclContainer implementation.
1182 * decl.cs (MemberCore, DeclSpace): Likewise.
1183 * namespace.cs: Remove #ifdef GMCS_SOURCE.
1185 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
1186 MCS TypeManager has a corresponding dummy method.
1188 2006-09-19 Martin Baulig <martin@ximian.com>
1190 * expression.cs: Completely merged with the gmcs version.
1192 2006-09-19 Martin Baulig <martin@ximian.com>
1194 * expression.cs (Invocation): Merged with the gmcs version.
1195 (ArrayAccess.GetStoreOpcode): Likewise.
1197 2006-09-19 Martin Baulig <martin@ximian.com>
1200 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
1201 (TypeManager.IsGenericMethodDefinition): Likewise.
1203 2006-09-19 Martin Baulig <martin@ximian.com>
1206 (TypeManager.IsEqual): Moved the gmcs implementation here.
1207 (TypeManager.DropGenericTypeArguments): Likewise.
1208 (TypeManager.DropGenericMethodArguments): Likewise.
1209 (TypeManager.GetTypeArguments): Moved here from gmcs.
1210 (TypeManager.HasGenericArguments): Likewise.
1212 2006-09-19 Martin Baulig <martin@ximian.com>
1214 * expression.cs (Binary): Merged with the gmcs version.
1216 2006-09-19 Martin Baulig <martin@ximian.com>
1218 * expression.cs (Probe, As, Is): Merged with the gmcs version.
1220 2006-09-19 Martin Baulig <martin@ximian.com>
1222 * typemanager.cs: Merged with the gmcs version.
1224 2006-09-16 Raja R Harinath <rharinath@novell.com>
1226 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
1227 * driver.cs: Likewise.
1229 2006-09-16 Marek Safar <marek.safar@seznam.cz>
1232 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
1233 only if parent type is class.
1234 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
1237 2006-09-15 Marek Safar <marek.safar@seznam.cz>
1240 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
1242 * typemanager.cs(CSharpName): Converts NullType to null.
1244 2006-09-15 Martin Baulig <martin@ximian.com>
1247 (TypeManager.GetMethodName): Added mcs implementation.
1248 (TypeManager.IsEqual): Likewise.
1251 (SimpleName.RemoveGenericArity): Added dummy implementation.
1253 * pending.cs: Merged with the gmcs version.
1255 2006-09-15 Martin Baulig <martin@ximian.com>
1257 * statement.cs: Merge with the gmcs version.
1259 2006-09-15 Martin Baulig <martin@ximian.com>
1261 * statement.cs (Switch): Merge with the gmcs implementation
1262 (without nullables), which is newer.
1264 2006-09-15 Martin Baulig <martin@ximian.com>
1266 * statement.cs (Block.Variables): Make this public.
1267 (ToplevelBlock.Parameters): Make this a property.
1268 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
1270 2006-09-15 Martin Baulig <martin@ximian.com>
1272 * namespace.cs: Merge with the gmcs version.
1274 2006-09-15 Martin Baulig <martin@ximian.com>
1276 * decl.cs (MemberName): Minor code cleanups.
1278 2006-09-15 Martin Baulig <martin@ximian.com>
1280 * parameter.cs: Merge with the gmcs version.
1282 2006-09-15 Martin Baulig <martin@ximian.com>
1284 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
1285 and an error in mcs.
1287 2006-09-15 Martin Baulig <martin@ximian.com>
1289 * flowanalysis.cs: Merged from GMCS; added the generics code into
1290 a `GMCS_SOURCE' conditional so we can share this file.
1292 2006-09-08 Martin Baulig <martin@ximian.com>
1294 * typemanager.cs (TypeManager.interlocked_type): New public field.
1295 (TypeManager.int_interlocked_compare-exchange): New public field.
1296 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
1297 enumerator types here and call InitGenericCoreTypes().
1298 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
1299 after calling InitEnumUnderlyingTypes().
1302 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
1303 `classes_second_stage'.
1305 2006-09-14 Marek Safar <marek.safar@seznam.cz>
1307 * assign.cs, ecore.cs, expression.cs: Share error message text.
1308 * class.cs (FieldMember.Define): Check for varible of static type.
1309 * driver.cs (LoadAssembly): Uses error output for errors.
1310 * statement.cs: Updated.
1312 2006-09-08 Marek Safar <marek.safar@seznam.cz>
1314 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
1317 2006-09-07 Martin Baulig <martin@ximian.com>
1320 (MainDriver): Revert r62663 from Marek; see #70506 for details.
1322 2006-08-29 Miguel de Icaza <miguel@novell.com>
1324 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
1326 2006-08-17 Miguel de Icaza <miguel@novell.com>
1328 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
1329 #52019 and #79064, the use of the \uXXXX sequence in source code
1330 to represent unicode characters.
1332 2006-08-15 Marek Safar <marek.safar@seznam.cz>
1334 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
1336 * class.cs, ecore.cs, statement.cs: Merged to one error message.
1338 2006-08-13 Miguel de Icaza <miguel@novell.com>
1340 * assign.cs: Catch attempts to assign to a method groups in += and
1343 2006-08-13 Marek Safar <marek.safar@seznam.cz>
1346 * cs-parser.jay: Don't destroy current array type by typeof of array's.
1348 2006-08-12 Marek Safar <marek.safar@seznam.cz>
1350 * class.cs (Method.Define): Issue a warning when generic method looks like
1352 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
1355 2006-08-09 Marek Safar <marek.safar@seznam.cz>
1357 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
1359 * decl.cs (MemberCache.FindMembers): When container is interface we need to
1360 search all base interfaces as a member can be ambiguous.
1361 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
1362 Constructor member type filter.
1363 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
1364 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
1365 reporting for returned memberinfos.
1366 * report.cs: Updated.
1367 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
1368 version to work on all runtimes.
1369 (TypeManager.RealMemberLookup): Removed members filtering.
1371 2006-08-08 Raja R Harinath <rharinath@novell.com>
1373 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
1374 (PropertyExpr.EmitAssign): Likewise.
1375 * expression.cs (Indirection.EmitAssign): Likewise.
1376 (LocalVariableReference.EmitAssign): Likewise.
1377 (ParameterReference.EmitAssign): Likewise.
1378 (Invocation.EmitArguments): Likewise.
1379 (ArrayAccess.EmitAssign): Likewise.
1380 (IndexerAccess.EmitAssign): Likewise.
1381 (This.EmitAssign): Likewise.
1382 (ConditionalLogicalOperator.Emit): Likewise.
1385 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
1386 instead of ArrayList. If the hashtable has a LocalBuilder, don't
1387 leave it in after returning it.
1388 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
1390 2006-08-06 Marek Safar <marek.safar@seznam.cz>
1392 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
1395 2006-08-03 Raja R Harinath <rharinath@novell.com>
1397 Fix cs0146-3.cs and cs0146-4.cs.
1398 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
1399 enclosing types don't depend on the current type.
1401 2006-08-02 Raja R Harinath <rharinath@novell.com>
1404 * class.cs (TypeContainer.DoDefineMembers): Use
1405 FindBaseMemberWithSameName on Parent, since we're interested in
1406 whether we hide inherited members or not.
1407 (FindBaseMemberWithSameName): Make slightly more robust.
1409 Fix the non-generic testcase from #77396
1410 * decl.cs (DeclSpace.DeclContainer): Remove override.
1412 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
1413 declspaces for doppelgangers too.
1414 (UsingEntry): Implement IResolveContext.
1415 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
1416 'this' as the resolve context.
1417 (LocalAliasEntry): Likewise.
1419 Implement parts of #77403
1420 * roottypes.cs (RootDeclSpace): New. Used to represent the
1421 toplevel declaration space. Each namespace declaration introduces
1422 a "partial" root declaretion space.
1423 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
1424 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
1425 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
1426 from 'current_namespace.SlaveDeclSpace'.
1427 (namespace_declaration): Likewise.
1428 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
1429 check. It can't happen now.
1430 * decl.cs (DeclSpace.LookupType): Likewise.
1431 * driver.cs (MainDriver): Sanity check.
1433 2006-08-01 Raja R Harinath <rharinath@novell.com>
1435 * decl.cs (DeclSpace.FindNestedType): Remove.
1436 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
1437 LookupTypeContainer to get the container of the nested type.
1438 * class.cs (TypeContainer.FindNestedType): Make non-override.
1440 2006-07-31 Raja R Harinath <rharinath@novell.com>
1442 * decl.cs (DeclSpace.PartialContainer): Move field from ...
1443 * class.cs (TypeContainer.PartialContainer): ... here.
1444 (TypeContainer.AddBasesForPart): New helper.
1445 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
1447 * cs-parser.jay (current_class): Convert to DeclSpace.
1448 (struct_declaration, interface_declaration, class_declaration):
1449 Use AddBasesForPart instead of .Bases directly.
1450 * const.cs, iterators.cs: Update to changes.
1452 2006-07-28 Raja R Harinath <rharinath@novell.com>
1454 * class.cs (TypeContainer.AddMemberType): Rename from
1456 (TypeContainer.AddMember): Rename from AddToMemberContainer.
1457 (AddTypeContainer): New. Combine AddClassOrStruct and
1459 (AddPartial): Update. Add 'is_partial' argument.
1460 * roottypes.cs: Update to changes.
1461 * cs-parser.jay (push_current_class): New helper for handling
1462 current_container and current_class.
1463 (struct_declaration, interface_declaration, class_declaration):
1466 2006-07-26 Raja R Harinath <rharinath@novell.com>
1468 * roottypes.cs: Rename from tree.cs.
1470 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
1471 * tree.cs (Tree, ITreeDump): Remove types.
1472 * rootcontext.cs (tree, Tree): Remove fields.
1473 (root, ToplevelTypes): New.
1474 * *.cs: Update to rename.
1476 * tree.cs (Tree.RecordDecl): Remove.
1477 (RootTypes.AddToTypeContainer): Record the toplevel type in its
1479 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
1481 2006-07-23 Raja R Harinath <harinath@gmail.com>
1483 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
1484 DoFlowAnalysis and OmitStructFlowAnalysis here.
1485 (ec.With): Rename from WithUnsafe and generalize.
1486 (ec.WithCheckState): Remove. All users can be handled by 'With'.
1487 (ec.WithFlowAnalyis): New.
1488 * ecore.cs, expression.cs, statement.cs: Update.
1490 2006-07-22 Raja R Harinath <harinath@gmail.com>
1492 * statement.cs (Block.ResolveMeta): Simplify slightly.
1494 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
1495 multiple boolean fields. Convert InUnsafe, constant_check_state,
1496 check_state to flags.
1497 (CheckState, ConstantCheckState): Update.
1498 (InUnsafe): New read-only property.
1499 (FlagsHandle): Rename from CheckStateHandle and convert to handle
1501 (WithUnsafe): New helper similar to WithCheckState.
1502 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
1503 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
1505 2006-07-21 Raja R Harinath <rharinath@novell.com>
1507 Make comparisons use the same IL irrespective of whether they're
1508 in a 'checked' or 'unchecked' context: one of the issues in #78899
1509 * codegen.cs (EmitContext.CheckState): Make read-only property.
1510 (EmitContext.ConstantCheckState): Likewise.
1511 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
1512 helper that implement a save/restore stack for CheckState
1513 values. This is the only way to change check-state.
1514 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
1515 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
1516 (CheckedExpr.EmitBranchable): New forwarding method.
1517 (UnCheckedExpr): Likewise.
1518 * statement.cs (Block.ResolveMeta): Use WithCheckState.
1519 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
1520 (Checked.Resolve, checked.DoEmit): Likewise.
1522 2006-07-20 Miguel de Icaza <miguel@novell.com>
1524 * anonymous.cs: Cache the resolved anonymous delegate, and return
1525 this so that the ResolveTopBlock is only triggered once, not
1528 Currently we trigger ResolvetopBlock twice due to a first pass of
1529 argument check compatibility, and a second pass that does the
1532 2006-07-15 Marek Safar <marek.safar@seznam.cz>
1534 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
1536 * rootcontext.cs (Reset): Add helper_classes.
1538 2006-07-15 Marek Safar <marek.safar@seznam.cz>
1541 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
1544 2006-07-13 Miguel de Icaza <miguel@novell.com>
1546 * statement.cs (Lock): Handle expressions of type
1547 TypeManager.null_type specially. Fixes #78770
1549 2006-07-08 Marek Safar <marek.safar@seznam.cz>
1551 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
1554 2006-07-08 Marek Safar <marek.safar@seznam.cz>
1556 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
1557 for accessors as well.
1558 * ecore.cs (EventExpr): Add AccessorTable.
1560 2006-07-01 Marek Safar <marek.safar@seznam.cz>
1563 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
1564 for CS0122 where appropriate.
1565 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
1567 (Filter): Assembly can be null in the case of top level attributes.
1569 2006-06-25 Marek Safar <marek.safar@seznam.cz>
1573 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
1574 is done at global level.
1576 2006-06-24 Marek Safar <marek.safar@seznam.cz>
1578 A fix for #77002, Implemented TypeForwarder support.
1580 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
1581 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
1582 * typemanager.cs (): Add type_forwarder_attr_type.
1584 2006-06-24 Marek Safar <marek.safar@seznam.cz>
1586 * report.cs: Add CS0469 warning.
1588 2006-06-21 Martin Baulig <martin@ximian.com>
1590 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
1591 the `try'-block, so we also report CS0016 etc. there.
1593 2006-06-21 Martin Baulig <martin@ximian.com>
1596 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
1598 2006-06-21 Martin Baulig <martin@ximian.com>
1600 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
1601 also report CS1686 for parameters.
1603 2006-06-21 Martin Baulig <martin@ximian.com>
1605 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
1606 instead of an error if the value is not implicitly convertible to
1607 the switch types; fixes #77964.
1609 2006-06-21 Raja R Harinath <rharinath@novell.com>
1612 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
1613 FieldBuilder is null.
1616 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
1617 'left' and 'right' before error-checking.
1619 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
1621 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
1623 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
1624 (FieldExpr.DoResolve): likewise.
1625 (PropertyExpr.InstanceResolve): likewise.
1626 (EventExpr.InstanceResolve): likewise.
1628 2006-06-04 Marek Safar <marek.safar@seznam.cz>
1630 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
1631 attribute applicable tests for attribute argument.
1633 2006-06-02 Raja R Harinath <rharinath@novell.com>
1636 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
1637 (Binary.OverloadResolve_PredefinedIntegral): New.
1638 (Binary.OverloadResolve_PredefinedFloating): New.
1639 (Binary.OverloadResolve_PredefinedString): New.
1640 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
1641 Follow the standard more closely, and treat numeric promotions in
1642 terms of overload resolution.
1643 (Binary.CheckShiftArguments): Simplify.
1645 2006-06-01 Raja R Harinath <rharinath@novell.com>
1647 * flowanalysis.cs (MyBitVector): Simplify representation.
1648 (MyBitVector.Clone): Avoid allocating BitArray.
1649 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
1650 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
1651 (*): Update. Change all references to MyBitVector.And and
1652 MyBitVector.Or to &= and |=.
1654 2006-05-29 Raja R Harinath <rharinath@novell.com>
1657 * cs-parser.jay (formal_parameter_list): Extend the pattern below
1658 to param arguments too.
1660 2006-05-26 Miguel de Icaza <miguel@novell.com>
1662 * cs-parser.jay: Catch another parsing form for arglist being
1663 followed by other arguments. Fixes #78313.
1665 2006-05-24 Raja R Harinath <rharinath@novell.com>
1667 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1668 checking of out parameters to ...
1669 (FlowBranchingToplevel.Merge): ... here.
1670 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1671 set, propagate the origin upward, and only complain if there was
1673 (FlowBranchingException.AddContinueOrigin): Likewise.
1674 (FlowBranchingException.AddReturnOrigin): Likewise.
1675 (FlowBranchingException.AddGotoOrigin): Likewise.
1677 2006-05-23 Raja R Harinath <rharinath@novell.com>
1679 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1680 unreachable, skip it.
1681 (FlowBranchingException.Merge): Always propagate jumps, even if
1682 the finally block renders subsequent code unreachable.
1684 2006-05-18 Raja R Harinath <rharinath@novell.com>
1687 * statement.cs (Goto.Resolve): Move responsibility for resolving
1688 'goto' to FlowBranching.AddGotoOrigin.
1689 (Goto.SetResolvedTarget): New. Callback to set the
1690 LabeledStatement that's the target of the goto.
1691 (Goto.DoEmit): Use Leave instead of Br when crossing an
1692 unwind-protect boundary.
1693 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1694 LookupLabel and adjust to new semantics.
1695 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1696 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1697 Goto.SetResolvedTarget to update target.
1698 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1699 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1700 AddBreakOrigin & co. Delay propagation until ...
1701 (FlowBranchingException.Merge): ... this.
1703 * statement.cs (Block.Resolve): Always depend on flow-branching to
1704 determine unreachability. Kill workaround that originally emitted
1705 only one statement after an "unreachable" label (see infloop in
1708 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1709 This is still "wrong", but anything better would probably need a
1710 multi-pass algorithm.
1711 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1712 usage vector. Force current usage vector to be reachable, to
1713 optimistically signify backward jumps.
1714 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1716 (FlowBranchingLabeled.Merge): New. If no backward jump was
1717 detected, return the original salted-away usage vector instead,
1718 updated with appropriate changes. Print unreachable warning if
1720 * statement.cs (Block.Resolve): Don't print unreachable warning on
1721 a labeled statement.
1723 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
1725 * driver.cs: Pass filename without path to AssemblyBuilder's
1726 AddResourceFile. Fixes bug #78407.
1728 2006-05-17 Raja R Harinath <rharinath@novell.com>
1730 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1731 * flowanalysis.cs (FlowBranchingLabeled): ... here.
1732 (FlowBranching.MergeChild): Overwrite
1733 reachability information from Labeled branchings too.
1735 2006-05-16 Raja R Harinath <rharinath@novell.com>
1737 * statement.cs (Goto.Resolve): Merge jump origins here ...
1738 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1740 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1741 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
1742 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
1743 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1745 * statement.cs (Goto.Resolve): ... not here.
1746 (Goto.Emit): Remove CS1632 check.
1748 2006-05-14 Marek Safar <marek.safar@seznam.cz>
1750 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1753 2006-05-11 Raja R Harinath <rharinath@novell.com>
1755 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1756 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1757 (FlowBranchingException.Label): Likewise.
1759 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
1761 (MyBitVector.Or): Use it to avoid losing information (Count).
1762 (FlowBranching.MergeOrigins): Likewise.
1764 * flowanalysis.cs (UsageVector.IsDirty): Remove.
1765 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1766 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1767 (UsageVector.ToString): Simplify.
1768 (UsageVector.MergeSiblings): Move here from ...
1769 (FlowBranching.Merge): ... here.
1770 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1773 2006-05-10 Raja R Harinath <rharinath@novell.com>
1775 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1776 null bitvector is treated as all-true.
1778 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1779 (MyBitVector): Rationalize invariants. 'vector != null' implies
1780 that we have our own copy of the bitvector. Otherwise,
1781 'InheritsFrom == null' implies all inherited bits are true.
1783 2006-05-09 Marek Safar <marek.safar@seznam.cz>
1785 * statement.cs (LocalInfo): Add IsConstant.
1786 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1787 local variable for constants.
1789 2006-05-09 Raja R Harinath <rharinath@novell.com>
1791 * flowanalysis.cs (MyBitVector.Empty): New.
1792 (MyBitVector): Don't allow InheritedFrom to be null.
1793 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1794 (UsageVector, FlowBranching): Update to changes.
1796 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1797 recursion. The 'Parent == null' condition isn't sufficient for
1799 (FlowBranching.AddBreakOrigin): Likewise.
1800 (FlowBranching.AddContinueOrigin): Likewise.
1801 (FlowBranching.AddReturnOrigin): Likewise.
1802 (FlowBranching.StealFinallyClauses): Likewise.
1803 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1804 (FlowBranching.CheckOutParameters): Likewise.
1805 (FlowBranchingToplevel): Terminate all the above recursions here.
1806 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1807 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1809 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
1811 (FlowBranchingToplevel): New. Empty for now.
1812 (FlowBranching.MergeTopBlock): Update.
1813 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1814 branching for the anonymous delegate.
1815 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1817 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1818 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1819 information at the start of the merge. Reorganize.
1821 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1823 * class.cs (MethodData.Define): Method cannot implement interface accessor.
1825 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1827 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1828 to newly introduced ctor.
1830 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1831 message to one place.
1832 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1835 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1837 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1839 * ecore.cs (Expression.ResolveAsConstant): Updated.
1841 * statement.cs (ResolveMeta): Updated.
1843 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1845 * cs-parser.jay: __arglist cannot be used in initializer.
1847 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1850 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1853 2006-05-05 Raja R Harinath <rharinath@novell.com>
1855 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1856 (LabeledStatement): Add 'name' parameter.
1857 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1858 (Block.AddLabel): Update to changes.
1859 * cs-parser.jay (labeled_statement): Likewise.
1861 * flowanalysis.cs (BranchingType.Labeled): New.
1862 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1863 (FlowBranchingLabeled): New. Does nothing for now, but will
1864 eventually handle 'goto' flows.
1865 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1866 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1867 that's terminated ...
1868 (Block.Resolve): ... here.
1870 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1871 (UsageVector.MergeFinallyOrigins): Likewise.
1872 (FlowBranching.InTryOrCatch): Likewise.
1873 (FlowBranching.AddFinallyVector): Likewise.
1874 (FlowBranchingException): Update to changes.
1877 * statement.cs (Return.Resolve): Move error checking to ...
1878 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1879 (FlowBranchingException): Handle return origins like break and
1881 (FlowBranching.UsageVector.CheckOutParameters): Remove.
1883 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1886 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1889 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1892 * class.cs (MethodData.Define): Do public accessor check only when method
1893 implements an interface.
1895 2006-05-04 Raja R Harinath <rharinath@novell.com>
1897 Remove special handling of 'break'
1898 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1899 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
1900 (UsageVector.Break): Remove.
1901 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1903 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1905 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1906 UsageVector.Breaks (). Don't set NeedsReturnLabel.
1908 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1911 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1912 be the interface member.
1914 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1917 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1918 for emitting small (int) values.
1920 2006-05-03 Raja R Harinath <rharinath@novell.com>
1923 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1924 control-flow passes through the 'finally' after merging-in all the
1925 control-flows from 'try' and the 'catch' clauses.
1927 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1928 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
1929 always true at the only non-recursive entry point.
1930 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1931 FlowBranchingBreakable.
1932 (FlowBranchingLoop): Remove.
1933 * statement.cs (Return.DoResolve): Update to changes.
1936 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1937 (FlowBranching.CreateBranching): Handle it: create a
1938 FlowBranchingContinuable.
1939 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1940 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1941 except that it handles the 'continue' command.
1942 (FlowBranching.UsageVector.MergeOrigins): Rename from
1944 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1945 except that it overrides AddContinueOrigin.
1946 (FlowBranchingException): Override AddContinueOrigin, similar to
1948 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1949 Create a new branching around the embedded statement.
1950 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
1951 control flow after the embedded statement.
1952 (Continue.Resolve): Move all error checking to AddContinueOrigin.
1954 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1955 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1956 FlowBranchingBreakable.
1957 (FlowBranchingSwitch): Remove.
1960 * statement.cs (Break.Resolve): Simplify. Move responsibility for
1961 error reporting to ...
1962 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1963 Rename from 'AddBreakVector'. Add new location argument. Return
1964 a bool indicating whether the 'break' crosses an unwind-protect.
1965 (FlowBranchingException.AddBreakOrigin): Add.
1966 (FlowBranchingException.Merge): Propagate 'break's to surrounding
1967 flowbranching after updating with the effects of the 'finally'
1969 (FlowBranchingBreakable): New common base class for
1970 FlowBranchingLoop and FlowBranchingSwitch.
1972 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1974 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1976 2006-05-02 Raja R Harinath <rharinath@novell.com>
1978 * statement.cs (Do.Resolve): If the loop is infinite, set the
1980 (While.Resolve, For.Resolve): Set a barrier after the embedded
1981 statement. There's no direct control flow that goes from the end
1982 of the embedded statement to the end of the loop.
1983 * flowanalysis.cs (FlowBranching.Infinite): Remove.
1984 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
1985 above ensure that the reachability is correctly computed.
1987 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1988 (UsageVector.MergeBreakOrigins): If the current path is
1989 unreachable, treat it as if all parameters/locals are initialized.
1990 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
1991 infinite loops before merging-in break origins.
1993 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1994 (Reachability.Reachable): Split part into ...
1995 (Reachability.Unreachable): ... this. Simplify.
1996 (Reachability.IsUnreachable): Use 'Unreachable' instead.
1998 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1999 (Reachability.SetThrowsSometimes): Likewise.
2000 (FlowBranchingBlock.MergeTopBlock): Don't compare against
2001 TriState.Always, use corresponding property.
2002 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
2003 (Block.Resolve): Likewise. Remove some redundant checks.
2005 2006-05-02 Raja R Harinath <harinath@gmail.com>
2007 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
2008 (Reachability.Meet): Don't bother checking AlwaysThrows --
2009 barrier is always set.
2010 (FlowBranchingBlock.Merge): Likewise.
2012 2006-05-01 Raja R Harinath <harinath@gmail.com>
2014 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
2015 checks for unreachable.
2017 2006-05-01 Marek Safar <marek.safar@seznam.cz>
2020 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
2022 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
2023 whether field is really assigned.
2025 2006-04-30 Raja R Harinath <harinath@gmail.com>
2027 * flowanalysis.cs (Reachability): Make 4-argument constructor
2029 (Reachability.Meet): Rename from 'And'. Remove static variant.
2030 (Reachability.Always): Rename from the highly misleading
2031 'Reachability.Never'.
2032 (FlowBranching.Merge): Update to changes. Mark an impossible
2033 situation with a 'throw'.
2034 (*): Update to changes.
2036 2006-04-29 Raja R Harinath <harinath@gmail.com>
2038 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
2040 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
2041 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
2042 (*): Update to changes.
2043 * statement.cs: Update to changes.
2045 2006-04-28 Marek Safar <marek.safar@seznam.cz>
2048 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
2050 2006-04-28 Raja R Harinath <harinath@gmail.com>
2052 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
2055 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
2056 argument to two arguments: an usage-vector and a bool. Move call
2057 to FlowBranching.Merge () ...
2058 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
2060 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
2061 handling of loop and switch reachability to ...
2062 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
2064 2006-04-27 Raja R Harinath <harinath@gmail.com>
2066 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
2067 handling to FlowBranchingLoop.InLoop.
2068 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
2070 2006-04-26 Marek Safar <marek.safar@seznam.cz>
2073 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
2074 anonymous method is allowed from AnonymousContainer here.
2076 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
2078 2006-04-24 Raja R Harinath <rharinath@novell.com>
2081 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
2083 2006-04-23 Marek Safar <marek.safar@seznam.cz>
2086 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
2087 (DoubleConstant.Reduce): Ditto.
2089 2006-04-23 Raja R Harinath <rharinath@novell.com>
2091 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
2092 Remove 'lvalue_right_side' argument. Move parts to ...
2093 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
2094 (LocalVariable.DoResolveLValue): ... these.
2096 2006-04-21 Raja R Harinath <rharinath@novell.com>
2099 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
2100 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
2101 (LocalVariableReference.DoResolveBase): Use it to implement new
2103 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
2104 (Argument.Resolve): Simplify. Move CS1510 check ...
2105 * ecore.cs (Expression.ResolveLValue): ... here.
2106 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
2107 (PropertyExpr.DoResolveLValue): Likewise.
2108 (FieldExpr.Report_AssignToReadonly): Likewise.
2109 (FieldExpr.DoResolve): Add 'out_access' argument. Use
2110 LValueMemberAccess or LValueMemberOutAccess on instance depending
2112 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
2113 DoResolve as appropriate.
2115 2006-04-20 Raja R Harinath <rharinath@novell.com>
2118 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
2119 implicit conversions on 'out' and 'ref' arguments.
2121 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
2122 improve clarity. Remove dead code.
2125 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
2126 (Catch.Resolve): Resolve VarBlock if it exists.
2128 2006-04-19 Miguel de Icaza <miguel@novell.com>
2130 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
2131 twice, this was some residual code, the enumerator was emitted
2132 properly in the two branche of if later.
2134 2006-04-19 Raja R Harinath <rharinath@novell.com>
2136 * expression.cs (Cast.ResolveLValue): Remove. The result of a
2137 cast is never an lvalue.
2138 (Cast.DoResolve, Cast.ResolveRest): Combine.
2139 (Argument.Emit): Simplify slightly. Move 'Expr is
2140 IMemoryLocation' check ...
2141 (Argument.Resolve): ... here.
2142 (Argument.Error_LValueRequired): Remove. Inline into only user.
2144 Simplifications. Fix cs0191-2.cs
2145 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
2146 CS1649 and CS1651 to ...
2147 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
2148 the actual selection of the error code and message to a lookup
2149 table. Add a dummy return value to simplify callsites.
2150 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
2151 readonly fields of other instances of the same type. Move CS0197
2153 * expression.cs (Argument.Resolve): ... here. Simplify code.
2154 Ensure that ec.InRefOutArgumentResolving is only set during LValue
2155 resolution of an out or ref argument. The code simplification
2156 above uses this invariant.
2158 2006-04-18 Raja R Harinath <rharinath@novell.com>
2160 Possibly fix #77752. Fix cs1690-[4-7].cs.
2161 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
2162 CheckMarshallByRefAccess. Drop parameter.
2163 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
2165 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
2167 * report.cs (AllWarnings): Add CS1690.
2168 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
2170 (LocalVariableReference.DoResolveBase): Update.
2172 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2174 * class.cs (MethodOrOperator): Moved common parts from method class.
2175 detect obsolete attributes.
2176 (Method.Define): Simplified as it reuses code from base.
2177 (Constructor.ValidAttributeTargets): Fixed issue found during
2179 (Destructor.ValidAttributeTargets): Fixed issue found during
2181 (Operator): Finished refactoring set off by #78020. Operator class is now
2182 ordinary method class.
2184 * anonymous.cs: Updated.
2186 * decl.cs (DeclSpace): Add IsGeneric
2188 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2190 * class.cs (Constructor.Emit): Don't emit the attributes twice.
2192 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2194 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
2195 detect obsolete attributes.
2196 (Method.CreateEmitContext): Moved to MethodOrOperator.
2198 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2201 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
2202 customized exception to make crash detection easier.
2203 (MethodOrOperator): Started to work on new base class for methods and
2205 (Method): Derives from MethodOrOperator.
2206 (Constructor.Emit): Emits its own attributes.
2207 (AbstractPropertyEventMethod.Emit): Ditto.
2208 (Operator): Derives from MethodOrOperator, will refactor fully in extra
2210 (Operator.Emit): It's temporary more tricky than should be.
2212 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
2214 * report.cs (InternalErrorException): Add ctor with inner exception.
2216 2006-04-08 Marek Safar <marek.safar@seznam.cz>
2219 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
2222 2006-04-07 Marek Safar <marek.safar@seznam.cz>
2225 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
2228 2006-04-06 Marek Safar <marek.safar@seznam.cz>
2230 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
2231 attribute is present and Guid not.
2232 (Interface.ApplyAttributeBuilder): Ditto.
2234 * attribute.cs: Add error message.
2236 2006-04-06 Marek Safar <marek.safar@seznam.cz>
2240 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
2241 sources (it's composite) so hold them in extra array as they are used in
2242 Emit phase only. It worked in the previous versions by mistake.
2243 (Attribute.Emit): Emit attribute for more owners when exist.
2245 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
2246 it has now different behaviour.
2248 2006-04-04 Marek Safar <marek.safar@seznam.cz>
2250 * constant.cs (Constant.IsDefaultInitializer): New method.
2252 * class.cs: Updated.
2254 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
2255 re-initialize default values. It saves KBs almost for every assembly.
2256 Thanks Zoltan for the idea.
2257 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
2258 (ArrayCreation.DoResolve): Resolve only once.
2259 (ArrayCreation.Emit): Emit static initializer only when it is faster.
2260 (ArrayCreation.GetAttributableValue): Cope with optimized values.
2262 2006-04-03 Zoltan Varga <vargaz@gmail.com>
2264 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
2267 2006-04-01 Marek Safar <marek.safar@seznam.cz>
2269 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
2270 in an embedded statement too.
2272 2006-04-01 Raja R Harinath <rharinath@novell.com>
2275 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
2277 2006-04-01 Marek Safar <marek.safar@seznam.cz>
2281 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
2284 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
2286 2006-03-31 Marek Safar <marek.safar@seznam.cz>
2288 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
2291 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
2292 LocalTemporary change.
2294 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
2296 (ClassOrStruct.DefineFieldInitializers): Implemented static field
2297 initializers optimization.
2298 (ClassOrStruct.TypeAttr): Moved from modifiers.
2299 (Constructor.CheckBase): Don't crash when static ctor has parameters.
2300 (FieldBase.ResolveInitializer): Resolves initializer.
2301 (FieldBase.HasDefaultInitializer): New property.
2303 * cs-parser.jay: Removed message.
2305 * expression.cs (CompilerGeneratedThis): New specialization.
2307 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
2309 2006-03-28 Marek Safar <marek.safar@seznam.cz>
2311 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
2313 2006-03-27 Marek Safar <marek.safar@seznam.cz>
2315 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
2316 be now EnumConstants only.
2318 2006-03-27 Marek Safar <marek.safar@seznam.cz>
2320 * attribute.cs, driver.cs: Reset more caches.
2322 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2324 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
2326 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2328 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
2329 for easier reuse. Updated all overrides.
2330 (IntegralConstant): New base class for all integral constants.
2331 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
2332 of the constant range, report custom error.
2333 (UIntConstant.Reduce): Fixed uint conversion.
2335 * ecore.cs, literal.cs: Reduce updates.
2337 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2341 * class.cs (Constructor.Define): Removed extra if for default ctors.
2342 A patch from Atsushi Enomoto.
2344 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2346 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
2347 GetAttributableValue.
2349 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
2352 * convert.cs (ImplicitConversionRequired): Error message moved to
2355 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
2356 automatic implicit conversion of an output value.
2357 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
2359 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
2361 (TypeOf.GetAttributableValue): Add extra handling for object type.
2363 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
2364 special error message.
2366 2006-03-25 Marek Safar <marek.safar@seznam.cz>
2368 * class.cs (Constructor.Emit): Don't crash when struct ctor is
2370 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
2371 compatible with MS runtime.
2373 2006-03-23 Marek Safar <marek.safar@seznam.cz>
2375 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
2376 attribute arguments here.
2378 * class.cs (Indexer.Define): The check was moved to attribute class.
2380 2006-03-22 Marek Safar <marek.safar@seznam.cz>
2382 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
2383 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
2386 2006-03-22 Raja R Harinath <rharinath@novell.com>
2388 Support ParameterDefaultValueAttribute in gmcs. Also applied to
2389 mcs to keep code differences small.
2390 * attribute.cs (Attribute.GetParameterDefaultValue): New.
2391 * typemanager.cs (parameter_default_value_attribute_type): New.
2392 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
2395 2006-03-21 Marek Safar <marek.safar@seznam.cz>
2397 * expression.cs (StringConcat.Append): Reverted back to no warning state.
2399 2006-03-21 Marek Safar <marek.safar@seznam.cz>
2401 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
2403 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
2406 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
2408 * doc-bootstrap.cs : fix build.
2410 2006-03-20 Marek Safar <marek.safar@seznam.cz>
2412 * expression.cs (StringConcat.Append): Issue a warning when empty string
2415 2006-03-20 Marek Safar <marek.safar@seznam.cz>
2417 * assign.cs (CompoundAssign.ResolveSource): Removed.
2419 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
2422 * class.cs (TypeContainer.FindMethods): Removed.
2423 (TypeContainer.CheckMemberUsage): Made static.
2425 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
2427 * constant.cs (CheckRange): Removed unused type argument.
2428 (CheckUnsigned): Removed unused type argument.
2430 * cs-parser.jay: Updated after MemberAccess clean up.
2431 Uses Length for empty string test.
2433 * cs-tokenizer.cs: Uses Length for empty string test.
2434 (IsCastToken): Made static.
2435 (is_hex): Made static.
2436 (real_type_suffix): Made static.
2438 * decl.cs (SetupCache): Made static.
2439 (OnGenerateDocComment): Removed unused ds argument.
2441 * delegate.cs (VerifyDelegate): Removed unused argument.
2443 * doc.cs: Uses Length for empty string test.
2445 * driver.cs: Uses Length for empty string test.
2447 * enum.cs (IsValidEnumType): Made static
2449 * expression.cs (EnumLiftUp): Removed unused argument.
2450 (ResolveMethodGroup): Ditto.
2451 (BetterConversion): Ditto.
2452 (GetVarargsTypes): Ditto.
2453 (UpdateIndices): Ditto.
2454 (ValidateInitializers): Ditto.
2455 (MemberAccess.ctor): Ditto.
2456 (GetIndexersForType): Ditto.
2458 * flowanalysis.cs: (MergeFinally): Removed unused argument.
2460 * iterators.cs: Updated after MemberAccess clean up.
2462 * location.cs: Uses Length for empty string test.
2464 * namespace.cs: Uses Length for empty string test.
2466 * report.cs (CheckWarningCode): Made static.
2468 * statement.cs (LabeledStatement): Removed unused argument.
2470 * typemanager.cs (FilterNone): Removed.
2472 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2474 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
2477 * class.cs: Updated.
2479 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2481 * cs-parser.jay.cs: __arglist is not allowed for delegates.
2483 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2487 * expression.cs (VerifyArgumentsCompat): Reverted to double error
2488 reporting, it's more tricky than I thought.
2490 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2494 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
2496 (AnonymousMethod.ImplicitStandardConversionExists): New method.
2497 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
2498 Add more error reporting; Fixed issue with params.
2500 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
2502 * cs-parser.jay: AnonymousMethod requires host container.
2504 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
2506 2006-03-18 Raja R Harinath <harinath@gmail.com>
2508 * class.cs: Change 'TypeContainer ds' constructor argument to
2509 'DeclSpace parent'. Some classes were missed below due to
2510 different naming convention.
2512 * class.cs (MemberCore.Parent): Delete. This makes the
2513 ParentContainer changes below enforceable by the compiler.
2515 Treat pointers to enclosing declaration space as 'DeclSpace', not
2517 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
2518 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
2520 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
2522 (Block.AddThisVariable): Likewise.
2523 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
2524 (AbstractPropertyEventMethod.Emit): Likewise.
2525 (AbstractPropertyEventMethod.EmitMethod): Likewise.
2526 (GetMethod.Define, SetMethod.Define): Likewise.
2527 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
2528 (DelegateMethod.EmitMethod): Likewise.
2530 Fix regression test-partial-13.cs.
2531 Rationalize use of PartialContainer. Ensure that the partial
2532 class semantics can be tied to type-correctness, i.e., any
2533 violation will cause a compile error.
2534 * class.cs, const.cs: Access all fields that belong to class
2535 TypeContainer via ParentContainer. Arguments of EmitContexts and
2536 Resolve()-like functions still use 'Parent'.
2538 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
2539 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
2540 (PropertyMethod.CheckModifiers): Remove unused argument.
2541 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
2544 2006-03-17 Raja R Harinath <harinath@gmail.com>
2546 Make semantics of PartialContainer simpler.
2547 * decl.cs (DeclSpace.IsPartial): Remove.
2548 * class.cs (TypeContainer.IsPartial): Likewise.
2549 (TypeContainer..ctor): Set PartialContainer to point to self.
2550 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
2551 (TypeContainer.FindNestedType): Likewise.
2552 (MemberCore.ParentContainer): Simplify. Remove deprecation.
2554 2006-03-17 Marek Safar <marek.safar@seznam.cz>
2556 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2558 2006-03-15 Marek Safar <marek.safar@seznam.cz>
2560 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
2563 2006-03-15 Marek Safar <marek.safar@seznam.cz>
2565 * class.cs (Operator.Define): An error for base conversion was not
2568 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
2570 * iterator.cs : yield break is allowed in try statement which has
2571 catch clauses. Fixed bug #77767.
2573 2006-03-13 Marek Safar <marek.safar@seznam.cz>
2575 A fix for #77593, #77574.
2577 * class.cs (MethodCore.CheckBase): Another if for operator.
2579 2006-03-09 Marek Safar <marek.safar@seznam.cz>
2581 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
2584 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
2585 (DelegateCreation.ImplicitStandardConversionExists): New method for just
2588 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
2591 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
2592 Updated after another emitcontext usage was clean up. It should help us to
2593 synchronize with gmcs easier.
2595 2006-03-04 Marek Safar <marek.safar@seznam.cz>
2599 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
2600 (Event.Define): ditto
2601 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
2603 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
2604 Removed redundant code and set NewSlot for Invoke method too.
2606 * parameter.cs (Parameters.ctor): Add custom, type ctor.
2607 (Parameters.MergeGenerated): New method. Use this method when you merge
2608 compiler generated argument with user arguments.
2610 2006-03-03 Marek Safar <marek.safar@seznam.cz>
2612 * attribute.cs (ResolveAsTypeTerminal): Removed.
2614 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
2615 specialization for predefined types; 30% speed up.
2616 Finally placed obsolete check to right place.
2617 (Expression.ResolveType): Removed.
2619 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
2620 Updated after ResolveType was removed.
2622 * expression.cs (Cast.ctor): Check void cast.
2623 (Binary.ResolveAsTypeTerminal): Is never type.
2624 (Conditional.ResolveAsTypeTerminal): Is never type.
2626 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
2628 2006-03-01 Raja R Harinath <rharinath@novell.com>
2631 * expression.cs (ParameterReference.DoResolveBase): Change return
2633 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2637 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2640 * typemanager.cs (GetFullNameSignature): Don't nullref on
2641 protected accessors.
2643 2006-02-27 Marek Safar <marek.safar@seznam.cz>
2645 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
2646 these two separated members to simplify the code.
2647 (Attribute.Resolve): Refactored to use new fields and methods.
2648 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
2649 implemented obsolete attribute checking.
2650 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2651 implemented obsolete checking again. It look line never ending quest ;-)
2652 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2654 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2656 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2658 *class.cs (Property.Define): Add RegisterProperty call.
2660 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2661 argument groups (only 2).
2663 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2664 encoding expression to arguments.
2665 (Expression.ExprClassToResolveFlags): Just turned to property.
2667 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2668 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2669 optimized as well as implemented support for zero-length attributes.
2671 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2672 Add caching of PropertyInfo's.
2674 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2676 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2677 error multiple times.
2679 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2681 New partial class implementation.
2682 A fix for #77027, #77029, #77403
2684 * attribute.cs (Attributable): Made attributes protected.
2686 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2687 the replacements of ClassPart and PartialContainer.
2688 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2689 (TypeContainer.AddInterface): Ditto.
2690 (TypeContainer.AddPartial): The main method for partial classes. It checks
2691 for errors and merges ModFlags and attributes. At the end class is added to
2693 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2695 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2696 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2697 from the rest of partial classes.
2698 (TypeContainer.GetClassBases): Simplified.
2699 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2701 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2702 (TypeContainer.HasExplicitLayout): Uses Flags now.
2703 (PartialContainer): Removed.
2704 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2705 (StaticClass): Was merged with Class.
2706 (Class.GetClassBases): class and static class bases are verified here.
2707 (Class.TypeAttr): Added static attributes when class is static.
2708 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2709 (MemberBase): In some cases we need to call parent container for partial
2710 class. It should be eliminated but it's not easy now.
2712 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2714 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2715 partial classed to accumulate class comments.
2716 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2718 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2720 * driver.cs (MainDriver): Tree.GetDecl was removed.
2722 * modifiers.cs (Modifiers): Add partial modifier.
2724 * tree.cs (Tree.decl): Removed.
2725 (RootTypes): Started to use this class more often for root types
2728 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2732 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2733 external interface does not have an attribute.
2735 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2737 Another prerequisites for new partial classs implementation.
2739 * attribute.cs (Attribute.Equal): Implemented.
2740 (Attribute.Emit): Changed as attributes can be applied more than twice.
2741 (Attributes.Emit): Check for duplicate attributes here.
2743 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2744 as a parameter, clean-up.
2746 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2750 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2751 contains obsolete attribute check which can in some cases look for base
2752 type of current class which is not initialized yet.
2753 (TypeContainer.BaseType): Replacement of ptype.
2755 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2757 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2759 First of prerequisites for new partial classs implemention.
2761 * attribute.cs (Attributable): Extended by ResolveContext;
2762 Attributes finally have correct context for resolving in all cases.
2763 (AttachTo): Attribute owner is assigned here.
2765 * codegen.cs (IResolveContext): Introduce new interface to hold
2766 all information needed in resolving phase.
2767 (EmitContext): Implements IResolveContext; more clean-up needed here.
2769 * decl.cs (MemberCore): Implemented IResolveContext.
2771 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2772 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2773 parameter.cs, statement.cs, tree.cs, typemanager.cs:
2774 Refactored to use new IResolveContext instead of EmitContext; cleanup
2776 2006-02-06 Miguel de Icaza <miguel@novell.com>
2778 * codegen.cs (EmitScopeInitFromBlock): check here the
2779 capture_context, there is no need to make two calls to the
2782 * anonymous.cs: Add some debugging messages that might help me
2783 track other instances of this problem in the future (the
2784 regression of test 467).
2786 * cs-parser.jay: track the variable block, as we need to initalize
2787 any captured variables declared in this block for the "catch"
2788 portion of the "Try" statement.
2790 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2791 scope initialization for captured variables.
2793 Also, move the emit for the variables after the block location has
2796 2006-02-06 Marek Safar <marek.safar@seznam.cz>
2798 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2800 2006-02-02 Miguel de Icaza <miguel@novell.com>
2802 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2803 commit yesterday, the initialization for the roots is necessary.
2804 What is not necessary is the scope activation.
2806 2006-02-02 Raja R Harinath <rharinath@novell.com>
2808 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2809 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2811 (Argument.Resolve): Remove CS0206 checks.
2813 2006-02-01 Miguel de Icaza <miguel@novell.com>
2815 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2816 scopes for all the roots, the scopes will now be emitted when the
2817 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2819 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2820 code. This reduces a lot of existing cruft.
2822 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2823 that the ScopeInfo is generated as we enter the scope, not at the
2824 time of use, which is what we used to do before.
2826 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2827 every time a Block is about to be emitted if we have a
2830 2006-02-01 Raja R Harinath <rharinath@novell.com>
2832 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2834 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2836 * typemanager.cs (cons_param_array_attribute): Make private.
2837 (Reset): Set it to null.
2838 (InitCoreHelpers): Don't initialize it.
2839 (ConsParamArrayAttribute): New. Initialize it as needed.
2840 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2842 2006-01-31 Miguel de Icaza <miguel@novell.com>
2844 * expression.cs: There might be errors reported during the
2845 selection of applicable methods. If there are errors, do not
2846 continue execution as it will lead the compiler to crash.
2848 2006-01-30 Miguel de Icaza <miguel@novell.com>
2850 * expression.cs: Member access is not allowed on anonymous
2851 methods. Fixes #77402.
2853 2006-01-30 Raja R Harinath <rharinath@novell.com>
2856 * cs-parser.jay (VariableDeclaration): Don't set
2857 current_array_type to null.
2858 (field_declaration, event_declaration, declaration_statement):
2859 Set it to null here.
2861 2006-01-28 Raja R Harinath <harinath@gmail.com>
2863 * typemanager.cs (GenericParameterPosition): New.
2866 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
2868 * doc.cs : To process "include" elements, first we should create
2869 another list than XmlNodeList, because it could result in node
2870 removal, which could result in that the XmlNodeList gives up
2873 (Also made code identical to gmcs again.)
2875 2006-01-25 Miguel de Icaza <miguel@novell.com>
2877 * ecore.cs: Introduce an error report that we were not catching
2878 before, if not silent, we must report the error. Gonzalo ran into
2881 2006-01-23 Miguel de Icaza <miguel@novell.com>
2883 A fix for bug: #76957
2885 * iterators.cs (MoveNextMethod.CreateMethodHost): call
2886 ComputeMethodHost before creating the method, this is a new
2889 * anonymous.cs (AnonymousContainer): Now we track all the scopes
2890 that this method references (RegisterScope). The actual scope
2891 where the method is hosted is computed with the ComputeMethodHost
2892 before we create the method.
2894 Moved the Deepest routine here.
2896 (AnonymousContainer.ComputeMethodHost): New routine used to
2897 compute the proper ScopeInfo that will host the anonymous method.
2899 (ScopeInfo): Deal with multiple roots. The problem was that we
2900 did not have a unique root where all ScopeInfos could be hanged
2901 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
2904 Remove AdjustMethodScope which is now computed at the end. Remove
2905 LinkScope which did a partial link, instead link all ScopeInfos
2906 before code generation from the new "LinkScopes" routine.
2908 Simplify all the Add* routines as they no longer need to maintain
2909 the tree, they just need to record that they are using variables
2912 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2913 routines to produce the forest of ScopeInfo trees.
2915 * class.cs (TypeContainer.AppendMethod): This is just like
2916 AddMethod, but ensures that an interface implementation method
2917 (IEnumerable.XXX) is not inserted at the beginning of the queue of
2918 methods, but at the end.
2920 We use this functionality to ensure that the generated MoveNext
2921 method in the iterator class is resolved/emitted before the
2922 enumerator methods created.
2924 This is required because the MoveNext method computes the right
2925 ScopeInfo for the method. And the other methods will eventually
2926 need to resolve and fetch information computed from the anonymous
2929 2006-01-21 Raja R Harinath <harinath@gmail.com>
2930 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2933 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2935 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2936 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2938 2006-01-18 Raja R Harinath <rharinath@novell.com>
2940 Fix #76656, cs0231-2.cs.
2941 * cs-parser.jay (formal_parameter_list): Make error case catch
2943 (parenthesized_expression_0): Add CS1026 check.
2944 (invocation_expression): Remove unused { $$ = lexer.Location }.
2946 2006-01-17 Raja R Harinath <rharinath@novell.com>
2949 * cs-parser.jay (statement_expression): Don't list out the
2950 individual statement-expressions. Convert syntax error into
2953 2006-01-16 Raja R Harinath <rharinath@novell.com>
2956 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2957 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
2958 CheckIntermediateModification.
2959 (FieldExpr.DoResolve): Add new two-argument version that
2960 allows us to resolve the InstanceExpression as an lvalue.
2961 The one-argument variant is now just a wrapper.
2962 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2963 Resolve the lhs as an lvalue if the it has a value type.
2964 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2965 from Assign.DoResolve.
2966 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2967 resolved as an lvalue.
2968 (PropertyExpr.DoResolve): Update.
2969 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2970 has a value type. Move CS1612 check here from
2971 CheckIntermediateModification.
2972 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2973 * expression.cs (EmptyExpression.OutAccess): New. Used as the
2974 'right_side' of a ResolveLValue on an 'out' argument.
2975 (EmptyExpression.LValueMemberAccess): New. Used as the
2976 'right_side' of a propagated ResolveLValue on a value type.
2977 (LocalVariableReference.DoResolveBase): Recognize
2978 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2980 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2981 EmptyExpression.Null.
2983 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
2985 * typemanager.cs : added IsGenericParameter(). In mcs it always
2987 * doc.cs : for generic parameters, use GenericParameterPosition,
2990 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
2992 * expression.cs: Fix Console.WriteLine ((this = x).foo);
2994 2006-01-12 Miguel de Icaza <miguel@novell.com>
2996 This fixes the problem where we used ldfld instead of ldflda to
2997 load the "THIS" pointer on captured parameters, when THIS is a
2998 value type. See bug #77205.
3000 * iterators.cs (CapturedThisReference.Emit): Pass false to
3001 EmitThis (we do not need the address).
3003 * codegen.cs (EmitThis): it needs to know whether we need the
3004 address of `this' or not. This is used by value types.
3006 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
3007 every other call passes false.
3009 2006-01-12 Raja R Harinath <rharinath@novell.com>
3012 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
3014 * expression.cs (Invocation.OverloadResolve): Update.
3015 (Invocation.DoResolve): Avoid double resolution of invocation.
3017 2006-01-11 Raja R Harinath <rharinath@novell.com>
3020 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
3021 unary negation of floating point types as 0-expr; negation cannot
3022 overflow in floating point types.
3025 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
3026 on operands of 'void' type.
3029 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
3030 and ExclusiveOr for boolean constants too.
3032 2006-01-09 Raja R Harinath <rharinath@novell.com>
3035 * expression.cs (Invocation.OverloadResolve): Replace reflected
3036 override methods with their base virtual methods, rather than
3038 * typemanager.cs (TypeManager.GetOverride): New.
3040 2006-01-05 Jb Evain <jbevain@gmail.com>
3042 * class.cs (Property.Define, Indexer.Define): do not tag the
3043 properties as SpecialName | RTSpecialName.
3045 2006-01-04 Miguel de Icaza <miguel@novell.com>
3047 * class.cs (MethodCore.IsDuplicateImplementation): This method was
3048 doing a low-level comparission of parameter types. It was lacking
3049 a check for __argslist.
3051 2005-12-30 Miguel de Icaza <miguel@novell.com>
3053 * expression.cs (ParameterReference.DoResolveBase): Allow
3054 reference parameters if they are local to this block.
3056 This allows the ref and out parameters of a delegate to be used in
3057 an anonymous method, for example:
3059 delegate void set (out int x);
3061 set s = delegate (out int x){
3065 This is used by functionality introduced late in the C# language.
3067 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
3068 method that take ref and out parameters.
3070 Fixes #77119 which was a late change in the spec.
3072 2005-12-23 Miguel de Icaza <miguel@novell.com>
3074 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
3075 parent if its the same scope. Fixes #77060.
3077 2005-12-21 Miguel de Icaza <miguel@novell.com>
3079 * driver.cs: Report the case of no source files and no -out:
3082 2005-12-20 Raja R Harinath <rharinath@novell.com>
3085 * expression.cs (ComposedCast.GetSignatureForError): Define.
3087 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3091 * namespace.cs (NamespaceEntry): Add extern_aliases as a
3092 ListDictionary, to contain the ExternAliasEntry entries (in
3093 addition to the NamespaceEntry.aliases hashtable). This field is
3094 shared between the original entry and its doppelganger (bodyless
3096 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
3097 extern_aliases field.
3098 (NamespaceEntry.Lookup): Move the IsImplicit check after the
3099 lookup in extern_aliases.
3101 2005-12-16 Raja R Harinath <rharinath@novell.com>
3104 * class.cs (TypeContainer.Mark_HasEquals): New.
3105 (TypeContainer.Mark_HasGetHashCode): New.
3106 (ClassPart): Override them.
3107 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
3110 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
3111 'parent' argument to the base constructor.
3113 Remove all mention of TypeContainer from decl.cs.
3114 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
3115 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
3116 (DeclSpace.DeclSpace): Likewise.
3117 (DeclSpace.DefineMembers): Remove unused argument.
3118 * cs-parser.jay (pop_current_class): Update to changes. Simplify
3119 debugging check -- we don't care if the debug code throws an
3120 InvalidCastException instead of an InternalErrorException.
3121 * class.cs (TypeContainer.DefineMembers): Update to changes.
3122 (TypeContainer.DoDefineMembers): Likewise.
3123 (TypeContainer.GetMethods): Likewise.
3124 (PropertyMember.Define): Likewise.
3125 (MemberBase.Parent): New property that forwards to
3126 MemberCore.Parent, but ensures that we get a TypeContainer.
3127 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
3128 (RootContext.PopulateTypes): Likewise. Remove special case code
3129 for !RootContext.StdLib: DefineMembers is idempotent.
3131 2005-12-14 Miguel de Icaza <miguel@novell.com>
3133 * convert.cs (ExplicitConversionCore): Check the return value from
3134 ExplicitConversionCore which can return null on failure. Fixes #76914
3136 2005-12-13 Marek Safar <marek.safar@seznam.cz>
3138 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
3140 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
3142 * doc.cs : The search for referenced namespace was insufficient to
3143 get global one as it used to do. Fixed bug #76965.
3145 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
3147 * doc.cs : check name in cref in the last phase that whether it is
3150 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
3152 * cs-tokenizer.cs : reverted the latest change: it somehow broke
3155 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
3157 * doc.cs : so it turned out that we cannot skip override check for
3158 interface members. Fixed bug #76954.
3160 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
3162 * cs-tokenizer.cs : fixed bug #75984:
3163 - #warning and #error should not be handled when the source line
3165 - #line is not checked strictly when the source line is disabled.
3166 - #define and #undef is on the other hand checked strictly at any
3169 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
3171 * cs-tokenizer.cs : missing Location (actually, filename) in one of
3174 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3176 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
3178 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
3180 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
3181 (FieldBase.Initializer): Initializer is now optional.
3182 (EventField.Define): Only event field can have initializer.
3184 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
3186 * const.cs (Const): Reuse initializer.
3188 * cs-parser.jay: Updated after FieldBase changes.
3189 Added current_array_type to simplify array initializers.
3191 * ecore.cs (NullCast.IsDefaultValue): Implemented.
3193 * expression.cs, iterators.cs: Updated.
3195 * namespace.cs (NamespaceEntry): Made UsingFound private.
3197 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3199 * parameterCollection.cs: Obsolete, removed.
3200 * parser.cs: Obsolete, removed.
3202 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3205 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
3207 * enum.cs (Enum.Define): Set obsolete context here.
3209 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
3212 - FindDocumentedMember() now expects 1) paramList as null
3213 when "we don't have to check the number of parameters" and
3214 2) Type.EmptyTypes when "there is no arguments".
3215 - Introduced FoundMember struct to hold the exact type which was
3216 used to find the documented member (the above change broke
3217 test-xml-044; it might be better just to use DeclaringType than
3218 what MS does, like this change does, but it depends on usage.)
3220 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
3222 * doc.cs : documented member might be from DeclaringType for nested
3223 types. Fixed bug #76782.
3225 2005-12-03 Ben Maurer <bmaurer@ximian.com>
3227 * anonymous.cs: Have the param code handle leaving copies on the
3228 stack etc. Allows anonymous params to take part in the assignment
3229 code (++, +=, etc). Fixes bug #76550
3231 * expression.cs: Handle the prepare_for_load/leave_copy by passing
3232 it down to the anon code.
3234 * iterators.cs: Use dummy var here
3236 * codegen.cs: Handle new vars
3238 2005-12-01 Marek Safar <marek.safar@seznam.cz>
3241 * class.cs (MethodData.Define): Set proper Obsolete context.
3243 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
3245 (FieldExpr.DoResolve): Ditto.
3247 2005-12-01 Marek Safar <marek.safar@seznam.cz>
3250 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
3251 parent is not obsolete.
3253 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
3255 * doc.cs : (FindDocumentedMember) find parameterless members first
3256 and get CS0419 in the early stage. Fixed first case of bug #76727.
3258 2005-11-30 Marek Safar <marek.safar@seznam.cz>
3261 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
3262 no error was reported.
3264 *expression.cs (Binary.DoResolve): left can be null.
3266 2005-11-22 Marek Safar <marek.safar@seznam.cz>
3269 * class.cs (MethodData.Emit): Parameters should be labeled first.
3271 2005-11-21 Marek Safar <marek.safar@seznam.cz>
3274 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
3276 2005-11-18 Marek Safar <marek.safar@seznam.cz>
3278 * attribute.cs (AreParametersCompliant): Moved to Parameter.
3280 * class.cs (MethodCore): Parameter clean up.
3281 (IMethodData): Added ParameterInfo.
3282 (MethodData): Parameter clean up.
3283 (Indexer.Define): Parameter clean up.
3295 * typemanager.cs: Parameter clean up.
3297 * delegate.cs (Define): Get rid of duplicated code.
3299 * expression.cs (ParameterReference): Removed useless parameters
3301 (Invocation): Ditto.
3303 * parameter.cs (ParamsParameter): New class, params specialization.
3304 (ArglistParameter): Attemp to separate arglist.
3305 (Parameter): Refactored to be reusable and faster.
3306 (Parameter.Modifier): Made understandable.
3307 (Parameters): Changed to be used as a class for `this' assembly
3308 parameters. Refactored to use new specialized classes.
3310 * support.cs (ParameterData): Added Types property.
3311 (InternalParameters): Deleted.
3313 2005-08-20 Martin Baulig <martin@ximian.com>
3315 Merging this patch from GMCS to fix #75867.
3317 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3318 scope if we don't already have it.
3320 2005-11-17 Martin Baulig <martin@ximian.com>
3323 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
3324 inherit the scope from our parent. Fixes #76653.
3326 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3328 * doc.cs : the previous patch does not actually fix the bug.
3329 PropertyInfo override check is now implemented and really fixed it.
3330 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
3332 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3334 * doc.cs : apply "override filter" also to properties.
3337 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3339 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
3340 no need to check overrides. For classes, omit those results from
3341 interfaces since they must exist in the class. Fixed bug #76726.
3343 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3345 * typemanager.cs : (GetFullNameSignature) differentiate indexers
3346 with different parameters. Fixed the second problem in #76685.
3348 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3350 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3351 get expected 'protected' access in CheckValidFamilyAccess()).
3354 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3356 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3357 Fixed bug #76705. CS1569 was incorrectly commented out.
3359 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3361 * doc.cs : use Invocation.IsOverride() to do real override check.
3362 * expression.cs : made Invocation.IsOverride() internal.
3364 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3366 * doc.cs : use TypeManager.FindMembers() instead of (possible)
3367 TypeBuilder.FindMembers() and filter overriden base members out.
3370 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3372 * doc.cs : ref/out parameters are represented as '@' (instead of
3373 '&' in type FullName). Fixed bug #76630 (additionally crefs).
3375 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3377 * doc.cs : when there was no '.' in cref to methods in doc comment,
3378 then parameters were missing in the output. Fixed bug #76691.
3380 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3382 * driver.cs : don't output docs when there is an error.
3385 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3388 Now it should detect indexers. Fixed primary concern in bug #76685.
3389 Fixed CS0419 message to not show the identical member signature in
3392 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3394 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3395 instead of Type.FindMembers() since it does not handle events.
3398 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
3400 * codegen.cs: Fixed typo (speficied -> specified).
3402 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3405 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3407 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3409 * attribute.cs: Changed error message.
3411 * cs-tokenizer.cs: One more check.
3413 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3415 * statement.cs (Block.Resolve): Ignore empty statement.
3417 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3419 * report.cs: Made error/warning methods more strict to avoid
3422 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3423 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3424 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3425 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3427 2005-11-08 Marek Safar <marek.safar@seznam.cz>
3429 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3430 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3432 * class.cs (TypeContainer.IsComImport): New property.
3433 (Constructor.Define): Create proper ctor for ComImport types.
3435 * expression.cs (New.CheckComImport): Fixed.
3437 2005-11-07 Miguel de Icaza <miguel@novell.com>
3439 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3440 that a parameter has been captured does not mean that we do not
3441 have to do the rest of the processing. This fixes the second part
3442 of #76592. If there was another anonymous method capturing
3443 values in the past, the Scope would never be set for the second
3444 method that captured the same parameter.
3446 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3447 properly manipulate the stack. Second part of fix for #76592.
3449 * expression.cs (New): Add support for invoking "new" on
3450 interfaces that have been flagged with the ComImport attribute and
3451 the CoClass. Fixes #76637
3453 * statement.cs (Try.DoEmit): When a variable is captured, do not
3454 try to emit the vi.LocalBuilder variable as it has been captured.
3455 Create a temporary variable and store the results on the
3456 FieldBuilder. Fixes #76642
3458 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3460 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3462 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3464 * expression.cs (Binary.DoResolve): Added && optimalization.
3466 * typemanager.cs (AddUserType): Removed useless argument.
3468 2005-11-04 Marek Safar <marek.safar@seznam.cz>
3470 * statement.cs (Block.variables): Uses ListDictionary.
3472 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3475 * class.cs (PartialContainer.EmitType): Customized to emit
3476 security attributes.
3477 (ClassPart.ApplyAttributeBuilder): Transform security attribute
3478 for partial classes.
3480 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3483 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3484 access has to be fixed.
3486 * typemanager.cs (IsUnmanagedType): Wrong common field type.
3488 2005-11-01 Marek Safar <marek.safar@seznam.cz>
3491 * ecore.cs (NullCast.Reduce): Implemented.
3493 * expression.cs (ArrayCreation.CheckIndices): Correcly check
3496 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3498 (Foreach.Resolve): Catch null properly.
3500 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3502 * cs-tokenizer.cs: Warning text fix.
3504 * driver.cs: AllWarningNumbers exposed on public interface.
3506 * report.cs (): Reviewed warning numbers.
3507 (IsValidWarning): Use binary search.
3509 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3511 * driver.cs: Implemeted resource visibility.
3512 (Resources): New class for code sharing between /res: and
3515 2005-10-28 Marek Safar <marek.safar@seznam.cz>
3518 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3521 * convert (Convert.ImplicitReferenceConversion): NullCast holds
3524 * ecore.cs (NullCast): Child is contant only.
3526 * literal.cs (NullLiteral.Reduce): null can be converted to any
3529 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
3531 * driver.cs: Use Encoding.Default as default code page instead
3534 2005-10-27 Raja R Harinath <rharinath@novell.com>
3537 * expression.cs (Invocation.Error_InvalidArguments): Handle
3538 __arglist parameters.
3539 (Invocation.VerifyArgumentsCompat): Likewise.
3540 * support.cs (ReflectionParameters.GetSignatureForError): Print
3541 __arglist parameters.
3542 (InternalParamters.GetSignatureForError): Likewise.
3543 * parameter.cs (Parameters.GetSignatureForError): Likewise.
3545 2005-10-26 Marek Safar <marek.safar@seznam.cz>
3547 * attribute.cs (GetPropertyValue): Made public.
3549 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3551 Add new property WrapNonExceptionThrows to handle 2.0 assembly
3553 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3556 * driver.cs: Reflect method name change.
3558 * statement.cs (Try.Resolve): Warn when try has both general
3561 * typemanager.cs: runtime_compatibility_attr_type new predefined
3564 2005-10-26 Raja R Harinath <harinath@gmail.com>
3567 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3568 treat it as an empty parameter list.
3570 2005-10-26 Raja R Harinath <rharinath@novell.com>
3573 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
3574 ResolveAsTypeStep silent.
3575 * statement.cs (Block.AddConstant): Mark block as used.
3576 (Block.ResolveMeta): Avoid piling on error messages
3577 if a constant initializer resolution fails.
3579 2005-10-25 Raja R Harinath <rharinath@novell.com>
3581 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3583 (NamespaceEntry.VerifyAllUsing): New.
3584 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
3585 behaviour. Delegates actual resolution of alias to ...
3586 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
3587 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3589 * driver.cs (Driver.MainDriver): Update.
3591 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3592 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3594 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3596 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3597 RootNamespace.DefineNamespacesForAll.
3599 2005-10-24 Raja R Harinath <harinath@gmail.com>
3601 * typemanager.cs (assemblies, external_aliases, modules)
3602 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3603 (ComputeNamespaces, GetRootNamespace): Remove extra staging
3604 overhead. Move resposibility ...
3605 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
3606 * driver.cs, attribute.cs, codegen.cs: Update to changes.
3608 2005-10-23 Raja R Harinath <harinath@gmail.com>
3610 * namespace.cs (RootNamespace.all_namespaces): Renamed from
3611 cached_namespaces. Improve usage.
3612 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3613 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3614 Move from GlobalRootNamespace and simplify.
3615 (RootNamespace.Global): Make instance variable.
3616 (RootNamespace.RootNamespace): Add "alias name" parameter.
3617 (GlobalRootNamespace): Simplify drastically.
3618 (Namespace.Lookup): Don't use GetNamespace.
3619 * typemanager.cs (GetRootNamespace): Rename from
3620 ComputeNamespaceForAlias.
3621 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3623 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3625 * anonymous.cs (AnonymousContainer): Don't crash when container
3628 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3630 * expression.cs (Binary.DoResolve): Warn when comparing same
3633 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3636 * expression.cs (Binary.DoResolve): It looks like there are no
3637 convetsion rules in enum context.
3639 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3641 Add support for extern alias qualifiers.
3642 * typemanager.cs: Move some LookupTypeReflection code
3643 to namespace.cs, to have cleaner code. Added some methods
3644 to help us keep track of the extern aliased references.
3645 * driver.cs: Add suport for extern alias assemblies on command
3646 line and check for their warnings/errors. Also keep track of the
3647 extern aliased assemblies.
3648 * namespace.cs: Move the global functionality of Namespace
3649 to GlobalRootNamespace/RootNamespace. Now the global namespace
3650 is GlobalRootNamespace.Globa. Also the code moved from
3651 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
3652 Finally added LocalAliasEntry (AliasEntry before) and
3653 ExternAliasEntry, to handle alias statements.
3654 * cs-parser.jay: Add support in the grammar for extern alias
3656 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
3657 Update callings to Namespace (now in GlobalRootNamespace).
3659 2005-10-18 Raja R Harinath <rharinath@novell.com>
3662 * class.cs (TypeContainer.DefineType): Move updating of
3663 topological sort earlier in the code.
3664 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3666 2005-10-18 Marek Safar <marek.safar@seznam.cz>
3669 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3671 * constant.cs (Constant.TryReduce): Moved from Cast class.
3672 (Reduce): Made little bit more OO and fixed missing conversions.
3674 * ecore.cs (Reduce): Implemented.
3675 (Binary.EnumLiftUp): New method to upgrade values to enum values.
3677 * literal.cs (Reduce): Implemented.
3679 * class.cs: Reverted Miguel's wrong commit.
3681 2005-10-14 Miguel de Icaza <miguel@novell.com>
3683 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3685 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
3687 * cs-parser.jay, expression.cs : CS0214 was missing error location
3688 for constants. Fixed bug #76404.
3690 2005-10-11 Marek Safar <marek.safar@seznam.cz>
3693 * convert.cs (ExplicitConversionCore): Fixed object->enum
3696 2005-10-10 Raja R Harinath <rharinath@novell.com>
3698 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3700 (PropertyExpr.EmitCall): Likewise.
3701 * expression.cs (Invocation.EmitArguments): Handle case where
3703 (Invocation.EmitCall): Avoid allocating temporary variable if
3704 there are no arguments.
3706 2005-10-07 Raja R Harinath <rharinath@novell.com>
3709 * convert.cs (ImplicitConversionStandard): Move conversion of
3710 void* to arbitrary pointer types ...
3711 (ExplicitConversionStandard): .. here.
3712 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3713 error to always print typenames.
3715 2005-10-07 Raja R Harinath <rharinath@novell.com>
3717 * convert.cs (GetConversionOperator): Rename from
3718 GetConversionOperators. Move operator selection code from ...
3719 (UserDefinedConversion): ... here.
3721 2005-10-06 Marek Safar <marek.safar@seznam.cz>
3723 * convert.cs (ExplicitConversionCore): Removed duplicate enum
3726 2005-10-05 Marek Safar <marek.safar@seznam.cz>
3728 * assign.cs (Assign.DoResolve): Error method changed.
3730 * cfold.cs (DoConstantNumericPromotions): Error method changed.
3732 * const.cs (ResolveValue): Reset in_transit immediately.
3734 * constant.cs: Error method changed.
3736 * convert.cs: Removed useless location parameter.
3737 (ExplicitNumericConversion): Don't do double enum check.
3738 (ExplicitConversionCore): Renamed from ExplicitConversion.
3739 (ExplicitUnsafe): Extracted from ExplicitConversion.
3740 (ExplicitConversion): Uses for error reporting.
3742 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3744 (ResolveBoolean): Uses common error method.
3745 (CastToDecimal): Get rid of ec.
3746 (CastFromDecimal): Optimized.
3747 (ConvCast): Get rid of ec.
3749 * enum.cs (ResolveValue): Reset in_transit immediately.
3750 (Emit): Return after first error.
3752 * expression.cs: Convert changes.
3754 * literal.cs: Error method changed.
3756 * statement.cs: Error method changed.
3758 2005-10-03 Raja R Harinath <rharinath@novell.com>
3760 * support.cs (SeekableStreamReader.Position): Don't error out when
3761 the requested position is just beyond the end of the current
3764 2005-09-28 Raja R Harinath <rharinath@novell.com>
3766 * support.cs (SeekableStreamReader): Simplify drastically. Don't
3767 try to keep in sync with the byte count of the underlying Stream.
3768 However, this limits us to a window size of 2048 characters: i.e.,
3769 the maximum lookahead of our lexer/parser can be 2048 characters.
3771 2005-09-28 Marek Safar <marek.safar@seznam.cz>
3774 * driver.cs: Fix compilation files with full root path.
3776 2005-09-25 Miguel de Icaza <miguel@novell.com>
3778 * report.cs (SymbolRelatedToPreviousError): Format the output so
3779 it does not use an open parenthesis that is never closed.
3781 * driver.cs: Follow coding guidelines
3783 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3786 * const.cs (Const.ResolveValue): Check for assigning non-null
3787 value to reference type.
3789 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3791 * anonymous.cs: Implemented ExprClassName.
3793 * assign.cs (Assign.DoResolve): Don't chrash when type is not
3796 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3799 * class.cs (StaticClass.DefineContainerMembers): Report protected
3802 * codegen.cs: if(ed) PRODUCTION.
3804 * convert.cs (Error_CannotImplicitConversion): Better error
3807 * cs-parser.jay: More error checks.
3809 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3811 * driver.cs (CSCParseOption): Enabled wrong option check.
3813 * ecore.cs (Expression.ExprClassName): Turned to property.
3814 (MemberExpr.CheckIntermediateModification): For checking boxed
3815 value types modification.
3817 * statement.cs (Fixed.Resolve): Expression type must be
3818 convertible to fixed type.
3819 (CollectionForeach.GetEnumeratorFilter,TryType):
3820 Small refactoring for easier error checking.
3822 2005-09-26 Marek Safar <marek.safar@seznam.cz>
3824 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3827 * class.cs (GeneratedBaseInitializer): New class for customization
3828 compiler generated initializers.
3829 (MemberBase.DoDefine): Check Obsolete attribute here.
3830 (FieldMember.DoDefine): Ditto.
3832 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3835 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3836 (MemberCore.GetObsoleteAttribute): Removed argument.
3837 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3838 (MemberCore.CheckObsoleteType): New helper.
3842 * statement.cs: Updates after MemberCore changes.
3844 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3845 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3847 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3848 obsolete attribute for compiler construct.
3849 (As.DoResolve): Cache result.
3851 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3853 2005-09-26 Raja R Harinath <rharinath@novell.com>
3856 * expression.cs (This.VerifyFixed): In a value type T, the type of
3857 'this' is T&, iow, 'this' is either an out or ref parameter. In a
3858 value type R, 'this' is treated as a value parameter.
3860 2005-09-22 Miguel de Icaza <miguel@novell.com>
3862 * statement.cs (Lock): Use the TemporaryVariable class instead of
3863 manually using local variables as those do not work when variables
3866 * ecore.cs: Moved the TemporaryVariable class from being a nested
3867 class inside Foreach to be a public class that can be employed in
3870 2005-09-19 Marek Safar <marek.safar@seznam.cz>
3872 * cs-parser.jay: interface_accessors replaced by
3873 accessor_declarations.
3875 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3878 * statement.cs (GotoCase.Resolve): Convert null constant to
3880 (SwitchLabel.ResolveAndReduce): Ditto.
3881 (SwitchLabel.NullStringCase): Custom null stamp.
3882 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3884 typemanager.cs (CSharpSignature): Don't skip first argument
3887 2005-09-18 Miguel de Icaza <miguel@novell.com>
3889 * driver.cs: Set InEmacs based on the environment variable EMACS.
3891 * location.cs (InEmacs): in this mode, do not report column
3892 location as it confuses Emacs.
3894 2005-09-16 Marek Safar <marek.safar@seznam.cz>
3896 * cfold.cs, constant.cs, convert.cs, ecore.cs,
3897 expression.cs, iterators.cs, literal.cs: Store constants and
3900 * class.cs (MemberBase.ShortName): Pass location.
3902 * cs-parser.jay: Some location fixes.
3904 * ecore.cs (Expression.Location): Made virtual.
3906 2005-09-05 Miguel de Icaza <miguel@novell.com>
3908 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3909 if the underlying types are the same, otherwise we need to produce
3910 code that will do the proper cast.
3912 This was exposed by Marek's constant rewrite which produced
3913 invalid code for the call site:
3916 void Method (X v) {}
3920 This fixes test-49.cs
3922 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3924 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3925 Type/Object should be allowed as well. Fixed bug #75968.
3927 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3929 * expression.cs : (Binary.DoResolve): when one is enum constant and
3930 another is constant 0, then return enum one *as enum type*.
3933 2005-09-02 Raja R Harinath <rharinath@novell.com>
3935 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3939 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3940 flow-branching for LocalVariableReferences in case we were invoked
3941 from a MemberAccess.
3942 * expression.cs (LocalVariableReference.VerifyAssigned): New.
3944 (LocalVariableReference.DoResolveBase): ... this.
3945 (MemberAccess.Resolve): Do the check that was disabled during
3948 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3951 (PartialContainer.Create): check abstract/sealed/static strictly
3952 but abstract/sealed can exist only at one side. Fixed bug #75883.
3954 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
3957 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3958 specified, don't default to UnmanagedType.I4.
3960 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3962 * expression.cs : conditional operator should check possibly
3963 incorrect assign expression. Fixed bug #75946.
3965 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
3967 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
3968 Reverting the change. gmcs is much complex than mcs on this matter.
3970 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
3972 * cs-tokenizer.cs : To read another token ahead of the actual
3973 consumption, use new SavedToken and cache token instead of moving
3974 back the stream with SeekableStreamReader (it seemed problematic).
3976 driver.cs : Thus use StreamReader directly.
3977 * support.cs : Thus removed SeekableStreamReader.
3979 2005-08-30 Raja R Harinath <rharinath@novell.com>
3982 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3983 (ScopeInfo.EmitScopeType): Use it to construct field names from
3984 names of captured locals.
3987 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3988 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3989 Pass 'target_type' to BoxedCast. Don't default to 'object'.
3990 (ExplicitConversion): Remove enum cases already handled by
3991 implicit conversion. Move implicit conversion check to the beginning.
3992 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3993 * expression.cs (ArrayCreation.EmitDynamicInitializers):
3994 Don't treat System.Enum as a struct.
3996 2005-08-30 Jb Evain <jbevain@gmail.com>
3998 * attribute.cs: handles as expression in parameters.
4000 2005-08-30 Raja R Harinath <rharinath@novell.com>
4003 * class.cs (TypeContainer.VerifyClsName): Don't use a
4004 PartialContainer when verifying CLS compliance.
4005 (AbstractPropertyEventMethod): Set Parent here, ...
4006 (PropertyMethod): ... not here.
4008 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
4010 * attribute.cs : escaped attribute name should not be allowed to be
4011 resolved (e.g. @class as classAttribute). Fixed bug #75930.
4013 2005-08-29 Raja R Harinath <rharinath@novell.com>
4016 * convert.cs (ImplicitStandardConversionExists): Allow zero also
4017 when converting a long constant to unsigned long.
4018 * expression.cs (Invocation.OverloadResolve): Add sanity check to
4019 detect where IsApplicable and VerifyArgumentsCompat disagree.
4021 2005-08-29 Raja R Harinath <rharinath@novell.com>
4022 and Carlos Alberto Cortez <carlos@unixmexico.org>
4025 * class.cs (TypeContainer.CanElideInitializer): New helper.
4026 (TypeContainer.EmitFieldInitializers): Use it to determine if we
4027 can safely emitting the initializer of a field.
4029 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4031 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
4032 allowed inside a switch (without loop). Fixed bug #75433.
4034 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
4036 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4037 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4039 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4041 * driver.cs : kinda reverting the default encoding changes (not exact
4042 revert since I noticed that "codepage:reset" might not work fine).
4044 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4046 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
4047 Location. Now getter and setter store location correctly.
4048 (errors/cs0111-12.cs now reports the expected location.)
4050 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4052 * driver.cs : Use default encoding on the environment.
4053 Removed (now that) extra parameter for SeekableStreamReader.
4054 * support.cs : (SeekableStreamReader) third .ctor() argument for
4055 StreamReader is not required (always true). preamble size could
4056 be acquired in simpler and safe way.
4058 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
4060 * cs-parser.jay: report CS0642 at warning level 3
4061 and report CS0642 for an if else statement also
4062 fixes bug #74745. Patch by John Luke (and a bit
4064 Removed extra CS0642 warning check for "while",
4066 * statement.cs: In Block.Resolve(), CS0642 check
4067 is reimplemented to check a sequence of an empty
4068 statement and a block.
4070 Both fix bug #66777.
4072 2005-08-24 Marek Safar <marek.safar@seznam.cz>
4074 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
4075 detection until I fix it.
4077 * cs-tokenizer.cs: Changed error message.
4079 * cs-parser.jay: Fixed 2 error locations.
4081 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
4082 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
4085 * enum.cs (GetSignatureForError): Fixed.
4087 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
4091 * typemanager.cs (RegisterProperty): Removed.
4093 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
4095 2005-08-24 Raja R Harinath <rharinath@novell.com>
4098 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
4099 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
4101 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4103 * expression.cs : tiny fix is required for not warning positive ulong.
4106 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4108 * expression.cs : add CS0652 check for constant and integral
4109 expression. Fixed bug #53974.
4111 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4113 * expression.cs : in DoNumericPromotions(), check if there is implicit
4114 conversion overload for string (to check CS0034). Fixed bug #52492.
4116 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4118 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
4120 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4122 * ecore.cs : report location when it is *not* Null.
4124 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4130 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4131 correctly. Fixed bug #75721.
4133 2005-08-23 Raja R Harinath <rharinath@novell.com>
4135 * support.cs (SeekableStreamReader.Position): Avoid an expensive
4136 loop that performs 'min (pos, char_count)'.
4139 * expression.cs (Unary.ResolveOperator): Don't discard implicit
4140 converted value in Operator.OnesComplement.
4142 2005-08-22 Ben Maurer <bmaurer@ximian.com>
4144 * anonymous.cs: If the anon method is pulled into a helper class,
4145 it needs to be `internal' not `private'. Fixes runtime behavior on
4148 2005-08-20 Martin Baulig <martin@ximian.com>
4150 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4151 scope if we don't already have it.
4153 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4154 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4157 2005-08-17 Marek Safar <marek.safar@seznam.cz>
4160 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4163 2005-08-16 Marek Safar <marek.safar@seznam.cz>
4165 The big constants rewrite
4166 Fix #75746, #75685 and more
4167 As a side effect saved 1MB for MWF ;-)
4169 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4170 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4171 enum based for corlib compilation.
4173 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4176 * class.cs (FixedField.Define): Use ResolveAsConstant.
4178 * const.cs (IConstant): Interface constants and enums.
4179 (Const.ResolveValue): New method for constant resolvning.
4180 (ExternalConstant): Constants from imported assemblies.
4182 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4183 conversion; like enums.
4184 (Constant.ToType): Converts this constant to different type.
4185 (Constant.Increment): Adds 1.
4187 * convert.cs (ImplicitConversionRequired): Simplified.
4189 * cs-parser.jay: Create EnumMember directly.
4191 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4193 * doc.cs (GenerateEnumDocComment): Removed.
4195 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4196 (ConvertIntLiteral): Removed.
4197 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4199 * enum.cs (EnumMember): Implement IConstant.
4200 (Enum.IsValidEnumConstant): Removed.
4201 (Enum.GetNextDefaultValue): Removed.
4202 (Enum.FindMembers): Updated.
4203 (Enum.GenerateDocComment): Iterate enum members.
4205 * expression.cs (Cast.TryReduce): Handle enums correctly.
4206 (New.Constantify): Made public.
4207 (MemberAccess.DoResolve): Removed contant specific if(s).
4209 * literal.cs (NullLiteral): Implement new abstract methods.
4211 * statement.cs (GotoCase.Resolve): Use new constant methods.
4212 (SwitchLabel.ResolveAndReduce): Use new constant methods.
4214 * typemanager.cs (LookupEnum): Removed.
4215 (IsEnumType): Fixed to work with corlib.
4216 (RegisterConstant): Removed.
4217 (LookupConstant): Removed.
4218 (GetConstant): Changed to work with IConstant.
4220 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
4222 * location.cs : Fixed overflown (>255) column number.
4224 2005-08-03 Raja R Harinath <rharinath@novell.com>
4226 First cut of the qualified-alias-member feature.
4227 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4229 * cs-parser.jay (DOUBLE_COLON): New token.
4230 (namespace_or_type_name): Add rule for recognizing
4231 qualified-alias-members.
4232 (primary_expression): Likewise.
4233 (element_access): Allow QualifiedAliasMember as a possible
4234 type-bearing expression.
4235 (local_variable_type, local_variable_pointer_type): Likewise.
4236 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
4237 aliases in the current and enclosing namespace declarations.
4238 (NamespaceEntry.UsingAlias): Add CS0440 warning.
4239 * decl.cs (MemberName.is_double_colon): New.
4240 (MemberName.MemberName): Add new constructor for alias-member.
4241 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4242 * expression.cs (QualifiedAliasMember): New expression type.
4244 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4246 * location.cs : it borked when no argument was specified.
4248 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4250 * location.cs : tiny ToString() format fix.
4252 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4254 * statement.cs : oops, it was missing.
4256 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4258 A set of fixes for precise line/column location.
4261 "token" field now holds a file/line "delta", a line number offset
4262 from the segment, and a column number. See also:
4263 http://lists.ximian.com/pipermail/mono-devel-list/2004-
4264 December/009508.html
4265 Removed static IsNull. Use instance IsNull property instead.
4267 For some tokens it stores Location. For Identifier it stores
4268 LocatedToken which is a pair of string name and location.
4269 Column numbers are adjusted only at getChar().
4271 Use Location.ToString() for reporting (it now contains column).
4273 Largely modified to use LocatedToken instead of
4274 string (IDENTIFIER), and to acquire Location from some tokens.
4275 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4276 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4278 Now MemberName holds Location. DeclSpace.ctor() receives Location
4279 as a parameter. Removed extra parameters to all derived classes.
4280 Replaced Location.IsNull() with instance property.
4281 * assign.cs, expression.cs :
4282 Added .ctor() overload that omits Location.
4284 Added "nameEscaped" flag that indicates the identifier was escaped
4285 in the source file. This fixes bug #57047.
4287 2005-08-02 Marek Safar <marek.safar@seznam.cz>
4289 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4290 New method, looking for lo-case imported cls type.
4292 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4295 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4297 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4299 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4301 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4303 Optimized to save 3.5 MB for SWF compilation.
4305 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4307 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4308 (PartialContainer.Create): Moved logic AddToContainer.
4309 (PartialContainer.MarkForDuplicationCheck): Shares name.
4311 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4314 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4316 (Namespace.GetSignatureForError): New method.
4318 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4319 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4321 2005-08-01 Raja R Harinath <rharinath@novell.com>
4324 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4325 member lookup rather than qualifier_type, since qualifier_type can
4328 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4330 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4333 2005-07-31 Miguel de Icaza <miguel@novell.com>
4335 * statement.cs: Copy the local exception into the exception
4336 captured local. Fixes 75674
4338 2005-07-31 Raja R Harinath <harinath@gmail.com>
4341 * expression.cs (Invocation.OverloadResolve): Don't report error
4342 CS1501 if error CS1502 has been reported.
4343 (New.DoResolve): Delegate CS1501 reporting to
4344 Invocation.OverloadResolve.
4347 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4348 invariant-meaning-in-block property in an enclosing block if
4351 2005-07-29 Marek Safar <marek.safar@seznam.cz>
4353 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4354 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4355 (Switch.CheckSwitch): Just save 50kb for SWF.
4357 2005-07-27 Martin Baulig <martin@ximian.com>
4359 * anonymous.cs (CaptureContext.AddField): Added
4360 `AnonymousContainer am' argument; compute its toplevel scope if
4361 it's not already computed. Fixes #75649.
4363 2005-07-26 Raja R Harinath <rharinath@novell.com>
4366 * class.cs (Constructor.Emit): Reset block to null if the block
4369 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4371 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4373 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4375 * class.cs (MethodData.Define): Check whether accessor implementing
4376 interface is public.
4378 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4380 2005-07-22 Marek Safar <marek.safar@seznam.cz>
4383 * namespace.cs (LookupType): Moved same type check to...
4385 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4388 2005-07-21 Raja R Harinath <rharinath@novell.com>
4390 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4391 already found a typebuilder.
4392 * class.cs (MethodCore.IsDuplicateImplementation): Compare
4393 MemberNames, not strings.
4395 * const.cs (Error_ExpressionMustBeConst):
4396 Rename from Error_EpressionMustBeConst.
4397 * const.cs, class.cs, statement.cd: Update.
4399 2005-07-21 Marek Safar <marek.safar@seznam.cz>
4403 * const.cs (Const.LookupConstantValue): Report missing contant expression
4405 (Error_EpressionMustBeConstant): Only one error method.
4407 * class.cs, statement.c: Updated.
4409 2005-07-20 Raja R Harinath <rharinath@novell.com>
4411 * statement.cs (Block.Flags): Add back HasVarargs.
4412 (Block.flags): Make protected.
4413 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4415 * typemanager.cs (types, typecontainers, user_types): Remove.
4416 (UserTypes, TypeContainers): Likewise.
4417 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4418 (CleanUp, Reset): Update.
4419 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
4420 (GetNestedType): Use Type.GetNestedType.
4421 (CoreLookupType): Take two arguments, the namespace and the
4422 basename of the type. Update to use the Namespace.Lookup
4424 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4425 (RealMemberLookup): Use IsNestedChildOf instead of playing with
4426 string concatenation and substring matches.
4427 * class.cs, enum.cs, delegate.cs: Update to changes.
4429 2005-07-20 Marek Safar <marek.safar@seznam.cz>
4431 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4432 Expression and made virtual.
4434 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4435 (ImplicitStandardConversionExists): Fixed `byte' typo ?
4437 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4439 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4442 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4445 2005-07-18 Marek Safar <marek.safar@seznam.cz>
4448 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4449 AssemblyCultureAttribute is not used on executable.
4452 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4454 2005-07-16 Raja R Harinath <rharinath@novell.com>
4457 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4458 New. Reports CS0252/CS0253.
4459 Mostly taken from preliminary patch by Duncak Mak.
4460 (Binary.DoResolveOperator): Store results of operator lookup.
4461 Use them to detect if we need to warn about unintended reference
4464 2005-07-15 Raja R Harinath <rharinath@novell.com>
4467 * namespace.cs (Namespace.Lookup): Add back location parameter.
4468 (Namespace.LookupType): Add CS0436 report. Add location parameter.
4469 * delegate.cs, ecore.cs, expression.cs: Update to changes.
4471 * codegen.cs (EmitContext.DeclSpace): Make readonly.
4472 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4473 (Namespace.LookupType): ... this.
4474 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4476 * typemanager.cs (LookupTypeReflection): Remove buggy code that
4477 purported to handle pointers.
4478 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4481 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4483 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4486 2005-07-15 Raja R Harinath <rharinath@novell.com>
4488 * namespace.cs (Namespace.Lookup): Drop location parameter.
4489 (NamespaceEntry.LookupAlias): Remove. Merge into ...
4490 (NamespaceEntry.Lookup): ... this.
4491 (NamespaceEntry.Error_AmbiguousTypeReference):
4492 Move here from DeclSpace.
4493 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4495 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4496 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4497 Move to NamespaceEntry.
4498 * delegate.cs, expression.cs: Update to changes.
4500 2005-07-14 Marek Safar <marek.safar@seznam.cz>
4502 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4503 CheckAttributeType and refactored.
4504 (Attribute.ResolvePossibleAttributeType): Changed to reuse
4505 ResolveAsTypeTerminal error handling.
4506 (ResolveAsTypeTerminal): Introduced because of global attributes extra
4508 (GetSignatureForError): Print errors in same way.
4511 * codegen.cs: Reflect attribute GetSignatureForError change.
4514 * expression.cs: Add silent parameter to ResolveAsTypeStep.
4516 * namespace.cs (UsingEntry): Refactored to make fields private.
4519 statement.cs: Error_UnexpectedKind has extra parameter.
4521 2005-07-14 Raja R Harinath <rharinath@novell.com>
4523 * ecore.cs (IAlias): Remove.
4524 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
4525 that implement the interface.
4526 * namespace.cs (Namespace): Likewise.
4527 (Namespace.declspaces): Renamed from 'defined_names'.
4528 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
4529 DeclSpace instead of an IAlias.
4530 * tree.cs (Tree.AddDecl): Update.
4532 2005-07-12 Raja R Harinath <rharinath@novell.com>
4534 * statement.cs (Block.Flags); Remove HasVarargs.
4535 (Block.HasVarargs): Move to ToplevelBlock.
4536 (Block.ThisVariable, Block.AddThisVariable): Likewise.
4537 (Block.Variables): Make protected. Initialize variable hashtable
4539 (Block.AddVariable): Update.
4540 (Block.Resolve): Update to changes.
4541 (ToplevelBlock.HasVarargs): New boolean.
4542 (ToplevelBlock.ThisVariable): Move here from Block.
4543 (ToplevelBlock.AddThisVariable): Likewise.
4544 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
4545 * expression.cs (This.ResolveBase): Update to changes.
4546 (ArglistAccess.DoResolve): Likewise.
4548 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4551 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4553 * class.cs (TypeContainer.VerifyMembers): Distinguish between
4554 not used and not used & assigned.
4555 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4557 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4560 * expression.cs (Is.DoResolve): null is never provided type.
4562 2005-07-08 Marek Safar <marek.safar@seznam.cz>
4565 * cs-parser.jay: Less strict event error rule to catch more errors.
4567 2005-07-08 Martin Baulig <martin@ximian.com>
4569 Fix test-iter-10.cs - distinguish whether we `yield' in a property
4570 gettter (allowed) or setter (not allowed).
4572 * class.cs (Accessor): Implement IIteratorContainer.
4573 (Accessor.Yields): New public field.
4574 (PropertyBase.PropertyMethod.Define): Handle iterators on a
4578 (get_accessor_declaration, set_accessor_declaration): Set the
4579 `yields' flag on the accessor, not the property.
4580 (property_declaration): Do the iterators check on a per-accessor
4581 basis and not for the whole property.
4583 2005-07-08 Martin Baulig <martin@ximian.com>
4585 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4586 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4588 2005-07-07 Marek Safar <marek.safar@seznam.cz>
4591 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4592 (ExtractSecurityPermissionSet): Cope with self referencing security
4593 attributes properly.
4595 * driver.cs (SetOutputFile): Made public property OutputFile.
4597 2005-07-07 Raja R Harinath <rharinath@novell.com>
4600 * class.cs (TypeContainer.first_nonstatic_field): Rename from
4601 has_nonstatic_fields. Make into a FieldBase pointer.
4602 (TypeContainer.AddField): Add CS0282 check.
4603 (TypeContainer.EmitType): Update.
4605 2005-07-06 Miguel de Icaza <miguel@novell.com>
4607 * cs-tokenizer.cs (consume_identifier): Do not create strings to
4608 compare if they start with __.
4610 2005-07-06 Raja R Harinath <rharinath@novell.com>
4612 * statement.cs (Switch.SwitchGoverningType): Only look at
4613 UserCasts that don't need implicit standard conversions to one of
4614 the allowed switch types (Fixes test-322.cs).
4615 (LocalInfo.Resolve): Re-enable sanity-test.
4617 2005-07-06 Marek Safar <marek.safar@seznam.cz>
4619 * cs-tokenizer.cs (consume_identifier): Detect double undescores
4621 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4623 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4625 2005-07-06 Raja R Harinath <rharinath@novell.com>
4628 * ecore.cs (SimpleName.GetSignatureForError): Add.
4629 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4630 (MemberAccess.GetSignatureForError): Add.
4632 2005-07-05 Marek Safar <marek.safar@seznam.cz>
4634 The big error and warning messages review.
4664 * typemanager.cs: Updated.
4666 * class.cs: (MethodCore.SetYields): Moved here to share.
4667 (PropertyMethod.Define): Moved iterator setup here.
4669 * iterators.cs: Add orig_method to have full access to parent
4672 2005-07-05 Raja R Harinath <rharinath@novell.com>
4674 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4675 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4676 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4677 variable of struct type.
4678 * expression.cs (Unary.ResolveOperator): Update to change.
4679 (Indirection.VerifyFixed): Likewise.
4680 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4681 (ParameterReference.VerifyFixed): Value parameters are fixed.
4682 (This.VerifyFixed): Treat 'this' as a value parameter.
4683 * statement.cs (LocalInfo.IsFixed): Remove.
4685 2005-07-01 Martin Baulig <martin@ximian.com>
4687 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4688 `ec.EmitThis ()' to get the correct scope.
4690 2005-07-01 Martin Baulig <martin@ximian.com>
4692 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4693 instance is a ParameterReference; fixes #75299.
4695 2005-07-01 Martin Baulig <martin@ximian.com>
4697 Reverted Marek's latest patch (r46725):
4698 - it contains structural changes which are neither mentioned in
4699 the ChangeLog nor explained anywhere; for example the additional
4700 argument of EmitContext's and Iterator's .ctor's and the
4701 TypeContainer.DefineMembers() change.
4702 - structural changes like this should go in in seperate patches
4703 and not be hidden in a huge patch which just seems to affect
4704 warnings and errors.
4705 a big and hard to understand patch.
4706 - it breaks iterators and causes regressions, for instance in
4709 2005-06-30 Raja R Harinath <rharinath@novell.com>
4712 * expression.cs (Indexers.map): Remove.
4713 (Indexers.Append): Filter out inaccessible setters and getters.
4714 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4717 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
4719 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4720 (FieldExpr.Emit, PropertyExpr.Emit): Update.
4721 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4722 * expression.cs (Invocation.EmitCall): Add CS0120 check.
4724 2005-06-30 Marek Safar <marek.safar@seznam.cz>
4727 * class.cs (FieldBase.GetInitializerExpression): One more field
4730 2005-06-28 Miguel de Icaza <miguel@novell.com>
4732 * pending.cs: Do not define a proxy if the base method is virtual,
4733 it will be picked up by the runtime (bug 75270).
4735 2005-06-08 Martin Baulig <martin@ximian.com>
4737 The big Iterators rewrite :-)
4739 * iterators.cs: Rewrite this to use the anonymous methods framework.
4741 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4742 before the TypeContainers; see 2test-21.cs.
4745 (TypeContainer.DefineType): Don't create a new EmitContext if we
4746 already have one (this only happens if we're an Iterator).
4747 (TypeContainer.Define): Also call Define() on all our iterators.
4748 (Method.CreateEmitContext): Added support for iterators.
4751 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4752 (AnonymousContainer.CreateMethodHost): Moved here from
4753 AnonymousMethod and made abstract.
4754 (AnonymousContainer.CreateScopeType): New abstract method.
4755 (AnonymousContainer.IsIterator): New public property.
4756 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4757 get the ScopeTypeBuilder rather than manually defining it here.
4758 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4761 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4762 before RootContext.DefineTypes().
4764 * codegen.cs (EmitContext.RemapToProxy): Removed.
4765 (EmitContext.CurrentAnonymousMethod): Changed type from
4766 AnonymousMethod -> AnonymousContainer.
4767 (EmitContext.ResolveTopBlock): Protect from being called twice.
4768 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4769 (EmitContext.EmitThis): Removed the iterators hacks; use the
4770 anonymous methods framework for that.
4773 (ToplevelBlock.Container): Make this a property, not a field.
4774 (ToplevelBlock.ReParent): New public method; move the
4775 ToplevelBlock into a new container.
4776 (Foreach.TemporaryVariable): Simplify.
4778 2005-06-05 Martin Baulig <martin@ximian.com>
4780 * statement.cs (LocalInfo.CompilerGenerated): New flag.
4781 (Block.AddTemporaryVariable): New public method; creates a new
4782 `LocalInfo' for a temporary variable.
4783 (Block.EmitMeta): Create the LocalBuilders for all the temporary
4785 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4786 non-iterator variables.
4788 2005-06-05 Martin Baulig <martin@ximian.com>
4790 * statement.cs (Foreach.TemporaryVariable): Create the
4791 LocalBuilder in the Emit phase and not in Resolve since in some
4792 situations, we don't have an ILGenerator during Resolve; see
4793 2test-19.cs for an example.
4795 2005-06-04 Martin Baulig <martin@ximian.com>
4797 **** Merged r45395 from GCS ****
4799 The big Foreach rewrite - Part II.
4801 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4802 with `PropertyInfo ienumerator_getcurrent'.
4804 * codegen.cs (VariableStorage): Removed.
4807 (Foreach): Derive from Statement, not ExceptionStatement.
4808 (Foreach.CollectionForeach): New nested class. Moved all the code
4809 dealing with collection foreach here.
4810 (Foreach.ForeachHelperMethods): Removed.
4811 (Foreach.TemporaryVariable): Implement IMemoryLocation.
4813 2005-05-23 Martin Baulig <martin@ximian.com>
4815 * statement.cs (Try.DoResolve): Don't create a `finally' if we
4816 don't need to. Fix #75014.
4818 2005-05-20 Martin Baulig <martin@ximian.com>
4820 Merged r44808 from GMCS.
4822 * class.cs (TypeContainer.CircularDepException): Removed.
4823 (TypeContainer.DefineType): Removed the `InTransit' stuff.
4824 (TypeContainer.CheckRecursiveDefinition): Check for circular class
4825 (CS0146) and interface (CS0529) dependencies here.
4827 2005-06-21 Raja R Harinath <rharinath@novell.com>
4829 * expression.cs (Invocation.EmitCall): Fix initialization
4830 'this_call' to reflect current behaviour. Fix indentation.
4832 * convert.cs (FindMostEncompassedType): Add two trivial special
4833 cases (number_of_types == 0 || number_of_types == 1).
4834 (FindMostEncompasingType): Likewise.
4836 2005-06-17 Raja R Harinath <rharinath@novell.com>
4838 Some cleanups preparing for the fix of #75283.
4839 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4841 (EventExpr.InstanceResolve): Likewise.
4842 (EventExpr.DoResolve): Remove redundant checks.
4844 2005-06-10 Duncan Mak <duncan@novell.com>
4846 * cs-tokenizer.cs (process_directives): New flag for controlling
4847 the processing of preprocessor directives.
4848 (x_token): After seeing a '#', return Token.NONE instead of going
4849 to handle_preprocessing_directive() when not processing
4850 directives. This avoids unnecessary processing during the token peek in
4855 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
4856 the existing error reporting methods instead of Report.Error.
4858 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
4859 after Raja's rewrite.
4861 2005-06-08 Miguel de Icaza <miguel@novell.com>
4863 * class.cs: Small fix.
4865 2005-06-08 Raja R Harinath <rharinath@novell.com>
4868 * class.cs (GetPartialBases): Fix return value check of
4871 2005-06-07 Raja R Harinath <rharinath@novell.com>
4873 Ensure that partial classes are registered in their enclosing
4874 namespace. Initial part of fix of #75160.
4875 * tree.cs (Tree.RecordDecl): Add new namespace argument.
4876 Register declspace with namespace here, not in
4877 DeclSpace.RecordDecl.
4878 * cs-parser.jay: Pass namespace to RecordDecl.
4879 * class.cs (PartialContainer.Create): Likewise.
4880 (ClassPart.DefineType): New sanity-check. Throws an exception if
4882 * decl.cs (Declspace.RecordDecl): Remove.
4883 * namespace.cs (NamespaceEntry.DefineName): Remove.
4885 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4887 * rootcontext.cs: Reset TargetExt as well.
4889 2005-06-03 Raja R Harinath <rharinath@novell.com>
4891 * ecore.cs (Expression.Resolve): Emit CS0654 error when
4894 2005-06-02 Raja R Harinath <rharinath@novell.com>
4896 Fix #75080, cs0119.cs.
4897 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
4899 (Expression.Resolve): ... this. Use it. Remove bogus code
4900 allowing ExprClass.Type and ExprClass.Namespace for
4901 ResolveFlags.VariableOrValue.
4902 (Expression.Resolve) [1-argument variant]: Change default resolve
4903 flags based on language version.
4904 (Expression.Error_UnexpectedKind): Use a simple string array
4905 rather than an ArrayList.
4906 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4908 (TypeOfVoid.DoResolve): Likewise.
4909 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
4910 flags argument -- it always has the same value.
4912 2005-05-31 Raja R Harinath <rharinath@novell.com>
4915 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4916 Use it in the error message.
4917 * assign.cs, expression.cs, statement.cs: Update.
4919 2005-05-30 Raja R Harinath <rharinath@novell.com>
4922 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4923 the "almostMatchedMember" case too.
4924 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4925 that failed the accessibility checks to 'almost_match'.
4927 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
4929 * attribute.cs: Use internal MethodBuilder methods to set
4930 ExactSpelling and SetLastError on PInvoke methods, instead
4931 of passing them via charset. Fixes #75060.
4933 2005-05-27 Raja R Harinath <rharinath@novell.com>
4935 * parameter.cs (Parameter): Remove TODO comment.
4936 (Parameter.DefineParameter): Remove Location parameter.
4937 (Parameters.LabelParameters): Likewise.
4938 * class.cs (Constructor.Emit): Update to change.
4939 (MethodData.Emit): Likewise.
4940 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
4941 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4943 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
4946 Removed Parameters.Location and added Parameter.Location instead.
4947 Removed Location parameter from Emit() and GetSignature().
4954 Modified all related calls.
4956 2005-05-26 Raja R Harinath <rharinath@novell.com>
4958 Improve user-defined conversion handling.
4959 * convert.cs (GetConversionOperators): Rewrite. Return only the
4960 applicable operators.
4961 (AddConversionOperators): New. Helper for GetConversionOperators.
4962 (FindMostEncompassedType, FindMostEncompassingType): Verify that
4963 there is only one most encompassed/encompassing type.
4964 (FindMostSpecificSource, FindMostSpecificTarget): Remove
4965 "applicable operator" handling.
4966 (UserConversion): Move cache here from GetConversionOperators.
4967 Directly cache the chosen operator, rather than the whole
4969 (ExplicitNumericConversion): Fix buggy implementation of Decimal
4970 case. Allow conversion of decimal to sbyte and byte too.
4971 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4972 New static methods. Used to avoid allocating EmptyExpressions in
4975 2005-05-24 Duncan Mak <duncan@novell.com>
4977 * ecore.cs (CastFromDecimal): New class for casting a decimal to
4978 another class, used in Convert.ExplicitNumericConversion.
4979 (CastToDecimal): New class, similar to above, but casts to
4980 System.Decimal, used in Convert.ImplicitNumericConversion and also
4981 in explicit convesion from double/float to decimal.
4983 * convert.cs (ImplicitNumericConversion): Handle implicit
4984 conversions to System.Decimal.
4985 (ExplicitNumericConversion): handle explicit conversions to
4990 2005-05-20 Miguel de Icaza <miguel@novell.com>
4992 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
4993 know the type at this stage, just break through. Fixes #75008
4995 2005-05-19 Martin Baulig <martin@ximian.com>
4998 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4999 to disable error reporting.
5001 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5002 here since we don't want to report an error; see the new test-336.cs.
5004 2005-05-19 Raja R Harinath <rharinath@novell.com>
5006 * statement.cs (ToplevelBlock.GetParameterReference)
5007 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5008 Move here from class Block.
5009 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5010 * expression.cs (ParameterReference.DoResolveBase): Likewise.
5012 2005-05-18 Martin Baulig <martin@ximian.com>
5017 (FlowBranching.Reachability): Add non-static public And() and Or()
5019 (FlowBranchingSwitch): New class; do the `break_origins' thing
5020 like in FlowBranchingLoop.
5021 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5022 reachability, not just locals and parameters.
5023 (FlowBranching.MergeChild): Remove some of the hacks for loop and
5024 switch; MergeBreakOrigins() now takes care of that.
5026 2005-05-18 Martin Baulig <martin@ximian.com>
5028 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5029 a loop and may leave it, reset the barrier; fixes #74974.
5031 2005-05-17 Marek Safar <marek.safar@seznam.cz>
5033 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5036 * cs-parser.jay: Catch more lexical errors.
5038 * report.cs: Add one more Error method.
5041 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5043 2005-05-17 Martin Baulig <martin@ximian.com>
5045 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5048 2005-05-16 Raja R Harinath <rharinath@novell.com>
5050 Fix test-382.cs. Emit values of decimal constants.
5051 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5053 (TypeContainer.AddField): ... this.
5054 (TypeContainer.EmitFieldInitializers): Allow the list of fields
5055 with initializers to include 'Const's.
5056 (ClassPart.RegisterFieldForInitialization): Forward to
5058 * const.cs (Const.Const): Pass initializer to base class.
5059 (Const.Define): In case of decimal constants, register them for
5060 initialization in a static constructor.
5062 2005-05-14 Martin Baulig <martin@ximian.com>
5064 * statement.cs (Block.Resolve): Correctly handle unreachable code;
5065 do not call ResolveUnreachable() on unreachable statements in
5066 here, see the comment in the source code.
5068 2005-05-13 Raja R Harinath <rharinath@novell.com>
5071 * expression.cs (BinaryResolveOperator): If one of the operands of
5072 an equality comparison is 'null' and the other is a pointer type,
5073 convert the null to a NullPointer.
5074 * convert.cs (ImplicitReferenceConversion): If the expression is a
5075 NullLiteral and the target type is a pointer type, return a
5076 NullPointer instead.
5077 (ImplicitConversionStandard): Likewise.
5079 2005-05-13 Marek Safar <marek.safar@seznam.cz>
5081 * cs-parser.jay: Set readonly context based on special constructs.
5083 * expression.cs (LocalVariableReference.DoResolveBase): Improved
5084 readonly variable error handling.
5086 * rootcontext.cs (EmitCode): Don't verify members when error
5089 * statement.cs (LocalInfo): Add reaodnly context information.
5090 (SetReadOnlyContext, GetReadOnlyContext): New methods.
5092 2005-05-13 Raja R Harinath <rharinath@novell.com>
5094 * statement.cs (Block.Resolve): Revert change below. Modify fix
5095 for #74041 to initialize 'resolved' to false only for explicit
5096 blocks. Fixes #74873.
5098 2005-05-12 Raja R Harinath <harinath@gmail.com>
5101 * typemanager.cs (unmanaged_enclosing_types): New.
5102 (IsUnmanagedType): Avoid infloops by using
5103 'unmanaged_enclosing_types' to talk with recursive invocations.
5105 2005-05-13 Martin Baulig <martin@ximian.com>
5107 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5108 instance variable, not a local. Fix #74873.
5109 (Block.ResolveUnreachable): Set it to true here.
5111 2005-05-11 Duncan Mak <duncan@novell.com>
5113 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5114 continuing to process for 'arg'.
5115 (handle_preprocessing_directive): Check the argument of the #endif
5116 directive and report error CS1025 if there are any trailing
5119 According to the C# spec, having even whitespace after the #endif
5120 directive is illegal; however, because we call arg.TrimEnd ()
5121 beforehand, we have the same behavior as csc, allowing whitespace
5122 after the directive.
5126 2005-05-11 Marek Safar <marek.safar@seznam.cz>
5130 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5131 (Constructor.GetObsoleteAttribute): Implemented correctly.
5133 2005-05-10 Martin Baulig <martin@ximian.com>
5135 * support.cs (ReflectionParameters.ParameterModifier): Use
5136 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5137 and `ParameterAttributes.In'. Fixes #74884.
5139 2005-05-10 Marek Safar <marek.safar@seznam.cz>
5141 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5143 * expression.cs (Argument.GetParameterModifier): Turned to property.
5144 (Invocation.Error_InvalidArguments): Add more descriptive errors.
5146 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5149 2005-05-09 Raja R Harinath <rharinath@novell.com>
5152 * decl.cs (MemberCache.AddMethods): Register override methods,
5153 rather than non-override methods.
5154 * typemanager.cs (RegisterOverride): New.
5155 (IsOverride): Update.
5157 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5161 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5162 recursive declaration.
5164 * statement.cs (Block.ResolveMeta): Report any error in resolving.
5166 2005-05-06 Marek Safar <marek.safar@seznam.cz>
5168 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5170 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5172 2005-05-05 Raja R Harinath <rharinath@novell.com>
5175 * decl.cs (DeclSpace.FamilyAccessible):
5176 Use TypeManager.IsNestedFamilyAccessible.
5178 Fix reopened #64812.
5179 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5182 2005-05-04 Raja R Harinath <rharinath@novell.com>
5183 Abin Thomas <projectmonokochi@rediffmail.com>
5184 Anoob V E <projectmonokochi@rediffmail.com>
5185 Harilal P R <projectmonokochi@rediffmail.com>
5188 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5189 allow access to all static members.
5191 2005-05-04 Martin Baulig <martin@ximian.com>
5193 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5195 2005-05-04 Martin Baulig <martin@ximian.com>
5199 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5200 section at the end; make things work if `default' is not the last
5203 2005-05-04 Martin Baulig <martin@ximian.com>
5207 * statement.cs (Switch): Replaced the `got_default' field with a
5208 `default_section' one.
5209 (Switch.CheckSwitch): Set `default_section' here.
5210 (Switch.Resolve): If we're a constant switch and the constant is
5211 not found, use the default section.
5213 2005-05-03 Martin Baulig <martin@ximian.com>
5215 * expression.cs (ArrayAccess.EmitGetLength): New public method.
5217 * statement.cs (Foreach.ArrayForeach): New nested class.
5218 (Foreach.TemporaryVariable): New nested class.
5219 (Foreach.EmitArrayForeach): Removed; this is now in the new
5222 2005-05-03 Raja R Harinath <rharinath@novell.com>
5224 * pending.cs (BaseImplements): Move the #74773 fix here. This is
5226 (VerifyPendingMethods): Revert change below.
5228 * typemanager.cs (IsOverride, RegisterNonOverride): New.
5229 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5230 that used to trigger warning -28. Remove warning -28.
5231 * expression.cs (Invocation.OverloadResolve): Use
5232 TypeManager.IsOverride to distinguish override methods.
5235 * pending.cs (VerifyPendingMethods): If a base type implements the
5236 requested interface, don't bother checking individual methods of
5237 the base type. As a side-effect, this prevents the creation of
5238 unnecessary proxies.
5240 2005-05-02 Martin Baulig <martin@ximian.com>
5244 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5245 Also `And' the locals if the old vector is null.
5246 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5247 null; in this case we basically reset all the variables.
5249 2005-05-02 Martin Baulig <martin@ximian.com>
5253 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5254 Added `FlowBranching branching' argument; always `and' the
5255 variables instead of `or'ing them unless we're an infinite loop.
5257 * statement.cs (While.Resolve): Create a new sibling unless we're
5260 2005-05-02 Martin Baulig <martin@ximian.com>
5264 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5265 arguments; use it instead of creating a new TopLevelBlock.
5266 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5267 our ConstructorInitializer.
5270 (TopLevelBlock.TopLevelBranching): New public property.
5271 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5272 and create our `TopLevelBranching'.
5274 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5275 anonymous method host, use `block.TopLevelBranching' rather than
5276 creating a new branching.
5278 2005-04-20 Miguel de Icaza <miguel@novell.com>
5280 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5281 a ScopeInfo, if any of the current children is a child of the new
5282 entry, move those children there.
5284 2005-04-30 Martin Baulig <martin@ximian.com>
5286 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5287 at the beginning of a SwitchSection. Fix #73335.
5289 2005-04-27 Marek Safar <marek.safar@seznam.cz>
5292 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5294 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5295 (FieldExpr.DoResolve): Obsolete members are ignored for field
5298 2005-04-26 Marek Safar <marek.safar@seznam.cz>
5300 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5301 of arrays detection.
5303 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5305 (Field.VerifyClsCompliance): Volatile fields are not compliant.
5307 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5310 2005-04-25 Ben Maurer <bmaurer@ximian.com>
5312 * cs-parser.jay: Use the prefered version of -unsafe in error
5315 2005-04-22 Marek Safar <marek.safar@seznam.cz>
5317 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5320 2005-04-20 John Luke <john.luke@gmail.com>
5322 * driver.cs: fix typo in error message, --outout to --output
5324 2005-04-20 Marek Safar <marek.safar@seznam.cz>
5326 * codegen.cs (InRefOutArgumentResolving): New field.
5328 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5329 fields outside contructor.
5331 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5333 2005-04-19 Miguel de Icaza <miguel@novell.com>
5335 * anonymous.cs (CaptureContext.EmitParameterInstance): The
5336 parameter code was not completed ever, so it was not as up-to-date
5337 as local variables. Must finish it.
5339 The bug fix was to compare the Toplevel of the block, not the
5340 current block. Thanks for Ben for pointing this out.
5342 2005-04-19 Raja R Harinath <rharinath@novell.com>
5344 * decl.cs (AddMethods): Use the declaring type of the problem
5345 method to determine if we want to squash a warning.
5347 2005-04-19 Marek Safar <marek.safar@seznam.cz>
5349 * attribute.cs: Removed debug output.
5351 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5353 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5356 2005-04-18 Raja R Harinath <rharinath@novell.com>
5359 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5360 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5361 all null comparisons against reference types.
5363 2005-04-18 Marek Safar <marek.safar@seznam.cz>
5366 * class.cs (TypeContainer.CircularDepException) New nested
5368 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5369 (TypeContainer.DefineType): Removed error, reset InTransit before
5371 (Class.DefineType): Throw exception when is in Transit.
5372 Catch exception and report error.
5373 (Struct.DefineType): Throw exception when is in Transit.
5374 Catch exception and report error.
5375 (Interface.DefineType): Throw exception when is in Transit.
5376 Catch exception and report error.
5378 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5379 handle nested exception handlers.
5381 * flowanalysis.cs (InTryWithCatch): New method, search for try with
5384 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5385 InFinally and InCatch storage.
5387 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5388 (Catch.Resolve): Set and Restore ec.InCatch.
5389 (Try.Resolve): Set and Restore ec.InFinally.
5390 (Try.HasCatch): True when try has catch.
5392 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
5394 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5395 for the same event member, so exclude such cases from warning 419.
5398 2005-04-16 Miguel de Icaza <miguel@novell.com>
5400 * expression.cs (Binary.ResolveOperator): Apply patch from John
5401 Luke to fix bug 59864: operators &, | and ^ on enumerations
5402 require that the same enum type on both sides.
5404 * driver.cs: Add warnings to old flag usage, this is to assist
5405 people who produce Makefiles and hope that the Makefiles will be
5408 * class.cs (TypeContainer.EmitType): Moved the definition of the
5409 special $PRIVATE$ field from the resolve phase to the Emit phase.
5410 During resolve we do not know if we are a struct with
5411 HasExplicitLayout, we know this only after the attributes for the
5414 Set the FieldOffset to zero on the dummy field that we create for
5415 the class. Fixes 74590.
5417 2005-04-16 Raja R Harinath <rharinath@novell.com>
5420 * ecore.cs (PropertyExpr.resolved): New.
5421 (DoResolve): Use it to handle a case of double resolution here.
5422 Handle a case of identical-name-and-type-name.
5423 * expression.cs (ArrayCreation.CheckIndices): Avoid double
5424 resolution by storing the results of expression resolution back
5425 into the "probes" array.
5427 2005-04-15 Raja R Harinath <rharinath@novell.com>
5429 Fix cs0208-7.cs and cs0208-8.cs.
5430 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5431 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
5432 error reporting to point out the reason a struct is not unmanaged.
5434 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5436 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
5437 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5439 2005-04-13 Raja R Harinath <rharinath@novell.com>
5442 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5443 IdenticalNameAndTypeName here.
5444 (EventExpr.InstanceResolve): Likewise.
5446 2005-04-13 Marek Safar <marek.safar@seznam.cz>
5448 C# 2.0 DefaultCharSetAttribute implementation
5450 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5451 which allows us to set GlobalNamespace for every resolve.
5452 (Attribute.ResolveArguments): Cut from Resolve.
5453 (Attribute.GetCharSetValue): Returns CharSet named argument.
5454 (Attribute.DefinePInvokeMethod): Gets default charset from
5456 (GlobalAttribute.ResolveAsTypeStep): Override.
5457 (GlobalAttribute.ResolveArguments): Override.
5459 * class.cs (TypeAttr): Is protected.
5461 * codegen.cs (ModuleClass.DefaultCharSet): New member.
5462 (ModuleClass.DefaultCharSetType): New memeber.
5463 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5465 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5466 charset from module.
5468 * delegate.cs (TypeAttr): Override.
5469 (Delegate.DefineType): Use this TypeAttr.
5471 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5472 at very early stage (before types are defined) to resolve model
5473 module attributes. It will probably not work with corlib but it
5476 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5477 charset from module.
5479 * typemanager.cs (default_charset_type): New type.
5481 2005-04-13 Raja R Harinath <rharinath@novell.com>
5483 * decl.cs (MemberCache.AddMethods): Don't warn if
5484 System.Object.Finalize has buggy MethodAttributes.
5486 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5489 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5491 * doc.cs : detect ambiguous reference to overloaded members.
5492 Fixed bug #71603. MS 1.1 csc does not detect it.
5494 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5496 * doc.cs : delegates must not be referenced with parameters.
5499 2005-04-12 Miguel de Icaza <miguel@novell.com>
5501 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5503 2005-04-10 Miguel de Icaza <miguel@novell.com>
5505 * driver.cs (MainDriver): Stop processing if the CLS stage found
5508 (CompilerCallableEntryPoint.InvokeCompiler): Always
5509 reset after execution; Take a TextWriter argument for the
5512 * report.cs: Use the error stream instead of hardcoding stderr.
5514 2005-04-09 Miguel de Icaza <miguel@novell.com>
5516 * class.cs: Reduce code paths to test, too small of an
5517 optimization to make it worth the extra testing. Always perform
5520 2005-04-08 Raja R Harinath <rharinath@novell.com>
5523 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5524 operators that had errors reported on them.
5526 2005-04-08 Marek Safar <marek.safar@seznam.cz>
5528 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5530 (Attribute.Resolve): Add named argument type checking.
5532 * class.cs (FixedField.Define): Use IsPrimitiveType
5534 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5536 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5537 unsafe parameter types.
5539 * statement.cs (Using.ResolveExpression): Add better error description.
5541 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5543 2005-04-08 Raja R Harinath <rharinath@novell.com>
5546 * attribute.cs (Attribute.GetAttributeUsage): Resolve
5547 AttributeUsageAttribute in the emitcontext of the attribute class,
5548 not in the emitcontext of the attributable entity it was attached to.
5549 * cs-parser.jay: Use 'current_class', not 'current_container',
5550 when creating a GlobalAttribute.
5552 2005-04-08 Alp Toker <alp@atoker.com>
5554 * pending.cs: The fix to #58413 failed to compile methods implementing
5555 interfaces with/without params modifiers and vice versa, even though
5556 params modifiers aren't part of the signature. Make the modifier check
5557 less strict as in csc.
5559 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
5560 Anoob V E <projectmonokochi@rediffmail.com>
5561 Harilal P R <projectmonokochi@rediffmail.com>
5564 * pending.cs (TypeAndMethods.mods): New. Store the parameter
5565 modifiers of pending methods.
5566 (PendingImplementation.PendingImplementation): Initialize it.
5567 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5568 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5569 with ParameterData. Add check for modifiers.
5570 * class.cs (MethodData.Define): Update to changes.
5572 2005-04-07 Raja R Harinath <rharinath@novell.com>
5574 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5576 2005-04-07 Marek Safar <marek.safar@seznam.cz>
5578 * class.cs (PropertyMethod.Define): Check private accessor in abstract
5581 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5584 * typemanager.cs: Registered RequiredAttributeAttribute.
5586 2005-04-06 Marek Safar <marek.safar@seznam.cz>
5588 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5589 Warning CS0169 is back at level 3.
5590 (IMethodData.SetMemberIsUsed): New method.
5592 * decl.cs (IsUsed): New value; moved from FieldBase.Status
5593 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5595 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5597 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5599 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5602 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5605 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5606 to avoid the problems with nested types.
5608 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
5609 Anoob V.E <projectmonokochi@rediffmail.com>
5610 Harilal P.R <projectmonokochi@rediffmail.com>
5611 Raja R Harinath <rharinath@novell.com>
5614 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5616 * typemanager (GetConstructor): Make public.
5618 2005-04-05 John Luke <john.luke@gmail.com>
5619 Raja R Harinath <rharinath@novell.com>
5622 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5623 struct too. Return false quicker in a few cases.
5624 (VerifyUnManaged): Use it.
5626 2005-04-05 Raja R Harinath <rharinath@novell.com>
5629 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5630 not 'unreachable_seen'.
5632 2005-04-04 Marek Safar <marek.safar@seznam.cz>
5634 * attribute.cs (Attribute.GetValue): Removed unused.
5636 * codegen.cs (CodeGen.TrimExt): Removed unused.
5638 * cs-parser.jay (output): Removed unused.
5640 * cs-tokenizer.cs (hex_digits): Removed unused.
5642 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5644 * expression.cs (Indirection.LoadExprValue): Removed unused.
5645 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5647 * iterators.cs (Iterator.param_types): Removed unused.
5649 * statement.cs (Goto.block): Removed unused.
5650 (ToplevelBlock.did): Removed unused.
5651 (Switch.ResolveConstantSwitch): Removed unused.
5653 2005-04-01 Ben Maurer <bmaurer@ximian.com>
5655 * rootcontext.cs: Allow mcs to bootstrap with the compilation
5658 2005-04-01 Raja R Harinath <rharinath@novell.com>
5660 Fix #74232 and cs0208-3.cs.
5661 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5662 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5663 unmanaged type. Don't use FieldBuilders when 't' is a
5664 TypeBuilder. Use ModFlags and MemberType fields.
5665 * class.cs (MemberBase.member_type): Rename from MemberType.
5666 (MemberBase.MemberType): New property. Determines member_type on
5668 (MemberBase.DoDefine): Don't initialize MemberType here.
5669 (FieldMember.Define): Likewise.
5671 2005-04-01 Marek Safar <marek.safar@seznam.cz>
5674 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5675 Attributes are emitted there.
5677 2005-04-01 Raja R Harinath <rharinath@novell.com>
5679 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5680 keyword in 'partial enum' too.
5681 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5683 Report from Kamil Skalski <nazgul@omega.pl>.
5686 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5687 have partial containers too.
5689 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5690 in block' checks to Block.CheckInvariantMeaningInBlock.
5691 * statement.cs (Block.GetKnownVariableInfo): Make private.
5692 (Block.IsVariableUsedInChildBlock): Remove.
5693 (Block.IsVariableUsedInBlock): Likewise.
5694 (Block.CheckInvariantMeaningInBlock): New. Show location of
5695 conflicting declaration.
5696 (Block.AddVariable): Make error messages less long-winded and more
5697 specific. Show location of conflicting declaration.
5698 * parameter.cs (Parameters.Location): New readonly property.
5700 2005-03-31 Raja R Harinath <rharinath@novell.com>
5702 Clean up semantics of invoking ResolveMemberAccess.
5703 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5704 can have an instance, ensure that we pass in a non-TypeExpression
5705 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
5706 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5707 argument. Update to changes and simplify.
5708 (FieldExpr.Emitinstance): Remove CS0120 check.
5709 (PropertyExpr.EmitInstance): Likewise.
5710 * expression.cs (Argument.Resolve): Likewise.
5711 (Invocation.DoResolve): Update to changes in semantics of
5714 2005-03-31 Marek Safar <marek.safar@seznam.cz>
5717 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5720 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5722 2005-03-31 Raja R Harinath <rharinath@novell.com>
5724 Fix difference in behaviour with commandline invocation.
5725 * driver.cs (Driver.Reset): New.
5726 (CompilerCallableEntryPoint): Call it.
5728 * statement.cs (If.Resolve): Avoid spurious "uninitialized
5729 variable" warnings if the boolean expression failed to resolve.
5731 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
5733 * attribute.cs: Fix the union of several permissions when some of them
5734 are unrestricted (so the result isn't an unrestricted permission set).
5737 2005-03-30 Raja R Harinath <rharinath@novell.com>
5739 * ecore.cs (MemberExpr): New class. Convert from interface
5741 (MemberExpr.ResolveMemberAccess): Refactor and move here from
5742 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
5744 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5745 (MethodGroupExpr.IsExplicitImpl): Remove.
5746 (Expression.GetFieldFromEvent): Remove.
5747 (SimpleName.MemberStaticCheck): Remove.
5748 (SimpleName.DoSimpleNameResolve): Update to changes.
5749 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5750 (MemberAccess.IdenticalNameAndTypeName): Remove.
5751 (MemberAccess.error176): Move to MemberExpr.
5752 (MemberAccess.DoResolve): Update to changes.
5753 (BaseAccess.DoResolve): Likewise.
5755 2005-03-30 Marek Safar <marek.safar@seznam.cz>
5757 C# 2.0 Conditional attribute class implementation
5759 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5760 Analyzes class whether it has attribute which has ConditionalAttribute
5761 and its condition is not defined.
5763 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5764 (Class.IsExcluded): New method. Search for at least one defined
5765 condition in ConditionalAttribute of attribute class.
5767 2005-03-30 Raja R Harinath <rharinath@novell.com>
5769 * ecore.cs (PropertyExpr): Derive from Expression, not
5770 ExpressionStatement.
5771 (PropertyExpr.EmitStatement): Remove.
5773 2005-03-29 Raja R Harinath <rharinath@novell.com>
5776 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5777 internal field "value__" of an enum be private. The examples for
5778 "value__" that I found on MSDN all used FieldAttributes.Private.
5780 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5781 Don't mention IL method attribute names.
5783 Fix #47991. Remove a TODO.
5784 * statement.cs (Block.Toplevel): Make into a field.
5785 (Block.Parameters): Move into ToplevelBlock.
5786 (Block.known_variables): Rename from child_variable_names.
5787 (Block.Block): Remove variants that take Parameters. Initialize
5788 'Toplevel' with the immediately surrounding toplevel block.
5789 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
5790 LocalInfo parameter.
5791 (Block.GetKnownVariableInfo): New.
5792 (Block.IsVariableNameUsedInChildBlock): Update.
5793 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
5794 the block, even though it may not be in scope.
5795 (Block.AddVariable): Remove Parameters parameter. Use
5796 Toplevel.Parameters instead.
5797 (Block.AddConstant): Remove Parameters parameter.
5798 (Block.GetParameterReference): Update to use Toplevel.Parameters.
5799 (Block.IsParamaterReference): Likewise.
5800 (Block.IsLocalParameter): Likewise. Simplify a lot.
5801 (ToplevelBlock.Parameters): New. Moved from Block.
5802 (ToplevelBlock.ToplevelBlock): Update to changes. Always
5803 initialize Parameters to a non-null value.
5804 * cs-parser.jay: Update to changes.
5805 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5806 simple names that mean different things in the same block. Use
5807 Block.IsVariableNameUsedInBlock.
5809 2005-03-28 Raja R Harinath <rharinath@novell.com>
5811 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5812 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5813 GetTypeHandle. It is possible for a reflected type to derive from
5814 a TypeBuilder (e.g., int[] derives from the TypeBuilder
5815 System.Array during mscorlib compilation).
5816 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5817 contain a method_hash, don't create one either. Don't create a
5818 deep copy of the base cache's method_hash.
5819 (MemberCache.SetupCache): Rename back from DeepCopy.
5820 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5821 already initialized. If we see an override function, add its
5822 underlying base virtual function to the member_hash too.
5824 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5826 2005-03-26 Raja R Harinath <harinath@acm.org>
5829 * assign.cs (Assign.DoResolve): When the RHS of an assignment
5830 fails to resolve, ensure that the LHS is still resolved as an
5833 2005-03-25 Raja R Harinath <harinath@acm.org>
5835 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5837 (Enum.current_ec): Remove.
5838 (Enum.LookupEnumValue): Remove EmitContext argument.
5839 Just uses the one created during DefineType.
5840 (Enum.FindMembers): Update.
5841 * expression.cs (MemberAccess.DoResolve): Update.
5843 2005-03-22 Marek Safar <marek.safar@seznam.cz>
5845 * assign.cs (Assign.DoResolve): Check for CS1717 when
5846 source and target are same (uses Equals).
5848 * expression.cs (LocalVariableReference, ParameterReference,
5849 This): Implemented Equals, GetHashCode.
5851 * statement.cs (Block.GetParameterReference): Removed useless
5854 2005-03-22 Raja R Harinath <rharinath@novell.com>
5857 * statement.cs (Block.AddVariable): Ensure that we skip implicit
5858 blocks before deciding whether the error is cs0136 or cs0128.
5860 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5861 (using_alias_directive, using_namespace_directive): Pass
5862 MemberName, not an expression to Namespace.UsingAlias and
5864 (MakeName): Use the MemberName of the namespace.
5865 * namespace.cs (Namespace.MemberName): New.
5866 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5867 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5869 * decl.cs (MemberName.Name): Make readonly.
5870 (MemberName.FromDotted): New "constructor".
5871 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5872 (MemberCore.Name): Compute from MemberName on demand.
5873 (MemberCore.SetMemberName): Provide a way to change the
5875 (MemberCore.AddToContainer): Don't take a fullname parameter.
5876 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5877 fully qualified name of the container to the member name.
5878 (TypeContainer.AddToTypeContainer): Use a fully qualified name
5879 only if the type is a member of the root container.
5880 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5881 MemberName.Left rather than searching for an embedded ".".
5882 (PartialContainer.CreatePart): Update to changes in RootContext.
5883 (MemberBase.ShortName): Turn into a property. Use
5884 MemberCore.SetMemberName.
5885 (MemberBase.ExplicitInterfaceName): Remove.
5886 (MemberBase.UpdateMemberName): Remove.
5887 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5888 (PropertyBase.SetMemberName): New override.
5889 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5890 (Tree.GetDecl): New.
5891 (Tree.AllDecls): Rename from Decls.
5892 * attribute.cs, enum.cs, report.cs: Update to changes.
5893 * driver.cs (MainDriver): Use MemberName.FromDotted on
5894 RootContext.MainClass.
5896 2005-03-21 Marek Safar <marek.safar@seznam.cz>
5898 * class.cs (FixedField.Define): Check for CS1664 and more sanity
5901 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5903 2005-03-18 Marek Safar <marek.safar@seznam.cz>
5905 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5906 property accessor modifiers.
5908 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5909 fixed buffer attribute (CS1716).
5910 (PropertyMethod.HasCustomAccessModifier): When property accessor
5911 has custom modifier.
5913 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5915 (PropertyExpr.DoResolveLValue): Add CS0272.
5917 2005-03-17 Miguel de Icaza <miguel@novell.com>
5919 * convert.cs: When converting to a pointer, use the proper Conv.U
5920 or Conv.I depending on the source data type.
5922 * cs-tokenizer.cs: Make the size for large decimal constants,
5925 2005-03-17 Martin Baulig <martin@ximian.com>
5927 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5928 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5930 2005-03-17 Martin Baulig <martin@ximian.com>
5932 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5933 to bool so we can return an error condition.
5934 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5937 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
5939 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5942 2005-03-16 Raja R Harinath <rharinath@novell.com>
5944 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5945 Refactor to avoid traversing the list of assemblies, and to avoid
5946 string concatenation.
5947 * typemanager.cs (guid_attr_type): Remove.
5948 (negative_hits, pointers, references): Remove hashes.
5950 (GetConstructedType): New. Uses type_hash to handle constructed
5951 types (arrays, references, pointers).
5952 (GetReferenceType, GetPointerType): Use it.
5953 (GetNestedType): New. Uses type_hash to handle nested types of
5955 (LookupType, LookupTypeDirect): Remove.
5956 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
5957 'types' hash and LookupTypeReflection directly.
5958 (params_string, params_object): Use GetConstructedType.
5959 * namespace.cs (Namespace.cached_types): New. Cache of reflected
5961 (Namespace.Lookup): Use cached_types.
5962 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5963 provided by old TypeManager.LookupType.
5964 * rootcontext.cs (MakeFQN): Remove.
5965 * decl.cs (DeclSpace.MakeFQN): Likewise.
5966 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5967 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5968 TypeManager.GetConstructedType.
5969 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5971 2005-03-15 Marek Safar <marek.safar@seznam.cz>
5973 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
5976 * cs-parser.jay: Reports CS1527 for any namespace element.
5978 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5981 * expression.cs (ParameterReference.IsAssigned): Changed error to
5983 (Error_WrongNumArguments): Moved CS0245 detection here.
5985 * statement.cs (Return.Resolve): Add CS1622 report.
5987 2005-03-11 Marek Safar <marek.safar@seznam.cz>
5989 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5991 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
5993 * attribute.cs expression.cs: Get rid of some allocations.
5995 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
5997 * doc.cs : just eliminate the latest change.
5999 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6001 * doc.cs : commented out the latest change. It breaks xml-030.cs
6003 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6005 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6006 fail. So invoke CreateType() in FindDocumentedType().
6008 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6010 * cs-tokenizer.cs : added IsKeyword().
6011 * doc.cs : Detect keyword incorrectly used as identifier.
6012 Allow identifiers prefixed by @.
6014 2005-03-10 Marek Safar <marek.safar@seznam.cz>
6016 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6017 It caused exception in namespace resolving (again!).
6019 * class.cs (Class.ctor): Removed exit.
6020 (PropertyMethod.ctor): ditto.
6022 * codegen.cs (Codegen.Reset): Reset static data.
6023 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6025 * cs-tokenizer.cs (Cleanup): Removed.
6027 * driver.cs (GetSystemDir): Rewrote to one line command.
6028 It caused problem with unloaded dynamic modules.
6029 (UnixParseOption): Removed Exit.
6030 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6031 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6032 Now can be mcs used as library.
6034 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6037 * location.cs (Reset): Reset static data.
6039 * namespace.cs (Reset): Reset static data.
6041 * report.cs (Report.Reset): Reset static data.
6043 * rootcontext.cs (RootContext.Reset): Reset static data.
6045 * tree.cs (RootTypes.ctor): Use Location.Null
6047 * typemanager.cs (TypeManager.Reset): Reset static data.
6048 (CoreLookupType): Removed Exit.
6049 (TypeHandle.Reset): Reset static data.
6051 2005-03-10 Raja R Harinath <rharinath@novell.com>
6054 * typemanager.cs (ComputeNamespaces): Import namespaces from
6055 referenced modules too.
6057 2005-03-09 Raja R Harinath <rharinath@novell.com>
6059 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6062 2005-03-09 Raja R Harinath <rharinath@novell.com>
6064 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6065 enclosing DeclSpace. This ensures that a name-lookup populates
6066 more caches and there are fewer 'TypeExpression's. Carve out
6067 nested type lookup into ...
6068 (LookupNestedTypeInHierarchy): ... this.
6070 2005-03-09 Raja R Harinath <rharinath@novell.com>
6072 Clean up a few partial-class semantics.
6073 Fixes test-357.cs and cs1618-2.cs.
6074 * cs-parser.jay (struct_declaration): Use 'current_class' as
6075 parent of newly-created struct. Remove call to Register ().
6076 Use 'pop_current_class' to complete handing the current struct.
6077 (interface_declaration): Likewise.
6078 (class_declaration): Likewise.
6079 (enum_declaration): Use 'current_class' as parent of newly created
6081 (delegate_declaration): Likewise.
6082 (pop_current_class): New function. This is used to handle closing
6083 up the 'current_class' and 'current_container', and pointing them
6084 to the enclosing class/container.
6085 (CSharpParser): Initialize 'current_class' too.
6086 * decl.cs (MemberCore): Add check for invariant: a partial
6087 container is not a parsed entity, and thus does not enclose any
6089 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6090 (DeclSpace.BaseTypeExpr): Use it.
6091 (DeclSpace.LookupType): Add check for invariant.
6092 * class.cs (TypeContainer): Add check for invariant: a nested
6093 class should have the same NamespaceEntry as its enclosing class.
6094 (TypeContainer.EmitFieldInitializers): Make virtual.
6095 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6097 (TypeContainer.Register): Remove.
6098 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6099 null. Use TypeResolveEmitContext for resolving base types and
6100 interfaces. Move initialization of Parts.TypeBuilder here from
6102 (TypeContainer.DefineNestedTypes): ... here.
6103 (PartialContainer): Take a Namespace not a NamespaceEntry.
6104 (PartialContainer.Create): Don't use Register. Call the
6105 appropriate Add... function directly.
6106 (ClassPart): Take both the PartialContainer and the enclosing
6107 class as constructor arguments.
6108 (ClassPart.EmitFieldInitializers): Override.
6109 (ClassPart.PartFindNestedTypes): Remove.
6110 (FieldBase.GetInitializerExpression): Resolve the initializer
6111 expression in the emit context of the enclosing class.
6112 * tree.cs (RootTypes): Remove Register ().
6114 2005-03-08 Marek Safar <marek.safar@seznam.cz>
6116 * cs-parser.jay: Removed CS0134.
6118 * driver.cs: Removed CS1901.
6120 * expression.cs (SizeOf.DoResolve): Don't report CS0233
6121 for predefined types.
6123 2005-03-07 Duncan Mak <duncan@novell.com>
6125 * codegen.cs (Save): Catch UnauthorizedAccessException as
6126 well. Fixes bug #73454.
6128 2005-03-07 Marek Safar <marek.safar@seznam.cz>
6130 * cs-tokenizer.cs (xtoken): Add CS1035.
6132 * class.cs (MethodData.Define): Add CS0683.
6133 (FieldMember.ctor): Add CS0681.
6135 2005-03-07 Raja R Harinath <rharinath@novell.com>
6137 * ecore.cs (SimpleName.DoResolve): Rename from
6138 SimpleName.DoResolveAllowStatic.
6139 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6140 Pass 'intermediate' flag to MemberStaticCheck.
6141 (SimpleName.MemberStaticCheck): Skip "static check" only in case
6142 of "intermediate" lookups via MemberAccess.
6143 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
6144 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6146 2005-03-07 Raja R Harinath <rharinath@novell.com>
6149 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6150 slipped in because of variable names that are identical to a
6151 builtin type's BCL equivalent ('string String;', 'int Int32;').
6152 (PropertyExpr.EmitInstance): Likewise.
6154 2005-03-04 Marek Safar <marek.safar@seznam.cz>
6156 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6158 * report.cs (warning_ignore_table): Made public.
6160 2005-03-04 Raja R Harinath <rharinath@novell.com>
6163 * class.cs (MethodData.Emit): Pass 'container' to
6164 container.GetObsoleteAttribute instead of 'container.Parent'.
6166 2005-03-03 Marek Safar <marek.safar@seznam.cz>
6168 * cs-parser.jay: Add 1534 error test.
6170 * iterators.cs (Yield.CheckContext): Add error 1629.
6171 (Iterator.ctor): Save unsafe modifier.
6172 (MoveNextMethod.DoEmit): Restore unsafe context.
6174 * namespace.cs (UsingAlias): Better error message.
6176 2005-03-03 Dan Winship <danw@novell.com>
6178 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6179 the warning message [#73219]
6181 2005-03-03 Raja R Harinath <rharinath@novell.com>
6183 Fix compile with MCS 1.0.0.0.
6184 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6185 w_restore to not depend on string constant folding.
6187 2005-03-03 Raja R Harinath <rharinath@novell.com>
6189 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
6190 CS0246 check to users who passed 'silent = false'.
6191 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6193 (SimpleName.SimpleNameResolve): Update.
6194 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6195 (MemberAccess.IdenticalNameAndTypeName): Update.
6196 * doc.cs (FindDocumentedTypeNonArray): Update.
6198 2005-03-03 Raja R Harinath <rharinath@novell.com>
6200 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6201 * parameters.cs (ComputeAndDefineParameters): Remove.
6202 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6203 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6204 Use GetParameterInfo.
6206 2005-03-02 Marek Safar <marek.safar@seznam.cz>
6208 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6210 2005-03-02 Raja R Harinath <rharinath@novell.com>
6212 Unify DeclSpace.LookupType and DeclSpace.FindType.
6213 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
6214 is in charge of defining nested types on demand.
6215 (DeclSpace.LookupType): Use it when the current_type is a
6216 TypeBuilder. Use LookupTypeDirect for reflected types.
6217 (DeclSpace.FindType): Remove.
6218 (DeclSpace.LookupInterfaceOrClass): Likewise.
6219 (DeclSpace.DefineTypeAndParents): Likewise.
6220 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6221 DeclSpace.LookupType.
6222 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6223 * typemanager.cs (LookupType): Simplify.
6224 (AddUserType): Remove type from negative_hits.
6225 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6226 * class.cs (TypeContainer.FindMembers): Move handling of nested
6228 (TypeContainer.FindMembers_NestedTypes): ... here.
6229 (TypeContainer.FindNestedType): Implement override.
6230 (ClassPart.FindNestedType): Delegate to PartialContainer.
6231 (ClassPart.PartFindNestedType): Looks up the nested types of the
6234 2005-03-02 Martin Baulig <martin@ximian.com>
6236 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6237 static constructor in static classes.
6239 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
6241 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6242 sizeParamIndex is not specified.
6244 2005-03-01 Marek Safar <marek.safar@seznam.cz>
6247 * report.cs (WarningMessage.IsEnabled): Missing null check.
6249 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6251 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6252 in the fields and not in the properties.
6254 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
6256 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
6259 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6261 * attribute.cs: Small refactoring (improved robustness).
6262 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6263 (ValidateGuid): Removed.
6264 (Resolve): Removed referenced to above mentioned.
6265 (GetAttributeUsage): Made private and changed to work without
6267 (GetIndexerAttributeValue): Don't crash.
6268 (GetConditionalAttributeValue): Ditto.
6269 (GetClsCompliantAttributeValue): Ditto.
6270 (ExtractSecurityPermissionSet): All attributes exceptions are
6272 (GetPropertyValue): New helper.
6273 (GetMethodImplOptions): New method.
6274 (DefinePInvokeMethod): Reuse common code. Implemented handling of
6275 some missing properties.
6277 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6278 (Method.ApplyAttributeBuilder): Updated.
6280 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6283 2005-02-28 Raja R Harinath <rharinath@novell.com>
6286 * report.cs (Report.SymbolRelatedToPreviousError): Handle
6287 non-simple types (array, pointer, reference).
6289 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6291 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6293 * class.cs (MethodCore.IsDuplicateImplementation): Special error
6295 (Method.CheckBase): Catch wrong destructor here.
6296 (MethodData.Define): Add errors 550, 668.
6298 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6300 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6302 * pending.cs (VerifyPendingMethods): Add error 551.
6304 * typemanager.cs (CSharpName): Next error report helper.
6306 2005-02-25 Marek Safar <marek.safar@seznam.cz>
6308 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6309 attributes. Removed useless attribute double check.
6310 It saves almost 2MBs for corlib.
6312 2005-02-25 Raja R Harinath <rharinath@novell.com>
6315 * statement.cs (ExpressionStatement.Resolve): Make robust to being
6316 called twice in case of error.
6318 2005-02-23 Chris Toshok <toshok@ximian.com>
6320 Fix compiler portions of #72827.
6321 * statement.cs (Block.Emit): call Begin/EndScope on the
6322 EmitContext instead of the ILGenerator.
6324 * codegen.cs (EmitContext.BeginScope): new method, call
6325 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6327 (EmitContext.BeginScope): same, but EndScope and CloseScope
6329 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6330 offset and call the superclass's OpenScope(int) with it.
6331 (SymbolWriter.CloseScope): get the current il
6332 offset and call superclass's CloseScope(int) with it.
6334 2005-02-23 Marek Safar <marek.safar@seznam.cz>
6336 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6337 CS1677 for out and ref as well.
6339 * class.cs (Method.Define): Add error CS1599 detection.
6341 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6343 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6345 * delegate.cs (Delegate.Define): Add error CS1599 detection.
6347 * support.cs.cs (ModifierDesc): New helper method.
6349 2005-02-23 Raja R Harinath <rharinath@novell.com>
6350 Abin Thomas <projectmonokochi@rediffmail.com>
6351 Anoob V E <projectmonokochi@rediffmail.com>
6352 Harilal P R <projectmonokochi@rediffmail.com>
6355 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6356 MemberLookup (used for error reporting) actually returns a result.
6357 Fix error report number (122, not 112).
6359 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
6360 Anoob V E <projectmonokochi@rediffmail.com>
6361 Harilal P R <projectmonokochi@rediffmail.com>
6364 * pending.cs (PendingImplementation.GetAbstractMethods):
6365 Find NonPublic members too.
6367 2005-02-22 Marek Safar <marek.safar@seznam.cz>
6369 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6372 * class.cs (MethodCore.CheckMethodAgainstBase):
6373 Add error 239 report.
6375 2005-02-21 Raja R Harinath <rharinath@novell.com>
6378 * expression.cs (Invocation.IsApplicable): Make public.
6379 (Invocation.IsParamsMethodApplicable): Likewise.
6380 * delegate.cs (Delegate.VerifyApplicability): Don't use
6381 Invocation.VerifyArgumentCompat for parameter applicability
6382 testing. Use Invocation.IsApplicable and
6383 Invocation.IsParamsMethodApplicable.
6385 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6387 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6389 * class.cs (Operator.Define): Add error 217 report.
6391 2005-02-21 Raja R Harinath <rharinath@novell.com>
6393 * namespace.cs (UsingEntry.Resolve): Undo change below.
6395 2005-02-21 Raja R Harinath <rharinath@novell.com>
6398 * ecore.cs (Expression.MemberLookupFailed): Add argument to
6399 disable the error message when the extended MemberLookup also
6401 (Expression.MemberLookupFinal): Update.
6402 (SimpleName.DoSimpleNameResolve): Update.
6403 * expression.cs (MemberAccess.ResolveNamespaceOrType):
6404 Don't use MemberLookupFinal.
6405 (New.DoResolve): Update.
6406 (BaseAccess.CommonResolve): Update.
6408 2005-02-21 Raja R Harinath <rharinath@novell.com>
6411 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6412 occured previously, don't resolve again.
6414 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6417 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6418 argument. Call ResolveAttributeUsage for unresolved.
6419 when types doesn't match ctor arguments.
6421 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6422 for nested attribute classes.
6423 (Class.attribute_usage): Removed.
6424 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6425 for attribute class.
6427 * ecore.cs (IsAttribute): Removed.
6429 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6431 * rootcontext.cs (RegisterAttribute): Removed, attributes are
6433 (attribute_types): Removed.
6434 (EmitCode): Global attributes are emited as the latest.
6436 2005-02-18 Marek Safar <marek.safar@seznam.cz>
6438 * class.cs (EmitFieldInitializers): Don't emit field initializer
6439 for default values when optimilization is on.
6441 * constant.cs (Constant.IsDefaultValue): New property.
6443 * driver.cs: Add /optimize handling.
6447 * literal.cs: Implement new IsDefaultValue property.
6449 * rootcontext.cs (Optimize): New field, holds /optimize option.
6451 2005-02-18 Raja R Harinath <rharinath@novell.com>
6453 Fix crasher in re-opened #72347.
6454 * namespace.cs (Namespace.Lookup): Return null if
6455 DeclSpace.DefineType returns null.
6458 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6460 2005-02-18 Raja R Harinath <rharinath@novell.com>
6462 Fix remainder of #63202. Change semantics of DoResolveLValue: it
6463 now returns null if it cannot resolve to an lvalue.
6464 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6465 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6466 returned null. Remove check for SimpleName.
6467 (EventExpr.DoResolveLValue): New.
6468 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6469 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
6471 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
6473 (Unary.ResolveOperator): Move CS0211 check ...
6474 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
6476 (Unary.DoResolveLValue): Simplify.
6477 (AddressOf.DoResolveLValue): New.
6478 (ArrayAccess.DoResolveLValue): New.
6480 2005-02-16 Marek Safar <marek.safar@seznam.cz>
6482 * attribute.cs (Attribute.Resolve): Add arguments casting for
6483 when types doesn't match ctor arguments.
6485 2005-02-16 Raja R Harinath <rharinath@novell.com>
6487 Fix parts of #63202.
6488 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6489 lookup of operator in base type. Ensure that all checks happen
6490 when the operator resolves to an "op_..." method.
6492 2005-02-15 Raja R Harinath <rharinath@novell.com>
6495 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6496 'ignore_cs0104' parameter. Pass it to ...
6497 (NamespaceEntry.Lookup): ... this.
6498 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6499 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6500 (TypeLookupExpression.DoResolveAsTypeStep): Update.
6501 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6502 Update. Request that cs0104 errors be ignored.
6503 (ComposedCast.ResolveAsTypeStep): Update.
6505 2005-02-14 Raja R Harinath <rharinath@novell.com>
6508 * expression.cs (Invocation.BetterFunction): Remove support for
6509 comparing virtual functions and their overrides.
6510 (Invocation.IsOverride): New.
6511 (Invocation.OverloadResolve): Don't consider 'override' functions
6512 during candidate selection. Store them in a lookaside list.
6513 If the selected method is a 'virtual' function, use the list to
6514 find any overrides that are closer to the LHS type.
6516 2005-02-14 Marek Safar <marek.safar@seznam.cz>
6518 * expression.cs (New.DoResolve): Add complex core type reduction.
6519 (New.Constantify): Converts complex core type syntax like 'new int ()'
6522 2005-02-14 Raja R Harinath <rharinath@novell.com>
6524 * decl.cs (EntryType.EntryType): New constructor to create an
6525 updated copy of a cache entry.
6526 (MemberCache.AddMethods): Use it.
6527 (MemberCache.ClearDeclaredOnly): Remove.
6528 (MemberCache.MemberCache): Update.
6530 2005-02-11 Miguel de Icaza <miguel@novell.com>
6532 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6533 variable. This one is represents the actual low-level declaration
6534 of the method, as opposed to the semantic level `IsStatic'.
6536 An anonymous method which is hosted into a static method might be
6537 actually an instance method. IsStatic would reflect the
6538 container, while MethodIsStatic represents the actual code
6541 * expression.cs (ParameterReference): Use the new MethodIsStatic
6542 instead of IsStatic.
6544 * anonymous.cs (AnonymousMethod.Compatible): Pass the
6545 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6546 set on the current EmitContext.
6548 * expression.cs (Cast): Overload DoResolveLValue so we can pass
6549 resolve our casted expression as an LValue. This triggers the
6550 proper LValue processing that is later required by Assign.
6554 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6556 2005-02-11 Marek Safar <marek.safar@seznam.cz>
6558 C# 2.0 Fixed buffer implementation
6560 * anonymous.cs: Update after RegisterHelperClass renaming.
6562 * attribute.cs (AttributeTester.fixed_buffer_cache):
6563 Cache of external fixed buffers.
6564 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6565 implementation if field is fixed buffer else null.
6568 (TypeContainer.AddField): Accept FieldMember instead of Field.
6569 (FieldBase.IsFieldClsCompliant): Extracted code from
6570 VerifyClsCompliance descendant customization.
6571 (FixedField): New class handles fixed buffer fields.
6572 (FixedFieldExternal): Keeps information about imported fixed
6574 (IFixedField): Make access to internal or external fixed buffer
6577 * cs-parser.jay: Add fixed buffer parsing.
6579 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6582 * expression.cs (Indirection): Extended implementation to accept
6584 (PointerArithmetic.Emit): Get element from fixed buffer as well.
6585 (ElementAccess.MakePointerAccess): Get type as parameter.
6586 (DoResolve): Add fixed buffer field expression conversion.
6587 (DoResolveLValue): Ditto.
6588 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6589 (ArrayPtr): Derives from FixedBufferPtr.
6590 (ArrayPtr.Emit): Add extra emit for array elements.
6592 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6594 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6595 for compiler generated types.
6596 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6598 * statement.cs (Fixed): Refactored to be easier add fixed buffer
6599 and consume less memory.
6600 (Fixed.Resolve): Add fixed buffer case.
6602 * typemanager.cs (compiler_generated_attr_ctor,
6603 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6604 (HasElementType): Add our own implementation to work on every
6607 2005-02-11 Miguel de Icaza <miguel@novell.com>
6609 * anonymous.cs (CaptureContext): Track whether `this' has been
6612 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
6613 only captured `this' if it was implicitly done (instance
6614 methods/variables were used).
6616 * codegen.cs (EmitContext.CaptureThis): New method to flag that
6617 `this' must be captured.
6619 2005-01-30 Miguel de Icaza <miguel@novell.com>
6621 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6622 is null it means that there has been no need to capture anything,
6623 so we just create a sibling.
6625 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6627 Just a partial fix. The other half is fairly elusive.
6629 2005-02-10 Raja R Harinath <rharinath@novell.com>
6631 Fix #52586, cs0121-4.cs.
6632 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
6633 and return a hashtable.
6634 (MemberCache.ClearDeclaredOnly): New.
6635 (MemberCache.MemberCache): Update to change. Make a deep copy of
6636 the method_hash of a base type too.
6637 (MemberCache.AddMethods): Adapt to having a deep copy of the base
6638 type methods. Overwrite entries with the same MethodHandle so
6639 that the ReflectedType is correct. The process leaves in base
6640 virtual functions and their overrides as distinct entries.
6641 (CacheEntry): Now a class instead of a struct. It shouldn't alter
6642 matters since it was boxed in a ArrayList before.
6643 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6645 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
6646 case of a virtual function and its override (choose the overload
6648 (Invocation.OverloadResolve): Avoid 'override' members during
6649 'applicable_type' calculation.
6651 2005-02-09 Raja R Harinath <rharinath@novell.com>
6653 Combine two near-redundant caches.
6654 * typemanager.cs (method_params): Rename from method_internal_params.
6655 (TypeManager.GetParameterData): New. Replace
6656 Invocation.GetParameterData.
6657 (TypeManager.LookupParametersByBuilder): Remove.
6658 * expression.cs (Invocation.method_parameter_cache): Remove.
6659 (Invocation.GetParameterData): Remove.
6661 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6664 2005-02-08 Raja R Harinath <rharinath@novell.com>
6667 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6668 TypeManager.multicast_delegate_type is null, resolve it by looking
6669 up "System.MulticastDelegate".
6670 * rootcontext.cs (RootContext.ResolveCore): Simplify.
6672 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
6673 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
6674 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
6677 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6678 (LabeledStatement.AddReference): New. Set 'referenced'.
6679 (Goto.Resolve): Use it.
6681 2005-02-05 John Luke <john.luke@gmail.com>
6683 * driver.cs: remove duplicate -doc line in Usage ()
6685 2005-02-04 Raja R Harinath <rharinath@novell.com>
6687 * location.cs (Location.AddFile): Fix CS2002 error report.
6689 2005-02-02 Martin Baulig <martin@ximian.com>
6691 * delegate.cs (Delegate.DefineType): Report an internal error if
6692 TypeManager.multicast_delegate_type is null. See bug #72015 for
6695 2005-02-02 Raja R Harinath <rharinath@novell.com>
6697 Fix a crasher in a variant of #31984.
6698 * const.cs (Constant.CheckBase): New override that defers the
6699 new-or-override check in case the base type hasn't been populated
6701 (Constant.Define): Ensure the new-or-override check is performed.
6703 2005-02-01 Duncan Mak <duncan@ximian.com>
6705 * const.cs (LookupConstantValue): Check that `ce' is not null
6706 before calling GetValue ().
6708 2005-02-01 Raja R Harinath <rharinath@novell.com>
6710 Fix test-334.cs (#69519).
6711 * cs-parser.jay (using_alias_directive): Pass in an expression to
6712 NamespaceEntry.UsingAlias.
6713 (using_namespace_directive): Pass in an expression to
6714 NamespaceEntry.Using.
6715 (namespace_name): Don't flatten to a string.
6716 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6717 (NamespaceEntry.AliasEntry.Resolve): Lookup using
6719 (NamespaceEntry.UsingEntry): Likewise.
6720 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6722 (NamespaceEntry.LookupForUsing): Remove.
6723 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6725 (NamespaceEntry.Lookup): Remove support for dotted names.
6727 2005-02-01 Raja R Harinath <rharinath@novell.com>
6729 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6731 (NamespaceEntry.ImplicitParent): Compute on demand.
6732 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6733 parallels the current.
6734 (NamespaceEntry.LookupForUsing): Use it.
6735 (NamespaceEntry.Lookup): If the current namespace-entry is
6736 implicit, don't search aliases and using tables.
6738 2005-02-01 Raja R Harinath <rharinath@novell.com>
6741 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6743 (TypeContainer.BaseCache): Compute on demand.
6744 (TypeContainer.FindMembers): Define constants and types if they're
6745 not already created.
6746 (FieldMember.Define): Move resetting of ec.InUnsafe before error
6748 * const.cs (Constant.Define): Make idempotent.
6750 2005-01-29 Miguel de Icaza <miguel@novell.com>
6752 * pending.cs: Produce better code (no nops produced by using Ldarg
6755 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6756 i - 1' it should be arg + 1.
6760 2005-01-28 Raja R Harinath <rharinath@novell.com>
6762 * attribute.cs (Attribute.CheckAttributeType): Make private
6764 (Attribute.ResolveType): Make virtual.
6765 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6766 handling of RootContext.Tree.Types.
6768 2005-01-27 Raja R Harinath <rharinath@novell.com>
6770 Update attribute-handling to use the SimpleName/MemberAccess
6772 * cs-parser.jay (attribute): Pass in an expression to the
6773 constructors of Attribute and GlobalAttribute.
6774 * attribute.cs (Attribute): Take an expression for the name.
6775 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
6776 passed in attribute name expression.
6777 (Attribute.CheckAttributeType): Use it.
6778 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6779 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6780 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
6781 argument to prevent error messages if the lookup fails.
6783 2005-01-27 Marek Safar <marek.safar@seznam.cz>
6785 * expression.cs (Indirection): Implemented IVariable interface
6786 to support indirection in AddressOf operator.
6787 (PointerArithmetic.Emit): Add optimalization for case where
6788 result can be precomputed.
6790 2005-01-26 Martin Baulig <martin@ximian.com>
6792 * class.cs (TypeContainer.AttributeTargets): Return the correct
6793 AttributeTargets depending on our `Kind' instead of throwing an
6794 exception; fixes #71632.
6796 2005-01-26 Marek Safar <marek.safar@seznam.cz>
6799 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6802 2005-01-25 Raja R Harinath <rharinath@novell.com>
6805 * expression.cs (MemberAccess.DoResolve): Don't complain with
6806 cs0572 when the LHS of a member access has identical name and type
6809 2005-01-25 Marek Safar <marek.safar@seznam.cz>
6812 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6814 Create custom PermissionSet only for PermissionSetAttribute.
6816 2005-01-24 Marek Safar <marek.safar@seznam.cz>
6819 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6820 delegates in static class.
6822 2005-01-24 Martin Baulig <martin@ximian.com>
6824 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6825 merging an implicit block, just use its reachability.
6827 * statement.cs (Block.Resolve): Make the unreachable code check
6828 work wrt. implicit blocks; see test-337 from #63842.
6830 2005-01-21 Alp Toker <alp@atoker.com>
6832 * cs-parser.jay: destructor_declaration's container is PartialContainer
6833 not Class when partial types are used, so use Kind prop instead of
6836 2005-01-22 Miguel de Icaza <miguel@ximian.com>
6838 * cs-parser.jay: Improve error reporting when an interface
6841 2005-01-20 Dick Porter <dick@ximian.com>
6843 * support.cs: SeekableStreamReader fix from Sandor Dobos
6844 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6845 chars are read. Fixes bug 70369.
6847 2005-01-20 Raja R Harinath <rharinath@novell.com>
6849 * cs-parser.jay (catch_clause): Simplify current_block handling
6852 2005-01-17 Miguel de Icaza <miguel@ximian.com>
6854 * convert.cs (ImplicitStandardConversionExists): Synchronize the
6855 code with ImplicitStandardConversion to handle the implicit
6856 conversion of method groups into valid delegate invocations.
6858 The problem is that in parameter handling we were using this code
6859 path. Fixes bug #64698
6861 2005-01-19 Raja R Harinath <rharinath@novell.com>
6863 * cs-parser.jay: Fix several infelicities.
6864 - Avoid assigning to the parser value stack. Code like
6865 '$3 = null' is unclean. Synthesize a value for the code block
6867 - Avoid using oob_stack for storing location information. Use ...
6868 (_mark_): ... this. New (empty) rule. Saves the current location
6870 (foreach_statement): Avoid using oob_stack for current_block
6871 handling. Use technique used in for_statement and
6872 using_statement. Synthesize a value for the code block to store
6873 additional intermediate information.
6875 2005-01-13 Miguel de Icaza <miguel@ximian.com>
6877 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6878 of a different type is only allowed to private fields of a
6879 containing type, not on fields of a base class.
6881 See test-174.cs and error cs0122-9.cs
6883 2005-01-13 Raja R Harinath <rharinath@novell.com>
6885 Fix test-335.cs (bug #58126).
6886 * cs-parser.jay (argument): Split out non-expression parts of the
6887 rule into 'non_simple_argument'.
6888 (invocation_expression): Support parenthesized invocations with
6889 multiple arguments, and with single non-simple arguments.
6891 2005-01-13 Raja R Harinath <rharinath@novell.com>
6893 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6896 2005-01-12 Raja R Harinath <rharinath@novell.com>
6898 Fix cs0038-1.cs, cs1640-6.cs.
6899 * ecore.cs (Expression.Resolve): Remove special-case for
6900 SimpleName in error-handling.
6901 (Expression.almostMatchedMembers): Relax access permission to
6903 (Expression.MemberLookupFailed): Handle duplicates in
6904 almostMatchedMembers list.
6905 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6906 * expression.cs (New.DoResolve): Report CS1540 for more cases.
6907 * typemanager.cs (GetFullNameSignature): Use the MethodBase
6908 overload if the passed in MemberInfo is a MethodBase.
6910 2005-01-12 Marek Safar <marek.safar@seznam.cz>
6913 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6914 for non-CAS & merge permission sets properly.
6916 2005-01-11 Raja R Harinath <rharinath@novell.com>
6918 Improve standard-compliance of simple name and member access
6919 resolution. Fixes bugs #52697, #57200, #67520, #69519.
6920 * ecore.cs (FullNamedExpression): New abstract base class
6921 for Namespaces and TypeExpressions.
6922 (ResolveFlags.SimpleName): Remove.
6923 (SimpleName): Remove support for dotted names.
6924 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
6925 DeclSpace.FindType and DeclSpace.LookupType.
6926 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6927 (Expression.ExprClassName): Make member function.
6928 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6929 a namespace. Remove creation of dotted "SimpleName"s.
6930 (MemberAccess.DoResolve): Likewise.
6931 * decl.cs (DeclSpace.Cache): Make private.
6932 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6933 (DeclSpace.FindType): Update.
6934 (DeclSpace.LookupType): Move here from RootContext. Return a
6935 FullNamedExpression.
6936 * namespace.cs (Namespace): Derive from FullNamedExpression
6937 so that it can be part of expression resolution.
6938 (Namespace.Lookup): Return an FullNamedExpression.
6939 (NamespaceEntry.LookupAlias): Lookup aliases only in current
6941 * rootcontext.cs (NamespaceLookup): Remove.
6942 (LookupType): Move to DeclSpace.
6943 * attribute.cs (CheckAttributeType): Update.
6944 * doc.cs (FindDocumentedType): Remove allowAlias argument.
6945 (FindDocumentedTypeNonArray): Likewise.
6947 2005-01-11 Raja R Harinath <rharinath@novell.com>
6949 Fix cs0509.cs, cs1632.cs.
6950 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6951 is the same as IsInterface.
6952 (TypeContainer.GetClassBases): Likewise.
6953 * statement.cs (LabeledStatement.ig): New field.
6954 (LabeledStatement.LabelTarget): Save ILGenerator which created the
6956 (LabeledStatement.DoEmit): Check that the label was created with
6957 the same ILGenerator.
6959 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6962 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6963 accessors to its properties.
6965 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6966 from accessors to property.
6968 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6971 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6974 2005-01-08 Miguel de Icaza <miguel@ximian.com>
6976 * attribute.cs: Check for null and empty strings.
6978 I have lost another battle to Paolo.
6980 2005-01-07 Marek Safar <marek.safar@seznam.cz>
6983 * class.cs (PropertyMethod): Set Parent field in ctors.
6984 (SetMethod.InternalParameters): Add unsafe switch hack.
6985 Override MarkForDuplicationCheck where it is appropriate.
6987 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6988 It says whether container allows members with the same name.
6990 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6991 Removed is_method parameter.
6993 2005-01-06 Duncan Mak <duncan@ximian.com>
6995 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6996 because the previous change led to incorrect reporting of CS1032
6997 ("Cannot define/undefine preprocessor symbols after first token in
6998 file"). Instead of using `tokens_seen' as the only flag that
6999 triggers CS1040, introduce `comments_seen'. This new flag is used
7000 to signify having seen comments on the current line, so it is
7001 unset after a newline.
7003 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7005 * doc.cs : When searching for a type, find nested type too.
7006 This fixes bug #71040.
7008 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7011 - Warn missing member comment on those classes which also does not
7012 have doc comments. Fixed bug #71041.
7013 - Don't warn missing doc comment on default constructor.
7016 2005-01-06 Duncan Mak <duncan@ximian.com>
7018 * cs-tokenizer.cs (xtoken): After handling traditional C-style
7019 comments, set `tokens_seen' to true. This allows us to detect
7020 misplaced preprocessor directives (i.e. not at the beginning of
7021 the a line, nor after whitespaces). In that case, report error
7022 CS1040. This fixes bug #56460.
7024 * cs-parser.jay (interface_member_declaration): Add checks for
7025 IsExplicitImpl, and report CS0541 error if an interface member is
7026 defined as an explicit interface declaration.
7028 2005-01-06 Marek Safar <marek.safar@seznam.cz>
7031 * class.cs (PropertyMethod): Set Parent field in ctors.
7032 (SetMethod.InternalParameters): Add unsafe switch hack.
7034 * decl.cs (MemberCore.Parent): Cannot be readonly.
7036 2005-01-06 Raja R Harinath <rharinath@novell.com>
7038 * decl.cs (DeclSpace.ResolveType): Remove.
7039 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7040 Merge in code from ...
7041 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
7042 * class.cs, enum.cs: Update to changes.
7044 2005-01-06 Miguel de Icaza <miguel@ximian.com>
7046 * anonymous.cs: Ensure that we init the scope of our parent if it
7047 has not been initialized yet.
7049 2004-12-30 Duncan Mak <duncan@ximian.com>
7051 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7052 if field.FieldBuilder is null. Fixes #70758.
7054 * convert.cs: Fixed some typos and updated some of the comments.
7055 (ImplicitStandardConversionExists):
7056 (TryImplicitIntConversion): If `target_type' is an interface and
7057 the type of `ic' implements this interface, return true or a new
7058 BoxedCast instead of null. This fixes #70468.
7060 2004-12-29 Duncan Mak <duncan@ximian.com>
7062 * expression.cs (Argument.Emit): Check that Expr is
7063 IMemoryLocation before casting to it, and report CS1510 otherwise.
7067 2004-12-21 Ben Maurer <bmaurer@ximian.com>
7069 * statement.cs (Block.ThisVariable): remove the recursion here, to
7070 make the --profile more sane.
7072 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
7074 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7075 assembly, by JB Evain.
7077 2004-12-17 Raja R Harinath <rharinath@novell.com>
7079 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
7080 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7081 "parent" refers to enclosing type/class. "base" refers to superclass.
7083 2004-12-17 Raja R Harinath <rharinath@novell.com>
7085 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7086 Ensure that we only have GlobalAttributes.
7087 * attribute.cs (Attribute.Emit): Make non-virtual.
7088 (GlobalAttribute.Emit): Remove.
7089 (Attribute.Resolve): Make virtual.
7090 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
7091 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7092 the argument. Don't create one.
7093 (Attribute.GetObsoleteAttribute): Likewise.
7094 (Attribute.GetClsCompliantAttributeValue): Likewise.
7095 * class.cs, decl.cs: Update to changes.
7097 2004-12-17 Marek Safar <marek.safar@seznam.cz>
7099 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7101 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7103 * statement.cs (Foreach.Resolve): Add error 186 report.
7105 2004-12-16 Marek Safar <marek.safar@seznam.cz>
7107 * expression.cs (Conditional.DoResolve): Add warning 429.
7109 * statement.cs (If.Resolve): Add warning 665.
7111 2004-12-16 Raja R Harinath <rharinath@novell.com>
7113 New invariant: RootContext.Tree.Types.NamespaceEntry == null
7114 except when in the parser, and in GlobalAttribute.
7115 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7116 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7117 RootContext.Tree.Types.NamespaceEntry once work is done.
7118 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
7119 and resets RootContext.Tree.Types.NamespaceEntry.
7121 2004-12-15 Marek Safar <marek.safar@seznam.cz>
7123 * cs-parser.jay: Don't create a block for every variable.
7125 2004-12-14 Miguel de Icaza <miguel@ximian.com>
7127 * location.cs: Provide extra information.
7129 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7130 variables from the captured environment, it is the ldarg_0.
7132 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7134 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7137 * class.cs: Changed warning level for 169 to avoid developer
7138 displeasure from warning flooding. It will be changed back when they
7139 fix most of current BCL warnings.
7141 * RootContext.cs: Pushed default WarningLevel to 3.
7143 * statement.cs: Removed unused variable.
7145 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7147 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7148 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7149 Add error 502 report.
7150 (StaticClass.DefineType): Add error 441 report.
7151 (Class.AllowedModifiersProp): New virtual property as temporary
7152 extension to AllowedModifiers.
7153 (Class.DefineType): Add error 418 report. Moved ModFlags check here
7154 to share implementation with StaticClass and don't call virtual
7157 * driver.cs (MainDriver): Add error 1558 test.
7159 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7160 report. Moved error 36 test here.
7162 * statement.cs (Throw.Resolve): Add error 724 report.
7164 * typemanager.cs: Add out_attribute_type core type.
7166 2004-12-13 Marek Safar <marek.safar@seznam.cz>
7168 * class.cs (TypeContainer.VerifyClsCompliance): Add error
7170 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7172 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7175 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7177 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
7178 Add error 3023 report.
7179 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7181 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7184 2004-12-12 John Luke <john.luke@gmail.com>
7186 * driver.cs (AddArgs): take -- into account when
7187 adding arguments, fixes bug 65710
7189 2004-12-12 Martin Baulig <martin@ximian.com>
7191 * expression.cs (Unary.TryReduceNegative): Added support for
7192 SByteConstant and ByteConstant.
7193 (Unary.Reduce): Check error values from TryReduceNegative().
7195 2004-12-10 Marek Safar <marek.safar@seznam.cz>
7197 * attributes.cs (Attribute.Resolve): Avoid multiple error report
7198 and report exception as error 182.
7200 2004-12-10 Raja R Harinath <rharinath@novell.com>
7202 * driver.cs (Main): Fix message when there are warnings.
7204 2004-12-09 Miguel de Icaza <miguel@ximian.com>
7206 * delegate.cs: Fixed my fix from yesterday, sorry about that.
7208 2004-12-09 Marek Safar <marek.safar@seznam.cz>
7210 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
7211 Reduced number of warnings.
7213 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7215 2004-12-08 Miguel de Icaza <miguel@ximian.com>
7217 * driver.cs: Removed message.
7219 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7221 2004-12-08 <vargaz@freemail.hu>
7223 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7225 2004-12-08 Martin Baulig <martin@ximian.com>
7227 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7228 instead of a CS3002 for properties and indexer.
7230 2004-12-08 Martin Baulig <martin@ximian.com>
7232 * decl.cs (MemberName.ToString): Make this work again.
7234 2004-12-08 Marek Safar <marek.safar@seznam.cz>
7236 * attribute.cs (Resolve): Add error 591 detection.
7238 * class.cs (FieldMember.Define): Add error 1547 detection.
7239 (Indexer.Define): Add error 620 detection.
7240 (Operator.Define): Add error 590 detection.
7242 * ecore.cs: Missing argument for error 79.
7244 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7247 2004-12-07 Marek Safar <marek.safar@seznam.cz>
7250 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7253 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7255 * cs-parser.jay : handle doc comments on implicit/explicit operators.
7256 Some operator comments were suppressed.
7257 * doc.cs : Implicit/explicit operator name in doc comments are like
7258 "op_Explicit(type)~returnType", so added suffix handling.
7260 2004-12-07 Martin Baulig <martin@ximian.com>
7263 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7264 (MemberCore.GetClsCompliantAttributeValue): Likewise.
7265 (DeclSpace.ec): New protected field; store the EmitContext here.
7266 (DeclSpace.EmitContext): New public property; moved here from
7268 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7271 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7272 (Enum.Emit): Don't create a new EmitContext.
7274 * delegate.cs (Delegate.DefineType): Always create the
7277 * iterators.cs (Iterators.DefineIterator): Create a new
7278 EmitContext and store it in `ec'.
7280 2004-08-24 Martin Baulig <martin@ximian.com>
7283 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7284 this for accessibility checks.
7285 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7286 IsNestedFamilyAccessible.
7287 (TypeManager.IsSubclassOf): New method, do what the name actually
7290 2004-12-06 Raja R Harinath <rharinath@novell.com>
7292 Fix crash on cs0657-17.cs.
7293 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7294 Use RootContext.Tree.Types, not 'new RootTypes ()'.
7295 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7296 the case where the NamespaceEntry gets overwritten.
7298 2004-12-06 Marek Safar <marek.safar@seznam.cz>
7300 Fixed #69195, #56821
7301 * ecore.cs (ResolveBoolean): Tiny refactoring.
7303 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7304 of right expression resolving when left is false constant and
7305 operator is LogicalAnd OR true constant and operator is LogicalOr.
7307 * statement.cs (ResolveUnreachable): Always reports warning.
7309 2004-12-05 Miguel de Icaza <miguel@ximian.com>
7311 * class.cs: Distinguish between 1721 and 1722 (just a little help
7312 for the programmer).
7314 2004-12-03 Miguel de Icaza <miguel@ximian.com>
7316 * delegate.cs: Only allow this on new versions of the language.
7318 2004-12-02 Duncan Mak <duncan@ximian.com>
7320 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7322 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7323 here as a static method. Take an additional bool out parameter
7324 `must_do_cs1540_check' for signaling to InstanceResolve.
7325 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7326 member field from PropertyExpr class and made it an argument of
7328 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7329 check for MarshalByRefObject, and report CS0122 instead of CS1540.
7330 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7331 and `remove_accessor' as well as InstanceResolve: report CS0122
7336 2004-12-03 Raja R Harinath <rharinath@novell.com>
7338 Fix test-327.cs, test-328.cs, and put in early infrastructure
7339 for eventually fixing #52697.
7340 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7341 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7343 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7344 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7345 (VerifyUsing, error246): Update.
7346 * rootcontext.cs (RootContext.NamespaceLookup): Just use
7347 'NamespaceEntry.LookupNamespaceOrType'.
7349 2004-12-03 Martin Baulig <martin@ximian.com>
7351 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7352 method as our child, call AnonymousMethod.Compatible() on it.
7354 2004-12-03 Raja R Harinath <rharinath@novell.com>
7356 Disable XML documentation support in 'basic' profile.
7357 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
7358 Redirect XmlElement to System.Object.
7359 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
7360 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
7361 * mcs.exe.sources: Add doc-bootstrap.cs.
7362 * doc-bootstrap.cs: New file. Contains empty stub implementation
7365 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
7367 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7368 comments are allowed.
7370 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7372 * delegate.cs: Add checks for subtypes in paramaters and return values
7373 in VerifyMethod () to add support for Covariance/Contravariance
7376 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7378 * report.cs: Remove extra closing parenthesis.
7380 * convert.cs (Error_CannotImplicitConversion): If the name of the
7381 types are the same, provide some extra information.
7383 * class.cs (FieldBase): Use an unused bit field from the field to
7384 encode the `has_offset' property from the FieldMember. This saves
7385 a couple of Ks on bootstrap compilation.
7387 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7388 method as our child, return the AnonymousMethod resolved
7391 * expression.cs (New.DoResolve): Allow return values from
7392 NewDelegate to also include AnonymousMethods.
7396 2004-12-02 Marek Safar <marek.safar@seznam.cz>
7399 * attribute.cs (Resolve): Improved implementation of params
7400 attribute arguments.
7402 * support.cs (ParameterData): Add HasParams to be faster.
7404 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
7406 all things are for /doc support:
7408 * doc.cs: new file that supports XML documentation generation.
7409 * mcs.exe.sources: added doc.cs.
7411 Handle /doc command line option.
7412 Report error 2006 instead of 5 for missing file name for /doc.
7413 Generate XML documentation when required, after type resolution.
7415 Added support for picking up documentation (/// and /** ... */),
7416 including a new XmlCommentState enumeration.
7418 Added lines to fill Documentation element for field, constant,
7419 property, indexer, method, constructor, destructor, operator, event
7420 and class, struct, interface, delegate, enum.
7421 Added lines to warn incorrect comment.
7423 Added Documentation field (passed only when /doc was specified).
7425 Added DocComment, DocCommentHeader, GenerateDocComment() and
7426 OnGenerateDocComment() and some supporting private members for
7427 /doc feature to MemberCore.
7429 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7431 Added overriden DocCommentHeader.
7433 Added overriden DocCommentHeader and GenerateDocComment().
7435 2004-12-01 Miguel de Icaza <miguel@ximian.com>
7437 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7438 unwrapping the enumeration values, chain to
7439 DoConstantNumericPromotions again, so we can promote things to the
7440 fundamental types (takes care of enums that are bytes, sbytes).
7444 2004-12-01 Raja R Harinath <rharinath@novell.com>
7446 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7447 Fix long-standing bug in type-lookup. Use FindType instead of
7448 LookupType when ec.ResolvingTypeTree.
7449 (Attribute.ResolveType, Attribute.Resolve)
7450 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7452 (Attributes.Search): Remove internal version. Update.
7453 (Attributes.SearchMulti): Update.
7454 (Attributes.GetClsCompliantAttribute): Remove.
7455 (Attributes.GetIndexerNameAttribute): Remove.
7456 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7457 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7458 * class.cs (Indexer.Define): Likewise.
7460 2004-12-01 Marek Safar <marek.safar@seznam.cz>
7463 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7464 MarshallByReference members access.
7466 * expression.cs: Use CheckMarshallByRefAccess;
7467 Better error CS0197 message.
7469 * report.cs: Print whole related error message.
7471 2004-11-30 Raja R Harinath <rharinath@novell.com>
7473 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
7474 the current directory to help debugging.
7476 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7478 * class (GetClassBases): Better error 60 report.
7479 (EventProperty): Disabled warning 67 detection.
7481 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7484 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7486 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7489 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7492 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7494 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7496 2004-11-26 Miguel de Icaza <miguel@ximian.com>
7498 * attribute.cs (Attribute.Resolve): Refine error reporting and
7499 report a cs0117 if the identifier does not exist, to distinguish
7500 from 0617 which is a miss-use of the actual identifier.
7502 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7503 between cs0070 and cs0079.
7505 * class.cs (MemberBase.DoDefine): When reporting a wrong
7506 accessibility level, we use MethodCore to compare instead of
7507 Method (this was a regression in some refactoring effort).
7509 So now we correctly report cs0056 again.
7511 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7512 testing the target_type (which was known to be object_type) and
7513 not the source type (which is anonymous_method).
7515 Fixed reporting of error cs1660.
7517 * expression.cs (UserCast.Source): Expose the underlying cast.
7519 * statement.cs (Switch.SwitchGoverningType): Sort the list of
7520 allowed types to find a match to int32 first (most common).
7522 In addition, it ignores any ImplicitUserConversions that did an
7523 internal implicit conversion (as the switch statement allows only
7524 one integral conversion to exist).
7526 * class.cs (PartialContainer.Create): rename `name' to
7527 `member_name' for clarity. Then replace the string calls with a
7528 call to MemberName.GetPartialName, as now using
7529 MemberName.ToString is an error (this is due to the side effects
7530 it had, that were fixed in the past).
7532 This will restore the error reporting on a number of partial class
7533 errors that were missusing this (and getting an exception as a
7534 results, which is now just a plain textual warning, because
7535 yyparse debug output would crash otherwise).
7537 2004-11-26 Raja R Harinath <rharinath@novell.com>
7539 * Makefile (PROGRAM_INSTALL_DIR): Remove.
7541 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7543 * rootcontext.cs (LookupType): Make sure to cache lookups that
7544 don't give us a negative result. This saves about 5% of corlib
7547 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7549 * report.cs (AbstractMessage.Print): messages are sent to stderr
7551 * class.cs (TypeContainer.GetClassBases): It is an error to have a
7552 non-interface in the list of interfaces (at this point, either
7553 parent was properly set, or a base class is being listed in the
7554 interfaces section).
7556 This flags error 1722, and resolves the crash from bug 69259.
7558 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7560 * statement.cs (Using.EmitExpressionFinally): make this work right
7561 for valuetypes. Fixes 69926.
7563 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7565 * const.cs (Const.ChangeType): Cope with the "0 literal can be
7566 converted to an enum" here, before we try to change the underlying
7567 type. This code exists, but it is a different code path than the
7568 one used while encoding constants.
7570 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7571 old bug: when converting from the null literal to a pointer,
7572 return an EmptyCast, not the NullLiteral.
7574 This fixes #69921, the recent null_type changes probably made this
7577 (ImplicitReferenceConversionExists): In addition, resynchronized
7578 the code here, so it matches the same code in
7579 ImplicitReferenceConversionExists for the `from any class-type S
7580 to any interface-type T'.
7583 2004-11-25 Marek Safar <marek.safar@seznam.cz>
7585 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7587 2004-11-24 Miguel de Icaza <miguel@ximian.com>
7589 * cs-parser.jay: Use verbosity accordingly.
7591 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7593 * expression.cs (Unary.ResolveOperator): Do not report warning;
7594 AddressOf reads from variable.
7596 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7598 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7602 * attribute.cs (Attributable): Removed CheckTargets.
7603 (Attributes.Emit): Explicit attribute targets are tested here.
7605 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7606 not enabled for interfaces.
7608 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7609 (GetAssemblyName): Ouch next bug there.
7611 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7613 * expression.cs: Error 275 added.
7615 2004-11-23 Marek Safar <marek.safar@seznam.cz>
7617 Fix bug #69177 (Implemented decimal constant support)
7619 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7620 (BinaryFold): Add DecimalConstant.
7622 * const.cs (Define): Decimal constant
7624 (ChangeType): Add decimal type handling.
7625 (LookupConstantValue): Don't set value for decimal type but
7626 emit DecimalConstantAttribute. Needed for constant optimization.
7628 * constant.cs (ToDecimal): New method.
7629 (ConvertToDecimal): New method.
7630 (IntConstant): Implemented ConvertToDecimal.
7631 (DecimalConstant.Emit): Emit optimized version for decimals in
7634 * expression.cs (ResolveOperator): Changed order of constant
7635 reduction to work correctly with native types which have
7636 overloaded operators.
7637 (ResolveMemberAccess): Extract constant value from attribute
7640 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7642 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7643 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7644 (ChangeType): Decimal is special.
7645 (TypeToCoreType): Add decimal type.
7647 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7649 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7652 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7654 * class.cs (EventField.ApplyAttributeBuilder): Fix error
7657 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7659 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7661 * pending.cs (PendingImplementation): Grab only interfaces.
7663 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7665 * statement.cs (ForeachHelperMethods): Add location member and
7666 error 202 detection.
7668 2004-11-19 Raja R Harinath <rharinath@novell.com>
7670 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
7671 automatically handled by executable.make.
7672 (PROGRAM): Make profile-specific.
7674 2004-11-18 Marek Safar <marek.safar@seznam.cz>
7676 * expression.cs (DoResolveBase): Fixed wrong warning for out
7679 2004-11-18 Martin Baulig <martin@ximian.com>
7681 Merged latest changes into gmcs. Please keep this comment in
7682 here, it makes it easier for me to see what changed in MCS since
7683 the last time I merged.
7685 2004-11-17 Raja R Harinath <rharinath@novell.com>
7687 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7688 (TypeHandle.GetMemberCache): New.
7689 (TypeHandle.TypeHandle): Update.
7690 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7691 (TypeManager.LookupParentInterfacesCache):
7692 Rename from LookupInterfaceCache. Optimize slightly.
7693 (TypeManager.MemberLookup_FindMembers): Update.
7694 * decl.cs (MemberCache.MemberCache): Set Container to null in the
7696 (AddCacheContents): Rename from AddHashtable.
7697 * class.cs (TypeContainer.parent_container): Remove.
7698 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7699 (TypeContainer.DoDefineMembers): Don't initialize it.
7700 Update to name changes.
7702 2004-11-17 Miguel de Icaza <miguel@ximian.com>
7704 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7705 that factors the code to check access modifiers on override.
7707 (PropertyBase): Use the code here.
7709 Patch from Lluis S'anchez, fixes bug #69361.
7711 2004-11-15 Miguel de Icaza <miguel@ximian.com>
7713 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7714 routine that is used to report the use of a captured variable
7715 whose address has been taken.
7717 There are two checks: one when variables are being captured and
7718 the other check is when the address of a variable is taken.
7720 (because an anonymous methods might be resolved before *or* after
7721 the address has been taken) and
7723 * expression.cs (Conditional.DoResolve): Remove the special
7724 casing that Martin added to trueExpr and falseExpr being both
7725 NullLiteral. We get the right behavior now just by introducing
7726 the null_type into the compiler.
7728 * convert.cs (ExplicitConversion): Change the code to use
7729 null_type instead of testing `expr is NullLiteral'.
7730 (ImplicitConversionStandard): use null_type too.
7731 (ImplicitReferenceConversionExists): use null_type too.
7732 (ImplicitReferenceConversion): use null_type too.
7734 * literal.cs: The type of `NullLiteral' is now null_type instead
7736 (Resolve): Set the type here.
7738 * typemanager.cs: Introduce null_type.
7740 2004-11-17 Martin Baulig <martin@ximian.com>
7742 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7743 direction, like FindMembers() does. Fixes #69546, testcase is in
7746 2004-11-16 Martin Baulig <martin@ximian.com>
7748 This is based on a patch from Marek Safar, see bug #69082.
7749 Fixes bugs #63705 and #67130.
7751 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7752 method; create a MemberCache for an interface type and cache the
7755 * decl.cs (IMemberContainer.ParentContainer): Removed.
7756 (IMemberContainer.ParentCache): New property.
7757 (MemberCache.SetupCacheForInterface): Removed.
7758 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7759 to create a cache for an interface's "parent".
7761 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7764 2004-11-16 Martin Baulig <martin@ximian.com>
7766 Merged back from gmcs; these changes already went into gmcs a
7767 couple of weeks ago.
7770 (TypeManager.AddUserType): Removed the `ifaces' argument.
7771 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
7773 (TypeManager.AddUserInterface): Removed.
7774 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
7776 (TypeManager.GetInterfaces): Likewise.
7777 (TypeManager.GetExplicitInterfaces): Likewise.
7779 * ecore.cs (TypeExpr.GetInterfaces): Removed.
7781 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
7782 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
7784 2004-11-14 Ben Maurer <bmaurer@ximian.com>
7786 * statement.cs: Avoid adding bools to a hashtable.
7788 2004-11-07 Miguel de Icaza <miguel@ximian.com>
7790 * expression.cs (Invocation.OverloadResolve): Flag error if we are
7791 calling an unsafe method from a safe location.
7793 2004-11-06 Marek Safar <marek.safar@seznam.cz>
7796 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7798 2004-11-06 Miguel de Icaza <miguel@ximian.com>
7800 * namespace.cs (VerifyUsing): use GetPartialName instead of
7803 2004-11-05 Miguel de Icaza <miguel@ximian.com>
7805 * statement.cs (Return.Resolve): Fix regression in typo: if
7806 `in_exc', we have to request a NeedReturnLabel, this was a typo
7807 introduced in the anonymous method check-in. Fixes #69131.
7809 * Indexers were using the ShortName when defining themselves,
7810 causing a regression in the compiler bootstrap when applying the
7811 patch from 2004-11-02 (first part), now they use their full name
7812 and the bug is gone.
7814 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
7816 * driver.cs: Strip the path from the names of embedded resources. Fixes
7819 2004-11-04 Raja R Harinath <rharinath@novell.com>
7821 Fix error message regression: cs0104-2.cs.
7822 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7823 (AliasEntry.Resolve): Update.
7824 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
7826 (RootContext.LookupType): Update.
7828 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
7830 * cs-parser.jay: Add support for handling accessor modifiers
7831 * class: Add support port accessor modifiers and error checking,
7832 define PropertyMethod.Define as virtual (not abstract anymore)
7833 * ecore.cs: Add checking for proeprties access with access modifiers
7834 * iterators.cs: Modify Accessor constructor call based in the modified
7836 2004-11-02 Ben Maurer <bmaurer@ximian.com>
7838 * expression.cs (StringConcat): Handle being called twice,
7839 as when we have a concat in a field init with more than two
7842 2004-11-02 Miguel de Icaza <miguel@ximian.com>
7844 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7845 special case explicit implementations, we should always produce
7846 the .property or .event declaration.
7848 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7849 since it will not return correct data if people use this
7850 unresolved in the presence of using statements (see test-313).
7852 * class.cs (MethodData.Define): If we are an explicit interface
7853 implementation, set the method name to the full name of the
7854 interface plus the name of the method.
7856 Notice that using the method.MethodName.GetFullName() does not
7857 work, as it will only contain the name as declared on the source
7858 file (it can be a shorthand in the presence of using statements)
7859 and not the fully qualifed type name, for example:
7863 class D : ICloneable {
7864 object ICloneable.Clone () {
7868 Would produce a method called `ICloneable.Clone' instead of
7869 `System.ICloneable.Clone'.
7871 * namespace.cs (Alias.Resolve): Use GetPartialName.
7873 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7875 * cs-parser.jay: Add error 1055 report.
7877 2004-11-01 Miguel de Icaza <miguel@ximian.com>
7879 * assign.cs (Assign.DoResolve): Only do the transform of
7880 assignment into a New if the types are compatible, if not, fall
7881 through and let the implicit code deal with the errors and with
7882 the necessary conversions.
7884 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7886 * cs-parser.jay: Add error 1031 report.
7888 * cs-tokenizer.cs: Add location for error 1038.
7890 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7892 * cs-parser.jay: Add error 1016 report.
7894 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7896 * cs-parser.jay: Add errors 1575,1611 report.
7898 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7900 * cs-parser.jay: Add error 1001 report.
7902 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7905 * attribute.cs (GetMarshal): Add method argument for
7906 caller identification.
7908 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7909 agument for GetMarshal and RuntimeMissingSupport.
7911 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7913 * attribute.cs (ExtractSecurityPermissionSet): Removed
7914 TypeManager.code_access_permission_type.
7916 * typemanager.cs: Removed TypeManager.code_access_permission_type.
7918 2004-10-27 Miguel de Icaza <miguel@ximian.com>
7920 * expression.cs (LocalVariableReference.DoResolveLValue): Check
7921 for obsolete use of a variable here. Fixes regression on errors
7922 cs0619-25 and cs0619-26.
7924 2004-10-27 Marek Safar <marek.safar@seznam.cz>
7926 Fix #62358, implemented security attribute encoding.
7928 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7929 Tests permitted SecurityAction for assembly or other types.
7930 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7931 data from SecurityPermissionAttribute to PermisionSet class.
7933 * class.cs (ApplyAttributeBuilder): Added special handling
7934 for System.Security.Permissions.SecurityAttribute based types.
7936 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7937 special handling for System.Security.Permissions.SecurityAttribute
7940 * enum.cs (ApplyAttributeBuilder): Added special handling
7941 for System.Security.Permissions.SecurityAttribute based types.
7943 * parameter.cs (ApplyAttributeBuilder): Added special handling
7944 for System.Security.Permissions.SecurityAttribute based types.
7946 * rootcontext.cs: Next 2 core types.
7948 * typemanager.cs (TypeManager.security_permission_attr_type):
7949 Built in type for the SecurityPermission Attribute.
7950 (code_access_permission_type): Build in type.
7952 2004-10-17 Miguel de Icaza <miguel@ximian.com>
7954 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7955 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7956 all of this information into
7957 EmitContext.EmitCapturedVariableInstance.
7959 * codegen.cs (EmitCapturedVariableInstance): move here the
7960 funcionality of emitting an ldarg.0 in the presence of a
7961 remapping. This centralizes the instance emit code.
7963 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7964 then emit a load of this: it means that we have reached the
7965 topmost ScopeInfo: the one that contains the pointer to the
7966 instance of the class hosting the anonymous method.
7968 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7969 captures to the topmost CaptureContext.
7971 2004-10-12 Miguel de Icaza <miguel@ximian.com>
7973 * expression.cs (LocalVariableReference): Move the knowledge about
7974 the iterators into codegen's EmitCapturedVariableInstance.
7976 2004-10-11 Miguel de Icaza <miguel@ximian.com>
7978 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7979 all code paths return a value from an anonymous method (it is the
7980 same as the 161 error, but for anonymous methods).
7982 2004-10-08 Miguel de Icaza <miguel@ximian.com>
7984 The introduction of anonymous methods in the compiler changed
7985 various ways of doing things in the compiler. The most
7986 significant one is the hard split between the resolution phase
7987 and the emission phases of the compiler.
7989 For instance, routines that referenced local variables no
7990 longer can safely create temporary variables during the
7991 resolution phase: they must do so from the emission phase,
7992 since the variable might have been "captured", hence access to
7993 it can not be done with the local-variable operations from the runtime.
7997 (Block.Flags): New flag `IsTopLevel' to indicate that this block
7998 is a toplevel block.
8000 (ToplevelBlock): A new kind of Block, these are the blocks that
8001 are created by the parser for all toplevel method bodies. These
8002 include methods, accessors and anonymous methods.
8004 These contain some extra information not found in regular blocks:
8005 A pointer to an optional CaptureContext (for tracking captured
8006 local variables and parameters). A pointer to the parent
8009 (Return.Resolve): Catch missmatches when returning a value from an
8010 anonymous method (error 1662).
8011 Invoke NeedReturnLabel from the Resolve phase instead of the emit
8014 (Break.Resolve): ditto.
8016 (SwitchLabel): instead of defining the labels during the
8017 resolution phase, we now turned the public ILLabel and ILLabelCode
8018 labels into methods called GetILLabelCode() and GetILLabel() that
8019 only define the label during the Emit phase.
8021 (GotoCase): Track the SwitchLabel instead of the computed label
8022 (its contained therein). Emit the code by using
8023 SwitchLabel.GetILLabelCode ().
8025 (LocalInfo.Flags.Captured): A new flag has been introduce to track
8026 whether the Local has been captured or not.
8028 (LocalInfo.IsCaptured): New property, used to tell whether the
8029 local has been captured.
8031 * anonymous.cs: Vastly updated to contain the anonymous method
8034 The main classes here are: CaptureContext which tracks any
8035 captured information for a toplevel block and ScopeInfo used to
8036 track the activation frames for various local variables.
8038 Each toplevel block has an optional capture context associated
8039 with it. When a method contains an anonymous method both the
8040 toplevel method and the anonymous method will create a capture
8041 context. When variables or parameters are captured, they are
8042 recorded on the CaptureContext that owns them, for example:
8046 MyDelegate d = delegate {
8051 Here `a' will be recorded as captured on the toplevel
8052 CapturedContext, the inner captured context will not have anything
8053 (it will only have data if local variables or parameters from it
8054 are captured in a nested anonymous method.
8056 The ScopeInfo is used to track the activation frames for local
8057 variables, for example:
8059 for (int i = 0; i < 10; i++)
8060 for (int j = 0; j < 10; j++){
8061 MyDelegate d = delegate {
8066 At runtime this captures a single captured variable `i', but it
8067 captures 10 different versions of the variable `j'. The variable
8068 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8069 recorded on a child.
8071 The toplevel ScopeInfo will also track information like the `this'
8072 pointer if instance variables were referenced (this is necessary
8073 as the anonymous method lives inside a nested class in the host
8074 type of the method).
8076 (AnonymousMethod): Expanded to track the Toplevel, implement
8077 `AnonymousMethod.Compatible' to tell whether an anonymous method
8078 can be converted to a target delegate type.
8080 The routine now also produces the anonymous method content
8082 (AnonymousDelegate): A helper class that derives from
8083 DelegateCreation, this is used to generate the code necessary to
8084 produce the delegate for the anonymous method that was created.
8086 * assign.cs: API adjustments for new changes in
8087 Convert.ImplicitStandardConversionExists.
8089 * class.cs: Adjustments to cope with the fact that now toplevel
8090 blocks are of type `ToplevelBlock'.
8092 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8093 insteda of standard blocks.
8095 Flag errors if params arguments are passed to anonymous methods.
8097 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8098 `CurrentAnonymousMethod' which points to the current Anonymous
8099 Method. The variable points to the AnonymousMethod class that
8100 holds the code being compiled. It is set in the new EmitContext
8101 created for the anonymous method.
8103 (EmitContext.Phase): Introduce a variable and an enumeration to
8104 assist in enforcing some rules about when and where we are allowed
8105 to invoke certain methods (EmitContext.NeedsReturnLabel is the
8106 only one that enfonces this right now).
8108 (EmitContext.HaveCaptureInfo): new helper method that returns
8109 whether we have a CapturedContext initialized.
8111 (EmitContext.CaptureVariable): New method used to register that a
8112 LocalInfo must be flagged for capturing.
8114 (EmitContext.CapturedParameter): New method used to register that a
8115 parameters must be flagged for capturing.
8117 (EmitContext.CapturedField): New method used to register that a
8118 field must be flagged for capturing.
8120 (EmitContext.HaveCapturedVariables,
8121 EmitContext.HaveCapturedFields): Return whether there are captured
8122 variables or fields.
8124 (EmitContext.EmitMethodHostInstance): This is used to emit the
8125 instance for the anonymous method. The instance might be null
8126 (static methods), this (for anonymous methods that capture nothing
8127 and happen to live side-by-side with the current method body) or a
8128 more complicated expression if the method has a CaptureContext.
8130 (EmitContext.EmitTopBlock): Routine that drives the emission of
8131 code: it will first resolve the top block, then emit any metadata
8132 and then emit the code. The split is done so that we can extract
8133 any anonymous methods and flag any captured variables/parameters.
8135 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8136 during this phase, the ILGenerator should not be used as labels
8137 and local variables declared here might not be accessible to any
8138 code that is part of an anonymous method.
8140 Exceptions to this include the temporary variables that are
8141 created by some statements internally for holding temporary
8144 (EmitContext.EmitMeta): New routine, in charge of emitting all the
8147 (EmitContext.TemporaryReturn): This method is typically called
8148 from the Emit phase, and its the only place where we allow the
8149 ReturnLabel to be defined other than the EmitMeta. The reason is
8150 that otherwise we would have to duplicate a lot of logic in the
8151 Resolve phases of various methods that today is on the Emit
8154 (EmitContext.NeedReturnLabel): This no longer creates the label,
8155 as the ILGenerator is not valid during the resolve phase.
8157 (EmitContext.EmitThis): Extended the knowledge in this class to
8158 work in anonymous methods in addition to iterators.
8160 (EmitContext.EmitCapturedVariableInstance): This emits whatever
8161 code is necessary on the stack to access the instance to a local
8162 variable (the variable will be accessed as a field).
8164 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8165 EmitContext.EmitAddressOfParameter): Routines to support
8166 parameters (not completed at this point).
8168 Removals: Removed RemapLocal and RemapLocalLValue. We probably
8169 will also remove the parameters.
8171 * convert.cs (Convert): Define a `ConstantEC' which points to a
8172 null. This is just to prefity some code that uses
8173 ImplicitStandardConversion code and do not have an EmitContext
8176 The idea is to flag explicitly that at that point in time, it is
8177 known that the conversion will not trigger the delegate checking
8178 code in implicit conversions (which requires a valid
8181 Everywhere: pass new EmitContext parameter since
8182 ImplicitStandardConversionExists now requires it to check for
8183 anonymous method conversions.
8185 (Convert.ImplicitStandardConversionExists): If the type of an
8186 expression is the anonymous_method_type, and the type is a
8187 delegate, we invoke the AnonymousMethod.Compatible method to check
8188 whether an implicit conversion is possible.
8190 (Convert.ImplicitConversionStandard): Only do implicit method
8191 group conversions if the language level is not ISO_1.
8193 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8194 MethodInfo for the Invoke method. used by Delegate and
8197 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8198 method conversions if the target type is a delegate.
8200 Removed extra debugging nops.
8202 (LocalVariableReference): Turn the `local_info' into a public
8205 Add `prepared' field, the same hack used for FieldExprs to cope
8206 with composed assignments, as Local variables do not necessarily
8207 operate purely on the stack as they used to: they can be captured
8210 Add `temp' for a temporary result, like fields.
8212 Refactor DoResolve and DoResolveLValue into DoResolveBase.
8214 It now copes with Local variables that are captured and emits the
8215 proper instance variable to load it from a field in the captured
8218 (ParameterReference.DoResolveBase): During the resolve phase,
8219 capture parameters if we are in an anonymous method.
8221 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8222 anonymous method, use the EmitContext helper routines to emit the
8223 parameter reference.
8225 * iterators.cs: Set RemapToProxy to true/false during the
8228 * parameters.cs (GetParameterByName): New helper method.
8230 * typemanager.cs (anonymous_method_type) a new type that
8231 represents an anonyous method. This is always an internal type,
8232 used as a fencepost to test against the anonymous-methodness of an
8235 2004-10-20 Marek Safar <marek.safar@seznam.cz>
8237 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8239 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8241 2004-10-18 Martin Baulig <martin@ximian.com>
8243 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8244 `Type' directly, but call ResolveType() on it.
8245 (Catch.Resolve): Likewise.
8246 (Foreach.Resolve): Likewise.
8248 2004-10-18 Martin Baulig <martin@ximian.com>
8250 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8251 `Type' directly, but call ResolveType() on it.
8252 (Probe.DoResolve): Likewise.
8253 (ArrayCreation.LookupType): Likewise.
8254 (TypeOf.DoResolve): Likewise.
8255 (SizeOf.DoResolve): Likewise.
8257 2004-10-18 Martin Baulig <martin@ximian.com>
8259 * expression.cs (Invocation.BetterFunction): Put back
8260 TypeManager.TypeToCoreType().
8262 2004-10-18 Raja R Harinath <rharinath@novell.com>
8264 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8267 2004-10-18 Martin Baulig <martin@ximian.com>
8269 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
8270 `Type' directly, but call ResolveType() on it.
8272 2004-10-18 Martin Baulig <martin@ximian.com>
8274 * class.cs (FieldMember.Define): Don't access the TypeExpr's
8275 `Type' directly, but call ResolveType() on it.
8276 (MemberBase.DoDefine): Likewise.
8278 * expression.cs (New.DoResolve): Don't access the TypeExpr's
8279 `Type' directly, but call ResolveType() on it.
8280 (ComposedCast.DoResolveAsTypeStep): Likewise.
8282 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8283 `Type' directly, but call ResolveType() on it.
8285 2004-10-17 John Luke <john.luke@gmail.com>
8287 * class.cs (Operator.GetSignatureForError): use CSharpName
8289 * parameter.cs (Parameter.GetSignatureForError): Returns
8290 correct name even if was not defined.
8292 2004-10-13 Raja R Harinath <rharinath@novell.com>
8295 * class.cs (TypeContainer.EmitContext): New property.
8296 (DefineNestedTypes): Create an emitcontext for each part.
8297 (MethodCore.DoDefineParameters): Use container's emitcontext.
8298 Pass type array to InternalParameters.
8299 (MemberBase.DoDefine): Use container's emitcontext.
8300 (FieldMember.Define): Likewise.
8301 (Event.Define): Likewise.
8302 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8303 Pass type array to InternalParameters.
8304 (SetIndexerMethod.GetParameterInfo): Likewise.
8305 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8306 * delegate.cs (Define): Pass emitcontext to
8307 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8308 array to InternalParameters.
8309 * expression.cs (ParameterReference.DoResolveBase): Pass
8310 emitcontext to GetParameterInfo.
8311 (ComposedCast.DoResolveAsTypeStep): Remove check on
8312 ec.ResolvingTypeTree.
8313 * parameter.cs (Parameter.Resolve): Change argument to
8314 EmitContext. Use ResolveAsTypeTerminal.
8315 (Parameter.GetSignature): Change argument to EmitContext.
8316 (Parameters.ComputeSignature): Likewise.
8317 (Parameters.ComputeParameterTypes): Likewise.
8318 (Parameters.GetParameterInfo): Likewise.
8319 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8320 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8321 * support.cs (InternalParameters..ctor): Remove variant that takes
8323 * typemanager.cs (system_intptr_expr): New.
8324 (InitExpressionTypes): Initialize it.
8326 2004-10-12 Chris Toshok <toshok@ximian.com>
8328 * cs-parser.jay: fix location for try_statement and catch_clause.
8330 2004-10-11 Martin Baulig <martin@ximian.com>
8332 * report.cs: Don't make --fatal abort on warnings, we have
8333 -warnaserror for that.
8335 2004-10-07 Raja R Harinath <rharinath@novell.com>
8337 More DeclSpace.ResolveType avoidance.
8338 * decl.cs (MemberCore.InUnsafe): New property.
8339 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
8340 with newly created EmitContext.
8341 (FieldMember.Define): Likewise.
8342 * delegate.cs (Delegate.Define): Likewise.
8343 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8344 only if normal name-lookup fails.
8345 (TypeExpr.DoResolve): Enable error-checking.
8346 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8347 (SizeOf.DoResolve): Likewise.
8348 (ComposedCast.DoResolveAsTypeStep): Likewise.
8349 (StackAlloc.DoResolve): Likewise.
8350 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8351 (Block.Unsafe): New property.
8352 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8353 (Unsafe): Set 'unsafe' flag of contained block.
8354 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8355 (Fixed.Resolve): Likewise.
8356 (Catch.Resolve): Likewise.
8357 (Using.ResolveLocalVariableDecls): Likewise.
8358 (Foreach.Resolve): Likewise.
8360 2004-10-05 John Luke <john.luke@gmail.com>
8362 * cs-parser.jay: add location to error CS0175
8364 2004-10-04 Miguel de Icaza <miguel@ximian.com>
8366 * ecore.cs (Expression.Constantity): Add support for turning null
8369 * const.cs (Const.Define): Allow constants to be reference types
8370 as long as the value is Null.
8372 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
8374 * namespace.cs (NamespaceEntry.Using): No matter which warning
8375 level is set, check if this namespace name has already been added.
8377 2004-10-03 Ben Maurer <bmaurer@ximian.com>
8379 * expression.cs: reftype [!=]= null should always use br[true,false].
8382 2004-10-03 Marek Safar <marek.safar@seznam.cz>
8385 * attribute.cs: Enum conversion moved to
8386 GetAttributeArgumentExpression to be applied to the all
8389 2004-10-01 Raja R Harinath <rharinath@novell.com>
8391 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8392 * class.c (TypeContainer.DefineType): Flag error if
8393 base types aren't accessible due to access permissions.
8394 * decl.cs (DeclSpace.ResolveType): Move logic to
8395 Expression.ResolveAsTypeTerminal.
8396 (DeclSpace.ResolveTypeExpr): Thin layer over
8397 Expression.ResolveAsTypeTerminal.
8398 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8399 Refactor code into NestedAccess. Use it.
8400 (DeclSpace.NestedAccess): New.
8401 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8402 argument to silence errors. Check access permissions.
8403 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8404 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8405 (Cast.DoResolve): Likewise.
8406 (New.DoResolve): Likewise.
8407 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8408 (TypeOf.DoResolve): Likewise.
8410 * expression.cs (Invocation.BetterConversion): Return the Type of
8411 the better conversion. Implement section 14.4.2.3 more faithfully.
8412 (Invocation.BetterFunction): Make boolean. Make correspondence to
8413 section 14.4.2.2 explicit.
8414 (Invocation.OverloadResolve): Update.
8415 (Invocation): Remove is_base field.
8416 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
8417 (Invocation.Emit): Likewise.
8419 2004-09-27 Raja R Harinath <rharinath@novell.com>
8421 * README: Update to changes.
8423 2004-09-24 Marek Safar <marek.safar@seznam.cz>
8425 * cs-parser.jay: Reverted 642 warning fix.
8427 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8430 * decl.cs (FindMemberWithSameName): Indexer can have more than
8433 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8435 * expression.cs (LocalVariableReference.DoResolveLValue):
8436 Do not report warning 219 for out values.
8437 (EmptyExpression.Null): New member to avoid extra allocations.
8439 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8441 * cs-parser.jay: Fix wrong warning 642 report.
8443 * cs-tokenizer.cs (CheckNextToken): New helper;
8444 Inspect next character if is same as expected.
8446 2004-09-23 Martin Baulig <martin@ximian.com>
8448 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8449 (Convert.ImplicitReferenceConversionExists): Likewise.
8451 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8453 * class.cs (Operator.Define): Add error 448 and 559 report.
8455 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8457 * class.cs (MemberBase.IsTypePermitted): New protected
8458 method for checking error CS0610.
8460 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8462 * class.cs (TypeContainer.HasExplicitLayout): New property
8463 Returns whether container has StructLayout attribute set Explicit.
8464 (FieldMember): New abstract class for consts and fields.
8465 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8466 (Field): Reuse FieldMember.
8468 * const.cs (Const): Reuse FieldMember.
8470 * rootcontext.cs: EmitConstants call moved to class.
8472 2004-09-22 Martin Baulig <martin@ximian.com>
8474 Thanks to Peter Sestoft for this bug report.
8476 * expression.cs (Conditional): If both the `trueExpr' and the
8477 `falseExpr' is a NullLiteral, return a NullLiteral.
8479 2004-09-22 Martin Baulig <martin@ximian.com>
8481 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8482 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8483 for the "get_Current" call.
8485 2004-09-22 Martin Baulig <martin@ximian.com>
8487 Marek and me just fixed one of our oldest bugs: #28562 :-)
8489 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8491 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8492 we're an EnumConstant, just return that.
8493 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8494 an EnumConstant. In this case, we need to use GetValueAsEnumType()
8495 to get the value which'll actually be written into the attribute.
8496 However, we have to use GetValue() to access the attribute's value
8499 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8501 * constant.cs (Constant.IsNegative): New abstract property
8504 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8505 (StackAlloc.DoResolve): Reused IsNegative.
8507 2004-09-21 Martin Baulig <martin@ximian.com>
8509 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
8510 if we're used in an iterator, we may be called from different
8513 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
8514 we actually have an exception block.
8516 2004-09-20 John Luke <jluke@cfl.rr.com>
8518 * class.cs, cs-parser.jay: Improve the error report for 1520:
8519 report the actual line where the error happens, not where the
8522 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
8523 Pass location information that was available elsewhere.
8525 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
8527 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
8528 runtime to delay sign assemblies.
8530 2004-09-19 Miguel de Icaza <miguel@ximian.com>
8532 * cs-parser.jay: Do not report the stack trace, this is barely
8535 2004-08-22 John Luke <john.luke@gmail.com>
8537 * driver.cs : check that a resource id is not already used
8538 before adding it, report CS1508 if it is, bug #63637
8540 2004-09-19 Miguel de Icaza <miguel@ximian.com>
8542 * ecore.cs: Removed dead code.
8544 2004-09-18 Marek Safar <marek.safar@seznam.cz>
8546 * class.cs: Do not report warning CS0067 on the interfaces.
8548 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8550 * cs-parser.jay: Add error 504 report.
8552 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8554 * rootcontext.cs: WarningLevel is 4 by default now.
8556 * statement.cs (Fixed.Resolve): Do not null
8559 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8562 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
8563 deep search when property is not virtual.
8564 (PropertyExpr.ResolveAccessors): Make one call for both
8567 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8570 * statement.cs: Error 152 report constains also location.
8572 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8575 * const.cs: Explicitly set constant as static.
8577 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8580 * cs-parser.jay: Add error 1017 report.
8582 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8584 Fixed bug #59980, #64224
8585 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
8587 * typemanager.cs (IsSpecialMethod): Simplified
8589 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8591 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
8592 condition with better params.
8594 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8597 * attribute.cs (Resolve): Property has to have both
8600 2004-09-14 Martin Baulig <martin@ximian.com>
8602 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8604 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8607 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8608 called and is obsolete then this member suppress message
8609 when call is inside next [Obsolete] method or type.
8611 * expression.cs: Use TestObsoleteMethodUsage member.
8613 2004-09-14 Martin Baulig <martin@ximian.com>
8615 * cs-parser.jay: Sync a bit with the GMCS version.
8617 2004-09-14 Martin Baulig <martin@ximian.com>
8619 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
8620 (CSharpParser.yacc_verbose_flag): New public field.
8622 * genericparser.cs: Removed.
8624 2004-09-14 Raja R Harinath <rharinath@novell.com>
8626 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
8628 2004-09-13 Marek Safar <marek.safar@seznam.cz>
8630 * class.cs (MethodCore.CheckBase): Fix bug #65757.
8632 2004-09-10 Martin Baulig <martin@ximian.com>
8634 Backported my MemberName changes from GMCS into MCS.
8636 - we are now using a special `MemberName' class instead of using
8637 strings; in GMCS, the `MemberName' also contains the type
8640 - changed the grammar rules a bit:
8641 * the old `member_name' is now a `namespace_or_type_name':
8642 The rule is that we use `namespace_or_type_name' everywhere
8643 where we expect either a "member name" (GetEnumerator) or a
8644 "member name" with an explicit interface name
8645 (IEnumerable.GetEnumerator).
8646 In GMCS, the explicit interface name may include type arguments
8647 (IEnumerable<T>.GetEnumerator).
8648 * we use `member_name' instead of just `IDENTIFIER' for
8650 The rule is that we use `member_name' wherever a member may
8651 have type parameters in GMCS.
8653 * decl.cs (MemberName): New public class.
8654 (MemberCore.MemberName): New public readonly field.
8655 (MemberCore.ctor): Take a `MemberName' argument, not a string.
8656 (DeclSpace): Likewise.
8658 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
8659 * enum.cs (Enum.ctor): Likewise.
8661 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
8663 (AliasEntry.ctor): Take a MemberName, not an Expression.
8664 (AliasEntry.UsingAlias): Likewise.
8666 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
8667 (IMethodData.MemberName): Changed type from string to MemberName.
8668 (MemberBase.ExplicitInterfaceName): Likewise.
8669 (AbstractPropertyEventMethod.SetupName): Make this private.
8670 (AbstractPropertyEventMethod.ctor): Added `string prefix'
8671 argument; compute the member name here.
8672 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
8673 on the `member.MemberName' and the `prefix'.
8675 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
8677 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
8678 thus, we get a `MemberName' instead of a `string'. These
8679 declarations may have type parameters in GMCS.
8680 (interface_method_declaration, delegate_declaration): Likewise.
8681 (class_declaration, interface_declaration): Likewise.
8682 (method_header): Use `namespace_or_type_name' instead of
8683 `member_name'. We may be an explicit interface implementation.
8684 (property_declaration, event_declaration): Likewise.
8685 (member_name): This is now just an `IDENTIFIER', not a
8686 `namespace_or_type_name'.
8687 (type_name, interface_type): Removed.
8688 (namespace_or_type_name): Return a MemberName, not an Expression.
8689 (primary_expression): Use `member_name' instead of `IDENTIFIER';
8690 call GetTypeExpression() on the MemberName to get an expression.
8691 (IndexerDeclaration.interface_type): Changed type from string to
8693 (MakeName): Operate on MemberName's instead of string's.
8695 2004-09-13 Raja R Harinath <rharinath@novell.com>
8698 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
8699 (NamespaceEntry.Lookup): Add new argument to flag if we want the
8700 lookup to avoid symbols introduced by 'using'.
8701 * rootcontext.cs (NamespaceLookup): Update.
8703 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8705 * class.cs (TypeContainer.DoDefineMembers): Do not call
8706 DefineDefaultConstructor for static classes.
8708 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8710 * attribute.cs (Attribute.Resolve): Add error 653 report.
8712 * class.cs (Class.ApplyAttributeBuilder): Add error 641
8714 (Method.ApplyAttributeBuilder): Add error 685 report.
8715 (Operator.Define): Add error 564 report.
8717 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8719 * expression.cs (Invocation.DoResolve): Add error
8722 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8725 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8727 * class.cs (ConstructorInitializer.Resolve):
8728 Wrong error number (515->516).
8730 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8732 * class.cs (Indexer.Define): Add error 631 report.
8734 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8736 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8738 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8740 * expression.cs (Probe.DoResolve): Add error CS0241 report.
8742 2004-09-10 Marek Safar <marek.safar@seznam.cz>
8744 * cs-parser.jay: Added error CS0241 report.
8746 2004-09-10 Raja R Harinath <rharinath@novell.com>
8748 * cs-parser.jay (fixed_statement): Introduce a scope for the
8749 declaration in the 'fixed' statement.
8751 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8753 * cs-parser.jay: Added CS0230 error report.
8755 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8757 * cs-parser.jay: Added errors CS0231 and CS0257 report.
8759 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8761 * expression.cs (Argument.Resolve): Added error CS0192 and
8764 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8766 C# 2.0 #pragma warning feature
8768 * cs-tokenizer.cs (PreProcessPragma): New method;
8769 Handles #pragma directive.
8771 * report.cs (WarningRegions): New class; Support
8772 class for #pragma warning directive. It tests whether
8773 warning is enabled for a given line.
8775 2004-09-08 Miguel de Icaza <miguel@ximian.com>
8777 * const.cs: Add more descriptive error report, tahnks to
8780 2004-09-08 Marek Safar <marek.safar@seznam.cz>
8782 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8784 2004-09-07 Miguel de Icaza <miguel@ximian.com>
8786 * expression.cs: Apply patch from Ben: Remove dead code from
8787 ArrayCreation, and remove the TurnintoConstant call in const.cs,
8788 as that code just threw an exception anwyays.
8790 * const.cs: Remove the call to the turnintoconstant, for details
8793 * literal.cs: The type of the null-literal is the null type; So
8794 we use a placeholder type (literal.cs:System.Null, defined here)
8797 * expression.cs (Conditional.DoResolve): Remove some old code that
8798 is no longer needed, conversions have been fixed.
8800 (ArrayCreationExpression.DoResolve): Return false if we fail to
8801 resolve the inner expression.
8803 2004-09-07 Raja R Harinath <rharinath@novell.com>
8806 * cs-parser.jay (delegate_declaration): Record a delegate
8807 declaration as a type declaration.
8808 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8810 2004-09-06 Miguel de Icaza <miguel@ximian.com>
8812 * parameter.cs: Do not crash if the type can not be resolved.
8814 * expression.cs: Report errors with unsafe pointers, fixes #64896
8816 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
8818 * expression.cs: Pointer arith always needs to do a conv.i
8819 if the operand is a long. fix 65320
8821 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8823 Fixed cs0619-37.cs, cs0619-38.cs
8825 * enum.cs (GetObsoleteAttribute): Removed.
8827 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8828 on Enum member is double staged. The first is tested member
8831 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8833 Fixed #56986, #63631, #65231
8835 * class.cs: (TypeContainer.AddToMemberContainer): New method,
8836 adds member to name container.
8837 (TypeContainer.AddToTypeContainer): New method, adds type to
8839 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8840 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8841 AddOperator): Simplified by reusing AddToMemberContainer.
8842 (TypeContainer.UserDefinedStaticConstructor): Changed to property
8844 (Method.CheckForDuplications): Fixed implementation to test all
8846 (MemberBase): Detection whether member is explicit interface
8847 implementation is now in constructor.
8848 (MemberBase.UpdateMemberName): Handles IndexerName.
8849 (Accessor): Changed to keep also location information.
8850 (AbstractPropertyEventMethod): Is derived from MemberCore.
8851 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8852 will be emited or not.
8853 (PropertyBase.AreAccessorsDuplicateImplementation):
8854 Tests whether accessors are not in collision with some method.
8855 (Operator): Is derived from MethodCore to simplify common
8858 * decl.cs (Flags.TestMethodDuplication): Test for duplication
8860 (DeclSpace.AddToContainer): Adds the member to defined_names
8861 table. It tests for duplications and enclosing name conflicts.
8863 * enum.cs (EnumMember): Clean up to reuse the base structures
8865 2004-09-03 Martin Baulig <martin@ximian.com>
8867 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8868 into TypeContainer, to make partial classes work again.
8870 2004-09-03 Martin Baulig <martin@ximian.com>
8872 * rootcontext.cs (RootContext.V2): Removed.
8874 2004-03-23 Martin Baulig <martin@ximian.com>
8876 * expression.cs (Invocation.OverloadResolve): Added `bool
8877 may_fail' argument and use it instead of the Location.IsNull() hack.
8879 2004-09-03 Martin Baulig <martin@ximian.com>
8881 Merged latest changes into gmcs. Please keep this comment in
8882 here, it makes it easier for me to see what changed in MCS since
8883 the last time I merged.
8885 2004-09-03 Raja R Harinath <rharinath@novell.com>
8888 * expression.cs (BetterConversion): Don't allow either conversion
8889 to be null. Remove redundant implicit conversion test when 'q ==
8890 null' -- when this function is invoked, we already know that the
8891 implicit conversion exists.
8892 (BetterFunction): Assume that 'best' is non-null. Remove
8893 redundant reimplementation of IsApplicable when 'best' is null.
8894 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8895 number of arguments.
8896 (IsAncestralType): Extract from OverloadResolve.
8897 (OverloadResolve): Make robust to the MethodGroupExpr being
8898 unsorted. Implement all the logic of Section 14.5.5.1, and
8899 support overloading of methods from multiple applicable types.
8900 Clean up logic somewhat. Don't pass null methods to BetterFunction.
8902 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8903 (RealError, Warning): Append type of report to related symbol.
8905 2004-09-03 Marek Safar <marek.safar@seznam.cz>
8907 * enum.cs: Fixed CLS-Compliance checks for enum members.
8908 Error tests cs3008-8.cs, cs3014-8.cs
8910 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8912 Fixed bug #62342, #63102
8913 * class.cs: ImplementIndexer uses member.IsExplicitImpl
8914 like ImplementMethod.
8916 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8918 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8921 2004-09-02 Martin Baulig <martin@ximian.com>
8923 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8924 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8927 2004-09-01 Marek Safar <marek.safar@seznam.cz>
8929 C# 2.0 Static classes implemented
8931 * class.cs (TypeContainer): instance_constructors,
8932 initialized_fields, initialized_static_fields,
8933 default_constructor, base_inteface_types are protected to be
8934 accessible from StaticClass.
8935 (TypeContainer.DefineDefaultConstructor): New virtual method
8936 for custom default constructor generating
8937 (StaticClass): New class to handle "Static classes" feature.
8939 * cs-parser.jay: Handle static keyword on class like instance
8942 * driver.cs: Added "/langversion" command line switch with two
8943 options (iso-1, default).
8945 2004-08-31 Marek Safar <marek.safar@seznam.cz>
8947 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8949 2004-08-31 Miguel de Icaza <miguel@ximian.com>
8951 * delegate.cs: Style.
8953 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
8955 * delegate.cs: Add seperate instance expr field for miguel.
8957 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8959 * PointerArithmetic (Resolve): make sure we are not doing
8960 pointer arith on void*. Also, make sure we are resolved
8961 by not setting eclass until resolve.
8963 All callers: Make sure that PointerArithmetic gets resolved.
8965 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8967 * ArrayCreation (LookupType): If the type does not resolve
8968 to an array, give an error.
8970 2004-08-27 Marek Safar <marek.safar@seznam.cz>
8972 * statement.cs (Try.Resolve): Fixed bug #64222
8974 2004-08-27 Martin Baulig <martin@ximian.com>
8977 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8980 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8982 * ecore.cs (Constantify): Get underlying type via
8983 System.Enum.GetUnderlyingType to avoid StackOverflow on the
8984 Windows in special cases.
8986 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8988 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8989 for obtaining also private methods.
8990 (GetRemoveMethod): Used GetRemoveMethod (true)
8991 for obtaining also private methods.
8993 2004-08-24 Martin Baulig <martin@ximian.com>
8995 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8996 MethodAttributes.HideBySig for operators.
8998 2004-08-23 Martin Baulig <martin@ximian.com>
9000 Back to the old error reporting system :-)
9002 * report.cs (Message): Removed.
9003 (Report.MessageData, ErrorData, WarningData): Removed.
9004 (Report.Error, Warning): Back to the old system.
9006 2004-08-23 Martin Baulig <martin@ximian.com>
9008 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9010 * class.cs (TypeContainer.ParentContainer): New public virtual
9011 method; replaces the explicit interface implementation.
9012 (ClassPart.ParentContainer): Override.
9014 2004-08-23 Martin Baulig <martin@ximian.com>
9016 * statement.cs (Switch): Added support for constant switches; see
9017 #59428 or test-285.cs.
9019 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9022 * statement.cs (GetEnumeratorFilter): Removed useless
9023 logic because C# specs is strict. GetEnumerator must be
9026 2004-08-22 Martin Baulig <martin@ximian.com>
9028 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9029 a switch and may break, reset the barrier. Fixes #59867.
9031 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9033 CLS-Compliance speed up (~5% for corlib)
9035 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9036 New method. Tests container for CLS-Compliant names
9038 * class.cs (TypeContainer.VerifyClsName): New method.
9039 Checks whether container name is CLS Compliant.
9040 (Constructor): Implements IMethodData.
9042 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9043 low-case table for CLS Compliance test.
9044 (MemberCache.VerifyClsParameterConflict): New method.
9045 Checks method parameters for CS3006 error.
9047 * enum.cs (EnumMember): Is derived from MemberCore.
9048 (Enum.VerifyClsName): Optimized for better performance.
9050 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9052 * report.cs: Renamed Error_T to Error and changed all
9055 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9057 * class.cs (TypeContainer.IndexerArrayList): New inner class
9058 container for indexers.
9059 (TypeContainer.DefaultIndexerName): New constant for default
9060 indexer name. Replaced all "Item" with this constant.
9061 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9063 * typemanager.cs (TypeManager.default_member_ctor): Cache here
9064 DefaultMemberAttribute constructor.
9066 2004-08-05 Martin Baulig <martin@ximian.com>
9068 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9071 2004-08-05 Marek Safar <marek.safar@seznam.cz>
9073 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9074 multi platforms problem.
9076 * compiler.csproj: Included shared files.
9078 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9080 Fix bug 60333, 55971 in the more general way
9081 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9082 Added arg_type argument for constant conversion.
9083 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9085 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9088 * class.cs (TypeContainer ): New inner classes MethodArrayList,
9089 OperatorArrayList, MethodCoreArrayList for typecontainer
9090 containers. Changed class member types to these new types.
9091 (MethodArrayList.DefineMembers): Added test for CS0659.
9093 2004-08-04 Miguel de Icaza <miguel@ximian.com>
9095 * cfold.cs: Synchronize the folding with the code in expression.cs
9096 Binary.DoNumericPromotions for uint operands.
9098 * attribute.cs: Revert patch from Raja, it introduced a regression
9099 while building Blam-1.2.1 (hard to isolate a test case).
9101 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9105 (TypeContainer.Define): Renamed to DefineContainerMembers because of
9107 (MethodCore.parent_method): New member. The method we're overriding
9108 if this is an override method.
9109 (MethodCore.CheckBase): Moved from Method class and made common.
9110 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9112 (MethodCore.CheckForDuplications): New abstract method. For custom
9113 member duplication search in a container
9114 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9115 method and its return type.
9116 (Event.conflict_symbol): New member. Symbol with same name in the
9120 (MemberCache.FindMemberWithSameName): New method. The method
9121 is looking for conflict with inherited symbols.
9123 2004-08-04 Martin Baulig <martin@ximian.com>
9125 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9127 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9129 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9131 * report.cs (Message): New enum for better error, warning reference in
9133 (MessageData): New inner abstract class. It generally handles printing of
9134 error and warning messages.
9135 Removed unused Error, Warning, Message methods.
9137 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9139 Fix for cs0592-8.cs test
9141 (Attributable.ValidAttributeTargets): Made public.
9142 (Attribute.ExplicitTarget): New member for explicit target value.
9143 (Attribute.CheckTargets): Now we translate explicit attribute
9144 target to Target here.
9146 2004-08-03 Ben Maurer <bmaurer@ximian.com>
9148 * ecore.cs (MethodGroupExpr): new IsBase property.
9150 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9152 * delegate.cs (DelegateCreation): store a MethodGroupExpr
9153 rather than an instance expr.
9155 (DelegateCreation.Emit): Use the method group rather than
9156 the instance expression. Also, if you have base.Foo as the
9157 method for a delegate, make sure to emit ldftn, not ldftnvirt.
9159 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
9161 (NewDelegate.DoResolve): Only check for the existance of Invoke
9162 if the method is going to be needed. Use MethodGroupExpr.
9164 (NewDelegate.Emit): Remove, DelegateCreation implements this.
9166 * expression.cs: For pointer arith., make sure to use
9167 the size of the type, not the size of the pointer to
9170 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9173 * class.cs (Class): Added error CS0502 test.
9175 2004-08-03 John Luke <jluke@cfl.rr.com>
9176 Raja R Harinath <rharinath@novell.com>
9179 * attribute.cs (Attribute.complained_before): New flag.
9180 (Attribute.ResolveType, Attribute.Resolve),
9181 (Attribute.DefinePInvokeMethod): Set it.
9182 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9184 2004-08-03 Martin Baulig <martin@ximian.com>
9186 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9187 use a user-defined operator; we still need to do numeric
9188 promotions in case one argument is a builtin type and the other
9189 one has an implicit conversion to that type. Fixes #62322.
9191 2004-08-02 Martin Baulig <martin@ximian.com>
9193 * statement.cs (LocalInfo.Flags): Added `IsThis'.
9194 (LocalInfo.IsThis): New public property.
9195 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9197 2004-08-01 Martin Baulig <martin@ximian.com>
9199 * class.cs (TypeContainer.GetClassBases): Don't set the default
9200 here since we may get called from GetPartialBases().
9201 (TypeContainer.DefineType): If GetClassBases() didn't return a
9202 parent, use the default one.
9204 2004-07-30 Duncan Mak <duncan@ximian.com>
9206 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
9208 2004-07-30 Martin Baulig <martin@ximian.com>
9210 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9212 * class.cs (SourceMethod): New public class, derive from the
9213 symbol writer's ISourceMethod.
9214 (Method): Use the new symbol writer API.
9216 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9217 as argument and use the new symbol writer.
9220 (SourceFile): Implement the symbol writer's ISourceFile.
9221 (Location.SymbolDocument): Removed.
9222 (Location.SourceFile): New public property.
9224 * symbolwriter.cs: Use the new symbol writer API.
9226 2004-07-30 Raja R Harinath <rharinath@novell.com>
9228 * Makefile (install-local): Remove. Functionality moved to
9231 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
9233 * Makefile: Install mcs.exe.config file together with mcs.exe.
9234 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9235 correct runtime version.
9237 2004-07-25 Martin Baulig <martin@ximian.com>
9240 (TypeContainer.RegisterOrder): Removed, this was unused.
9241 (TypeContainer, interface_order): Removed.
9242 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9243 TypeContainer as argument since we can also be called with a
9244 `PartialContainer' for a partial class/struct/interface.
9245 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9246 of checking whether we're an `Interface' - we could be a
9248 (PartialContainer.Register): Override; call
9249 AddClass()/AddStruct()/AddInterface() on our parent.
9251 * cs-parser.jay (interface_member_declaration): Add things to the
9252 `current_container', not the `current_class'.
9254 * rootcontext.cs (RegisterOrder): The overloaded version which
9255 takes an `Interface' was unused, removed.
9257 * typemanager.cs (TypeManager.LookupInterface): Return a
9258 `TypeContainer', not an `Interface'.
9259 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9260 contain a `PartialContainer' for an interface, so check it's
9261 `Kind' to figure out what it is.
9263 2004-07-25 Martin Baulig <martin@ximian.com>
9265 * class.cs (Class.DefaultTypeAttributes): New public constant.
9266 (Struct.DefaultTypeAttributes): Likewise.
9267 (Interface.DefaultTypeAttributes): Likewise.
9268 (PartialContainer.TypeAttr): Override this and add the
9269 DefaultTypeAttributes.
9271 2004-07-25 Martin Baulig <martin@ximian.com>
9273 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9274 we can just use the `Parent' field instead.
9276 2004-07-25 Martin Baulig <martin@ximian.com>
9278 * class.cs (TypeContainer.Emit): Renamed to EmitType().
9280 2004-07-25 Martin Baulig <martin@ximian.com>
9282 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9283 our parts before defining any methods.
9284 (TypeContainer.VerifyImplements): Make this virtual.
9285 (ClassPart.VerifyImplements): Override and call VerifyImplements()
9286 on our PartialContainer.
9288 2004-07-25 Martin Baulig <martin@ximian.com>
9290 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9292 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9293 argument, we can just use the `Parent' field instead.
9296 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
9297 (MemberBase.DoDefine): Likewise.
9299 2004-07-24 Martin Baulig <martin@ximian.com>
9301 * decl.cs (MemberCore.Parent): New public field.
9302 (DeclSpace.Parent): Moved to MemberCore.
9304 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9305 (MemberBase.ctor): Added TypeContainer argument, pass it to our
9307 (FieldBase, Field, Operator): Likewise.
9308 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9309 (EventField, Event): Likewise.
9311 2004-07-23 Martin Baulig <martin@ximian.com>
9313 * class.cs (PartialContainer): New public class.
9314 (ClassPart): New public class.
9315 (TypeContainer): Added support for partial classes.
9316 (TypeContainer.GetClassBases): Splitted some of the functionality
9317 out into GetNormalBases() and GetPartialBases().
9319 * cs-tokenizer.cs (Token.PARTIAL): New token.
9320 (Tokenizer.consume_identifier): Added some hacks to recognize
9321 `partial', but only if it's immediately followed by `class',
9322 `struct' or `interface'.
9324 * cs-parser.jay: Added support for partial clases.
9326 2004-07-23 Martin Baulig <martin@ximian.com>
9328 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9329 a `DeclSpace' and also made it readonly.
9330 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9331 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9332 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9334 * cs-parser.jay: Pass the `current_class', not the
9335 `current_container' (at the moment, this is still the same thing)
9336 to a new Method, Property, Event, Indexer or Constructor.
9338 2004-07-23 Martin Baulig <martin@ximian.com>
9340 * cs-parser.jay (CSharpParser): Added a new `current_class' field
9341 and removed the `current_interface' one.
9342 (struct_declaration, class_declaration, interface_declaration):
9343 Set `current_class' to the newly created class/struct/interface;
9344 set their `Bases' and call Register() before parsing their body.
9346 2004-07-23 Martin Baulig <martin@ximian.com>
9348 * class.cs (Kind): New public enum.
9349 (TypeContainer): Made this class abstract.
9350 (TypeContainer.Kind): New public readonly field.
9351 (TypeContainer.CheckDef): New public method; moved here from
9353 (TypeContainer.Register): New public abstract method.
9354 (TypeContainer.GetPendingImplementations): New public abstract
9356 (TypeContainer.GetClassBases): Removed the `is_class' and
9357 `is_iface' parameters.
9358 (TypeContainer.DefineNestedTypes): Formerly known as
9360 (ClassOrStruct): Made this class abstract.
9362 * tree.cs (RootTypes): New public type.
9364 2004-07-20 Martin Baulig <martin@ximian.com>
9366 * tree.cs (Tree.RecordNamespace): Removed.
9367 (Tree.Namespaces): Removed.
9369 * rootcontext.cs (RootContext.IsNamespace): Removed.
9371 * cs-parser.jay (namespace_declaration): Just create a new
9372 NamespaceEntry here.
9374 2004-07-20 Martin Baulig <martin@ximian.com>
9376 * statement.cs (ExceptionStatement): New abstract class. This is
9377 now used as a base class for everyone who's using `finally'.
9378 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
9379 our local variables before using them.
9381 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
9382 virtual method. This is used by Yield.Resolve() to "steal" an
9383 outer block's `finally' clauses.
9384 (FlowBranchingException): The .ctor now takes an ExceptionStatement
9387 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
9388 version which takes an ExceptionStatement. This version must be
9389 used to create exception branchings.
9392 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
9393 (Iterator.EmitMoveNext): Added exception support; protect the
9394 block with a `fault' clause, properly handle 'finally' clauses.
9395 (Iterator.EmitDispose): Run all the `finally' clauses here.
9397 2004-07-20 Martin Baulig <martin@ximian.com>
9399 * iterator.cs: This is the first of a set of changes in the
9400 iterator code. Match the spec more closely: if we're an
9401 IEnumerable, then GetEnumerator() must be called. The first time
9402 GetEnumerator() is called, it returns the current instance; all
9403 subsequent invocations (if any) must create a copy.
9405 2004-07-19 Miguel de Icaza <miguel@ximian.com>
9407 * expression.cs: Resolve the constant expression before returning
9410 2004-07-19 Martin Baulig <martin@ximian.com>
9412 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
9413 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
9414 the return type of the new EmitContext.
9416 2004-07-18 Martin Baulig <martin@ximian.com>
9418 * class.cs (Property.Define): Fix iterators.
9420 * iterators.cs (Iterator.Define): Moved the
9421 `container.AddInterator (this)' call here from the .ctor; only do
9422 it if we resolved successfully.
9424 2004-07-17 Miguel de Icaza <miguel@ximian.com>
9426 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
9427 `true' for preprocessing directives that we parse. The return
9428 value indicates whether we should return to regular tokenizing or
9429 not, not whether it was parsed successfully.
9431 In the past if we were in: #if false ... #line #endif, we would
9432 resume parsing after `#line'. See bug 61604.
9434 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
9435 building: IsEnumType should return true only for enums, not for
9436 enums or System.Enum itself. This fixes #61593.
9438 Likely what happened is that corlib was wrong: mcs depended on
9439 this bug in some places. The bug got fixed, we had to add the
9440 hack, which caused bug 61593.
9442 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
9443 that was a workaround for the older conditions.
9445 2004-07-16 Ben Maurer <bmaurer@ximian.com>
9447 * assign.cs: IAssignMethod has a new interface, as documented
9448 inline. All assignment code now uses this new api.
9450 * ecore.cs, expression.cs: All classes which implement
9451 IAssignMethod now use the new interface.
9453 * expression.cs (Invocation): add a hack to EmitCall so that
9454 IndexerAccess can be the target of a compound assignment without
9455 evaluating its arguments twice.
9457 * statement.cs: Handle changes in Invocation api.
9459 2004-07-16 Martin Baulig <martin@ximian.com>
9461 * iterators.cs: Rewrote this. We're now using one single Proxy
9462 class for both the IEnumerable and the IEnumerator interface and
9463 `Iterator' derives from Class so we can use the high-level API.
9465 * class.cs (TypeContainer.AddIterator): New method.
9466 (TypeContainer.DoDefineType): New protected virtual method, which
9467 is called from DefineType().
9468 (TypeContainer.DoDefineMembers): Call DefineType() and
9469 DefineMembers() on all our iterators.
9470 (TypeContainer.Emit): Call Emit() on all our iterators.
9471 (TypeContainer.CloseType): Call CloseType() on all our iterators.
9473 * codegen.cs (EmitContext.CurrentIterator): New public field.
9475 2004-07-15 Martin Baulig <martin@ximian.com>
9478 (TypeManager.not_supported_exception_type): New type.
9480 2004-07-14 Martin Baulig <martin@ximian.com>
9482 * iterators.cs: Use real error numbers.
9484 2004-07-14 Martin Baulig <martin@ximian.com>
9486 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9487 requires this to be a System.Collection.IEnumerable and not a
9488 class implementing that interface.
9489 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
9491 2004-07-13 Marek Safar <marek.safar@seznam.cz>
9493 * class.cs: Fixed previous fix, it broke some error tests.
9495 2004-07-12 Martin Baulig <martin@ximian.com>
9497 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9500 2004-07-09 Miguel de Icaza <miguel@ximian.com>
9502 * assign.cs (LocalTemporary): Add new argument: is_address,If
9503 `is_address' is true, then the value that we store is the address
9504 to the real value, and not the value itself.
9506 * ecore.cs (PropertyExpr): use the new local temporary
9507 stuff to allow us to handle X.Y += z (where X is a struct)
9509 2004-07-08 Martin Baulig <martin@ximian.com>
9511 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9512 not always return, just like we're doing in Using.Resolve().
9514 2004-07-07 Miguel de Icaza <miguel@ximian.com>
9516 * cs-parser.jay (fixed_statement): flag this as Pinned.
9518 2004-07-06 Miguel de Icaza <miguel@ximian.com>
9520 * typemanager.cs (TypeManager): Removed MakePinned method, this
9521 mechanism is replaced with the .NET 2.x compatible mechanism of
9522 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9524 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
9525 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9526 `IsFixed' property which has a different meaning.
9528 2004-07-02 Raja R Harinath <rharinath@novell.com>
9530 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9531 visible from inside a nested class, not just the names of the
9532 immediately enclosing class.
9535 2004-06-24 Raja R Harinath <rharinath@novell.com>
9537 * expression.cs (BetterConversion): Remove buggy special-case
9538 handling of "implicit constant expression conversions". At this
9539 point, we already know that the conversion is possible -- we're
9540 only checking to see which is better.
9542 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9544 * cs-parser.jay: Added error CS0210 test.
9546 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9548 * cs-parser.jay: Added error CS0134 test.
9550 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9553 * cs-parser.jay: Added error CS0145 test.
9555 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9557 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9559 2004-06-23 Ben Maurer <bmaurer@ximian.com>
9561 * expression.cs (StackAlloc.Resolve): The argument may not
9562 be a constant; deal with this case.
9564 2004-06-23 Marek Safar <marek.safar@seznam.cz>
9566 * attribute.cs (IndexerName_GetIndexerName): Renamed to
9567 GetIndexerAttributeValue.
9568 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9570 * class.cs (Indexer.Define): Added error tests for CS0415,
9573 2004-06-23 Miguel de Icaza <miguel@ximian.com>
9575 * attribute.cs (Attribute.Resolve): Keep field code in sync with
9578 2004-06-23 Martin Baulig <martin@ximian.com>
9580 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9581 neither return nor throw, reset the barrier as well. Fixes #60457.
9583 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
9585 * class.cs : EventAttributes is now set to None by default.
9586 This fixes bug #60459.
9588 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9591 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9592 Don't throw exception but return null (it's sufficient now).
9594 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9596 * typemanager.cs (GetArgumentTypes): Faster implementation.
9598 2004-06-18 Martin Baulig <martin@ximian.com>
9600 * attribute.cs (Attribute.Resolve): Check whether we're an
9601 EmptyCast which a Constant child. Fixes #60333.
9603 2004-06-17 Ben Maurer <bmaurer@ximian.com>
9605 * statement.cs (EmitCollectionForeach): Account for the fact that
9606 not all valuetypes are in areas which we can take the address of.
9607 For these variables, we store to a temporary variable. Also, make
9608 sure that we dont emit a `callvirt' on a valuetype method.
9610 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9612 * expression.cs (StackAlloc.DoReSolve): Added test for
9613 negative parameter (CS0247).
9615 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9618 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9620 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9623 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9626 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9628 Fix bug #58254 & cs1555.cs, cs1556.cs
9629 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9631 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9633 * cs-parser.jay: Added error CS1669 test for indexers.
9635 2004-06-11 Martin Baulig <martin@ximian.com>
9637 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9638 call this twice: for params and varargs methods.
9640 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9643 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9645 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9647 * attribute.cs (Attribute.GetValidTargets): Made public.
9650 (AbstractPropertyEventMethod): New class for better code sharing.
9651 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9653 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9655 2004-06-11 Raja R Harinath <rharinath@novell.com>
9658 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
9659 that the call to Resolve is part of a MemberAccess.
9660 (Expression.Resolve): Use it for SimpleName resolution.
9661 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
9662 Add 'intermediate' boolean argument.
9663 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
9664 error message when the SimpleName can be resolved ambiguously
9665 between an expression and a type.
9666 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
9668 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
9669 call on the left-side.
9671 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9674 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
9676 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9678 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
9680 2004-06-11 Martin Baulig <martin@ximian.com>
9682 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
9683 varargs methods if applicable.
9685 2004-06-11 Martin Baulig <martin@ximian.com>
9687 * expression.cs (Invocation.EmitCall): Don't use
9688 `method.CallingConvention == CallingConventions.VarArgs' since the
9689 method could also have `CallingConventions.HasThis'.
9691 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9693 * class.cs (Event.GetSignatureForError): Implemented.
9694 Fixed crash in error test cs3010.cs
9696 2004-06-10 Miguel de Icaza <miguel@ximian.com>
9698 * cs-tokenizer.cs: Change the way we track __arglist to be
9699 consistent with the other keywords.
9701 2004-06-09 Miguel de Icaza <miguel@ximian.com>
9703 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
9706 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
9708 * codegen.cs: Check that all referenced assemblies have a strongname
9709 before strongnaming the compiled assembly. If not report error CS1577.
9710 Fix bug #56563. Patch by Jackson Harper.
9711 * typemanager.cs: Added a method to return all referenced assemblies.
9712 Fix bug #56563. Patch by Jackson Harper.
9714 2004-06-08 Marek Safar <marek.safar@seznam.cz>
9717 (Method.ApplyAttributeBuilder): Moved and added conditional
9718 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
9721 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
9723 2004-06-08 Marek Safar <marek.safar@seznam.cz>
9726 * class.cs: (EventField.attribute_targets): Changed default target.
9728 2004-06-08 Martin Baulig <martin@ximian.com>
9730 * expression.cs (Invocation.EmitCall): Enable varargs methods.
9732 2004-06-08 Martin Baulig <martin@ximian.com>
9734 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
9736 2004-06-07 Martin Baulig <martin@ximian.com>
9738 Added support for varargs methods.
9740 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
9743 * cs-parser.jay: Added support for `__arglist'.
9745 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
9747 * expression.cs (Argument.AType): Added `ArgList'.
9748 (Invocation): Added support for varargs methods.
9749 (ArglistAccess): New public class.
9750 (Arglist): New public class.
9752 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
9754 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
9755 a method's top-level block if the method has varargs.
9757 * support.cs (ReflectionParameters, InternalParameters): Added
9758 support for varargs methods.
9760 2004-06-07 Miguel de Icaza <miguel@ximian.com>
9762 * class.cs: Provide location in indexer error report.
9764 * driver.cs: Use standard names.
9766 * namespace.cs: Catch the use of using after a namespace has been
9767 declared also on using aliases.
9769 2004-06-03 Raja R Harinath <rharinath@novell.com>
9772 * typemanager.cs (closure_private_ok, closure_invocation_type)
9773 (closure_qualifier_type, closure_invocation_assembly)
9774 (FilterWithClosure): Move to ...
9775 (Closure): New internal nested class.
9776 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
9777 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
9778 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
9779 (MemberLookup, MemberLookupFailed): Use it.
9780 * expression.cs (New.DoResolve): Treat the lookup for the
9781 constructor as being qualified by the 'new'ed type.
9782 (Indexers.GetIndexersForTypeOrInterface): Update.
9784 2004-06-03 Marek Safar <marek.safar@seznam.cz>
9787 (GetConditionalAttributeValue): New method. Returns
9788 condition of ConditionalAttribute.
9789 (SearchMulti): New method. Returns all attributes of type 't'.
9790 Use it when attribute is AllowMultiple = true.
9791 (IsConditionalMethodExcluded): New method.
9794 (Method.IsExcluded): Implemented. Returns true if method has conditional
9795 attribute and the conditions is not defined (method is excluded).
9796 (IMethodData): Extended interface for ConditionalAttribute support.
9797 (PropertyMethod.IsExcluded): Implemented.
9800 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
9803 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
9806 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
9808 * expression.cs (ArrayCreationExpression): Make this just an
9809 `expression'. It can't be a statement, so the code here was
9812 2004-06-02 Marek Safar <marek.safar@seznam.cz>
9815 * typemanager.cs (GetFullNameSignature): New method for
9818 2004-06-02 Marek Safar <marek.safar@seznam.cz>
9821 * class.cs (MemberBase.GetSignatureForError): New virtual method.
9822 Use this method when MethodBuilder is null.
9823 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
9824 Added test for error CS0626 (MONO reports error for this situation).
9825 (IMethodData.GetSignatureForError): Extended interface.
9827 2004-06-01 Marek Safar <marek.safar@seznam.cz>
9830 (AttributeTester.GetObsoleteAttribute): Returns instance of
9831 ObsoleteAttribute when type is obsolete.
9834 (TypeContainer.VerifyObsoleteAttribute): Override.
9835 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9836 (MethodCode.VerifyObsoleteAttribute): Override.
9837 (MemberBase.VerifyObsoleteAttribute): Override.
9840 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9841 and report proper error.
9844 Delegate.VerifyObsoleteAttribute): Override.
9847 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9848 and report proper error.
9849 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9852 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9856 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9857 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9858 Added test for ObsoleteAttribute.
9861 (Catch): Derived from Statement.
9863 2004-06-01 Marek Safar <marek.safar@seznam.cz>
9865 Fixed bug #59071 & cs0160.cs
9867 * statement.cs (Try.Resolve): Check here whether order of catch
9868 clauses matches their dependencies.
9870 2004-05-31 Miguel de Icaza <miguel@ximian.com>
9872 * Reverted patch to namespace.cs (Use lookuptypedirect). This
9873 caused a regression: #59343. Referencing nested classes from an
9874 assembly stopped working.
9876 2004-05-31 Martin Baulig <martin@ximian.com>
9878 MCS is now frozen for beta 2.
9880 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9882 * convert.cs: add a trivial cache for overload operator resolution.
9884 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9886 * decl.cs: If possible, use lookuptypedirect here. We can only do
9887 this if there is no `.' after the namespace. Avoids using
9888 LookupType, which does lots of slow processing.
9889 (FindNestedType) New method, does what it says :-).
9890 * namespace.cs: use LookupTypeDirect.
9891 * rootcontext.cs: use membercache, if possible.
9892 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9894 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9897 According to the spec,
9899 In a member access of the form E.I, if E is a single identifier,
9900 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9901 field, property, localvariable, or parameter with the same type as
9902 the meaning of E as a type-name (§3.8), then both possible
9903 meanings of E are permitted.
9905 We did not check that E as a simple-name had the same type as E as
9908 This trivial check gives us 5-7% on bootstrap time.
9910 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9912 * expression.cs (Invocation.OverloadResolve): Avoid the
9913 use of hashtables and boxing here by allocating on demand.
9915 2004-05-30 Martin Baulig <martin@ximian.com>
9917 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9918 we're doing a silent lookup. Don't try to lookup nested types in
9919 TypeManager.object_type (thanks to Ben Maurer).
9921 2004-05-30 Martin Baulig <martin@ximian.com>
9923 Committing a patch from Ben Maurer.
9925 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9927 2004-05-29 Martin Baulig <martin@ximian.com>
9929 * class.cs (IMethodData.ShouldIgnore): New method.
9931 * typemanager.cs (TypeManager.MethodFlags): Don't take a
9932 `Location' argument, we don't need it anywhere. Use
9933 `IMethodData.ShouldIgnore ()' instead of
9934 `MethodData.GetMethodFlags ()'.
9935 (TypeManager.AddMethod): Removed.
9936 (TypeManager.AddMethod2): Renamed to AddMethod.
9938 2004-05-29 Martin Baulig <martin@ximian.com>
9940 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9942 * convert.cs (Convert.ImplicitReferenceConversion): If we're
9943 converting from a class type S to an interface type and we already
9944 have an object on the stack, don't box it again. Fixes #52578.
9946 2004-05-29 Martin Baulig <martin@ximian.com>
9948 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9949 Added support for `params' parameters. Fixes #59267.
9951 2004-05-29 Martin Baulig <martin@ximian.com>
9953 * literal.cs (NullPointer): Provide a private .ctor which sets
9954 `type' to TypeManager.object_type. Fixes #59048.
9956 2004-05-29 Martin Baulig <martin@ximian.com>
9958 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9959 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
9961 * ecore.cs (EventExpr.instance_expr): Make the field private.
9963 2004-05-26 Marek Safar <marek.safar@seznam.cz>
9965 Fixed bug #50080 & cs0214-2.cs
9966 * expression.cs (Cast.DoResolve): Check unsafe context here.
9968 * statement.cs (Resolve.DoResolve): Likewise.
9970 2004-05-26 Martin Baulig <martin@ximian.com>
9972 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9974 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9975 (RootContext.LookupType): Pass down the `silent' flag.
9977 2004-05-25 Martin Baulig <martin@ximian.com>
9980 (MethodGroupExpr.IdenticalTypeName): New public property.
9981 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9982 expression actually refers to a type.
9984 2004-05-25 Martin Baulig <martin@ximian.com>
9986 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9987 for #56176 and made it actually work.
9989 2004-05-25 Martin Baulig <martin@ximian.com>
9991 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9992 (FieldExpr, PropertyExpr): Override and implement
9993 CacheTemporaries. Fixes #52279.
9995 2004-05-25 Miguel de Icaza <miguel@ximian.com>
9997 * location.cs: In the new compiler listing a file twice is a
9998 warning, not an error.
10000 2004-05-24 Martin Baulig <martin@ximian.com>
10002 * enum.cs (Enum.DefineType): For the `BaseType' to be a
10003 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
10005 2004-05-24 Martin Baulig <martin@ximian.com>
10007 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10008 walking the `using' list. Fixes #53921.
10010 2004-05-24 Martin Baulig <martin@ximian.com>
10012 * const.cs (Const.LookupConstantValue): Added support for
10013 EmptyCast's; fixes #55251.
10015 2004-05-24 Martin Baulig <martin@ximian.com>
10017 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10018 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10019 which does the CS0135 check. The reason is that we first need to
10020 check whether the variable actually exists.
10022 2004-05-24 Martin Baulig <martin@ximian.com>
10024 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10025 than RootContext.LookupType() to find the explicit interface
10026 type. Fixes #58584.
10028 2004-05-24 Raja R Harinath <rharinath@novell.com>
10030 * Makefile: Simplify. Use executable.make.
10031 * mcs.exe.sources: New file. List of sources of mcs.exe.
10033 2004-05-24 Anders Carlsson <andersca@gnome.org>
10037 Use the invariant culture when doing String.Compare for CLS case
10040 2004-05-23 Martin Baulig <martin@ximian.com>
10042 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10043 don't have any dots. Fixes #52622, added cs0246-8.cs.
10045 * namespace.cs (NamespaceEntry.Lookup): Likewise.
10047 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10049 * class.cs (MemberBase.Define): Reuse MemberType member for
10050 resolved type. Other methods can use it too.
10052 2004-05-23 Martin Baulig <martin@ximian.com>
10054 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10055 the variable also exists in the current block (otherwise, we need
10056 to report a CS0103). Fixes #58670.
10058 2004-05-23 Martin Baulig <martin@ximian.com>
10060 * flowanalysis.cs (Reachability.Reachable): Compute this
10061 on-the-fly rather than storing it as a field.
10063 2004-05-23 Martin Baulig <martin@ximian.com>
10065 * flowanalysis.cs (Reachability.And): Manually compute the
10066 resulting `barrier' from the reachability.
10068 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10071 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10072 instance of ObsoleteAttribute when symbol is obsolete.
10075 (IMethodData): Extended interface for ObsoleteAttribute support.
10077 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10079 * attribute.cs: Fix bug #55970
10081 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10085 (GetObsoleteAttribute): New method. Creates the instance of
10087 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10088 ObsoleteAttribute when member is obsolete.
10089 (AttributeTester.Report_ObsoleteMessage): Common method for
10090 Obsolete error/warning reporting.
10093 (TypeContainer.base_classs_type): New member for storing parent type.
10096 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10097 for this MemberCore.
10099 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10101 * attribute.cs, const.cs: Fix bug #58590
10103 2004-05-21 Martin Baulig <martin@ximian.com>
10105 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10106 out parameters if the end of the method is unreachable. Fixes
10109 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10111 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10112 Hari was right, why extra method.
10114 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10116 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10118 2004-05-20 Martin Baulig <martin@ximian.com>
10120 Merged this back from gmcs to keep the differences to a minumum.
10122 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
10123 instead of a Declspace.
10124 (Attribute.ResolveType): Likewise.
10125 (Attributes.Search): Likewise.
10126 (Attributes.Contains): Likewise.
10127 (Attributes.GetClsCompliantAttribute): Likewise.
10129 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
10131 (MethodData.ApplyAttributes): Take an EmitContext instead of a
10134 2004-05-19 Marek Safar <marek.safar@seznam.cz>
10136 Fix bug #58688 (MCS does not report error when the same attribute
10139 * attribute.cs (Attribute.Emit): Distinction between null and default.
10141 2004-05-19 Raja R Harinath <rharinath@novell.com>
10143 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10144 of a top-level attribute without an attribute target.
10145 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
10147 (Attribute.Conditional_GetConditionName),
10148 (Attribute.Obsolete_GetObsoleteMessage): Update.
10149 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
10150 part of ScanForIndexerName.
10151 (Attribute.CanIgnoreInvalidAttribute): New function.
10152 (Attribute.ScanForIndexerName): Move to ...
10153 (Attributes.ScanForIndexerName): ... here.
10154 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10155 (Attributes.Search): New internal variant that can choose not to
10156 complain if types aren't resolved. The original signature now
10158 (Attributes.GetClsCompliantAttribute): Use internal variant, with
10159 complaints suppressed.
10160 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10161 only if it not useful.
10162 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10163 top-level for attributes that are shared between the assembly
10164 and a top-level class.
10165 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10166 * class.cs: Update to reflect changes.
10167 (DefineIndexers): Fuse loops.
10168 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
10169 a couple more variants of attribute names.
10171 2004-05-18 Marek Safar <marek.safar@seznam.cz>
10173 Fix bug #52585 (Implemented explicit attribute declaration)
10176 (Attributable.ValidAttributeTargets): New abstract method. It gets
10177 list of valid attribute targets for explicit target declaration.
10178 (Attribute.Target): It holds target itself.
10179 (AttributeSection): Removed.
10180 (Attribute.CheckTargets): New method. It checks whether attribute
10181 target is valid for the current element.
10184 (EventProperty): New class. For events that are declared like
10185 property (with add and remove accessors).
10186 (EventField): New class. For events that are declared like field.
10189 * cs-parser.jay: Implemented explicit attribute target declaration.
10191 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
10192 Override ValidAttributeTargets.
10195 (ReturnParameter): Class for applying custom attributes on
10197 (ParameterAtribute): New class. Class for applying custom
10198 attributes on the parameter type.
10200 2004-05-17 Miguel de Icaza <miguel@ximian.com>
10202 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10205 (Method): Allow UNSAFE here.
10207 * modifiers.cs: Support unsafe reporting.
10209 2004-05-17 Marek Safar <marek.safar@seznam.cz>
10211 * decl.cs: Fix bug #58478.
10213 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10215 * statement.cs: When checking for unreachable code on an EmptyStatement,
10216 set the location. Fixes bug #58488.
10218 2004-05-13 Miguel de Icaza <miguel@ximian.com>
10220 * driver.cs: Add -pkg handling.
10222 From Gonzalo: UseShelLExecute=false
10224 2004-05-12 Marek Safar <marek.safar@seznam.cz>
10227 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10229 (Attribute.IsClsCompliaceRequired): Moved to base for better
10231 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10232 when attribute is AttributeUsageAttribute.
10233 (Attribute.GetValidTargets): Simplified.
10234 (Attribute.GetAttributeUsage): New method returns AttributeUsage
10235 attribute for this type.
10236 (Attribute.ApplyAttributes): Method renamed to Emit and make
10238 (GlobalAttributeSection): New class for special handling of global
10239 attributes (assembly, module).
10240 (AttributeSection.Emit): New method.
10242 * class.cs: Implemented Attributable abstract methods.
10243 (MethodCore.LabelParameters): Moved to Parameter class.
10244 (Accessor): Is back simple class.
10245 (PropertyMethod): Implemented Attributable abstract class.
10246 (DelegateMethod): Implemented Attributable abstract class.
10247 (Event): New constructor for disctintion between normal Event
10248 and Event with accessors.
10250 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10252 * codegen.cs, const.cs, decl.cs, delegate.cs:
10253 (CommonAssemblyModulClass): Implemented Attributable abstract class
10256 * enum.cs: Implement IAttributeSupport interface.
10257 (EnumMember): New class for emum members. Implemented Attributable
10261 (ParameterBase): Is abstract.
10262 (ReturnParameter): New class for easier [return:] attribute handling.
10264 * typemanager.cs: Removed builder_to_attr.
10266 2004-05-11 Raja R Harinath <rharinath@novell.com>
10269 * attribute.cs (Attribute.GetPositionalValue): New function.
10270 * class.cs (TypeContainer.VerifyMembers): New function.
10271 (TypeContainer.Emit): Use it.
10272 (ClassOrStruct): New base class for Class and Struct.
10273 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
10274 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10276 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10277 then each non-static field should have a FieldOffset attribute.
10278 Otherwise, none of the fields should have a FieldOffset attribute.
10279 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
10280 and FieldOffset attributes.
10281 * typemanager.cs (TypeManager.struct_layout_attribute_type)
10282 (TypeManager.field_offset_attribute_type): New core types.
10283 (TypeManager.InitCoreTypes): Initialize them.
10285 2004-05-11 Michal Moskal <malekith@pld-linux.org>
10287 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10288 Return correct type.
10291 2004-05-09 Miguel de Icaza <miguel@ximian.com>
10293 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10294 be implicitly converted to ulong.
10296 * expression.cs: The logic for allowing operator &, | and ^ worked
10297 was wrong, it worked before because we did not report an error in
10298 an else branch. Fixes 57895.
10300 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10301 allow volatile fields to be reference types.
10303 2004-05-07 Miguel de Icaza <miguel@ximian.com>
10305 * driver.cs: Add support for /debug-
10307 2004-05-07 Raja R Harinath <rharinath@novell.com>
10309 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
10310 Add a 'complain' parameter to silence errors.
10311 (Attribute.Resolve): Update to changes. Put in sanity check to catch
10312 silently overlooked type-resolutions.
10313 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10314 to reflect changes.
10315 (Attributes.Search): New function.
10316 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10317 (Attributes.GetAttributeFullName): Remove hack.
10318 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
10319 Update to reflect changes.
10320 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10321 Use Attributes.Search instead of nested loops.
10323 2004-05-07 Marek Safar <marek.safar@seznam.cz>
10326 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10327 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10328 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10330 * report.cs: (Report.Warning): Renamed to Warning_T because of
10331 parameter collision.
10333 2004-05-05 Raja R Harinath <rharinath@novell.com>
10335 * expression.cs (MemberAccess.ResolveMemberAccess):
10336 Exit with non-zero status after Report.Error.
10337 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10339 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10341 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10343 * support.cs: Don't hang when the file is empty.
10345 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10347 * support.cs: In SeekableStreamReader, compute the preamble size of the
10348 underlying stream. Position changes should take into account that initial
10351 2004-05-03 Todd Berman <tberman@sevenl.net>
10353 * driver.cs: remove unused GetSysVersion function.
10355 2004-05-03 Todd Berman <tberman@sevenl.net>
10357 * driver.cs: Remove the hack from saturday, as well as the hack
10358 from jackson (LoadAssemblyFromGac), also adds the CWD to the
10359 link_paths to get that bit proper.
10361 2004-05-01 Todd Berman <tberman@sevenl.net>
10363 * driver.cs: Try a LoadFrom before a Load, this checks the current
10364 path. This is currently a bug in mono that is be fixed, however, this
10365 provides a workaround for now. This will be removed when the bug
10368 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
10370 * CryptoConvert.cs: Updated to latest version. Fix issue with
10371 incomplete key pairs (#57941).
10373 2004-05-01 Todd Berman <tberman@sevenl.net>
10375 * driver.cs: Remove '.' from path_chars, now System.* loads properly
10378 2004-04-30 Jackson Harper <jackson@ximian.com>
10380 * codegen.cs: Open keys readonly.
10382 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10384 * typemanager.cs: don't report cyclic struct layout when a struct
10385 contains 2 or more fields of the same type. Failed for Pango.AttrShape
10386 which has 2 Pango.Rectangle fields.
10388 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
10390 * expression.cs: Handle IntPtr comparisons with IL code
10391 rather than a method call.
10393 2004-04-29 Martin Baulig <martin@ximian.com>
10395 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
10396 the list of PropertyInfo's in class hierarchy and find the
10397 accessor. Fixes #56013.
10399 2004-04-29 Martin Baulig <martin@ximian.com>
10401 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10403 2004-04-29 Martin Baulig <martin@ximian.com>
10405 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10407 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10409 2004-04-29 Martin Baulig <martin@ximian.com>
10411 * class.cs (ConstructorInitializer.Resolve): Check whether the
10412 parent .ctor is accessible. Fixes #52146.
10414 2004-04-29 Martin Baulig <martin@ximian.com>
10416 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10418 * statement.cs (Using.EmitLocalVariableDecls): Use
10419 TypeManager.idisposable_type, not typeof (IDisposable).
10420 (Foreach.EmitCollectionForeach): Added support for valuetypes.
10422 2004-04-29 Martin Baulig <martin@ximian.com>
10424 * class.cs (Event.Define): Don't emit the field and don't set
10425 RTSpecialName and SpecialName for events on interfaces. Fixes
10428 2004-04-29 Raja R Harinath <rharinath@novell.com>
10430 Refactor Attribute.ApplyAttributes.
10431 * attribute.cs (Attributable): New base class for objects that can
10432 have Attributes applied on them.
10433 (Attribute): Make AttributeUsage fields public.
10434 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10435 (Attribute.IsInternalCall): New property.
10436 (Attribute.UsageAttr): Convert to a public read-only property.
10437 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10438 (Attribute.ResolveType, Attribute.Resolve)
10439 (Attribute.ScanForIndexerName): Update to reflect changes.
10440 (Attribute.CheckAttributeTarget): Re-format.
10441 (Attribute.ApplyAttributes): Refactor, to various
10442 Attributable.ApplyAttributeBuilder methods.
10443 * decl.cs (MemberCore): Make Attributable.
10444 * class.cs (Accessor): Make Attributable.
10445 (MethodData.ApplyAttributes): Use proper attribute types, not
10447 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10448 (TypeContainer.ApplyAttributeBuilder)
10449 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10450 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
10451 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10452 (Operator.ApplyAttributeBuilder): New factored-out methods.
10453 * const.cs (Const.ApplyAttributeBuilder): Likewise.
10454 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10455 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10456 * parameter.cs (ParameterBase): New Attributable base class
10457 that can also represent Return types.
10458 (Parameter): Update to the changes.
10460 2004-04-29 Jackson Harper <jackson@ximian.com>
10462 * driver.cs: Prefer the corlib system version when looking for
10463 assemblies in the GAC. This is still a hack, but its a better hack
10466 2004-04-29 Marek Safar <marek.safar@seznam.cz>
10468 * decl.cs, enum.cs: Improved error 3005 reporting.
10470 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10471 (related_symbols): New private member for list of symbols
10472 related to reported error/warning.
10474 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10476 2004-04-29 Martin Baulig <martin@ximian.com>
10478 * ecore.cs (Expression.Constantify): If we're an enum and
10479 TypeManager.TypeToCoreType() doesn't give us another type, use
10480 t.UnderlyingSystemType. Fixes #56178.
10482 2004-04-29 Martin Baulig <martin@ximian.com>
10484 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10485 interfaces and for each interface, only add members directly
10486 declared in that interface. Fixes #53255.
10488 2004-04-28 Martin Baulig <martin@ximian.com>
10490 * expression.cs (ConditionalLogicalOperator): Use a temporary
10491 variable for `left' to avoid that we evaluate it more than once;
10494 2004-04-28 Martin Baulig <martin@ximian.com>
10496 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10499 2004-04-28 Martin Baulig <martin@ximian.com>
10501 * statement.cs (LocalInfo.Resolve): Check whether the type is not
10504 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10505 whether the type is not void (CS1547).
10507 2004-04-28 Martin Baulig <martin@ximian.com>
10509 * expression.cs (Unary.DoResolveLValue): Override this and report
10510 CS0131 for anything but Operator.Indirection.
10512 2004-04-28 Martin Baulig <martin@ximian.com>
10514 Committing a patch from Ben Maurer; see bug #50820.
10516 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10519 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10522 2004-04-28 Martin Baulig <martin@ximian.com>
10524 Committing a patch from Ben Maurer; see bug #50820.
10526 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10529 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10532 2004-04-28 Martin Baulig <martin@ximian.com>
10534 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10535 (Block.AddLabel): Call DoLookupLabel() to only search in the
10538 2004-04-28 Martin Baulig <martin@ximian.com>
10540 * cfold.cs (ConstantFold.BinaryFold): Added special support for
10541 comparing StringConstants and NullLiterals in Equality and Inequality.
10543 2004-04-28 Jackson Harper <jackson@ximian.com>
10545 * driver.cs: Attempt to load referenced assemblies from the
10546 GAC. This is the quick and dirty version of this method that
10547 doesnt take into account versions and just takes the first
10548 canidate found. Will be good enough for now as we will not have more
10549 then one version installed into the GAC until I update this method.
10551 2004-04-28 Martin Baulig <martin@ximian.com>
10553 * typemanager.cs (TypeManager.CheckStructCycles): New public
10554 static method to check for cycles in the struct layout.
10556 * rootcontext.cs (RootContext.PopulateTypes): Call
10557 TypeManager.CheckStructCycles() for each TypeContainer.
10558 [Note: We only need to visit each type once.]
10560 2004-04-28 Martin Baulig <martin@ximian.com>
10562 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10564 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10565 success and added `out object value'. Use a `bool resolved' field
10566 to check whether we've already been called rather than
10567 `ConstantValue != null' since this breaks for NullLiterals.
10569 2004-04-28 Raja R Harinath <rharinath@novell.com>
10571 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10572 setting of this flag, since the 'set' method may be non-public.
10574 2004-04-28 Raja R Harinath <rharinath@novell.com>
10576 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10577 check on current_vector.Block.
10579 2004-04-27 Martin Baulig <martin@ximian.com>
10581 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10582 a field initializer. Fixes #56459.
10584 2004-04-27 Martin Baulig <martin@ximian.com>
10586 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10587 we're not attempting to use an indexer. Fixes #52154.
10589 2004-04-27 Martin Baulig <martin@ximian.com>
10591 * statement.cs (Return): Don't create a return label if we don't
10592 need it; reverts my change from January 20th. Thanks to Ben
10595 2004-04-27 Martin Baulig <martin@ximian.com>
10597 According to the spec, `goto' can only leave a nested scope, but
10600 * statement.cs (Block.LookupLabel): Only lookup in the current
10601 block, don't recurse into parent or child blocks.
10602 (Block.AddLabel): Check in parent and child blocks, report
10603 CS0140/CS0158 if we find a duplicate.
10604 (Block): Removed this indexer for label lookups.
10605 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10606 this already does the error reporting for us.
10609 (FlowBranching.UsageVector.Block): New public variable; may be null.
10610 (FlowBranching.CreateSibling): Added `Block' argument.
10611 (FlowBranching.LookupLabel): New public virtual method. Lookup a
10612 label for the target of a `goto' and check whether we're not
10613 leaving a `finally'.
10615 2004-04-27 Martin Baulig <martin@ximian.com>
10617 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10618 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10621 2004-04-27 Martin Baulig <martin@ximian.com>
10623 * statement.cs (Block.AddLabel): Also check for implicit blocks
10624 and added a CS0158 check.
10626 2004-04-27 Martin Baulig <martin@ximian.com>
10628 * flowanalysis.cs (FlowBranchingLoop): New class.
10629 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10630 UsageVector's instead of an ArrayList.
10631 (FlowBranching.Label): Likewise.
10632 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10633 (FlowBranching.AddBreakVector): New method.
10635 2004-04-27 Miguel de Icaza <miguel@ximian.com>
10637 * attribute.cs: Small regression fix: only convert the type if we
10638 the type is different, fixes System.Drawing build.
10640 2004-04-27 Martin Baulig <martin@ximian.com>
10642 * attribute.cs (Attribute.Resolve): If we have a constant value
10643 for a named field or property, implicity convert it to the correct
10646 2004-04-27 Raja R Harinath <rharinath@novell.com>
10648 * statement.cs (Block.Block): Implicit blocks share
10649 'child_variable_names' fields with parent blocks.
10650 (Block.AddChildVariableNames): Remove.
10651 (Block.AddVariable): Mark variable as "used by a child block" in
10652 every surrounding block.
10653 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10654 been used in a child block, complain about violation of "Invariant
10655 meaning in blocks" rule.
10656 * cs-parser.jay (declare_local_variables): Don't use
10657 AddChildVariableNames.
10658 (foreach_statement): Don't create an implicit block: 'foreach'
10659 introduces a scope.
10661 2004-04-23 Miguel de Icaza <miguel@ximian.com>
10663 * convert.cs (ImplicitNumericConversion): 0 is also positive when
10664 converting from 0L to ulong. Fixes 57522.
10666 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10668 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10669 derived class hides via 'new' keyword field from base class (test-242.cs).
10670 TODO: Handle this in the more general way.
10672 * class.cs (CheckBase): Ditto.
10674 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10676 * decl.cs (caching_flags): New member for storing cached values
10678 (MemberCore.Flags): New enum where bit flags for caching_flags
10680 (MemberCore.cls_compliance): Moved to caching_flags.
10681 (DeclSpace.Created): Moved to caching_flags.
10683 * class.cs: Use caching_flags instead of DeclSpace.Created
10685 2004-04-21 Miguel de Icaza <miguel@ximian.com>
10687 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10688 if we are only a derived class, not a nested class.
10690 * typemanager.cs: Same as above, but do this at the MemberLookup
10691 level (used by field and methods, properties are handled in
10692 PropertyExpr). Allow for the qualified access if we are a nested
10695 2004-04-21 Marek Safar <marek.safar@seznam.cz>
10697 * class.cs: Refactoring.
10698 (IMethodData): New inteface; Holds links to parent members
10699 to avoid member duplication (reduced memory allocation).
10700 (Method): Implemented IMethodData interface.
10701 (PropertyBase): New inner classes for get/set methods.
10702 (PropertyBase.PropertyMethod): Implemented IMethodData interface
10703 (Event): New inner classes for add/remove methods.
10704 (Event.DelegateMethod): Implemented IMethodData interface.
10706 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10707 EmitContext (related to class.cs refactoring).
10709 2004-04-21 Raja R Harinath <rharinath@novell.com>
10711 * delegate.cs (Delegate.VerifyApplicability): If the number of
10712 arguments are the same as the number of parameters, first try to
10713 verify applicability ignoring any 'params' modifier on the last
10717 2004-04-16 Raja R Harinath <rharinath@novell.com>
10719 * class.cs (TypeContainer.AddIndexer): Use
10720 'ExplicitInterfaceName' to determine if interface name was
10721 explicitly specified. 'InterfaceType' is not initialized at this time.
10722 (TypeContainer.DefineIndexers): Remove use of temporary list. The
10723 Indexers array is already in the required order. Initialize
10724 'IndexerName' only if there are normal indexers.
10725 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10726 (TypeContainer.Emit): Emit DefaultMember attribute only if
10727 IndexerName is initialized.
10730 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
10732 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10735 2004-04-15 Raja R Harinath <rharinath@novell.com>
10737 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10741 * attribute.cs (Attribute.Resolve): Check for duplicate named
10745 2004-04-15 Miguel de Icaza <miguel@ximian.com>
10747 * iterators.cs (MarkYield): track whether we are in an exception,
10748 and generate code accordingly. Use a temporary value to store the
10749 result for our state.
10751 I had ignored a bit the interaction of try/catch with iterators
10752 since their behavior was not entirely obvious, but now it is
10753 possible to verify that our behavior is the same as MS .NET 2.0
10757 2004-04-14 Miguel de Icaza <miguel@ximian.com>
10759 * iterators.cs: Avoid creating temporaries if there is no work to
10762 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10763 Enumerations, use TypeManager.EnumToUnderlying and call
10766 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10769 (This.Emit): Use EmitContext.EmitThis to emit our
10772 (This.EmitAssign): Ditto.
10774 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10775 codepaths, we will move all the functionality into
10778 (FieldExpr.EmitAssign): Ditto.
10780 This fixes several hidden bugs that I uncovered while doing a code
10781 review of this today.
10783 * codegen.cs (EmitThis): reworked so the semantics are more clear
10784 and also support value types "this" instances.
10786 * iterators.cs: Changed so that for iterators in value types, we
10787 do not pass the value type as a parameter.
10789 Initialization of the enumerator helpers is now done in the caller
10790 instead of passing the parameters to the constructors and having
10791 the constructor set the fields.
10793 The fields have now `assembly' visibility instead of private.
10795 2004-04-11 Miguel de Icaza <miguel@ximian.com>
10797 * expression.cs (Argument.Resolve): Check if fields passed as ref
10798 or out are contained in a MarshalByRefObject.
10800 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10801 another compiler type.
10803 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
10805 * class.cs (Indexer.Define): use the new name checking method.
10806 Also, return false on an error.
10807 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10808 (is_identifier_[start/part]_character): make static.
10810 2004-04-10 Miguel de Icaza <miguel@ximian.com>
10812 * expression.cs (Binary.ResolveOperator): Do no append strings
10813 twice: since we can be invoked more than once (array evaluation)
10814 on the same concatenation, take care of this here. Based on a fix
10815 from Ben (bug #56454)
10817 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10819 * codegen.cs: Fix another case where CS1548 must be reported (when
10820 delay-sign isn't specified and no private is available #56564). Fix
10821 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10822 error when MCS is used on the MS runtime and we need to delay-sign
10823 (which seems unsupported by AssemblyBuilder - see #56621).
10825 2004-04-08 Marek Safar <marek.safar@seznam.cz>
10827 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10828 (TypeManager.ComputeNamespaces): Faster implementation for
10831 * compiler.csproj: Updated AssemblyName to mcs.
10833 2004-04-07 Miguel de Icaza <miguel@ximian.com>
10835 * rootcontext.cs: Add new types to the boot resolution.
10837 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10838 MulticastDelegate is not allowed.
10840 * typemanager.cs: Add new types to lookup: System.TypedReference
10843 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10844 check for TypedReference or ArgIterator, they are not allowed.
10846 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10847 makes us properly catch 1510 in some conditions (see bug 56016 for
10850 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
10852 * CryptoConvert.cs: update from corlib version
10855 2004-04-05 Miguel de Icaza <miguel@ximian.com>
10857 * class.cs (Indexer.Define): Check indexername declaration
10859 2004-04-05 Marek Safar <marek.safar@seznam.cz>
10861 * attribute.cs (IsClsCompliant): Fixed problem with handling
10862 all three states (compliant, not-compliant, undetected).
10864 2004-03-30 Marek Safar <marek.safar@seznam.cz>
10866 * attribute.cs (Attribute): Location is now public.
10867 (Resolve): Store resolved arguments (pos_values) in attribute class.
10868 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10869 (GetClsCompliantAttributeValue): New method that gets
10870 CLSCompliantAttribute value.
10871 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10872 if exists else null.
10873 (AttributeTester): New class for CLS-Compliant verification routines.
10875 * class.cs (Emit): Add CLS-Compliant verification.
10876 (Method.GetSignatureForError): Implemented.
10877 (Constructor.GetSignatureForError): Implemented
10878 (Constructor.HasCompliantArgs): Returns if constructor has
10879 CLS-Compliant arguments.
10880 (Constructor.Emit): Override.
10881 (Construcor.IsIdentifierClsCompliant): New method; For constructors
10882 is needed to test only parameters.
10883 (FieldBase.GetSignatureForError): Implemented.
10884 (TypeContainer): New member for storing base interfaces.
10885 (TypeContainer.FindMembers): Search in base interfaces too.
10887 * codegen.cs (GetClsComplianceAttribute): New method that gets
10888 assembly or module CLSCompliantAttribute value.
10889 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10891 (ModuleClass.Emit): Add error 3012 test.
10893 * const.cs (Emit): Override and call base for CLS-Compliant tests.
10895 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10896 state for all decl types.
10897 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10898 if CLS-Compliant tests are required.
10899 (IsClsCompliaceRequired): New method. Analyze whether code
10900 must be CLS-Compliant.
10901 (IsExposedFromAssembly): New method. Returns true when MemberCore
10902 is exposed from assembly.
10903 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10904 value or gets cached value.
10905 (HasClsCompliantAttribute): New method. Returns true if MemberCore
10906 is explicitly marked with CLSCompliantAttribute.
10907 (IsIdentifierClsCompliant): New abstract method. This method is
10908 used to testing error 3005.
10909 (IsIdentifierAndParamClsCompliant): New method. Common helper method
10910 for identifier and parameters CLS-Compliant testing.
10911 (VerifyClsCompliance): New method. The main virtual method for
10912 CLS-Compliant verifications.
10913 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10914 null. I don't know why is null (too many public members !).
10915 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10916 and get value of first CLSCompliantAttribute that found.
10918 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10919 (VerifyClsCompliance): Override and add extra tests.
10921 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10922 clscheck- disable CLS-Compliant verification event if assembly is has
10923 CLSCompliantAttribute(true).
10925 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10926 ApllyAttribute is now called in emit section as in the other cases.
10927 Possible future Emit integration.
10928 (IsIdentifierClsCompliant): New override.
10929 (VerifyClsCompliance): New override.
10930 (GetEnumeratorName): Returns full enum name.
10932 * parameter.cs (GetSignatureForError): Implemented.
10934 * report.cs (WarningData): New struct for Warning message information.
10935 (LocationOfPreviousError): New method.
10936 (Warning): New method. Reports warning based on the warning table.
10937 (Error_T): New method. Reports error based on the error table.
10939 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10940 verifications are done here.
10942 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10944 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10945 CLSCompliantAttribute.
10946 (all_imported_types): New member holds all imported types from other
10948 (LoadAllImportedTypes): New method fills static table with exported types
10949 from all referenced assemblies.
10950 (Modules): New property returns all assembly modules.
10952 2004-03-30 Miguel de Icaza <miguel@ximian.com>
10954 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10955 throwing a parser error.
10957 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10958 which removes the hardcoded get_/set_ prefixes for properties, as
10959 IL allows for the properties to be named something else.
10963 * expression.cs: Do not override operand before we know if it is
10964 non-null. Fix 56207
10966 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10968 * typemanager.cs: support for pinned variables.
10970 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10972 * decl.cs, typemanager.cs: Avoid using an arraylist
10973 as a buffer if there is only one result set.
10975 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10977 * expression.cs: Make sure you cant call a static method
10978 with an instance expression, bug #56174.
10980 2004-03-29 Miguel de Icaza <miguel@ximian.com>
10982 * class.cs (IsDuplicateImplementation): Improve error reporting to
10983 flag 663 (method only differs in parameter modifier).
10985 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10986 in preprocessor directives.
10988 * location.cs (LookupFile): Allow for the empty path.
10990 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
10991 better approach for some of that patch, but its failing with the
10992 CharSet enumeration. For now try/catch will do.
10994 * typemanager.cs: Do not crash if a struct does not have fields.
10997 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10999 * expression.cs: cs0213, cant fix a fixed expression.
11002 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11004 * cs-parser.jay: detect invalid embeded statements gracefully.
11007 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11009 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11012 the invocation type may not be a subclass of the tye of the item/
11013 The type of the item must be a subclass of the invocation item.
11018 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
11020 * attribute.cs: Added methods to get a string and a bool from an
11021 attribute. Required to information from AssemblyKeyFileAttribute,
11022 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11023 * codegen.cs: Modified AssemblyName creation to include support for
11024 strongnames. Catch additional exceptions to report them as CS1548.
11025 * compiler.csproj: Updated include CryptoConvert.cs.
11026 * compiler.csproj.user: Removed file - user specific configuration.
11027 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
11028 Mono.Security assembly. The original class is maintained and tested in
11029 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11030 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11031 like CSC 8.0 (C# v2) supports.
11032 * Makefile: Added CryptoConvert.cs to mcs sources.
11033 * rootcontext.cs: Added new options for strongnames.
11035 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
11037 * driver.cs: For --expect-error, report error code `2'
11038 if the program compiled with no errors, error code `1' if
11039 it compiled with an error other than the one expected.
11041 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
11043 * compiler.csproj: Updated for Visual Studio .NET 2003.
11044 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11045 * compiler.sln: Updated for Visual Studio .NET 2003.
11047 2004-03-24 Ravi Pratap M <ravi@ximian.com>
11049 * expression.cs: Fix bug #47234. We basically need to apply the
11050 rule that we prefer the conversion of null to a reference type
11051 when faced with a conversion to 'object' (csc behaviour).
11053 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11055 * statement.cs: Shorter form for foreach, eliminates
11056 a local variable. r=Martin.
11058 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11060 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11061 checks if we can use brtrue/brfalse to test for 0.
11062 * expression.cs: use the above in the test for using brtrue/brfalse.
11063 cleanup code a bit.
11065 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11067 * expression.cs: Rewrite string concat stuff. Benefits:
11069 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11070 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11071 rather than a concat chain.
11073 * typemanager.cs: Add lookups for more concat overloads.
11075 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11077 * expression.cs: Emit shorter il code for array init.
11094 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
11096 * statement.cs: Before, two switch blocks would be merged if the
11097 total size of the blocks (end_item - begin_item + 1) was less than
11098 two times the combined sizes of the blocks.
11100 Now, it will only merge if after the merge at least half of the
11105 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
11107 * class.cs : csc build fix for GetMethods(). See bug #52503.
11109 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
11111 * expression.cs: Make sure fp comparisons work with NaN.
11112 This fixes bug #54303. Mig approved this patch a long
11113 time ago, but we were not able to test b/c the runtime
11116 2004-03-19 Miguel de Icaza <miguel@ximian.com>
11118 * ecore.cs (TypExpr.GetHashCode): implement this overload.
11120 2004-03-19 Martin Baulig <martin@ximian.com>
11122 * class.cs (MemberCore.IsDuplicateImplementation): Report the
11123 error here and not in our caller.
11125 2004-03-19 Martin Baulig <martin@ximian.com>
11127 * interface.cs: Completely killed this file.
11128 (Interface): We're now a TypeContainer and live in class.cs.
11130 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11131 argument; we're now also called for interfaces.
11132 (TypeContainer.DefineMembers): Allow this method being called
11134 (TypeContainer.GetMethods): New public method; formerly known as
11135 Interface.GetMethod(). This is used by PendingImplementation.
11136 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11137 it's now private and non-static.
11138 (Interface): Moved this here; it's now implemented similar to
11140 (Method, Property, Event, Indexer): Added `bool is_interface'
11141 argument to their .ctor's.
11142 (MemberBase.IsInterface): New public field.
11144 * cs-parser.jay: Create normal Method, Property, Event, Indexer
11145 instances instead of InterfaceMethod, InterfaceProperty, etc.
11146 (opt_interface_base): Removed; we now use `opt_class_base' instead.
11147 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11149 2004-03-19 Martin Baulig <martin@ximian.com>
11151 * class.cs (MethodCore.IsDuplicateImplementation): New private
11152 method which does the CS0111 checking.
11153 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11154 Use IsDuplicateImplementation().
11156 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
11158 * decl.cs (FindMemberToOverride): New method to find the correct
11159 method or property to override in the base class.
11161 - Make Method/Property use the above method to find the
11162 version in the base class.
11163 - Remove the InheritableMemberSignatureCompare as it is now
11166 This patch makes large code bases much faster to compile, as it is
11167 O(n) rather than O(n^2) to do this validation.
11169 Also, it fixes bug 52458 which is that nested classes are not
11170 taken into account when finding the base class member.
11172 Reviewed/Approved by Martin.
11174 2004-03-17 Marek Safar <marek.safar@seznam.cz>
11176 * interface.cs: In all interface classes removed redundant
11177 member initialization.
11179 2004-03-16 Martin Baulig <martin@ximian.com>
11181 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11183 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11185 * decl.cs (DefineTypeAndParents): New helper method to define a
11186 type's containers before the type itself is defined; This is a
11187 bug exposed by the recent changes to Windows.Forms when an
11188 implemented interface was defined inside a class that had not been
11191 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11193 (Check): Loop correctly to report errors modifiers
11194 (UNSAFE was not in the loop, since it was the same as TOP).
11196 * interface.cs: Every interface member now takes a ModFlags,
11197 instead of a "is_new" bool, which we set on the base MemberCore.
11199 Every place where we called "UnsafeOk" in the interface, now we
11200 call the proper member (InterfaceMethod.UnsafeOK) instead to get
11201 the unsafe settings from the member declaration instead of the
11202 container interface.
11204 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
11206 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11207 `set_indexer_name' to the pending bits (one per type).
11209 We fixed a bug today that was picking the wrong method to
11210 override, since for properties the existing InterfaceMethod code
11211 basically ignored the method name. Now we make sure that the
11212 method name is one of the valid indexer names.
11214 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
11216 * support.cs (SeekableStreamReader): Keep track of stream byte
11217 positions and don't mix them with character offsets to the buffer.
11219 Patch from Gustavo Giráldez
11221 2004-03-15 Marek Safar <marek.safar@seznam.cz>
11223 * interface.cs (InterfaceSetGetBase): Removed double member
11224 initialization, base class does it as well.
11226 2004-03-13 Martin Baulig <martin@ximian.com>
11228 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11229 when compiling corlib.
11231 2004-03-13 Miguel de Icaza <miguel@ximian.com>
11233 * convert.cs (ExplicitConversion): We were reporting an error on
11234 certain conversions (object_type source to a value type, when the
11235 expression was `null') before we had a chance to pass it through
11236 the user defined conversions.
11238 * driver.cs: Replace / and \ in resource specifications to dots.
11241 * class.cs: Add check for duplicate operators. Fixes 52477
11243 2004-03-11 Miguel de Icaza <miguel@ximian.com>
11245 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11246 that are in the middle of the statements, not only at the end.
11249 * class.cs (TypeContainer.AddField): No longer set the
11250 `HaveStaticConstructor' flag, now we call it
11251 `UserDefineStaticConstructor' to diferentiate the slightly
11252 semantic difference.
11254 The situation is that we were not adding BeforeFieldInit (from
11255 Modifiers.TypeAttr) to classes that could have it.
11256 BeforeFieldInit should be set to classes that have no static
11261 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11263 And most importantly Zoltan's comment:
11265 http://bugzilla.ximian.com/show_bug.cgi?id=44229
11267 "I think beforefieldinit means 'it's ok to initialize the type sometime
11268 before its static fields are used', i.e. initialization does not need
11269 to be triggered by the first access to the type. Setting this flag
11270 helps the JIT to compile better code, since it can run the static
11271 constructor at JIT time, and does not need to generate code to call it
11272 (possibly lots of times) at runtime. Unfortunately, mcs does not set
11273 this flag for lots of classes like String.
11275 csc sets this flag if the type does not have an explicit static
11276 constructor. The reasoning seems to be that if there are only static
11277 initalizers for a type, and no static constructor, then the programmer
11278 does not care when this initialization happens, so beforefieldinit
11281 This bug prevents the AOT compiler from being usable, since it
11282 generates so many calls to mono_runtime_class_init that the AOT code
11283 is much slower than the JITted code. The JITted code is faster,
11284 because it does not generate these calls if the vtable is type is
11285 already initialized, which is true in the majority of cases. But the
11286 AOT compiler can't do this."
11288 2004-03-10 Miguel de Icaza <miguel@ximian.com>
11290 * class.cs (MethodData.Emit): Refactor the code so symbolic
11291 information is generated for destructors; For some reasons we
11292 were taking a code path that did not generate symbolic information
11295 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
11297 * class.cs: Create a Constructor.CheckBase method that
11298 takes care of all validation type code. The method
11299 contains some code that was moved from Define.
11301 It also includes new code that checks for duplicate ctors.
11302 This fixes bug #55148.
11304 2004-03-09 Joshua Tauberer <tauberer@for.net>
11306 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11307 a { ... }-style array creation invokes EmitStaticInitializers
11308 which is not good for reference-type arrays. String, decimal
11309 and now null constants (NullCast) are not counted toward
11310 static initializers.
11312 2004-03-05 Martin Baulig <martin@ximian.com>
11314 * location.cs (SourceFile.HasLineDirective): New public field;
11315 specifies whether the file contains or is referenced by a "#line"
11317 (Location.DefineSymbolDocuments): Ignore source files which
11318 either contain or are referenced by a "#line" directive.
11320 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
11322 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11323 direct access to our parent, so check the method inline there.
11325 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
11327 * expression.cs (Invocation.EmitCall): Miguel's last commit
11328 caused a regression. If you had:
11333 In Foo the implict this would be null.
11335 2004-02-27 Miguel de Icaza <miguel@ximian.com>
11337 * expression.cs (Invocation.EmitCall): If the method is not
11338 virtual, do not emit a CallVirt to it, use Call.
11340 * typemanager.cs (GetFullNameSignature): Improve the method to
11341 cope with ".ctor" and replace it with the type name.
11343 * class.cs (ConstructorInitializer.Resolve): Now the method takes
11344 as an argument the ConstructorBuilder where it is being defined,
11345 to catch the recursive constructor invocations.
11347 2004-02-26 Miguel de Icaza <miguel@ximian.com>
11349 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11350 routines to check if a type is an enumerable/enumerator allow
11351 classes that implement the IEnumerable or IEnumerator interfaces.
11353 * class.cs (Property, Operator): Implement IIteratorContainer, and
11354 implement SetYields.
11356 (Property.Define): Do the block swapping for get_methods in the
11357 context of iterators. We need to check if Properties also
11358 include indexers or not.
11360 (Operator): Assign the Block before invoking the
11361 OperatorMethod.Define, so we can trigger the Iterator code
11364 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
11365 Property and Operator classes are not created when we parse the
11366 declarator but until we have the block completed, so we use a
11367 singleton SimpleIteratorContainer.Simple to flag whether the
11368 SetYields has been invoked.
11370 We propagate this setting then to the Property or the Operator to
11371 allow the `yield' to function.
11373 2004-02-25 Marek Safar <marek.safar@seznam.cz>
11375 * codegen.cs: Implemented attribute support for modules.
11376 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11377 Assembly/Module functionality.
11379 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11380 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11381 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11383 2004-02-16 Marek Safar <marek.safar@seznam.cz>
11385 * interface.cs (FindMembers): The operation is performed on all base
11386 interfaces and not only on the first. It is required for future CLS Compliance patch.
11388 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
11390 * statement.cs, codegen.cs:
11391 This patch deals with patterns such as:
11393 public class List : IEnumerable {
11395 public MyEnumerator GetEnumerator () {
11396 return new MyEnumerator(this);
11399 IEnumerator IEnumerable.GetEnumerator () {
11403 public struct MyEnumerator : IEnumerator {
11408 Before, there were a few things we did wrong:
11409 1) we would emit callvirt on a struct, which is illegal
11410 2) we emited ldarg when we needed to emit ldarga
11411 3) we would mistakenly call the interface methods on an enumerator
11412 type that derived from IEnumerator and was in another assembly. For example:
11414 public class MyEnumerator : IEnumerator
11416 Would have the interface methods called, even if there were public impls of the
11417 method. In a struct, this lead to invalid IL code.
11419 2004-02-11 Marek Safar <marek.safar@seznam.cz>
11421 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11424 * delegate.cs (Define): Fixed crash when delegate type is undefined.
11426 2004-02-11 Miguel de Icaza <miguel@ximian.com>
11428 * cs-parser.jay: Fix small regression: we were not testing V2
11429 compiler features correctly.
11431 * interface.cs: If the emit context is null, then create one
11433 2004-02-09 Marek Safar <marek.safar@seznam.cz>
11435 * decl.cs (GetSignatureForError): New virtual method to get full name
11436 for error messages.
11438 * attribute.cs (IAttributeSupport): New interface for attribute setting.
11439 Now it is possible to rewrite ApplyAttributes method to be less if/else.
11441 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11442 Duplicated members and code in these classes has been removed.
11443 Better encapsulation in these classes.
11445 2004-02-07 Miguel de Icaza <miguel@ximian.com>
11447 * assign.cs (Assign.DoResolve): When dealing with compound
11448 assignments, there is a new rule in ECMA C# 2.4 (might have been
11449 there before, but it is documented here) that states that in:
11453 If b is of type int, and the `op' is a shift-operator, then the
11454 above is evaluated as:
11458 * expression.cs (Binary.ResolveOperator): Instead of testing for
11459 int/uint/long/ulong, try to implicitly convert to any of those
11460 types and use that in pointer arithmetic.
11462 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11463 method to print information for from the type, not from the
11464 null-method we were given.
11466 2004-02-01 Duncan Mak <duncan@ximian.com>
11468 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11469 parsing for cmd, fixes bug #53694.
11471 2004-02-04 Marek Safar <marek.safar@seznam.cz>
11473 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11474 in the member name duplication tests. Property and operator name duplication
11475 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11477 2004-02-03 Marek Safar <marek.safar@seznam.cz>
11479 * interface.cs (PopulateMethod): Fixed crash when interface method
11480 returns not existing type (error test cs0246-3.cs).
11482 2004-02-02 Ravi Pratap M <ravi@ximian.com>
11484 * cs-parser.jay (interface_accessors): Re-write actions to also
11485 store attributes attached to get and set methods. Fix spelling
11488 (inteface_property_declaration): Modify accordingly.
11490 (InterfaceAccessorInfo): New helper class to store information to pass
11491 around between rules that use interface_accessors.
11493 * interface.cs (Emit): Apply attributes on the get and set
11494 accessors of properties and indexers too.
11496 * attribute.cs (ApplyAttributes): Modify accordingly to use the
11497 right MethodBuilder when applying attributes to the get and set accessors.
11499 2004-01-31 Miguel de Icaza <miguel@ximian.com>
11501 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11503 2004-01-26 Miguel de Icaza <miguel@ximian.com>
11505 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11507 2004-01-25 Miguel de Icaza <miguel@ximian.com>
11509 * cs-parser.jay: Remove YIELD token, instead use the new grammar
11510 changes that treat `yield' specially when present before `break'
11511 or `return' tokens.
11513 * cs-tokenizer.cs: yield is no longer a keyword.
11515 2004-01-23 Marek Safar <marek.safar@seznam.cz>
11517 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11518 setting for default constructors.
11519 For default constructors are almost every time set wrong Modifier. The
11520 generated IL code has been alright. But inside mcs this values was
11521 wrong and this was reason why several of my CLS Compliance tests
11524 2004-01-22 Martin Baulig <martin@ximian.com>
11526 * cs-parser.jay (namespace_or_type_name): Return an Expression,
11527 not a QualifiedIdentifier. This is what `type_name_expression'
11528 was previously doing.
11529 (type_name_expression): Removed; the code is now in
11530 `namespace_or_type_name'.
11531 (qualified_identifier): Removed, use `namespace_or_type_name'
11533 (QualifiedIdentifier): Removed this class.
11535 2004-01-22 Martin Baulig <martin@ximian.com>
11537 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11538 not a string as alias name.
11540 2004-01-21 Miguel de Icaza <miguel@ximian.com>
11542 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11543 #52730 bug, and instead compute correctly the need to use a
11544 temporary variable when requesting an address based on the
11545 static/instace modified of the field and the constructor.
11547 2004-01-21 Martin Baulig <martin@ximian.com>
11549 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11550 class and namespace before looking up aliases. Fixes #52517.
11552 2004-01-21 Martin Baulig <martin@ximian.com>
11554 * flowanalysis.cs (UsageVector.Merge): Allow variables being
11555 assinged in a 'try'; fixes exception4.cs.
11557 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11558 * class.cs : Implemented parameter-less constructor for TypeContainer
11560 * decl.cs: Attributes are now stored here. New property OptAttributes
11562 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11564 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11566 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11568 * typemanager.cs (CSharpSignature): Now reports also inner class name.
11569 (CSharpSignature): New method for indexer and property signature.
11571 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11573 * pending.cs (IsVirtualFilter): Faster implementation.
11575 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11577 * typemanager.cs: Avoid inclusion of same assembly more than once.
11579 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11581 * cs-parser.jay: Fixed problem where the last assembly attribute
11582 has been applied also to following declaration (class, struct, etc.)
11584 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11586 * class.cs: Added error CS0538, CS0539 reporting.
11587 Fixed crash on Microsoft runtime when field type is void.
11589 * cs-parser.jay: Added error CS0537 reporting.
11591 * pending.cs: Added error CS0535 reporting.
11592 Improved error report for errors CS0536, CS0534.
11594 2004-01-20 Miguel de Icaza <miguel@ximian.com>
11596 Merge a few bits from the Anonymous Method MCS tree.
11598 * statement.cs (ToplevelBlock): New class for toplevel methods,
11599 will hold anonymous methods, lifted variables.
11601 * cs-parser.jay: Create toplevel blocks for delegates and for
11602 regular blocks of code.
11604 2004-01-20 Martin Baulig <martin@ximian.com>
11606 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11607 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11608 and `NeedExplicitReturn'; added `IsLastStatement'.
11609 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11610 have a `ReturnLabel' or we're not unreachable.
11612 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11613 child's reachability; don't just override ours with it. Fixes
11614 #58058 (lluis's example).
11615 (FlowBranching): Added public InTryOrCatch(), InCatch(),
11616 InFinally(), InLoop(), InSwitch() and
11617 BreakCrossesTryCatchBoundary() methods.
11619 * statement.cs (Return): Do all error checking in Resolve().
11620 Unless we are the last statement in a top-level block, always
11621 create a return label and jump to it.
11622 (Break, Continue): Do all error checking in Resolve(); also make
11623 sure we aren't leaving a `finally'.
11624 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11625 statement in a top-level block.
11626 (Block.Flags): Added `IsDestructor'.
11627 (Block.IsDestructor): New public property.
11629 2004-01-20 Martin Baulig <martin@ximian.com>
11631 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11633 2004-01-20 Martin Baulig <martin@ximian.com>
11635 * statement.cs (Statement.ResolveUnreachable): New public method.
11636 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11637 (Block.Resolve): Resolve unreachable statements.
11639 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11641 * expression.cs: We need to fix the case where we do
11642 not have a temp variable here.
11644 * assign.cs: Only expression compound assignments need
11645 temporary variables.
11647 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11649 * flowanalysis.cs: Reduce memory allocation in a few ways:
11650 - A block with no variables should not allocate a bit
11652 - A method with no out parameters does not need any tracking
11653 for assignment of the parameters, so we need not allocate
11656 public readonly Type[] VariableTypes;
11657 public readonly string[] VariableNames;
11658 Are redundant. The data is already stored in the variable
11659 map, so we need not allocate another array for it.
11660 - We need to add alot of checks for if (params | locals) == null
11661 due to the first two changes.
11663 2004-01-18 Miguel de Icaza <miguel@ximian.com>
11665 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11666 implement IMemoryLocation, we store a copy on a local variable and
11667 take the address of it. Patch from Benjamin Jemlich
11669 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11670 to use a special "type_name_expression" rule which reduces the
11671 number of "QualifiedIdentifier" classes created, and instead
11672 directly creates MemberAccess expressions.
11674 2004-01-17 Miguel de Icaza <miguel@ximian.com>
11676 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11677 that fixes #52853. Null literal assignment to ValueType
11679 * class.cs (MethodData.Emit): Instead of checking the name of the
11680 method to determine if its a destructor, create a new derived
11681 class from Method called Destructor, and test for that.
11683 * cs-parser.jay: Create a Destructor object instead of a Method.
11685 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11689 2004-01-16 Miguel de Icaza <miguel@ximian.com>
11691 * expression.cs (Binary.ResolveOperator): Perform an implicit
11692 conversion from MethodGroups to their delegate types on the
11693 Addition operation.
11695 * delegate.cs: Introduce a new class DelegateCreation that is the
11696 base class for `NewDelegate' and `ImplicitDelegateCreation',
11697 factor some code in here.
11699 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11700 conversion from MethodGroups to compatible delegate types.
11702 * ecore.cs (Expression.Resolve): Do not flag error 654
11703 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11704 we allow conversions from MethodGroups to delegate types now.
11706 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11707 assignments in v2 either.
11709 2004-01-10 Miguel de Icaza <miguel@ximian.com>
11711 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11712 static read-only fields in ctors.
11714 Applied patch from Benjamin Jemlich
11716 * expression.cs (UnaryMutator): Avoid leaking local variables.
11718 2004-01-09 Miguel de Icaza <miguel@ximian.com>
11720 * cs-tokenizer.cs (IsCastToken): Allow the various native types
11721 here to return true, as they can be used like this:
11723 (XXX) int.MEMBER ()
11725 Fixed 49836 and all the other dups
11727 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
11729 * driver.cs: Implement /win32res and /win32icon.
11731 2004-01-08 Miguel de Icaza <miguel@ximian.com>
11733 * cs-parser.jay: Add a rule to improve error handling for the
11734 common mistake of placing modifiers after the type.
11736 2004-01-07 Miguel de Icaza <miguel@ximian.com>
11738 * cs-parser.jay (interface_event_declaration): Catch
11739 initialization of events on interfaces, and report cs0068
11741 * cs-parser.jay (interface_event_declaration): Catch
11742 initialization of events.
11744 * ecore.cs: Better report missing constructors.
11746 * expression.cs (Binary.ResolveOperator): My previous bug fix had
11747 the error reporting done in the wrong place. Fix.
11749 * expression.cs (Binary.ResolveOperator): Catch the
11750 operator + (E x, E y) error earlier, and later allow for implicit
11751 conversions in operator +/- (E e, U x) from U to the underlying
11754 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11755 52596, if the container class is abstract, the default constructor
11756 is protected otherwise its public (before, we were always public).
11758 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11761 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11762 Jemlich that fixes bug #52597, MCS was generating invalid code for
11763 idisposable structs. Thanks to Ben for following up with this
11766 2004-01-06 Miguel de Icaza <miguel@ximian.com>
11768 * driver.cs: Allow assemblies without code to be generated, fixes
11771 2004-01-07 Nick Drochak <ndrochak@gol.com>
11773 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11775 2004-01-05 Miguel de Icaza <miguel@ximian.com>
11777 * cs-parser.jay: Add rules to improve error reporting if fields or
11778 methods are declared at the namespace level (error 116)
11780 * Add rules to catch event add/remove
11782 2004-01-04 David Sheldon <dave-mono@earth.li>
11784 * expression.cs: Added matching ")" to error message for
11787 2004-01-03 Todd Berman <tberman@gentoo.org>
11789 * ecore.cs, attribute.cs:
11790 Applying fix from #52429.
11792 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11794 * ecore.cs, expression.cs, statement.cs:
11795 Total rewrite of how we handle branching. We
11796 now handle complex boolean expressions with fewer
11797 jumps. As well if (x == 0) no longer emits a ceq.
11799 if (x is Foo) is much faster now, because we generate
11802 Overall, we get a pretty big improvement on our benchmark
11803 tests. The code we generate is smaller and more readable.
11805 I did a full two-stage bootstrap. The patch was reviewed
11806 by Martin and Miguel.
11808 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11810 * cs-parser.jay: Make primary_expression not take a QI.
11811 we dont need this because the member_access rule covers
11812 us here. So we replace the rule with just IDENTIFIER.
11814 This has two good effects. First, we remove a s/r conflict.
11815 Second, we allocate many fewer QualifiedIdentifier objects.
11817 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11819 * attribute.cs: Handle MarshalAs attributes as pseudo, and
11820 set the correct information via SRE. This prevents
11821 hanging on the MS runtime. Fixes #29374.
11823 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11825 * convert.cs: correctly handle conversions to value types
11826 from Enum and ValueType as unboxing conversions.
11828 Fixes bug #52569. Patch by Benjamin Jemlich.
11830 2004-01-02 Ravi Pratap <ravi@ximian.com>
11832 * expression.cs (BetterConversion): Prefer int -> uint
11833 over int -> ulong (csc's behaviour). This fixed bug #52046.
11835 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
11837 * decl.cs (MemberCache.FindMembers): now returns a
11840 * typemanager.cs: In general, go with with ^^.
11841 (CopyNewMethods): take an IList.
11842 (RealMemberLookup): Only allocate an arraylist
11843 if we copy from two sets of methods.
11845 This change basically does two things:
11846 1) Fewer array lists allocated due to CopyNewMethods.
11847 2) the explicit cast in MemberList costed ALOT.
11849 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
11851 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11852 a hashtable to avoid needless string allocations when an identifier is
11853 used more than once (the common case).
11855 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11857 * pending.cs: MS's TypeBuilder.GetInterfaces ()
11858 is broken, it will not return anything. So, we
11859 have to use the information we have in mcs to
11862 * typemanager.cs: Add a cache for GetInterfaces,
11863 since this will now be used more often (due to ^^)
11865 (GetExplicitInterfaces) New method that gets the
11866 declared, not effective, interfaces on a type
11867 builder (eg, if you have interface IFoo, interface
11868 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11871 This patch makes MCS able to bootstrap itself on
11874 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11876 * expression.cs: Remove the Nop's that Miguel put
11879 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11881 * report.cs, codegen.cs: Give the real stack trace to
11882 the error when an exception is thrown.
11884 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11886 * decl.cs: only allocate hashtables for ifaces if
11889 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11891 * expression.cs: fix the error from cs0121-2.cs
11892 (a parent interface has two child interfaces that
11893 have a function with the same name and 0 params
11894 and the function is called through the parent).
11896 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
11898 * class.cs, rootcontext.cs, typmanager.cs: do not
11901 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
11903 * codegen.cs: remove stack for the ec flow branching.
11904 It is already a linked list, so no need.
11906 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
11908 * Makefile: Allow custom profiler here.
11910 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11912 * typemanager.cs (LookupType):
11913 - Use a static char [], because split takes
11914 a param array for args, so it was allocating
11916 - Do not store true in a hashtable, it boxes.
11918 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11920 * flowanalysis.cs: bytify common enums.
11922 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11924 * modifiers.cs: Add a new set of flags for the
11925 flags allowed on explicit interface impls.
11926 * cs-parser.jay: catch the use of modifiers in
11927 interfaces correctly.
11928 * class.cs: catch private void IFoo.Blah ().
11930 All related to bug #50572.
11932 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11934 * decl.cs: Rewrite the consistant accessability checking.
11935 Accessability is not linear, it must be implemented in
11936 a tableish way. Fixes #49704.
11938 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11940 * expression.cs: Handle negation in a checked context.
11941 We must use subtraction from zero. Fixes #38674.
11943 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11945 * class.cs: Ignore static void main in DLLs.
11946 * rootcontext.cs: Handle the target type here,
11947 since we are have to access it from class.cs
11948 * driver.cs: account for the above.
11950 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11952 * report.cs: Give line numbers and files if available.
11954 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
11956 * driver.cs: Implement /addmodule.
11958 * typemanager.cs: Change 'modules' field so it now contains Modules not
11961 2003-12-20 Martin Baulig <martin@ximian.com>
11963 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11964 (FieldBase.IsAssigned): Removed this field.
11965 (FieldBase.SetAssigned): New public method.
11966 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11968 2003-12-20 Martin Baulig <martin@ximian.com>
11970 * expression.cs (LocalVariableReference.DoResolve): Don't set
11971 `vi.Used' if we're called from DoResolveLValue().
11973 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11974 returns the usage vector it just merged into the current one -
11975 pass this one to UsageWarning().
11976 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11977 of the `EmitContext', don't call this recursively on our children.
11979 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
11981 * driver.cs: Implement /target:module.
11983 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
11985 * support.cs (CharArrayHashtable): New helper class.
11987 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
11988 char arrays, not strings, so we can avoid creating a string in
11989 consume_identifier if the identifier is a keyword.
11991 2003-12-16 Martin Baulig <martin@ximian.com>
11993 * statement.cs (LocalInfo.Assigned): Removed this property.
11994 (LocalInfo.Flags): Removed `Assigned'.
11995 (LocalInfo.IsAssigned): New public method; takes the EmitContext
11996 and uses flow analysis.
11997 (Block.UsageWarning): Made this method private.
11998 (Block.Resolve): Call UsageWarning() if appropriate.
12000 * expression.cs (LocalVariableReference.DoResolve): Always set
12001 LocalInfo.Used here.
12003 2003-12-13 Martin Baulig <martin@ximian.com>
12005 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12006 any value here; we're now using flow analysis to figure out
12007 whether a statement/block returns a value.
12009 2003-12-13 Martin Baulig <martin@ximian.com>
12011 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12013 (FlowBranching.MergeFinally): Don't call
12014 `branching.CheckOutParameters()' here, this is called in
12016 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12017 when adding the `finally' vector.
12019 2003-12-13 Martin Baulig <martin@ximian.com>
12022 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12023 actually work and also fix #48962.
12025 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
12027 * decl.cs: Do not check System.Object for nested types,
12028 since we know it does not have any. Big bang for buck:
12031 Run 1: 8.35 seconds
12032 Run 2: 8.32 seconds
12033 corlib: 17.99 seconds
12035 Run 1: 8.17 seconds
12036 Run 2: 8.17 seconds
12037 corlib: 17.39 seconds
12039 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
12041 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12042 time we are returning 0 members, so we save alot here.
12044 2003-12-11 Martin Baulig <martin@ximian.com>
12046 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12047 `MergeChild()', also just take the `FlowBranching' as argument;
12048 call Merge() on it and return the result.
12049 (FlowBranching.Merge): We don't need to do anything if we just
12052 2003-12-11 Martin Baulig <martin@ximian.com>
12054 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12055 them in an `ArrayList' to reduce memory usage. Thanks to Ben
12056 Maurer for this idea.
12058 2003-12-11 Martin Baulig <martin@ximian.com>
12060 * flowanalysis.cs (MergeResult): This class is now gone; we now
12061 use the `UsageVector' for this. The reason for this is that if a
12062 branching just has one sibling, we don't need to "merge" them at
12063 all - that's the next step to do.
12064 (FlowBranching.Merge): We now return a `UsageVector' instead of a
12067 2003-12-11 Martin Baulig <martin@ximian.com>
12069 Reworked flow analyis and made it more precise and bug-free. The
12070 most important change is that we're now using a special `Reachability'
12071 class instead of having "magic" meanings of `FlowReturns'. I'll
12072 do some more cleanups and optimizations and also add some more
12073 documentation this week.
12075 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12076 largely reworked this class.
12077 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12078 the new `Reachability' class instead of having "magic" values here.
12079 (FlowBranching): We're now using an instance of `Reachability'
12080 instead of having separate `Returns', `Breaks' etc. fields.
12082 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12083 based on flow analysis; ignore the return value of block.Emit ().
12085 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
12087 * driver.cs typemanager.cs: Find the mono extensions to corlib even
12088 if they are private.
12090 2003-12-09 Martin Baulig <martin@ximian.com>
12092 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12093 call them directly on the UsageVector.
12095 2003-12-09 Martin Baulig <martin@ximian.com>
12097 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12098 Changed return type from `FlowReturns' to `Reachability'.
12100 2003-12-09 Martin Baulig <martin@ximian.com>
12102 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12103 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12104 `Reachable' fields with a single `Reachability' one.
12106 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12108 * class.cs (FindMembers): Remove foreach's.
12113 Run 1: 8.74 seconds
12114 Run 2: 8.71 seconds
12117 Run 1: 8.64 seconds
12118 Run 2: 8.58 seconds
12121 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12126 This patch does a few things:
12127 1. EmptyStatement is now a singleton, so it is never reallocated.
12128 2. All blah is EmptyStatement constructs have been changed to
12129 blah == EmptyStatement.Value, which is much faster and valid
12130 now that EmptyStatement is a singleton.
12131 3. When resolving a block, rather than allocating a new array for
12132 the non-empty statements, empty statements are replaced with
12133 EmptyStatement.Value
12134 4. Some recursive functions have been made non-recursive.
12135 Mainly the performance impact is from (3), however (1) and (2) are needed for
12136 this to work. (4) does not make a big difference in normal situations, however
12137 it makes the profile look saner.
12142 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12143 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12144 Total memory allocated: 56397 KB
12147 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12148 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12149 Total memory allocated: 55666 KB
12151 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12153 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12154 than the hashtable in a hashtable version
12156 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12157 we always end up concating a string. This results in a huge perf
12158 loss, because many strings have to be tracked by the GC. In this
12159 patch, we first use a hashtable that works with two keys, so that
12160 the strings do not need to be concat'ed.
12164 Run 1: 8.74 seconds
12165 Run 2: 8.71 seconds
12168 Run 1: 8.65 seconds
12169 Run 2: 8.56 seconds
12171 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12173 * Makefile: Add a new target `do-time' that does a quick and simple
12174 profile, leaving easy to parse output.
12176 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
12178 * codegen.cs (Init): Create the dynamic assembly with
12179 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12181 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
12183 * support.cs: Make the PtrHashtable use only one
12184 instance of its comparer.
12186 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
12188 * typemanager.cs: Fix lookup of GetNamespaces.
12190 2003-11-29 Miguel de Icaza <miguel@ximian.com>
12192 * expression.cs: Removed redundant line.
12194 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12195 ArrayLists, use for loops with bounds.
12197 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12200 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12201 arraylists, use for loop with bounds.
12203 The above three changes give us a 0.071 second performance
12204 improvement out of 3.294 seconds down to 3.223. On my machine
12205 the above changes reduced the memory usage by 1,387 KB during
12206 compiler bootstrap.
12208 * cs-parser.jay (QualifiedIdentifier): New class used to represent
12209 QualifiedIdentifiers. Before we created a new string through
12210 concatenation, and mostly later on, the result would be
12211 manipulated by DecomposeQI through string manipulation.
12213 This reduced the compiler memory usage for bootstrapping from
12214 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12215 compile times in 0.05 seconds.
12217 2003-11-28 Dick Porter <dick@ximian.com>
12219 * support.cs: Do string compares with the Invariant culture.
12227 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12228 the comparison is done with the Invariant culture.
12230 2003-11-27 Miguel de Icaza <miguel@ximian.com>
12232 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12233 GetEnumerator method.
12235 (ProbeCollectionType): Iterate starting at the most specific type
12236 upwards looking for a GetEnumerator
12238 * expression.cs: Shift count can be up to 31 for int/uint and 63
12241 2003-11-26 Miguel de Icaza <miguel@ximian.com>
12243 * statement.cs (Block.LookupLabel): Also look for the label on the
12244 children blocks. Use a hash table to keep track of visited
12247 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12248 we actually did transform the other operand, otherwise fall back
12249 to the common codepath that casts to long.
12251 * cs-tokenizer.cs: Use the same code pattern as the int case.
12252 Maybe I should do the parsing myself, and avoid depending on the
12253 Parse routines to get this done.
12255 2003-11-25 Miguel de Icaza <miguel@ximian.com>
12257 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12258 which fixes bug 51347. This time test it.
12260 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12261 attributes for example can not tell the difference between these.
12262 The difference was only a syntax feature of the language.
12264 * attribute.cs: Apply attributes to delegates.
12266 * delegate.cs: Call the apply attributes method.
12268 2003-11-24 Miguel de Icaza <miguel@ximian.com>
12270 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12271 comparing 0 vs Byte.MinValue, not the value
12273 (ImplicitConversionRequired): When reporting a conversion error,
12274 use error 31 to print out the constant error instead of the
12277 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12278 which fixes bug 51347.
12280 2003-11-22 Miguel de Icaza <miguel@ximian.com>
12282 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
12283 which fixes the -warnaserror command line option.
12285 2003-11-21 Miguel de Icaza <miguel@ximian.com>
12287 * cfold.cs (DoNumericPromotions): During constant folding of
12288 additions on UIntConstant, special case intconstants with
12289 IntConstants like we do on the expression binary operator.
12291 2003-11-12 Miguel de Icaza <miguel@ximian.com>
12293 * convert.cs (ImplicitReferenceConversion): We were missing a case
12294 (System.Enum are not value types or class types, so we need to
12295 classify them separatedly).
12297 * driver.cs: We do not support error 2007.
12299 2003-11-12 Jackson Harper <jackson@ximian.com>
12301 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12302 system directory. Also use the full file name so users can
12303 libraries names mscorlib-o-tron.dll in a non system dir.
12305 2003-11-10 Martin Baulig <martin@ximian.com>
12307 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12308 (TypeManager.InitCoreTypes): Initialize them here, but instead of
12309 calling `ResolveType()' on them, directly assign their `Type'.
12311 2003-11-08 Martin Baulig <martin@ximian.com>
12313 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12314 return value and the `out parent' parameter.
12315 (TypeContainer.DefineType): Moved the CS0644 check into
12316 GetClassBases(). Don't pass the interface types to the
12317 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12318 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12320 * ecore.cs (TypeExpr.IsAttribute): New property.
12321 (TypeExpr.GetInterfaces): New method.
12323 * interface.cs (Interface.GetInterfaceTypeByName): Return a
12324 TypeExpr instead of a Type.
12325 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12326 (Interface.DefineType): Don't pass the interface types to the
12327 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12328 them later and then call `TypeBulider.AddInterfaceImplementation()'.
12330 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12331 instead of a `Type[]'.
12332 (TypeManager.RegisterBuilder): Likewise.
12333 (TypeManager.AddUserInterface): Likewise.
12334 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12335 `Type[]' and also return a `TypeExpr[]'.
12336 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12338 2003-11-08 Martin Baulig <martin@ximian.com>
12340 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12343 2003-11-08 Martin Baulig <martin@ximian.com>
12345 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12346 TypeManager.ResolveExpressionTypes().
12348 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12349 instead of an Expression.
12350 (TypeExpr): This is now an abstract base class for `TypeExpression'.
12351 (TypeExpression): New public class; formerly known as `TypeExpr'.
12353 * expression.cs (ComposedCast): Derive from TypeExpr.
12355 * typemanager.cs (TypeManager.system_*_expr): These are now
12356 TypExpr's instead of Expression's.
12357 (TypeManager.ResolveExpressionTypes): New public static function;
12358 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12361 2003-11-06 Miguel de Icaza <miguel@ximian.com>
12363 * expression.cs (New.DoResolve): Do not dereference value that
12364 might be a null return.
12366 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12367 sure that the constant value has the right type. Fixes an
12368 unreported bug, similar to 50425.
12370 * const.cs (Const.LookupConstantValue): Call
12371 ImplicitStandardConversionExists before doing a conversion to
12372 avoid havng the TypeManager.ChangeType do conversions.
12374 Reduced the number of casts used
12376 (Const.ChangeType): New routine to enable reuse of the constant
12377 type changing code from statement.
12379 * typemanager.cs (ChangeType): Move common initialization to
12380 static global variables.
12384 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12385 every value type to go through, even if it was void. Fix that.
12387 * cs-tokenizer.cs: Use is_identifier_start_character on the start
12388 character of the define, and the is_identifier_part_character for
12389 the rest of the string.
12391 2003-11-05 Miguel de Icaza <miguel@ximian.com>
12393 * expression.cs (UnaryMutator.EmitCode): When I updated
12394 LocalVariableReference.DoResolve, I overdid it, and dropped an
12395 optimization done on local variable references.
12397 2003-11-04 Miguel de Icaza <miguel@ximian.com>
12399 * ecore.cs: Convert the return from Ldlen into an int.
12401 2003-10-20 Miguel de Icaza <miguel@ximian.com>
12403 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12404 the accessibility, this is a special case for toplevel non-public
12405 classes (internal for instance).
12407 2003-10-20 Nick Drochak <ndrochak@gol.com>
12409 * ecore.cs: Fix typo and build. Needed another right paren.
12411 2003-10-19 Miguel de Icaza <miguel@ximian.com>
12413 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
12414 `internal' case regular and protected, but not allowing protected
12415 to be evaluated later. Bug 49840
12417 2003-10-15 Miguel de Icaza <miguel@ximian.com>
12419 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12420 to kb.Nlast, and not the kb.nFirst to isolate the switch
12423 Extract the underlying type, so enumerations of long/ulong are
12424 treated like long/ulong.
12426 2003-10-14 Miguel de Icaza <miguel@ximian.com>
12428 * expression.cs (New): Overload the meaning of RequestedType to
12429 track the possible creation of the NewDelegate type, since
12430 DoResolve is invoked more than once for new constructors on field
12433 See bugs: #48800 and #37014
12435 * cs-parser.jay (declare_local_constants): Take an arraylist
12436 instead of a single constant.
12438 (local_constant_declaration): It should take a
12439 constant_declarators, not a constant_declarator. Fixes 49487
12441 * convert.cs: Fix error report.
12443 2003-10-13 Jackson Harper <jackson@ximian.com>
12445 * typemanager.cs (TypeToCoreType): Add float and double this fixes
12448 2003-10-09 Martin Baulig <martin@ximian.com>
12450 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12452 (MethodCore.DoDefineParameters): Removed the TypeContainer
12453 argument; use the DeclSpace which was passed to the .ctor instead.
12454 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12455 TypeContainer; we only need a DeclSpace here.
12457 2003-10-09 Martin Baulig <martin@ximian.com>
12459 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12461 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12462 EmitContext's .ctor.
12464 2003-10-09 Martin Baulig <martin@ximian.com>
12466 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12467 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12468 AsAccessible(), moved them as well.
12470 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12472 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12474 * cs-parser.jay : Renamed yyName to yyNames related to jay.
12476 2003-10-07 Miguel de Icaza <miguel@ximian.com>
12478 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12479 generation for >=, as spotted by Paolo, bug 48679.
12480 Patch from David Waite.
12482 * cs-tokenizer.cs: Add handling for #pragma.
12484 * cs-parser.jay: Allow for both yield and yield return in the
12485 syntax. The anti-cobolization of C# fight will go on!
12487 * class.cs (TypeBuilder.DefineType): Catch error condition here
12488 (Parent.DefineType erroring out and returning null).
12490 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12491 coping with enumerations variables, we were mistakenly processing
12492 them as a regular value type instead of built-in types. Fixes the
12495 * typemanager.cs (IsBuiltinOrEnum): New method.
12497 2003-09-30 Miguel de Icaza <miguel@ximian.com>
12499 * cs-parser.jay: Upgrade: yield now needs the return clause.
12501 2003-09-19 Martin Baulig <martin@ximian.com>
12503 * decl.cs (MemberCache.SetupCacheForInterface): Take a
12504 `MemberCache parent' argument. Normally, an interface doesn't
12505 have a parent type except System.Object, but we use this in gmcs
12506 for generic type parameters.
12508 2003-09-18 Martin Baulig <martin@ximian.com>
12510 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12511 on `type.IsInterface'; don't check whether the type has a parent
12512 to determine whether it's an interface.
12514 2003-09-15 Martin Baulig <martin@ximian.com>
12516 * class.cs (TypeContainer.DefineType): Added an error flag to
12517 avoid reporting duplicate CS0146's ("class definition is
12520 * driver.cs (Driver.MainDriver): Abort if
12521 RootContext.ResolveTree() reported any errors.
12523 2003-09-07 Martin Baulig <martin@ximian.com>
12525 * report.cs (Error, Warning): Added overloaded versions which take
12526 a `params object[] args' and call String.Format().
12528 2003-09-07 Martin Baulig <martin@ximian.com>
12530 * decl.cs (DeclSpace..ctor): Don't call
12531 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12532 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
12533 (DeclSpace.RecordDecl): New method.
12535 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12537 2003-09-02 Ravi Pratap <ravi@ximian.com>
12539 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12540 value attributes to be applied to ParameterBuilders.
12542 * class.cs (MethodCore.LabelParameters): Make static and more
12543 generic so that it can be used from other places - like interface
12544 methods, for instance.
12546 * interface.cs (Interface.Emit): Call LabelParameters before
12547 emitting attributes on the InterfaceMethod.
12549 2003-08-26 Martin Baulig <martin@ximian.com>
12551 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12552 resolving aliases; fixes #47927.
12554 2003-08-26 Martin Baulig <martin@ximian.com>
12556 * statement.cs (Using.DoResolve): This is internally emitting a
12557 try/finally clause, so we need to set ec.NeedExplicitReturn if we
12558 do not always return. Fixes #47681.
12560 2003-08-26 Martin Baulig <martin@ximian.com>
12562 * decl.cs (MemberCore): Moved WarningNotHiding(),
12563 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12565 (AdditionResult): Make this nested in DeclSpace.
12566 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12567 argument; call NamespaceEntry.Define() unless we're nested in a
12570 * namespace.cs (Namespace.DefineName): New public function. This
12571 is called from DeclSpace's .ctor to add
12572 (Namespace.Lookup): Include DeclSpaces in the lookup.
12574 * class.cs (Operator): Derive from MemberBase, not MemberCore.
12576 * const.cs (Const): Derive from MemberBase, not MemberCore.
12578 2003-08-25 Martin Baulig <martin@ximian.com>
12580 * convert.cs (Convert.ExplicitReferenceConversion): When
12581 converting from an interface type to a class, unbox if the target
12582 type is a struct type. Fixes #47822.
12584 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12586 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12589 2003-08-22 Martin Baulig <martin@ximian.com>
12591 * class.cs (TypeManager.DefineType): When defining a nested type,
12592 call DefineType() on our parent; fixes #47801.
12594 2003-08-22 Martin Baulig <martin@ximian.com>
12596 * class.cs (MethodData.Define): While checking if a method is an
12597 interface implementation, improve the test a bit more to fix #47654.
12599 2003-08-22 Martin Baulig <martin@ximian.com>
12601 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12602 correctly; fixes #47722.
12604 2003-08-22 Martin Baulig <martin@ximian.com>
12606 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12607 LocalVariableReference, ensure it's not read-only. Fixes #47536.
12609 * statement.cs (Fixed.DoResolve): Make all variables read-only.
12611 2003-08-22 Martin Baulig <martin@ximian.com>
12613 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12614 can only be assigned in static constructors. Fixes #47161.
12616 2003-08-22 Martin Baulig <martin@ximian.com>
12618 Rewrote and improved the flow analysis code.
12620 * flowbranching.cs (FlowBranching): Make this class abstract.
12621 (FlowBranching.CreateBranching): New static function to create a
12622 new flow branching.
12623 (FlowBranchingBlock, FlowBranchingException): New classes.
12624 (FlowBranching.UsageVector.Type): New public readonly field.
12625 (FlowBranching.UsageVector.Breaks): Removed the setter.
12626 (FlowBranching.UsageVector.Returns): Removed the setter.
12627 (FlowBranching.UsageVector): Added Break(), Return(),
12628 NeverReachable() and Throw() methods to modify the reachability.
12629 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12630 done by FlowBranching.Merge().
12631 (FlowBranching.UsageVector.MergeChild): New method; merges the
12632 merge result into the current vector.
12633 (FlowBranching.Merge): New abstract method to merge a branching.
12635 2003-08-12 Martin Baulig <martin@ximian.com>
12637 * expression.cs (Indirection.CacheTemporaries): Create the
12638 LocalTemporary with the pointer type, not its element type.
12640 2003-08-10 Miguel de Icaza <miguel@ximian.com>
12642 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12643 token was a keyword or not.
12645 Add `error' options where an IDENTIFIER was expected; Provide
12646 CheckToken and CheckIdentifierToken convenience error reporting
12649 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12651 * decl.cs: Rename `NamespaceEntry Namespace' public field into
12652 NameSpaceEntry NameSpaceEntry.
12654 (LookupInterfaceOrClass): Avoid creating a full qualified name
12655 from namespace and name: avoid doing lookups when we know the
12656 namespace is non-existant. Use new Tree.LookupByNamespace which
12657 looks up DeclSpaces based on their namespace, name pair.
12659 * driver.cs: Provide a new `parser verbose' to display the
12660 exception thrown during parsing. This is turned off by default
12661 now, so the output of a failure from mcs is more graceful.
12663 * namespace.cs: Track all the namespaces defined in a hashtable
12666 (IsNamespace): New method
12668 2003-08-09 Miguel de Icaza <miguel@ximian.com>
12670 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
12671 we know that we need to concatenate (full typename can never be
12676 * statement.cs: Use a bitfield; Do not initialize to null things
12677 which are done by the constructor by default.
12679 * cs-parser.jay: bug fix, parameter was 4, not 3.
12681 * expression.cs: Just use the property;
12683 * statement.cs: No need for GetVariableInfo method.
12685 2003-08-08 Martin Baulig <martin@ximian.com>
12687 * flowanalysis.cs (FlowReturns): This is now nested in the
12688 `FlowBranching' class.
12689 (MyBitVector): Moved this here from statement.cs.
12690 (FlowBranching.SiblingType): New enum type.
12691 (FlowBranching.CreateSibling): Added `SiblingType' argument.
12693 2003-08-07 Martin Baulig <martin@ximian.com>
12695 * flowanalysis.cs (FlowBranchingType): This is now nested in the
12696 `FlowBranching' class and called `BranchingType'.
12698 2003-08-07 Martin Baulig <martin@ximian.com>
12700 * flowanalysis.cs: Moved all the control flow analysis code into
12703 2003-08-07 Martin Baulig <martin@ximian.com>
12705 * assign.cs (Assign.DoResolve): `target' must either be an
12706 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
12709 2003-08-07 Miguel de Icaza <miguel@ximian.com>
12711 * expression.cs (BinaryMethod): This kind of expression is created by the
12712 Binary class if it determines that the operator has to be handled
12715 (BinaryDelegate): This kind of expression is created if we are
12716 dealing with a + or - operator on delegates.
12718 (Binary): remove method, argumetns, and DelegateOperator: when
12719 dealing with methods,
12721 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12723 * statement.cs (Block): use bitfields for the three extra booleans
12724 we had in use. Remove unused topblock parameter.
12726 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12728 * assign.cs: Drop extra unneeded tests.
12730 2003-08-06 Miguel de Icaza <miguel@ximian.com>
12732 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12734 * statement.cs (Foreach): Use VariableStorage instead of
12737 * codegen.cs (VariableStorage): New class used by clients that
12738 require a variable stored: locals or fields for variables that
12739 need to live across yield.
12741 Maybe provide a convenience api for EmitThis+EmitLoad?
12743 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12746 2003-08-05 Miguel de Icaza <miguel@ximian.com>
12748 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12749 RemapParameterLValue): New methods that are used to turn a
12750 precomputed FieldInfo into an expression like this:
12754 The idea is to use this instead of making LocalVariableReference
12755 have more than one meaning.
12757 * cs-parser.jay: Add error production to BASE.
12759 * ecore.cs: Deal with TypeManager.GetField returning null, which
12760 is now a valid return value.
12762 (FieldExprNoAddress): New expression for Fields whose address can
12765 * expression.cs (LocalVariableReference): During the resolve
12766 phases, create new expressions if we are in a remapping context.
12767 Remove code that dealt with remapping here.
12769 (ParameterReference): same.
12771 (ProxyInstance): New expression, like the `This' expression, but
12772 it is born fully resolved. We know what we are doing, so remove
12773 the errors that are targeted to user-provided uses of `this'.
12775 * statement.cs (Foreach): our variable is now stored as an
12776 Expression; During resolution, follow the protocol, dont just
12777 assume it will return this.
12779 2003-08-06 Martin Baulig <martin@ximian.com>
12781 * support.cs (SeekableStreamReader.cs): New public class.
12783 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12784 SeekableStreamReader instead of the normal StreamReader.
12786 2003-08-04 Martin Baulig <martin@ximian.com>
12788 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12789 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12790 deambiguate casts and delegate invocations.
12791 (parenthesized_expression): Use the new tokens to ensure this is
12792 not a cast of method invocation.
12794 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12795 when reading a `)' and Deambiguate_CloseParens () was previously
12798 * expression.cs (ParenthesizedExpression): New class. This is
12799 just used for the CS0075 test.
12800 (Binary.DoResolve): Check for CS0075.
12802 2003-07-29 Ravi Pratap <ravi@ximian.com>
12804 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12805 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12806 reference comparison.
12808 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12809 examine the ReturnType for equality - this is necessary in the
12810 cases of implicit and explicit operators whose signature also
12811 includes the return type.
12813 2003-07-26 Miguel de Icaza <miguel@ximian.com>
12815 * namespace.cs: Cache the result of the namespace computation,
12816 instead of computing it every time.
12818 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12820 * decl.cs: Use a global arraylist that we reuse over invocations
12821 to avoid excesive memory consumption. Reduces memory usage on an
12822 mcs compile by one meg (45 average).
12824 * typemanager.cs (LookupTypeReflection): In .NET pointers are
12825 private, work around that.
12827 2003-07-23 Miguel de Icaza <miguel@ximian.com>
12829 * literal.cs (IntLiteral): Define Zero and One static literals.
12831 * cs-parser.jay (integer_literal): use static literals to reduce
12832 memory usage for the most used literals (0, 1 and -1). 211kb
12833 reduced in memory usage.
12835 Replace all calls to `new ArrayList' with `new
12836 ArrayList(4)' which is a good average number for most allocations,
12837 and also requires only 16 bytes of memory for its buffer by
12840 This reduced MCS memory usage in seven megabytes for the RSS after
12843 2003-07-28 Ravi Pratap <ravi@ximian.com>
12845 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12846 handle params methods the correct way by forming only one
12847 applicable set with params and normal methods in them. Earlier we
12848 were looking at params methods only if we found no normal methods
12849 which was not the correct thing to do.
12851 (Invocation.BetterFunction): Take separate arguments indicating
12852 when candidate and the best method are params methods in their
12855 This fixes bugs #43367 and #46199.
12857 * attribute.cs: Documentation updates.
12859 (CheckAttribute): Rename to CheckAttributeTarget.
12860 (GetValidPlaces): Rename to GetValidTargets.
12862 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12863 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12867 2003-07-28 Martin Baulig <martin@ximian.com>
12869 * class.cs (TypeContainer.DefineMembers): Use the base type's full
12870 name when looking up the base class of a nested class. Fixes #46977.
12872 2003-07-26 Martin Baulig <martin@ximian.com>
12874 * expression.cs (Indexers.Indexer): New nested struct; contains
12875 getter, setter and the indexer's type.
12876 (Indexers.Properties): This is now an ArrayList of
12877 Indexers.Indexer's.
12878 (IndexerAccess.DoResolveLValue): Correctly set the type if the
12879 indexer doesn't have any getters.
12881 * assign.cs (Assign.DoResolve): Also do the implicit conversions
12882 for embedded property and indexer assignments.
12884 2003-07-26 Martin Baulig <martin@ximian.com>
12886 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
12887 preprocessor directive is not the first non-whitespace character
12890 2003-07-26 Martin Baulig <martin@ximian.com>
12892 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
12893 namespace parsing, follow the spec more closely.
12895 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
12896 NamespaceEntry.Lookup().
12898 2003-07-25 Martin Baulig <martin@ximian.com>
12900 * MethodCore.cs (OverridesSomething): New public field; it's set
12901 from TypeContainer.DefineMembers if this method overrides
12902 something (which doesn't need to be a method). Fix #39462.
12904 2003-07-25 Ravi Pratap <ravi@ximian.com>
12906 * typemanager.cs (GetMembers): Ensure that the list of members is
12907 reversed. This keeps things in sync.
12909 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
12910 find an AttributeUsage attribute.
12912 * expression.cs (Invocation.OverloadResolve): Perform the check
12913 which disallows Invoke to be directly called on a Delegate.
12915 (Error_InvokeOnDelegate): Report error cs1533.
12917 2003-07-25 Martin Baulig <martin@ximian.com>
12919 * expression.cs (Indexers.GetIndexersForType): Only look in the
12920 interface hierarchy if the requested type is already an
12921 interface. Fixes #46788 while keeping #46502 fixed.
12923 2003-07-25 Martin Baulig <martin@ximian.com>
12925 * class.cs (TypeContainer.DefineMembers): Check whether all
12926 readonly fields have been assigned and report warning CS0649 if
12929 * statement.cs (LocalInfo.IsFixed): Always return true if this is
12932 2003-07-24 Ravi Pratap <ravi@ximian.com>
12934 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
12935 returned from GetMethods to make things consistent with the
12936 assumptions MCS makes about ordering of methods.
12938 This should comprehensively fix bug #45127 and it does :-)
12940 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
12941 ordering is actually reverse.
12943 * Clean up some debug messages I left lying around.
12945 * interface.cs (Populate*): Get rid of code which emits attributes
12946 since the stage in which we emit attributes is the 'Emit' stage,
12947 not the define stage.
12949 (Emit): Move attribute emission for interface members here.
12951 2003-07-22 Ravi Pratap <ravi@ximian.com>
12953 * expression.cs (Invocation.OverloadResolve): Follow the spec more
12954 closely: we eliminate methods in base types when we have an
12955 applicable method in a top-level type.
12957 Please see section 14.5.5.1 for an exact description of what goes
12960 This fixes bug #45127 and a host of other related to corlib compilation.
12962 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12963 array is the method corresponding to the top-level type (this is
12964 because of the changes made to icall.c) so we change this
12967 (MethodGroupExpr.Name): This too.
12969 * typemanager.cs (GetElementType): New method which does the right
12970 thing when compiling corlib.
12972 * everywhere: Make use of the above in the relevant places.
12974 2003-07-22 Martin Baulig <martin@ximian.com>
12976 * cs-parser.jay (invocation_expression): Moved
12977 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12978 `cast_expression', but create a InvocationOrCast which later
12979 resolves to either an Invocation or a Cast.
12981 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12982 method; call this before EmitStatement() to make sure that this
12983 expression can be used as a statement.
12985 * expression.cs (InvocationOrCast): New class; resolves to either
12986 an Invocation or a Cast.
12988 * statement.cs (StatementExpression): Call ResolveStatement() on
12989 the ExpressionStatement before emitting it.
12991 2003-07-21 Martin Baulig <martin@ximian.com>
12993 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12994 `ref' and `out' attributes match; fixes #46220.
12995 (MemberAccess.ResolveMemberAccess): You can't reference a type
12996 through an expression; fixes #33180.
12997 (Indexers.GetIndexersForType): Don't return the indexers from
12998 interfaces the class implements; fixes #46502.
13000 2003-07-21 Martin Baulig <martin@ximian.com>
13002 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13003 CS0661 checks; fixes bug #30442.
13005 2003-07-21 Martin Baulig <martin@ximian.com>
13007 * decl.cs (AdditionResult): Added `Error'.
13009 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13011 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
13012 makes cs0031.cs actually work.
13014 2003-07-20 Martin Baulig <martin@ximian.com>
13016 * namespace.cs: Fixed that bug which caused a crash when compiling
13017 the debugger's GUI.
13019 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13021 * typemanager.cs (LookupTypeReflection): Never expose types which
13022 are NotPublic, NestedPrivate, NestedAssembly, or
13023 NestedFamANDAssem. We used to return these, and later do a check
13024 that would report a meaningful error, but the problem is that we
13025 would not get the real match, if there was a name override.
13027 2003-07-18 Miguel de Icaza <miguel@ximian.com>
13029 * namespace.cs (Namespace, Name): Do not compute the namespace
13030 name dynamically, compute it in the constructor. This reduced
13031 memory usage by 1697 KB.
13033 * driver.cs: Use --pause to pause at the end.
13035 2003-07-17 Peter Williams <peter@newton.cx>
13037 * Makefile: Change the name of the test target so that it doesn't
13038 conflict with the recursive test target.
13040 2003-07-17 Miguel de Icaza <miguel@ximian.com>
13042 * expression.cs (LocalVariableReference.Emit, EmitAssign,
13043 AddressOf): Do not use EmitThis, that was wrong, use the actual
13046 2003-07-15 Miguel de Icaza <miguel@ximian.com>
13048 * class.cs (MethodData.Define): While checking if a method is an
13049 interface implementation, improve the test: If we are not public
13050 (use new test here: use the computed MethodAttributes directly,
13051 instead of the parsed modifier flags) check if the `implementing'
13052 method comes from an interface or not.
13054 * pending.cs (VerifyPendingMethods): Slightly better error
13057 * makefile: add test target that does the mcs bootstrap.
13059 2003-07-16 Ravi Pratap <ravi@ximian.com>
13061 * interface.cs (Define): Do nothing here since there are no
13062 members to populate etc. Move the attribute emission out of here
13063 since this was just totally the wrong place to put it. Attribute
13064 application happens during the 'Emit' phase, not in the 'Define'
13067 (Emit): Add this method and move the attribute emission here
13069 * rootcontext.cs (EmitCode): Call the Emit method on interface
13072 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13074 * expression.cs (OverloadResolve): Report error only if Location
13075 is not 'Null' which means that there was a probe going on.
13077 2003-07-14 Martin Baulig <martin@ximian.com>
13079 * expression.cs (ConditionalLogicalOperator): New public class to
13080 implement user defined conditional logical operators.
13081 This is section 14.11.2 in the spec and bug #40505.
13083 2003-07-14 Martin Baulig <martin@ximian.com>
13085 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13087 2003-07-14 Martin Baulig <martin@ximian.com>
13089 * codegen.cs (EmitContext.InFixedInitializer): New public field.
13091 * ecore.cs (IVariable.VerifyFixed): New interface method.
13093 * expression.cs (Unary.ResolveOperator): When resolving the `&'
13094 operator, check whether the variable is actually fixed. Fixes bug
13095 #36055. Set a variable definitely assigned when taking its
13096 address as required by the spec.
13098 * statement.cs (LocalInfo.IsFixed): New field.
13099 (LocalInfo.MakePinned): Set `IsFixed' to true.
13101 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13103 * attribute.cs (Attribute.Resolve): While doing a Member lookup
13104 for .ctors, ensure that we only ask for members declared in the
13105 attribute type (BindingFlags.DeclaredOnly).
13109 * expression.cs (Error_WrongNumArguments): Report error 1501
13110 correctly the way CSC does.
13112 2003-07-13 Martin Baulig <martin@ximian.com>
13114 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13115 lookup on the fully qualified name, to make things like "X.X" work
13116 where "X.X" is a fully qualified type name, but we also have a
13117 namespace "X" in the using list. Fixes #41975.
13119 2003-07-13 Martin Baulig <martin@ximian.com>
13121 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13122 function. If we're a CompoundAssign, we need to create an embedded
13123 CompoundAssign, not an embedded Assign.
13124 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13127 2003-07-13 Martin Baulig <martin@ximian.com>
13129 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13130 work to fix bug #46088.
13132 2003-07-13 Ravi Pratap <ravi@ximian.com>
13134 * class.cs (Operator.Emit): Do not emit attributes here - it is
13135 taken care of by the Method class that we delegate too. This takes
13136 care of bug #45876.
13138 2003-07-10 Martin Baulig <martin@ximian.com>
13140 * expression.cs (TypeOfVoid): New class.
13141 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
13143 2003-07-10 Martin Baulig <martin@ximian.com>
13145 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13148 2003-07-10 Martin Baulig <martin@ximian.com>
13150 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13151 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13153 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13155 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13157 2003-07-10 Martin Baulig <martin@ximian.com>
13159 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13160 of decimal. Fixes #42850.
13162 NOTE: I also fixed the created byte blob, but this doesn't work on
13163 the MS runtime and csc never produces any byte blobs for decimal
13166 2003-07-10 Martin Baulig <martin@ximian.com>
13168 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13169 structs; fixes #32068.
13170 (Block.AddChildVariableNames): Fixed #44302.
13172 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13174 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13176 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13178 * attribute.cs: And this test is onger needed.
13180 2003-07-08 Martin Baulig <martin@ximian.com>
13182 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13183 inaccessible types. Fixes #36313.
13185 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13187 * namespace.cs (NamespaceEntry): Create implicit entries for all
13188 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13189 implicit entries for N1.N2 and N1.
13191 2003-07-08 Martin Baulig <martin@ximian.com>
13193 Rewrote the handling of namespaces to fix a lot of the issues
13194 wrt. `using' aliases etc.
13196 * namespace.cs (Namespace): Splitted this class into a
13197 per-assembly `Namespace' and a per-file `NamespaceEntry'.
13199 * typemanager.cs (TypeManager.IsNamespace): Removed.
13200 (TypeManager.ComputeNamespaces): Only compute namespaces from
13201 loaded assemblies here, not the namespaces from the assembly we're
13202 currently compiling.
13204 2003-07-08 Martin Baulig <martin@ximian.com>
13206 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13208 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13210 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13213 I thought about the memory savings here, but LookupTypeReflection
13214 is used under already very constrained scenarios. Compiling
13215 corlib or mcs only exposes one hit, so it would not really reduce
13216 any memory consumption.
13218 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13220 * typemanager.cs: fixes bug #45889 by only adding public types from
13221 other assemblies to the list of known types.
13223 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13225 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13226 on the type we resolved.
13228 2003-07-05 Martin Baulig <martin@ximian.com>
13230 * pending.cs (PendingImplementation.ParentImplements): Don't
13231 create the proxy if the parent is abstract.
13233 * class.cs (TypeContainer.DefineIndexers): Process explicit
13234 interface implementations first. Fixes #37714.
13236 2003-07-04 Miguel de Icaza <miguel@ximian.com>
13238 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13239 defined recursively; but since we modify the input parameters
13240 (left is set to `this' temporarily), we reset this value if the
13241 left_is_explicit is false, which gives the original semantics to
13244 * literal.cs (NullPointer): new class used to represent a null
13245 literal in a pointer context.
13247 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13248 type is a pointer, use a NullPointer object instead of a
13249 NullLiteral. Closes 43687
13251 (ExplicitConversion): Convert pointer values using
13252 the conv opcode to the proper type.
13254 * ecore.cs (New): change ValueTypeVariable property into a method,
13255 that returns whether the valuetype is suitable for being used.
13257 * expression.cs (Binary.DoNumericPromotions): Only return if we
13258 the int constant was a valid uint, and we can return both left and
13259 right as uints. If not, we continue processing, to trigger the
13260 type conversion. This fixes 39018.
13262 * statement.cs (Block.EmitMeta): During constant resolution, set
13263 the CurrentBlock property on the emitcontext, so that we resolve
13264 constants propertly.
13266 2003-07-02 Martin Baulig <martin@ximian.com>
13268 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13269 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13271 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13272 than emitting it here.
13274 * statement.cs: Fixed some more flow analysis bugs.
13276 2003-07-02 Martin Baulig <martin@ximian.com>
13278 * class.cs (MethodData.Define): When implementing interface
13279 methods, set Final unless we're Virtual.
13281 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13282 check work for interface methods.
13284 2003-07-01 Martin Baulig <martin@ximian.com>
13286 * ecore.cs (EmitContext.This): Replaced this property with a
13287 GetThis() method which takes a Location argument. This ensures
13288 that we get the correct error location for a CS0188.
13290 2003-07-01 Miguel de Icaza <miguel@ximian.com>
13292 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13293 ImplicitStandardConversion.
13295 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13297 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
13299 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13302 2003-06-30 Miguel de Icaza <miguel@ximian.com>
13304 * class.cs (Constructor.Define): Turn off initlocals for unsafe
13307 (MethodData.Define): Turn off initlocals for unsafe methods.
13309 2003-06-29 Miguel de Icaza <miguel@ximian.com>
13311 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13312 complete; Fixes #37521.
13314 * delegate.cs: Use Modifiers.TypeAttr to compute the
13315 TypeAttributes, instead of rolling our own. This makes the flags
13316 correct for the delegates.
13318 2003-06-28 Miguel de Icaza <miguel@ximian.com>
13320 * class.cs (Constructor.Define): Set the private flag for static
13321 constructors as well.
13323 * cs-parser.jay (statement_expression): Set the return value to
13324 null, to avoid a crash when we catch an error.
13326 2003-06-24 Miguel de Icaza <miguel@ximian.com>
13328 * cs-parser.jay: Applied patch from Jackson that adds support for
13329 extern and unsafe modifiers to destructor declarations.
13331 * expression.cs: Report error 21 if the user is trying to index a
13334 * driver.cs: Add an error message, suggested by the bug report.
13336 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13337 if we do not have a ": this ()" constructor initializer. Fixes 45149
13339 2003-06-14 Miguel de Icaza <miguel@ximian.com>
13341 * namespace.cs: Add some information to reduce FAQs.
13343 2003-06-13 Miguel de Icaza <miguel@ximian.com>
13345 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13346 underlying enumeration types. Fixes #43915.
13348 * expression.cs: Treat ushort/short as legal values to be used in
13349 bitwise operations.
13351 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13353 * delegate.cs: transfer custom attributes for paramenters from
13354 the delegate declaration to Invoke and BeginInvoke.
13356 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13358 * attribute.cs: handle custom marshalers and emit marshal info
13361 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
13363 * makefile.gnu: Added anonymous.cs to the compiler sources.
13365 2003-05-28 Miguel de Icaza <miguel@ximian.com>
13367 * iterators.cs: Change the name of the proxy class to include two
13370 * cs-parser.jay: Update grammar to include anonymous methods.
13372 * anonymous.cs: new file.
13374 2003-05-27 Miguel de Icaza <miguel@ximian.com>
13376 * class.cs (Field.Define): Add missing test for pointers and
13379 2003-05-27 Ravi Pratap <ravi@ximian.com>
13381 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13382 we use the stobj opcode.
13384 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13385 since it wasn't the correct fix.
13387 It still is puzzling that we are required to use stobj for IntPtr
13388 which seems to be a ValueType.
13390 2003-05-26 Miguel de Icaza <miguel@ximian.com>
13392 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13393 during regular simple name resolution. Now, the trick is that
13394 instead of returning for processing the simplename, we do a
13395 TypeManager.LookupType (ie, a rooted lookup as opposed to a
13396 contextual lookup type). If a match is found, return that, if
13397 not, return for further composition.
13399 This fixes long-standing 30485.
13401 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13402 using the address to initialize an object, do an Stobj instead of
13403 using the regular Stelem.
13405 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13406 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13407 Because if we are a BaseIndexerAccess that value will be true.
13410 * statement.cs (GotoCase.Resolve): Return after reporting an
13411 error, do not attempt to continue.
13413 * expression.cs (PointerArithmetic.Emit): If our operand is a
13414 long, convert our constants to match the operand before
13415 multiplying. Convert to I type before adding. Fixes 43670.
13417 2003-05-14 Ravi Pratap <ravi@ximian.com>
13419 * enum.cs (ImplicitConversionExists) : Rename to
13420 ImplicitEnumConversionExists to remove ambiguity.
13422 * ecore.cs (NullCast): New type of cast expression class which
13423 basically is very similar to EmptyCast with the difference being
13424 it still is a constant since it is used only to cast a null to
13426 (eg. (string) null)
13428 * convert.cs (ImplicitReferenceConversion): When casting a null
13429 literal, we return a NullCast.
13431 * literal.cs (NullLiteralTyped): Remove - I don't see why this
13432 should be around anymore.
13434 The renaming (reported was slightly wrong). Corrections:
13436 ConvertImplicitStandard -> ImplicitConversionStandard
13437 ConvertExplicitStandard -> ExplicitConversionStandard
13439 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13440 before passing them in !
13442 * convert.cs (ImplicitConversionStandard): When comparing for
13443 equal expr and target types, ensure that expr is not a
13446 In general, we must not be checking (expr_type ==
13447 target_type) in the top level conversion methods
13448 (ImplicitConversion, ExplicitConversion etc). This checking is
13449 done in the methods that they delegate to.
13451 2003-05-20 Miguel de Icaza <miguel@ximian.com>
13453 * convert.cs: Move Error_CannotConvertType,
13454 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13455 ImplicitNumericConversion, ImplicitConversionExists,
13456 ImplicitUserConversionExists, StandardConversionExists,
13457 FindMostEncompassedType, FindMostSpecificSource,
13458 FindMostSpecificTarget, ImplicitUserConversion,
13459 ExplicitUserConversion, GetConversionOperators,
13460 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13461 TryImplicitIntConversion, Error_CannotConvertImplicit,
13462 ConvertImplicitRequired, ConvertNumericExplicit,
13463 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13464 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13467 Perform the following renames:
13469 StandardConversionExists -> ImplicitStandardConversionExists
13470 ConvertImplicit -> ImplicitConversion
13471 ConvertImplicitStandard -> ImplicitStandardConversion
13472 TryImplicitIntConversion -> ImplicitIntConversion
13473 ConvertImplicitRequired -> ImplicitConversionRequired
13474 ConvertNumericExplicit -> ExplicitNumericConversion
13475 ConvertReferenceExplicit -> ExplicitReferenceConversion
13476 ConvertExplicit -> ExplicitConversion
13477 ConvertExplicitStandard -> ExplicitStandardConversion
13479 2003-05-19 Martin Baulig <martin@ximian.com>
13481 * statement.cs (TypeInfo.StructInfo): Made this type protected.
13482 (TypeInfo): Added support for structs having structs as fields.
13484 * ecore.cs (FieldExpr): Implement IVariable.
13485 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13486 VariableInfo for the field.
13488 2003-05-18 Martin Baulig <martin@ximian.com>
13490 * expression.cs (This.DoResolve): Report a CS0027 if we're
13491 emitting a field initializer.
13493 2003-05-18 Martin Baulig <martin@ximian.com>
13495 * expression.cs (This.ResolveBase): New public function.
13496 (This.DoResolve): Check for CS0188.
13498 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13501 * ecore.cs (MethodGroupExpr.DoResolve): Set the
13502 `instance_expression' to null if we don't have any non-static
13505 2003-05-18 Martin Baulig <martin@ximian.com>
13507 Reworked the way how local variables and parameters are handled by
13508 the flow analysis code.
13510 * statement.cs (TypeInfo, VariableMap): New public classes.
13511 (VariableInfo): New public class. This is now responsible for
13512 checking whether a variable has been assigned. It is used for
13513 parameters and local variables.
13514 (Block.EmitMeta): Take the InternalParameters as argument; compute
13515 the layout of the flow vectors here.
13516 (Block.LocalMap, Block.ParameterMap): New public properties.
13517 (FlowBranching): The .ctor doesn't get the InternalParameters
13518 anymore since Block.EmitMeta() now computes the layout of the flow
13520 (MyStructInfo): This class is now known as `StructInfo' and nested
13521 in `TypeInfo'; we don't access this directly anymore.
13523 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13524 property and removed IsAssigned(), IsFieldAssigned(),
13525 SetAssigned() and SetFieldAssigned(); we now call them on the
13526 VariableInfo so we don't need to duplicate this code everywhere.
13528 * expression.cs (ParameterReference): Added `Block block' argument
13530 (LocalVariableReference, ParameterReference, This): The new
13531 VariableInfo class is now responsible for all the definite
13534 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13535 IsParameterAssigned, SetParameterAssigned): Removed.
13537 2003-05-18 Martin Baulig <martin@ximian.com>
13539 * typemanager.cs (InitCoreTypes): Try calling
13540 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13541 the 3-args-version. Corlib now also needs our `void_type'.
13542 (GetMethod): Added overloaded version which takes an optional
13543 `bool report_errors' to allow lookups of optional methods.
13545 2003-05-12 Martin Baulig <martin@ximian.com>
13547 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13548 only used for locals and not for parameters.
13550 2003-05-12 Miguel de Icaza <miguel@ximian.com>
13552 * support.cs (InternalParameters.ParameterType): Return the
13553 ExternalType of the parameter.
13555 * parameter.cs (Parameter.ExternalType): drop the two arguments,
13558 2003-05-11 Miguel de Icaza <miguel@ximian.com>
13560 * class.cs (MethodData.Define): Do not set the `newslot' on
13561 interface members, if they are also flagged as "override".
13563 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13564 better code for ++i and i++. This only works for static fields
13565 and local variables.
13567 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13568 want to pull the DeclSpace out of the builder_to_declspace instead
13569 of the TypeBuilder (like in TypeContainer.FindMembers).
13571 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13572 instead of LookupTypeContainer. Fixes the crash on .NET for
13573 looking up interface members.
13575 * const.cs: Create our own emit context during the Definition
13576 stage, so that constants are evaluated in the proper context, when
13577 a recursive definition happens.
13579 2003-05-11 Martin Baulig <martin@ximian.com>
13581 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
13582 new block for a switch section.
13583 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13584 the adding/lookup in the switch block. Fixes #39828.
13586 2003-05-09 Miguel de Icaza <miguel@ximian.com>
13588 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13589 functionality: I needed to convert the data after I had performed
13590 the add/sub operation into the operands type size.
13592 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13593 pass the type for the box operation, otherwise the resulting
13594 object would have been of type object.
13596 (BoxedCast): Add constructor to specify the type to box as.
13598 2003-05-07 Miguel de Icaza <miguel@ximian.com>
13600 * iterators.cs: I was reusing the `count' variable inadvertently,
13601 take steps to not allow this to happen.
13603 2003-05-06 Miguel de Icaza <miguel@ximian.com>
13605 * attribute.cs (Attribute.Resolve): Params attributes are encoded
13606 by creating an array at the point where the params starts and
13607 putting all those arguments there, then adjusting the size of the
13610 2003-05-05 Miguel de Icaza <miguel@ximian.com>
13612 * expression.cs (New.AddressOf): Implement interface
13613 IMemoryLocation. This is used when the `new' operator is used in
13614 the context of an invocation to a method on a value type.
13616 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13619 * namespace.cs: Also check the using aliases here.
13621 * driver.cs: Move the test for using validity after the types have
13622 been entered, so we do a single pass that also includes the using
13625 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13626 in the regular case. CreateSiblingForFinally is doing extra
13629 * attribute.cs (GetAttributeArgumentExpression): Store the result
13630 on an out value, and use the return value to indicate failure
13631 instead of using null (which is a valid return for Constant.GetValue).
13633 * statement.cs: Perform the analysis flow for the increment
13634 portion after the statement, because this will be the real flow of
13635 execution. Fixes #42385
13637 * codegen.cs (EmitContext.EmitArgument,
13638 EmitContext.EmitStoreArgument): New helper functions when the
13639 RemapToProxy flag is set.
13641 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13644 Add support for remapping parameters.
13646 * iterators.cs: Propagate parameter values; Store parameter
13647 values in the proxy classes.
13649 2003-05-04 Miguel de Icaza <miguel@ximian.com>
13651 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
13652 need a proxy reference; I do not know what I was thinking
13654 * cs-parser.jay (constructor_initializer): catch another error,
13655 and display nice message.
13657 (field_declaration): catch void field declaration
13658 to flag a better error.
13660 * class.cs (MemberBase.CheckBase): Report an error instead of a
13661 warning if a new protected member is declared in a struct.
13662 (Field.Define): catch the error of readonly/volatile.
13664 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13666 (FieldExpr.AddressOf): ditto. Catch error where the address of a
13667 volatile variable is taken
13669 2003-05-02 Miguel de Icaza <miguel@ximian.com>
13671 * statement.cs (Fixed.Resolve): Report an error if we are not in
13674 2003-05-01 Miguel de Icaza <miguel@ximian.com>
13676 * typemanager.cs: reuse the code that handles type clashes for
13677 delegates and enumerations.
13679 * class.cs (Report28): Always report.
13681 * expression.cs (EncodeAsAttribute): Allow nulls here.
13683 2003-04-28 Miguel de Icaza <miguel@ximian.com>
13685 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13686 the functionality for testing whether an expression is valid for
13687 an attribute here. Also handle the case of arrays of elements
13690 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13691 encoding a linear array into an array of objects that are suitable
13692 to be passed to an CustomAttributeBuilder.
13694 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13696 * ecore.cs: (FieldExpr): Handle field remapping here.
13698 * iteratators.cs: Pass the instance variable (if the method is an
13699 instance method) to the constructors, so we can access the field
13700 variables on the class.
13702 TODO: Test this with structs. I think the THIS variable on
13703 structs might have to be a pointer, and not a refenrece
13705 2003-04-27 Miguel de Icaza <miguel@ximian.com>
13707 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13708 local variables to fields in a proxy class.
13710 * iterators.cs (PopulateProxy): Rename our internal fields to
13712 Create a <THIS> field if we are an instance method, so we can
13713 reference our parent container variables.
13714 (MapVariable): Called back from the EmitContext code to enter a
13715 new variable to field mapping into the proxy class (we just create
13719 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13720 for using the remapped locals to fields.
13722 I placed the code here, because that gives the same semantics to
13723 local variables, and only changes the Emit code.
13725 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13726 statements inside iterators.
13727 (VariableInfo): Add a FieldBuilder for the cases when we are
13728 remapping local variables to fields in a proxy class
13730 * ecore.cs (SimpleNameResolve): Avoid testing two times for
13731 current_block != null.
13733 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13734 not cope with strings, as it has been moved to the
13735 TableSwitchEmit. Fixed bug in switch generation.
13737 * expression.cs (New.DoResolve): Provide more context for the user
13738 when reporting an error.
13740 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13743 * expression.cs (MemberAccess.DoResolve): When we get a type back,
13744 check the permissions for it. Note than in a type-resolution
13745 context the check was already present in DeclSpace.ResolveType,
13746 but was missing from the MemberAccess.
13748 (ArrayCreation.CheckIndices): warn if the user has
13749 more nested levels of expressions, but there are no more
13750 dimensions specified. Avoids crash on bug 41906.
13752 2003-04-26 Miguel de Icaza <miguel@ximian.com>
13754 * statement.cs (Block): replace Implicit bool, for a generic
13756 New flag: `Unchecked'. This is used during the EmitMeta phase
13757 (which is out-of-line with the regular Resolve/Emit process for a
13758 statement, as this is done ahead of time, but still gets a chance
13759 to call constant resolve).
13761 (Block.Flags): new enum for adding a new flag.
13763 (Block.EmitMeta): track the state of unchecked.
13765 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13766 to enable constant resolution to work there as well.
13768 2003-04-22 Miguel de Icaza <miguel@ximian.com>
13770 * typemanager.cs (ienumerable_type): Also look up
13771 System.Collections.IEnumerable.
13773 2003-04-21 Miguel de Icaza <miguel@ximian.com>
13775 TODO: Test more than one conditional per method.
13777 * class.cs (Indexer.Define): Report the location where the user is
13778 referencing the unsupported feature.
13780 (MethodData): Overload the use of `conditionals' to
13781 minimize the creation of needless ArrayLists. This saves roughly
13782 212kb on my machine.
13784 (Method): Implement the new IIteratorContainer interface.
13785 (Method.SetYields): Implement the method by setting the ModFlags
13786 to contain METHOD_YIELDS.
13788 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13789 which just got set to null.
13791 * iterators.cs: New file.
13793 (Yield, YieldBreak): New statements.
13795 * statement.cs (Return.Resolve): Flag an error if we are used in
13796 an iterator method.
13798 * codegen.cs (InIterator): New flag set if the code is being
13799 compiled in an iterator method.
13801 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
13802 internal modifier, and we just use it to avoid adding extra
13803 fields, as this is seldom used.
13805 * cs-parser.jay: Add yield_statement (yield and yield break).
13807 * driver.cs: New flag -v2 to turn on version 2 features.
13809 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13810 hashtable when v2 is enabled.
13812 2003-04-20 Miguel de Icaza <miguel@ximian.com>
13814 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13815 there is already a namespace defined with this name.
13817 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13818 people upgraded their corlibs.
13820 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13821 always use fully qualified types, no need to use the compiler
13824 (TypeManager.IsNamespace): Use binarysearch.
13826 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13827 AddDelegate): I did not quite use the new IsValid API properly: I
13828 have to pass the short-name and the fullname. I was passing only
13829 the basename instead of the fullname sometimes.
13831 (TypeContainer.DefineType): call NamespaceClash.
13833 * interface.cs (Interface.DefineType): use NamespaceClash before
13836 * delegate.cs (Delegate.DefineType): use NamespaceClash before
13839 * enum.cs: (Enum.DefineType): use NamespaceClash before
13842 * typemanager.cs (: 3-line patch that gives us some tasty 11%
13843 speed increase. First, use the negative_hits cache when we get a
13844 negative. Second, add the type with its full original name
13845 instead of the new . and + encoded name (reflection uses + to
13846 separate type from a nested type). Use LookupTypeReflection
13847 directly which bypasses the type->name hashtable (that we already
13848 know does not contain the type.
13850 * decl.cs (DeclSpace.ResolveTypeExpr): track the
13851 location/container type.
13853 * driver.cs: When passing utf8, use directly the UTF8Encoding.
13855 2003-04-19 Miguel de Icaza <miguel@ximian.com>
13857 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13859 * delegate.cs (NewDelegate.Resolve): Test whether an instance
13860 method is being referenced in the method group from a static
13861 context, and report error 120 if so.
13863 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13866 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13867 is created, we create the A namespace).
13869 * cs-parser.jay: A namespace also introduces a DeclarationFound.
13872 2003-04-18 Miguel de Icaza <miguel@ximian.com>
13874 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13875 invocation to ModuleBuilder.GetType with the same values will
13876 return a new type instance, so we need to cache its return
13879 * expression.cs (Binary.ResolveOperator): Only allow the compare
13880 operators on enums if they are of the same type.
13882 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13883 types of ValueType on their own case. Before we were giving them
13884 the same treatment as objects.
13886 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13887 fullname. Short name is used to compare against container name.
13888 Fullname is used to check against defined namespace names.
13890 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13891 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13893 (Method.CheckBase): Call parent.
13894 (MemberBase.CheckBase): Check for protected members on sealed
13896 (PropertyBase.CheckBase): Call parent.
13897 (Field.Define): Call parent.
13899 * report.cs: Negative error codes are now mapped to 8000 - code,
13900 so that the display is render more nicely.
13902 * typemanager.cs: Do not use try/catch, instead report a regular
13905 (GetPointerType, GetReferenceType): These methods provide
13906 mechanisms to obtain the T* and T& from a T. We had the code
13907 previously scattered around the code base, and it also used
13908 TypeManager.LookupType that would go through plenty of caches.
13909 This one goes directly to the type source.
13911 In some places we did the Type.GetType followed by
13912 ModuleBuilder.GetType, but not in others, so this unifies the
13913 processing as well.
13915 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13916 statements now that we have namespace information.
13918 * typemanager.cs (IsNamespace): New method, returns whether the
13919 string presented is a namespace or not.
13921 (ComputeNamespaces): New public entry point, computes the list of
13922 available namespaces, using the GetNamespaces API call in Mono, or
13923 the slower version in MS.NET.
13925 Now before we start the semantic analysis phase, we have a
13926 complete list of namespaces including everything that the user has
13929 Deleted old code to cache namespaces in .nsc files.
13931 2003-04-17 Miguel de Icaza <miguel@ximian.com>
13933 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13934 class/struct location definition Location for the implicit
13935 constructor location.
13937 (Operator.Define): Use the location of the operator for the
13938 implicit Method definition.
13940 (Constructor.Emit): use the constructor location for the implicit
13941 base initializer constructor.
13943 * ecore.cs: Remove ITypeExpression. This interface is now gone,
13944 and the Expression class now contains two new methods:
13946 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
13947 isolate type lookup from the rest of the resolution process.
13949 Since we use Expressions to hold type definitions due to the way
13950 we parse the input we have historically overloaded Resolve to
13951 perform the Type lookups if a special flag is passed. Now this is
13952 eliminated and two methods take their place.
13954 The differences in the two methods between xStep and xTerminal is
13955 that xStep is involved in our current lookup system that uses
13956 SimpleNames to compose a name, while xTerminal is used just to
13957 catch the case where the simplename lookup failed.
13959 2003-04-16 Miguel de Icaza <miguel@ximian.com>
13961 * expression.cs (ResolveMemberAccess): Remove redundant code.
13962 TypeExpr expressions are always born fully resolved.
13964 * interface.cs (PopulateMethod): Do not lookup the types twice.
13965 We were doing it once during SemanticAnalysis and once during
13968 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13969 in local variable type definitions, were being returned as a
13970 SimpleName (we decomposed everything into a string), that is
13971 because primary_expression was being used instead of a type in the
13972 grammar (reduce/reduce conflicts).
13974 The part that was wrong is that we converted the expression into a
13975 string (an oversimplification in one hand, compounded with primary
13976 expressions doing string concatenation).
13982 Would return "A.B.C[]" as a SimpleName. This stopped things like
13983 using clauses from working on this particular context. And a type
13984 was being matched directly against "A.B.C[]".
13986 We now use the correct approach, and allow for ComposedCast to be
13987 part of the unary expression. So the "A.B.C []" become a composed
13988 cast of "A.B.C" (as a nested group of MemberAccess with a
13989 SimpleName at the end) plus the rank composition "[]".
13993 2003-04-10 Miguel de Icaza <miguel@ximian.com>
13995 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13996 for the access level checking.
13998 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
13999 `TypeContainer container', because I kept getting confused when I
14000 was debugging this code.
14002 * expression.cs (Indexers): Instead of tracking getters/setters,
14003 we now track them in parallel. We create one arraylist less, but
14004 most importantly it is possible now for the LValue code to find a
14005 matching get for a set.
14007 (IndexerAccess.DoResolveLValue): Update the code.
14008 GetIndexersForType has been modified already to extract all the
14009 indexers from a type. The code assumed it did not.
14011 Also make the code set the correct return type for the indexer.
14012 This was fixed a long time ago for properties, but was missing for
14013 indexers. It used to be void_type.
14015 (Binary.Emit): Test first for doubles instead of
14016 floats, as they are more common.
14018 (Binary.EmitBranchable): Use the .un version of the branch opcodes
14019 when dealing with floats and the <=, >= operators. This fixes bug
14022 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14023 to load the array value by emitting a load on the foreach variable
14024 type. This was incorrect.
14026 We now emit the code to load an element using the the array
14027 variable type, and then we emit the conversion operator.
14031 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
14033 * attribute.cs: Avoid allocation of ArrayLists in the common case.
14035 2003-04-09 Miguel de Icaza <miguel@ximian.com>
14037 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14038 test for protection before we test for signatures.
14040 (MethodSignature.ToString): implement.
14042 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14043 to the case where we reduced into a LongConstant.
14045 * decl.cs (CheckAccessLevel): If the type is an array, we can not
14046 depend on whether the information is acurrate, because the
14047 Microsoft runtime will always claim that the array type is public,
14048 regardless of the real state.
14050 If the type is a pointer, another problem happens: the type is
14051 reported as non-public in Microsoft.
14053 In both cases we have to call CheckAccessLevel recursively with
14054 the underlying type as the argument to be tested.
14056 2003-04-08 Miguel de Icaza <miguel@ximian.com>
14058 * assign.cs (Assign.Emit): If we are dealing with a compound
14059 assignment expression, we should use the code path that stores the
14060 intermediate result in a temporary value. This fixes #40903.
14062 *expression.cs (Indirection.ToString): Provide ToString method for
14065 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
14067 * class.cs: Null out fields holding references to Block objects so
14068 they can be garbage collected.
14070 * expression.cs (OverloadResolve): Remove unused local.
14072 2003-04-07 Martin Baulig <martin@ximian.com>
14074 * codegen.cs (EmitContext.CurrentFile): New public field.
14075 (EmitContext.Mark): Use the CurrentFile to check whether the
14076 location is in the correct file.
14077 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14079 2003-04-07 Martin Baulig <martin@ximian.com>
14081 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14083 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14084 location. [FIXME: The location argument which gets passed to this
14085 method is sometimes wrong!]
14087 2003-04-07 Nick Drochak <ndrochak@gol.com>
14089 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14091 2003-04-07 Miguel de Icaza <miguel@ximian.com>
14093 * expression.cs (Indirection.EmitAssign): We were using the
14094 temporary, but returning immediately instead of continuing the
14097 2003-04-06 Martin Baulig <martin@ximian.com>
14099 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14100 if it's a nested child, but also deriving from the outer class.
14103 * typemanager.cs (IsNestedChildOf): Make this work if it's a
14104 nested child, but also deriving from the outer class. See
14106 (FilterWithClosure): We may access private members of the outer
14107 class if we're a nested child and deriving from the outer class.
14108 (RealMemberLookup): Only set `closure_private_ok' if the
14109 `original_bf' contained BindingFlags.NonPublic.
14111 2003-04-05 Martin Baulig <martin@ximian.com>
14113 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
14115 2003-04-02 Miguel de Icaza <miguel@ximian.com>
14117 * class.cs (Event.Define): Do not allow abstract events to have
14120 2003-04-01 Miguel de Icaza <miguel@ximian.com>
14122 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14123 block in event declarations.
14125 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14126 value type, get its address.
14128 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14129 leaving a class on the stack instead of a boolean value (int
14130 0/1). Change the code so we compare against null, and then the
14131 result against zero.
14133 * class.cs (TypeContainer.GetClassBases): We were checking for the
14134 parent class being sealed too late.
14136 * expression.cs (Binary.Emit): For <= and >= when dealing with
14137 floating point values, use cgt.un and clt.un instead of cgt and
14140 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
14142 * statement.cs: Apply the same optimization as MS: skip the
14143 GetEnumerator returning an IEnumerator, and use the one returning a
14144 CharEnumerator instead. This allows us to avoid the try-finally block
14147 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
14149 * cs-parser.jay: Attributes cannot be applied to
14150 namespaces. Fixes #40473
14152 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14155 (Add*): check if the name is valid using the full name for constants,
14156 fields, properties and events.
14158 2003-03-28 Miguel de Icaza <miguel@ximian.com>
14160 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14161 char constants to be part of the enumeration.
14163 * expression.cs (Conditional.DoResolve): Add support for operator
14164 true. Implements the missing functionality from 14.12
14166 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14167 operator true/false as required by the spec.
14169 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14170 implicit conversion to boolean.
14172 * statement.cs (Statement.ResolveBoolean): A boolean expression is
14173 also one where the type implements `operator true'.
14175 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14176 get an expression that will invoke operator true based on an
14179 (GetConversionOperators): Removed the hack that called op_True
14182 (Expression.ResolveBoolean): Move this from Statement.
14184 2003-03-17 Miguel de Icaza <miguel@ximian.com>
14186 * ecore.cs (FieldExpr): do not allow initialization of initonly
14187 fields on derived classes
14189 2003-03-13 Martin Baulig <martin@ximian.com>
14191 * statement.cs (Block.Emit): Call ig.BeginScope() and
14192 ig.EndScope() when compiling with debugging info; call
14193 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14195 2003-03-08 Miguel de Icaza <miguel@ximian.com>
14197 * expression.cs (Indexers): Do not construct immediately, allow
14198 for new members to be appended as we go. Fixes 38143
14200 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14202 * expression.cs: save/restore context when resolving an unchecked
14205 2003-03-05 Miguel de Icaza <miguel@ximian.com>
14207 * cfold.cs: Catch division by zero in modulus operator during
14210 2003-03-03 Miguel de Icaza <miguel@ximian.com>
14212 * interface.cs (Interface.DefineMembers): Avoid defining members
14215 2003-02-27 Miguel de Icaza <miguel@ximian.com>
14217 * driver.cs: handle the +/- options for -noconfig
14219 * statement.cs (Unckeched.Resolve): Also track the state of
14220 unchecked in the Resolve phase.
14222 2003-02-27 Martin Baulig <martin@ximian.com>
14224 * ecore.cs (Expression.MemberLookup): Don't create a
14225 MethodGroupExpr for something which is not a method. Fixes #38291.
14227 2003-02-25 Miguel de Icaza <miguel@ximian.com>
14229 * class.cs (MemberBase.CheckParameters): Also check that the type
14230 is unmanaged if it is a pointer.
14232 * expression.cs (SizeOf.Resolve): Add location information.
14234 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14235 a managed type is declared.
14237 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14238 parameter modifiers as well. Fixes bug 38606
14240 * class.cs: Very sad. Am backing out the speed up changes
14241 introduced by the ArrayList -> Array in the TypeContainer, as they
14242 were not actually that much faster, and introduced a bug (no error
14243 reports on duplicated methods).
14245 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14246 source first, this will guarantee that we have a valid expression
14247 before calling in lower levels functions that will require a
14248 resolved object. Then use this original_source in the
14249 target.ResolveLValue instead of the original source that was
14252 Another change. Use target.Resolve instead of LValueResolve.
14253 Although we are resolving for LValues, we will let the Assign code
14254 take care of that (it will be called again from Resolve). This
14255 basically allows code like this:
14257 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14258 class Y { void A (X x) { x [0] += o; }
14260 The problem was that the indexer was trying to resolve for
14261 set_Item (idx, object o) and never finding one. The real set_Item
14262 was set_Item (idx, X). By delaying the process we get the right
14267 2003-02-23 Martin Baulig <martin@ximian.com>
14269 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14270 while calling DoEmit ().
14272 * codegen.cs (EmitContext.Mark): Don't mark locations in other
14273 source files; if you use the #line directive inside a method, the
14274 compiler stops emitting line numbers for the debugger until it
14275 reaches the end of the method or another #line directive which
14276 restores the original file.
14278 2003-02-23 Martin Baulig <martin@ximian.com>
14280 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14282 2003-02-23 Martin Baulig <martin@ximian.com>
14284 * statement.cs (Block.AddChildVariableNames): We need to call this
14285 recursively, not just for our immediate children.
14287 2003-02-23 Martin Baulig <martin@ximian.com>
14289 * class.cs (Event.Define): Always make the field private, like csc does.
14291 * typemanager.cs (TypeManager.RealMemberLookup): Make events
14292 actually work, fixes bug #37521.
14294 2003-02-23 Miguel de Icaza <miguel@ximian.com>
14296 * delegate.cs: When creating the various temporary "Parameters"
14297 classes, make sure that we call the ComputeAndDefineParameterTypes
14298 on those new parameters (just like we do with the formal ones), to
14299 allow them to be resolved in the context of the DeclSpace.
14301 This fixes the bug that Dick observed in Bugzilla #38530.
14303 2003-02-22 Miguel de Icaza <miguel@ximian.com>
14305 * expression.cs (ResolveMemberAccess): When resolving a constant,
14306 do not attempt to pull a constant if the value was not able to
14307 generate a valid constant.
14309 * const.cs (LookupConstantValue): Do not report more errors than required.
14311 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14313 * expression.cs: fixes bug #38328.
14315 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14317 * class.cs: Changed all the various members that can be part of a
14318 class from being an ArrayList to be an Array of the right type.
14319 During the DefineType type_list, interface_list, delegate_list and
14320 enum_list are turned into types, interfaces, delegates and enums
14323 And during the member population, indexer_list, event_list,
14324 constant_list, field_list, instance_constructor_list, method_list,
14325 operator_list and property_list are turned into their real arrays.
14327 Although we could probably perform this operation earlier, for
14328 good error reporting we need to keep the lists and remove the
14329 lists for longer than required.
14331 This optimization was triggered by Paolo profiling the compiler
14332 speed on the output of `gen-sample-program.pl' perl script.
14334 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14335 not crash in methods like MemberLookupFailed that use this field.
14337 This problem arises when the compiler fails to resolve a type
14338 during interface type definition for example.
14340 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14342 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14343 inherit from System.Object, so we have to stop at null, not only
14344 when reaching System.Object.
14346 2003-02-17 Miguel de Icaza <miguel@ximian.com>
14348 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14349 DeclaredOnly because the parent indexer might have had a different
14350 name, but did not loop until the top of the hierarchy was reached.
14352 The problem this one fixes is 35492: when a class implemented an
14353 indexer from an interface, we were getting the interface method
14354 (which was abstract) and we were flagging an error (can not invoke
14357 This also keeps bug 33089 functioning, and test-148 functioning.
14359 * typemanager.cs (IsSpecialMethod): The correct way of figuring
14360 out if a method is special is to see if it is declared in a
14361 property or event, or whether it is one of the predefined operator
14362 names. This should fix correctly #36804.
14364 2003-02-15 Miguel de Icaza <miguel@ximian.com>
14366 The goal here is to remove the dependency on EmptyCast.Peel ().
14367 Killing it completely.
14369 The problem is that currently in a number of places where
14370 constants are expected, we have to "probe" for an EmptyCast, and
14371 Peel, which is not the correct thing to do, as this will be
14372 repetitive and will likely lead to errors.
14374 The idea is to remove any EmptyCasts that are used in casts that
14375 can be reduced to constants, so we only have to cope with
14378 This bug hunt was triggered by Bug 37363 and the desire to remove
14379 the duplicate pattern where we were "peeling" emptycasts to check
14380 whether they were constants. Now constants will always be
14383 * ecore.cs: Use an enumconstant here instead of wrapping with
14386 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14387 throwing me off. By handling this we can get rid of a few hacks.
14389 * statement.cs (Switch): Removed Peel() code.
14391 2003-02-14 Miguel de Icaza <miguel@ximian.com>
14393 * class.cs: Location information for error 508
14395 * expression.cs (New.DoResolve): Add a guard against double
14396 resolution of an expression.
14398 The New DoResolve might be called twice when initializing field
14399 expressions (see EmitFieldInitializers, the call to
14400 GetInitializerExpression will perform a resolve on the expression,
14401 and later the assign will trigger another resolution
14403 This leads to bugs (#37014)
14405 * delegate.cs: The signature for EndInvoke should contain any ref
14406 or out parameters as well. We were not doing this in the past.
14408 * class.cs (Field.Define): Do not overwrite the type definition
14409 inside the `volatile' group. Turns out that volatile enumerations
14410 were changing the type here to perform a validity test, which
14413 2003-02-12 Miguel de Icaza <miguel@ximian.com>
14415 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14416 and structs, we do not want to load the instance variable
14418 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14419 enum_type has to be handled like an object reference (implicit
14420 conversions exists from this to object), but the regular IsClass
14421 and IsValueType tests will never return true for this one.
14423 Also we use TypeManager.IsValueType instead of type.IsValueType,
14424 just for consistency with the rest of the code (this is only
14425 needed if we ever use the construct exposed by test-180.cs inside
14426 corlib, which we dont today).
14428 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
14430 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14433 2003-02-09 Martin Baulig <martin@ximian.com>
14435 * namespace.cs (Namespace..ctor): Added SourceFile argument.
14436 (Namespace.DefineNamespaces): New static public method; this is
14437 called when we're compiling with debugging to add all namespaces
14438 to the symbol file.
14440 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14441 pass it to the Namespace's .ctor.
14443 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14444 and MethodBase arguments; pass the namespace ID to the symwriter;
14445 pass the MethodBase instead of the token to the symwriter.
14446 (SymbolWriter.DefineNamespace): New method to add a namespace to
14449 2003-02-09 Martin Baulig <martin@ximian.com>
14451 * symbolwriter.cs: New file. This is a wrapper around
14452 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
14453 methods here in near future.
14455 2003-02-09 Martin Baulig <martin@ximian.com>
14457 * codegen.cs (EmitContext.Mark): Just pass the arguments to
14458 ILGenerator.MarkSequencePoint() which are actually used by the
14461 2003-02-09 Martin Baulig <martin@ximian.com>
14463 * location.cs (SourceFile): New public sealed class. This
14464 contains the name and an index which is used in the location's token.
14465 (Location): Reserve an appropriate number of bits in the token for
14466 the source file instead of walking over that list, this gives us a
14467 really huge performance improvement when compiling with debugging.
14469 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14470 `SourceFile' argument instead of a string.
14471 (Driver.ProcessFile): Add all the files via Location.AddFile(),
14472 but don't parse/tokenize here, we need to generate the list of all
14473 source files before we do that.
14474 (Driver.ProcessFiles): New static function. Parses/tokenizes all
14477 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14478 instead of a string.
14480 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14483 2003-02-09 Martin Baulig <martin@ximian.com>
14485 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14486 filename on `#line default'.
14488 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14490 * statement.cs: don't clear the pinned var when the fixed statement
14491 returns from the method (fixes bug#37752).
14493 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14495 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
14498 2003-02-07 Martin Baulig <martin@ximian.com>
14500 * driver.cs: Removed the `--debug-args' command line argument.
14502 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14503 automatically by the AsssemblyBuilder.
14504 (CodeGen.InitializeSymbolWriter): We don't need to call any
14505 initialization function on the symbol writer anymore. This method
14506 doesn't take any arguments.
14508 2003-02-03 Miguel de Icaza <miguel@ximian.com>
14510 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14511 from referenced assemblies as well.
14513 2003-02-02 Martin Baulig <martin@ximian.com>
14515 * class.cs (MethodData.Emit): Generate debugging info for external methods.
14517 2003-02-02 Martin Baulig <martin@ximian.com>
14519 * class.cs (Constructor.Emit): Open the symbol writer before
14520 emitting the constructor initializer.
14521 (ConstructorInitializer.Emit): Call ec.Mark() to allow
14522 single-stepping through constructor initializers.
14524 2003-01-30 Miguel de Icaza <miguel@ximian.com>
14526 * class.cs: Handle error 549: do not allow virtual methods in
14529 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14531 * decl.cs: Check access levels when resolving types
14533 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14535 * statement.cs: Add parameters and locals set in catch blocks that might
14536 return to set vector
14538 2003-01-29 Miguel de Icaza <miguel@ximian.com>
14540 * class.cs (Operator): Set the SpecialName flags for operators.
14542 * expression.cs (Invocation.DoResolve): Only block calls to
14543 accessors and operators on SpecialName methods.
14545 (Cast.TryReduce): Handle conversions from char constants.
14548 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14550 * statement.cs: small memory and time optimization in FlowBranching.
14552 2003-01-28 Pedro Mart <yoros@wanadoo.es>
14554 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14555 problem that the last fix but in the other sid (Set).
14557 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14558 access when there is no indexer in the hierarchy.
14560 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14562 * class.cs: Combine some if statements.
14564 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14566 * driver.cs: fixed bug #37187.
14568 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
14570 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14571 any indexer, it's needed to build a list with all the indexers in the
14572 hierarchy (AllGetters), else we have problems. Fixes #35653.
14574 2003-01-23 Miguel de Icaza <miguel@ximian.com>
14576 * class.cs (MethodData.Define): It is wrong for an interface
14577 implementation to be static in both cases: explicit and implicit.
14578 We were only handling this in one case.
14580 Improve the if situation there to not have negations.
14582 * class.cs (Field.Define): Turns out that we do not need to check
14583 the unsafe bit on field definition, only on usage. Remove the test.
14585 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14587 * driver.cs: use assembly.Location instead of Codebase (the latest
14588 patch made mcs fail when using MS assemblies).
14590 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
14592 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14593 get the path to *corlib.dll.
14595 2003-01-21 Nick Drochak <ndrochak@gol.com>
14599 * typemanager.cs: Remove compiler warnings
14601 2003-01-20 Duncan Mak <duncan@ximian.com>
14603 * AssemblyInfo.cs: Bump the version number to 0.19.
14605 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14607 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14609 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
14611 * class.cs (Constructor::Emit): Emit debugging info for constructors.
14613 2003-01-17 Miguel de Icaza <miguel@ximian.com>
14615 * cs-parser.jay: Small fix: we were not comparing the constructor
14616 name correctly. Thanks to Zoltan for the initial pointer.
14618 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14620 * cs-tokenizer.cs: Set file name when specified with #line
14622 2003-01-15 Miguel de Icaza <miguel@ximian.com>
14624 * cs-parser.jay: Only perform the constructor checks here if we
14625 are named like the class; This will help provider a better
14626 error. The constructor path is taken when a type definition is
14627 not found, but most likely the user forgot to add the type, so
14628 report that rather than the constructor error.
14630 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14632 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14635 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14637 * cs-parser.jay: Add cleanup call.
14639 2003-01-13 Duncan Mak <duncan@ximian.com>
14641 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14642 consistent with other methods.
14644 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14646 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14648 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14650 * attribute.cs: only set GuidAttr to true when we have a
14653 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14657 * typemanager.cs: fixes to allow mcs compile corlib with the new
14658 Type.IsSubclassOf fix.
14660 2003-01-08 Miguel de Icaza <miguel@ximian.com>
14662 * expression.cs (LocalVariableReference.DoResolve): Classify a
14663 constant as a value, not as a variable. Also, set the type for
14666 * cs-parser.jay (fixed_statement): take a type instead of a
14667 pointer_type, so we can produce a better error message later.
14669 * statement.cs (Fixed.Resolve): Flag types that are not pointers
14672 (For.DoEmit): Make inifinite loops have a
14673 non-conditional branch back.
14675 (Fixed.DoEmit): First populate the pinned variables, then emit the
14676 statement, then clear the variables. Before I was emitting the
14677 code once for each fixed piece.
14680 2003-01-08 Martin Baulig <martin@ximian.com>
14682 * statement.cs (FlowBranching.MergeChild): A break in a
14683 SWITCH_SECTION does not leave a loop. Fixes #36155.
14685 2003-01-08 Martin Baulig <martin@ximian.com>
14687 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14688 lives in the same number space than `param_map'. Fixes #36154.
14690 2003-01-07 Miguel de Icaza <miguel@ximian.com>
14692 * cs-parser.jay (constructor_declaration): Set the
14693 Constructor.ModFlags before probing for it. This makes the
14694 compiler report 514, 515 and 132 (the code was there, but got
14697 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14698 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14699 (GotoCase.Resolve): Set `Returns' to ALWAYS.
14701 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14703 * enum.cs: create the enum static fields using the enum type.
14705 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14707 * class.cs: don't try to create the ParamBuilder for the return
14708 type if it's not needed (and handle it breaking for the ms runtime
14711 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14713 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14715 2002-12-29 Miguel de Icaza <miguel@ximian.com>
14717 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14718 the command. This showed up while compiling the JANET source
14719 code, which used \r as its only newline separator.
14721 2002-12-28 Miguel de Icaza <miguel@ximian.com>
14723 * class.cs (Method.Define): If we are an operator (because it
14724 reuses our code), then set the SpecialName and HideBySig. #36128
14726 2002-12-22 Miguel de Icaza <miguel@ximian.com>
14728 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14729 exception, report error 120 `object reference required'.
14731 * driver.cs: Add --pause option, used during to measure the size
14732 of the process as it goes with --timestamp.
14734 * expression.cs (Invocation.DoResolve): Do not allow methods with
14735 SpecialName to be invoked.
14737 2002-12-21 Miguel de Icaza <miguel@ximian.com>
14739 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14740 number before adding it.
14742 2002-12-21 Ravi Pratap <ravi@ximian.com>
14744 * ecore.cs (StandardImplicitConversion): When in an unsafe
14745 context, we allow conversion between void * to any other pointer
14746 type. This fixes bug #35973.
14748 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14750 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14751 is not thrown when extensionless outputs are used
14753 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14755 * rootcontext.cs: fixed compilation of corlib.
14757 2002-12-19 Miguel de Icaza <miguel@ximian.com>
14759 * attribute.cs (Attributes.Contains): Add new method.
14761 * class.cs (MethodCore.LabelParameters): if the parameter is an
14762 `out' parameter, check that no attribute `[In]' has been passed.
14764 * enum.cs: Handle the `value__' name in an enumeration.
14766 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
14768 * decl.cs: Added special case to allow overrides on "protected
14771 2002-12-18 Ravi Pratap <ravi@ximian.com>
14773 * attribute.cs (Attributes.AddAttributeSection): Rename to this
14774 since it makes much more sense.
14776 (Attributes.ctor): Don't require a Location parameter.
14778 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14780 * attribute.cs (ApplyAttributes): Remove extra Location parameters
14781 since we already have that information per attribute.
14783 * everywhere : make appropriate changes.
14785 * class.cs (LabelParameters): Write the code which actually
14786 applies attributes to the return type. We can't do this on the MS
14787 .NET runtime so we flag a warning in the case an exception is
14790 2002-12-18 Miguel de Icaza <miguel@ximian.com>
14792 * const.cs: Handle implicit null conversions here too.
14794 2002-12-17 Ravi Pratap <ravi@ximian.com>
14796 * class.cs (MethodCore.LabelParameters): Remove the extra
14797 Type [] parameter since it is completely unnecessary. Instead
14798 pass in the method's attributes so that we can extract
14799 the "return" attribute.
14801 2002-12-17 Miguel de Icaza <miguel@ximian.com>
14803 * cs-parser.jay (parse): Use Report.Error to flag errors instead
14804 of ignoring it and letting the compile continue.
14806 * typemanager.cs (ChangeType): use an extra argument to return an
14807 error condition instead of throwing an exception.
14809 2002-12-15 Miguel de Icaza <miguel@ximian.com>
14811 * expression.cs (Unary.TryReduce): mimic the code for the regular
14812 code path. Perform an implicit cast in the cases where we can
14813 implicitly convert to one of the integral types, and then reduce
14814 based on that constant. This fixes bug #35483.
14816 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14818 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14820 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14822 * namespace.cs: fixed bug #35489.
14824 2002-12-12 Miguel de Icaza <miguel@ximian.com>
14826 * class.cs: Remove some dead code.
14828 * cs-parser.jay: Estimate the number of methods needed
14829 (RootContext.MethodCount);
14831 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14832 numbers instead of StringBuilders.
14834 * support.cs (PtrHashtable): Add constructor with initial size;
14835 We can now reduce reallocations of the method table.
14837 2002-12-10 Ravi Pratap <ravi@ximian.com>
14839 * attribute.cs (ApplyAttributes): Keep track of the emitted
14840 attributes on a per-target basis. This fixes bug #35413.
14842 2002-12-10 Miguel de Icaza <miguel@ximian.com>
14844 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14845 default to the Windows 1252 encoding.
14847 (UnixParseOption): Support version, thanks to Alp for the missing
14850 * AssemblyInfo.cs: Add nice assembly information.
14852 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14855 * cs-parser.jay: Allow a trailing comma before the close bracked
14856 in the attribute_section production.
14858 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14859 address of the instance was being taken, I will take this out,
14860 because we take the address of the object immediately here.
14862 2002-12-09 Ravi Pratap <ravi@ximian.com>
14864 * typemanager.cs (AreMultipleAllowed): Take care of the most
14865 obvious case where attribute type is not in the current assembly -
14868 2002-12-08 Miguel de Icaza <miguel@ximian.com>
14870 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14871 definitions, instead of doing that afterwards.
14873 Also we use a nice little hack, depending on the constructor, we
14874 know if we are a "composed" name or a simple name. Hence, we
14875 avoid the IndexOf test, and we avoid
14877 * codegen.cs: Add code to assist in a bug reporter to track down
14878 the source of a compiler crash.
14880 2002-12-07 Ravi Pratap <ravi@ximian.com>
14882 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14883 types have been emitted for a given element and flag an error
14884 if something which does not have AllowMultiple set is used more
14887 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14888 attribute types and their corresponding AllowMultiple properties
14890 (AreMultipleAllowed): Check the property for a given type.
14892 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14893 property in the case we have a TypeContainer.
14895 (Attributes.AddAttribute): Detect duplicates and just skip on
14896 adding them. This trivial fix catches a pretty gross error in our
14897 attribute emission - global attributes were being emitted twice!
14899 Bugzilla bug #33187 is now fixed.
14901 2002-12-06 Miguel de Icaza <miguel@ximian.com>
14903 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14904 instead of pp_and).
14906 * expression.cs (Binary.ResolveOperator): I can only use the
14907 Concat (string, string, string) and Concat (string, string,
14908 string, string) if the child is actually a concatenation of
14911 2002-12-04 Miguel de Icaza <miguel@ximian.com>
14913 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14914 context where we need a 2-character lookahead.
14916 * pending.cs (PendingImplementation): Rework so we can keep track
14917 of interface types all the time, and flag those which were
14918 implemented by parents as optional.
14920 2002-12-03 Miguel de Icaza <miguel@ximian.com>
14922 * expression.cs (Binary.ResolveOperator): Use
14923 String.Concat(string,string,string) or
14924 String.Concat(string,string,string,string) when possible.
14926 * typemanager: More helper methods.
14929 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14931 * pending.cs: remove the bogus return from GetMissingInterfaces()
14932 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14934 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14936 * namespace.cs: avoid duplicated 'using xxx' being added to
14937 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14938 when we get more than one 'using' statement for the same namespace.
14939 Report a CS0105 warning for it.
14941 2002-11-30 Miguel de Icaza <miguel@ximian.com>
14943 * cs-tokenizer.cs (consume_identifier): use read directly, instead
14944 of calling getChar/putback, uses internal knowledge of it.
14946 (xtoken): Reorder tokenizer so most common patterns are checked
14947 first. This reduces the compilation time in another 5% (from 8.11s
14948 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14950 The parsing time is 22% of the compilation in mcs, and from that
14951 64% is spent on the tokenization process.
14953 I tried using a binary search for keywords, but this is slower
14954 than the hashtable. Another option would be to do a couple of
14957 * Not use a StringBuilder, instead use an array of chars,
14958 with a set value. Notice that this way we could catch
14959 the 645 error without having to do it *afterwards*.
14961 * We could write a hand-parser to avoid the hashtable
14962 compares altogether.
14964 The identifier consumption process takes 37% of the tokenization
14965 time. Another 15% is spent on is_number. 56% of the time spent
14966 on is_number is spent on Int64.Parse:
14968 * We could probably choose based on the string length to
14969 use Int32.Parse or Int64.Parse and avoid all the 64-bit
14972 Another 3% is spend on wrapping `xtoken' in the `token' function.
14974 Handle 0xa0 as whitespace (#34752)
14976 2002-11-26 Miguel de Icaza <miguel@ximian.com>
14978 * typemanager.cs (IsCLRType): New routine to tell whether a type
14979 is one of the builtin types.
14981 Maybe it needs to use TypeCodes to be faster. Maybe we could use
14982 typecode in more places instead of doing pointer comparissions.
14983 We could leverage some knowledge about the way the typecodes are
14986 New code to cache namespaces in assemblies, it is currently not
14987 invoked, to be used soon.
14989 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14991 * expression.cs (Binary.ResolveOperator): specially handle
14992 strings, and do not perform user-defined operator overloading for
14995 2002-11-24 Miguel de Icaza <miguel@ximian.com>
14997 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14998 internalcall as it is a pretty simple operation; Avoid whenever
14999 possible to call Char.IsLetter.
15001 (consume_identifier): Cut by half the number of
15002 hashtable calls by merging the is_keyword and GetKeyword behavior.
15004 Do not short-circuit, because if we do, we
15005 report errors (ie, #if false && true would produce an invalid
15009 2002-11-24 Martin Baulig <martin@ximian.com>
15011 * expression.cs (Cast.TryReduce): If we're in checked syntax,
15012 check constant ranges and report a CS0221. Fixes #33186.
15014 2002-11-24 Martin Baulig <martin@ximian.com>
15016 * cs-parser.jay: Make this work for uninitialized variable
15017 declarations in the `for' initializer. Fixes #32416.
15019 2002-11-24 Martin Baulig <martin@ximian.com>
15021 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15022 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
15024 2002-11-24 Martin Baulig <martin@ximian.com>
15026 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15027 argument; if true, we also check for user-defined conversions.
15028 This is only needed if both arguments are of a user-defined type.
15029 Fixes #30443, added test-175.cs.
15030 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15032 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15034 2002-11-24 Martin Baulig <martin@ximian.com>
15036 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15037 function to get the store opcode.
15038 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15039 only emit the Ldelema if the store opcode is Stobj. You must run
15040 both test-34 and test-167 to test this. Fixes #34529.
15042 2002-11-23 Martin Baulig <martin@ximian.com>
15044 * ecore.cs (Expression.MemberLookup): Added additional
15045 `qualifier_type' argument which is used when we're being called
15046 from MemberAccess.DoResolve() and null if we're called from a
15048 (Expression.MemberLookupFailed): New method to report errors; this
15049 does the CS1540 check and reports the correct error message.
15051 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15052 argument for the CS1540 check and redone the way how we're dealing
15053 with private members. See the comment in the source code for details.
15054 (FilterWithClosure): Reverted this back to revision 1.197; renamed
15055 `closure_start_type' to `closure_qualifier_type' and check whether
15056 it's not null. It was not this filter being broken, it was just
15057 being called with the wrong arguments.
15059 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15060 and pass it the correct `qualifier_type'; this also does the error
15063 2002-11-22 Miguel de Icaza <miguel@ximian.com>
15065 * expression.cs (Invocation.EmitParams): If the we are dealing
15066 with a non-built-in value type, load its address as well.
15068 (ArrayCreation): Use a a pretty constant instead
15069 of the hardcoded value 2. Use 6 instead of 2 for the number of
15070 static initializers.
15072 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15073 because they are not really value types, just glorified integers.
15075 * driver.cs: Do not append .exe, the CSC compiler does not do it.
15077 * ecore.cs: Remove redundant code for enumerations, make them use
15078 the same code path as everything else, fixes the casting issue
15079 with enumerations in Windows.Forms.
15081 * attribute.cs: Do only cast to string if it is a string, the
15082 validation happens later.
15084 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15085 people upgrade their corlibs.
15087 * ecore.cs: Oops, enumerations were not following the entire code path
15089 2002-11-21 Miguel de Icaza <miguel@ximian.com>
15091 * typemanager.cs (FilterWithClosure): Commented out the test for
15092 1540 in typemanager.cs, as it has problems when accessing
15093 protected methods from a parent class (see test-174.cs).
15095 * attribute.cs (Attribute.ValidateGuid): new method.
15096 (Attribute.Resolve): Use above.
15098 2002-11-19 Miguel de Icaza <miguel@ximian.com>
15100 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15102 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15103 handling for enumerations, as we only needed the TypeContainer
15104 functionality to begin with (this is required for the fix below to
15105 work for enums that reference constants in a container class for
15108 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15110 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15111 a valid TypeBuilder to perform lookups on.o
15113 * class.cs (InheritableMemberSignatureCompare): Use true in the
15114 call to GetGetMethod and GetSetMethod, because we are comparing
15115 the signature, and we need to get the methods *even* if they are
15118 (PropertyBase.CheckBase): ditto.
15120 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15121 GotoCase.Resolve): Use Peel on EmpytCasts.
15123 * ecore.cs (EmptyCast): drop child, add Peel method.
15125 2002-11-17 Martin Baulig <martin@ximian.com>
15127 * ecore.cs (EmptyCast.Child): New public property.
15129 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15130 label resolved to an EmptyCast. Fixes #34162.
15131 (GotoCase.Resolve): Likewise.
15132 (Block.EmitMeta): Likewise.
15134 2002-11-17 Martin Baulig <martin@ximian.com>
15136 * expression.cs (Invocation.BetterConversion): Prefer int over
15137 uint; short over ushort; long over ulong for integer literals.
15138 Use ImplicitConversionExists instead of StandardConversionExists
15139 since we also need to check for user-defined implicit conversions.
15140 Fixes #34165. Added test-173.cs.
15142 2002-11-16 Martin Baulig <martin@ximian.com>
15144 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15145 with the `true' and `false' literals. Fixes #33151.
15147 2002-11-16 Martin Baulig <martin@ximian.com>
15149 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15150 October 22nd; don't do the cs1540 check for static members.
15152 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15153 now using our own filter here and doing the cs1540 check again.
15155 2002-11-16 Martin Baulig <martin@ximian.com>
15157 * support.cs (InternalParameters): Don't crash if we don't have
15158 any fixed parameters. Fixes #33532.
15160 2002-11-16 Martin Baulig <martin@ximian.com>
15162 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15163 when looking up static methods to make this work on Windows.
15166 2002-11-16 Martin Baulig <martin@ximian.com>
15168 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15169 a setter rather than using PropertyInfo.CanWrite.
15171 2002-11-15 Nick Drochak <ndrochak@gol.com>
15173 * class.cs: Allow acces to block member by subclasses. Fixes build
15176 2002-11-14 Martin Baulig <martin@ximian.com>
15178 * class.cs (Constructor.Emit): Added the extern/block check.
15181 2002-11-14 Martin Baulig <martin@ximian.com>
15183 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15184 iteration while looking for indexers, this is needed because the
15185 indexer may have a different name in our base classes. Fixed the
15186 error reporting (no indexers at all, not get accessor, no
15187 overloaded match). Fixes bug #33089.
15188 (IndexerAccess.DoResolveLValue): Likewise.
15190 2002-11-14 Martin Baulig <martin@ximian.com>
15192 * class.cs (PropertyBase.CheckBase): Make this work for multiple
15193 indexers. Fixes the first part of bug #33089.
15194 (MethodSignature.InheritableMemberSignatureCompare): Added support
15197 2002-11-13 Ravi Pratap <ravi@ximian.com>
15199 * attribute.cs (Attribute.Resolve): Catch the
15200 NullReferenceException and report it since it isn't supposed to
15203 2002-11-12 Miguel de Icaza <miguel@ximian.com>
15205 * expression.cs (Binary.EmitBranchable): Also handle the cases for
15206 LogicalOr and LogicalAnd that can benefit from recursively
15207 handling EmitBranchable. The code now should be nice for Paolo.
15209 2002-11-08 Miguel de Icaza <miguel@ximian.com>
15211 * typemanager.cs (LookupType): Added a negative-hit hashtable for
15212 the Type lookups, as we perform quite a number of lookups on
15213 non-Types. This can be removed once we can deterministically tell
15214 whether we have a type or a namespace in advance.
15216 But this might require special hacks from our corlib.
15220 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15221 and double which avoids a conversion from an integer to a double.
15223 * expression.cs: tiny optimization, avoid calling IsConstant,
15224 because it effectively performs the lookup twice.
15226 2002-11-06 Miguel de Icaza <miguel@ximian.com>
15228 But a bogus return here to keep the semantics of the old code
15229 until the Mono runtime is fixed.
15231 * pending.cs (GetMissingInterfaces): New method used to remove all
15232 the interfaces that are already implemented by our parent
15233 classes from the list of pending methods.
15235 * interface.cs: Add checks for calls after ResolveTypeExpr.
15237 2002-11-05 Miguel de Icaza <miguel@ximian.com>
15239 * class.cs (Class.Emit): Report warning 67: event not used if the
15240 warning level is beyond 3.
15242 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15243 being a NullLiteral.
15245 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15248 * class.cs (TypeContainer.GetClassBases): Cover a missing code
15249 path that might fail if a type can not be resolved.
15251 * expression.cs (Binary.Emit): Emit unsigned versions of the
15254 * driver.cs: use error 5.
15256 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15258 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15260 2002-11-01 Miguel de Icaza <miguel@ximian.com>
15262 * cs-parser.jay (switch_section): A beautiful patch from Martin
15263 Baulig that fixed 33094.
15265 2002-10-31 Miguel de Icaza <miguel@ximian.com>
15267 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15268 Check whether the base is abstract and report an error if so.
15270 * expression.cs (IndexerAccess.DoResolveLValue,
15271 IndexerAccess.DoResolve): ditto.
15273 (Invocation.DoResolve): ditto.
15275 (Invocation.FullMethodDesc): Improve the report string.
15277 * statement.cs (Block): Eliminate IsVariableDefined as it is
15278 basically just a wrapper for GetVariableInfo.
15280 * ecore.cs (SimpleName): Use new
15282 * support.cs (ReflectionParamter.ParameterType): We unwrap the
15283 type, as we return the actual parameter ref/unref state on a
15286 2002-10-30 Miguel de Icaza <miguel@ximian.com>
15288 * support.cs: Return proper flags REF/OUT fixing the previous
15291 * expression.cs: Reverted last patch, that was wrong. Is_ref is
15292 not used to mean `ref' but `ref or out' in ParameterReference
15294 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15295 full type signature instead of calling TypeManger.CSharpName
15298 * support.cs (InternalParameters.ParameterDesc): Do not compare
15299 directly to the modflags, because REF/OUT will actually be bitsets
15302 * delegate.cs (VerifyMethod): Check also the modifiers.
15304 * cs-tokenizer.cs: Fix bug where floating point values with an
15305 exponent where a sign was missing was ignored.
15307 * driver.cs: Allow multiple assemblies to be specified in a single
15310 2002-10-28 Miguel de Icaza <miguel@ximian.com>
15312 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
15313 because identifiers after a parenthesis would end up in this kind
15314 of production, and we needed to desamiguate it for having casts
15317 (UserDefinedType *) xxx
15319 2002-10-24 Miguel de Icaza <miguel@ximian.com>
15321 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15322 we should set on the Bindingflags.NonPublic, but not turn on
15323 private_ok. private_ok controls whether a Private member is
15324 returned (this is chekced on the filter routine), while the
15325 BindingFlags.NonPublic just controls whether private/protected
15326 will be allowed. This fixes the problem part of the problem of
15327 private properties being allowed to be used in derived classes.
15329 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15330 so we can call the children DoResolveLValue method (this will
15331 properly signal errors on lvalue assignments to base properties)
15333 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15334 getter are null, and we have a property info, we know that this
15335 happened because the lookup failed, so we report an error 122 for
15336 protection level violation.
15338 We also silently return if setter and getter are null in the
15339 resolve functions, this condition only happens if we have flagged
15340 the error before. This is the other half of the problem.
15342 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15343 not have accessibility information, that is why we were returning
15344 true in the filter function in typemanager.cs.
15346 To properly report 122 (property is inaccessible because of its
15347 protection level) correctly, we report this error in ResolveAccess
15348 by failing if both the setter and the getter are lacking (ie, the
15351 DoResolve and DoLResolve have been modified to check for both
15352 setter/getter being null and returning silently, the reason being
15353 that I did not want to put the knowledge about this error in upper
15356 int old = Report.Errors;
15357 x = new PropertyExpr (...);
15358 if (old != Report.Errors)
15363 So the property expr is returned, but it is invalid, so the error
15364 will be flagged during the resolve process.
15366 * class.cs: Remove InheritablePropertySignatureCompare from the
15367 class, as we no longer depend on the property signature to compute
15368 whether it is possible to implement a method or not.
15370 The reason is that calling PropertyInfo.GetGetMethod will return
15371 null (in .NET, in Mono it works, and we should change this), in
15372 cases where the Get Method does not exist in that particular
15377 class X { public virtual int A { get { return 1; } } }
15379 class Z : Y { public override int A { get { return 2; } } }
15381 Would fail in Z because the parent (Y) would not have the property
15382 defined. So we avoid this completely now (because the alternative
15383 fix was ugly and slow), and we now depend exclusively on the
15386 (PropertyBase.CheckBase): Use a method-base mechanism to find our
15387 reference method, instead of using the property.
15389 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15390 routines are gone now.
15392 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15393 names, they were incorrectly named.
15395 * cs-tokenizer.cs: Return are more gentle token on failure.
15397 * pending.cs (PendingImplementation.InterfaceMethod): This routine
15398 had an out-of-sync index variable, which caused it to remove from
15399 the list of pending methods the wrong method sometimes.
15401 2002-10-22 Miguel de Icaza <miguel@ximian.com>
15403 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15404 CanWrite, because those refer to this particular instance of the
15405 property, and do not take into account the fact that we can
15406 override single members of a property.
15408 Constructor requires an EmitContext. The resolution process does
15409 not happen here, but we need to compute the accessors before,
15410 because the resolution does not always happen for properties.
15412 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15413 subclass, before we did not update this flag, but we did update
15416 (GetAccessors): Drop this routine, as it did not work in the
15417 presence of partially overwritten set/get methods.
15419 Notice that this broke the cs1540 detection, but that will require
15422 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15426 * driver.cs: issue a warning instead of an error if we don't support
15427 debugging for the platform. Also ignore a couple of errors that may
15428 arise when trying to write the symbols. Undo my previous patch.
15430 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15432 * driver.cs: ignore /debug switch except for Unix platforms.
15434 2002-10-23 Nick Drochak <ndrochak@gol.com>
15436 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15438 2002-10-21 Miguel de Icaza <miguel@ximian.com>
15440 * driver.cs: Do not make mcs-debug conditional, so we do not break
15441 builds that use it.
15443 * statement.cs (UsageVector.MergeChildren): I would like Martin to
15444 review this patch. But basically after all the children variables
15445 have been merged, the value of "Breaks" was not being set to
15446 new_breaks for Switch blocks. I think that it should be set after
15447 it has executed. Currently I set this to the value of new_breaks,
15448 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15449 conservative, but I do not understand this code very well.
15451 I did not break anything in the build, so that is good ;-)
15453 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15455 2002-10-20 Mark Crichton <crichton@gimp.org>
15457 * cfold.cs: Fixed compile blocker. Really fixed it this time.
15459 2002-10-20 Nick Drochak <ndrochak@gol.com>
15461 * cfold.cs: Fixed compile blocker.
15463 2002-10-20 Miguel de Icaza <miguel@ximian.com>
15465 * driver.cs: I was chekcing the key, not the file.
15467 2002-10-19 Ravi Pratap <ravi@ximian.com>
15469 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15470 message that we were generating - we just need to silently return
15473 2002-10-19 Miguel de Icaza <miguel@ximian.com>
15475 * class.cs (Event.Define): Change my previous commit, as this
15476 breaks the debugger. This is a temporary hack, as it seems like
15477 the compiler is generating events incorrectly to begin with.
15479 * expression.cs (Binary.ResolveOperator): Added support for
15480 "U operator - (E x, E y)"
15482 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15485 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15486 init-only variables, but this path did not take into account that
15487 there might be also instance readonly variables. Correct this
15490 This fixes bug 32253
15492 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15495 * driver.cs: Change the extension for modules to `netmodule'
15497 * cs-parser.jay: Improved slightly the location tracking for
15498 the debugger symbols.
15500 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15501 modifiers that were specified instead of the hardcoded value
15502 (FamAndAssem). This was basically ignoring the static modifier,
15503 and others. Fixes 32429.
15505 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15506 fixed a bug in the process (32476)
15508 * expression.cs (ArrayAccess.EmitAssign): Patch from
15509 hwang_rob@yahoo.ca that fixes bug 31834.3
15511 2002-10-18 Miguel de Icaza <miguel@ximian.com>
15513 * driver.cs: Make the module extension .netmodule.
15515 2002-10-16 Miguel de Icaza <miguel@ximian.com>
15517 * driver.cs: Report an error if the resource file is not found
15518 instead of crashing.
15520 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15521 false, like Emit does.
15523 2002-10-16 Nick Drochak <ndrochak@gol.com>
15525 * typemanager.cs: Remove unused private member. Also reported mcs
15526 bug to report this as a warning like csc.
15528 2002-10-15 Martin Baulig <martin@gnome.org>
15530 * statement.cs (Statement.Emit): Made this a virtual method; emits
15531 the line number info and calls DoEmit().
15532 (Statement.DoEmit): New protected abstract method, formerly knows
15533 as Statement.Emit().
15535 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15537 2002-10-11 Miguel de Icaza <miguel@ximian.com>
15539 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15540 have fixed a remaining problem: not every AddXXXX was adding a
15541 fully qualified name.
15543 Now everyone registers a fully qualified name in the DeclSpace as
15544 being defined instead of the partial name.
15546 Downsides: we are slower than we need to be due to the excess
15547 copies and the names being registered this way.
15549 The reason for this is that we currently depend (on the corlib
15550 bootstrap for instance) that types are fully qualified, because
15551 we dump all the types in the namespace, and we should really have
15552 types inserted into the proper namespace, so we can only store the
15553 basenames in the defined_names array.
15555 2002-10-10 Martin Baulig <martin@gnome.org>
15557 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15558 from bug #31834, see the bug report for a testcase which is
15561 2002-10-10 Martin Baulig <martin@gnome.org>
15563 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15564 flow analysis code for this.
15566 * statement.cs (Do, While, For): Tell the flow analysis code about
15568 (FlowBranching.UsageVector): Added support for infinite loops.
15569 (Block.Resolve): Moved the dead code elimination here and use flow
15572 2002-10-09 Miguel de Icaza <miguel@ximian.com>
15574 * class.cs (Field.Define): Catch cycles on struct type
15577 * typemanager.cs (IsUnmanagedtype): Do not recursively check
15578 fields if the fields are static. We only need to check instance
15581 * expression.cs (As.DoResolve): Test for reference type.
15583 * statement.cs (Using.ResolveExpression): Use
15584 ConvertImplicitRequired, not ConvertImplicit which reports an
15586 (Using.ResolveLocalVariableDecls): ditto.
15588 * expression.cs (Binary.ResolveOperator): Report errors in a few
15589 places where we had to.
15591 * typemanager.cs (IsUnmanagedtype): Finish implementation.
15593 2002-10-08 Miguel de Icaza <miguel@ximian.com>
15595 * expression.cs: Use StoreFromPtr instead of extracting the type
15596 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
15598 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15599 an enumeration value to a System.Enum, but System.Enum is not a
15600 value type, but an class type, so we need to box.
15602 (Expression.ConvertExplicit): One codepath could return
15603 errors but not flag them. Fix this. Fixes #31853
15605 * parameter.cs (Resolve): Do not allow void as a parameter type.
15607 2002-10-06 Martin Baulig <martin@gnome.org>
15609 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15610 if it's a class type and not a struct. Fixes #31815.
15612 2002-10-06 Martin Baulig <martin@gnome.org>
15614 * statement.cs: Reworked the flow analysis code a bit to make it
15615 usable for dead code elimination.
15617 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15619 * cs-parser.jay: allow empty source files. Fixes bug #31781.
15621 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15623 * expression.cs (ComposedCast.DoResolveType): A quick workaround
15624 to fix the test 165, will investigate deeper.
15626 2002-10-04 Martin Baulig <martin@gnome.org>
15628 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15629 finally blocks actually work.
15630 (Try.Resolve): We don't need to create a sibling for `finally' if
15631 there is no finally block.
15633 2002-10-04 Martin Baulig <martin@gnome.org>
15635 * class.cs (Constructor.Define): The default accessibility for a
15636 non-default constructor is private, not public.
15638 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15640 * class.cs (Constructor): Make AllowedModifiers public, add
15643 * cs-parser.jay: Perform the modifiers test here, as the
15644 constructor for the Constructor class usually receives a zero
15645 because of the way we create it (first we create, later we
15646 customize, and we were never checking the modifiers).
15648 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15649 is a version of LookupTypeReflection that includes the type-name
15650 cache. This can be used as a fast path for functions that know
15651 the fully qualified name and are only calling into *.GetType() to
15652 obtain a composed type.
15654 This is also used by TypeManager.LookupType during its type
15657 (LookupType): We now also track the real type name, as sometimes
15658 we can get a quey for the real type name from things like
15659 ComposedCast. This fixes bug 31422.
15661 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15662 complete type fullname, it does not have to go through the type
15663 resolution system to obtain the composed version of the type (for
15664 obtaining arrays or pointers).
15666 (Conditional.Emit): Use the EmitBoolExpression to
15667 generate nicer code, as requested by Paolo.
15669 (ArrayCreation.CheckIndices): Use the patch from
15670 hwang_rob@yahoo.ca to validate the array initializers.
15672 2002-10-03 Miguel de Icaza <miguel@ximian.com>
15674 * class.cs (ConstructorInitializer.Emit): simplify code by using
15675 Invocation.EmitCall, and at the same time, fix the bugs in calling
15676 parent constructors that took variable arguments.
15678 * ecore.cs (Expression.ConvertNumericExplicit,
15679 Expression.ImplicitNumericConversion): Remove the code that
15680 manually wrapped decimal (InternalTypeConstructor call is now gone
15683 * expression.cs (Cast.TryReduce): Also handle decimal types when
15684 trying to perform a constant fold on the type.
15686 * typemanager.cs (IsUnmanagedtype): Partially implemented.
15688 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15689 that only turned off an error report, and did nothing else.
15691 2002-10-02 Miguel de Icaza <miguel@ximian.com>
15693 * driver.cs: Handle and ignore /fullpaths
15695 2002-10-01 Miguel de Icaza <miguel@ximian.com>
15697 * expression.cs (Binary.ResolveOperator): Catch the case where
15698 DoNumericPromotions returns true,
15700 (Binary.DoNumericPromotions): Simplify the code, and the tests.
15702 2002-09-27 Miguel de Icaza <miguel@ximian.com>
15704 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15707 2002-09-26 Miguel de Icaza <miguel@ximian.com>
15709 * ecore.cs (ConvertNumericExplicit): It is not enough that the
15710 conversion exists, but it is also required that the conversion be
15711 performed. This manifested in "(Type64Enum) 2".
15713 * class.cs (TypeManager.AddMethod): The fix is not to change
15714 AddEnum, because that one was using a fully qualified name (every
15715 DeclSpace derivative does), but to change the AddMethod routine
15716 that was using an un-namespaced name. This now correctly reports
15717 the duplicated name.
15719 Revert patch until I can properly fix it. The issue
15720 is that we have a shared Type space across all namespaces
15721 currently, which is wrong.
15723 Options include making the Namespace a DeclSpace, and merge
15724 current_namespace/current_container in the parser.
15726 2002-09-25 Miguel de Icaza <miguel@ximian.com>
15728 * cs-parser.jay: Improve error reporting when we get a different
15729 kind of expression in local_variable_type and
15730 local_variable_pointer_type.
15732 Propagate this to avoid missleading errors being reported.
15734 * ecore.cs (ImplicitReferenceConversion): treat
15735 TypeManager.value_type as a target just like object_type. As
15740 Is valid, and needs to result in the int 1 being boxed before it
15741 is assigned to the value type v.
15743 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15744 to validate the enumeration name.
15746 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15747 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
15748 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15750 * ecore.cs (TryImplicitIntConversion): When doing an
15751 implicit-enumeration-conversion, check if the type is 64-bits and
15752 perform a conversion before passing to EnumConstant.
15754 2002-09-23 Miguel de Icaza <miguel@ximian.com>
15756 * decl.cs (Error_AmbiguousTypeReference); New routine used to
15757 report ambiguous type references. Unlike the MS version, we
15758 report what the ambiguity is. Innovation at work ;-)
15760 (DeclSpace.FindType): Require a location argument to
15761 display when we display an ambiguous error.
15763 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15765 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15767 * expression.cs (EmitDynamicInitializers): Apply patch from
15768 hwang_rob@yahoo.ca that fixes the order in which we emit our
15771 2002-09-21 Martin Baulig <martin@gnome.org>
15773 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15774 delegate takes no arguments.
15776 2002-09-20 Miguel de Icaza <miguel@ximian.com>
15778 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15781 * expression.cs: Extract the underlying type.
15783 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15785 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15787 2002-09-19 Miguel de Icaza <miguel@ximian.com>
15789 * class.cs (TypeContainer.DefineType): We can not use the nice
15790 PackingSize with the size set to 1 DefineType method, because it
15791 will not allow us to define the interfaces that the struct
15794 This completes the fixing of bug 27287
15796 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15797 means also structs. This fixes part of the problem.
15798 (Expresion.ImplicitReferenceConversionExists): ditto.
15800 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15801 error if there were no errors reported during the type lookup
15802 process, to avoid duplicates or redundant errors. Without this
15803 you would get an ambiguous errors plus a type not found. We have
15804 beaten the user enough with the first error.
15806 (DeclSparce.FindType): Emit a warning if we have an ambiguous
15809 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15810 during the resolution process, stop the lookup, this avoids
15811 repeated error reports (same error twice).
15813 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15815 * typemanager.cs (LookupType): Redo the type lookup code to match
15816 the needs of System.Reflection.
15818 The issue is that System.Reflection requires references to nested
15819 types to begin with a "+" sign instead of a dot. So toplevel
15820 types look like: "NameSpace.TopLevelClass", and nested ones look
15821 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15824 2002-09-19 Martin Baulig <martin@gnome.org>
15826 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15827 says that a method always returns or always throws an exception,
15828 don't report the CS0161.
15830 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15831 set `Returns = new_returns'.
15833 2002-09-19 Martin Baulig <martin@gnome.org>
15835 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15836 to an enum constant, check for a CS0176.
15838 2002-09-18 Miguel de Icaza <miguel@ximian.com>
15840 * class.cs (TypeContainer.CheckPairedOperators): Now we check
15841 for operators that must be in pairs and report errors.
15843 * ecore.cs (SimpleName.DoResolveType): During the initial type
15844 resolution process, when we define types recursively, we must
15845 check first for types in our current scope before we perform
15846 lookups in the enclosing scopes.
15848 * expression.cs (MakeByteBlob): Handle Decimal blobs.
15850 (Invocation.VerifyArgumentsCompat): Call
15851 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15852 I thought we were supposed to always call this, but there are a
15853 few places in the code where we dont do it.
15855 2002-09-17 Miguel de Icaza <miguel@ximian.com>
15857 * driver.cs: Add support in -linkres and -resource to specify the
15858 name of the identifier.
15860 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15862 * ecore.cs (StandardConversionExists): Sync with the conversion
15863 code: allow anything-* to void* conversions.
15865 (FindMostSpecificSource): Use an Expression argument
15866 instead of a Type, because we might be handed over a Literal which
15867 gets a few more implicit conversions that plain types do not. So
15868 this information was being lost.
15870 Also, we drop the temporary type-holder expression when not
15873 2002-09-17 Martin Baulig <martin@gnome.org>
15875 * class.cs (PropertyBase.CheckBase): Don't check the base class if
15876 this is an explicit interface implementation.
15878 2002-09-17 Martin Baulig <martin@gnome.org>
15880 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15881 different `IndexerName' attributes.
15883 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15884 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15885 virtual CommonResolve().
15887 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15889 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15890 and convert that to the UnderlyingType.
15892 * statement.cs (Foreach.Resolve): Indexers are just like variables
15893 or PropertyAccesses.
15895 * cs-tokenizer.cs (consume_string): Track line numbers and columns
15896 inside quoted strings, we were not doing this before.
15898 2002-09-16 Martin Baulig <martin@gnome.org>
15900 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15901 resolve it. This is needed for the definite assignment check of the
15902 instance expression, fixes bug #29846.
15903 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15905 2002-09-16 Nick Drochak <ndrochak@gol.com>
15907 * parameter.cs: Fix compile error. Cannot reference static member
15908 from an instance object. Is this an mcs bug?
15910 2002-09-14 Martin Baulig <martin@gnome.org>
15912 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15913 multiple times. Fixes bug #30295, added test-166.cs.
15915 2002-09-14 Martin Baulig <martin@gnome.org>
15917 * statement.cs (Block.Emit): Don't emit unreachable code.
15918 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15919 `break' statements.
15920 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15922 2002-09-14 Martin Baulig <martin@gnome.org>
15924 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15927 2002-09-14 Martin Baulig <martin@gnome.org>
15929 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15930 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15931 be false on the ms runtime.
15933 2002-09-13 Martin Baulig <martin@gnome.org>
15935 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15936 the CS0038 error message.
15938 2002-09-12 Miguel de Icaza <miguel@ximian.com>
15940 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15941 constant inside, return it.
15943 2002-09-12 Martin Baulig <martin@gnome.org>
15945 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15946 implicit conversion can be done between enum types.
15948 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15949 check whether an implicit conversion to the current enum's UnderlyingType
15950 exists and report an error if not.
15952 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15953 without debugging support.
15955 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15956 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
15958 2002-09-12 Martin Baulig <martin@gnome.org>
15960 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15962 * ecore.cs (IMemberExpr.DeclaringType): New property.
15963 (SimpleName.SimpleNameResolve): Check whether we're accessing a
15964 nonstatic member of an outer type (CS0038).
15966 2002-09-11 Miguel de Icaza <miguel@ximian.com>
15968 * driver.cs: Activate the using-error detector at warning level
15969 4 (at least for MS-compatible APIs).
15971 * namespace.cs (VerifyUsing): Small buglett fix.
15973 * pending.cs (PendingImplementation): pass the container pointer.
15975 * interface.cs (GetMethods): Allow for recursive definition. Long
15976 term, I would like to move every type to support recursive
15977 definitions, not the current ordering mechanism that we have right
15980 The situation is this: Attributes are handled before interfaces,
15981 so we can apply attributes to interfaces. But some attributes
15982 implement interfaces, we will now handle the simple cases
15983 (recursive definitions will just get an error).
15985 * parameter.cs: Only invalidate types at the end if we fail to
15988 2002-09-09 Martin Baulig <martin@gnome.org>
15990 * ecore.cs (PropertyExpr.Emit): Also check for
15991 TypeManager.system_int_array_get_length so this'll also work when
15992 compiling corlib. Fixes #30003.
15994 2002-09-09 Martin Baulig <martin@gnome.org>
15996 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15997 and throw an exception if we can't get the type's size. Fixed #30040,
16000 2002-09-09 Martin Baulig <martin@gnome.org>
16002 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16004 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16005 context. Fixes bug #30027.
16007 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16008 virtual functions. Fixes bug #30043, added test-164.cs.
16010 2002-09-08 Ravi Pratap <ravi@ximian.com>
16012 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16014 2002-09-08 Nick Drochak <ndrochak@gol.com>
16016 * driver.cs: Use an object to get the windows codepage since it's not a
16019 2002-09-08 Miguel de Icaza <miguel@ximian.com>
16021 * statement.cs (For.Emit): for infinite loops (test == null)
16022 return whether there is a break inside, not always "true".
16024 * namespace.cs (UsingEntry): New struct to hold the name of the
16025 using definition, the location where it is defined, and whether it
16026 has been used in a successful type lookup.
16028 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16033 2002-09-06 Ravi Pratap <ravi@ximian.com>
16035 * attribute.cs : Fix incorrect code which relied on catching
16036 a NullReferenceException to detect a null being passed in
16037 where an object was expected.
16039 2002-09-06 Miguel de Icaza <miguel@ximian.com>
16041 * statement.cs (Try): flag the catch variable as assigned
16043 * expression.cs (Cast): Simplified by using ResolveType instead of
16044 manually resolving.
16046 * statement.cs (Catch): Fix bug by using ResolveType.
16048 2002-09-06 Ravi Pratap <ravi@ximian.com>
16050 * expression.cs (BetterConversion): Special case for when we have
16051 a NullLiteral as the argument and we have to choose between string
16052 and object types - we choose string the way csc does.
16054 * attribute.cs (Attribute.Resolve): Catch the
16055 NullReferenceException and report error #182 since the Mono
16056 runtime no more has the bug and having this exception raised means
16057 we tried to select a constructor which takes an object and is
16060 2002-09-05 Ravi Pratap <ravi@ximian.com>
16062 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16063 message (1502, 1503) when we can't locate a method after overload
16064 resolution. This is much more informative and closes the bug
16067 * interface.cs (PopulateMethod): Return if there are no argument
16068 types. Fixes a NullReferenceException bug.
16070 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16071 expressions too. Previously we were checking only in one place for
16072 positional arguments leaving out named arguments.
16074 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16075 type to the enum type is not allowed. Remove code corresponding to
16078 (ConvertNumericExplicit): Allow explicit conversions from
16079 the underlying type to enum type. This precisely follows the spec
16080 and closes a bug filed by Gonzalo.
16082 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16085 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16087 2002-09-03 Miguel de Icaza <miguel@ximian.com>
16089 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16090 it was important that we stored the right value after the
16091 reduction in `converted'.
16093 2002-09-04 Martin Baulig <martin@gnome.org>
16095 * location.cs (Location.SymbolDocument): Use full pathnames for the
16098 2002-08-30 Miguel de Icaza <miguel@ximian.com>
16100 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16101 of the expression resolve mechanism, because that will catch the
16102 SimpleName error failures.
16104 (Conditional): If we can not resolve the
16105 expression, return, do not crash.
16107 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16110 (location): display token name instead of its number.
16112 2002-08-28 Martin Baulig <martin@gnome.org>
16114 * expression.cs (Binary.ResolveOperator): Don't silently return
16115 but return an error if an operator cannot be applied between two
16118 2002-08-28 Martin Baulig <martin@gnome.org>
16120 * class.cs (Constructor.Define): Set the permission attributes
16121 correctly instead of making all constructors public.
16123 2002-08-28 Martin Baulig <martin@gnome.org>
16125 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16126 for private members before reporting a CS0103; if we find anything,
16129 2002-08-28 Martin Baulig <martin@gnome.org>
16131 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16132 to check whether `closure_start_type == closure_invocation_type',
16133 we also need to check whether `m.DeclaringType == closure_invocation_type'
16134 before bypassing the permission checks. We might be accessing
16135 protected/private members from the base class.
16136 (TypeManager.RealMemberLookup): Only set private_ok if private
16137 members were requested via BindingFlags.NonPublic.
16139 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16141 * expression.cs (MemberAccess.ResolveMemberAccess): Set
16142 MethodGroupExpr.IsExplicitImpl if appropriate.
16143 (Invocation.DoResolve): Don't report the CS0120 for explicit
16144 interface implementations.
16146 2002-08-27 Martin Baulig <martin@gnome.org>
16148 * expression.cs (Invocation.DoResolve): If this is a static
16149 method and we don't have an InstanceExpression, we must report
16152 2002-08-25 Martin Baulig <martin@gnome.org>
16154 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16155 `==' between a valuetype and an object.
16157 2002-08-25 Miguel de Icaza <miguel@ximian.com>
16159 * ecore.cs (TypeExpr): Provide a ToString method.
16161 2002-08-24 Martin Baulig <martin@gnome.org>
16163 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16164 now called proggie.dbg and it's a binary file.
16166 2002-08-23 Martin Baulig <martin@gnome.org>
16168 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16170 2002-08-23 Martin Baulig <martin@gnome.org>
16172 * struct.cs (MyStructInfo.ctor): Make this work with empty
16173 structs; it's not allowed to use foreach() on null.
16175 2002-08-23 Martin Baulig <martin@gnome.org>
16177 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16178 writer the full pathname of the generated assembly.
16180 2002-08-23 Martin Baulig <martin@gnome.org>
16182 * statements.cs (FlowBranching.UsageVector.MergeChildren):
16183 A `finally' block never returns or breaks; improved handling of
16186 2002-08-23 Martin Baulig <martin@gnome.org>
16188 * statement.cs (Throw.Resolve): Allow `throw null'.
16190 2002-08-23 Martin Baulig <martin@gnome.org>
16192 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16193 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16194 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
16195 MemberLookup would return a wrong event if this is an explicit
16196 interface implementation and the class has an event with the same
16199 2002-08-23 Martin Baulig <martin@gnome.org>
16201 * statement.cs (Block.AddChildVariableNames): New public method.
16202 (Block.AddChildVariableName): Likewise.
16203 (Block.IsVariableNameUsedInChildBlock): Likewise.
16204 (Block.AddVariable): Check whether a variable name has already
16205 been used in a child block.
16207 * cs-parser.jay (declare_local_variables): Mark all variable names
16208 from the current block as being used in a child block in the
16211 2002-08-23 Martin Baulig <martin@gnome.org>
16213 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16214 find the symbol writer.
16216 * driver.cs: csc also allows the arguments to /define being
16217 separated by commas, not only by semicolons.
16219 2002-08-23 Martin Baulig <martin@gnome.org>
16221 * interface.cs (Interface.GetMembers): Added static check for events.
16223 2002-08-15 Martin Baulig <martin@gnome.org>
16225 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16226 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16228 * ecore.cs (Expression.MemberLookup): Added documentation and explained
16229 why the MethodData.EmitDestructor() change was necessary.
16231 2002-08-20 Martin Baulig <martin@gnome.org>
16233 * class.cs (TypeContainer.FindMembers): Added static check for events.
16235 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16237 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16238 use Type.GetEvents(), not Type.FindMembers().
16240 2002-08-20 Martin Baulig <martin@gnome.org>
16242 * decl.cs (MemberCache): Added a special method cache which will
16243 be used for method-only searched. This ensures that a method
16244 search will return a MethodInfo with the correct ReflectedType for
16247 2002-08-20 Martin Baulig <martin@gnome.org>
16249 * decl.cs (DeclSpace.FindMembers): Made this public.
16251 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16253 * delegate.cs: fixed build on windows.
16254 [FIXME: Filed as bug #29150: MCS must report these errors.]
16256 2002-08-19 Ravi Pratap <ravi@ximian.com>
16258 * ecore.cs (StandardConversionExists): Return a false
16259 if we are trying to convert the void type to anything else
16260 since that is not allowed.
16262 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16263 we flag error 70 in the event an event is trying to be accessed
16264 directly from outside the declaring type.
16266 2002-08-20 Martin Baulig <martin@gnome.org>
16268 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16269 MemberCache from typemanager.cs to decl.cs.
16271 2002-08-19 Martin Baulig <martin@gnome.org>
16273 * class.cs (TypeContainer): Implement IMemberContainer.
16274 (TypeContainer.DefineMembers): Create the MemberCache.
16275 (TypeContainer.FindMembers): Do better BindingFlags checking; only
16276 return public members if BindingFlags.Public was given, check
16277 whether members are static.
16279 2002-08-16 Martin Baulig <martin@gnome.org>
16281 * decl.cs (DeclSpace.Define): Splitted this in Define and
16282 DefineMembers. DefineMembers is called first and initializes the
16285 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
16286 DefineMembers() on all our DeclSpaces.
16288 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16289 but call DefineMembers() on all nested interfaces. We call their
16290 Define() in our new Define() function.
16292 * interface.cs (Interface): Implement IMemberContainer.
16293 (Interface.Define): Moved all code except the attribute stuf to
16295 (Interface.DefineMembers): Initialize the member cache.
16297 * typemanager.cs (IMemberFinder): Removed this interface, we don't
16298 need this anymore since we can use MemberCache.FindMembers directly.
16300 2002-08-19 Martin Baulig <martin@gnome.org>
16302 * typemanager.cs (MemberCache): When creating the cache for an
16303 interface type, add all inherited members.
16304 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16305 to `out bool used_cache' and documented it.
16306 (TypeManager.MemberLookup): If we already used the cache in the first
16307 iteration, we don't need to do the interfaces check.
16309 2002-08-19 Martin Baulig <martin@gnome.org>
16311 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
16312 here from IMemberFinder and don't implement this interface anymore.
16313 (DeclSpace.MemberCache): Moved here from IMemberFinder.
16315 * typemanager.cs (IMemberFinder): This interface is now only used by
16316 classes which actually support the member cache.
16317 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16318 since we only put DeclSpaces into this Hashtable.
16319 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16320 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16322 2002-08-16 Martin Baulig <martin@gnome.org>
16324 * typemanager.cs (ICachingMemberFinder): Removed.
16325 (IMemberFinder.MemberCache): New property.
16326 (TypeManager.FindMembers): Merged this with RealFindMembers().
16327 This function will never be called from TypeManager.MemberLookup()
16328 so we can't use the cache here, just the IMemberFinder.
16329 (TypeManager.MemberLookup_FindMembers): Check whether the
16330 IMemberFinder has a MemberCache and call the cache's FindMembers
16332 (MemberCache): Rewrote larger parts of this yet another time and
16333 cleaned it up a bit.
16335 2002-08-15 Miguel de Icaza <miguel@ximian.com>
16337 * driver.cs (LoadArgs): Support quoting.
16339 (Usage): Show the CSC-like command line arguments.
16341 Improved a few error messages.
16343 2002-08-15 Martin Baulig <martin@gnome.org>
16345 * typemanager.cs (IMemberContainer.Type): New property.
16346 (IMemberContainer.IsInterface): New property.
16348 The following changes are conditional to BROKEN_RUNTIME, which is
16349 defined at the top of the file.
16351 * typemanager.cs (MemberCache.MemberCache): Don't add the base
16352 class'es members, but add all members from TypeHandle.ObjectType
16353 if we're an interface.
16354 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16355 is the current type.
16356 (MemberCache.CacheEntry.Container): Removed this field.
16357 (TypeHandle.GetMembers): Include inherited members.
16359 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16361 * typemanager.cs: fixed compilation and added a comment on a field that
16364 2002-08-15 Martin Baulig <martin@gnome.org>
16366 * class.cs (ConstructorInitializer.Resolve): In the
16367 Expression.MemberLookup call, use the queried_type as
16370 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16371 declared' attribute, it's always true.
16372 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16373 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16374 temporary wrapper for FindMembers which tells MemberLookup whether
16375 members from the base classes are included in the return value.
16376 This will go away soon.
16377 (TypeManager.MemberLookup): Use this temporary hack here; once the
16378 new MemberCache is completed, we don't need to do the DeclaredOnly
16379 looping here anymore since the MemberCache will take care of this.
16380 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16381 (MemberCache): When creating the MemberCache for a class, get
16382 members from the current class and all its base classes.
16383 (MemberCache.CacheEntry.Container): New field. This is a
16384 temporary hack until the Mono runtime is fixed to distinguish
16385 between ReflectedType and DeclaringType. It allows us to use MCS
16386 with both the MS runtime and the unfixed Mono runtime without
16387 problems and without accecting performance.
16388 (MemberCache.SearchMembers): The DeclaredOnly looping from
16389 TypeManager.MemberLookup is now done here.
16391 2002-08-14 Martin Baulig <martin@gnome.org>
16393 * statement.cs (MyStructInfo.MyStructInfo): Don't call
16394 Type.GetFields on dynamic types but get the fields from the
16395 corresponding TypeContainer.
16396 (MyStructInfo.GetStructInfo): Added check for enum types.
16398 * typemanager.cs (MemberList.IsSynchronized): Implemented.
16399 (MemberList.SyncRoot): Implemented.
16400 (TypeManager.FilterWithClosure): No need to check permissions if
16401 closure_start_type == closure_invocation_type, don't crash if
16402 closure_invocation_type is null.
16404 2002-08-13 Martin Baulig <martin@gnome.org>
16406 Rewrote TypeContainer.FindMembers to use a member cache. This
16407 gives us a speed increase of about 35% for the self-hosting MCS
16408 build and of about 15-20% for the class libs (both on GNU/Linux).
16410 * report.cs (Timer): New class to get enhanced profiling. This
16411 whole class is "TIMER" conditional since it remarkably slows down
16414 * class.cs (MemberList): New class. This is an IList wrapper
16415 which we're now using instead of passing MemberInfo[]'s around to
16416 avoid copying this array unnecessarily.
16417 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16418 (ICachingMemberFinder, IMemberContainer): New interface.
16419 (TypeManager.FilterWithClosure): If `criteria' is null, the name
16420 has already been checked, otherwise use it for the name comparision.
16421 (TypeManager.FindMembers): Renamed to RealMemberFinder and
16422 provided wrapper which tries to use ICachingMemberFinder.FindMembers
16423 if possible. Returns a MemberList, not a MemberInfo [].
16424 (TypeHandle): New class, implements IMemberContainer. We create
16425 one instance of this class per type, it contains a MemberCache
16426 which is used to do the member lookups.
16427 (MemberCache): New class. Each instance of this class contains
16428 all members of a type and a name-based hash table.
16429 (MemberCache.FindMembers): This is our new member lookup
16430 function. First, it looks up all members of the requested name in
16431 the hash table. Then, it walks this list and sorts out all
16432 applicable members and returns them.
16434 2002-08-13 Martin Baulig <martin@gnome.org>
16436 In addition to a nice code cleanup, this gives us a performance
16437 increase of about 1.4% on GNU/Linux - not much, but it's already
16438 half a second for the self-hosting MCS compilation.
16440 * typemanager.cs (IMemberFinder): New interface. It is used by
16441 TypeManager.FindMembers to call FindMembers on a TypeContainer,
16442 Enum, Delegate or Interface.
16443 (TypeManager.finder_to_member_finder): New PtrHashtable.
16444 (TypeManager.finder_to_container): Removed.
16445 (TypeManager.finder_to_delegate): Removed.
16446 (TypeManager.finder_to_interface): Removed.
16447 (TypeManager.finder_to_enum): Removed.
16449 * interface.cs (Interface): Implement IMemberFinder.
16451 * delegate.cs (Delegate): Implement IMemberFinder.
16453 * enum.cs (Enum): Implement IMemberFinder.
16455 * class.cs (TypeContainer): Implement IMemberFinder.
16457 2002-08-12 Martin Baulig <martin@gnome.org>
16459 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16461 2002-08-12 Martin Baulig <martin@gnome.org>
16463 * ecore.cs (ITypeExpression): New interface for expressions which
16465 (TypeExpression): Renamed to TypeLookupExpression.
16466 (Expression.DoResolve): If we're doing a types-only lookup, the
16467 expression must implement the ITypeExpression interface and we
16468 call DoResolveType() on it.
16469 (SimpleName): Implement the new ITypeExpression interface.
16470 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16471 hack, the situation that we're only looking up types can't happen
16472 anymore when this method is called. Moved the type lookup code to
16473 DoResolveType() and call it.
16474 (SimpleName.DoResolveType): This ITypeExpression interface method
16475 is now doing the types-only lookup.
16476 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16477 (ResolveFlags): Added MaskExprClass.
16479 * expression.cs (MemberAccess): Implement the ITypeExpression
16481 (MemberAccess.DoResolve): Added support for a types-only lookup
16482 when we're called via ITypeExpression.DoResolveType().
16483 (ComposedCast): Implement the ITypeExpression interface.
16485 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
16486 Expression.Resolve() with ResolveFlags.Type instead.
16488 2002-08-12 Martin Baulig <martin@gnome.org>
16490 * interface.cs (Interface.Define): Apply attributes.
16492 * attribute.cs (Attribute.ApplyAttributes): Added support for
16493 interface attributes.
16495 2002-08-11 Martin Baulig <martin@gnome.org>
16497 * statement.cs (Block.Emit): Only check the "this" variable if we
16498 do not always throw an exception.
16500 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16501 whether the property has a set accessor.
16503 2002-08-11 Martin Baulig <martin@gnome.org>
16505 Added control flow analysis support for structs.
16507 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16508 with control flow analysis turned off.
16509 (IVariable): New interface.
16510 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16511 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16512 (FieldExpr.DoResolve): Resolve the instance expression with flow
16513 analysis turned off and do the definite assignment check after the
16514 resolving when we know what the expression will resolve to.
16516 * expression.cs (LocalVariableReference, ParameterReference):
16517 Implement the new IVariable interface, only call the flow analysis
16518 code if ec.DoFlowAnalysis is true.
16519 (This): Added constructor which takes a Block argument. Implement
16520 the new IVariable interface.
16521 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16522 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16523 This does the definite assignment checks for struct members.
16525 * class.cs (Constructor.Emit): If this is a non-static `struct'
16526 constructor which doesn't have any initializer, call
16527 Block.AddThisVariable() to tell the flow analysis code that all
16528 struct elements must be initialized before control returns from
16531 * statement.cs (MyStructInfo): New public class.
16532 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16533 argument to this indexer. If non-zero, check an individual struct
16534 member, not the whole struct.
16535 (FlowBranching.CheckOutParameters): Check struct members.
16536 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16537 overloaded versions of these methods which take an additional
16538 `int field_idx' argument to check struct members.
16539 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16540 overloaded versions of these methods which take an additional
16541 `string field_name' argument to check struct member.s
16542 (VariableInfo): Implement the IVariable interface.
16543 (VariableInfo.StructInfo): New public property. Returns the
16544 MyStructInfo instance of the variable if it's a struct or null.
16545 (Block.AddThisVariable): New public method. This is called from
16546 Constructor.Emit() for non-static `struct' constructor which do
16547 not have any initializer. It creates a special variable for the
16548 "this" instance variable which will be checked by the flow
16549 analysis code to ensure that all of the struct's fields are
16550 initialized before control returns from the constructor.
16551 (UsageVector): Added support for struct members. If a
16552 variable/parameter is a struct with N members, we reserve a slot
16553 in the usage vector for each member. A struct is considered fully
16554 initialized if either the struct itself (slot 0) or all its
16555 members are initialized.
16557 2002-08-08 Martin Baulig <martin@gnome.org>
16559 * driver.cs (Driver.MainDriver): Only report an error CS5001
16560 if there were no compilation errors.
16562 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16563 `UnsafeContext' property to determine whether the parent is in
16564 unsafe context rather than checking the parent's ModFlags:
16565 classes nested in an unsafe class are unsafe as well.
16567 2002-08-08 Martin Baulig <martin@gnome.org>
16569 * statement.cs (UsageVector.MergeChildren): Distinguish between
16570 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16571 we return. Added test17() and test18() to test-154.cs.
16573 2002-08-08 Martin Baulig <martin@gnome.org>
16575 * typemanager.cs (TypeManager.FilterWithClosure): If we have
16576 Family access, make sure the invoking type isn't a subclass of the
16577 queried type (that'd be a CS1540).
16579 * ecore.cs (Expression.MemberLookup): Added overloaded version of
16580 this method which takes an additional `Type invocation_type'.
16582 * expression.cs (BaseAccess.DoResolve): Use the base type as
16583 invocation and query type.
16584 (MemberAccess.DoResolve): If the lookup failed and we're about to
16585 report a CS0122, try a lookup with the ec.ContainerType - if this
16586 succeeds, we must report a CS1540.
16588 2002-08-08 Martin Baulig <martin@gnome.org>
16590 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16591 (MethodGroupExpr): Implement the IMemberExpr interface.
16593 * expression (MemberAccess.ResolveMemberAccess): No need to have
16594 any special code for MethodGroupExprs anymore, they're now
16597 2002-08-08 Martin Baulig <martin@gnome.org>
16599 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16600 Family, FamANDAssem and FamORAssem permissions.
16601 (TypeManager.IsSubclassOrNestedChildOf): New public method.
16603 2002-08-08 Martin Baulig <martin@gnome.org>
16605 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16606 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16609 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16611 * driver.cs: implemented /resource option to embed managed resources.
16613 2002-08-07 Martin Baulig <martin@gnome.org>
16615 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16616 (FieldBase.HasFieldInitializer): New public property.
16617 (FieldBase.GetInitializerExpression): New public method. Resolves and
16618 returns the field initializer and makes sure it is only resolved once.
16619 (TypeContainer.EmitFieldInitializers): Call
16620 FieldBase.GetInitializerExpression to get the initializer, this ensures
16621 that it isn't resolved multiple times.
16623 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
16624 the resolving process (SimpleName/MemberLookup) that we're currently
16625 emitting a field initializer (which must not access any instance members,
16626 this is an error CS0236).
16628 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16629 argument, if the `IsFieldInitializer' flag is set, we must report and
16630 error CS0236 and not an error CS0120.
16632 2002-08-07 Martin Baulig <martin@gnome.org>
16634 * ecore.cs (IMemberExpr): New public interface.
16635 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16636 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16637 if the expression is an IMemberExpr.
16639 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16640 to be null, implicitly default to `this' if we're non-static in
16641 this case. Simplified the code a lot by using the new IMemberExpr
16642 interface. Also fixed bug #28176 here.
16644 2002-08-06 Martin Baulig <martin@gnome.org>
16646 * cs-parser.jay (SimpleLookup): Removed. We need to create
16647 ParameterReferences during semantic analysis so that we can do a
16648 type-only search when resolving Cast, TypeOf and SizeOf.
16649 (block): Pass the `current_local_parameters' to the Block's
16652 * class.cs (ConstructorInitializer): Added `Parameters parameters'
16653 argument to the constructor.
16654 (ConstructorInitializer.Resolve): Create a temporary implicit
16655 block with the parameters.
16657 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16658 references here if we aren't doing a type-only search.
16660 * statement.cs (Block): Added constructor which takes a
16661 `Parameters parameters' argument.
16662 (Block.Parameters): New public property.
16664 * support.cs (InternalParameters.Parameters): Renamed `parameters'
16665 to `Parameters' and made it public readonly.
16667 2002-08-06 Martin Baulig <martin@gnome.org>
16669 * ecore.cs (Expression.Warning): Made this public as well.
16671 * report.cs (Report.Debug): Print the contents of collections.
16673 2002-08-06 Martin Baulig <martin@gnome.org>
16675 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
16676 used to tell Resolve() which kinds of expressions it may return.
16677 (Expression.Resolve): Added overloaded version of this method which
16678 takes a `ResolveFlags flags' argument. This can be used to tell
16679 Resolve() which kinds of expressions it may return. Reports a
16681 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16682 ResolveFlags.SimpleName.
16683 (Expression.Error118): Added overloaded version of this method which
16684 takes a `ResolveFlags flags' argument. It uses the flags to determine
16685 which kinds of expressions are allowed.
16687 * expression.cs (Argument.ResolveMethodGroup): New public method.
16688 Resolves an argument, but allows a MethodGroup to be returned.
16689 This is used when invoking a delegate.
16691 * TODO: Updated a bit.
16693 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16695 Fixed compilation with csc.
16697 * ecore.cs: Expression.Error made public. Is this correct? Should
16698 Warning be made public too?
16700 * expression.cs: use ea.Location instead of ea.loc.
16701 [FIXME: Filed as bug #28607: MCS must report these errors.]
16703 2002-08-06 Martin Baulig <martin@gnome.org>
16705 * ecore.cs (Expression.loc): Moved the location here instead of
16706 duplicating it in all derived classes.
16707 (Expression.Location): New public property.
16708 (Expression.Error, Expression.Warning): Made them non-static and
16709 removed the location argument.
16710 (Expression.Warning): Added overloaded version which takes an
16711 `int level' argument.
16712 (Expression.Error118): Make this non-static and removed the
16713 expression and location arguments.
16714 (TypeExpr): Added location argument to the constructor.
16716 * expression.cs (StaticCallExpr): Added location argument to
16718 (Indirection, PointerArithmetic): Likewise.
16719 (CheckedExpr, UnCheckedExpr): Likewise.
16720 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16721 (StringPtr): Likewise.
16724 2002-08-05 Martin Baulig <martin@gnome.org>
16726 * expression.cs (BaseAccess.DoResolve): Actually report errors.
16728 * assign.cs (Assign.DoResolve): Check whether the source
16729 expression is a value or variable.
16731 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16732 while resolving the corresponding blocks.
16734 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16735 an error, don't silently return null.
16737 * statement.cs (Block.AddVariable): Do the error reporting here
16738 and distinguish between CS0128 and CS0136.
16739 (Block.DoResolve): Report all unused labels (warning CS0164).
16740 (LabeledStatement): Pass the location to the constructor.
16741 (LabeledStatement.HasBeenReferenced): New property.
16742 (LabeledStatement.Resolve): Set it to true here.
16744 * statement.cs (Return.Emit): Return success even after reporting
16745 a type mismatch error (CS0126 or CS0127), this is what csc does and
16746 it avoids confusing the users with any consecutive errors.
16748 2002-08-05 Martin Baulig <martin@gnome.org>
16750 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16752 * const.cs (Const.LookupConstantValue): Catch circular definitions.
16754 * expression.cs (MemberAccess.DoResolve): Silently return if an
16755 error has already been reported.
16757 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16758 error has already been reported.
16760 2002-08-05 Martin Baulig <martin@gnome.org>
16762 * statement.cs (UsageVector): Only initialize the `parameters'
16763 vector if we actually have any "out" parameters.
16765 2002-08-05 Martin Baulig <martin@gnome.org>
16767 * expression.cs (Binary.ResolveOperator): When combining delegates,
16768 they must have the same type.
16770 2002-08-05 Martin Baulig <martin@gnome.org>
16772 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16773 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16774 work with the ms runtime and we also don't need it: if we're a
16775 PropertyBuilder and not in the `indexer_arguments' hash, then we
16776 are a property and not an indexer.
16778 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16779 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16780 since the latter one doesn't work with the ms runtime.
16782 2002-08-03 Martin Baulig <martin@gnome.org>
16784 Fixed bugs #27998 and #22735.
16786 * class.cs (Method.IsOperator): New public field.
16787 (Method.CheckBase): Report CS0111 if there's already a method
16788 with the same parameters in the current class. Report CS0508 when
16789 attempting to change the return type of an inherited method.
16790 (MethodData.Emit): Report CS0179 if a method doesn't have a body
16791 and it's not marked abstract or extern.
16792 (PropertyBase): New abstract base class for Property and Indexer.
16793 (PropertyBase.CheckBase): Moved here from Property and made it work
16795 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16796 the same so we can reuse it there.
16797 (Property, Indexer): Derive from PropertyBase.
16798 (MethodSignature.inheritable_property_signature_filter): New delegate
16799 to find properties and indexers.
16801 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16802 argument and improved error reporting.
16804 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16805 EmptyReadOnlyParameters and made it a property.
16807 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16808 version of this method which takes a `PropertyInfo indexer'.
16809 (TypeManager.RegisterIndexer): New method.
16811 * class.cs: Added myself as author of this file :-)
16813 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16815 * class.cs: fixed compilation on windoze.
16817 2002-08-03 Martin Baulig <martin@gnome.org>
16819 * interface.cs (Interface.GetInterfaceBases): Check whether all
16820 base interfaces are at least as accessible than the current one.
16822 * class.cs (TypeContainer.GetClassBases): Check whether base types
16823 are at least as accessible than the current type.
16824 (TypeContainer.AsAccessible): Implemented and made non-static.
16825 (MemberBase.CheckParameters): Report errors if the accessibility
16828 * delegate.cs (Delegate.Delegate): The default visibility is
16829 internal for top-level types and private for nested types.
16830 (Delegate.Define): Report errors if the accessibility checks fail.
16832 * enum.cs (Enum.Enum): The default visibility is internal for
16833 top-level types and private for nested types.
16834 (Enum.DefineType): Compute the correct visibility.
16836 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16837 function which takes a `bool is_toplevel' instead of a TypeContainer.
16839 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16842 2002-08-02 Martin Baulig <martin@gnome.org>
16844 * expression.cs (LocalVariableReferenc): Added constructor which
16845 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16846 (LocalVariableReference.IsReadOnly): New property.
16847 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16848 variable is readonly, use our own readonly flag to do this; you can
16849 use the new constructor to get a writable reference to a read-only
16852 * cs-parser.jay (foreach_statement, using_statement): Get a writable
16853 reference to the local variable.
16855 2002-08-01 Miguel de Icaza <miguel@ximian.com>
16857 * rootcontext.cs (ResolveCore): Also include System.Exception
16859 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16860 we reach an EmptyStatement.
16862 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16865 * expression.cs (Binary.ResolveOperator): Check error result in
16868 use brtrue/brfalse directly and avoid compares to null.
16870 2002-08-02 Martin Baulig <martin@gnome.org>
16872 * class.cs (TypeContainer.Define): Define all nested interfaces here.
16873 Fixes bug #28407, added test-155.cs.
16875 2002-08-01 Martin Baulig <martin@gnome.org>
16877 * class.cs (Event.EmitDefaultMethod): Make this work with static
16878 events. Fixes #28311, added verify-3.cs.
16880 2002-08-01 Martin Baulig <martin@gnome.org>
16882 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16883 `is_disposable' fields.
16884 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16885 `hm.is_disposable' if we're using the collection pattern.
16886 (Foreach.EmitCollectionForeach): Use the correct type for the
16887 enumerator's local variable, only emit the try/finally block if
16888 necessary (fixes #27713).
16890 2002-08-01 Martin Baulig <martin@gnome.org>
16892 * ecore.cs (Expression.report118): Renamed to Error118 and made
16895 * statement.cs (Throw.Resolve): Check whether the expression is of
16896 the correct type (CS0118) and whether the type derives from
16897 System.Exception (CS0155).
16898 (Catch.Resolve): New method. Do the type lookup here and check
16899 whether it derives from System.Exception (CS0155).
16900 (Catch.CatchType, Catch.IsGeneral): New public properties.
16902 * typemanager.cs (TypeManager.exception_type): Added.
16904 2002-07-31 Miguel de Icaza <miguel@ximian.com>
16906 * driver.cs: Updated About function.
16908 2002-07-31 Martin Baulig <martin@gnome.org>
16910 Implemented Control Flow Analysis.
16912 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16913 (EmitContext.CurrentBranching): Added.
16914 (EmitContext.StartFlowBranching): Added.
16915 (EmitContext.EndFlowBranching): Added.
16916 (EmitContext.KillFlowBranching): Added.
16917 (EmitContext.IsVariableAssigned): Added.
16918 (EmitContext.SetVariableAssigned): Added.
16919 (EmitContext.IsParameterAssigned): Added.
16920 (EmitContext.SetParameterAssigned): Added.
16921 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16922 Added control flow analysis stuff here.
16924 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16925 resolve the expression as lvalue.
16926 (LocalVariableReference.DoResolve): Check whether the variable has
16927 already been assigned.
16928 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16929 the parameter as assigned here.
16930 (ParameterReference.DoResolve): Check whether the parameter has already
16932 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16933 expression as lvalue.
16935 * statement.cs (FlowBranching): New class for the flow analysis code.
16936 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16937 (LabeledStatement.IsDefined): New public property.
16938 (LabeledStatement.AddUsageVector): New public method to tell flow
16939 analyis that the label may be reached via a forward jump.
16940 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16942 (VariableInfo.Number): New public field. This is used by flow analysis
16943 to number all locals of a block.
16944 (Block.CountVariables): New public property. This is the number of
16945 local variables in this block (including the locals from all parent
16947 (Block.EmitMeta): Number all the variables.
16949 * statement.cs: Added flow analysis support to all classes.
16951 2002-07-31 Martin Baulig <martin@gnome.org>
16953 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16954 To get debugging messages, compile mcs with /define:MCS_DEBUG and
16955 then use this argument.
16957 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16959 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16960 use this to specify /define options.
16962 2002-07-29 Martin Baulig <martin@gnome.org>
16964 * statement.cs (Fixed): Moved all code that does variable lookups
16965 and resolvings from Emit to Resolve.
16967 * statement.cs (For): Moved all code that does variable lookups
16968 and resolvings from Emit to Resolve.
16970 * statement.cs (Using): Moved all code that does variable lookups
16971 and resolvings from Emit to Resolve.
16973 2002-07-29 Martin Baulig <martin@gnome.org>
16975 * attribute.cs (Attribute.Resolve): Explicitly catch a
16976 System.NullReferenceException when creating the
16977 CustromAttributeBuilder and report a different warning message.
16979 2002-07-29 Martin Baulig <martin@gnome.org>
16981 * support.cs (ParameterData.ParameterName): Added method to
16982 get the name of a parameter.
16984 * typemanager.cs (TypeManager.IsValueType): New public method.
16986 2002-07-29 Martin Baulig <martin@gnome.org>
16988 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
16989 is a flag which specifies that it's either ref or out.
16990 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16991 the out parameter to `out Parameter.Modifier mod', also set the
16992 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16994 * support.cs (InternalParameters.ParameterModifier): Distinguish
16995 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16996 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16998 * expression.cs (Argument.GetParameterModifier): Distinguish
16999 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17000 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17002 2002-07-29 Martin Baulig <martin@gnome.org>
17004 * expression.cs (ParameterReference.ParameterReference): Added
17005 `Location loc' argument to the constructor.
17007 * cs-parser.jay: Pass location to ParameterReference.
17009 2002-07-28 Miguel de Icaza <miguel@ximian.com>
17011 * statement.cs (Try): Initialize the location.
17013 * cs-parser.jay: pass location to Try.
17015 * expression.cs (Unary.Reduce): Change the prototype to return
17016 whether a constant fold could be performed or not. The result is
17017 returned in an out parameters. In the case of Indirection and
17018 AddressOf, we want to perform the full tests.
17020 2002-07-26 Miguel de Icaza <miguel@ximian.com>
17022 * statement.cs (Statement.Emit): Flag dead code.
17024 2002-07-27 Andrew Birkett <andy@nobugs.org>
17026 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17028 2002-07-27 Martin Baulig <martin@gnome.org>
17030 * class.cs (MethodData.Define): Put back call to
17031 TypeManager.AddMethod(), accidentally commented this out.
17033 * report.cs (Debug): New public method to print debugging information,
17034 this is `[Conditional ("DEBUG")]'.
17036 2002-07-26 Martin Baulig <martin@gnome.org>
17038 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17039 (switch_statement): Push the current_block to the switch_stack and
17040 pop it again when we're done with the switch.
17041 (switch_section): The new block is a child of the current_block.
17042 Fixes bug #24007, added test-152.cs.
17044 2002-07-27 Martin Baulig <martin@gnome.org>
17046 * expression.cs (Invocation.EmitArguments): When calling a varargs
17047 function with only its fixed arguments, we need to pass an empty
17050 2002-07-27 Martin Baulig <martin@gnome.org>
17052 Mono 0.13 has been released.
17054 2002-07-25 Miguel de Icaza <miguel@ximian.com>
17056 * driver.cs: Rename --resource to --linkres, because that is what
17057 we do currently, we dont support --resource yet.
17059 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17061 2002-07-25 Martin Baulig <martin@gnome.org>
17063 * class.cs (MethodData): New public class. This is a `method builder'
17064 class for a method or one accessor of a Property/Indexer/Event.
17065 (MethodData.GetMethodFlags): Moved here from MemberBase.
17066 (MethodData.ApplyAttributes): Likewise.
17067 (MethodData.ApplyObsoleteAttribute): Likewise.
17068 (MethodData.ApplyConditionalAttribute): Likewise.
17069 (MethodData.ApplyDllImportAttribute): Likewise.
17070 (MethodData.CheckAbstractAndExternal): Likewise.
17071 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17072 (MethodData.Emit): Formerly known as Method.Emit().
17073 (MemberBase): Moved everything which was specific to a single
17074 accessor/method to MethodData.
17075 (Method): Create a new MethodData and call Define() and Emit() on it.
17076 (Property, Indexer, Event): Create a new MethodData objects for each
17077 accessor and call Define() and Emit() on them.
17079 2002-07-25 Martin Baulig <martin@gnome.org>
17081 Made MethodCore derive from MemberBase to reuse the code from there.
17082 MemberBase now also checks for attributes.
17084 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17085 (MemberBase.GetMethodFlags): Moved here from class Method and marked
17087 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17088 `CallingConventions cc' and `Attributes opt_attrs' arguments.
17089 (MemberBase.ApplyAttributes): New virtual method; applies the
17090 attributes to a method or accessor.
17091 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17092 (MemberBase.ApplyConditionalAttribute): Likewise.
17093 (MemberBase.ApplyDllImportAttribute): Likewise.
17094 (MemberBase.CheckAbstractAndExternal): Likewise.
17095 (MethodCore.ParameterTypes): This is now a property instead of a
17096 method, it's initialized from DoDefineParameters().
17097 (MethodCore.ParameterInfo): Removed the set accessor.
17098 (MethodCore.DoDefineParameters): New protected virtual method to
17099 initialize ParameterTypes and ParameterInfo.
17100 (Method.GetReturnType): We can now simply return the MemberType.
17101 (Method.GetMethodFlags): Override the MemberBase version and add
17102 the conditional flags.
17103 (Method.CheckBase): Moved some code from Define() here, call
17104 DoDefineParameters() here.
17105 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17106 here to avoid some larger code duplication.
17107 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17108 ensure that abstract and external accessors don't declare a body.
17110 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17111 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17112 lookup in the attribute's parent classes, so we need to abort as soon
17113 as we found the first match.
17114 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17115 the attribute has no arguments.
17117 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17120 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17122 * cs-parser.jay: reverted previous patch.
17124 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17126 * cs-parser.jay: fixed bug #22119.
17128 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17130 * attribute.cs: fixed compilation. The error was:
17131 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
17132 be assigned to before control leaves the current method."
17133 [FIXME: Filed as bug #28186: MCS must report this error.]
17135 2002-07-25 Martin Baulig <martin@gnome.org>
17137 * attribute.cs (Attribute.Conditional_GetConditionName): New static
17138 method to pull the condition name ouf of a Conditional attribute.
17139 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17140 the obsolete message and error flag out of an Obsolete attribute.
17142 * class.cs (Method.GetMethodFlags): New public method to get the
17143 TypeManager.MethodFlags for this method.
17144 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17146 (Method.Define): Get and apply the Obsolete and Conditional attributes;
17147 if we're overriding a virtual function, set the new private variable
17148 `parent_method'; call the new TypeManager.AddMethod().
17150 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
17151 the MethodBuilder and the Method in a PtrHashtable.
17152 (TypeManager.builder_to_method): Added for this purpose.
17153 (TypeManager.MethodFlags): Added IsObsoleteError.
17154 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
17155 Obsolete and Conditional arguments in MethodBuilders. If we discover
17156 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17157 the message from the attribute.
17159 2002-07-24 Martin Baulig <martin@gnome.org>
17161 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17162 preprocessor directives, ensure that the argument to #define/#undef is
17163 exactly one identifier and that it's actually an identifier.
17165 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17168 2002-07-24 Martin Baulig <martin@gnome.org>
17170 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17171 initialize it to TypeManager.object_type in the constructor.
17172 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17173 of the `hm.get_current' method if we're using the collection pattern.
17174 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17175 for the explicit conversion to make it work when we're using the collection
17176 pattern and the `Current' property has a different return type than `object'.
17179 2002-07-24 Martin Baulig <martin@gnome.org>
17181 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17182 does not match, but don't report any errors. This method is called in
17183 order for all methods in a MethodGroupExpr until a matching method is
17184 found, so we don't want to bail out if the first method doesn't match.
17185 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17186 matches, report the 123. Fixes #28070.
17188 2002-07-24 Martin Baulig <martin@gnome.org>
17190 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17191 TypeManager.TypeToCoreType() to the top of the method so the
17192 following equality checks will work. Fixes #28107.
17194 2002-07-24 Martin Baulig <martin@gnome.org>
17196 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17197 operand is of type uint, and the other operand is of type sbyte,
17198 short or int, the operands are converted to type long." -
17199 Actually do what this comment already told us. Fixes bug #28106,
17202 2002-07-24 Martin Baulig <martin@gnome.org>
17204 * class.cs (MethodBase): New abstract class. This is now a base
17205 class for Property, Indexer and Event to avoid some code duplication
17206 in their Define() and DefineMethods() methods.
17207 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17208 generic methods for Define() and DefineMethods().
17209 (FieldBase): Derive from MemberBase, not MemberCore.
17210 (Property): Derive from MemberBase, not MemberCore.
17211 (Property.DefineMethod): Moved all the code from this method to the
17212 new MethodBase.DefineAccessor(), just call it with appropriate
17214 (Property.Define): Call the new Property.DoDefine(), this does some
17215 sanity checks and we don't need to duplicate the code everywhere.
17216 (Event): Derive from MemberBase, not MemberCore.
17217 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17218 accessors, this will also make them work with interface events.
17219 (Indexer): Derive from MemberBase, not MemberCore.
17220 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17221 (Indexer.Define): Use the new MethodBase functions.
17223 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17224 argument to the constructor.
17225 (Interface.FindMembers): Added support for interface events.
17226 (Interface.PopluateEvent): Implemented.
17228 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
17230 2002-07-22 Miguel de Icaza <miguel@ximian.com>
17232 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17233 but this is required to check for a method name being the same as
17234 the containing class.
17238 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17240 * interface.cs: initialize variable.
17242 2002-07-23 Martin Baulig <martin@gnome.org>
17244 Implemented the IndexerName attribute in interfaces.
17246 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17247 name if this is an explicit interface implementation.
17248 (Indexer.InterfaceIndexerName): New public variable. If we're
17249 implementing an interface indexer, this is the IndexerName in that
17250 interface. Otherwise, it's the IndexerName.
17251 (Indexer.DefineMethod): If we're implementing interface indexer,
17252 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
17253 and Pending.ImplementIndexer methods.
17254 (Indexer.Define): Also define the PropertyBuilder if we're
17255 implementing an interface indexer and this is neither an explicit
17256 interface implementation nor do the IndexerName match the one in
17259 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17260 If a method is defined here, then we always need to create a proxy
17261 for it. This is used when implementing interface indexers.
17262 (Pending.IsInterfaceIndexer): New public method.
17263 (Pending.ImplementIndexer): New public method.
17264 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17265 This is used when implementing interface indexers to define a proxy
17267 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17268 define a proxy if necessary.
17270 * interface.cs (Interface.IndexerName): New public variable.
17271 (Interface.PopulateIndexer): Set the IndexerName.
17272 (Interface.DefineIndexers): New private method. Populate all the
17273 indexers and make sure their IndexerNames match.
17275 * typemanager.cs (IndexerPropertyName): Added support for interface
17278 2002-07-22 Martin Baulig <martin@gnome.org>
17280 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17281 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17282 ret if HasReturnLabel.
17283 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17286 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17287 and set the ec.LoopBeginTryCatchLevel.
17288 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17289 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17290 the current ec.TryCatchLevel, the branch goes out of an exception
17291 block. In this case, we need to use Leave and not Br.
17293 2002-07-22 Martin Baulig <martin@gnome.org>
17295 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17296 block unless the block does not always return or it is contained in
17297 another try { ... } catch { ... } block. Fixes bug #26506.
17298 Added verify-1.cs to the test suite.
17300 2002-07-22 Martin Baulig <martin@gnome.org>
17302 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17303 then we do not always return. Fixes bug #24985.
17305 2002-07-22 Martin Baulig <martin@gnome.org>
17307 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17308 lookup on a per-class level; ie. walk up the class hierarchy until we
17309 found at least one applicable method, then choose the best among them.
17310 Fixes bug #24463 and test-29.cs.
17312 2002-07-22 Martin Baulig <martin@gnome.org>
17314 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17315 return types of the methods. The return type is not part of the
17316 signature and we must not check it to make the `new' modifier work.
17317 Fixes bug #27999, also added test-147.cs.
17318 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17320 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17321 on the method's return type.
17323 2002-07-21 Martin Baulig <martin@gnome.org>
17325 * assign.cs: Make this work if the rightmost source is a constant and
17326 we need to do an implicit type conversion. Also adding a few more tests
17327 to test-38.cs which should have caught this.
17329 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17330 target in the makefile for this. The makefile.gnu is primarily intended
17331 for end-users who don't want to debug the compiler.
17333 2002-07-21 Martin Baulig <martin@gnome.org>
17335 * assign.cs: Improved the Assign class so it can now handle embedded
17336 assignments (X = Y = Z = something). As a side-effect this'll now also
17337 consume less local variables. test-38.cs now passes with MCS, added
17338 a few new test cases to that test.
17340 2002-07-20 Martin Baulig <martin@gnome.org>
17342 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17343 instructions. Fixes bug #27977, also added test-146.cs.
17345 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17347 * cs-tokenizer.cs: fixed getHex ().
17349 2002-07-19 Martin Baulig <martin@gnome.org>
17351 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17352 not Type.GetType() to lookup the array type. This is needed when
17353 we're constructing an array of a user-defined type.
17354 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17355 single-dimensional arrays, but also for single-dimensial arrays of
17358 2002-07-19 Martin Baulig <martin@gnome.org>
17360 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17361 this function is called, it's not allowed to share LocalBuilders
17362 among ILGenerators.
17364 2002-07-19 Martin Baulig <martin@gnome.org>
17366 * expression.cs (Argument.Resolve): Report an error 118 when trying
17367 to pass a type as argument.
17369 2002-07-18 Martin Baulig <martin@gnome.org>
17371 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17372 Conv_R_Un for the signed `long' type.
17374 2002-07-15 Miguel de Icaza <miguel@ximian.com>
17376 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17377 `expr' for the temporary result, as that will fail if we do
17378 multiple resolves on the same expression.
17380 2002-07-05 Miguel de Icaza <miguel@ximian.com>
17382 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17383 ec.TypeContainer for looking up aliases.
17385 * class.cs (TypeContainer): Remove LookupAlias from here.
17387 * decl.cs (DeclSpace); Move here.
17389 2002-07-01 Miguel de Icaza <miguel@ximian.com>
17391 * class.cs (FindMembers): Only call filter if the constructor
17392 bulider is not null.
17394 Also handle delegates in `NestedTypes' now. Now we will perform
17395 type lookups using the standard resolution process. This also
17398 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17399 This uses Expressions (the limited kind that can be parsed by the
17400 tree) instead of strings.
17402 * expression.cs (ComposedCast.ToString): Implement, used to flag
17403 errors since now we have to render expressions.
17405 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
17408 * ecore.cs (SimpleName.ToString): ditto.
17410 * cs-parser.jay: Instead of using strings to assemble types, use
17411 Expressions to assemble the type (using SimpleName, ComposedCast,
17412 MemberAccess). This should fix the type lookups in declarations,
17413 because we were using a different code path for this.
17415 * statement.cs (Block.Resolve): Continue processing statements
17416 even when there is an error.
17418 2002-07-17 Miguel de Icaza <miguel@ximian.com>
17420 * class.cs (Event.Define): Also remove the `remove' method from
17421 the list of pending items.
17423 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17424 generate more compact code.
17426 2002-07-17 Martin Baulig <martin@gnome.org>
17428 * const.cs (Const.LookupConstantValue): Add support for constant
17429 `unchecked' and `checked' expressions.
17430 Also adding test case test-140.cs for this.
17432 2002-07-17 Martin Baulig <martin@gnome.org>
17434 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17435 check whether mi.ReturnType implements the IEnumerator interface; the
17436 `==' and the IsAssignableFrom() will fail in this situation.
17438 2002-07-16 Ravi Pratap <ravi@ximian.com>
17440 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
17443 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17445 * expression.cs: fixed bug #27811.
17447 2002-07-14 Miguel de Icaza <miguel@ximian.com>
17449 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17450 Molaro: when we are a ref, the value already contains a pointer
17451 value, do not take the address of it.
17453 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17454 * removed mb-parser.jay and mb-tokenizer.cs
17456 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17458 * expression.cs: check against the building corlib void type.
17460 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17462 * ecore.cs: fix for valuetype static readonly fields: when
17463 initializing them, we need their address, not the address of a copy.
17465 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17467 * typemanager.cs: register also enum_type in corlib.
17469 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17471 * class.cs: allow calling this (but not base) initializers in structs.
17473 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17475 * ecore.cs: make sure we compare against the building base types
17478 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17480 * typemanager.cs: fix TypeToCoreType() to handle void and object
17481 (corlib gets no more typerefs after this change).
17483 2002-07-12 Miguel de Icaza <miguel@ximian.com>
17485 * expression.cs (ArrayCreation.EmitArrayArguments): use
17486 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17488 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17489 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
17490 array indexes, the runtime actually forbids them.
17492 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17493 for array arguments here.
17495 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17496 instead of the default for ValueTypes.
17498 (New.DoEmit): Use IsValueType instead of
17499 IsSubclassOf (value_type)
17500 (New.DoResolve): ditto.
17501 (Invocation.EmitCall): ditto.
17503 * assign.cs (Assign): ditto.
17505 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17506 Statements *are* currently doing part of their resolution during
17509 Expressions do always resolve during resolve, but statements are
17510 only required to propagate resolution to their children.
17512 2002-07-11 Miguel de Icaza <miguel@ximian.com>
17514 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17516 (LoadAssembly): Do not add the dll if it is already specified
17518 (MainDriver): Add the System directory to the link path at the end,
17519 after all the other -L arguments.
17521 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17522 wrong opcode for loading bytes and bools (ldelem.i1 instead of
17523 ldelem.u1) and using the opposite for sbytes.
17525 This fixes Digger, and we can finally run it.
17527 * driver.cs (UnixParseOption): Move the option parsing here.
17528 (CSCParseOption): Implement CSC-like parsing of options.
17530 We now support both modes of operation, the old Unix way, and the
17531 new CSC-like way. This should help those who wanted to make cross
17532 platform makefiles.
17534 The only thing broken is that /r:, /reference: and /lib: are not
17535 implemented, because I want to make those have the same semantics
17536 as the CSC compiler has, and kill once and for all the confussion
17537 around this. Will be doing this tomorrow.
17539 * statement.cs (Unsafe.Resolve): The state is checked during
17540 resolve, not emit, so we have to set the flags for IsUnsfe here.
17542 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17544 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17545 not catch the Error_ObjectRefRequired in SimpleName (as it is
17546 possible to have a class/instance variable name that later gets
17547 deambiguated), we have to check this here.
17549 2002-07-10 Ravi Pratap <ravi@ximian.com>
17551 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17552 make static and put into Expression.
17554 (Event.Define): Register the private field of the event with the
17555 TypeManager so that GetFieldFromEvent can get at it.
17557 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17558 keep track of the private field associated with an event which
17561 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17564 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17566 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17568 * expression.cs (Binary.EmitBranchable): this routine emits the
17569 Binary expression in a branchable context. This basically means:
17570 we need to branch somewhere, not just get the value on the stack.
17572 This works together with Statement.EmitBoolExpression.
17574 * statement.cs (Statement.EmitBoolExpression): Use
17577 2002-07-09 Miguel de Icaza <miguel@ximian.com>
17579 * statement.cs (For): Reduce the number of jumps in loops.
17581 (For): Implement loop inversion for the For statement.
17583 (Break): We can be breaking out of a Try/Catch controlled section
17584 (foreach might have an implicit try/catch clause), so we need to
17585 use Leave instead of Br.
17587 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17588 now). If the instace expression supports IMemoryLocation, we use
17589 the AddressOf method from the IMemoryLocation to extract the
17590 address instead of emitting the instance.
17592 This showed up with `This', as we were emitting the instance
17593 always (Emit) instead of the Address of This. Particularly
17594 interesting when This is a value type, as we dont want the Emit
17595 effect (which was to load the object).
17597 2002-07-08 Miguel de Icaza <miguel@ximian.com>
17599 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17601 * statement.cs (Checked): Set the CheckedState during the resolve
17602 process too, as the ConvCast operations track the checked state on
17603 the resolve process, and not emit.
17605 * cs-parser.jay (namespace_member_declaration): Flag that we have
17606 found a declaration when we do. This is used to flag error 1529
17608 * driver.cs: Report ok when we display the help only.
17610 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
17612 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17614 2002-07-04 Miguel de Icaza <miguel@ximian.com>
17616 * cs-tokenizer.cs (define): We also have to track locally the
17617 defines. AllDefines is just used for the Conditional Attribute,
17618 but we also need the local defines for the current source code.
17620 2002-07-03 Miguel de Icaza <miguel@ximian.com>
17622 * statement.cs (While, For, Do): These loops can exit through a
17623 Break statement, use this information to tell whether the
17624 statement is the last piece of code.
17626 (Break): Flag that we break.
17628 * codegen.cs (EmitContexts): New `Breaks' state variable.
17630 2002-07-03 Martin Baulig <martin@gnome.org>
17632 * class.cs (TypeContainer.MethodModifiersValid): Allow override
17633 modifiers in method declarations in structs. Otherwise, you won't
17634 be able to override things like Object.Equals().
17636 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17638 * class.cs (Method, Property, Indexer): Do not allow the public
17639 modifier to be used in explicit interface implementations.
17641 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17642 override modifiers in method declarations in structs
17644 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
17646 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17647 integer or real overflow, report an error
17649 2002-07-02 Martin Baulig <martin@gnome.org>
17651 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17652 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17653 to tell the runtime about our newly created System.Object and
17654 System.ValueType types.
17656 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17658 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17659 struct instead of Ldarg/Starg.
17661 2002-07-02 Martin Baulig <martin@gnome.org>
17663 * expression.cs (Indirection.Indirection): Call
17664 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17666 2002-07-02 Martin Baulig <martin@gnome.org>
17668 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17669 ValueType, call TypeManager.TypeToCoreType() on it.
17670 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17671 the OpCodes.Newarr argument.
17673 2002-07-02 Martin Baulig <martin@gnome.org>
17675 * expression.cs (Invocation.EmitCall): When compiling corlib,
17676 replace all calls to the system's System.Array type to calls to
17677 the newly created one.
17679 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17680 System.Array methods.
17681 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17682 from the system's System.Array type which must be replaced.
17684 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17686 * typemanager.cs: load unverifiable_code_ctor so we can build
17687 corlib using the correct type. Avoid using GetTypeCode() with
17689 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17690 TypeManager.object_type to allow building corlib.
17692 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17694 * ecore.cs: handle System.Enum separately in LoadFromPtr().
17696 2002-07-01 Martin Baulig <martin@gnome.org>
17698 * class.cs: Make the last change actually work, we need to check
17699 whether `ifaces != null' to avoid a crash.
17701 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17703 * class.cs: when we build structs without fields that implement
17704 interfaces, we need to add the interfaces separately, since there is
17705 no API to both set the size and add the interfaces at type creation
17708 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17710 * expression.cs: the dimension arguments to the array constructors
17711 need to be converted if they are a long.
17713 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17715 * class.cs: don't emit ldarg.0 if there is no parent constructor
17716 (fixes showstopper for corlib).
17718 2002-06-29 Martin Baulig <martin@gnome.org>
17720 MCS now compiles corlib on GNU/Linux :-)
17722 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17723 ie. check for MethodImplOptions.InternalCall.
17725 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17726 and TypeManager.attribute_type are null, so we must explicitly check
17727 whether parent is not null to find out whether it's an attribute type.
17728 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17729 and SetBuilder, not only if the property is neither abstract nor external.
17730 This is necessary to set the MethodImplOptions on the accessor methods.
17731 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17732 SetBuilder, see Property.Emit().
17734 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17735 populate "System.Object", "System.ValueType" and "System.Attribute" since
17736 they've already been populated from BootCorlib_PopulateCoreTypes().
17738 2002-06-29 Martin Baulig <martin@gnome.org>
17740 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17741 is the NullLiteral, we also need to make sure that target_type is not
17744 2002-06-29 Martin Baulig <martin@gnome.org>
17746 * rootcontext.cs (RootContext.ResolveCore): We must initialize
17747 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17748 before calling BootstrapCorlib_ResolveDelegate ().
17750 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17752 * statement.cs: fixed build-breaker. All tests passed ok.
17754 2002-06-27 Martin Baulig <martin@gnome.org>
17756 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17757 for System.Decimal when compiling corlib.
17759 2002-06-27 Martin Baulig <martin@gnome.org>
17761 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17762 switch blocks which contain nothing but a default clause.
17764 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
17766 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17768 2002-06-27 Martin Baulig <martin@gnome.org>
17770 * ecore.cs (PropertyExpr.PropertyExpr): Call
17771 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17773 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17774 is already a TypeBuilder.
17776 2002-06-27 Martin Baulig <martin@gnome.org>
17778 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17779 `target_type == TypeManager.array_type', not IsAssignableFrom() in
17780 the "from an array-type to System.Array" case. This makes it work
17781 when compiling corlib.
17783 2002-06-27 Martin Baulig <martin@gnome.org>
17785 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17786 non-static PropertyExpr, set its InstanceExpression. This makes
17787 the `ICollection.Count' property work in System/Array.cs.
17789 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
17791 * driver.cs: Made error handling more consistent. Errors now
17792 tracked by Report class, so many methods which used to return int
17793 now return void. Main() now prints success/failure and
17794 errors/warnings message.
17796 Renamed '--probe' compiler argument to '--expect-error'. Removed
17797 the magic number return values (123 and 124). Now, if the
17798 expected error occurs, the compiler exits with success (exit value
17799 0). If the compilation completes without seeing that particular
17800 error, the compiler exits with failure (exit value 1). The
17801 makefile in mcs/errors has been changed to handle the new behaviour.
17803 * report.cs: Made 'expected error' number a property and renamed
17804 it from 'Probe' to 'ExpectedError'.
17806 * genericparser.cs: Removed error handling support, since it is
17807 now all done by Report class.
17809 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17810 class, so parse() no longer returns an int.
17812 * namespace.cs: Use Report.Error instead of GenericParser.error
17814 2002-06-22 Miguel de Icaza <miguel@ximian.com>
17816 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17817 TypeContainer.AddOperator): At the front of the list put the
17818 explicit implementations, so they get resolved/defined first.
17820 2002-06-21 Miguel de Icaza <miguel@ximian.com>
17822 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17823 interface type is implemented by this TypeContainer. Used during
17824 explicit interface implementation.
17826 (Property.Define, Indexer.Define, Method.Define): Validate that
17827 the given interface in the explicit implementation is one of the
17828 base classes for the containing type.
17830 Also if we are explicitly implementing an interface, but there is
17831 no match in the pending implementation table, report an error.
17833 (Property.Define): Only define the property if we are
17834 not explicitly implementing a property from an interface. Use the
17835 correct name also for those properties (the same CSC uses,
17836 although that is really not needed).
17838 (Property.Emit): Do not emit attributes for explicitly implemented
17839 properties, as there is no TypeBuilder.
17841 (Indexer.Emit): ditto.
17843 Hiding then means that we do not really *implement* a pending
17844 implementation, which makes code fail.
17846 2002-06-22 Martin Baulig <martin@gnome.org>
17848 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17849 the return value of Object.GetType(). [FIXME: we need to do this whenever
17850 we get a type back from the reflection library].
17852 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17854 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17856 2002-06-20 Miguel de Icaza <miguel@ximian.com>
17858 * attribute.cs: Return null if we can not look up the type.
17860 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17861 the interface types found.
17863 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17864 interface types found.
17866 * typemanager.cs (GetInterfaces): Make this routine returns alll
17867 the interfaces and work around the lame differences between
17868 System.Type and System.Reflection.Emit.TypeBuilder in the results
17869 result for GetInterfaces.
17871 (ExpandInterfaces): Given an array of interface types, expand and
17872 eliminate repeated ocurrences of an interface. This expands in
17873 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17876 2002-06-21 Martin Baulig <martin@gnome.org>
17878 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17881 2002-06-21 Martin Baulig <martin@gnome.org>
17883 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
17884 and called with one of the core types, return the corresponding typebuilder for
17887 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17890 2002-06-21 Martin Baulig <martin@gnome.org>
17892 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17893 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17894 (Expression.ConvertReferenceExplicit): Likewise.
17896 * expression.cs (ElementAccess.DoResolve): Likewise.
17897 (ElementAccess.DoResolveLValue): Likewise.
17899 2002-06-10 Martin Baulig <martin@gnome.org>
17901 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17902 add the "value" parameter to the parameter list.
17904 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17907 2002-06-19 Miguel de Icaza <miguel@ximian.com>
17909 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17910 the argument to an int, uint, long or ulong, per the spec. Also
17911 catch negative constants in array creation.
17913 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17915 * class.cs: do not allow the same interface to appear twice in
17916 the definition list.
17918 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17920 * ecore.cs: don't use ldlen with System.Array.
17922 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17924 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17926 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17928 * modifiers.cs: produce correct field attributes for protected
17929 internal. Easy fix so miguel can work on ther harder stuff:-)
17931 2002-06-18 Miguel de Icaza <miguel@ximian.com>
17933 * pending.cs: New file. Move the code from class.cs here.
17934 Support clearning the pending flag for all methods (when not doing
17935 explicit interface implementation).
17937 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17939 * rootcontext.cs: added a couple more types needed to bootstrap.
17941 2002-06-17 Miguel de Icaza <miguel@ximian.com>
17943 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17944 constructor in the type, instead of any constructor in the type
17945 hierarchy. Thanks to Paolo for finding this bug (it showed up as
17946 a bug in the Mono runtime when applying the params attribute).
17948 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17949 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17951 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
17953 * expression.cs (Unary.ResolveOperator): Use TypeManager
17954 to resolve the type.
17956 2002-06-13 Ravi Pratap <ravi@ximian.com>
17958 * cs-parser.jay (enum_member_declaration): Pass in the attributes
17961 * enum.cs (AddEnumMember): Add support to store the attributes associated
17962 with each member too.
17964 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17965 field builders too - this takes care of the enum member case.
17967 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
17969 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17970 address-of operator on both value types and pointers.
17972 2002-06-10 Martin Baulig <martin@gnome.org>
17974 * interface.cs (Interface.PopulateIndexer): Add the indexer's
17975 PropertyBuilder to the `property_builders' list.
17977 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17978 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17979 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
17980 find any indexers which are inherited from an interface.
17982 2002-06-09 Martin Baulig <martin@gnome.org>
17984 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17985 the same type as the constant if necessary. There's also a test-130.cs
17988 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17990 * typemanager.cs (TypeManager.ChangeType): Previously known as
17991 Enum.ChangeEnumType().
17993 2002-06-09 Martin Baulig <martin@gnome.org>
17995 * expression.cs (Cast.TryReduce): Added support for consts.
17997 2002-06-08 Ravi Pratap <ravi@ximian.com>
17999 * class.cs (Accessor): Hold attributes information so we can pass
18002 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18003 Modify to pass in attributes attached to the methods.
18005 (add_accessor_declaration, remove_accessor_declaration): Ditto.
18007 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18008 to handle the Accessor kind :-)
18010 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18012 2002-06-08 Martin Baulig <martin@gnome.org>
18014 * expression.cs (Unary.TryReduceNegative): Added support for
18017 2002-06-08 Martin Baulig <martin@gnome.org>
18019 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18020 name can't be found in the `defined_names' - the caller will do a
18021 MemberLookup in this case and thus find methods in System.Enum
18022 such as Enum.IsDefined().
18024 2002-06-08 Martin Baulig <martin@gnome.org>
18026 * enum.cs (Enum.ChangeEnumType): This is a custom version of
18027 Convert.ChangeType() which works with TypeBuilder created types.
18028 (Enum.LookupEnumValue, Enum.Define): Use it here.
18030 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18031 `TypeBuilder.BaseType != null' check.
18032 (TypeContainer.FindMembers): Only lookup parent members if we
18033 actually have a parent.
18034 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18035 (ConstructorInitializer.Resolve): Likewise.
18037 * interface.cs (Interface.FindMembers): Added
18038 `TypeBuilder.BaseType != null' check.
18040 * rootcontext.cs (RootContext.ResolveCore): Added
18041 "System.Runtime.CompilerServices.IndexerNameAttribute" to
18042 classes_second_stage.
18044 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18045 debug_type and trace_type when compiling with --nostdlib.
18047 2002-06-07 Martin Baulig <martin@gnome.org>
18049 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18050 (AddField): Set it to true when adding a non-static field.
18051 (DefineType): Use `have_nonstatic_fields' to find out whether we
18052 have non-static fields, not `Fields != null'.
18054 2002-06-02 Miguel de Icaza <miguel@ximian.com>
18056 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18057 dereferencing a null on the static-field code path)
18059 2002-05-30 Martin Baulig <martin@gnome.org>
18061 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18062 to take command line arguments. Use reflection to call the new
18063 custom `Initialize' function on the symbol writer and pass it the
18064 command line arguments.
18066 * driver.cs (--debug-args): New command line argument to pass command
18067 line arguments to the symbol writer.
18069 2002-05-28 Miguel de Icaza <miguel@ximian.com>
18071 * assign.cs (DoResolve): Forgot to do the implicit conversion to
18072 the target type for indexers and properties. Thanks to Joe for
18075 2002-05-27 Miguel de Icaza <miguel@ximian.com>
18077 * typemanager.cs (MethodFlags): returns the method flags
18078 (Obsolete/ShouldIgnore) that control warning emission and whether
18079 the invocation should be made, or ignored.
18081 * expression.cs (Invocation.Emit): Remove previous hack, we should
18082 not do this on matching a base type, we should do this based on an attribute
18084 Only emit calls to System.Diagnostics.Debug and
18085 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18086 on the command line.
18088 * rootcontext.cs: Global settings for tracing and debugging.
18090 * cs-tokenizer.cs (define): New utility function to track
18091 defines. Set the global settings for TRACE and DEBUG if found.
18093 2002-05-25 Ravi Pratap <ravi@ximian.com>
18095 * interface.cs (Populate*): Pass in the TypeContainer as well as
18096 the DeclSpace as parameters so that we can create EmitContexts and
18097 then use that to apply attributes etc.
18099 (PopulateMethod, PopulateEvent, PopulateProperty)
18100 (PopulateIndexer): Apply attributes everywhere.
18102 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18105 (ApplyAttributes): Update accordingly.
18107 We now apply interface attributes for all members too.
18109 2002-05-26 Miguel de Icaza <miguel@ximian.com>
18111 * class.cs (Indexer.Define); Correctly check if we are explicit
18112 implementation (instead of checking the Name for a ".", we
18113 directly look up if the InterfaceType was specified).
18115 Delay the creation of the PropertyBuilder.
18117 Only create the PropertyBuilder if we are not an explicit
18118 interface implementation. This means that explicit interface
18119 implementation members do not participate in regular function
18120 lookups, and hence fixes another major ambiguity problem in
18121 overload resolution (that was the visible effect).
18123 (DefineMethod): Return whether we are doing an interface
18126 * typemanager.cs: Temporary hack until we get attributes in
18127 interfaces (Ravi is working on that) and we get IndexerName
18128 support in interfaces.
18130 * interface.cs: Register the indexers as properties.
18132 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18133 warning, I have verified that this is a bug in the .NET runtime
18134 (JavaScript suffers of the same problem).
18136 * typemanager.cs (MemberLookup): When looking up members for
18137 interfaces, the parent of an interface is the implicit
18138 System.Object (so we succeed in searches of Object methods in an
18139 interface method invocation. Example: IEnumerable x; x.ToString
18142 2002-05-25 Miguel de Icaza <miguel@ximian.com>
18144 * class.cs (Event): Events should also register if they do
18145 implement the methods that an interface requires.
18147 * typemanager.cs (MemberLookup); use the new GetInterfaces
18150 (GetInterfaces): The code used to lookup interfaces for a type is
18151 used in more than one place, factor it here.
18153 * driver.cs: Track the errors at the bottom of the file, we kept
18156 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18157 instance if the method we are calling is static!
18159 2002-05-24 Miguel de Icaza <miguel@ximian.com>
18161 * attribute.cs (ApplyAttributes): Make this function filter out
18162 the IndexerName attribute (as that attribute in reality is never
18163 applied) and return the string constant for the IndexerName
18166 * class.cs (TypeContainer.Emit): Validate that all the indexers
18167 have the same IndexerName attribute, and if so, set the
18168 DefaultName attribute on the class.
18170 * typemanager.cs: The return value might contain other stuff (not
18171 only methods). For instance, consider a method with an "Item"
18172 property and an Item method.
18174 * class.cs: If there is a problem with the parameter types,
18177 2002-05-24 Ravi Pratap <ravi@ximian.com>
18179 * ecore.cs (ImplicitConversionExists): Wrapper function which also
18180 looks at user defined conversion after making a call to
18181 StandardConversionExists - we need this for overload resolution.
18183 * expression.cs : Update accordingly the various method calls.
18185 This fixes 2 bugs filed against implicit user defined conversions
18187 2002-05-22 Miguel de Icaza <miguel@ximian.com>
18189 * statement.cs: Track the result of the assignment.
18191 2002-05-21 Miguel de Icaza <miguel@ximian.com>
18193 * expression.cs (MemberAccess): Improved error reporting for
18194 inaccessible members.
18196 2002-05-22 Martin Baulig <martin@gnome.org>
18198 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
18199 itself with debugging support.
18201 2002-05-22 Martin Baulig <martin@gnome.org>
18203 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18204 Removed, this isn't needed anymore.
18206 2002-05-20 Martin Baulig <martin@gnome.org>
18208 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18209 be underlying type for an enum.
18211 2002-05-20 Miguel de Icaza <miguel@ximian.com>
18213 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18214 that splits out the loading of just the core types.
18216 * rootcontext.cs (ResolveCore): Split the struct resolution in
18217 two, so we can load the enumeration underlying types before any
18220 * expression.cs (Is): Bandaid until we fix properly Switch (see
18221 bug #24985 for details).
18223 * typemanager.cs (ImplementsInterface): The hashtable will contain
18224 a null if there are no interfaces implemented.
18226 2002-05-18 Miguel de Icaza <miguel@ximian.com>
18228 * cs-parser.jay (indexer_declarator): It is fine to have array
18231 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18233 * typemanager.cs: (RegisterBuilder): New function used to register
18234 TypeBuilders that implement interfaces. Since
18235 TypeBuilder.GetInterfaces (as usual) does not work with lame
18237 (AddUserType): register interfaces.
18239 (ImplementsInterface): Use the builder_to_ifaces hash if we are
18240 dealing with TypeBuilder. Also, arrays are showing up as
18241 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18242 methods can not be invoked on them!
18244 * ecore.cs (ExplicitReferenceConversionExists): Made public.
18245 (ImplicitReferenceConversionExists): Split out from
18246 StandardConversionExists.
18248 * expression.cs (As): We were only implementing one of the three
18249 cases for the as operator. We now implement them all.
18250 (Is): Implement the various other cases for Is as well.
18252 * typemanager.cs (CACHE): New define used to control if we want or
18253 not the FindMembers cache. Seems to have a negative impact on
18254 performance currently
18256 (MemberLookup): Nested types have full acess to
18257 enclosing type members
18259 Remove code that coped with instance/static returns for events, we
18260 now catch this in RealFindMembers.
18262 (RealFindMembers): only perform static lookup if the instance
18263 lookup did not return a type or an event.
18265 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18267 * assign.cs (CompoundAssign): We pass more semantic information
18268 now to Compound Assignments than we did before: now we have all
18269 the information at hand, and now we resolve the target *before* we
18270 do the expression expansion, which allows the "CacheValue" method
18271 to have the effect we intended (before, a [x] += 1 would generate
18272 two differen ArrayAccess expressions from the ElementAccess,
18273 during the resolution process).
18275 (CompoundAssign.DoResolve): Resolve target and original_source here.
18277 2002-05-16 Miguel de Icaza <miguel@ximian.com>
18279 * expression.cs (ArrayAccess): dropped debugging information.
18281 * typemanager.cs: Small bug fix: I was always returning i_members,
18282 instead of one of i_members or s_members (depending on which had
18285 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
18286 method is invoked before any code generation takes place, and it
18287 is a mechanism to inform that the expression will be invoked more
18288 than once, and that the method should use temporary values to
18289 avoid having side effects
18291 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18293 * ecore.cs (Expression.CacheTemporaries): Provide empty default
18296 * expression.cs (Indirection, ArrayAccess): Add support for
18297 CacheTemporaries in these two bad boys.
18299 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18300 ldobj or ldind_ref.
18301 (StoreFromPtr): Handle stobj as well.
18303 * expression.cs (UnaryMutator): Share more code.
18305 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18306 down: I was not tracking the Filter function as well, which
18307 was affecting the results of the cache.
18309 2002-05-15 Miguel de Icaza <miguel@ximian.com>
18311 * attribute.cs: Remove the hack to handle the CharSet property on
18314 2002-05-14 Miguel de Icaza <miguel@ximian.com>
18316 * attribute.cs (DoResolve): More uglyness, we now only try to
18317 resolve the attribute partially, to extract the CharSet
18318 information (only if we are a StructLayout attribute). Otherwise
18320 (GetExtraTypeInfo): Add some code to conditionally kill in the
18321 future this. I am more and more convinced that the .NET
18322 framework has special code to handle the attribute setting on
18325 * expression.cs (IsParamsMethodApplicable): Revert my previous
18326 foreach change here, it was wrong.
18328 2002-05-13 Miguel de Icaza <miguel@ximian.com>
18330 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18331 (pp_expr): do not abort on unknown input, just return.
18332 (eval): abort if there are pending chars.
18334 * attribute.cs (Attribute.Resolve): Positional parameters are
18335 optional. Deal with that case.
18337 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18338 the Ansi/Unicode/Auto information for the type.
18340 (TypeContainer.DefineType): instantiate the EmitContext here, as
18341 we will be using it during the type definition (to resolve
18342 attributes) and during the emit phase.
18344 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18345 to pull type information out of the attributes
18347 (Attribute.Resolve): track the constructor builder, and allow for
18348 multiple invocations (structs and classes will use this).
18350 * ecore.cs (MemberLookupFinal): new version with all the
18351 parameters customizable.
18353 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18354 constructors. Return if the result value is null (as the error
18355 would have been flagged already by MemberLookupFinal)
18357 Do not allow instances of abstract classes or interfaces to be
18360 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18361 We have to compare the assembly property here when dealing with
18362 FamANDAssem and Assembly access modifiers, because we might be
18363 creating an assembly from *modules* (that means that we are not
18364 getting TypeBuilders for types defined in other modules that are
18365 part of this assembly).
18367 (Method.Emit): If the method is marked abstract and has a body,
18370 (TypeContainer.DefineMembers): If both the defined member and the
18371 parent name match are methods, then do not emit any warnings: let
18372 the Method.Define routine take care of flagging warnings. But if
18373 there is a mismatch (method overrides something else, or method is
18374 overriwritten by something, then emit warning).
18376 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18377 set to null, this means `do not check for the return type on the
18380 (Method.Define): set the return type for the method signature to
18381 null, so that we get methods with the same name and parameters and
18382 different return types. This is used to flag warning 114 (you are
18383 hiding a method, and you probably want to use the new/override
18386 * typemanager.cs (MemberLookup): Implemented proper access
18387 control, closing a long standing set of bug reports. The problem
18388 was that the Framework only has two bits: Public and NonPublic,
18389 and NonPublic includes private and protected methods, but we need
18390 to enforce the FamANDAssem, FamOrAssem and Family.
18392 2002-05-11 Miguel de Icaza <miguel@ximian.com>
18394 * statement.cs (GotoCase): Return true: Ammounts to giving up
18395 knowledge on whether we return or not, and letting the other case
18396 be responsible for it.
18398 2002-05-10 Miguel de Icaza <miguel@ximian.com>
18400 * driver.cs: Do not load directories for each file processed, only
18401 do it if there is a pattern.
18403 * ecore.cs: Report readonly assigns here as well, as we might have
18404 been resolved only by MemberAccess.
18406 (SimpleName.SimpleNameResolve): Also be useful for LValue
18407 resolution. We need this to propagate assign to local readonly variables
18409 * typemanager.cs: Use a ptrhashtable for the criteria, because we
18410 do not want to reuse potential criteria memory.
18412 * class.cs (MyEventBuilder): Set reflected_type;
18414 * ecore.cs (Constantify): Added support for constifying bools.
18416 (RootContext.LookupType): Added a cache for values looked up in
18417 the declaration space.
18419 * typemanager.cs (FindMembers): Now is a front-end to
18420 RealFindMembers, and provides a two-level hashtable-based cache to
18423 15% performance improvement: from 22.5 to 19.2 seconds.
18425 * expression.cs (IsParamsMethodApplicable): use foreach.
18426 (Invocation.DoResolve): ditto.
18427 (New.DoResolve): ditto.
18428 (ArrayCreation.DoResolve): ditto.
18430 * ecore.cs (FindMostEncompassingType): use foreach.
18432 * delegate.cs (NewDelegate.DoResolve): Use foreach
18434 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18435 (RemoveMethods): use foreach.
18437 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18438 nested foreach statements instead of for, and also break out of
18439 the inner loop once a match is found.
18441 (Invocation.OverloadResolve): Use foreach, simplify the code.
18443 2002-05-08 Miguel de Icaza <miguel@ximian.com>
18445 * cfold.cs (BinaryFold): During an enumeration evaluation context,
18446 we actually unwrap the expression to allow for extra information
18449 * expression.cs: Use Shr_Un on unsigned operations.
18451 2002-05-08 Ravi Pratap <ravi@ximian.com>
18453 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
18454 applicable operators was not being considered correctly. This closes
18455 the bug Miguel reported.
18457 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18459 * attribute.cs: check that the type derives from System.Attribute
18460 and report the correct error in that case (moved the duplicate code to
18461 its own method, too).
18463 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18465 * attribute.cs: lookup attribute type name as the spec says: first the
18466 bare attribute name and then name + "Attribute" (nant compiles with
18467 mcs after this fix).
18469 2002-05-07 Miguel de Icaza <miguel@ximian.com>
18471 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
18472 Because of the way we parse things, we should try to see if a
18473 UIntConstant can fit in an integer.
18475 2002-05-07 Ravi Pratap <ravi@ximian.com>
18477 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18478 when we are in an explicit context.
18480 (ConvertReferenceExplicit): When converting from Iface type S to Class
18481 T make sure the rules are implemented as an OR.
18483 * parameter.cs (ParameterType): Make it a property for now although the
18484 purpose really isn't anything immediate.
18486 * expression.cs (Is*Applicable): Do better checking on the parameter type
18487 of a ref/out parameter. The ones from the system assemblies are already
18488 marked with the correct type so we don't need to do any correction.
18490 * ecore.cs (StandardConversionExists): Conversion from Interface types to
18491 the object type is standard too so include that.
18493 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18495 * ecore.cs (StandardConversionExists): Augment with missing code:
18496 deal with IntConstant, LongConstants and Enumerations.
18498 * assign.cs: Report the error, instead of failing silently
18500 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18501 typecontainer that they are declared, because the
18502 typecontainer/namespace will have the list of using clauses that
18503 need to be applied.
18505 Assembly Attributes were escaping the normal registration
18508 (EmitCode): Apply attributes within an EmitContext that represents
18509 the container they were declared on.
18511 * cs-parser.jay: Track bases for structs. How did I get this wrong?
18513 2002-05-06 Ravi Pratap <ravi@ximian.com>
18515 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18516 Revamp completely - make much cleaner as we now operate only
18519 (FindMostSpecificSource, FindMostSpecificTarget): New methods
18520 to implement the logic detailed in the spec more correctly.
18522 (UserDefinedConversion): Update accordingly.
18524 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18526 * statement.cs: Return flow analysis information up.
18528 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18531 (token): Do not consume an extra character before calling
18534 2002-05-06 Piers Haken <piersh@friskit.com>
18536 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18538 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18540 * class.cs (Constructor.Emit): Set the IsStatic flag in the
18541 EmitContext during the instance constructor initializer
18542 resolution, to stop access to instance variables.
18544 This is mandated by the spec, last paragraph of the `constructor
18545 initializers' section.
18547 2002-05-05 Miguel de Icaza <miguel@ximian.com>
18549 * cs-parser.jay, class.cs (Accessor): new class used to represent
18550 an accessor (get or set). In the past we used `null' to represent
18551 a missing accessor. But this is ambiguous because there was no
18552 way to tell in abstract indexers/properties if one of them was
18555 Now there is a way of addressing that.
18557 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18558 instead of FindMembers.
18560 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18561 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18563 * attribute.cs: Treat indexers and properties as the same in terms
18564 of applying attributes
18566 * ecore.cs (FindMostEncompassedType): Use statically initialized
18567 EmptyExpressions()s like we do elsewhere to avoid creating useless
18568 objects (and we take this out of the tight loop).
18570 (GetConversionOperators): Move the code to extract the actual
18571 operators to a separate routine to clean things up.
18573 2002-05-04 Miguel de Icaza <miguel@ximian.com>
18575 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18576 events are always registered FieldBuilders.
18578 * class.cs (FieldBase): New class shared by Fields
18580 * delegate.cs: If we are a toplevel delegate, use our full name.
18581 If we are a nested delegate, then only use our tail name.
18583 2002-05-02 Ravi Pratap <ravi@ximian.com>
18585 * expression.cs (IsApplicable): Ensure that we add the "&" to
18586 ref/out types before comparing it with the type of the argument.
18588 (IsParamsMethodApplicable): Ditto.
18590 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
18593 * delegate.cs : Handle the case when we have more than one applicable
18594 method. Flag an error only when we finish checking all.
18596 2002-05-02 Miguel de Icaza <miguel@ximian.com>
18598 * expression.cs: Add support for boolean static initializers.
18600 2002-05-01 Miguel de Icaza <miguel@ximian.com>
18602 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18604 * parameter.cs (ComputeParameterTypes,
18605 ComputeAndDefineParameterTypes): Better error handling: now we
18606 clear the `types' cache if we fail during any of the type lookups.
18607 We also return the status code correctly to our caller
18609 * delegate.cs: If we fail to define a delegate, abort the extra
18612 * expression.cs (Binary.ResolveOperator): for
18613 operator==(object,object) and operator !=(object, object) we also
18614 have to verify that there is an implicit conversion from one to
18617 (ArrayAccess.DoResolve): Array Access can operate on
18620 2002-04-30 Miguel de Icaza <miguel@ximian.com>
18622 * assign.cs (CompoundAssign): A new class used as a "flag" that
18623 the assignment actually is happening as part of a compound
18624 assignment operator.
18626 During compound assignment, a few new rules exist to enable things
18633 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18634 to the type of x) if y is implicitly convertible to the type of x,
18635 and the operator is a builtin operator and the return type of the
18636 operator is explicitly convertible to the type of x.
18638 * rootcontext.cs: Reset warning level to 2. 4 catches various
18639 "interesting" features in mcs, we must clean this up at some
18640 point, but currently am trying to kill other bugs ;-)
18642 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18643 in container classes as well.
18645 * expression.cs (Binary.ResolveOperator): Handle string case
18646 before anything else (as operator overloading does emit an error
18647 before doing anything else).
18649 This code could go away when we move to a table driven model, but
18650 i could not come up with a good plan last night.
18652 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
18654 * typemanager.cs (CSharpName): reimplementation using regex.
18655 * class.cs: added null check for fields in Emit
18656 * rootcontext.cs: set warninglevel to 4
18658 2002-04-29 Miguel de Icaza <miguel@ximian.com>
18660 * typemanager.cs (CSharpName): reimplemented with Lupus
18663 2002-04-28 Miguel de Icaza <miguel@ximian.com>
18665 * statement.cs (If): correclty implement Resolve, because we were
18666 not catching sem errors in there. The same process is needed
18668 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18671 (Statement.Warning_DeadCodeFound): Factorize code.
18672 (While): Report dead code here too.
18674 (Statement): Added Resolve virtual method to allow
18675 for resolution split from the emit code.
18677 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18679 * statement.cs (EmitBoolExpression): No longer try to resolve the
18681 (MakeBoolean): New utility function that resolve, implicitly
18682 converts to boolean and tags the expression.
18685 (If, Do): Implement dead code elimination.
18686 (While): Implement loop inversion
18688 (Do, While, For, If): Resolve the expression prior to calling our
18691 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
18694 - added method Report28 (warning: program has more than one entry point)
18695 - added method IsEntryPoint, implements paragraph 10.1 of the spec
18696 - modified method Method.Define, the part at the end of the method
18698 * rootcontext.cs: added static public Location EntryPointLocation;
18700 * ../errors/cs0028.cs : Add test case for the above warning.
18703 - modified method CSharpName to allow arrays of primitive type to
18704 be printed nicely (e.g. instead of System.Int32[][] it now prints
18706 - added method CSharpSignature: returns the signature of a method
18707 in string format to be used in reporting errors, warnings, etc.
18709 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18712 2002-04-26 Ravi Pratap <ravi@ximian.com>
18714 * delegate.cs (Define): Fix extremely silly bug where I was
18715 setting the type of the 'object' parameter of the BeginInvoke
18716 method to System.IAsyncResult instead of System.Object ;-)
18718 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18720 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18723 (Constructor.Emit): return if we fail to initialize the
18724 constructor. Another door closed!
18726 * expression.cs (New.DoResolve): Improve error message (from -6 to
18727 1501). Use DeclaredOnly lookup to find the exact constructor.
18729 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18730 loop. This is useful.
18732 * cs-parser.jay: Adjust the default parameters so that destructors
18733 have the proper signature.
18735 2002-04-26 Martin Baulig <martin@gnome.org>
18737 * driver.cs (LoadAssembly): If `assembly' contains any characters
18738 which are only valid in path names and not in assembly names
18739 (currently slash, backslash and point), use Assembly.LoadFrom ()
18740 instead of Assembly.Load () on the `assembly' (before iteration
18741 over the link_paths).
18743 2002-04-26 Martin Baulig <martin@gnome.org>
18745 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18747 2002-04-25 Miguel de Icaza <miguel@ximian.com>
18749 * class.cs (Property): use the new typemanager.MemberLookup
18751 (TypeContainer.MemberLookup): Implement using the
18752 TypeManager.MemberLookup now.
18754 * typemanager.cs: Make MemberLookup a function of the TypeManager,
18755 and return MemberInfos, so that these can be used without an
18756 EmitContext (what we had before).
18758 2002-04-24 Miguel de Icaza <miguel@ximian.com>
18760 * expression.cs: Fix the case where the argument to params if the
18761 type of the params. I omitted handling this before. Fixed
18763 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18765 * driver.cs: Call BootCorlib_PopulateCoreType
18767 * class.cs (Property.CheckBase): Check for properties only, not
18770 * interface.cs: Temporary hack: try/catch around the
18771 CustomAttributeBuilder, because I am getting an exception that I
18774 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18775 types whose definitions are required to be there (attributes are
18776 defined before standard types).
18778 Compute definitions as we boot the various types, as they are used
18779 immediately (value_type class will need object_type, but if we do
18780 not initialize object_type, we will pass a null, which will let
18781 the runtime pick the System.Object from the existing corlib, which
18782 is not what we want).
18784 2002-04-22 Patrik Torstensson <totte@labs2.com>
18786 * cs-tokenizer.cs: fixed a number of trim() issues.
18788 2002-04-22 Ravi Pratap <ravi@ximian.com>
18790 * expression.cs (Argument.Type): Ensure that we return the correct
18791 type when we have out or ref parameters [in which case we
18794 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18796 * class.cs (Property, Indexer): Allow extern modifier in there.
18798 * typemanager.cs (InitBaseTypes): Initializes object_type and
18799 value_type, since those will be used early on during the bootstrap
18800 process to compile corlib.
18802 (InitCoreTypes): Move code from here to InitBaseTypes.
18804 2002-04-21 Miguel de Icaza <miguel@ximian.com>
18806 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18807 single-dimension arrays as using the ldlen opcode.
18809 Daniel Lewis discovered this optimization.
18811 * typemanager.cs: Add signature for System.Array::get_Length
18813 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18815 * statement.cs: report the error when the foreach does not apply to an
18816 array nor a collection.
18818 2002-04-19 Miguel de Icaza <miguel@ximian.com>
18820 * expression.cs: Add implicit conversions to the operator ~.
18822 * constant.cs (DecimalConstant.Emit): Emit decimal value.
18824 * typemanager.cs: Locate the decimal constructor.
18826 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18828 * attribute.cs: use the new property of TypeOf.
18829 * expression.cs: added 'get' property around typearg.
18831 These changes fix a build breaker reported by NickD. Is this the
18832 correct way to fix? If not, please, revert my changes and make it
18835 2002-04-17 Miguel de Icaza <miguel@ximian.com>
18837 * attribute.cs: Add support for typeof in attribute invocations.
18838 I am not sure that this is right though.
18840 2002-04-14 Duncan Mak <duncan@ximian.com>
18842 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18843 Binary.Operator.Division case.
18845 2002-04-13 Ravi Pratap <ravi@ximian.com>
18847 * class.cs (DefineType): Ensure that we do a proper check on
18848 attribute types and also register it with the TypeManager.
18850 (TypeContainer.Targets): The default for attribute types is
18851 AttributeTargets.All.
18853 * attribute.cs (ApplyAttributes): Registering the attribute type
18854 is done elsewhere, not when we discover we have a Usage attribute.
18856 2002-04-12 Ravi Pratap <ravi@ximian.com>
18858 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18859 and get rid of is_delegate parameter.
18861 * everywhere : update.
18863 2002-04-12 Ravi Pratap <ravi@ximian.com>
18865 * cs-parser.jay (compilation_unit): Revamp completely to use
18866 some new ideas that I got from Rhys' grammar to solve the problems
18867 with assembly level attributes.
18869 (outer_declaration): New grammar production.
18871 (attribute_sections): Add.
18873 (opt_attributes): Base on attribute_sections
18875 (namespace_declaration): Allow opt_attributes to tackle the case
18876 when we have assembly level attributes - we are clever in this
18879 * attribute.cs (ApplyAttributes): Do not worry about assembly
18880 attributes in the non-global context.
18882 * rootcontext.cs (AddGlobalAttributes): Go back to using this
18883 instead of SetGlobalAttributes.
18885 * class.cs, rootcontext.cs : Ensure we define and generate
18886 attribute types before anything else.
18888 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18889 and flag the new error -20 for the case when the attribute type
18890 does not have valid targets specified. csc does not catch this.
18892 * ../errors/errors.txt : update for error # -20
18894 2002-04-11 Ravi Pratap <ravi@ximian.com>
18896 * support.cs (InternalParameters.ParameterModifier): Do some null
18897 checking and return sane values.
18899 * class.cs (Method.Define): If we are a PInvoke method, ensure
18900 that we are static and extern. Report error # 601
18902 * ../errors/cs0601.cs : Add test case for the above error.
18904 2002-04-07 Ravi Pratap <ravi@ximian.com>
18906 * rootcontext.cs (attribute_types): We need to keep type of
18907 all attribute types separately and emit code for them first.
18909 (RegisterAttribute) : Implement.
18911 * class.cs (DefineType): Check if the current Type is a custom
18912 attribute type and register it accordingly.
18914 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18915 adding the first attribute twice and rename to
18917 (SetGlobalAttributes): this.
18919 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18922 * attribute.cs (ApplyAttributes): Take an additional argument telling us
18923 if we are processing global arguments. Hmm, I am unsure of this.
18925 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18927 * expression.cs: added static array of strings to avoid calling
18928 Enum.ToString () for Operator in Binary. Significant recover of
18931 2002-04-10 Miguel de Icaza <miguel@ximian.com>
18933 * class.cs (FindMembers): Allow the Builders of the various
18934 members to be null. If they are skip them. This only happens
18935 during the PInvoke declaration.
18937 2002-04-09 Miguel de Icaza <miguel@ximian.com>
18939 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18940 failure, so we do not keep going afterwards.
18942 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18943 wanted to pass `false' as the `is_delegate' argument. If this is
18944 the case, why not use delegate_type == null to mean `is_delegate =
18945 false' and anything else as is_delegate = true.
18947 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
18949 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18950 code for the section, not the beginning of the tests.
18952 2002-04-08 Miguel de Icaza <miguel@ximian.com>
18954 * cfold.cs: Handle operator + (Enum x, Underlying x)
18956 * expression.cs (Binary): same. Warn about errors where we have
18957 Enum/Enum in operator + as well.
18959 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
18962 - added support for switch(bool)
18963 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18964 - add TableSwitchEmit() to handle table-based switch statements
18966 2002-04-05 Ravi Pratap <ravi@ximian.com>
18968 * expression.cs (Invocation.OverloadResolve): Factor out code which
18969 does parameter compatibility checking with arguments so that we can
18970 re-use the code even from Delegate.VerifyApplicability
18972 (VerifyArgumentsCompat): Move above code here.
18974 * delegate.cs (VerifyApplicability): Get rid of duplicate code
18975 and instead make a call to the above method.
18977 2002-03-31 Ravi Pratap <ravi@ximian.com>
18979 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18980 We use it to keep track of classes which are attribute types.
18982 2002-04-02 Miguel de Icaza <miguel@ximian.com>
18984 * delegate.cs (Delegate.Define): Correctly define the types in the
18985 presence of fixed and array parameters.
18987 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18990 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18991 include NonPublic after the first iteration.
18993 * class.cs (Indexer.CheckBase): Only check if both parents are
18996 * cs-parser.jay (accessor_body): If empty, set to null.
18998 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18999 same code path here to resolve constants names that we did have in
19000 MemberAccess.DoResolve. There is too much code duplicated here.
19002 2002-04-01 Miguel de Icaza <miguel@ximian.com>
19004 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19006 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19009 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19010 tokens, numbers and strings.
19012 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19015 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19016 asyncronous parameters and the regular parameters.
19018 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19019 specify the target directory.
19021 * expression.cs: (This.DoResolve): Simplify
19022 (As.Emit): Optimize, do not generate IsInst if the expression is
19023 always of the given type.
19025 (Is.DoResolve): Bug fix, we were reporting both always/never for
19028 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19029 creating too many unnecessary arrays.
19031 2002-03-31 Miguel de Icaza <miguel@ximian.com>
19033 * class.cs (EmitFieldInitializer): Use Assign expression to assign
19034 fields instead of rolling our own initializer. Takes care of all
19035 implicit conversions, and drops unnecessary static checks/argument.
19037 2002-03-31 Dick Porter <dick@ximian.com>
19039 * driver.cs: use the GetDirectories() return values properly, and
19040 use "/" as path separator.
19042 2002-03-30 Miguel de Icaza <miguel@ximian.com>
19044 * expression.cs (Unary): Optimize - - expr into expr.
19045 (Binary): Optimize a + (-b) into a -b.
19047 * codegen.cs (CodeGen): Made all methods static.
19049 2002-03-29 Miguel de Icaza <miguel@ximian.com>
19053 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19054 TypeBuilder property.
19056 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19059 * tree.cs: Removed the various RecordXXXX, and replaced with a
19060 single RecordDecl. Removed all the accessor methods, and just
19061 left a single access point Type
19063 * enum.cs: Rename DefineEnum to DefineType.
19065 * decl.cs: New abstract method `DefineType' used to unify the
19066 Defines for Enumerations, Interfaces, TypeContainers and
19069 (FindType): Moved LookupInterfaceOrClass here. Moved the
19070 LookupBaseClasses method that used to live in class.cs and
19071 interface.cs here, and renamed to FindType.
19073 * delegate.cs: Implement DefineType. Take advantage of the
19074 refactored pattern for locating the parent builder without taking
19075 the parent_builder argument (which we know does not work if we are
19076 nested, and triggering a toplevel definition).
19078 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19080 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19081 accessibility of a member has changed during override and report
19084 * class.cs (Method.Define, Property.Define): Only complain on
19085 overrides if the method is private, any other accessibility is
19086 fine (and since we just checked the permission is the same, we are
19089 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19090 and elif are processed always. The other pre-processing
19091 directives are only processed if we are "taking" the path
19093 2002-03-29 Martin Baulig <martin@gnome.org>
19095 * class.cs (Method.Emit): Only emit symbolic debugging info if the
19096 current location is not Null.
19098 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19099 a separate method so we can profile it.
19101 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19102 `span.Seconds' are just seconds, but no minutes or hours.
19103 (MainDriver): Profile the CodeGen.SaveSymbols calls.
19105 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19107 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19108 Remove the gratuitous set of Final:
19110 // If an interface implementation, then we can set Final.
19111 if (((flags & MethodAttributes.Abstract) == 0) &&
19112 implementing.DeclaringType.IsInterface)
19113 flags |= MethodAttributes.Final;
19115 I do not know what I was smoking when I used that.
19118 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19119 step into fixing the name resolution issues for delegates and
19120 unifying the toplevel name resolution.
19122 2002-03-28 Martin Baulig <martin@gnome.org>
19124 * class.cs (Method.Emit): If we have a symbol writer, call its
19125 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19126 tell it about the current method.
19128 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19129 writer that we're going to emit the first byte of IL code for a new
19130 statement (a new source line).
19131 (EmitContext.EmitTopBlock): If we have a symbol writer, call
19132 EmitContext.Mark() before emitting any code.
19134 * location.cs (SymbolDocument): Return null when we're Null.
19136 * statement.cs (Statement): Moved the `Location loc' variable here.
19137 (Statement.EmitBoolExpression): If we have a symbol writer, call
19138 ec.Mark() before emitting any code to tell it that we're at the
19139 beginning of a new statement.
19140 (StatementExpression): Added `Location' argument to the constructor.
19141 (Block): Added public readonly variable `StartLocation' and public
19142 variable `EndLocation'. The latter is to be set using SetEndLocation().
19143 (Block): Added constructor which takes a start and end location.
19144 (Block.SetEndLocation): New method. This sets the end location.
19145 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19146 local variables we create.
19147 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19148 each statement and do also mark the begin and end of the block.
19150 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19151 tell it the current lexer.Location, use Location.Null for the end of the
19153 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19154 current block, set its end location using SetEndLocation().
19155 (statement_expression): StatementExpression constructor now takes the
19156 lexer.Location as additional argument.
19157 (for_statement, declare_local_variables): Likewise.
19158 (declare_local_variables): When creating a new implicit block, use the
19159 new Block constructor and pass it the lexer.Location.
19161 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19163 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19164 members also on the parent interfaces recursively.
19166 2002-03-27 Miguel de Icaza <miguel@ximian.com>
19168 * report.cs: Use new formats, since Gonzalo finished the missing
19171 * expression.cs (Binary.ResolveOperator): added missing operator|
19172 operator& and operator^ for bool/bool.
19174 * cs-parser.jay: CheckDef now takes a Location argument that is
19175 used to report errors more precisly (instead of reporting the end
19176 of a definition, we try to track something which is a lot closer
19177 to the source of the problem).
19179 * cs-tokenizer.cs: Track global token use, so we can properly flag
19180 the use of #define/#undef after the first token has been seen.
19182 Also, rename the reportXXXX to Error_DescriptiveName
19184 * decl.cs (DeclSpace.IsTopLevel): Move property here from
19185 TypeContainer, so that Enum and Interface can use this too.
19187 * class.cs (TypeContainer.LookupInterfaceOrClass,
19188 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19189 `builder' argument. Typically this was used to pass the parent
19190 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19193 The problem is that a nested class could trigger the definition of
19194 a toplevel class, and the builder would be obviously wrong in that
19197 So we drop this argument, and we compute dynamically the
19198 TypeBuilder/ModuleBuilder (the correct information was available
19199 to us anyways from DeclSpace.Parent)
19201 * interface.cs (Interface.DefineInterface): Drop builder
19202 parameter cleanup like class.cs
19204 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
19207 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19210 (Try.Emit): Propagate the returns value from the statement.
19212 (Return.Emit): Even if we are leavning
19214 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19216 * modifiers.cs: Fix the computation of MethodAttributes flags.
19218 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19220 * driver.cs: allow compilation of files that start with '/'.
19221 Add a default case when checking the argument of --target.
19223 2002-03-25 Miguel de Icaza <miguel@ximian.com>
19225 * interface.cs: Implement the same search algorithm for types in
19226 the interface code.
19228 * delegate.cs: Do not allow multiple definition.
19230 * Recovered ChangeLog that got accidentally amputated
19232 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19234 * rootcontext.cs: Load manually enum to allow core classes to
19235 contain enumerations.
19237 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19238 Update to new static methods in TypeManager.
19240 * typemanager.cs (GetMethod, GetConstructor): Use our
19241 implementation of FindMembers to find the members, since during
19242 corlib compilation, the types are TypeBuilders and GetMethod and
19243 GetConstructor do not work.
19245 Make all methods in TypeManager static.
19247 (InitCodeHelpers): Split the functionality from
19248 the InitCodeTypes function.
19250 * driver.cs: Call InitCodeHelpers after we have populated the
19253 * cs-parser.jay (delegate_declaration): we did not used to compute
19254 the delegate name correctly for void delegates.
19256 2002-03-24 Miguel de Icaza <miguel@ximian.com>
19258 * rootcontext.cs (RootContext): Init the interface_resolve_order
19259 and type_container_resolve_order always.
19261 (ResolveCore, BootstrapCorlib_ResolveClass,
19262 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19263 compiler when compiling with --nostdlib
19265 * class.cs (TypeContainer.DefineType): Check that our parent is
19266 not null. This test is most important when we are bootstraping
19269 * codegen.cs: Split out the symbol writing code.
19271 2002-03-25 Martin Baulig <martin@gnome.org>
19273 * driver.cs (-g): Made -g an alias for --debug.
19275 2002-03-24 Martin Baulig <martin@gnome.org>
19277 * codegen.cs (SymbolWriter): New public variable. Returns the
19278 current symbol writer.
19279 (CodeGen): Added `bool want_debugging_support' argument to the
19280 constructor. If true, tell the ModuleBuild that we want debugging
19281 support and ask it for the ISymbolWriter.
19282 (Save): If we have a symbol writer, call it's Close() method after
19283 saving the assembly.
19285 * driver.c (--debug): New command line argument to create a
19286 debugger information file.
19288 * location.cs (SymbolDocument): New public property. Returns an
19289 ISymbolDocumentWriter object for the current source file or null
19290 if we don't have a symbol writer.
19292 2002-03-21 Miguel de Icaza <miguel@ximian.com>
19294 * driver.cs (LoadAssembly): Correctly return when all the paths
19295 have been tried and not before.
19297 * statement.cs (Switch.Emit): return the actual coverage for this
19298 statement (returns/not-returns)
19300 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19301 switch of the statement if we are the last switch section. That
19302 kills two problems: try/catch problems (we used to emit an empty
19303 nop at the end) and switch statements where all branches would
19306 2002-03-19 Miguel de Icaza <miguel@ximian.com>
19308 * driver.cs: Add default assemblies (the equivalent to the
19309 Microsoft CSC.RSP file)
19311 * cs-tokenizer.cs: When updating `cols and setting it to zero,
19312 also update tokens_seen and set it to false.
19314 * driver.cs: Implement --recurse for Mike.
19316 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19317 correctly splitting out the paths.
19319 2002-03-18 Miguel de Icaza <miguel@ximian.com>
19321 * interface.cs (Interface.PopulateProperty): Instead of using
19322 `parent' as the declaration space for the set parameters, use
19325 * support.cs (InternalParameters): InternalParameters constructor
19326 takes a DeclSpace instead of a TypeContainer.
19328 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19329 types are being initialized, load the address of it before calling
19332 (New): Provide a mechanism to disable the generation of local
19333 value type temporaries when the caller will be providing us with
19334 an address to store it.
19336 (ArrayCreation.EmitDynamicInitializers): Use it.
19338 2002-03-17 Miguel de Icaza <miguel@ximian.com>
19340 * expression.cs (Invocation.EmitArguments): Only probe for array
19341 property if there is more than one argument. Sorry about that.
19343 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19344 empty param arrays.
19346 * class.cs (Method.LabelParameters): Fix incorrect code path that
19347 prevented the `ParamArrayAttribute' from being applied to the
19350 2002-03-16 Miguel de Icaza <miguel@ximian.com>
19352 * support.cs (ReflectionParameters): Correctly compute whether the
19353 last argument is a params array. Fixes the problem with
19356 * typemanager.cs: Make the assemblies array always be non-null
19357 (empty, but non-null)
19359 * tree.cs (RecordDecl): New function that abstracts the recording
19360 of names. This reports error 101, and provides a pointer to the
19361 previous declaration. Fixes a crash in the compiler.
19363 * cs-parser.jay (constructor_declaration): Update to new grammar,
19364 and provide a constructor_body that can be empty.
19366 2002-03-15 Miguel de Icaza <miguel@ximian.com>
19368 * driver.cs: Add support for --resources.
19370 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19371 Make all types for the various array helper methods be integer.
19373 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19374 CheckState to ConvCast.
19376 (ConvCast): Now it takes a `checked' state argument, to avoid
19377 depending on the emit context for the conversion, and just using
19378 the resolve time setting.
19380 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19381 instead of Invocation.EmitArguments. We do not emit the original
19382 arguments, instead we emit those which have been converted to
19383 unsigned int expressions.
19385 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19387 * codegen.cs: ditto.
19389 * expression.cs (LocalVariableReference): Drop the use of the
19390 Store function that depended on the variable index.
19392 * statement.cs (VariableInfo): Drop the `Idx' property from this
19393 class, as this is not taking into account the indexes for
19394 temporaries tat we generate during the execution, getting the
19397 * class.cs: First emit class initializers, then call the parent
19400 * expression.cs (Binary): Fix opcode emision.
19401 (UnaryMutator.EmitCode): Support checked code generation
19403 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19404 matches for events for both the Static and Instance scans,
19405 pointing to the same element. Fix that.
19407 2002-03-14 Miguel de Icaza <miguel@ximian.com>
19409 * rootcontext.cs (ResolveTree): Always set the
19410 interface_resolve_order, because nested interfaces will be calling
19413 * class.cs (GetInterfaceOrClass): Track the same resolution
19414 process used by TypeManager.LookupType. This fixes the nested
19415 type lookups in class declarations (separate path from
19418 (TypeContainer.DefineType): Also define nested interfaces.
19419 (TypeContainer.RegisterOrder): New public function used to
19420 register the order in which child interfaces need to be closed.
19422 Nested interfaces need to be closed after their parents have been
19425 * interface.cs (InterfaceAttr): Put all the logic for computing
19426 the interface attribute here.
19428 (DefineInterface): Register our interface order with the
19429 RootContext or with the TypeContainer depending on the case.
19431 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19433 * cs-parser.jay: rework foreach statement to work with the new
19434 changes to the policy on SimpleNames.
19436 * report.cs: support Stacktrace on warnings as well.
19438 * makefile: drop --unsafe and /unsafe from the compile.
19440 2002-03-13 Ravi Pratap <ravi@ximian.com>
19442 * ecore.cs (StandardConversionExists): Modify to take an Expression
19443 as the first parameter. Ensure we do null -> reference type conversion
19446 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19447 temporary Expression objects.
19449 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19451 * interface.cs: workaround bug in method overloading resolution
19452 (there is already a bugzilla bug for it).
19454 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19456 We could also solve this problem by having a separate path for
19457 performing type lookups, instead of DoResolve, we could have a
19458 ResolveType entry point, and only participating pieces of the
19459 production (simplename, deref, array) would implement this.
19461 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19462 signal SimpleName to only resolve type names and not attempt to
19463 resolve anything else.
19465 * expression.cs (Cast): Set the flag.
19467 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19469 * class.cs: Only report 108 if there is no `new' modifier.
19471 * cs-parser.jay: rework foreach statement to work with the new
19472 changes to the policy on SimpleNames.
19474 * report.cs: support Stacktrace on warnings as well.
19476 * makefile: drop --unsafe and /unsafe from the compile.
19478 2002-03-11 Miguel de Icaza <miguel@ximian.com>
19480 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19481 lookups here, instead of doing that at parse time. This means
19482 that our grammar will not introduce `LocalVariableReferences' as
19483 expressions at this point. That solves the problem of code like
19487 static void Main ()
19491 This is only half the fix. The full fix requires parameters to
19492 also be handled in this way.
19494 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19495 makes the use more obvious of the DeclSpace. The
19496 ec.TypeContainer.TypeBuilder is now only used to pull the
19497 TypeBuilder for it.
19499 My theory is that I can get rid of the TypeBuilder completely from
19500 the EmitContext, and have typecasts where it is used (from
19501 DeclSpace to where it matters).
19503 The only pending problem is that the code that implements Aliases
19504 is on TypeContainer, and probably should go in DeclSpace.
19506 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19507 lookups here, instead of doing that at parse time. This means
19508 that our grammar will not introduce `LocalVariableReferences' as
19509 expressions at this point. That solves the problem of code like
19513 static void Main ()
19517 This is only half the fix. The full fix requires parameters to
19518 also be handled in this way.
19520 * class.cs (Property.DefineMethod): When implementing an interface
19521 method, set newslot, when implementing an abstract method, do not
19522 set the flag (before we tried never setting it, or always setting
19523 it, which is the difference).
19524 (Indexer.DefineMethod): same.
19525 (Method.DefineMethod): same.
19527 * ecore.cs: Only set the status used flag if we get back a Field.
19529 * attribute.cs: Temporary hack, so Paolo can keep working.
19531 2002-03-08 Ravi Pratap <ravi@ximian.com>
19533 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19534 the unmanaged type in the case we have a MarshalAs attribute.
19536 (Resolve): Handle the case when we are parsing the special MarshalAs
19537 attribute [we need to store the unmanaged type to use later]
19539 * typemanager.cs (marshal_as_attr_type): Built in type for the
19540 MarshalAs Attribute.
19542 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
19543 on parameters and accordingly set the marshalling info.
19545 2002-03-09 Miguel de Icaza <miguel@ximian.com>
19547 * class.cs: Optimizing slightly by removing redundant code after
19548 we switched to the `NoTypes' return value.
19549 (Property.DefineMethod): use NoTypes here too.
19551 This fixes the bug I introduced in my last batch of changes.
19553 2002-03-05 Ravi Pratap <ravi@ximian.com>
19555 * tree.cs (RecordEnum): Add. We now keep track of enums too.
19557 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19558 Enums since those are types too.
19560 * cs-parser.jay (enum_declaration): Record enums as we parse them.
19562 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
19563 thanks to a call during the lookup process.
19565 2002-03-07 Miguel de Icaza <miguel@ximian.com>
19567 * statement.cs (Foreach): Lots of work to accomodate a particular
19568 kind of foreach statement that I had not kept in mind. It is
19569 possible to have foreachs on classes that provide a GetEnumerator
19570 method that return objects that implement the "pattern" for using
19571 a foreach, there is no need to support GetEnumerator
19574 This is needed to compile nant.
19576 * decl.cs: Only report 114 if the member is not `Finalize' and if
19577 the warning level is at least 2.
19579 * class.cs: Moved the compare function from Method to
19582 (MethodSignature.InheritableMemberSignatureCompare): Add new
19583 filter function that is used to extract inheritable methods from a
19586 (Method.Define): Use the new `inheritable_method_signature_filter'
19589 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19592 2002-03-06 Miguel de Icaza <miguel@ximian.com>
19594 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19596 * cs-parser.jay: Add opt_semicolon to the interface declaration.
19598 * expression.cs: Pass location information to
19599 ConvertImplicitStandard.
19601 * class.cs: Added debugging code to track return values from
19604 2002-03-05 Miguel de Icaza <miguel@ximian.com>
19606 * expression.cs (Is.DoResolve): If either side of the `is' is an
19607 interface, do not flag the warning.
19609 * ecore.cs (ImplicitReferenceConversion): We need a separate test
19612 * report.cs: Allow for --fatal to be used with --probe.
19614 * typemanager.cs (NoTypes): Move the definition for the empty Type
19617 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19619 (TypeContainer.DefineProxy): New function used to proxy to parent
19620 implementations when implementing interfaces.
19621 (TypeContainer.ParentImplements): used to lookup if our parent
19622 implements a public function that is required by an interface.
19623 (TypeContainer.VerifyPendingMethods): Hook this up.
19625 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19626 `modules' and `assemblies' arraylists into arrays. We only grow
19627 these are the very early start up of the program, so this improves
19628 the speedof LookupType (nicely measured).
19630 * expression.cs (MakeByteBlob): Replaced unsafe code with
19631 BitConverter, as suggested by Paolo.
19633 * cfold.cs (ConstantFold.Binary): Special case: perform constant
19634 folding of string concatenation, but if either side is a string,
19635 and the other is not, then return null, and let the runtime use
19636 the concatenation on the string plus the object (using
19637 `Object.ToString').
19639 2002-03-04 Miguel de Icaza <miguel@ximian.com>
19641 Constant Folding has been implemented now.
19643 * expression.cs (Unary.Reduce): Do not throw an exception, catch
19644 the error instead on types that are not supported in one's
19647 * constant.cs (Constant and all children): New set of functions to
19648 perform implict and explicit conversions.
19650 * ecore.cs (EnumConstant): Implement the new functions to perform
19651 conversion by proxying to the child expression.
19653 * codegen.cs: (ConstantCheckState): Constant evaluation has its
19654 own separate setting that can not be turned off from the command
19655 line using --unchecked or --checked and is only controlled using
19656 the checked/unchecked statements and expressions. This setting is
19657 used by the constant folder to flag errors.
19659 * expression.cs (CheckedExpr, UncheckedExpr): Set the
19660 ConstantCheckState as well.
19662 During Resolve, they also have to flag the state, because the
19663 constant folder runs completely in the Resolve phase.
19665 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19668 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19670 * cfold.cs: New file, this file contains the constant folder.
19672 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19673 argument to track whether we are using the resulting address to
19674 load or store a value and provide better error messages.
19676 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19677 new AddressOf arguments.
19679 * statement.cs (Foreach.EmitCollectionForeach): Update
19681 * expression.cs (Argument.Emit): Call AddressOf with proper
19682 arguments to track usage.
19684 (New.DoEmit): Call AddressOf with new arguments.
19686 (Unary.Emit): Adjust AddressOf call.
19688 2002-03-01 Ravi Pratap <ravi@ximian.com>
19690 * cs-parser.jay (member_access): Change the case for pre-defined types
19691 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
19694 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19697 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19698 essentially like methods and apply attributes like MethodImplOptions to them too.
19700 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19703 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19704 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19707 * Update code everywhere accordingly.
19709 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19711 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19713 2002-02-28 Ravi Pratap <ravi@ximian.com>
19715 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19716 try performing lookups against those instead of jumping straight into using
19717 the 'using' clauses.
19719 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19721 (LookupType): Perform lookups in implicit parents too.
19723 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19724 sequence as RootContext.LookupType.
19726 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
19727 the various cases of namespace lookups into this method.
19729 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19731 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19732 in positional arguments)
19734 * class.cs (Operator): Update the AllowedModifiers to contain
19737 * cs-parser.jay: Update operator declaration to allow for the
19738 operator body to be empty.
19740 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19743 2002-02-27 Miguel de Icaza <miguel@ximian.com>
19745 * class.cs (Method.Emit): Label parameters.
19747 * driver.cs: Return 1 or 0 as the program exit code.
19749 2002-02-26 Miguel de Icaza <miguel@ximian.com>
19751 * expression.cs: Special case the `null' object when trying to
19752 auto-compute the type, as anything can be explicitly converted to
19755 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19756 spotting this Paolo.
19758 (Expression.ImplicitNumericConversion): Perform comparissions of
19759 the type using the underlying type in the case of an enumeration
19760 rather than using the enumeration type for the compare.
19762 Cope with the underlying == type case, which is not possible to
19765 (Expression.ConvertNumericExplicit): Perform comparissions of
19766 the type using the underlying type in the case of an enumeration
19767 rather than using the enumeration type for the compare.
19769 * driver.cs: If the user does not supply an extension, assume .exe
19771 * cs-parser.jay (if_statement): Rewrote so that we can track the
19772 location for the if statement.
19774 * expression.cs (Binary.ConstantFold): Only concat strings when
19775 the operation is "+", not everything ;-)
19777 * statement.cs (Statement.EmitBoolExpression): Take a location
19779 (If, While, Do): Track location.
19781 * expression.cs (Binary.ResolveOperator): In the object + string
19782 case, I was missing a call to ConvertImplicit
19784 2002-02-25 Ravi Pratap <ravi@ximian.com>
19786 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19787 Location arguments. Ensure we use RootContext.LookupType to do our work
19788 and not try to do a direct Type.GetType and ModuleBuilder.GetType
19790 * interface.cs (PopulateMethod): Handle the type of the parameter being
19793 * expression.cs (Invocation.BetterFunction): Handle the case when we
19794 have a params method with no fixed arguments and a call is made with no
19797 2002-02-25 Miguel de Icaza <miguel@ximian.com>
19799 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19800 the verbatim-string-literal
19802 * support.cs (InternalParameters.ParameterModifier): handle null
19804 (InternalParameters.ParameterType): ditto.
19806 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19807 duplicating the name of the variable parameter.
19808 (GetParameterByName): Fix bug where we were not looking up array
19809 paramters if they were the only present (thanks Paolo!).
19810 (GetParameterInfo): We only have an empty set of types if both
19811 fixed and array are set to null.
19812 (GetParameterInfo-idx): Handle FixedParameter == null
19814 * cs-parser.jay: Handle the case where there is no catch
19815 statements (missing null test).
19817 2002-02-22 Miguel de Icaza <miguel@ximian.com>
19819 * driver.cs (MainDriver): Be conservative on our command line
19822 Catch DirectoryNotFoundException when calling GetFiles.
19824 (SplitPathAndPattern): Used to split the input specification into
19825 a path and a pattern that we can feed to Directory.GetFiles.
19827 2002-02-21 Miguel de Icaza <miguel@ximian.com>
19829 * statement.cs (Fixed): Implement the last case of the Fixed
19830 statement (string handling).
19832 * expression.cs (StringPtr): New class used to return a char * to
19833 a string; Used by the Fixed statement.
19835 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
19837 * expression.cs (Binary.ResolveOperator): Remove redundant
19838 MemberLookup pn parent type.
19839 Optimize union call, we do not need a union if the types are the same.
19840 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19843 Specialize the use of MemberLookup everywhere, instead of using
19844 the default settings.
19846 (StackAlloc): Implement stackalloc keyword.
19848 * cs-parser.jay: Add rule to parse stackalloc.
19850 * driver.cs: Handle /h, /help, /?
19852 * expression.cs (MakeByteBlob): Removed the hacks we had in place
19853 before we supported unsafe code.
19855 * makefile: add --unsafe to the self compilation of mcs.
19857 2002-02-20 Miguel de Icaza <miguel@ximian.com>
19859 * expression.cs (PointerArithmetic): New class that is used to
19860 perform pointer arithmetic.
19861 (Binary.Resolve): Handle pointer arithmetic
19862 Handle pointer comparission.
19863 (ArrayPtr): Utility expression class that is used to take the
19864 address of an array.
19866 (ElementAccess): Implement array access for pointers
19868 * statement.cs (Fixed): Implement fixed statement for arrays, we
19869 are missing one more case before we are done.
19871 * expression.cs (Indirection): Implement EmitAssign and set the
19872 ExprClass to Variable. This allows pointer dereferences to be
19873 treated as variables, and to have values assigned to them.
19875 * ecore.cs (Expression.StoreFromPtr): New utility function to
19876 store values dereferencing.
19878 2002-02-20 Ravi Pratap <ravi@ximian.com>
19880 * expression.cs (Binary.ResolveOperator): Ensure that we are
19881 not trying to operate on a void type - this fixes the reported
19884 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19885 the parent implementation is sealed.
19887 * ../errors/cs0239.cs : Add.
19889 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19891 * typemanager.cs (unverifiable_code_type): Corresponds to
19892 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19893 which have unsafe code in them.
19895 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
19898 2002-02-19 Miguel de Icaza <miguel@ximian.com>
19900 * cs-tokenizer.cs: Add support for @"litreal strings"
19902 Make tokenizer accept pre-processor directives
19903 on any column (remove the old C-like limitation).
19905 * rootcontext.cs (EmitCode): Emit any global attributes.
19906 (AddGlobalAttributes): Used to keep track of assembly attributes.
19908 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19910 * cs-parser.jay: Add support for global attributes.
19912 2002-02-17 Miguel de Icaza <miguel@ximian.com>
19914 * expression.cs (Indirection): New helper class. Unary will
19915 create Indirection classes to be able to implement the
19916 IMemoryLocation interface on it.
19918 2002-02-16 Miguel de Icaza <miguel@ximian.com>
19920 * cs-parser.jay (fixed_statement): reference the right statement.
19922 * statement.cs (Fixed.Emit): Finish implementing the fixed
19923 statement for the &x case.
19925 2002-02-14 Miguel de Icaza <miguel@ximian.com>
19927 * class.cs (Property.Define, Method.Define): Remove newslot when
19930 * modifiers.cs: My use of NewSlot when `Abstract' was set was
19931 wrong. NewSlot should only be used if the `new' keyword is present.
19933 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19934 locating our system dir. Sorry about this.
19936 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19938 * driver.cs (GetSystemDir): Compute correctly the location of our
19939 system assemblies. I was using the compiler directory instead of
19940 the library directory.
19942 2002-02-13 Ravi Pratap <ravi@ximian.com>
19944 * expression.cs (BetterFunction): Put back in what Miguel commented out
19945 since it is the correct fix. The problem is elsewhere ;-)
19947 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19948 parameters of the parms method are themselves compatible or not !
19950 (StandardConversionExists): Fix very dangerous bug where we were forgetting
19951 to check that a class implements an interface before saying that an implicit
19952 conversion was allowed. Use ImplementsInterface to do the checking.
19954 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19956 * class.cs (Method.Define): Track whether we are an explicit
19957 implementation or not. And only call DefineMethodOverride if we
19958 are an explicit implementation.
19960 (Property.DefineMethod): Ditto.
19962 2002-02-11 Ravi Pratap <ravi@ximian.com>
19964 * expression.cs (BetterFunction): Catch hideous bug which was
19965 preventing us from detecting ambiguous calls due to implicit casts i.e
19968 2002-01-29 Miguel de Icaza <miguel@ximian.com>
19970 * support.cs (Pair): Remove un-needed method. I figured why I was
19971 getting the error in cs-parser.jay, the variable in a foreach loop
19972 is readonly, and the compiler does not really treat this as a variable.
19974 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
19975 instead of EQUALS in grammar.
19977 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19979 * expression.cs (Unary.DoResolve): Check whether the argument is
19982 2002-01-28 Miguel de Icaza <miguel@ximian.com>
19984 * support.cs: Api for Pair to set a value. Despite the fact that
19985 the variables are public the MS C# compiler refuses to compile
19986 code that accesses the field if the variable is part of a foreach
19989 * statement.cs (Fixed): Begin implementation of the fixed
19992 (Block.AddVariable): Return the VariableInfo on success and null
19993 on failure instead of true/false.
19995 * cs-parser.jay (foreach): Catch errors on variables already
19996 defined (we were ignoring this value before) and properly unwind
19997 the block hierarchy
19999 (fixed_statement): grammar for the fixed statement.
20001 2002-01-25 Miguel de Icaza <miguel@ximian.com>
20003 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20004 pointer types to be incretemented.
20006 (SizeOf): Implement.
20008 * cs-parser.jay (pointer_member_access): Implement
20009 expr->IDENTIFIER production.
20011 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20012 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20015 (Unary): Implement indirection.
20017 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20018 use in non-unsafe context).
20020 (SimpleName.DoResolve): Check for pointers in field access on safe
20023 (Expression.LoadFromPtr): Factor the load-indirect code in this
20024 function. This was duplicated in UnboxCast and ParameterReference
20026 2002-01-24 Miguel de Icaza <miguel@ximian.com>
20028 * expression.cs (ComposedCast): report an error if a pointer cast
20029 is used in a safe region.
20031 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20032 pointer type casts in unsafe context.
20034 * codegen.cs (EmitContext): Set up IsUnsafe.
20036 * cs-parser.jay (non_expression_type): Add productions for pointer
20039 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20040 code. We should not use force into static mode if the method is
20041 not virtual. Fixes bug in MIS
20043 * statement.cs (Do.Emit, While.Emit, For.Emit,
20044 Statement.EmitBoolExpression): Add support to Do and While to
20045 propagate infinite loop as `I do return' semantics.
20047 Improve the For case to also test for boolean constants.
20049 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20050 to the list of attributes we can add.
20052 Remove `EmitContext' argument.
20054 * class.cs (Method.Define): Apply parameter attributes.
20055 (Constructor.Define): Apply parameter attributes.
20056 (MethodCore.LabelParameters): Move here the core of labeling
20059 * support.cs (ReflectionParameters.ParameterModifier,
20060 InternalParameters.ParameterModifier): Use IsByRef on the type and
20061 only return the OUT bit for these parameters instead of in/out/ref
20064 This is because I miss-understood things. The ParameterInfo.IsIn
20065 and IsOut represent whether the parameter has the [In] and [Out]
20068 2002-01-22 Miguel de Icaza <miguel@ximian.com>
20070 * ecore.cs (FieldExpr.Emit): Release temporaries.
20072 * assign.cs (LocalTemporary.Release): new function.
20074 * codegen.cs (EmitContext.GetTemporaryStorage,
20075 EmitContext.FreeTemporaryStorage): Rework the way we deal with
20076 temporary storage. Now we can "put back" localbuilders when we
20079 2002-01-21 Miguel de Icaza <miguel@ximian.com>
20081 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20082 need to make a copy of the variable to generate verifiable code.
20084 2002-01-19 Miguel de Icaza <miguel@ximian.com>
20086 * driver.cs: Compute dynamically the system directory.
20088 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20089 Slower, but more generally useful. Used by the abstract
20090 registering implementation.
20092 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20093 the rules for the special rule on Type/instances. First check if
20094 we have the same name, and if so, try that special static path
20095 rather than the instance path.
20097 2002-01-18 Miguel de Icaza <miguel@ximian.com>
20099 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20102 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20103 Enum, ValueType, Delegate or Array for non-corlib compiles.
20105 * cs-tokenizer.cs: Catch long identifiers (645)
20107 * typemanager.cs (IndexerPropetyName): Ravi never tested this
20110 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20111 fix, we were returning too early, so we were not registering
20112 pending methods from abstract classes.
20114 Do not register pending methods if the class is abstract.
20116 * expression.cs (Conditional.DoResolve): Report circular implicit
20117 conversions when we neecd to compute it for conditional
20120 (Is.DoResolve): If the expression is always of the provided type,
20121 flag warning 183. If the expression can not ever be of the
20122 provided type flag warning 184.
20124 * class.cs: Catch 169 as well.
20126 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20129 2002-01-18 Nick Drochak <ndrochak@gol.com>
20131 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
20133 2002-01-17 Miguel de Icaza <miguel@ximian.com>
20135 * interface.cs: (PopulateMethod): Check for pointers being defined
20136 only if the unsafe context is active.
20137 (PopulateProperty): ditto.
20138 (PopulateIndexer): ditto.
20140 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20141 specified. If pointers are present, make sure that they are
20142 present in an unsafe context.
20143 (Constructor, Constructor.Define): ditto.
20144 (Field, Field.Define): ditto.
20145 (Property, Property.Define): ditto.
20146 (Event, Event.Define): ditto.
20148 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20149 hashtable if there are classes or structs defined.
20151 * expression.cs (LocalVariableReference.DoResolve): Simplify this
20152 code, as the constant resolution moved.
20154 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20155 the metadata, so we can flag error 133.
20157 * decl.cs (MemberCore.UnsafeOK): New function to test that a
20158 pointer is being declared in an unsafe context.
20160 2002-01-16 Miguel de Icaza <miguel@ximian.com>
20162 * modifiers.cs (Modifiers.Check): Require a Location argument.
20163 Report error 227 for Unsafe use.
20165 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20167 * statement.cs (For.Emit): If the test is null, then report that
20168 we do `return', as we wont reach anything afterwards.
20170 (Switch.SwitchGoverningType): Track the expression that matched
20173 * driver.cs: Allow negative numbers as an error code to flag.
20175 * cs-parser.jay: Handle 1551.
20177 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20179 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20181 * cs-parser.jay: Report 1518 (type declaration can only contain
20182 class, struct, interface, enum or delegate)
20184 (switch_label): Report 1523 (keywords `case' or `default' must
20187 (opt_switch_sections): Report 1522 (empty switch)
20189 * driver.cs: Report 1515 (response file specified multiple times)
20190 Report 1516 (Source file specified multiple times).
20192 * expression.cs (Argument.Resolve): Signal 1510
20194 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20195 access not allowed in static code)
20197 2002-01-11 Ravi Pratap <ravi@ximian.com>
20199 * typemanager.cs (IsPointerType): Utility method which we are going
20202 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20203 the object type, so we take care of that.
20205 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20207 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20208 added to non-params parameters :-)
20210 * typemanager.cs (CSharpName): Include 'void' type too.
20212 (void_ptr_type): Include in the set of core types.
20214 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
20217 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
20220 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
20221 completely forgotten about it.
20223 2002-01-10 Ravi Pratap <ravi@ximian.com>
20225 * cs-parser.jay (pointer_type): Add. This begins our implementation
20226 of parsing rules for unsafe code.
20228 (unsafe_statement): Implement.
20230 (embedded_statement): Modify to include the above.
20232 * statement.cs (Unsafe): Implement new class for unsafe blocks.
20234 * codegen.cs (EmitContext.InUnsafe): Add. This determines
20235 if the current context is an unsafe one.
20237 * cs-parser.jay (local_variable_pointer_type): Since local variable types
20238 are handled differently, we need separate rules for them.
20240 (local_variable_declaration): Update to use local_variable_pointer_type
20241 to allow variable declarations of unmanaged pointer types.
20243 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20244 in unsafe contexts.
20246 * ../errors/cs0214.cs : Add.
20248 2002-01-16 Nick Drochak <ndrochak@gol.com>
20250 * makefile: remove 'response' file when cleaning.
20252 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20254 * cs-parser.jay: Report 1524.
20256 2002-01-14 Miguel de Icaza <miguel@ximian.com>
20258 * typemanager.cs (RegisterMethod): drop checking if we have
20259 registered this from here
20261 2002-01-12 Miguel de Icaza <miguel@ximian.com>
20263 * class.cs (Method.EmitDestructor): Implement calling our base
20266 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20267 value of InFinally.
20269 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20270 this routine and will wrap the call in a try/catch block. Deal
20273 2002-01-11 Miguel de Icaza <miguel@ximian.com>
20275 * ecore.cs (Expression.MemberLookup): instead of taking a
20276 parameter `same_type' that was used to tell whether we could
20277 access private members we compute our containing type from the
20280 (FieldExpr): Added partial support for volatile fields. This does
20281 not work for volatile fields exposed from assemblies, as I can not
20282 figure out how to extract the modreq from it.
20284 Updated all the source files to use this.
20286 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20287 because it is referenced by MemberLookup very often.
20289 2002-01-09 Ravi Pratap <ravi@ximian.com>
20291 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20292 TypeBuilder.GetCustomAttributes to retrieve what we need.
20294 Get rid of redundant default_member_attr_type as this is the same as
20295 default_member_type which already exists.
20297 * interface.cs, attribute.cs : Update accordingly.
20299 2002-01-08 Miguel de Icaza <miguel@ximian.com>
20301 * typemanager.cs: Enable IndexerPropertyName again. It does not
20302 work for TYpeBuilders though. Ravi, can you please fix this?
20304 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20306 * expression.cs (Argument.Emit): Handle the case of ref objects
20307 being passed to ref functions;
20309 (ParameterReference.EmitLoad): Loads the content of the pointer
20310 without dereferencing.
20312 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20314 * cs-tokenizer.cs: Implemented the pre-processing expressions.
20316 2002-01-08 Ravi Pratap <ravi@ximian.com>
20318 * class.cs (Indexer.DefineMethod): Incorporate the interface
20319 type in the name of the method if we are doing explicit interface
20322 * expression.cs (ConversionExists): Remove as it is completely obsolete.
20324 (BetterConversion): Fix extremely trivial bug where we were referring to
20325 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20328 * ../errors/bug16.cs : Add although we have fixed it.
20330 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20332 * expression.cs (BaseIndexer): Begin implementation.
20334 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20336 * cs-parser.jay (indexer_declarator): Use qualified_identifier
20337 production directly to remove a shift/reduce, and implement
20338 explicit interface implementation.
20340 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20341 after a floating point suffix.
20343 * expression.cs (DoNumericPromotions): Improved the conversion for
20344 uint/uint. If we have a constant, we avoid doing a typecast to a
20347 * class.cs (Indexer): Implement explicit interface implementation
20350 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20352 * class.cs: make the default instance constructor public and hidebysig.
20354 2001-01-03 Ravi Pratap <ravi@ximian.com>
20356 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20357 so we can call it from elsewhere.
20359 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20360 we emit it internally if the class has a defined indexer; otherwise the user
20361 emits it by decorating the class definition with the DefaultMemberAttribute.
20363 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20364 attribute is not used on a type which defines an indexer.
20366 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20367 character when we skip whitespace.
20369 * ../errors/cs0646.cs : Add.
20371 2002-01-03 Miguel de Icaza <miguel@ximian.com>
20373 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20376 * makefile: Add practical target `mcs3.exe' which builds the third
20377 generation compiler.
20379 * expression.cs (New): Fix structures constructor calling.
20381 * class.cs (Property, Method, Indexer): Emit Final flag on the
20382 method if we are an interface implementation and we are not
20385 * ecore.cs (PropertyExpr): New public field `IsBase', tells
20386 whether this property is referencing a `base' method.
20388 * expression.cs (Invocation.EmitCall): take an extra argument:
20389 is_base, this is used to determine whether the `call' or
20390 `callvirt' opcode should be used.
20393 * delegate.cs: update EmitCall.
20395 * class.cs (Method.Define): Set NewSlot for the cases where we are
20396 not implementing an interface method.
20398 (Property.Define): ditto.
20400 2002-01-02 Miguel de Icaza <miguel@ximian.com>
20402 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20403 'r'. Allows mcs to parse itself fully.
20405 2002-01-02 Ravi Pratap <ravi@ximian.com>
20407 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20408 of the number of initializers that require the InitializeArray method.
20410 (CheckIndices): Store the Expression in all cases - not the plain value. Also
20411 update the above field where necessary.
20413 (MakeByteBlob): Update accordingly.
20415 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
20418 (EmitDynamicInitializers): Update in accordance with the new optimization.
20420 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20421 same OpCode applies.
20423 * cs-parser.jay : Fix some glaring errors I introduced.
20425 2002-01-01 Ravi Pratap <ravi@ximian.com>
20427 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20428 so that we can check for name clashes there too.
20430 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20431 for interface indexers.
20433 * interfaces.cs (Define): Emit the default member attribute.
20435 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20436 variable was being referred to while setting the value ;-)
20438 2002-01-01 Miguel de Icaza <miguel@ximian.com>
20440 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20441 byte-by-byte information when we know the data is zero.
20443 Make the block always a multiple of 4, because
20444 DefineInitializedData has a bug.
20446 * assign.cs: Fix, we should assign from the temporary, not from
20449 * expression.cs (MakeByteBlob): Fix my incorrect code.
20451 2001-12-31 Miguel de Icaza <miguel@ximian.com>
20453 * typemanager.cs (EnumToUnderlying): This function is used to get
20454 the underlying type from an enumeration, because it does not
20457 * constant.cs: Use the I4_S form for values between -128 and 127.
20459 * statement.cs (Block.LookupLabel): Looks up a label.
20460 (Block): Drop support for labeled blocks.
20462 (LabeledStatement): New kind of statement that represents a label
20465 (Goto): Finally implement this bad boy.
20467 * cs-parser.jay: Update to reflect new mechanism to implement
20470 2001-12-30 Miguel de Icaza <miguel@ximian.com>
20472 * codegen.cs (EmitContext.This): a codegen property that keeps the
20473 a single instance of this instead of creating many different this
20476 * delegate.cs (Delegate.DoResolve): Update to use the property;
20478 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20480 * expression.cs (BaseAccess.DoResolve): Ditto.
20482 2001-12-29 Ravi Pratap <ravi@ximian.com>
20484 * typemanager.cs (methodimpl_attr_type): Add to hold the type
20485 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20487 (InitCoreTypes): Update accordingly.
20489 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20490 so we can quickly store the state.
20492 (ApplyAttributes): Set the correct implementation flags
20493 for InternalCall methods.
20495 2001-12-29 Miguel de Icaza <miguel@ximian.com>
20497 * expression.cs (EmitCall): if a method is not virtual, then do
20498 not use callvirt on it.
20500 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20501 user defined stuff) requires the use of stobj, which takes an
20502 address on the stack instead of an array and an index. So emit
20503 the Ldelema operation for it.
20505 (EmitStoreOpcode): Use stobj for valuetypes.
20507 (UnaryMutator.EmitCode): Use the right 1 value depending on
20508 whether we are dealing with int64/uint64, float or doubles.
20510 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20511 constructors that I implemented last night.
20513 (Constructor.IsDefault): Fix to work properly for static
20516 * cs-parser.jay (CheckDef): report method signature errors.
20517 Update error number 103 to be 132.
20519 * decl.cs: New AdditionResult enumeration value: MethodExists.
20520 Although we do this check for methods later on in the semantic
20521 analysis, catching repeated default constructors is so easy that
20522 we catch these here.
20524 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20527 (ParameterReference.EmitAssign, Emit): handle
20530 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20531 (ArrayAccess.EmitStoreOpcode): ditto.
20533 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20535 * expression.cs (MakeByteBlob): Complete all the missing types
20536 (uint, short, ushort, byte, sbyte)
20538 * class.cs: Only init instance field initializers on instance
20541 Rename `constructors' to instance_constructors.
20543 (TypeContainer.AddConstructor): Only add constructors to the list
20544 if it is not static.
20546 Make sure that we handle default_static_constructor independently
20547 everywhere where we handle instance_constructors
20549 2001-12-28 Miguel de Icaza <miguel@ximian.com>
20551 * class.cs: Do not lookup or create a base initializer for a
20552 static constructor.
20554 (ConstructorInitializer.Resolve): use the proper type to lookup
20557 * cs-parser.jay: Report error 1585 (modifiers between type and name).
20559 * enum.cs, interface.cs: Remove CloseType, this is taken care by
20562 * decl.cs: CloseType is now an virtual method, the default
20563 implementation just closes this type.
20565 2001-12-28 Ravi Pratap <ravi@ximian.com>
20567 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20568 to PreserveSig by default. Also emit HideBySig on such methods.
20570 Basically, set the defaults to standard values.
20572 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20573 argument, if candidate is better, it can't be worse than the best !
20575 (Invocation): Re-write bits to differentiate between methods being
20576 applicable in their expanded form and their normal form - for params
20579 Get rid of use_standard everywhere as only standard conversions are allowed
20580 in overload resolution.
20582 More spec conformance.
20584 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20586 * driver.cs: Add --timestamp, to see where the compiler spends
20589 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20590 `this' in static code.
20592 (SimpleName.DoResolve): Implement in terms of a helper function
20593 that allows static-references to be passed upstream to
20596 (Expression.ResolveWithSimpleName): Resolve specially simple
20597 names when called by MemberAccess to implement the special
20600 (Expression.ImplicitReferenceConversion): Handle conversions from
20601 Null to reference types before others, as Null's type is
20604 * expression.cs (Invocation.EmitCall): Handle the special case of
20605 calling methods declared on a reference type from a ValueType
20606 (Base classes System.Object and System.Enum)
20608 (MemberAccess.Resolve): Only perform lookups on Enumerations if
20609 the left hand side is a TypeExpr, not on every enumeration.
20611 (Binary.Resolve): If types are reference types, then do a cast to
20612 object on operators != and == of both arguments.
20614 * typemanager.cs (FindMembers): Extract instance and static
20615 members if requested.
20617 * interface.cs (PopulateProperty): Use void_type instead of null
20618 as the return type for the setter method.
20620 (PopulateIndexer): ditto.
20622 2001-12-27 Ravi Pratap <ravi@ximian.com>
20624 * support.cs (ReflectionParameters): Fix minor bug where we
20625 were examining the wrong parameter for the ParamArray attribute.
20627 Cope with requests for the type of the parameter at position
20628 greater than the params parameter's. We now return the element
20629 type of the params array as that makes more sense.
20631 * expression.cs (Invocation.IsParamsMethodApplicable): Update
20632 accordingly as we no longer have to extract the element type
20635 (Invocation.OverloadResolve): Update.
20637 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20639 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20640 against IEnumerator, test whether the return value is a descendant
20641 of the IEnumerator interface.
20643 * class.cs (Indexer.Define): Use an auxiliary method to implement
20644 the other bits of the method definition. Begin support for
20645 explicit interface implementation.
20647 (Property.DefineMethod): Use TypeManager.void_type instead of null
20648 for an empty return value.
20650 2001-12-26 Miguel de Icaza <miguel@ximian.com>
20652 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20653 dealing with a FieldExpr which is composed of a FieldBuilder, in
20654 the code path we did extract the constant, but we should have
20655 obtained the underlying value to be able to cast it (otherwise we
20656 end up in an infinite loop, this is what Ravi was running into).
20658 (ArrayCreation.UpdateIndices): Arrays might be empty.
20660 (MemberAccess.ResolveMemberAccess): Add support for section
20661 14.5.4.1 that deals with the special case of E.I when E is a type
20662 and something else, that I can be a reference to a static member.
20664 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20665 handle a particular array type to create byte blobs, it is just
20666 something we dont generate byteblobs for.
20668 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20671 * location.cs (Push): remove the key from the hashtable that we
20672 are about to add. This happens for empty files.
20674 * driver.cs: Dispose files after we have parsed them.
20676 (tokenize): new function that only runs the tokenizer on its
20677 input, for speed testing.
20679 2001-12-26 Ravi Pratap <ravi@ximian.com>
20681 * class.cs (Event.Define): Define the private field only if there
20682 are no accessors defined.
20684 * expression.cs (ResolveMemberAccess): If there is no associated
20685 field with the event, that means we have an event defined with its
20686 own accessors and we should flag error cs0070 since transforming
20687 ourselves into a field is not valid in that case.
20689 * ecore.cs (SimpleName.DoResolve): Same as above.
20691 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20692 and charset to sane values.
20694 2001-12-25 Ravi Pratap <ravi@ximian.com>
20696 * assign.cs (DoResolve): Perform check on events only if they
20697 are being accessed outside the declaring type.
20699 * cs-parser.jay (event_declarations): Update rules to correctly
20700 set the type of the implicit parameter etc.
20702 (add_accessor, remove_accessor): Set current local parameters.
20704 * expression.cs (Binary): For delegate addition and subtraction,
20705 cast the return value from the method into the appropriate delegate
20708 2001-12-24 Ravi Pratap <ravi@ximian.com>
20710 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20711 of these as the workaround is unnecessary.
20713 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20714 delegate data - none of that is needed at all.
20716 Re-write bits to extract the instance expression and the delegate method
20719 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
20722 * attribute.cs (ApplyAttributes): New method to take care of common tasks
20723 of attaching attributes instead of duplicating code everywhere.
20725 * everywhere : Update code to do attribute emission using the above method.
20727 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20729 * expression.cs (IsParamsMethodApplicable): if there are not
20730 parameters, return immediately.
20732 * ecore.cs: The 0 literal can be implicity converted to an enum
20735 (SimpleName.DoResolve): First lookup the type, then lookup the
20738 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20739 want to get its address. If the InstanceExpression is not
20740 addressable, store the result in a temporary variable, then get
20743 * codegen.cs: Only display 219 errors on warning level or above.
20745 * expression.cs (ArrayAccess): Make it implement the
20746 IMemoryLocation interface.
20748 (Binary.DoResolve): handle the operator == (object a, object b)
20749 and operator != (object a, object b) without incurring into a
20750 BoxedCast (because 5 != o should never be performed).
20752 Handle binary enumerator operators.
20754 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20755 value type, otherwise use Ldelem_ref.
20757 Use precomputed names;
20759 (AddressOf): Implement address of
20761 * cs-parser.jay (labeled_statement): Fix recursive block
20762 addition by reworking the production.
20764 * expression.cs (New.DoEmit): New has a special case:
20766 If we are dealing with a ValueType, we have a few
20767 situations to deal with:
20769 * The target of New is a ValueType variable, that is
20770 easy, we just pass this as the variable reference
20772 * The target of New is being passed as an argument,
20773 to a boxing operation or a function that takes a
20776 In this case, we need to create a temporary variable
20777 that is the argument of New.
20780 2001-12-23 Ravi Pratap <ravi@ximian.com>
20782 * rootcontext.cs (LookupType): Check that current_type is not null before
20783 going about looking at nested types.
20785 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20786 not implement the IAssignMethod interface any more.
20788 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20789 where we tranform them into FieldExprs if they are being resolved from within
20790 the declaring type.
20792 * ecore.cs (SimpleName.DoResolve): Do the same here.
20794 * assign.cs (DoResolve, Emit): Clean up code considerably.
20796 * ../errors/bug10.cs : Add.
20798 * ../errors/cs0070.cs : Add.
20800 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20802 * assign.cs : Get rid of EventIsLocal everywhere.
20804 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20806 * ecore.cs (ConvertIntLiteral): finished the implementation.
20808 * statement.cs (SwitchLabel): Convert the value we are using as a
20809 key before looking up the table.
20811 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20813 * codegen.cs (EmitTopBlock): Require a Location argument now.
20815 * cs-parser.jay (constructor_declarator): We need to setup
20816 current_local_parameters before we parse the
20817 opt_constructor_initializer, to allow the variables to be bound
20818 to the constructor arguments.
20820 * rootcontext.cs (LookupType): First lookup nested classes in our
20821 class and our parents before we go looking outside our class.
20823 * expression.cs (ConstantFold): Extract/debox the values at the
20826 * rootcontext.cs (EmitCode): Resolve the constants first before we
20827 resolve the types. This is not really needed, but it helps debugging.
20829 * statement.cs: report location.
20831 * cs-parser.jay: pass location to throw statement.
20833 * driver.cs: Small bug fix.
20835 * report.cs: Updated format to be 4-zero filled digits.
20837 2001-12-22 Ravi Pratap <ravi@ximian.com>
20839 * expression.cs (CheckIndices): Fix minor bug where the wrong
20840 variable was being referred to ;-)
20842 (DoEmit): Do not call EmitStaticInitializers when the
20843 underlying type is System.Object.
20845 2001-12-21 Ravi Pratap <ravi@ximian.com>
20847 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20848 and do the usual workaround for SRE.
20850 * class.cs (MyEventBuilder.EventType): New member to get at the type
20851 of the event, quickly.
20853 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20855 * assign.cs (Assign.DoResolve): Handle the case when the target
20856 is an EventExpr and perform the necessary checks.
20858 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20861 (SimpleName.MemberStaticCheck): Include check for EventExpr.
20863 (EventExpr): Set the type in the constructor itself since we
20864 are meant to be born fully resolved.
20866 (EventExpr.Define): Revert code I wrote earlier.
20868 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20869 instance expression is null. The instance expression is a This in that case
20870 or a null, depending on whether it is a static method or not.
20872 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20873 refers to more than one method.
20875 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20876 and accordingly flag errors.
20878 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20880 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20882 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20884 * location.cs (ToString): Provide useful rutine.
20886 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20888 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20889 objects, return the actual integral boxed.
20891 * statement.cs (SwitchLabel): define an ILLabel for each
20894 (Switch.CheckSwitch): If the value is a Literal, extract
20895 the underlying literal.
20897 Also in the unused hashtable we had, add the SwitchLabel so we can
20898 quickly look this value up.
20900 * constant.cs: Implement a bunch of new constants. Rewrite
20901 Literal based on this. Made changes everywhere to adapt to this.
20903 * expression.cs (Expression.MakeByteBlob): Optimize routine by
20904 dereferencing array only once, and also copes with enumrations.
20906 bytes are two bytes wide, not one.
20908 (Cast): Perform constant conversions.
20910 * ecore.cs (TryImplicitIntConversion): Return literals instead of
20911 wrappers to the literals here.
20913 * expression.cs (DoNumericPromotions): long literals can converted
20914 to ulong implicity (this is taken care of elsewhere, but I was
20915 missing this spot).
20917 * ecore.cs (Expression.Literalize): Make the return type Literal,
20918 to improve type checking.
20920 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20922 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20924 * literal.cs: Revert code from ravi that checked the bounds. The
20925 bounds are sane by the definition of the type itself.
20927 * typemanager.cs: Fix implementation of ImplementsInterface. We
20928 need to actually look up in our parent hierarchy for interfaces
20931 * const.cs: Use the underlying type for enumerations
20933 * delegate.cs: Compute the basename for the delegate creation,
20934 that should fix the delegate test case, and restore the correct
20935 Type Lookup semantics in rootcontext
20937 * rootcontext.cs: Revert Ravi's last patch. The correct way of
20938 referencing a nested type with the Reflection API is using the "+"
20941 * cs-parser.jay: Do not require EOF token at the end.
20943 2001-12-20 Ravi Pratap <ravi@ximian.com>
20945 * rootcontext.cs (LookupType): Concatenate type names with
20946 a '.' instead of a '+' The test suite passes again.
20948 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20949 field of the enumeration.
20951 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20952 the case when the member is an EventExpr.
20954 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20955 static has an associated instance expression.
20957 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20959 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20961 * class.cs (Event.Define): Register event and perform appropriate checks
20964 We define the Add and Remove methods even if the use provides none because
20965 in that case, we provide default implementations ourselves.
20967 Define a private field of the type of the event. This is done by the CSC compiler
20968 and we should be doing it too ;-)
20970 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20971 More methods we use in code we generate.
20973 (multicast_delegate_type, delegate_type): Two separate types since the distinction
20976 (InitCoreTypes): Update accordingly for the above.
20978 * class.cs (Event.Emit): Generate code for default accessors that we provide
20980 (EmitDefaultMethod): Do the job in the above.
20982 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
20985 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20987 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20988 builders even if we were missing one.
20990 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20991 pass the Basename as our class name instead of the Name. The
20992 basename will be correctly composed for us.
20994 * parameter.cs (Paramters): Now takes a Location argument.
20996 * decl.cs (DeclSpace.LookupType): Removed convenience function and
20997 make all the code call directly LookupType in RootContext and take
20998 this chance to pass the Location information everywhere.
21000 * Everywhere: pass Location information.
21002 2001-12-19 Miguel de Icaza <miguel@ximian.com>
21004 * class.cs (Constructor.Define): Updated way of detecting the
21005 length of the parameters.
21007 (TypeContainer.DefineType): Use basename as the type name for
21010 (TypeContainer.Define): Do not recursively define types here, as
21011 definition is taken care in order by the RootContext.
21013 * tree.cs: Keep track of namespaces in a per-file basis.
21015 * parameter.cs (Parameter.ComputeSignature): Update to use
21018 (Parameters.GetSignature): ditto.
21020 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21021 instead of a TypeContainer.
21023 (Interface.SemanticAnalysis): Use `this' instead of our parent to
21024 resolve names. Because we need to be resolve in our context, not
21027 * driver.cs: Implement response files.
21029 * class.cs (TypeContainer.DefineType): If we are defined, do not
21030 redefine ourselves.
21032 (Event.Emit): Emit the code for add/remove handlers.
21033 (Event.Define): Save the MethodBuilders for add/remove.
21035 * typemanager.cs: Use pair here too.
21037 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21038 DictionaryEntry requires the first argument to be non-null.
21040 (enum_declaration): Compute full name for registering the
21043 (delegate_declaration): Instead of using
21044 formal_parameter_list, use opt_formal_parameter_list as the list
21047 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21048 (EventParsing): New property that controls whether `add' and
21049 `remove' are returned as tokens or identifiers (for events);
21051 2001-12-19 Ravi Pratap <ravi@ximian.com>
21053 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21054 use MyEventBuilder only and let it wrap the real builder for us.
21056 (MyEventBuilder): Revamp constructor etc.
21058 Implement all operations that we perform on EventBuilder in precisely the same
21061 (FindMembers): Update to use the EventBuilder member.
21063 (Event.Emit): Update accordingly.
21065 2001-12-18 Ravi Pratap <ravi@ximian.com>
21067 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21068 by calling the appropriate methods.
21070 (GetCustomAttributes): Make stubs as they cannot possibly do anything
21073 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21075 2001-12-17 Ravi Pratap <ravi@ximian.com>
21077 * delegate.cs (Delegate.Populate): Check that the return type
21078 and various parameters types are indeed accessible.
21080 * class.cs (Constructor.Define): Same here.
21082 (Field.Define): Ditto.
21084 (Event.Define): Ditto.
21086 (Operator.Define): Check that the underlying Method defined itself
21087 correctly - so it's MethodBuilder should not be null.
21089 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21090 expression happens to be null.
21092 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21093 members but as of now we don't seem to be able to do anything really useful with it.
21095 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21096 not the EventBuilder.
21098 2001-12-18 Miguel de Icaza <miguel@ximian.com>
21100 * cs-tokenizer.cs: Add support for defines.
21101 Add support for #if, #elif, #else, #endif
21103 (eval_var): evaluates a variable.
21104 (eval): stubbed for evaluating functions.
21106 * cs-parser.jay: Pass the defines information
21108 * driver.cs: Add --define command line option.
21110 * decl.cs: Move MemberCore here.
21112 Make it the base class for DeclSpace. This allows us to catch and
21113 report 108 and 109 for everything now.
21115 * class.cs (TypeContainer.Define): Extract all the members
21116 before populating and emit the warning 108 (new keyword required
21117 to override) instead of having each member implement this.
21119 (MemberCore.Define): New abstract method, we will be using this in
21120 the warning reporting engine in Populate.
21122 (Operator.Define): Adjust to new MemberCore protocol.
21124 * const.cs (Const): This does not derive from Expression, it is a
21125 temporary object we use to create fields, it is a MemberCore.
21127 * class.cs (Method.Define): Allow the entry point to be in a
21130 * driver.cs: Rewrite the argument handler to clean it up a bit.
21132 * rootcontext.cs: Made it just an auxiliary namespace feature by
21133 making everything static.
21135 * driver.cs: Adapt code to use RootContext type name instead of
21138 * delegate.cs: Remove RootContext argument.
21140 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21143 * class.cs (Event.Define): The lookup can fail.
21145 * cs-tokenizer.cs: Begin implementation of pre-procesor.
21147 * expression.cs: Resolve the this instance before invoking the code.
21149 2001-12-17 Miguel de Icaza <miguel@ximian.com>
21151 * cs-parser.jay: Add a production in element_access that allows
21152 the thing to become a "type" reference. This way we can parse
21153 things like "(string [])" as a type.
21155 Note that this still does not handle the more complex rules of
21159 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
21161 * ecore.cs: (CopyNewMethods): new utility function used to
21162 assemble the list of methods from running FindMembers.
21164 (MemberLookup): Rework FindMembers so that
21166 2001-12-16 Miguel de Icaza <miguel@ximian.com>
21168 * class.cs (TypeContainer): Remove Delegates who fail to be
21171 * delegate.cs (Populate): Verify that we dont get null return
21172 values. TODO: Check for AsAccessible.
21174 * cs-parser.jay: Use basename to emit error 574 (destructor should
21175 have the same name as container class), not the full name.
21177 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21178 possible representation.
21180 Also implements integer type suffixes U and L.
21182 2001-12-15 Miguel de Icaza <miguel@ximian.com>
21184 * expression.cs (ArrayCreation.DoResolve): We need to do the
21185 argument resolution *always*.
21187 * decl.cs: Make this hold the namespace. Hold the root context as
21189 (LookupType): Move here.
21191 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21193 * location.cs (Row, Name): Fixed the code, it was always returning
21194 references to the first file.
21196 * interface.cs: Register properties defined through interfaces.
21198 * driver.cs: Add support for globbing on the command line
21200 * class.cs (Field): Make it derive from MemberCore as well.
21203 2001-12-15 Ravi Pratap <ravi@ximian.com>
21205 * class.cs (Event::Define): Check that the type of the event is a delegate
21206 type else flag error #66.
21208 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21211 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21212 values of EntryPoint, CharSet etc etc.
21214 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21216 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21217 be null and we should ignore this. I am not sure if this is really clean. Apparently,
21218 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21219 which needs this to do its work.
21221 * ../errors/cs0066.cs : Add.
21223 2001-12-14 Miguel de Icaza <miguel@ximian.com>
21225 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21228 * class.cs: (MethodSignature.MethodSignature): Removed hack that
21229 clears out the parameters field.
21230 (MemberSignatureCompare): Cleanup
21232 (MemberCore): New base class used to share code between MethodCore
21235 (RegisterRequiredImplementations) BindingFlags.Public requires
21236 either BindingFlags.Instace or Static. Use instance here.
21238 (Property): Refactored code to cope better with the full spec.
21240 * parameter.cs (GetParameterInfo): Return an empty array instead
21243 * class.cs (Property): Abstract or extern properties have no bodies.
21245 * parameter.cs (GetParameterInfo): return a zero-sized array.
21247 * class.cs (TypeContainer.MethodModifiersValid): Move all the
21248 method modifier validation to the typecontainer so we can reuse
21249 this on properties.
21251 (MethodCore.ParameterTypes): return an empty sized array of types.
21253 (Property.Define): Test property modifier validity.
21255 Add tests for sealed/override too.
21257 (Method.Emit): abstract or extern methods have no bodies.
21259 2001-12-14 Ravi Pratap <ravi@ximian.com>
21261 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21264 (Method::Define, ::Emit): Modify accordingly.
21266 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21268 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21270 * makefile: Pass in /unsafe.
21272 2001-12-13 Miguel de Icaza <miguel@ximian.com>
21274 * class.cs (MakeKey): Kill routine.
21276 * class.cs (TypeContainer.Define): Correctly define explicit
21277 method implementations (they require the full interface name plus
21280 * typemanager.cs: Deply the PtrHashtable here and stop using the
21281 lame keys. Things work so much better.
21283 This of course broke everyone who depended on `RegisterMethod' to
21284 do the `test for existance' test. This has to be done elsewhere.
21286 * support.cs (PtrHashtable): A hashtable that avoid comparing with
21287 the object stupid Equals method (because, that like fails all over
21288 the place). We still do not use it.
21290 * class.cs (TypeContainer.SetRequiredInterface,
21291 TypeContainer.RequireMethods): Killed these two routines and moved
21292 all the functionality to RegisterRequiredImplementations.
21294 (TypeContainer.RegisterRequiredImplementations): This routine now
21295 registers all the implementations required in an array for the
21296 interfaces and abstract methods. We use an array of structures
21297 which can be computed ahead of time to reduce memory usage and we
21298 also assume that lookups are cheap as most classes will not
21299 implement too many interfaces.
21301 We also avoid creating too many MethodSignatures.
21303 (TypeContainer.IsInterfaceMethod): Update and optionally does not
21304 clear the "pending" bit if we find that there are problems with
21307 (TypeContainer.VerifyPendingMethods): Update to report errors of
21308 methods that look like implementations but are not.
21310 (TypeContainer.Define): Add support for explicit interface method
21313 2001-12-12 Miguel de Icaza <miguel@ximian.com>
21315 * typemanager.cs: Keep track of the parameters here instead of
21316 being a feature of the TypeContainer.
21318 * class.cs: Drop the registration of parameters here, as
21319 InterfaceMethods are also interface declarations.
21321 * delegate.cs: Register methods with the TypeManager not only with
21322 the TypeContainer. This code was buggy.
21324 * interface.cs: Full registation here.
21326 2001-12-11 Miguel de Icaza <miguel@ximian.com>
21328 * expression.cs: Remove reducer for binary expressions, it can not
21331 * const.cs: Put here the code that used to go into constant.cs
21333 * constant.cs: Put here the code for constants, this is a new base
21334 class for Literals.
21336 * literal.cs: Make Literal derive from Constant.
21338 2001-12-09 Miguel de Icaza <miguel@ximian.com>
21340 * statement.cs (Return.Emit): Report error 157 if the user
21341 attempts to return from a finally block.
21343 (Return.Emit): Instead of emitting a return, jump to the end of
21346 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21347 LocalBuilder to store the result of the function. ReturnLabel is
21348 the target where we jump.
21351 2001-12-09 Radek Doulik <rodo@ximian.com>
21353 * cs-parser.jay: remember alias in current namespace
21355 * ecore.cs (SimpleName::DoResolve): use aliases for types or
21358 * class.cs (LookupAlias): lookup alias in my_namespace
21360 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21362 (LookupAlias): lookup alias in this and if needed in parent
21365 2001-12-08 Miguel de Icaza <miguel@ximian.com>
21369 * rootcontext.cs: (ModuleBuilder) Made static, first step into
21370 making things static. I need this to avoid passing the
21371 TypeContainer when calling ParameterType.
21373 * support.cs (InternalParameters.ParameterType): Remove ugly hack
21374 that did string manipulation to compute the type and then call
21375 GetType. Use Parameter.ParameterType instead.
21377 * cs-tokenizer.cs: Consume the suffix for floating values.
21379 * expression.cs (ParameterReference): figure out whether this is a
21380 reference parameter or not. Kill an extra variable by computing
21381 the arg_idx during emission.
21383 * parameter.cs (Parameters.GetParameterInfo): New overloaded
21384 function that returns whether a parameter is an out/ref value or not.
21386 (Parameter.ParameterType): The type of the parameter (base,
21387 without ref/out applied).
21389 (Parameter.Resolve): Perform resolution here.
21390 (Parameter.ExternalType): The full type (with ref/out applied).
21392 * statement.cs (Using.Emit, Using.EmitExpression): Implement
21393 support for expressions on the using statement.
21395 2001-12-07 Miguel de Icaza <miguel@ximian.com>
21397 * statement.cs (Using.EmitLocalVariableDecls): Split the
21398 localvariable handling of the using statement.
21400 (Block.EmitMeta): Keep track of variable count across blocks. We
21401 were reusing slots on separate branches of blocks.
21403 (Try.Emit): Emit the general code block, we were not emitting it.
21405 Check the type of the declaration to be an IDisposable or
21406 something that can be implicity converted to it.
21408 Emit conversions if required.
21410 * ecore.cs (EmptyExpression): New utility class.
21411 (Expression.ImplicitConversionExists): New utility function.
21413 2001-12-06 Miguel de Icaza <miguel@ximian.com>
21415 * statement.cs (Using): Implement.
21417 * expression.cs (LocalVariableReference): Support read only variables.
21419 * statement.cs: Remove the explicit emit for the Leave opcode.
21420 (VariableInfo): Add a readonly field.
21422 2001-12-05 Miguel de Icaza <miguel@ximian.com>
21424 * ecore.cs (ConvCast): new class used to encapsulate the various
21425 explicit integer conversions that works in both checked and
21426 unchecked contexts.
21428 (Expression.ConvertNumericExplicit): Use new ConvCast class to
21429 properly generate the overflow opcodes.
21431 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21433 * statement.cs: The correct type for the EmptyExpression is the
21434 element_type, not the variable type. Ravi pointed this out.
21436 2001-12-04 Ravi Pratap <ravi@ximian.com>
21438 * class.cs (Method::Define): Handle PInvoke methods specially
21439 by using DefinePInvokeMethod instead of the usual one.
21441 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21442 above to do the task of extracting information and defining the method.
21444 2001-12-04 Ravi Pratap <ravi@ximian.com>
21446 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21447 of the condition for string type.
21449 (Emit): Move that here.
21451 (ArrayCreation::CheckIndices): Keep string literals in their expression
21454 (EmitDynamicInitializers): Handle strings appropriately.
21456 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21458 * codegen.cs (EmitContext): Replace multiple variables with a
21459 single pointer to the current Switch statement.
21461 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21464 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21468 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21471 (Foreach.Emit): Foreach on arrays was not setting
21472 up the loop variables (for break/continue).
21474 (GotoCase): Semi-implented.
21476 2001-12-03 Ravi Pratap <ravi@ximian.com>
21478 * attribute.cs (CheckAttribute): Handle system attributes by using
21479 Attribute.GetAttributes to examine information we need.
21481 (GetValidPlaces): Same here.
21483 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21485 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21487 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21489 (Method::Define): Set appropriate flags if we have a DllImport attribute.
21491 (Method::Emit): Handle the case when we are a PInvoke method.
21493 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21495 * expression.cs: Use ResolveWithSimpleName on compound names.
21497 2001-12-02 Ravi Pratap <ravi@ximian.com>
21499 * constant.cs (EmitConstant): Make sure we resolve the associated expression
21500 before trying to reduce it.
21502 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21504 * constant.cs (LookupConstantValue): Implement.
21506 (EmitConstant): Use the above in emitting the constant.
21508 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21509 that are user-defined by doing a LookupConstantValue on them.
21511 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21514 2001-11-29 Miguel de Icaza <miguel@ximian.com>
21516 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21518 (BaseAccess.DoResolve): Implement.
21520 (MemberAccess.DoResolve): Split this routine into a
21521 ResolveMemberAccess routine that can be used independently
21523 2001-11-28 Miguel de Icaza <miguel@ximian.com>
21525 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21526 As that share bits of the implementation. Is returns a boolean,
21527 while As returns the Type that is being probed.
21529 2001-12-01 Ravi Pratap <ravi@ximian.com>
21531 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21532 instead of a Literal - much easier.
21534 (EnumInTransit): Remove - utterly useless :-)
21536 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21538 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21540 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21541 chain when we have no associated expression.
21543 2001-11-30 Ravi Pratap <ravi@ximian.com>
21545 * constant.cs (Define): Use Location while reporting the errror.
21547 Also emit a warning when 'new' is used and there is no inherited
21550 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
21553 (LookupEnumValue): Implement to lookup an enum member's value and define it
21556 (Populate): Re-write accordingly to use the above routine.
21558 2001-11-27 Miguel de Icaza <miguel@ximian.com>
21560 * expression.cs (This): Fix prototype for DoResolveLValue to
21561 override the base class DoResolveLValue.
21563 * cs-parser.cs: Report errors cs574 and cs575 (destructor
21566 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21567 (we need to load the address of the field here). This fixes
21570 (FieldExpr.DoResolveLValue): Call the DoResolve
21571 function to initialize the Instance expression.
21573 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21574 correctly the GetEnumerator operation on a value type.
21576 * cs-parser.jay: Add more simple parsing error catches.
21578 * statement.cs (Switch): Add support for string switches.
21579 Handle null specially.
21581 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
21583 2001-11-28 Ravi Pratap <ravi@ximian.com>
21585 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21587 (declare_local_constant): New helper function.
21589 * statement.cs (AddConstant): Keep a separate record of constants
21591 (IsConstant): Implement to determine if a variable is a constant.
21593 (GetConstantExpression): Implement.
21595 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21597 * statement.cs (IsVariableDefined): Re-write.
21599 2001-11-27 Ravi Pratap <ravi@ximian.com>
21601 * class.cs (TypeContainer::FindMembers): Look for constants
21602 in the case when we are looking for MemberTypes.Field
21604 * expression.cs (MemberAccess::DoResolve): Check that in the
21605 case we are a FieldExpr and a Literal, we are not being accessed
21606 by an instance reference.
21608 * cs-parser.jay (local_constant_declaration): Implement.
21610 (declaration_statement): Implement for constant declarations.
21612 2001-11-26 Miguel de Icaza <miguel@ximian.com>
21614 * statement.cs (Switch): Catch double defaults.
21616 (Switch): More work on the switch() statement
21617 implementation. It works for integral values now, need to finish
21621 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21623 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21624 integer literals into other integer literals. To be used by
21627 2001-11-24 Ravi Pratap <ravi@ximian.com>
21629 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21632 (EmitDynamicInitializers): Cope with the above since we extract data
21633 directly from ArrayData now.
21635 (ExpectInitializers): Keep track of whether initializers are mandatory
21638 (Bounds): Make it a hashtable to prevent the same dimension being
21639 recorded for every element in that dimension.
21641 (EmitDynamicInitializers): Fix bug which prevented the Set array method
21644 Also fix bug which was causing the indices to be emitted in the reverse
21647 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21649 * expression.cs (ArrayCreation): Implement the bits that Ravi left
21650 unfinished. They do not work, because the underlying code is
21653 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21655 * cs-parser.jay: Remove bogus fixme.
21657 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21658 on Switch statement.
21660 2001-11-23 Ravi Pratap <ravi@ximian.com>
21662 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21665 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21666 parameter. Apparently, any expression is allowed.
21668 (ValidateInitializers): Update accordingly.
21670 (CheckIndices): Fix some tricky bugs thanks to recursion.
21672 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
21673 I was being completely brain-dead.
21675 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21676 and re-write acordingly.
21678 (DelegateInvocation): Re-write accordingly.
21680 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21682 (MakeByteBlob): Handle types more correctly.
21684 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21685 initialization from expressions but it is incomplete because I am a complete
21688 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21690 * statement.cs (If.Emit): Fix a bug that generated incorrect code
21691 on If. Basically, we have to return `true' (ie, we do return to
21692 our caller) only if both branches of the if return.
21694 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21695 short-circuit operators, handle them as short circuit operators.
21697 (Cast.DoResolve): Resolve type.
21698 (Cast.Cast): Take an expression as the target type.
21700 * cs-parser.jay (cast_expression): Remove old hack that only
21701 allowed a limited set of types to be handled. Now we take a
21702 unary_expression and we resolve to a type during semantic
21705 Use the grammar productions from Rhys to handle casts (this is
21706 not complete like Rhys syntax yet, we fail to handle that corner
21707 case that C# has regarding (-x), but we will get there.
21709 2001-11-22 Ravi Pratap <ravi@ximian.com>
21711 * class.cs (EmitFieldInitializer): Take care of the case when we have a
21712 field which is an array type.
21714 * cs-parser.jay (declare_local_variables): Support array initialization too.
21716 * typemanager.cs (MakeKey): Implement.
21718 (everywhere): Use the above appropriately.
21720 * cs-parser.jay (for_statement): Update for array initialization while
21721 declaring variables.
21723 * ecore.cs : The error message was correct, it's the variable's names that
21724 were misleading ;-) Make the code more readable.
21726 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21727 the correct type etc.
21729 (ConvertExplicit): Handle Enum types by examining the underlying type.
21731 2001-11-21 Ravi Pratap <ravi@ximian.com>
21733 * parameter.cs (GetCallingConvention): Always return
21734 CallingConventions.Standard for now.
21736 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21738 * expression.cs (Binary.ResolveOperator): Update the values of `l'
21739 and `r' after calling DoNumericPromotions.
21741 * ecore.cs: Fix error message (the types were in the wrong order).
21743 * statement.cs (Foreach.ProbeCollectionType): Need to pass
21744 BindingFlags.Instance as well
21746 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21747 implicit int literal conversion in an empty cast so that we
21748 propagate the right type upstream.
21750 (UnboxCast): new class used to unbox value types.
21751 (Expression.ConvertExplicit): Add explicit type conversions done
21754 (Expression.ImplicitNumericConversion): Oops, forgot to test for
21755 the target type before applying the implicit LongLiterals to ULong
21758 2001-11-21 Miguel de Icaza <miguel@ximian.com>
21760 * cs-parser.jay (for_statement): Reworked the way For works: now
21761 we declare manually any variables that are introduced in
21762 for_initializer to solve the problem of having out-of-band code
21763 emition (that is what got for broken).
21765 (declaration_statement): Perform the actual variable declaration
21766 that used to be done in local_variable_declaration here.
21768 (local_variable_declaration): Do not declare anything, just pass
21769 the information on a DictionaryEntry
21771 2001-11-20 Ravi Pratap <ravi@ximian.com>
21773 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21774 re-write of the logic to now make it recursive.
21776 (UpdateIndices): Re-write accordingly.
21778 Store element data in a separate ArrayData list in the above methods.
21780 (MakeByteBlob): Implement to dump the array data into a byte array.
21782 2001-11-19 Ravi Pratap <ravi@ximian.com>
21784 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21787 * constant.cs (Define): Implement.
21789 (EmitConstant): Re-write fully.
21791 Pass in location info.
21793 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21796 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21797 DictionaryEntry since we need location info too.
21799 (constant_declaration): Update accordingly.
21801 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21802 code into another method : UpdateIndices.
21804 2001-11-18 Ravi Pratap <ravi@ximian.com>
21806 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21807 some type checking etc.
21809 2001-11-17 Ravi Pratap <ravi@ximian.com>
21811 * expression.cs (ArrayCreation::ValidateInitializers): Implement
21812 bits to provide dimension info if the user skips doing that.
21814 Update second constructor to store the rank correctly.
21816 2001-11-16 Ravi Pratap <ravi@ximian.com>
21818 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21819 and try to implement.
21821 * ../errors/cs0150.cs : Add.
21823 * ../errors/cs0178.cs : Add.
21825 2001-11-16 Miguel de Icaza <miguel@ximian.com>
21827 * statement.cs: Implement foreach on multi-dimensional arrays.
21829 * parameter.cs (Parameters.GetParameterByName): Also lookup the
21830 name of the params argument.
21832 * expression.cs: Use EmitStoreOpcode to get the right opcode while
21833 initializing the array.
21835 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21836 we can use this elsewhere.
21838 * statement.cs: Finish implementation of foreach for single
21841 * cs-parser.jay: Use an out-of-band stack to pass information
21842 around, I wonder why I need this.
21844 foreach_block: Make the new foreach_block the current_block.
21846 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21847 function used to return a static Parameters structure. Used for
21848 empty parameters, as those are created very frequently.
21850 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21852 2001-11-15 Ravi Pratap <ravi@ximian.com>
21854 * interface.cs : Default modifier is private, not public. The
21855 make verify test passes again.
21857 2001-11-15 Ravi Pratap <ravi@ximian.com>
21859 * support.cs (ReflectionParameters): Fix logic to determine
21860 whether the last parameter is a params one. Test 9 passes again.
21862 * delegate.cs (Populate): Register the builders we define with
21863 RegisterParameterForBuilder. Test 19 passes again.
21865 * cs-parser.jay (property_declaration): Reference $6 instead
21866 of $$ to get at the location.
21868 (indexer_declaration): Similar stuff.
21870 (attribute): Ditto.
21872 * class.cs (Property): Register parameters for the Get and Set methods
21873 if they exist. Test 23 passes again.
21875 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21876 call to EmitArguments as we are sure there aren't any params arguments.
21877 Test 32 passes again.
21879 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21880 IndexOutOfRangeException.
21882 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21883 Test 33 now passes again.
21885 2001-11-15 Miguel de Icaza <miguel@ximian.com>
21887 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21888 broke a bunch of things. Will have to come up with a better way
21889 of tracking locations.
21891 * statement.cs: Implemented foreach for single dimension arrays.
21893 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21895 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21896 an error. This removes the lookup from the critical path.
21898 * cs-parser.jay: Removed use of temporary_loc, which is completely
21901 2001-11-14 Miguel de Icaza <miguel@ximian.com>
21903 * support.cs (ReflectionParameters.ParameterModifier): Report
21904 whether the argument is a PARAMS argument or not.
21906 * class.cs: Set the attribute `ParamArrayAttribute' on the
21907 parameter argument.
21909 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21910 and cons_param_array_attribute (ConstructorInfo for
21911 ParamArrayAttribute).,
21913 * codegen.cs: Emit the return using the `Return' statement, that
21914 way we can report the error correctly for missing return values.
21916 * class.cs (Method.Emit): Clean up.
21918 * expression.cs (Argument.Resolve): Take another argument: the
21919 location where this argument is used. Notice that this is not
21920 part of the "Argument" class as to reduce the size of the
21921 structure (we know the approximate location anyways).
21923 Test if the argument is a variable-reference, if not, then
21924 complain with a 206.
21926 (Argument.Emit): Emit addresses of variables.
21928 (Argument.FullDesc): Simplify.
21930 (Invocation.DoResolve): Update for Argument.Resolve.
21932 (ElementAccess.DoResolve): ditto.
21934 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21935 method should be virtual, as this method is always virtual.
21937 (NewDelegate.DoResolve): Update for Argument.Resolve.
21939 * class.cs (ConstructorInitializer.DoResolve): ditto.
21941 * attribute.cs (Attribute.Resolve): ditto.
21943 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21945 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21947 * expression.cs (ParameterReference): Drop IStackStorage and implement
21948 IAssignMethod instead.
21950 (LocalVariableReference): ditto.
21952 * ecore.cs (FieldExpr): Drop IStackStorage and implement
21953 IAssignMethod instead.
21955 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21957 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21958 enumerations that are used in heavily used structures derive from
21959 byte in a laughable and pathetic attempt to reduce memory usage.
21960 This is the kind of pre-optimzations that you should not do at
21961 home without adult supervision.
21963 * expression.cs (UnaryMutator): New class, used to handle ++ and
21964 -- separatedly from the other unary operators. Cleans up the
21965 code, and kills the ExpressionStatement dependency in Unary.
21967 (Unary): Removed `method' and `Arguments' from this class, making
21968 it smaller, and moving it all to SimpleCall, so I can reuse this
21969 code in other locations and avoid creating a lot of transient data
21970 strucutres when not required.
21972 * cs-parser.jay: Adjust for new changes.
21974 2001-11-11 Miguel de Icaza <miguel@ximian.com>
21976 * enum.cs (Enum.Populate): If there is a failure during
21979 * cs-parser.jay (opt_enum_base): we used to catch type errors
21980 here, but this is really incorrect. The type error should be
21981 catched during semantic analysis.
21983 2001-12-11 Ravi Pratap <ravi@ximian.com>
21985 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21986 current_local_parameters as expected since I, in my stupidity, had forgotten
21989 * attribute.cs (GetValidPlaces): Fix stupid bug.
21991 * class.cs (Method::Emit): Perform check on applicability of attributes.
21993 (Constructor::Emit): Ditto.
21995 (Field::Emit): Ditto.
21997 (Field.Location): Store location information.
21999 (Property, Event, Indexer, Operator): Ditto.
22001 * cs-parser.jay (field_declaration): Pass in location for each field.
22003 * ../errors/cs0592.cs : Add.
22005 2001-11-12 Ravi Pratap <ravi@ximian.com>
22007 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22009 (InitCoreTypes): Update accordingly.
22011 (RegisterAttrType, LookupAttr): Implement.
22013 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22014 info about the same.
22016 (Resolve): Update to populate the above as necessary.
22018 (Error592): Helper.
22020 (GetValidPlaces): Helper to the above.
22022 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22024 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22026 2001-11-12 Ravi Pratap <ravi@ximian.com>
22028 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22030 * ../errors/cs0617.cs : Add.
22032 2001-11-11 Ravi Pratap <ravi@ximian.com>
22034 * enum.cs (Emit): Rename to Populate to be more consistent with what
22035 we expect it to do and when exactly it is called.
22037 * class.cs, rootcontext.cs : Update accordingly.
22039 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22040 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22042 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22044 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22045 of a fieldinfo using the above, when dealing with a FieldBuilder.
22047 2001-11-10 Ravi Pratap <ravi@ximian.com>
22049 * ../errors/cs0031.cs : Add.
22051 * ../errors/cs1008.cs : Add.
22053 * ../errrors/cs0543.cs : Add.
22055 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22058 (FindMembers): Implement.
22060 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22061 enums and delegates too.
22063 (enum_types): Rename to builder_to_enum.
22065 (delegate_types): Rename to builder_to_delegate.
22067 * delegate.cs (FindMembers): Implement.
22069 2001-11-09 Ravi Pratap <ravi@ximian.com>
22071 * typemanager.cs (IsEnumType): Implement.
22073 * enum.cs (Emit): Re-write parts to account for the underlying type
22074 better and perform checking etc.
22076 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22077 of the underlying type.
22079 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22082 * enum.cs (error31): Helper to report error #31.
22084 * cs-parser.jay (enum_declaration): Store location of each member too.
22086 * enum.cs (member_to_location): New hashtable.
22088 (AddEnumMember): Update location hashtable.
22090 (Emit): Use the location of each member while reporting errors.
22092 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22094 * cs-parser.jay: A for_initializer if is a
22095 local_variable_declaration really ammount to have an implicit
22096 block with the variable declaration and no initializer for for.
22098 * statement.cs (For.Emit): Cope with null initializers.
22100 This fixes the infinite loop on for initializers.
22102 2001-11-08 Miguel de Icaza <miguel@ximian.com>
22104 * enum.cs: More cleanup.
22106 * ecore.cs: Remove dead code.
22108 * class.cs (Property.Emit): More simplification.
22109 (Event.Emit): ditto.
22111 Reworked to have less levels of indentation.
22113 2001-11-08 Ravi Pratap <ravi@ximian.com>
22115 * class.cs (Property): Emit attributes.
22125 * enum.cs (Emit): Ditto.
22127 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22130 * class.cs (Field, Event, etc.): Move attribute generation into the
22131 Emit method everywhere.
22133 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22134 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22135 as we had no way of defining nested enums !
22137 * rootcontext.cs : Adjust code accordingly.
22139 * typemanager.cs (AddEnumType): To keep track of enum types separately.
22141 2001-11-07 Ravi Pratap <ravi@ximian.com>
22143 * expression.cs (EvalConstantExpression): Move into ecore.cs
22145 * enum.cs (Enum): Rename some members and make them public and readonly
22146 according to our convention.
22148 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22151 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22153 (Enum::Emit): Write a simple version for now which doesn't try to compute
22154 expressions. I shall modify this to be more robust in just a while.
22156 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22158 (TypeContainer::CloseType): Create the Enum types too.
22160 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22162 * expression.cs (EvalConstantExpression): Get rid of completely.
22164 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22165 user-defined values and other cases.
22167 (IsValidEnumLiteral): Helper function.
22169 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
22170 out there in the case we had a literal FieldExpr.
22172 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22174 (Literalize): Revamp a bit to take two arguments.
22176 (EnumLiteral): New class which derives from Literal to wrap enum literals.
22178 2001-11-06 Ravi Pratap <ravi@ximian.com>
22180 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22182 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22184 (Resolve): Use the above to ensure we have proper initializers.
22186 2001-11-05 Ravi Pratap <ravi@ximian.com>
22188 * expression.cs (Expression::EvalConstantExpression): New method to
22189 evaluate constant expressions.
22191 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22193 2001-11-07 Miguel de Icaza <miguel@ximian.com>
22195 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22198 (Binary.ResolveOperator): Handle operator != (object a, object b)
22199 and operator == (object a, object b);
22201 (Binary.DoNumericPromotions): Indicate whether the numeric
22202 promotion was possible.
22204 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22207 Made the ArrayAccess implement interface IAssignMethod instead of
22208 IStackStore as the order in which arguments are passed reflects
22211 * assign.cs: Instead of using expr.ExprClass to select the way of
22212 assinging, probe for the IStackStore/IAssignMethod interfaces.
22214 * typemanager.cs: Load InitializeArray definition.
22216 * rootcontext.cs (RootContext.MakeStaticData): Used to define
22217 static data that can be used to initialize arrays.
22219 2001-11-05 Miguel de Icaza <miguel@ximian.com>
22221 * expression.cs: Handle operator== and operator!= for booleans.
22223 (Conditioal.Reduce): Implement reducer for the ?: operator.
22225 (Conditional.Resolve): Implement dead code elimination.
22227 (Binary.Resolve): Catch string literals and return a new
22228 concatenated string.
22230 (Unary.Reduce): Implement reduction of unary expressions.
22232 * ecore.cs: Split out the expression core handling here.
22234 (Expression.Reduce): New method used to perform constant folding
22235 and CSE. This is needed to support constant-expressions.
22237 * statement.cs (Statement.EmitBoolExpression): Pass true and false
22238 targets, and optimize for !x.
22240 2001-11-04 Ravi Pratap <ravi@ximian.com>
22242 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22243 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22244 set custom atttributes.
22246 * literal.cs (Literal::GetValue): New abstract method to return the actual
22247 value of the literal, cast as an object.
22249 (*Literal): Implement GetValue method.
22251 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22252 expressions to the arraylist but objects of type Argument.
22254 * class.cs (TypeContainer::Emit): Emit our attributes too.
22256 (Method::Emit, Constructor::Emit): Ditto.
22258 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22259 to be ignoring earlier.
22261 2001-11-03 Ravi Pratap <ravi@ximian.com>
22263 * attribute.cs (AttributeSection::Define): Implement to do the business
22264 of constructing a CustomAttributeBuilder.
22266 (Attribute): New trivial class. Increases readability of code.
22268 * cs-parser.jay : Update accordingly.
22270 (positional_argument_list, named_argument_list, named_argument): New rules
22272 (attribute_arguments): Use the above so that we are more correct.
22274 2001-11-02 Ravi Pratap <ravi@ximian.com>
22276 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22277 to perform all checks for a method with a params parameter.
22279 (Invocation::OverloadResolve): Update to use the above method and therefore
22280 cope correctly with params method invocations.
22282 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
22285 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22286 constructors in our parent too because we can't afford to miss out on
22289 * attribute.cs (AttributeSection): New name for the class Attribute
22291 Other trivial changes to improve readability.
22293 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22294 use the new class names.
22296 2001-11-01 Ravi Pratap <ravi@ximian.com>
22298 * class.cs (Method::Define): Complete definition for params types too
22300 (Indexer::Define): Ditto.
22302 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22303 Cope everywhere with a request for info about the array parameter.
22305 2001-11-01 Ravi Pratap <ravi@ximian.com>
22307 * tree.cs (RecordNamespace): Fix up to check for the correct key.
22309 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
22310 local_variable_type to extract the string corresponding to the type.
22312 (local_variable_type): Fixup the action to use the new helper method.
22314 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
22317 * expression.cs : Clean out code which uses the above.
22319 2001-10-31 Ravi Pratap <ravi@ximian.com>
22321 * typemanager.cs (RegisterMethod): Check if we already have an existing key
22322 and bale out if necessary by returning a false.
22324 (RegisterProperty): Ditto.
22326 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22327 and print out appropriate error messages.
22329 * interface.cs (everywhere): Ditto.
22331 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22332 location to constructor.
22334 * class.cs (Property, Event, Indexer): Update accordingly.
22336 * ../errors/cs111.cs : Added.
22338 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22339 of a method, as laid down by the spec.
22341 (Invocation::OverloadResolve): Use the above method.
22343 2001-10-31 Ravi Pratap <ravi@ximian.com>
22345 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22346 now take a TypeContainer and a Parameters object.
22348 (ParameterData): Modify return type of ParameterModifier method to be
22349 Parameter.Modifier and not a string.
22351 (ReflectionParameters, InternalParameters): Update accordingly.
22353 * expression.cs (Argument::GetParameterModifier): Same here.
22355 * support.cs (InternalParameters::ParameterType): Find a better way of determining
22356 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22357 symbol in it at all so maybe this is only for now.
22359 2001-10-30 Ravi Pratap <ravi@ximian.com>
22361 * support.cs (InternalParameters): Constructor now takes an extra argument
22362 which is the actual Parameters class.
22364 (ParameterDesc): Update to provide info on ref/out modifiers.
22366 * class.cs (everywhere): Update call to InternalParameters to pass in
22367 the second argument too.
22369 * support.cs (ParameterData): Add ParameterModifier, which is a method
22370 to return the modifier info [ref/out etc]
22372 (InternalParameters, ReflectionParameters): Implement the above.
22374 * expression.cs (Argument::ParameterModifier): Similar function to return
22375 info about the argument's modifiers.
22377 (Invocation::OverloadResolve): Update to take into account matching modifiers
22380 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22381 a new SetFormalParameters object which we pass to InternalParameters.
22383 2001-10-30 Ravi Pratap <ravi@ximian.com>
22385 * expression.cs (NewArray): Merge into the ArrayCreation class.
22387 2001-10-29 Ravi Pratap <ravi@ximian.com>
22389 * expression.cs (NewArray): Merge classes NewBuiltinArray and
22390 NewUserdefinedArray into one as there wasn't much of a use in having
22393 * expression.cs (Argument): Change field's name to ArgType from Type.
22395 (Type): New readonly property which returns the proper type, taking into
22396 account ref/out modifiers.
22398 (everywhere): Adjust code accordingly for the above.
22400 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22401 whether we are emitting for a ref or out parameter.
22403 * expression.cs (Argument::Emit): Use the above field to set the state.
22405 (LocalVariableReference::Emit): Update to honour the flag and emit the
22408 * parameter.cs (Attributes): Set the correct flags for ref parameters.
22410 * expression.cs (Argument::FullDesc): New function to provide a full desc.
22412 * support.cs (ParameterData): Add method ParameterDesc to the interface.
22414 (ReflectionParameters, InternalParameters): Implement the above method.
22416 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22419 (Invocation::FullMethodDesc): Ditto.
22421 2001-10-29 Miguel de Icaza <miguel@ximian.com>
22423 * cs-parser.jay: Add extra production for the second form of array
22426 * expression.cs (ArrayCreation): Update to reflect the above
22429 * Small changes to prepare for Array initialization.
22431 2001-10-28 Miguel de Icaza <miguel@ximian.com>
22433 * typemanager.cs (ImplementsInterface): interface might be null;
22434 Deal with this problem;
22436 Also, we do store negative hits on the cache (null values), so use
22437 this instead of calling t.GetInterfaces on the type everytime.
22439 2001-10-28 Ravi Pratap <ravi@ximian.com>
22441 * typemanager.cs (IsBuiltinType): New method to help determine the same.
22443 * expression.cs (New::DoResolve): Get rid of array creation code and instead
22444 split functionality out into different classes.
22446 (New::FormArrayType): Move into NewBuiltinArray.
22448 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22451 (NewBuiltinArray): New class to handle creation of built-in arrays.
22453 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22454 account creation of one-dimensional arrays.
22456 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22458 (NewUserdefinedArray::DoResolve): Implement.
22460 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22462 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22463 we maintain inside the TypeManager. This is necessary to perform lookups on the
22466 (LookupType): Update to perform GetType on the module builders too.
22468 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22470 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22472 2001-10-23 Ravi Pratap <ravi@ximian.com>
22474 * expression.cs (New::DoResolve): Implement guts of array creation.
22476 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22478 2001-10-27 Miguel de Icaza <miguel@ximian.com>
22480 * expression.cs: Fix bug I introduced lsat night that broke
22483 (Expression.Resolve): Report a 246 error (can not resolve name)
22484 if we find a SimpleName in the stream.
22486 (Expression.ResolveLValue): Ditto.
22488 (Expression.ResolveWithSimpleName): This function is a variant of
22489 ResolveName, this one allows SimpleNames to be returned without a
22490 warning. The only consumer of SimpleNames is MemberAccess
22492 2001-10-26 Miguel de Icaza <miguel@ximian.com>
22494 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22495 might arrive here. I have my doubts that this is correct.
22497 * statement.cs (Lock): Implement lock statement.
22499 * cs-parser.jay: Small fixes to support `lock' and `using'
22501 * cs-tokenizer.cs: Remove extra space
22503 * driver.cs: New flag --checked, allows to turn on integer math
22506 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22507 Threading.Monitor.Exit
22509 2001-10-23 Miguel de Icaza <miguel@ximian.com>
22511 * expression.cs (IndexerAccess::DoResolveLValue): Set the
22512 Expression Class to be IndexerAccess.
22514 Notice that Indexer::DoResolve sets the eclass to Value.
22516 2001-10-22 Miguel de Icaza <miguel@ximian.com>
22518 * class.cs (TypeContainer::Emit): Emit code for indexers.
22520 * assign.cs (IAssignMethod): New interface implemented by Indexers
22521 and Properties for handling assignment.
22523 (Assign::Emit): Simplify and reuse code.
22525 * expression.cs (IndexerAccess, PropertyExpr): Implement
22526 IAssignMethod, clean up old code.
22528 2001-10-22 Ravi Pratap <ravi@ximian.com>
22530 * typemanager.cs (ImplementsInterface): New method to determine if a type
22531 implements a given interface. Provides a nice cache too.
22533 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22536 (ConvertReferenceExplicit): Ditto.
22538 * delegate.cs (Delegate::Populate): Update to define the parameters on the
22539 various methods, with correct names etc.
22541 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
22542 Operator.UnaryNegation.
22544 * cs-parser.jay (operator_declarator): Be a little clever in the case where
22545 we have a unary plus or minus operator.
22547 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
22550 * everywhere : update accordingly.
22552 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22555 * class.cs (Method::Define): For the case where we are implementing a method
22556 inherited from an interface, we need to set the MethodAttributes.Final flag too.
22557 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22559 2001-10-21 Ravi Pratap <ravi@ximian.com>
22561 * interface.cs (FindMembers): Implement to work around S.R.E
22564 * typemanager.cs (IsInterfaceType): Implement.
22566 (FindMembers): Update to handle interface types too.
22568 * expression.cs (ImplicitReferenceConversion): Re-write bits which
22569 use IsAssignableFrom as that is not correct - it doesn't work.
22571 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22572 and accordingly override EmitStatement.
22574 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22575 using the correct logic :-)
22577 2001-10-19 Ravi Pratap <ravi@ximian.com>
22579 * ../errors/cs-11.cs : Add to demonstrate error -11
22581 2001-10-17 Miguel de Icaza <miguel@ximian.com>
22583 * assign.cs (Assign::Resolve): Resolve right hand side first, and
22584 then pass this as a hint to ResolveLValue.
22586 * expression.cs (FieldExpr): Add Location information
22588 (FieldExpr::LValueResolve): Report assignment to readonly
22591 (Expression::ExprClassFromMemberInfo): Pass location information.
22593 (Expression::ResolveLValue): Add new method that resolves an
22596 (Expression::DoResolveLValue): Default invocation calls
22599 (Indexers): New class used to keep track of indexers in a given
22602 (IStackStore): Renamed from LValue, as it did not really describe
22603 what this did. Also ResolveLValue is gone from this interface and
22604 now is part of Expression.
22606 (ElementAccess): Depending on the element access type
22608 * typemanager.cs: Add `indexer_name_type' as a Core type
22609 (System.Runtime.CompilerServices.IndexerNameAttribute)
22611 * statement.cs (Goto): Take a location.
22613 2001-10-18 Ravi Pratap <ravi@ximian.com>
22615 * delegate.cs (Delegate::VerifyDelegate): New method to verify
22616 if two delegates are compatible.
22618 (NewDelegate::DoResolve): Update to take care of the case when
22619 we instantiate a delegate from another delegate.
22621 * typemanager.cs (FindMembers): Don't even try to look up members
22622 of Delegate types for now.
22624 2001-10-18 Ravi Pratap <ravi@ximian.com>
22626 * delegate.cs (NewDelegate): New class to take care of delegate
22629 * expression.cs (New): Split the delegate related code out into
22630 the NewDelegate class.
22632 * delegate.cs (DelegateInvocation): New class to handle delegate
22635 * expression.cs (Invocation): Split out delegate related code into
22636 the DelegateInvocation class.
22638 2001-10-17 Ravi Pratap <ravi@ximian.com>
22640 * expression.cs (New::DoResolve): Implement delegate creation fully
22641 and according to the spec.
22643 (New::DoEmit): Update to handle delegates differently.
22645 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22646 because of which we were printing out arguments in reverse order !
22648 * delegate.cs (VerifyMethod): Implement to check if the given method
22649 matches the delegate.
22651 (FullDelegateDesc): Implement.
22653 (VerifyApplicability): Implement.
22655 * expression.cs (Invocation::DoResolve): Update to accordingly handle
22656 delegate invocations too.
22658 (Invocation::Emit): Ditto.
22660 * ../errors/cs1593.cs : Added.
22662 * ../errors/cs1594.cs : Added.
22664 * delegate.cs (InstanceExpression, TargetMethod): New properties.
22666 2001-10-16 Ravi Pratap <ravi@ximian.com>
22668 * typemanager.cs (intptr_type): Core type for System.IntPtr
22670 (InitCoreTypes): Update for the same.
22672 (iasyncresult_type, asynccallback_type): Ditto.
22674 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22677 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22680 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22681 the builders for the 4 members of a delegate type :-)
22683 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22686 * expression.cs (New::DoResolve): Implement guts for delegate creation.
22688 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22690 2001-10-15 Miguel de Icaza <miguel@ximian.com>
22692 * statement.cs (Break::Emit): Implement.
22693 (Continue::Emit): Implement.
22695 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
22696 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
22697 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
22698 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
22701 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22702 properties that track the label for the current loop (begin of the
22703 loop and end of the loop).
22705 2001-10-15 Ravi Pratap <ravi@ximian.com>
22707 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22708 use of emitting anything at all.
22710 * class.cs, rootcontext.cs : Get rid of calls to the same.
22712 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22714 (Populate): Define the constructor correctly and set the implementation
22717 * typemanager.cs (delegate_types): New hashtable to hold delegates that
22720 (AddDelegateType): Implement.
22722 (IsDelegateType): Implement helper method.
22724 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22726 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22727 and accordingly handle it.
22729 * delegate.cs (Populate): Take TypeContainer argument.
22730 Implement bits to define the Invoke method. However, I still haven't figured out
22731 how to take care of the native int bit :-(
22733 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
22734 Qualify the name of the delegate, not its return type !
22736 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22739 (StandardConversionExists): Checking for array types turns out to be recursive.
22741 (ConvertReferenceExplicit): Implement array conversion.
22743 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22745 2001-10-12 Ravi Pratap <ravi@ximian.com>
22747 * cs-parser.jay (delegate_declaration): Store the fully qualified
22748 name as it is a type declaration.
22750 * delegate.cs (ReturnType, Name): Rename members to these. Make them
22753 (DefineDelegate): Renamed from Define. Does the same thing essentially,
22754 as TypeContainer::DefineType.
22756 (Populate): Method in which all the definition of the various methods (Invoke)
22759 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22762 (CloseDelegate): Finally creates the delegate.
22764 * class.cs (TypeContainer::DefineType): Update to define delegates.
22765 (Populate, Emit and CloseType): Do the same thing here too.
22767 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22768 delegates in all these operations.
22770 2001-10-14 Miguel de Icaza <miguel@ximian.com>
22772 * expression.cs: LocalTemporary: a new expression used to
22773 reference a temporary that has been created.
22775 * assign.cs: Handle PropertyAccess back here, so that we can
22776 provide the proper semantic access to properties.
22778 * expression.cs (Expression::ConvertReferenceExplicit): Implement
22779 a few more explicit conversions.
22781 * modifiers.cs: `NEW' modifier maps to HideBySig.
22783 * expression.cs (PropertyExpr): Make this into an
22784 ExpressionStatement, and support the EmitStatement code path.
22786 Perform get/set error checking, clean up the interface.
22788 * assign.cs: recognize PropertyExprs as targets, and if so, turn
22789 them into toplevel access objects.
22791 2001-10-12 Miguel de Icaza <miguel@ximian.com>
22793 * expression.cs: PropertyExpr::PropertyExpr: use work around the
22796 * typemanager.cs: Keep track here of our PropertyBuilders again to
22797 work around lameness in SRE.
22799 2001-10-11 Miguel de Icaza <miguel@ximian.com>
22801 * expression.cs (LValue::LValueResolve): New method in the
22802 interface, used to perform a second resolution pass for LValues.
22804 (This::DoResolve): Catch the use of this in static methods.
22806 (This::LValueResolve): Implement.
22808 (This::Store): Remove warning, assigning to `this' in structures
22811 (Invocation::Emit): Deal with invocation of
22812 methods on value types. We need to pass the address to structure
22813 methods rather than the object itself. (The equivalent code to
22814 emit "this" for structures leaves the entire structure on the
22815 stack instead of a pointer to it).
22817 (ParameterReference::DoResolve): Compute the real index for the
22818 argument based on whether the method takes or not a `this' pointer
22819 (ie, the method is static).
22821 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22822 value types returned from functions when we need to invoke a
22823 method on the sturcture.
22826 2001-10-11 Ravi Pratap <ravi@ximian.com>
22828 * class.cs (TypeContainer::DefineType): Method to actually do the business of
22829 defining the type in the Modulebuilder or Typebuilder. This is to take
22830 care of nested types which need to be defined on the TypeBuilder using
22831 DefineNestedMethod.
22833 (TypeContainer::GetClassBases): Implement. Essentially the code from the
22834 methods in RootContext, only ported to be part of TypeContainer.
22836 (TypeContainer::GetInterfaceOrClass): Ditto.
22838 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22840 * interface.cs (Interface::DefineInterface): New method. Does exactly
22841 what RootContext.CreateInterface did earlier, only it takes care of nested types
22844 (Interface::GetInterfaces): Move from RootContext here and port.
22846 (Interface::GetInterfaceByName): Same here.
22848 * rootcontext.cs (ResolveTree): Re-write.
22850 (PopulateTypes): Re-write.
22852 * class.cs (TypeContainer::Populate): Populate nested types too.
22853 (TypeContainer::Emit): Emit nested members too.
22855 * typemanager.cs (AddUserType): Do not make use of the FullName property,
22856 instead just use the name argument passed in as it is already fully
22859 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22860 to TypeContainer mapping to see if a type is user-defined.
22862 * class.cs (TypeContainer::CloseType): Implement.
22864 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22865 the default constructor.
22867 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22870 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22872 * interface.cs (CloseType): Create the type here.
22874 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22877 Remove all the methods which are now in TypeContainer.
22879 2001-10-10 Ravi Pratap <ravi@ximian.com>
22881 * delegate.cs (Define): Re-write bits to define the delegate
22884 2001-10-10 Miguel de Icaza <miguel@ximian.com>
22886 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22888 * expression.cs (ImplicitReferenceConversion): handle null as well
22889 as a source to convert to any reference type.
22891 * statement.cs (Return): Perform any implicit conversions to
22892 expected return type.
22894 Validate use of return statement.
22896 * codegen.cs (EmitContext): Pass the expected return type here.
22898 * class.cs (Method, Constructor, Property): Pass expected return
22899 type to EmitContext.
22901 2001-10-09 Miguel de Icaza <miguel@ximian.com>
22903 * expression.cs: Make DoResolve take an EmitContext instead of a
22906 Replaced `l' and `location' for `loc', for consistency.
22908 (Error, Warning): Remove unneeded Tc argument.
22910 * assign.cs, literal.cs, constant.cs: Update to new calling
22913 * codegen.cs: EmitContext now contains a flag indicating whether
22914 code is being generated in a static method or not.
22916 * cs-parser.jay: DecomposeQI, new function that replaces the old
22917 QualifiedIdentifier. Now we always decompose the assembled
22918 strings from qualified_identifier productions into a group of
22921 2001-10-08 Miguel de Icaza <miguel@ximian.com>
22923 * rootcontext.cs: Deal with field-less struct types correctly now
22924 by passing the size option to Define Type.
22926 * class.cs: Removed hack that created one static field.
22928 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22930 * statement.cs: Moved most of the code generation here.
22932 2001-10-09 Ravi Pratap <ravi@ximian.com>
22934 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22937 (ElementAccess): Remove useless bits for now - keep checks as the spec
22940 2001-10-08 Ravi Pratap <ravi@ximian.com>
22942 * expression.cs (ElementAccess::DoResolve): Remove my crap code
22943 and start performing checks according to the spec.
22945 2001-10-07 Ravi Pratap <ravi@ximian.com>
22947 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22948 rank_specifiers instead.
22950 (rank_specifiers): Change the order in which the rank specifiers are stored
22952 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22954 * expression.cs (ElementAccess): Implement the LValue interface too.
22956 2001-10-06 Ravi Pratap <ravi@ximian.com>
22958 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22959 except that user defined conversions are not included.
22961 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
22962 perform the conversion of the return type, if necessary.
22964 (New::DoResolve): Check whether we are creating an array or an object
22965 and accordingly do the needful.
22967 (New::Emit): Same here.
22969 (New::DoResolve): Implement guts of array creation.
22971 (New::FormLookupType): Helper function.
22973 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22975 * codegen.cs: Removed most of the code generation here, and move the
22976 corresponding code generation bits to the statement classes.
22978 Added support for try/catch/finalize and throw.
22980 * cs-parser.jay: Added support for try/catch/finalize.
22982 * class.cs: Catch static methods having the flags override,
22983 virtual or abstract.
22985 * expression.cs (UserCast): This user cast was not really doing
22986 what it was supposed to do. Which is to be born in fully resolved
22987 state. Parts of the resolution were being performed at Emit time!
22991 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22993 * expression.cs: Implicity convert the result from UserCast.
22995 2001-10-05 Ravi Pratap <ravi@ximian.com>
22997 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22998 prevented it from working correctly.
23000 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23001 merely ConvertImplicit.
23003 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23005 * typemanager.cs: Make the LookupTypeContainer function static,
23006 and not per-instance.
23008 * class.cs: Make static FindMembers (the one that takes a Type
23011 * codegen.cs: Add EmitForeach here.
23013 * cs-parser.jay: Make foreach a toplevel object instead of the
23014 inline expansion, as we need to perform semantic analysis on it.
23016 2001-10-05 Ravi Pratap <ravi@ximian.com>
23018 * expression.cs (Expression::ImplicitUserConversion): Rename to
23019 UserDefinedConversion.
23021 (Expression::UserDefinedConversion): Take an extra argument specifying
23022 whether we look for explicit user conversions too.
23024 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23026 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23028 (ExplicitUserConversion): Make it a call to UserDefinedConversion
23029 with the appropriate arguments.
23031 * cs-parser.jay (cast_expression): Record location too.
23033 * expression.cs (Cast): Record location info.
23035 (Expression::ConvertExplicit): Take location argument.
23037 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23038 to determine if we are doing explicit conversions.
23040 (UserCast::Emit): Update accordingly.
23042 (Expression::ConvertExplicit): Report an error if everything fails.
23044 * ../errors/cs0030.cs : Add.
23046 2001-10-04 Miguel de Icaza <miguel@ximian.com>
23048 * modifiers.cs: If the ABSTRACT keyword is present, also set the
23049 virtual and newslot bits.
23051 * class.cs (TypeContainer::RegisterRequiredImplementations):
23052 Record methods we need.
23054 (TypeContainer::MakeKey): Helper function to make keys for
23055 MethodBases, since the Methodbase key is useless.
23057 (TypeContainer::Populate): Call RegisterRequiredImplementations
23058 before defining the methods.
23060 Create a mapping for method_builders_to_methods ahead of time
23061 instead of inside a tight loop.
23063 (::RequireMethods): Accept an object as the data to set into the
23064 hashtable so we can report interface vs abstract method mismatch.
23066 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23068 * report.cs: Make all of it static.
23070 * rootcontext.cs: Drop object_type and value_type computations, as
23071 we have those in the TypeManager anyways.
23073 Drop report instance variable too, now it is a global.
23075 * driver.cs: Use try/catch on command line handling.
23077 Add --probe option to debug the error reporting system with a test
23080 * report.cs: Add support for exiting program when a probe
23081 condition is reached.
23083 2001-10-03 Ravi Pratap <ravi@ximian.com>
23085 * expression.cs (Binary::DoNumericPromotions): Fix the case when
23086 we do a forcible conversion regardless of type, to check if
23087 ForceConversion returns a null.
23089 (Binary::error19): Use location to report error.
23091 (Unary::error23): Use location here too.
23093 * ../errors/cs0019.cs : Check in.
23095 * ../errors/cs0023.cs : Check in.
23097 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23098 case of a non-null MethodInfo object with a length of 0 !
23100 (Binary::ResolveOperator): Flag error if overload resolution fails to find
23101 an applicable member - according to the spec :-)
23102 Also fix logic to find members in base types.
23104 (Unary::ResolveOperator): Same here.
23106 (Unary::report23): Change name to error23 and make first argument a TypeContainer
23107 as I was getting thoroughly confused between this and error19 :-)
23109 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23110 (::FindMostEncompassedType): Implement.
23111 (::FindMostEncompassingType): Implement.
23112 (::StandardConversionExists): Implement.
23114 (UserImplicitCast): Re-vamp. We now need info about most specific
23115 source and target types so that we can do the necessary conversions.
23117 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23118 mathematical union with no duplicates.
23120 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23122 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23123 in order from base classes to child classes, so that we can in
23124 child classes look up in our parent for method names and
23125 attributes (required for handling abstract, virtual, new, override
23126 constructs: we need to instrospect our base class, and if we dont
23127 populate the classes in order, the introspection might be
23128 incorrect. For example, a method could query its parent before
23129 the parent has any methods and would determine that the parent has
23130 no abstract methods (while it could have had them)).
23132 (RootContext::CreateType): Record the order in which we define the
23135 2001-10-02 Miguel de Icaza <miguel@ximian.com>
23137 * class.cs (TypeContainer::Populate): Also method definitions can
23138 fail now, keep track of this.
23140 (TypeContainer::FindMembers): Implement support for
23141 DeclaredOnly/noDeclaredOnly flag.
23143 (Constructor::Emit) Return the ConstructorBuilder.
23145 (Method::Emit) Return the MethodBuilder.
23146 Check for abstract or virtual methods to be public.
23148 * rootcontext.cs (RootContext::CreateType): Register all the
23149 abstract methods required for the class to be complete and the
23150 interface methods that must be implemented.
23152 * cs-parser.jay: Report error 501 (method requires body if it is
23153 not marked abstract or extern).
23155 * expression.cs (TypeOf::Emit): Implement.
23157 * typemanager.cs: runtime_handle_type, new global type.
23159 * class.cs (Property::Emit): Generate code for properties.
23161 2001-10-02 Ravi Pratap <ravi@ximian.com>
23163 * expression.cs (Unary::ResolveOperator): Find operators on base type
23164 too - we now conform exactly to the spec.
23166 (Binary::ResolveOperator): Same here.
23168 * class.cs (Operator::Define): Fix minor quirk in the tests.
23170 * ../errors/cs0215.cs : Added.
23172 * ../errors/cs0556.cs : Added.
23174 * ../errors/cs0555.cs : Added.
23176 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23178 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23179 single integer which is really efficient
23181 2001-10-01 Ravi Pratap <ravi@ximian.com>
23183 * expression.cs (Expression::ImplicitUserConversion): Use location
23184 even in the case when we are examining True operators.
23186 * class.cs (Operator::Define): Perform extensive checks to conform
23187 with the rules for operator overloading in the spec.
23189 * expression.cs (Expression::ImplicitReferenceConversion): Implement
23190 some of the other conversions mentioned in the spec.
23192 * typemanager.cs (array_type): New static member for the System.Array built-in
23195 (cloneable_interface): For System.ICloneable interface.
23197 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23198 we start resolving the tree and populating types.
23200 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23202 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23204 * expression.cs (Expression::ExprClassFromMemberInfo,
23205 Expression::Literalize): Create literal expressions from
23206 FieldInfos which are literals.
23208 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23209 type casts, because they were wrong. The test suite in tests
23212 (ImplicitNumericConversion): ushort to ulong requires a widening
23215 Int32 constant to long requires widening cast as well.
23217 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23218 for integers because the type on the stack is not i4.
23220 2001-09-30 Miguel de Icaza <miguel@ximian.com>
23222 * expression.cs (report118): require location argument.
23224 * parameter.cs: Do not dereference potential null value.
23226 * class.cs: Catch methods that lack the `new' keyword when
23227 overriding a name. Report warnings when `new' is used without
23228 anything being there to override.
23230 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23232 * class.cs: Only add constructor to hashtable if it is non-null
23233 (as now constructors can fail on define).
23235 (TypeManager, Class, Struct): Take location arguments.
23237 Catch field instance initialization in structs as errors.
23239 accepting_filter: a new filter for FindMembers that is static so
23240 that we dont create an instance per invocation.
23242 (Constructor::Define): Catch errors where a struct constructor is
23245 * cs-parser.jay: Pass location information for various new
23248 * delegate.cs (Delegate): take a location argument.
23250 * driver.cs: Do not call EmitCode if there were problesm in the
23251 Definition of the types, as many Builders wont be there.
23253 * decl.cs (Decl::Decl): Require a location argument.
23255 * cs-tokenizer.cs: Handle properly hex constants that can not fit
23256 into integers, and find the most appropiate integer for it.
23258 * literal.cs: Implement ULongLiteral.
23260 * rootcontext.cs: Provide better information about the location of
23261 failure when CreateType fails.
23263 2001-09-29 Miguel de Icaza <miguel@ximian.com>
23265 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23268 * expression.cs (Binary::CheckShiftArguments): Add missing type
23270 (Binary::ResolveOperator): Add type to the logical and and logical
23271 or, Bitwise And/Or and Exclusive Or code paths, it was missing
23274 (Binary::DoNumericPromotions): In the case where either argument
23275 is ulong (and most signed types combined with ulong cause an
23276 error) perform implicit integer constant conversions as well.
23278 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23280 * expression.cs (UserImplicitCast): Method should always be
23282 (Invocation::BetterConversion): Simplified test for IntLiteral.
23284 (Expression::ImplicitNumericConversion): Split this routine out.
23285 Put the code that performs implicit constant integer conversions
23288 (Expression::Resolve): Become a wrapper around DoResolve so we can
23289 check eclass and type being set after resolve.
23291 (Invocation::Badness): Remove this dead function
23293 (Binary::ResolveOperator): Do not compute the expensive argumnets
23294 unless we have a union for it.
23296 (Probe::Emit): Is needs to do an isinst and then
23297 compare against null.
23299 (::CanConvert): Added Location argument. If the Location argument
23300 is null (Location.Null), then we do not report errors. This is
23301 used by the `probe' mechanism of the Explicit conversion. We do
23302 not want to generate an error for something that the user
23303 explicitly requested to be casted. But the pipeline for an
23304 explicit cast first tests for potential implicit casts.
23306 So for now, if the Location is null, it means `Probe only' to
23307 avoid adding another argument. Might have to revise this
23310 (ClassCast): New class used to type cast objects into arbitrary
23311 classes (used in Explicit Reference Conversions).
23313 Implement `as' as well.
23315 Reverted all the patches from Ravi below: they were broken:
23317 * The use of `level' as a mechanism to stop recursive
23318 invocations is wrong. That was there just to catch the
23319 bug with a strack trace but not as a way of addressing
23322 To fix the problem we have to *understand* what is going
23323 on and the interactions and come up with a plan, not
23324 just get things going.
23326 * The use of the type conversion cache that I proposed
23327 last night had an open topic: How does this work across
23328 protection domains. A user defined conversion might not
23329 be public in the location where we are applying the
23330 conversion, a different conversion might be selected
23331 (ie, private A->B (better) but public B->A (worse),
23332 inside A, A->B applies, but outside it, B->A will
23335 * On top of that (ie, even if the above is solved),
23336 conversions in a cache need to be abstract. Ie, `To
23337 convert from an Int to a Short use an OpcodeCast', not
23338 `To convert from an Int to a Short use the OpcodeCast on
23339 the variable 5' (which is what this patch was doing).
23341 2001-09-28 Ravi Pratap <ravi@ximian.com>
23343 * expression.cs (Invocation::ConversionExists): Re-write to use
23344 the conversion cache
23346 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23347 cache all conversions done, not just user-defined ones.
23349 (Invocation::BetterConversion): The real culprit. Use ConversionExists
23350 to determine if a conversion exists instead of acutually trying to
23351 perform the conversion. It's faster too.
23353 (Expression::ConvertExplicit): Modify to use ConversionExists to check
23354 and only then attempt the implicit conversion.
23356 2001-09-28 Ravi Pratap <ravi@ximian.com>
23358 * expression.cs (ConvertImplicit): Use a cache for conversions
23359 already found. Check level of recursion and bail out if necessary.
23361 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23363 * typemanager.cs (string_concat_string_string, string_concat_object_object):
23364 Export standard methods that we expect for string operations.
23366 * statement.cs (Block::UsageWarning): Track usage of variables and
23367 report the errors for not used variables.
23369 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23372 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23374 * codegen.cs: remove unnneded code
23376 * expression.cs: Removed BuiltinTypeAccess class
23378 Fix the order in which implicit conversions are
23381 The previous fixed dropped support for boxed conversions (adding a
23382 test to the test suite now)
23384 (UserImplicitCast::CanConvert): Remove test for source being null,
23385 that code is broken. We should not feed a null to begin with, if
23386 we do, then we should track the bug where the problem originates
23387 and not try to cover it up here.
23389 Return a resolved expression of type UserImplicitCast on success
23390 rather than true/false. Ravi: this is what I was talking about,
23391 the pattern is to use a static method as a "constructor" for
23394 Also, do not create arguments until the very last minute,
23395 otherwise we always create the arguments even for lookups that
23396 will never be performed.
23398 (UserImplicitCast::Resolve): Eliminate, objects of type
23399 UserImplicitCast are born in a fully resolved state.
23401 * typemanager.cs (InitCoreTypes): Init also value_type
23402 (System.ValueType).
23404 * expression.cs (Cast::Resolve): First resolve the child expression.
23406 (LValue): Add new method AddressOf to be used by
23409 Change the argument of Store to take an EmitContext instead of an
23410 ILGenerator, because things like FieldExpr need to be able to call
23411 their children expression to generate the instance code.
23413 (Expression::Error, Expression::Warning): Sugar functions for
23416 (Expression::MemberLookup): Accept a TypeContainer instead of a
23417 Report as the first argument.
23419 (Expression::ResolvePrimary): Killed. I still want to improve
23420 this as currently the code is just not right.
23422 (Expression::ResolveMemberAccess): Simplify, but it is still
23425 (Unary::Resolve): Catch errors in AddressOf operators.
23427 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23428 index to a byte for the short-version, or the compiler will choose
23429 the wrong Emit call, which generates the wrong data.
23431 (ParameterReference::Emit, ::Store): same.
23433 (FieldExpr::AddressOf): Implement.
23435 * typemanager.cs: TypeManager: made public variable instead of
23438 * driver.cs: document --fatal.
23440 * report.cs (ErrorMessage, WarningMessage): new names for the old
23441 Error and Warning classes.
23443 * cs-parser.jay (member_access): Turn built-in access to types
23444 into a normal simplename
23446 2001-09-27 Ravi Pratap <ravi@ximian.com>
23448 * expression.cs (Invocation::BetterConversion): Fix to cope
23449 with q being null, since this was introducing a bug.
23451 * expression.cs (ConvertImplicit): Do built-in conversions first.
23453 2001-09-27 Ravi Pratap <ravi@ximian.com>
23455 * expression.cs (UserImplicitCast::Resolve): Fix bug.
23457 2001-09-27 Ravi Pratap <ravi@ximian.com>
23459 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23460 I had introduced long ago (what's new ?).
23462 * expression.cs (UserImplicitCast::CanConvert): Static method to do
23463 the work of all the checking.
23464 (ConvertImplicit): Call CanConvert and only then create object if necessary.
23465 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23467 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23468 that is the right way.
23470 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
23471 overloading resolution. Use everywhere instead of cutting and pasting code.
23473 (Binary::ResolveOperator): Use MakeUnionSet.
23475 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
23476 we have to convert to bool types. Not complete yet.
23478 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23480 * typemanager.cs (TypeManager::CSharpName): support ushort.
23482 * expression.cs (Expression::TryImplicitIntConversion): Attempts
23483 to provide an expression that performsn an implicit constant int
23484 conversion (section 6.1.6).
23485 (Expression::ConvertImplicitRequired): Reworked to include
23486 implicit constant expression conversions.
23488 (Expression::ConvertNumericExplicit): Finished.
23490 (Invocation::Emit): If InstanceExpression is null, then it means
23491 that we perform a call on this.
23493 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23495 * expression.cs (Unary::Emit): Remove some dead code.
23496 (Probe): Implement Resolve and Emit for `is'.
23497 (Expression::ConvertImplicitRequired): Attempt to do constant
23498 expression conversions here. Maybe should be moved to
23499 ConvertImplicit, but I am not sure.
23500 (Expression::ImplicitLongConstantConversionPossible,
23501 Expression::ImplicitIntConstantConversionPossible): New functions
23502 that tell whether is it possible to apply an implicit constant
23503 expression conversion.
23505 (ConvertNumericExplicit): Started work on explicit numeric
23508 * cs-parser.jay: Update operator constants.
23510 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23511 (Parameters::GetSignature): Hook up VerifyArgs here.
23512 (Parameters::VerifyArgs): Verifies that no two arguments have the
23515 * class.cs (Operator): Update the operator names to reflect the
23516 ones that the spec expects (as we are just stringizing the
23519 * expression.cs (Unary::ResolveOperator): Fix bug: Use
23520 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23521 previous usage did only work for our methods.
23522 (Expression::ConvertImplicit): Handle decimal implicit numeric
23523 conversions as well.
23524 (Expression::InternalTypeConstructor): Used to invoke constructors
23525 on internal types for default promotions.
23527 (Unary::Emit): Implement special handling for the pre/post
23528 increment/decrement for overloaded operators, as they need to have
23529 the same semantics as the other operators.
23531 (Binary::ResolveOperator): ditto.
23532 (Invocation::ConversionExists): ditto.
23533 (UserImplicitCast::Resolve): ditto.
23535 2001-09-26 Ravi Pratap <ravi@ximian.com>
23537 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23538 operator, return after emitting body. Regression tests pass again !
23540 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23541 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23542 (Invocation::OverloadResolve): Ditto.
23543 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23545 * everywhere : update calls to the above methods accordingly.
23547 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23549 * assign.cs (Assign): Make it inherit from ExpressionStatement.
23551 * expression.cs (ExpressionStatement): New base class used for
23552 expressions that can appear in statements, so that we can provide
23553 an alternate path to generate expression that do not leave a value
23556 (Expression::Emit, and all the derivatives): We no longer return
23557 whether a value is left on the stack or not. Every expression
23558 after being emitted leaves a single value on the stack.
23560 * codegen.cs (EmitContext::EmitStatementExpression): Use the
23561 facilties of ExpressionStatement if possible.
23563 * cs-parser.jay: Update statement_expression.
23565 2001-09-25 Miguel de Icaza <miguel@ximian.com>
23567 * driver.cs: Change the wording of message
23569 2001-09-25 Ravi Pratap <ravi@ximian.com>
23571 * expression.cs (Binary::ResolveOperator): Had forgottten to set
23572 the type of the expression to the return type of the method if
23573 we have an overloaded operator match ! The regression tests pass again !
23574 (Unary::ResolveOperator): Ditto.
23576 * expression.cs (Invocation::ConversionExists): Correct the member lookup
23577 to find "op_Implicit", not "implicit" ;-)
23578 (UserImplicitCast): New class to take care of user-defined implicit conversions.
23579 (ConvertImplicit, ForceConversion): Take TypeContainer argument
23581 * everywhere : Correct calls to the above accordingly.
23583 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23584 (ConvertImplicit): Do user-defined conversion if it exists.
23586 2001-09-24 Miguel de Icaza <miguel@ximian.com>
23588 * assign.cs: track location.
23589 (Resolve): Use implicit conversions on assignment.
23591 * literal.cs: Oops. Not good, Emit of short access values should
23592 pass (Bytes) or the wrong argument will be selected.
23594 * expression.cs (Unary::Emit): Emit code for -expr.
23596 (Unary::ResolveOperator): Handle `Substract' for non-constants
23597 (substract from zero from the non-constants).
23598 Deal with Doubles as well.
23600 (Expression::ConvertImplicitRequired): New routine that reports an
23601 error if no implicit conversion exists.
23603 (Invocation::OverloadResolve): Store the converted implicit
23604 expressions if we make them
23606 2001-09-24 Ravi Pratap <ravi@ximian.com>
23608 * class.cs (ConstructorInitializer): Take a Location argument.
23609 (ConstructorBaseInitializer): Same here.
23610 (ConstructorThisInitializer): Same here.
23612 * cs-parser.jay : Update all calls accordingly.
23614 * expression.cs (Unary, Binary, New): Take location argument.
23615 Update accordingly everywhere.
23617 * cs-parser.jay : Update all calls to the above to take a location
23620 * class.cs : Ditto.
23622 2001-09-24 Ravi Pratap <ravi@ximian.com>
23624 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23625 (Invocation::BetterConversion): Same here
23626 (Invocation::ConversionExists): Ditto.
23628 (Invocation::ConversionExists): Implement.
23630 2001-09-22 Ravi Pratap <ravi@ximian.com>
23632 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23633 Also take an additional TypeContainer argument.
23635 * All over : Pass in TypeContainer as argument to OverloadResolve.
23637 * typemanager.cs (CSharpName): Update to check for the string type and return
23640 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23643 2001-09-21 Ravi Pratap <ravi@ximian.com>
23645 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23646 (Invocation::BetterFunction): Implement.
23647 (Invocation::BetterConversion): Implement.
23648 (Invocation::ConversionExists): Skeleton, no implementation yet.
23650 Okay, things work fine !
23652 2001-09-21 Miguel de Icaza <miguel@ximian.com>
23654 * typemanager.cs: declare and load enum_type, delegate_type and
23657 * expression.cs (Expression::Emit): Now emit returns a value that
23658 tells whether a value is left on the stack or not. This strategy
23659 might be reveted tomorrow with a mechanism that would address
23660 multiple assignments.
23661 (Expression::report118): Utility routine to report mismatches on
23664 (Unary::Report23): Report impossible type/operator combination
23667 (Unary::IsIncrementableNumber): Whether the type can be
23668 incremented or decremented with add.
23669 (Unary::ResolveOperator): Also allow enumerations to be bitwise
23671 (Unary::ResolveOperator): Implement ++, !, ~,
23673 (Invocation::Emit): Deal with new Emit convetion.
23675 * All Expression derivatives: Updated their Emit method to return
23676 whether they leave values on the stack or not.
23678 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23679 stack for expressions that are statements.
23681 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23683 * expression.cs (LValue): New interface. Must be implemented by
23685 (LocalVariableReference, ParameterReference, FieldExpr): Implement
23688 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23689 interface for generating code, simplifies the code.
23691 2001-09-20 Ravi Pratap <ravi@ximian.com>
23693 * expression.cs (everywhere): Comment out return statements in ::Resolve
23694 methods to avoid the warnings.
23696 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23698 * driver.cs (parse): Report error 2001 if we can not open the
23701 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23704 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23707 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23708 otherwise nested blocks end up with the same index.
23710 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23712 * expression.cs: Instead of having FIXMEs in the Resolve
23713 functions, throw exceptions so it is obvious that we are facing a
23716 * cs-parser.jay (invocation_expression): Pass Location information.
23718 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23719 Use a basename for those routines because .NET does not like paths
23722 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23725 2001-09-19 Miguel de Icaza <miguel@ximian.com>
23727 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23728 are loading the correct data types (throws an exception if not).
23729 (TypeManager::InitCoreTypes): Use CoreLookupType
23731 * expression.cs (Unary::ResolveOperator): return the child
23732 expression for expressions which are just +expr.
23733 (Unary::ResolveOperator): Return negative literals for -LITERAL
23734 expressions (otherwise they are Unary {Literal}).
23735 (Invocation::Badness): Take into account `Implicit constant
23736 expression conversions'.
23738 * literal.cs (LongLiteral): Implement long literal class.
23739 (IntLiteral): export the `Value' of the intliteral.
23741 2001-09-19 Ravi Pratap <ravi@ximian.com>
23743 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23745 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
23746 instead of 'Operator'
23748 * expression.cs (Binary::ResolveOperator): Update accordingly.
23749 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23752 * cs-parser.jay (unary_expression): Update to use the new names.
23754 * gen-treedump.cs (GetUnary): Same here.
23756 * expression.cs (Unary::Resolve): Implement.
23757 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
23758 operators are found instead of making noise ;-)
23759 (Unary::ResolveOperator): New method to do precisely the same thing which
23760 Binary::ResolveOperator does for Binary expressions.
23761 (Unary.method, .Arguments): Add.
23762 (Unary::OperName): Implement.
23763 (Unary::ForceConversion): Copy and Paste !
23765 * class.cs (Operator::Define): Fix a small bug for the case when we have
23768 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23769 for the inbuilt operators. Only overloading works for now ;-)
23771 2001-09-18 Miguel de Icaza <miguel@ximian.com>
23773 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23774 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23776 * expression.cs (This::Emit): Implement.
23777 (This::Resolve): Implement.
23778 (TypeOf:Resolve): Implement.
23779 (Expression::ResolveSimpleName): Add an implicit this to instance
23781 (MemberAccess::Resolve): Deal with Parameters and Fields.
23782 Bind instance variable to Field expressions.
23783 (FieldExpr::Instance): New field used to track the expression that
23784 represents the object instance.
23785 (FieldExpr::Resolve): Track potential errors from MemberLookup not
23787 (FieldExpr::Emit): Implement.
23789 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23790 the last instruction contains a return opcode to avoid generating
23791 the last `ret' instruction (this generates correct code, and it is
23792 nice to pass the peverify output).
23794 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23795 initializer for static and instance variables.
23796 (Constructor::Emit): Allow initializer to be null in the case of
23797 static constructors. Only emit initializer for instance
23800 (TypeContainer::FindMembers): Return a null array if there are no
23803 Also fix the code for the MemberTypes.Method branch, as it was not
23804 scanning that for operators (or tried to access null variables before).
23806 * assign.cs (Assign::Emit): Handle instance and static fields.
23810 * driver.cs: Stop compilation if there are parse errors.
23812 * cs-parser.jay (constructor_declaration): Provide default base
23813 initializer for non-static constructors.
23814 (constructor_declarator): Do not provide a default base
23815 initializers if none was specified.
23816 Catch the fact that constructors should not have parameters.
23818 * class.cs: Do not emit parent class initializers for static
23819 constructors, that should be flagged as an error.
23821 2001-09-18 Ravi Pratap <ravi@ximian.com>
23823 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23824 Move back code into TypeContainer::Populate.
23826 2001-09-18 Ravi Pratap <ravi@ximian.com>
23828 * class.cs (TypeContainer::AddConstructor): Fix the check to
23829 compare against Name, not Basename.
23830 (Operator::OpType): Change Plus and Minus to Add and Subtract.
23832 * cs-parser.jay : Update accordingly.
23834 * class.cs (TypeContainer::FindMembers): For the case where we are searching
23835 for methods, don't forget to look into the operators too.
23836 (RegisterMethodBuilder): Helper method to take care of this for
23837 methods, constructors and operators.
23838 (Operator::Define): Completely revamp.
23839 (Operator.OperatorMethod, MethodName): New fields.
23840 (TypeContainer::Populate): Move the registering of builders into
23841 RegisterMethodBuilder.
23842 (Operator::Emit): Re-write.
23844 * expression.cs (Binary::Emit): Comment out code path to emit method
23845 invocation stuff for the case when we have a user defined operator. I am
23846 just not able to get it right !
23848 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23850 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23853 (Expression::MemberLookup): Provide a version that allows to
23854 specify the MemberTypes and BindingFlags.
23856 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23857 so it was not fetching variable information from outer blocks.
23859 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23860 Beforefieldinit as it was buggy.
23862 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23863 that Ravi put here.
23865 * class.cs (Constructor::Emit): Only emit if block is not null.
23866 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23867 deal with this by semantically definining it as if the user had
23870 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23871 constructors as we now "emit" them at a higher level.
23873 (TypeContainer::DefineDefaultConstructor): Used to define the
23874 default constructors if none was provided.
23876 (ConstructorInitializer): Add methods Resolve and Emit.
23878 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23880 2001-09-17 Ravi Pratap <ravi@ximian.com>
23882 * class.cs (TypeContainer::EmitDefaultConstructor): Register
23883 the default constructor builder with our hashtable for methodbuilders
23886 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23887 and argument_count is 0 in which case we have a match.
23888 (Binary::ResolveOperator): More null checking and miscellaneous coding
23891 2001-09-17 Ravi Pratap <ravi@ximian.com>
23893 * rootcontext.cs (IsNameSpace): Compare against null.
23895 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23897 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23898 and Unary::Operator.
23900 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23903 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23904 we have overloaded operators.
23905 (Binary::ResolveOperator): Implement the part which does the operator overload
23908 * class.cs (Operator::Emit): Implement.
23909 (TypeContainer::Emit): Emit the operators we have too.
23911 * expression.cs (Binary::Emit): Update to emit the appropriate code for
23912 the case when we have a user-defined operator.
23914 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23916 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23918 2001-09-16 Ravi Pratap <ravi@ximian.com>
23920 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23921 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23922 (Constructor::Emit): Implement.
23923 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23924 if we have no work to do.
23925 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
23928 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23929 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23931 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23934 2001-09-15 Ravi Pratap <ravi@ximian.com>
23936 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23938 (Tree::RecordNamespace): Method to do what the name says ;-)
23939 (Tree::Namespaces): Property to get at the namespaces hashtable.
23941 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
23944 * rootcontext.cs (IsNamespace): Fixed it :-)
23946 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23948 * class.cs (TypeContainer::FindMembers): Add support for
23950 (MethodCore): New class that encapsulates both the shared aspects
23951 of a Constructor and a Method.
23952 (Method, Constructor): Factored pieces into MethodCore.
23954 * driver.cs: Added --fatal which makes errors throw exceptions.
23955 Load System assembly as well as part of the standard library.
23957 * report.cs: Allow throwing exceptions on errors for debugging.
23959 * modifiers.cs: Do not use `parent', instead use the real type
23960 container to evaluate permission settings.
23962 * class.cs: Put Ravi's patch back in. He is right, and we will
23963 have to cope with the
23965 2001-09-14 Ravi Pratap <ravi@ximian.com>
23967 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23968 FamORAssem, not FamANDAssem.
23970 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23972 * driver.cs: Added --parse option that only parses its input files
23975 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
23976 incorrect. IsTopLevel is not used to tell whether an object is
23977 root_types or not (that can be achieved by testing this ==
23978 root_types). But to see if this is a top-level *class* (not
23979 necessarly our "toplevel" container).
23981 2001-09-14 Ravi Pratap <ravi@ximian.com>
23983 * enum.cs (Enum::Define): Modify to call the Lookup method on the
23984 parent instead of a direct call to GetType.
23986 2001-09-14 Ravi Pratap <ravi@ximian.com>
23988 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23989 Modifiers.TypeAttr. This should just be a call to that method.
23991 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23992 object so that we can determine if we are top-level or not.
23994 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
23997 * enum.cs (Enum::Define): Ditto.
23999 * modifiers.cs (FieldAttr): Re-write.
24001 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24002 (TypeContainer::HaveStaticConstructor): New property to provide access
24003 to precisely that info.
24005 * modifiers.cs (MethodAttr): Re-write.
24006 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24008 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24009 of top-level types as claimed.
24011 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24013 * expression.cs (MemberLookup): Fruitless attempt to lookup
24014 constructors. Maybe I need to emit default constructors? That
24015 might be it (currently .NET emits this for me automatically).
24016 (Invocation::OverloadResolve): Cope with Arguments == null.
24017 (Invocation::EmitArguments): new function, shared by the new
24018 constructor and us.
24019 (Invocation::Emit): Handle static and instance methods. Emit
24020 proper call instruction for virtual or non-virtual invocations.
24021 (New::Emit): Implement.
24022 (New::Resolve): Implement.
24023 (MemberAccess:Resolve): Implement.
24024 (MethodGroupExpr::InstanceExpression): used conforming to the spec
24025 to track instances.
24026 (FieldExpr::Resolve): Set type.
24028 * support.cs: Handle empty arguments.
24030 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24031 SimpleLookup): Auxiliary routines to help parse a qualifier
24034 Update qualifier_identifier rule.
24036 * codegen.cs: Removed debugging messages.
24038 * class.cs: Make this a global thing, this acts just as a "key" to
24039 objects that we might have around.
24041 (Populate): Only initialize method_builders_to_methods once.
24043 * expression.cs (PropertyExpr): Initialize type from the
24046 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24047 Resolve pattern. Attempt to implicitly convert value to boolean.
24050 * expression.cs: Set the type for the int32/int32 argument case.
24051 (Binary::ResolveOperator): Set the return type to boolean for
24052 comparission operators
24054 * typemanager.cs: Remove debugging print code.
24056 (Invocation::Resolve): resolve type.
24058 * class.cs: Allocate a MemberInfo of the correct size, as the code
24059 elsewhere depends on the test to reflect the correct contents.
24061 (Method::) Keep track of parameters, due to System.Reflection holes
24063 (TypeContainer::Populate): Keep track of MethodBuilders to Method
24066 (TypeContainer::FindMembers): Use ArrayList and then copy an array
24067 of the exact size and return that.
24069 (Class::LookupMethodByBuilder): New function that maps
24070 MethodBuilders to its methods. Required to locate the information
24071 on methods because System.Reflection bit us again.
24073 * support.cs: New file, contains an interface ParameterData and
24074 two implementations: ReflectionParameters and InternalParameters
24075 used to access Parameter information. We will need to grow this
24078 * expression.cs (Invocation::GetParameterData): implement a cache
24079 and a wrapper around the ParameterData creation for methods.
24080 (Invocation::OverloadResolve): Use new code.
24082 2001-09-13 Ravi Pratap <ravi@ximian.com>
24084 * class.cs (TypeContainer::EmitField): Remove and move into
24085 (Field::Define): here and modify accordingly.
24086 (Field.FieldBuilder): New member.
24087 (TypeContainer::Populate): Update accordingly.
24088 (TypeContainer::FindMembers): Implement.
24090 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24092 * statement.cs: (VariableInfo::VariableType): New field to be
24093 initialized with the full type once it is resolved.
24095 2001-09-12 Miguel de Icaza <miguel@ximian.com>
24097 * parameter.cs (GetParameterInfo): Use a type cache to compute
24098 things only once, and to reuse this information
24100 * expression.cs (LocalVariableReference::Emit): Implement.
24101 (OpcodeCast::Emit): fix.
24103 (ParameterReference::Resolve): Implement.
24104 (ParameterReference::Emit): Implement.
24106 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24107 that are expressions need to stay as Expressions.
24109 * typemanager.cs (CSharpName): Returns the C# name of a type if
24112 * expression.cs (Expression::ConvertImplicit): New function that
24113 implements implicit type conversions.
24115 (Expression::ImplicitReferenceConversion): Implements implicit
24116 reference conversions.
24118 (EmptyCast): New type for transparent casts.
24120 (OpcodeCast): New type for casts of types that are performed with
24121 a sequence of bytecodes.
24123 (BoxedCast): New type used for casting value types into reference
24124 types. Emits a box opcode.
24126 (Binary::DoNumericPromotions): Implements numeric promotions of
24127 and computation of the Binary::Type.
24129 (Binary::EmitBranchable): Optimization.
24131 (Binary::Emit): Implement code emission for expressions.
24133 * typemanager.cs (TypeManager): Added two new core types: sbyte
24136 2001-09-12 Ravi Pratap <ravi@ximian.com>
24138 * class.cs (TypeContainer::FindMembers): Method which does exactly
24139 what Type.FindMembers does, only we don't have to use reflection. No
24140 implementation yet.
24142 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24143 typecontainer objects as we need to get at them.
24144 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24146 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24147 typecontainer object.
24149 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24150 of just a Report object.
24152 2001-09-11 Ravi Pratap <ravi@ximian.com>
24154 * class.cs (Event::Define): Go back to using the prefixes "add_" and
24156 (TypeContainer::Populate): Now define the delegates of the type too.
24157 (TypeContainer.Delegates): Property to access the list of delegates defined
24160 * delegates.cs (Delegate::Define): Implement partially.
24162 * modifiers.cs (TypeAttr): Handle more flags.
24164 2001-09-11 Ravi Pratap <ravi@ximian.com>
24166 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24168 (Operator::Define): Re-write logic to get types by using the LookupType method
24169 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24170 (Indexer::Define): Ditto.
24171 (Event::Define): Ditto.
24172 (Property::Define): Ditto.
24174 2001-09-10 Ravi Pratap <ravi@ximian.com>
24176 * class.cs (TypeContainer::Populate): Now define operators too.
24177 (TypeContainer.Operators): New property to access the list of operators
24179 (Operator.OperatorMethodBuilder): New member to hold the method builder
24180 for the operator we are defining.
24181 (Operator::Define): Implement.
24183 2001-09-10 Ravi Pratap <ravi@ximian.com>
24185 * class.cs (Event::Define): Make the prefixes of the accessor methods
24186 addOn_ and removeOn_
24188 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24189 of the location being passed in too. Ideally, this should go later since all
24190 error reporting should be done through the Report object.
24192 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24193 (Populate): Iterate thru the indexers we have and define them too.
24194 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24195 for the get and set accessors.
24196 (Indexer::Define): Implement.
24198 2001-09-09 Miguel de Icaza <miguel@ximian.com>
24200 * expression.cs (Binary::Resolve): Beginning of it. I scratched
24201 my previous implementation, did not work.
24203 * typemanager.cs: Add a couple of missing types (the longs).
24205 * literal.cs: Use TypeManager.bool_type instead of getting it.
24207 * expression.cs (EventExpr): New kind of expressions.
24208 (Expressio::ExprClassFromMemberInfo): finish
24210 2001-09-08 Miguel de Icaza <miguel@ximian.com>
24212 * assign.cs: Emit stores to static fields differently.
24214 2001-09-08 Ravi Pratap <ravi@ximian.com>
24216 * Merge in changes and adjust code to tackle conflicts. Backed out my
24217 code in Assign::Resolve ;-)
24219 2001-09-08 Ravi Pratap <ravi@ximian.com>
24221 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24222 instead Report.Error and also pass in the location.
24223 (CSharpParser::Lexer): New readonly property to return the reference
24224 to the Tokenizer object.
24225 (declare_local_variables): Use Report.Error with location instead of plain
24229 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24230 (Operator.CheckBinaryOperator): Ditto.
24232 * cs-parser.jay (operator_declarator): Update accordingly.
24234 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24235 (CheckBinaryOperator): Same here.
24237 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24238 on the name without any prefixes of namespace names etc. This is because we
24239 already might have something already fully qualified like
24240 'System.Console.WriteLine'
24242 * assign.cs (Resolve): Begin implementation. Stuck ;-)
24244 2001-09-07 Ravi Pratap <ravi@ximian.com>
24246 * cs-tokenizer.cs (location): Return a string which also contains
24249 * expression.cs (ElementAccess): New class for expressions of the
24250 type 'element access.'
24251 (BaseAccess): New class for expressions of the type 'base access.'
24252 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24255 * cs-parser.jay (element_access): Implement action.
24256 (base_access): Implement actions.
24257 (checked_expression, unchecked_expression): Implement.
24259 * cs-parser.jay (local_variable_type): Correct and implement.
24260 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24262 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24264 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24265 name and the specifiers.
24267 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24269 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
24270 making them all public ;-)
24272 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24275 2001-09-07 Miguel de Icaza <miguel@ximian.com>
24277 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24279 (FieldExpr, PropertyExprs): New resolved expressions.
24280 (SimpleName::MemberStaticCheck): Perform static checks for access
24281 to non-static fields on static methods. Maybe this should be
24282 generalized for MemberAccesses.
24283 (SimpleName::ResolveSimpleName): More work on simple name
24286 * cs-parser.jay (primary_expression/qualified_identifier): track
24287 the parameter index.
24289 * codegen.cs (CodeGen::Save): Catch save exception, report error.
24290 (EmitContext::EmitBoolExpression): Chain to expression generation
24291 instead of temporary hack.
24292 (::EmitStatementExpression): Put generic expression code generation.
24294 * assign.cs (Assign::Emit): Implement variable assignments to
24295 local variables, parameters and fields.
24297 2001-09-06 Miguel de Icaza <miguel@ximian.com>
24299 * statement.cs (Block::GetVariableInfo): New method, returns the
24300 VariableInfo for a variable name in a block.
24301 (Block::GetVariableType): Implement in terms of GetVariableInfo
24303 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24304 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24306 2001-09-06 Ravi Pratap <ravi@ximian.com>
24308 * cs-parser.jay (operator_declaration): Continue on my quest : update
24309 to take attributes argument.
24310 (event_declaration): Ditto.
24311 (enum_declaration): Ditto.
24312 (indexer_declaration): Ditto.
24314 * class.cs (Operator::Operator): Update constructor accordingly.
24315 (Event::Event): Ditto.
24317 * delegate.cs (Delegate::Delegate): Same here.
24319 * enum.cs (Enum::Enum): Same here.
24321 2001-09-05 Ravi Pratap <ravi@ximian.com>
24323 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24325 * ../tests/cs0658.cs : New file to demonstrate error 0658.
24327 * attribute.cs (Attributes): New class to encapsulate all attributes which were
24328 being passed around as an arraylist.
24329 (Attributes::AddAttribute): Method to add attribute sections.
24331 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24332 (struct_declaration): Update accordingly.
24333 (constant_declaration): Update.
24334 (field_declaration): Update.
24335 (method_header): Update.
24336 (fixed_parameter): Update.
24337 (parameter_array): Ditto.
24338 (property_declaration): Ditto.
24339 (destructor_declaration): Ditto.
24341 * class.cs (Struct::Struct): Update constructors accordingly.
24342 (Class::Class): Ditto.
24343 (Field::Field): Ditto.
24344 (Method::Method): Ditto.
24345 (Property::Property): Ditto.
24346 (TypeContainer::OptAttribute): update property's return type.
24348 * interface.cs (Interface.opt_attributes): New member.
24349 (Interface::Interface): Update to take the extra Attributes argument.
24351 * parameter.cs (Parameter::Parameter): Ditto.
24353 * constant.cs (Constant::Constant): Ditto.
24355 * interface.cs (InterfaceMemberBase): New OptAttributes field.
24356 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
24357 the attributes as a parameter.
24358 (InterfaceProperty): Update constructor call.
24359 (InterfaceEvent): Ditto.
24360 (InterfaceMethod): Ditto.
24361 (InterfaceIndexer): Ditto.
24363 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
24364 pass the attributes too.
24365 (interface_event_declaration): Ditto.
24366 (interface_property_declaration): Ditto.
24367 (interface_method_declaration): Ditto.
24368 (interface_declaration): Ditto.
24370 2001-09-05 Miguel de Icaza <miguel@ximian.com>
24372 * class.cs (Method::Define): Track the "static Main" definition to
24373 create an entry point.
24375 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24376 EntryPoint if we find it.
24378 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24379 (EmitContext::ig): Make this variable public.
24381 * driver.cs: Make the default output file be the first file name
24382 with the .exe extension.
24384 Detect empty compilations
24386 Handle various kinds of output targets. Handle --target and
24387 rename -t to --dumper.
24389 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24390 methods inherited from Expression return now an Expression. This
24391 will is used during the tree rewriting as we resolve them during
24394 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24395 the spec. Missing entirely is the information about
24396 accessability of elements of it.
24398 (Expression::ExprClassFromMemberInfo): New constructor for
24399 Expressions that creates a fully initialized Expression based on
24400 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24403 (Invocation::Resolve): Begin implementing resolution of invocations.
24405 * literal.cs (StringLiteral): Implement Emit.
24407 2001-09-05 Ravi Pratap <ravi@ximian.com>
24409 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24412 2001-09-04 Ravi Pratap <ravi@ximian.com>
24414 * cs-parser.jay (attribute_arguments): Implement actions.
24415 (attribute): Fix bug in production. Implement action.
24416 (attribute_list): Implement.
24417 (attribute_target): Implement.
24418 (attribute_target_specifier, opt_target_specifier): Implement
24419 (CheckAttributeTarget): New method to check if the attribute target
24421 (attribute_section): Implement.
24422 (opt_attributes): Implement.
24424 * attribute.cs : New file to handle attributes.
24425 (Attribute): Class to hold attribute info.
24427 * cs-parser.jay (opt_attribute_target_specifier): Remove production
24428 (attribute_section): Modify production to use 2 different rules to
24429 achieve the same thing. 1 s/r conflict down !
24430 Clean out commented, useless, non-reducing dimension_separator rules.
24432 * class.cs (TypeContainer.attributes): New member to hold list
24433 of attributes for a type.
24434 (Struct::Struct): Modify to take one more argument, the attribute list.
24435 (Class::Class): Ditto.
24436 (Field::Field): Ditto.
24437 (Method::Method): Ditto.
24438 (Property::Property): Ditto.
24440 * cs-parser.jay (struct_declaration): Update constructor call to
24441 pass in the attributes too.
24442 (class_declaration): Ditto.
24443 (constant_declaration): Ditto.
24444 (field_declaration): Ditto.
24445 (method_header): Ditto.
24446 (fixed_parameter): Ditto.
24447 (parameter_array): Ditto.
24448 (property_declaration): Ditto.
24450 * constant.cs (Constant::Constant): Update constructor similarly.
24451 Use System.Collections.
24453 * parameter.cs (Parameter::Parameter): Update as above.
24455 2001-09-02 Ravi Pratap <ravi@ximian.com>
24457 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24458 (TypeContainer.delegates): New member to hold list of delegates.
24460 * cs-parser.jay (delegate_declaration): Implement the action correctly
24461 this time as I seem to be on crack ;-)
24463 2001-09-02 Miguel de Icaza <miguel@ximian.com>
24465 * rootcontext.cs (RootContext::IsNamespace): new function, used to
24466 tell whether an identifier represents a namespace.
24468 * expression.cs (NamespaceExpr): A namespace expression, used only
24469 temporarly during expression resolution.
24470 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24471 utility functions to resolve names on expressions.
24473 2001-09-01 Miguel de Icaza <miguel@ximian.com>
24475 * codegen.cs: Add hook for StatementExpressions.
24477 * class.cs: Fix inverted test for static flag in methods.
24479 2001-09-02 Ravi Pratap <ravi@ximian.com>
24481 * class.cs (Operator::CheckUnaryOperator): Correct error number used
24482 to make it coincide with MS' number.
24483 (Operator::CheckBinaryOperator): Ditto.
24485 * ../errors/errors.txt : Remove error numbers added earlier.
24487 * ../errors/cs1019.cs : Test case for error # 1019
24489 * ../errros/cs1020.cs : Test case for error # 1020
24491 * cs-parser.jay : Clean out commented cruft.
24492 (dimension_separators, dimension_separator): Comment out. Ostensibly not
24493 used anywhere - non-reducing rule.
24494 (namespace_declarations): Non-reducing rule - comment out.
24496 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24497 with TypeContainer::AddEnum.
24499 * delegate.cs : New file for delegate handling classes.
24500 (Delegate): Class for declaring delegates.
24502 * makefile : Update.
24504 * cs-parser.jay (delegate_declaration): Implement.
24506 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
24508 * class.cs (Event::Define): Implement.
24509 (Event.EventBuilder): New member.
24511 * class.cs (TypeContainer::Populate): Update to define all enums and events
24513 (Events): New property for the events arraylist we hold. Shouldn't we move to using
24514 readonly fields for all these cases ?
24516 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24518 * class.cs (Property): Revamp to use the convention of making fields readonly.
24519 Accordingly modify code elsewhere.
24521 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24522 the Define method of the Property class.
24524 * class.cs : Clean up applied patch and update references to variables etc. Fix
24526 (TypeContainer::Populate): Update to define all the properties we have. Also
24527 define all enumerations.
24529 * enum.cs (Define): Implement.
24531 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24533 * cs-parser.jay (overloadable_operator): The semantic value is an
24534 enum of the Operator class.
24535 (operator_declarator): Implement actions.
24536 (operator_declaration): Implement.
24538 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24539 validity of definitions.
24540 (Operator::CheckBinaryOperator): Static method to check for binary operators
24541 (TypeContainer::AddOperator): New method to add an operator to a type.
24543 * cs-parser.jay (indexer_declaration): Added line to actually call the
24544 AddIndexer method so it gets added ;-)
24546 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
24547 already taken care of by the MS compiler ?
24549 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24551 * class.cs (Operator): New class for operator declarations.
24552 (Operator::OpType): Enum for the various operators.
24554 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24556 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24557 ostensibly handle this in semantic analysis.
24559 * cs-parser.jay (general_catch_clause): Comment out
24560 (specific_catch_clauses, specific_catch_clause): Ditto.
24561 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24562 (catch_args, opt_catch_args): New productions.
24563 (catch_clause): Rewrite to use the new productions above
24564 (catch_clauses): Modify accordingly.
24565 (opt_catch_clauses): New production to use in try_statement
24566 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24567 and re-write the code in the actions to extract the specific and
24568 general catch clauses by being a little smart ;-)
24570 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24571 Hooray, try and catch statements parse fine !
24573 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24575 * statement.cs (Block::GetVariableType): Fix logic to extract the type
24576 string from the hashtable of variables.
24578 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24579 I end up making that mistake ;-)
24580 (catch_clauses): Fixed gross error which made Key and Value of the
24581 DictionaryEntry the same : $1 !!
24583 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24585 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24587 * cs-parser.jay (event_declaration): Correct to remove the semicolon
24588 when the add and remove accessors are specified.
24590 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24592 * cs-parser.jay (IndexerDeclaration): New helper class to hold
24593 information about indexer_declarator.
24594 (indexer_declarator): Implement actions.
24595 (parsing_indexer): New local boolean used to keep track of whether
24596 we are parsing indexers or properties. This is necessary because
24597 implicit_parameters come into picture even for the get accessor in the
24598 case of an indexer.
24599 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24601 * class.cs (Indexer): New class for indexer declarations.
24602 (TypeContainer::AddIndexer): New method to add an indexer to a type.
24603 (TypeContainer::indexers): New member to hold list of indexers for the
24606 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24608 * cs-parser.jay (add_accessor_declaration): Implement action.
24609 (remove_accessor_declaration): Implement action.
24610 (event_accessors_declaration): Implement
24611 (variable_declarators): swap statements for first rule - trivial.
24613 * class.cs (Event): New class to hold information about event
24615 (TypeContainer::AddEvent): New method to add an event to a type
24616 (TypeContainer::events): New member to hold list of events.
24618 * cs-parser.jay (event_declaration): Implement actions.
24620 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24622 * cs-parser.jay (dim_separators): Implement. Make it a string
24623 concatenating all the commas together, just as they appear.
24624 (opt_dim_separators): Modify accordingly
24625 (rank_specifiers): Update accordingly. Basically do the same
24626 thing - instead, collect the brackets here.
24627 (opt_rank_sepcifiers): Modify accordingly.
24628 (array_type): Modify to actually return the complete type string
24629 instead of ignoring the rank_specifiers.
24630 (expression_list): Implement to collect the expressions
24631 (variable_initializer): Implement. We make it a list of expressions
24632 essentially so that we can handle the array_initializer case neatly too.
24633 (variable_initializer_list): Implement.
24634 (array_initializer): Make it a list of variable_initializers
24635 (opt_array_initializer): Modify accordingly.
24637 * expression.cs (New::NType): Add enumeration to help us
24638 keep track of whether we have an object/delegate creation
24639 or an array creation.
24640 (New:NewType, New::Rank, New::Indices, New::Initializers): New
24641 members to hold data about array creation.
24642 (New:New): Modify to update NewType
24643 (New:New): New Overloaded contructor for the array creation
24646 * cs-parser.jay (array_creation_expression): Implement to call
24647 the overloaded New constructor.
24649 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
24651 * class.cs (TypeContainer::Constructors): Return member
24652 constructors instead of returning null.
24654 2001-08-26 Miguel de Icaza <miguel@ximian.com>
24656 * typemanager.cs (InitCoreTypes): Initialize the various core
24657 types after we have populated the type manager with the user
24658 defined types (this distinction will be important later while
24659 compiling corlib.dll)
24661 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24662 on Expression Classification. Now all expressions have a method
24663 `Resolve' and a method `Emit'.
24665 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24666 generation from working. Also add some temporary debugging
24669 2001-08-24 Miguel de Icaza <miguel@ximian.com>
24671 * codegen.cs: Lots of code generation pieces. This is only the
24672 beginning, will continue tomorrow with more touches of polish. We
24673 handle the fundamentals of if, while, do, for, return. Others are
24674 trickier and I need to start working on invocations soon.
24676 * gen-treedump.cs: Bug fix, use s.Increment here instead of
24679 * codegen.cs (EmitContext): New struct, used during code
24680 emission to keep a context. Most of the code generation will be
24683 * cs-parser.jay: Add embedded blocks to the list of statements of
24684 this block. So code generation proceeds in a top down fashion.
24686 2001-08-23 Miguel de Icaza <miguel@ximian.com>
24688 * statement.cs: Add support for multiple child blocks.
24690 2001-08-22 Miguel de Icaza <miguel@ximian.com>
24692 * codegen.cs (EmitCode): New function, will emit the code for a
24693 Block of code given a TypeContainer and its ILGenerator.
24695 * statement.cs (Block): Standard public readonly optimization.
24696 (Block::Block constructors): Link children.
24697 (Block::Child): Child Linker.
24698 (Block::EmitVariables): Emits IL variable declarations.
24700 * class.cs: Drop support for MethodGroups here, delay until
24702 (Method::): Applied the same simplification that I did before, and
24703 move from Properties to public readonly fields.
24704 (Method::ParameterTypes): Returns the parameter types for the
24705 function, and implements a cache that will be useful later when I
24706 do error checking and the semantic analysis on the methods is
24708 (Constructor::GetCallingConvention): Renamed from CallingConvetion
24709 and made a method, optional argument tells whether this is a class
24710 or a structure to apply the `has-this' bit.
24711 (Method::GetCallingConvention): Implement, returns the calling
24713 (Method::Define): Defines the type, a second pass is performed
24714 later to populate the methods.
24716 (Constructor::ParameterTypes): implement a cache similar to the
24717 one on Method::ParameterTypes, useful later when we do semantic
24720 (TypeContainer::EmitMethod): New method. Emits methods.
24722 * expression.cs: Removed MethodGroup class from here.
24724 * parameter.cs (Parameters::GetCallingConvention): new method.
24726 2001-08-21 Miguel de Icaza <miguel@ximian.com>
24728 * class.cs (TypeContainer::Populate): Drop RootContext from the
24731 (Constructor::CallingConvention): Returns the calling convention.
24732 (Constructor::ParameterTypes): Returns the constructor parameter
24735 (TypeContainer::AddConstructor): Keep track of default constructor
24736 and the default static constructor.
24738 (Constructor::) Another class that starts using `public readonly'
24739 instead of properties.
24741 (Constructor::IsDefault): Whether this is a default constructor.
24743 (Field::) use readonly public fields instead of properties also.
24745 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24746 track of static constructors; If none is used, turn on
24747 BeforeFieldInit in the TypeAttributes.
24749 * cs-parser.jay (opt_argument_list): now the return can be null
24750 for the cases where there are no arguments.
24752 (constructor_declarator): If there is no implicit `base' or
24753 `this', then invoke the default parent constructor.
24755 * modifiers.cs (MethodAttr): New static function maps a set of
24756 modifiers flags into a MethodAttributes enum
24757 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
24758 MethodAttr, TypeAttr to represent the various mappings where the
24759 modifiers are used.
24760 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
24762 2001-08-19 Miguel de Icaza <miguel@ximian.com>
24764 * parameter.cs (GetParameterInfo): Fix bug where there would be no
24767 * interface.cs (PopulateIndexer): Implemented the code generator
24768 for interface indexers.
24770 2001-08-17 Miguel de Icaza <miguel@ximian.com>
24772 * interface.cs (InterfaceMemberBase): Now we track the new status
24775 (PopulateProperty): Implement property population. Woohoo! Got
24776 Methods and Properties going today.
24778 Removed all the properties for interfaces, and replaced them with
24779 `public readonly' fields.
24781 2001-08-16 Miguel de Icaza <miguel@ximian.com>
24783 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24784 initialize their hashtables/arraylists only when they are needed
24785 instead of doing this always.
24787 * parameter.cs: Handle refs and out parameters.
24789 * cs-parser.jay: Use an ArrayList to construct the arguments
24790 instead of the ParameterCollection, and then cast that to a
24793 * parameter.cs: Drop the use of ParameterCollection and use
24794 instead arrays of Parameters.
24796 (GetParameterInfo): Use the Type, not the Name when resolving
24799 2001-08-13 Miguel de Icaza <miguel@ximian.com>
24801 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24802 and instead use public readonly fields.
24804 * class.cs: Put back walking code for type containers.
24806 2001-08-11 Miguel de Icaza <miguel@ximian.com>
24808 * class.cs (MakeConstant): Code to define constants.
24810 * rootcontext.cs (LookupType): New function. Used to locate types
24813 2001-08-08 Miguel de Icaza <miguel@ximian.com>
24815 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
24816 this System.Reflection code is. Kudos to Microsoft
24818 * typemanager.cs: Implement a type cache and avoid loading all
24819 types at boot time. Wrap in LookupType the internals. This made
24820 the compiler so much faster. Wow. I rule!
24822 * driver.cs: Make sure we always load mscorlib first (for
24823 debugging purposes, nothing really important).
24825 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
24826 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
24828 * rootcontext.cs: Lookup types on their namespace; Lookup types
24829 on namespaces that have been imported using the `using' keyword.
24831 * class.cs (TypeContainer::TypeAttr): Virtualize.
24832 (Class::TypeAttr): Return attributes suitable for this bad boy.
24833 (Struct::TypeAttr): ditto.
24834 Handle nested classes.
24835 (TypeContainer::) Remove all the type visiting code, it is now
24836 replaced with the rootcontext.cs code
24838 * rootcontext.cs (GetClassBases): Added support for structs.
24840 2001-08-06 Miguel de Icaza <miguel@ximian.com>
24842 * interface.cs, statement.cs, class.cs, parameter.cs,
24843 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24844 Drop use of TypeRefs, and use strings instead.
24846 2001-08-04 Miguel de Icaza <miguel@ximian.com>
24850 * class.cs (Struct::Struct): set the SEALED flags after
24851 checking the modifiers.
24852 (TypeContainer::TypeAttr): new property, returns the
24853 TypeAttributes for a class.
24855 * cs-parser.jay (type_list): Oops, list production was creating a
24856 new list of base types.
24858 * rootcontext.cs (StdLib): New property.
24859 (GetInterfaceTypeByName): returns an interface by type name, and
24860 encapsulates error handling here.
24861 (GetInterfaces): simplified.
24862 (ResolveTree): Encapsulated all the tree resolution here.
24863 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24866 * driver.cs: Add support for --nostdlib, to avoid loading the
24867 default assemblies.
24868 (Main): Do not put tree resolution here.
24870 * rootcontext.cs: Beginning of the class resolution.
24872 2001-08-03 Miguel de Icaza <miguel@ximian.com>
24874 * rootcontext.cs: Provide better error reporting.
24876 * cs-parser.jay (interface_base): set our $$ to be interfaces.
24878 * rootcontext.cs (CreateInterface): Handle the case where there
24879 are no parent interfaces.
24881 (CloseTypes): Routine to flush types at the end.
24882 (CreateInterface): Track types.
24883 (GetInterfaces): Returns an array of Types from the list of
24884 defined interfaces.
24886 * typemanager.c (AddUserType): Mechanism to track user types (puts
24887 the type on the global type hash, and allows us to close it at the
24890 2001-08-02 Miguel de Icaza <miguel@ximian.com>
24892 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24893 RecordInterface instead.
24895 * cs-parser.jay: Updated to reflect changes above.
24897 * decl.cs (Definition): Keep track of the TypeBuilder type that
24898 represents this type here. Not sure we will use it in the long
24899 run, but wont hurt for now.
24901 * driver.cs: Smaller changes to accomodate the new code.
24903 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24906 * rootcontext.cs (CreateInterface): New method, used to create
24907 the System.TypeBuilder type for interfaces.
24908 (ResolveInterfaces): new entry point to resolve the interface
24910 (CodeGen): Property, used to keep track of the code generator.
24912 2001-07-26 Miguel de Icaza <miguel@ximian.com>
24914 * cs-parser.jay: Add a second production for delegate_declaration
24917 (enum_body): Put an opt_comma here instead of putting it on
24918 enum_body or enum_member_declarations so we can handle trailing
24919 commas on enumeration members. Gets rid of a shift/reduce.
24921 (type_list): Need a COMMA in the middle.
24923 (indexer_declaration): Tell tokenizer to recognize get/set
24925 * Remove old targets.
24927 * Re-add the parser target.
24929 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24931 * cs-parser.jay: Add precendence rules for a number of operators
24932 ot reduce the number of shift/reduce conflicts in the grammar.
24934 2001-07-17 Miguel de Icaza <miguel@ximian.com>
24936 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24939 Get rid of old crufty code.
24941 * rootcontext.cs: Use this to keep track of the parsed
24942 representation and the defined types available to the program.
24944 * gen-treedump.cs: adjust for new convention.
24946 * type.cs: Split out the type manager, and the assembly builder
24949 * typemanager.cs: the type manager will live here now.
24951 * cil-codegen.cs: And the code generator here.
24953 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
24955 * makefile: Fixed up for easy making.
24957 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24959 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24962 (unary_expression): Expand pre_increment_expression and
24963 post_decrement_expression to reduce a shift/reduce.
24965 2001-07-11 Simon Cozens
24967 * cs-tokenizer.cs: Hex numbers should begin with a 0.
24969 Improve allow_keyword_as_indent name.
24971 2001-06-19 Miguel de Icaza <miguel@ximian.com>
24973 * Adjustments for Beta2.
24975 2001-06-13 Miguel de Icaza <miguel@ximian.com>
24977 * decl.cs: Added `Define' abstract method.
24978 (InTransit): new property, used to catch recursive definitions.
24980 * interface.cs: Implement `Define'.
24982 * modifiers.cs: Map Modifiers.constants to
24983 System.Reflection.TypeAttribute flags.
24985 * class.cs: Keep track of types and user-defined types.
24986 (BuilderInit): New method for creating an assembly
24987 (ResolveType): New function to launch the resolution process, only
24988 used by interfaces for now.
24990 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24991 that are inserted into the name space.
24993 2001-06-08 Miguel de Icaza <miguel@ximian.com>
24995 * ARGH. I have screwed up my tree so many times due to the use of
24996 rsync rather than using CVS. Going to fix this at once.
24998 * driver.cs: Objetify driver. Load assemblies, use assemblies to
25001 2001-06-07 Miguel de Icaza <miguel@ximian.com>
25003 * Experiment successful: Use System.Type rather that our own
25006 2001-05-25 Miguel de Icaza <miguel@ximian.com>
25008 * cs-parser.jay: Removed nsAliases from here.
25010 Use new namespaces, handle `using XXX;'
25012 * namespace.cs: Reimplemented namespace handling, use a recursive
25013 definition of the class. Now we can keep track of using clauses
25014 and catch invalid using clauses.
25016 2001-05-24 Miguel de Icaza <miguel@ximian.com>
25018 * gen-treedump.cs: Adapted for all the renaming.
25020 * expression.cs (Expression): this class now has a Type property
25021 which returns an expression Type.
25023 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25024 `Type', as this has a different meaning now in the base
25026 2001-05-22 Miguel de Icaza <miguel@ximian.com>
25028 * interface.cs, class.cs: Removed from all the sources the
25029 references to signature computation, as we can not do method
25030 signature computation during the parsing time, as we are not
25031 trying to solve at that point distinguishing:
25035 void a (NS.Blah x) {}
25038 Which depending on the context might be valid or not, as we do not
25039 know if Blah is the same thing as NS.Blah at that point.
25041 * Redid everything so the code uses TypeRefs now instead of
25042 Types. TypeRefs are just temporary type placeholders, that need
25043 to be resolved. They initially have a pointer to a string and the
25044 current scope in which they are used. This is used later by the
25045 compiler to resolve the reference to an actual Type.
25047 * DeclSpace is no longer a CIR.Type, and neither are
25048 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
25049 are all DeclSpaces, but no Types.
25051 * type.cs (TypeRefManager): This implements the TypeRef manager,
25052 which keeps track of all the types that need to be resolved after
25053 the parsing has finished.
25055 2001-05-13 Miguel de Icaza <miguel@ximian.com>
25057 * ARGH. We are going to have to store `foreach' as a class rather
25058 than resolving it, as we need to verify error 1579 after name
25059 resolution. *OR* we could keep a flag that says `This request to
25060 IEnumerator comes from a foreach statement' which we can then use
25061 to generate the error.
25063 2001-05-10 Miguel de Icaza <miguel@ximian.com>
25065 * class.cs (TypeContainer.AddMethod): we now add methods to the
25066 MethodGroup instead of the method hashtable.
25068 * expression.cs: Add MethodGroup abstraction, which gets us one
25069 step closer to the specification in the way we handle method
25072 * cs-parser.jay (primary_expression): qualified_identifier now
25073 tried to match up an identifier to a local variable reference or
25074 to a parameter reference.
25076 current_local_parameters is now a parser global variable that
25077 points to the current parameters for the block, used during name
25080 (property_declaration): Now creates an implicit `value' argument to
25083 2001-05-09 Miguel de Icaza <miguel@ximian.com>
25085 * parameter.cs: Do not use `param' arguments as part of the
25086 signature, per the spec.
25088 2001-05-08 Miguel de Icaza <miguel@ximian.com>
25090 * decl.cs: Base class for classes, structs and interfaces. This
25091 is the "Declaration Space"
25093 * cs-parser.jay: Use CheckDef for checking declaration errors
25094 instead of having one on each function.
25096 * class.cs: Factor out some code for handling error handling in
25097 accordance to the "Declarations" section in the "Basic Concepts"
25098 chapter in the ECMA C# spec.
25100 * interface.cs: Make all interface member classes derive from
25101 InterfaceMemberBase.
25103 2001-05-07 Miguel de Icaza <miguel@ximian.com>
25105 * Many things: all interfaces are parsed and generated in
25106 gen-treedump. Support for member variables, constructors,
25107 destructors, properties, constants is there.
25109 Beginning of the IL backend, but very little done, just there for
25112 2001-04-29 Miguel de Icaza <miguel@ximian.com>
25114 * cs-parser.jay: Fix labeled statement.
25116 * cs-tokenizer.cs (escape): Escape " and ' always.
25117 ref_line, ref_name: keep track of the line/filename as instructed
25118 by #line by the compiler.
25121 2001-04-27 Miguel de Icaza <miguel@ximian.com>
25123 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25124 to match the values in System.CodeDOM.
25126 Divid renamed to Divide.
25128 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25130 (Statements.set): remove.
25132 * System.CodeDOM/CodeCatchClause.cs: always have a valid
25135 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25136 falseStatements always have valid values.
25138 * cs-parser.jay: Use System.CodeDOM now.