1 2007-02-20 Marek Safar <marek.safar@gmail.com>
3 * class.cs, report.cs: Capture more details when things go wrong.
5 2007-02-20 Marek Safar <marek.safar@gmail.com>
8 * cs-parser.jay: Anonymous container starts at constructor declaration
9 and not at block beginning because it has to be usable in constructor
12 * statement.cs: Use context location and not block one for error reporting.
14 2007-02-18 Marek Safar <marek.safar@gmail.com>
17 * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
20 2007-02-18 Marek Safar <marek.safar@gmail.com>
22 A fix for bug #80493 by Atsushi Enomoto
23 * cs-parser.jay: Ignore invalid attribute target.
25 2007-02-18 Marek Safar <marek.safar@gmail.com>
27 * cs-tokenizer.cs: Ignore '\0' as white space character.
29 2007-02-17 Miguel de Icaza <miguel@novell.com>
31 * cs-parser.jay: Add support for lambda expressions to the mcs
34 * lambda.cs: Only clone when we are probing, not on the final call
35 (Compatible is the final call).
37 * statement.cs (CloneContext): Introduce class to provide block
38 remapping during clone.
40 All statements Clone themselves now.
42 (Clone): special handling for blocks, when we clone a block, we
43 register the block inside this routine, as children of the block
44 might trigger a lookup.
46 * expression.cs: Add support for CloneContext in all expressions.
48 2007-02-17 Marek Safar <marek.safar@gmail.com>
51 * statement.cs: Report ambiguous warning when interfaces are not related.
53 2007-02-15 Marek Safar <marek.safar@gmail.com>
55 C# 3.0 extension methods.
57 * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
58 cannot be used directly.
60 * class.cs (Class.Emit): Emit extension attribute if any class method
62 (Method.Define): Add basic extension method validation conditions.
63 (Method.Emit): Emit extension attribute for method.
65 * codegen.cs (AssemblyClass): Emit extension attribute if at least one
66 extension method exists. Currently we follow same approach as Microsoft
67 does, emit even if a method or a class are private but this can change
70 * cs-parser.jay: Add handling of `this' keyword in method parameters
73 * decl.cs (DeclSpace.IsStaticClass): New property.
74 (MemberCache.FindExtensionMethods): Looks for extension methods with
75 defined name and extension type.
77 * doc.cs: Updated after OverloadResolve changes.
79 * driver.cs: Add new soft reference to System.Core.dll.
81 * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
82 (ExtensionMethodGroupExpr): Represents group of extension methods.
84 * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
85 BetterFunction, IsOverride, IsAncestralType, OverloadResolve
86 to MethodGroupExpr and made non-static for easier customization.
87 (Invocation.DoResolve): Add extension method lookup when no standard
89 (MemberAccess.DoResolve): Try extension methods if no member exists.
91 * modifiers.cs: Add METHOD_EXTENSION modifier.
93 * namespace.cs (RegisterExtensionMethodClass): Register class namespace
94 as well as candidate extension type.
95 (ComputeNamespaces): When assembly constains extension methods registers
97 (Namespace.RegisterExternalExtensionMethodClass): Register type for later
98 extension method lookup.
99 (Namespace.LookupExtensionMethod): Looks for extension method in this
101 (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
102 find a method which matches name and extensionType.
104 * parameter.cs (Parameter): Add This modifer.
105 (HasExtensionMethodModifier): New property.
106 (Resolve): Add extension parameter check.
107 (ModFlags): turned to property to exclude this modifier as it is not real
109 (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
111 * support.cs (ParameterData): Add ExtensionMethodType.
112 (ReflectionParameters): Implemented ExtensionMethodType interface property.
114 * typemanager.cs: Add type and ctor extension attribute type.
116 2007-02-15 Miguel de Icaza <miguel@novell.com>
118 * report.cs (DisableErrors, EnableErrors): used to prevent error
119 output when we are "trying" to compile various methods with
122 * ecore.cs (Expression): Add Clone method that calls the virtual
123 CloneTo method. The current CloneTo method in Expression throws
124 an exception so we can track down all the places where this must
125 be implemented (not using abstract, because that would be a lot of
126 up-front-work before we can start testing the implementation
129 Important: we only need Clone capabilities for expressions created
130 by the parser, as the expressions we will be cloning are
131 expressions in the pre-resolved state. This vastly simplifies
134 (SimpleName): Add CloneTo that does nothing.
135 (EmptyCast): Add CloneTo.
137 * expression.cs (Binary): Implement CloneTo.
138 (Invocation.IsApplicable): Store the current ec in
139 EmitContext.TempEc and restore it on return. This is used so we
140 do not have to sprinkle hundres of methods with an extra
141 EmitContext, we know that the only user is the lambda expression
142 ImplicitConversionExists code.
144 (Argument): Add Cloning capabilities.
145 (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
146 Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
147 ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
148 UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
149 IndexerAccess): Add Clone capability.
151 (LocalVariableReference, This): TODO: needs cloned Block mapping.
153 (Argument): Add cloning capability.
155 * assign.cs (Assign): Implement CloneTo.
157 * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
159 * lambda.cs (ImplicitStandardConversionExists): Implement lambda
160 version by calling Convert with the EmitContext (that we are
161 currently storing in ec, this is not great, but will do for now,
162 to avoid passing EmitContext parameters to hundreds of functions
163 that do not need them now).
165 (SetExpression): Remove, it is not needed.
167 (ContextualReturn): Implement CloneTo.
169 * statement.cs (Statement): Implement cloning infrastructure,
170 similar to expressions.
172 (Block): Partial implementation of Clone for statements.
174 (Return): Implement clone.
176 * constant.cs (Constant.CloneTo): New method, does nothing.
178 * codegen.cs (TempEc): Add a static EmitContext as a temporary
179 solution, until we decide how to exactly do this.
181 2007-02-14 Marek Safar <marek.safar@gmail.com>
184 * class.cs (FindOutBaseMethod): When the base accessor does not exist and
185 a property is override we need to use second accessor.
187 2007-02-13 Marek Safar <marek.safar@gmail.com>
190 * attribute.cs, class.cs: Use correct calling conventions for pinvoke
193 2007-02-13 Marek Safar <marek.safar@gmail.com>
195 Another fix for bug #80749
196 * pending.cs: Abstract class has priority over interfaces.
198 2007-02-13 Marek Safar <marek.safar@gmail.com>
200 Another fix for bug #80749
201 * pending.cs: Abstract class has priority over interfaces.
203 2007-02-13 Marek Safar <marek.safar@gmail.com>
205 Another fix for bug #80749
206 * pending.cs: Abstract class has priority over interfaces.
208 2007-02-13 Marek Safar <marek.safar@gmail.com>
210 Another fix for bug #80749
211 * pending.cs: Abstract class has priority over interfaces.
213 2007-02-13 Marek Safar <marek.safar@gmail.com>
215 * class.cs Better error message.
217 * driver.cs: Add shorter versions of -optimize option.
219 2007-02-13 Martin Baulig <martin@ximian.com>
221 * class.cs (Constructor.Emit): Check the return value of
222 ec.ResolveTopBlock() and return on error.
224 2007-02-13 Raja R Harinath <rharinath@novell.com>
226 * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
227 message to fix error message regression.
229 2007-02-12 Marek Safar <marek.safar@gmail.com>
231 * delegate.cs: Delegate creation expression cannot be of Nullable type.
233 2007-02-12 Marek Safar <marek.safar@gmail.com>
236 * assign.cs (FieldInitializer): FieldInitializer has to keep track of
237 its parent container.
239 * class.cs (DefineFieldInitializers): Each initializer can has different
244 2007-02-11 Miguel de Icaza <miguel@novell.com>
246 * lambda.cs (LambdaExpression.Compatible): Remove some early code,
247 now all the heavy lifting to check that embedded statements or
248 expressions have the right form is done in the ContextualReturn.
250 (ContextualReturn): New class.
252 * ecore.cs (Error_InvalidExpressionStatement): Make a helper
253 method that can be invoked to report 201, so we do not replicate
256 * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
258 * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
259 treating tabs as spaces.
261 2007-02-09 Marek Safar <marek.safar@gmail.com>
263 A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
264 * assign.cs: Use full implicit conversion for right side check.
266 2007-02-09 Marek Safar <marek.safar@gmail.com>
268 * statement.cs (Switch): Switch over boolean type is not standardized.
270 2007-02-08 Marek Safar <marek.safar@gmail.com>
273 * decl.cs (FindBaseEvent): Don't use method cache for events.
275 2007-02-07 Marek Safar <marek.safar@gmail.com>
277 * cs-parser.jay: Better syntax error handling.
279 * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
280 instead of underlying type value.
282 2007-02-06 Marek Safar <marek.safar@gmail.com>
284 * driver.cs: Check define identifier before is registered.
286 * namespace.cs: Use existing error message.
288 * report.cs: New warning.
290 2007-02-06 Marek Safar <marek.safar@gmail.com>
293 * expression.cs: Delegate Invoke method can be called directly.
295 2007-02-06 Marek Safar <marek.safar@gmail.com>
298 * class.cs (IsEntryPoint): The Main method can have params modifier.
300 2007-02-04 Miguel de Icaza <miguel@novell.com>
302 * parameter.cs (Parameter, Parameters): Add Clone method.
304 * anonymous.cs (Compatible): Turn method into virtual method, so
305 LambdaExpression can implement a different behavior.
307 (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
308 out the basic checking here, so it can be used by
311 * lambda.cs: Introduce "Compatible" function that will do the
314 2007-02-02 Marek Safar <marek.safar@gmail.com>
316 * attribute.cs: Unified one error message.
318 * class.cs (Class): Use type attributes and not properties to test static
320 (IsEntryPoint): Don's pass local variable.
322 * convert.cs: Removed duplicate check.
324 * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
326 * driver.cs: Don't crash when soft reference does not exist.
328 * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
329 (UsingEntry): Removed redundant allocation.
331 * parameter.cs: Add fast path for type parameters.
333 * support.cs: Don't allocate attribute when it's not used.
335 2007-01-30 Miguel de Icaza <miguel@novell.com>
338 (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
339 this into a virtual method, so we can override it in LambdaExpression.
341 * driver.cs: Improve diagnostics in case of failure.
343 * cs-tokenizer.cs: Instead of trying to parse a type and a name,
344 write a function that is slightly more complex and that parses:
346 type identifier [, type identifier]* )
348 The old function would return incorrectly a OPEN_PARENS_LAMBDA for
351 (canEmpty ? i >= 0 : i > 0)
353 2007-01-30 Raja R Harinath <rharinath@novell.com>
355 * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
356 exception on possibly valid code.
358 2007-01-29 Raja R Harinath <rharinath@novell.com>
360 * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
362 (parse_opt_type_arguments): Remove. It's almost the same as
364 (parse_namespace_or_typename): Use parse_less_than.
366 2007-01-28 Miguel de Icaza <miguel@novell.com>
368 * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
369 this bug took a few hours to find, because the state saved and
370 restored by PushPosition and PopPosition was ignoring the state of
371 parse_generic_less_than.
373 I can also now remove the handling of OP_LT and OP_GT, this solves
376 * cs-tokenizer.cs: store the location for the ARROW token, we use
379 (PushPosition, PopPosition): save/restore also `current_token',
380 restore `parse_generic_less_than' (was missing).
382 (parse_opt_type_arguments): use parse_type, not
383 parse_namespace_or_typename to parse types.
385 * lambda.cs: Empty new file, will eventually have the lambda
386 expression implementation.
388 * lambda.test: used to test the internal tokenizer.
390 * report.cs (FeatureIsNotISO1): Rename from
391 FeatureIsNotStandardized, because it was about the language level
392 (1 vs 2) it was not about standarization.
394 (FeatureRequiresLINQ): New.
396 * support.cs (SeekableStreamReader): Only require that the reader
397 is a TextReader, not a StreamReader, so we can plug StringReader.
399 * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
400 given position in the input stream the following tokens can be
401 parsed as a type followed by an identifier.
403 (is_punct): after a '(' if parse_type_and_parameter returns true,
404 then return a special token OPEN_PARENS_LAMBDA which is used to
405 avoid reduce/reduce errors in the grammar for the
406 lambda_expression rules.
408 (parse_type): implement a type parser inside the
409 tokenizer, the parser only returns true or false depending on
410 whether the input at a given position can be parsed as a type.
412 (peek_token): new method used during type parsing.
414 2007-01-28 Raja R Harinath <rharinath@novell.com>
417 * anonymous.cs (ScopeInfo.InflateParameters): New.
418 (AnonymousContainer.Resolve): Use it to redirect types of
421 2007-01-27 Raja R Harinath <rharinath@novell.com>
424 * expression.cs (Error_InvalidArguments): Don't use two different
425 messages for CS1503. Use ExtraInformation and
426 SymbolRelatedToPreviousError instead.
429 * decl.cs (DeclSpace.initialize_type_params): Don't access
430 'type_params' of a partial class directly.
432 2007-01-26 Miguel de Icaza <miguel@novell.com>
434 * constant.cs: Removed a handful of out-of-range checks that were
437 2007-01-25 Marek Safar <marek.safar@gmail.com>
439 * expression.cs (CheckUselessComparison): Add additional check for char
442 * namespace.cs: Fixed typo.
444 2007-01-23 Miguel de Icaza <miguel@novell.com>
446 * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
447 gone, instead we inline the test, preventing the needless casts to
448 longs, ulongs and doubles for the parameters, avoiding calls to
449 methods that overchecked stuff, and instead inlined things
452 2007-01-20 Marek Safar <marek.safar@gmail.com>
454 * cs-parser.jay: Better parameter error handling.
456 2007-01-17 Marek Safar <marek.safar@gmail.com>
458 A fix for bug #80368, #80522
459 * expression.cs (ArrayCreation.only_constant_initializers): Indicates
460 whether array initializer contains constants only.
461 (ArrayCreation.Emit): Use better formula to decide when
462 are array initializers for static initialization.
463 (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
464 have to emit even constants otherwise they are pre-initialized.
466 2007-01-17 Bill Holmes <bill.holmes@ansys.com>
467 Raja R Harinath <rharinath@novell.com>
469 Fix emit order of 'get' vs. 'set'.
470 * support.cs (Accessors): New.
471 * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
472 Note the order in which accessors are declared in the source.
473 * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
474 Refactored from Property.Define and Indexer.Define.
475 (PropertyBase.DefineAccessors): New helper that calls the above in
476 appropriate order as noted by the parser.
477 (Property.Define, Indexer.Define): Update to changes.
478 (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
480 2007-01-17 Raja R Harinath <rharinath@novell.com>
482 Fix cs0029-6.cs and gcs0029-2.cs (regression)
483 * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
484 there's an implicit conversion from the current type to the target
485 type before converting the underlying constant.
487 2007-01-16 Marek Safar <marek.safar@gmail.com>
489 * const.cs (ResolveValue): Updated after constant conversion was made more
492 * constant.cs (GetAttributableValue): constant to object conversion is
493 used for attributes only.
494 (IntConstant.ConvertImplicitly): Moved from convert to be used in all
495 constant conversions.
496 (LongConstant.ConvertImplicitly): Ditto.
498 * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
499 (ImplicitConversionStandard): Handle constant conversion as extra step.
500 It solves the issue when constant conversion was called indirectly like
501 inside array initializer and constant folding was skipped.
503 * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
506 * statement.cs(ImplicitConversionStandard): Updated after constant
507 conversion was made more generic.
509 2007-01-16 Sergey P. Kondratyev <se@unicom.tomica.ru>
511 * expression.cs (As.DoResolve): Use GenericConstraints instead of
512 Constraints, solves the problem where the compiler incorrectly
513 reported that a type parameter was not constrained to a class (Bug
516 2007-01-14 Marek Habersack <grendello@gmail.com>
518 * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
520 2007-01-14 Marek Safar <marek.safar@gmail.com>
523 * assign.cs (FieldInitializer): New class implements field
524 initializer statement.
526 * attribute.cs: Update after FieldMember rename.
528 * class.cs (PropertyBasedMember): New common class for property based
530 (InterfaceMemberBase): New base class for all members which can be used as
531 an interface members.
532 (MethodCore): Moved really common code to InterfaceMemberBase.
533 (Method.Define): Equal and GetHasCode detection is relevant for methods
535 (MethodData.Define): Don't assume that public event implements an
536 interface automatically.
537 (MethodData.DefineMethodBuilder): Issue an error even if only extern
539 (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
540 (FieldMember): Merged with FieldBase.
541 (EventProperty.AEventPropertyAccessor): New specialization to check whether
542 event extern modifier can be used.
543 (EventField.EventFieldAccessor): Moved event field specific code here.
544 (Event.AllowedModifiers): Even event can be extern.
545 (Event.FindOutBaseMethod): New override specific to events.
546 (Indexer.parameters): Reintroduce parameters because base class holds
547 only properties common data.
548 (Indexer.CheckForDuplications): Indexers are threated as methods so we
549 need do extra parameters check.
551 * const.cs: Update after FieldMember rename.
553 * decl.cs (MemberCache.FindBaseEvent): New method.
555 * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
556 to reflect that indexer is now derived from PropertyBased.
558 * ecore.cs (GetMemberType): Made public.
559 (EventExpr.ResolveMemberAccess): Use right event cache and checks for
562 * flowanalysis.cs, statement.cs: Update after FieldMember rename.
564 * typemanager.cs (CSharpSignature): Correctly print event accessors.
565 (RegisterEvent): Removed.
566 (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
567 (GetPrivateFieldOfEvent): Renamed to GetEventField.
569 2007-01-11 Raja R Harinath <rharinath@novell.com>
572 * statement.cs (CollectionForeach.TryType): Prefer generic
573 GetEnumerator over non-generic variant. Fix code to follow comments.
575 2007-01-09 Raja R Harinath <rharinath@novell.com>
578 * support.cs (ReflectionParameter): Don't use an invalid index on
579 the generic parameter data.
581 2007-01-08 Miguel de Icaza <miguel@novell.com>
583 * driver.cs: Just add a tiny bit of infrastructure.
585 2007-01-02 Marek Safar <marek.safar@gmail.com>
587 * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
588 where field type is struct from current assembly.
590 * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
593 2007-01-02 Marek Safar <marek.safar@gmail.com>
596 * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
599 * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
601 (Namespace.LookupType): Always use core types from corlib when speficied.
603 * report.cs: A new warning.
605 * rootcontext.cs (BootstrapCorlib_ResolveInterface,
606 BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
607 (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
609 * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
610 (InitCoreTypes): Set expression type of object_type and value_type
611 immediately after lookup.
613 2007-01-01 Miguel de Icaza <miguel@novell.com>
615 * cs-tokenizer.cs: Accept Pc class characters (Connector
616 Punctuation) as valid identifiers. Fixes #78259
618 * expression.cs (Invocation.DoResolve): Moved the check for the
619 use of `this' for doing method calls to the Invocation resolution
620 step, after overload resolution has taken place instead of doing
621 the check at the low-level `This.DoResolve' level.
623 The `This.DoResolve'Â happens before overload resolution, so it has
624 no way of knowing if the method that will be called will be
625 instace or static, triggering an erroneous report for cs0188 (Bug
628 We now do the check for instance method invocations after we know
629 what method will be called.
631 (This.CheckThisUsage): Move the actual use of this structure
632 checking into its own method and expose it.
634 * Everywhere that called Error_ValueCannotBeConverted: pass a new
637 Exceptions: Null.ConvertImplicitly,
638 Constant.ImplicitConversionRequired as there are too many call
639 sites for passing the ec.
641 * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
642 EmitContext, if the value is null, then we do not try to provide
643 the extra information from the error (If a userdefined conversion
644 exists, as UserDefinedConversion requires a non null-EmitContext).
648 2006-12-30 Raja R Harinath <rharinath@novell.com>
650 * flowanalysis.cs (MyBitVector): Document some invariants.
651 (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
652 introduced below, and add a couple of others,
654 2006-12-30 Marek Safar <marek.safar@gmail.com>
656 * attribute.cs (GetMethodObsoleteAttribute): Uses new
657 GetPropertyFromAccessor and GetEventFromAccessor.
659 * class.cs (MethodCore.CheckBase): A new warning when obsolete member
660 overrides non-obsolete one.
661 (Indexer.Define): Error message has been moved to the parser.
663 * cs-parser.jay: Better syntax errors handling.
665 * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
666 when an invocation has no arguments.
668 * ecore.cs: Removed not used caching.
670 * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
673 * report.cs: Add a new warning.
675 * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
677 * typemanager.cs (enumeration_type): Removed.
678 (CSharpSignature): Reuses IsSpecialMethod.
679 (IsEqual): Hack for MS BCL.
680 (GetPropertyFromAccessor): New method.
681 (GetEventFromAccessor): New method.
682 (IsSpecialMethod): Fixed to handle more cases.
684 2006-12-30 Marek Safar <marek.safar@gmail.com>
686 * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
687 Made white spaces array static.
689 * ecore.cs (RemoveGenericArity): Optimized.
691 * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
693 (MyBitVector.initialize_vector): Simplified.
695 2006-12-22 Miguel de Icaza <miguel@novell.com>
697 * ecore.cs: Am not entirely happy with this hack, but it seems to
698 address the issue in 80257 (a small test case for
701 I set the MethodGroupExpr.Type to an internal compiler type
702 (itself in this case) to force the resolution to take place. Why
703 it does not take place with a null is beyond me.
705 2006-12-20 Marek Safar <marek.safar@gmail.com>
708 * expression.cs (ResolveOperator): Consider user defined conversion for
709 logical and operator too.
710 (EmitBranchable): Optimization for logical and when full constant folding
711 could not be applied but one operand is constant.
713 2006-12-19 Marek Safar <marek.safar@gmail.com>
715 * class.cs (GetClassBases): Write 5 times every day, will never use
716 FullName for error reporting.
718 * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
720 2006-12-19 Martin Baulig <martin@ximian.com>
722 * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
723 the symbol file info here.
725 2006-12-18 Marek Safar <marek.safar@gmail.com>
727 * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
728 of `elseif' is taking then following sections are not taking.
729 Fixes an issue reported on mono mailing list.
731 2006-12-18 Marek Safar <marek.safar@gmail.com>
734 * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
735 a caller is not taking.
737 2006-12-18 Raja R Harinath <rharinath@novell.com>
739 * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
740 (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
741 (RootScopeInfo, AnonymousMethodMethod): Update to changes.
742 * iterator.cs: Change several TypeContainer declarations to DeclSpace.
743 * class.cs: Update to changes.
745 2006-12-17 Marek Safar <marek.safar@gmail.com>
748 * anonymous.cs (CompilerGeneratedClass): Register class in a shared
751 * class.cs (ResolveMembers): Register an iterator in current container and
754 2006-12-16 Raja R Harinath <rharinath@novell.com>
757 * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
758 satisfy a params annotated parameter.
760 2006-12-16 Marek Safar <marek.safar@gmail.com>
763 * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
764 paramters correctly and not rely on hacks in Parameters class.
765 (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
767 (Invocation.VerifyArgumentsCompat): Ditto.
768 (Invocation.EmitArguments): Changed to correctly emit params arguments at
771 * parameter.cs (HasParams): Don't assume that params is the last one.
773 * support.cs (ReflectionParameters.ctor): Look for params attribute
775 (ReflectionParameters.ParameterType): Removed hack when we returned last
776 parameter for out of range parameters.
777 (ParameterName, ParameterModifier): Ditto.
779 2006-12-14 Marek Safar <marek.safar@gmail.com>
782 * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
783 when assembly is not CLS compliant but type is. I have no idea why is this
786 * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
788 2006-12-13 Miguel de Icaza <miguel@novell.com>
790 * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
791 in struct constructors, they are basically no-ops.
793 2006-12-12 Marek Safar <marek.safar@gmail.com>
795 * cs-tokenizer.cs (Position): Save preprocessor status too.
797 2006-12-12 Marek Safar <marek.safar@gmail.com>
800 * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
802 2006-12-12 Marek Safar <marek.safar@gmail.com>
804 * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
806 (pp_expr): Report error for an invalid expression.
807 (handle_preprocessing_directive): Simplified; add more error checking.
809 2006-12-11 Marek Safar <marek.safar@gmail.com>
812 * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
815 2006-12-10 Marek Safar <marek.safar@gmail.com>
817 A fix for bugs #80093, and #75984
818 * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
819 logic, it seems to me as it worked before "by coincidence".
820 (xtoken): Simplified to use reworked handle_preprocessing_directive.
821 (cleanup): Enabled endif check.
823 2006-12-09 Marek Safar <marek.safar@gmail.com>
826 * statement.cs (CollectionForeach.TryType): Generics and non-generics
827 enumerators are never ambiguous.
829 2006-12-08 Raja R Harinath <rharinath@novell.com>
832 * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
834 2006-12-06 Marek Safar <marek.safar@gmail.com>
837 * class.cs (EventProperty.Define): Explicit implementation means
838 that an even is used.
840 2006-12-06 Marek Safar <marek.safar@gmail.com>
842 Fixes the operators implementation (part II)
844 * cfold.cs (DoConstantNumericPromotions): Renamed to
845 DoBinaryNumericPromotions and simplified.
846 (BinaryFold): Couple of conversion fixes; simplified.
848 * constant.cs, ecore.cs, literal.cs
849 (ToType): Renamed to ConvertImplicitly.
850 (Reduce): Renamed to ConvertExplicitly.
852 * class.cs, convert.cs: Updated.
854 * expression.cs: TryReduce doesn't throw an exception.
856 2006-12-01 Marek Safar <marek.safar@gmail.com>
859 * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
862 2006-11-30 Marek Safar <marek.safar@gmail.com>
864 Fixes unary operators implementation (part I)
867 * cfold.cs (Error_CompileTimeOverflow): Made internal
869 * const.cs (IConstant): Changed to use reference to constant and
871 Updated IConstant implementations.
873 * constant.cs (CreateConstant): New factory method.
874 Updated IConstant implementation.
876 * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
878 * ecore.cs: Updated to use CreateConstantReference.
880 * enum.cs: Reflects IConstant changes.
882 * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
884 * literal.cs (NullConstant): Change to be independently usable.
886 2006-11-29 Martin Baulig <martin@ximian.com>
888 * class.cs (Constructor.Emit): Correctly handle anonymous methods;
889 we need to emit the scope initializer before calling the base .ctor.
891 * anonymous.cs: Merged back from the new anonymous methods branch.
892 (AnonymousMethodHost): Renamed to `RootScopeInfo'.
894 * expression.cs (ParameterReference.DoResolveBase): Create a
895 "normal" ScopeInfo when capturing parameters rather than using the
896 root scope; this makes things work with anonymous methods having
900 (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
902 2006-11-22 Marek Safar <marek.safar@gmail.com>
905 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
906 check to a base class.
907 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
908 only when assembly has missing attribute.
911 2006-11-21 Marek Safar <marek.safar@gmail.com>
913 * cs-tokenizer.cs: Merged with gmcs version.
915 2006-11-20 Marek Safar <marek.safar@gmail.com>
918 * cs-parser.jay: Better error message when partial keyword is misplaced.
920 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
923 report.cs: CS1058 only applies to 2.0 profile (gmcs).
924 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
925 a RuntimeWrappedException by default.
927 2006-11-18 Marek Safar <marek.safar@gmail.com>
930 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
932 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
934 2006-11-18 Marek Safar <marek.safar@gmail.com>
936 * driver.cs, namespace.cs: Uses faster IndexOf version.
938 2006-11-17 Marek Safar <marek.safar@gmail.com>
941 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
943 (Operator.Define): Implicit/Explicit operator of same type is duplicate
944 even if internal name is different.
945 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
946 (UserDefinedConversion): Simplified as the operators cannot be internal.
947 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
949 (MethodLookup): Replaced EmitContext with parentType.
950 * expression.cs: Updated.
952 2006-11-09 Raja R Harinath <rharinath@novell.com>
954 * driver.cs (BadAssembly): Handle all the ugliness of
955 DefineDynamicAssembly.
957 2006-11-08 Raja R Harinath <rharinath@novell.com>
959 Address parts of #58244 -- most of what's left is in the runtime
960 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
961 CS1509 error checks, and handle them for all assembly loads, not
962 just the first invocation.
963 (LoadModule): Likewise. Move handling of 'adder_method' ...
964 * codegen.cs (AssemblyClass.AddModule): ... here.
966 2006-11-02 Marek Safar <marek.safar@gmail.com>
968 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
969 IEnumerable<T> is ambiguous.
971 2006-10-31 Marek Safar <marek.safar@gmail.com>
974 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
975 GetEnumerator is ambiguous.
977 * report.cs: Add new warning.
979 2006-10-29 Marek Safar <marek.safar@gmail.com>
982 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
983 to protected member can be nested type.
985 2006-10-28 Marek Safar <marek.safar@gmail.com>
988 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
989 to protected member must derive from current type.
991 2006-10-27 Marek Safar <marek.safar@gmail.com>
993 assign.cs: Reuses error method.
995 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
996 instead of type for constants.
997 (Expression.Error_ValueAssignment): Common error method.
999 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
1002 2006-10-27 Marek Safar <marek.safar@gmail.com>
1004 A fix for bug #79081
1005 * expression.cs (MemberAccess.DoResolve): Check nested type
1008 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
1010 * doc.cs : nested delegates were not handled. Fixed bug #79754.
1012 2006-10-26 Marek Safar <marek.safar@gmail.com>
1014 A fix for bug #76591
1015 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
1017 2006-10-26 Marek Safar <marek.safar@gmail.com>
1019 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
1020 type forwarder of the same type multiple times.
1022 2006-10-26 Raja R Harinath <rharinath@novell.com>
1025 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
1026 instance as an rvalue, even when we later resolve as an lvalue.
1028 2006-10-25 Martin Baulig <martin@ximian.com>
1030 * anonymous.cs: Fix #79673.
1032 2006-10-24 Marek Safar <marek.safar@seznam.cz>
1034 A fix for bug #79666
1035 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
1036 ignored when is optimized (= default value) as its value is already set.
1038 2006-10-23 Marek Safar <marek.safar@seznam.cz>
1040 A fix for bug #79724
1041 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
1042 TypeContainer for type lookup.
1044 2006-10-23 Marek Safar <marek.safar@seznam.cz>
1046 A fix for bug #79231
1047 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
1048 * expression.cs (OverloadResolve): Always convert type name for
1050 (ResolveNamespaceOrType): Don't confuse a nested type with any
1053 2006-10-18 Martin Baulig <martin@ximian.com>
1055 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
1057 2006-10-17 Miguel de Icaza <miguel@novell.com>
1059 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
1060 an int32, but requesting an int64 from the conversion
1062 2006-10-12 Martin Baulig <martin@ximian.com>
1065 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
1067 2006-10-12 Martin Baulig <martin@ximian.com>
1070 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
1072 2006-10-11 Miguel de Icaza <miguel@novell.com>
1074 * convert.cs: Remove broken code: I was doing the "Existance"
1075 tests for Implicit conversions.
1077 2006-10-10 Miguel de Icaza <miguel@novell.com>
1079 * convert.cs: Added one missing case in
1080 ImplicitStandardConversionExists uint64 to intptr.
1084 * typemanager.cs (uintptr_type): another core known type.
1086 * ecore.cs (OperatorCast): routine used to do cast operations that
1087 depend on op_Explicit. We could change some of the Decimal
1088 conversions to use this.
1090 This one has a probe mechanism that checks both types for an op_
1091 which it coudl be used to eliminate two classes: CastToDecimal
1092 and CastFromDecimal.
1094 * convert.cs: Implement the conversions documented in #59800
1096 2006-10-10 Martin Baulig <martin@ximian.com>
1098 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
1099 before RootScope.ResolveMembers().
1101 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
1102 `CurrentType' if appropriate.
1104 2006-10-09 Marek Safar <marek.safar@seznam.cz>
1106 A fix for bug #78568
1107 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
1108 when contains binary operators.
1109 * cs-parser.jay: Updated.
1111 2006-10-09 Martin Baulig <martin@ximian.com>
1114 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
1115 moved that into Define() and also do the other type parameter
1116 checks there. Fixes #79094. Added gtest-292.cs.
1119 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
1120 since that doesn't include type parameters; don't use `Ldelema'
1121 for type parameters. Fixes #78980. Added gtest-293.cs.
1123 2006-10-08 Marek Safar <marek.safar@seznam.cz>
1126 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
1127 conversion is allowed.
1129 2006-10-06 Marek Safar <marek.safar@seznam.cz>
1131 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
1132 error reporting when no error occurs.
1134 2006-10-06 Marek Safar <marek.safar@seznam.cz>
1136 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
1139 2006-10-06 Raja R Harinath <rharinath@novell.com>
1142 * class.cs (DefineTypeBuilder): Check circular dependencies before
1143 setting the parent of the TypeBuilder.
1144 (CheckRecursiveDefinition): Don't use 'BaseType', since
1145 it may not be valid until after DefineTypeBuilder. Use
1146 'base_type' instead.
1148 2006-10-04 Martin Baulig <martin@ximian.com>
1150 Merged the Anonymous Methods patch.
1152 * anonymous.cs, iterators.cs: The new anonymous methods code.
1154 * statement.cs (Variable): New public abstract class.
1155 (LocalInfo.Variable): New public property.
1156 (LocalInfo.ResolveVariable): New public method.
1157 (Block.Flags): Add `IsIterator'.
1158 (Block.AddVariable): Improved the CS0136 check.
1159 (Block.AnonymousChildren): New public property.
1160 (Block.AddAnonymousChild): New public method.
1161 (ToplevelBlock): Update to use the new anonymous method framework.
1162 (ToplevelBlock.ctor): `container' is now a `Block' and not a
1163 `ToplevelBlock'; this is required to correctly implement the
1165 (Fixed, Using): Use `TemporaryVariable' instead of directly
1166 creating the `LocalBuilder'.
1168 * parameter.cs (Parameter.ResolveVariable): New public method.
1169 (Parameters.ResolveVariable): Likewise.
1171 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
1173 * class.cs (TypeContainer): Replaced the `iterators' list and
1174 corresponding methods with a list of `CompilerGeneratedClass'es.
1175 (TypeContainer.ResolveMembers): New public method.
1176 (Method): `IIteratorContainer' has been replaced by
1179 * expression.cs (VariableReference): New public abstract base
1180 class for `LocalVariableReference', `ParameterReference' and
1183 * codegen.cs (EmitContext): Removed `capture_context',
1184 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
1185 (EmitContext.EmitThis): Removed.
1187 * cs-parser.jay: Replace `iterator_container' with
1190 2006-10-04 Martin Baulig <martin@ximian.com>
1192 * generic.cs (GenericMethod): Don't make this abstract.
1193 (Constraints.Clone): Added dummy implementation.
1195 2006-10-04 Raja R Harinath <harinath@gmail.com>
1198 * namespace.cs (LookForAnyGenericType): Avoid nullref on
1199 'declspaces'. Avoid allocating arrays willy-nilly.
1202 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
1203 cases out of the switch.
1205 2006-09-28 Marek Safar <marek.safar@seznam.cz>
1207 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
1208 message when non-generic type is used with the type arguments.
1209 * expression.cs: Updated.
1211 2006-09-28 Raja R Harinath <rharinath@novell.com>
1214 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
1215 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1216 Change semantics slightly. Don't insist on having only one
1217 temporary EmptyExpression -- just throttle the creation of new ones.
1220 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
1221 non-interfaces too. If no methods are found, don't try to create
1224 2006-09-28 Marek Safar <marek.safar@seznam.cz>
1226 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
1229 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
1230 us produce better error message.
1232 2006-09-27 Marek Safar <marek.safar@seznam.cz>
1234 * expression.cs (Binary.ResolveOperator): Warn about a side effect
1235 of the `|' operator.
1237 * report.cs: A new warning added.
1239 2006-09-27 Martin Baulig <martin@ximian.com>
1241 * generic.cs (GenericMethod): Don't make this abstract.
1243 2006-09-27 Martin Baulig <martin@ximian.com>
1246 (InternalErrorException): Added overloaded ctor taking a params array.
1248 2006-09-26 Marek Safar <marek.safar@seznam.cz>
1250 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
1251 Fixed the cases when same error was reported twice.
1253 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
1254 now report symbol information.
1256 2006-09-25 Martin Baulig <martin@ximian.com>
1258 * class.cs: Completely unified with the gmcs version.
1260 2006-09-25 Martin Baulig <martin@ximian.com>
1262 * typemanager.cs (TypeManager.IsNullableType): New public function.
1263 (TypeManager.IsNullableTypeOf): Likewise.
1264 (TypeManager.IsNullableValueType): Likewise.
1266 * class.cs (MethodCore): Added the `GenericMethod' argument from
1267 gmcs and also unified all classes derived from `MethodCore' with gmcs.
1269 2006-09-24 Raja R Harinath <harinath@gmail.com>
1271 * convert.cs: Unify with gmcs version.
1273 2006-09-24 Marek Safar <marek.safar@seznam.cz>
1275 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
1276 verify them as well.
1278 * report.cs: New warning.
1280 2006-09-24 Marek Safar <marek.safar@seznam.cz>
1282 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
1283 for anonymous block with out argument.
1285 2006-09-24 Marek Safar <marek.safar@seznam.cz>
1287 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
1288 not used private events only.
1290 2006-09-23 Marek Safar <marek.safar@seznam.cz>
1292 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
1294 * const.cs (Const.Define): Check for constant type.
1295 (Const.IsConstantTypeValid): Looks for valid constant types.
1297 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
1299 * ecore.cs (EmptyConstantCast): New common class for all constant based
1302 * expression.cs (Is.DoResolve): Handle null constant especially.
1303 (New.DoResolve): Check for new void().
1304 (MemberAccess.DoResolve): Cope with all kind of nulls.
1306 * literal.cs (NullConstant): Uses EmptyConstantCast.
1307 (NullDefault): Based on EmptyConstantCast.
1308 (NullLiteral): Uses EmptyConstantCast.
1310 * statement.cs (Block.ResolveMeta): Check for constant type.
1312 2006-09-22 Martin Baulig <martin@ximian.com>
1314 * delegate.cs, attribute.cs: Merged with the gmcs versions.
1316 2006-09-22 Raja R Harinath <rharinath@novell.com>
1318 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
1322 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
1323 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
1326 2006-09-22 Martin Baulig <martin@ximian.com>
1328 * ecore.cs: Merged with the gmcs version.
1330 * generic.cs (ConstructedType): New dummy class.
1331 (TypeArguments): Don't make this abstract.
1334 (TypeManager.IsGenericTypeDefinition): New method.
1335 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
1337 2006-09-22 Raja R Harinath <rharinath@novell.com>
1339 * expression.cs (ComposedCast): Check for arrays of TypedReference
1340 before creating the type, not after.
1342 2006-09-21 Marek Safar <marek.safar@seznam.cz>
1344 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
1345 after ToType change.
1347 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
1348 when constant must be implicitly convertible.
1350 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
1352 * ecore.cs (NullCast): Derives from NullConstant.
1354 * expression.cs (Is.DoResolve): Removed useless variables.
1355 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
1356 (New.Constantify): Add enum support.
1357 (MemberAccess.DoResolve): Add warning when accessing null constant or
1360 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
1363 * literal.cs (NullConstant): New abstract class with common
1364 functionality for all null specializations.
1365 (NullDefault): Represents default(X) when result can be
1367 (NullLiteral): Updated.
1369 * report.cs: Add new warning.
1371 2006-09-21 Martin Baulig <martin@ximian.com>
1373 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
1375 2006-09-21 Martin Baulig <martin@ximian.com>
1377 * generic.cs (GenericConstraints): New dummy class.
1378 (Constraints): Likewise.
1379 (TypeParameter): Likewise.
1380 (TypeParameterName): Likewise.
1381 (GenericMethod): Likewise.
1383 * typemanager.cs (TypeManager.GetGenericArguments): New method.
1385 * decl.cs: Merged with the gmcs version.
1387 2006-09-21 Raja R Harinath <rharinath@novell.com>
1389 * generic.cs (TypeParameter): Implement IMemberContainer.
1390 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
1392 * rootcontext.cs: Unify with gmcs version.
1394 * report.cs: Unify with gmcs version.
1395 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
1396 from gmcs/generics.cs.
1397 * generics.cs (TypeParameter): New dummy class.
1399 * support.cs: Unify with gmcs version.
1401 2006-09-20 Raja R Harinath <rharinath@novell.com>
1403 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
1404 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
1406 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
1407 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
1408 * mcs.exe.sources: Add generic.cs.
1410 * codegen.cs: Unify with gmcs version.
1412 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
1413 (EmitContext): Add GenericDeclContainer implementation.
1414 * decl.cs (MemberCore, DeclSpace): Likewise.
1415 * namespace.cs: Remove #ifdef GMCS_SOURCE.
1417 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
1418 MCS TypeManager has a corresponding dummy method.
1420 2006-09-19 Martin Baulig <martin@ximian.com>
1422 * expression.cs: Completely merged with the gmcs version.
1424 2006-09-19 Martin Baulig <martin@ximian.com>
1426 * expression.cs (Invocation): Merged with the gmcs version.
1427 (ArrayAccess.GetStoreOpcode): Likewise.
1429 2006-09-19 Martin Baulig <martin@ximian.com>
1432 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
1433 (TypeManager.IsGenericMethodDefinition): Likewise.
1435 2006-09-19 Martin Baulig <martin@ximian.com>
1438 (TypeManager.IsEqual): Moved the gmcs implementation here.
1439 (TypeManager.DropGenericTypeArguments): Likewise.
1440 (TypeManager.DropGenericMethodArguments): Likewise.
1441 (TypeManager.GetTypeArguments): Moved here from gmcs.
1442 (TypeManager.HasGenericArguments): Likewise.
1444 2006-09-19 Martin Baulig <martin@ximian.com>
1446 * expression.cs (Binary): Merged with the gmcs version.
1448 2006-09-19 Martin Baulig <martin@ximian.com>
1450 * expression.cs (Probe, As, Is): Merged with the gmcs version.
1452 2006-09-19 Martin Baulig <martin@ximian.com>
1454 * typemanager.cs: Merged with the gmcs version.
1456 2006-09-16 Raja R Harinath <rharinath@novell.com>
1458 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
1459 * driver.cs: Likewise.
1461 2006-09-16 Marek Safar <marek.safar@seznam.cz>
1464 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
1465 only if parent type is class.
1466 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
1469 2006-09-15 Marek Safar <marek.safar@seznam.cz>
1472 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
1474 * typemanager.cs(CSharpName): Converts NullType to null.
1476 2006-09-15 Martin Baulig <martin@ximian.com>
1479 (TypeManager.GetMethodName): Added mcs implementation.
1480 (TypeManager.IsEqual): Likewise.
1483 (SimpleName.RemoveGenericArity): Added dummy implementation.
1485 * pending.cs: Merged with the gmcs version.
1487 2006-09-15 Martin Baulig <martin@ximian.com>
1489 * statement.cs: Merge with the gmcs version.
1491 2006-09-15 Martin Baulig <martin@ximian.com>
1493 * statement.cs (Switch): Merge with the gmcs implementation
1494 (without nullables), which is newer.
1496 2006-09-15 Martin Baulig <martin@ximian.com>
1498 * statement.cs (Block.Variables): Make this public.
1499 (ToplevelBlock.Parameters): Make this a property.
1500 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
1502 2006-09-15 Martin Baulig <martin@ximian.com>
1504 * namespace.cs: Merge with the gmcs version.
1506 2006-09-15 Martin Baulig <martin@ximian.com>
1508 * decl.cs (MemberName): Minor code cleanups.
1510 2006-09-15 Martin Baulig <martin@ximian.com>
1512 * parameter.cs: Merge with the gmcs version.
1514 2006-09-15 Martin Baulig <martin@ximian.com>
1516 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
1517 and an error in mcs.
1519 2006-09-15 Martin Baulig <martin@ximian.com>
1521 * flowanalysis.cs: Merged from GMCS; added the generics code into
1522 a `GMCS_SOURCE' conditional so we can share this file.
1524 2006-09-08 Martin Baulig <martin@ximian.com>
1526 * typemanager.cs (TypeManager.interlocked_type): New public field.
1527 (TypeManager.int_interlocked_compare-exchange): New public field.
1528 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
1529 enumerator types here and call InitGenericCoreTypes().
1530 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
1531 after calling InitEnumUnderlyingTypes().
1534 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
1535 `classes_second_stage'.
1537 2006-09-14 Marek Safar <marek.safar@seznam.cz>
1539 * assign.cs, ecore.cs, expression.cs: Share error message text.
1540 * class.cs (FieldMember.Define): Check for varible of static type.
1541 * driver.cs (LoadAssembly): Uses error output for errors.
1542 * statement.cs: Updated.
1544 2006-09-08 Marek Safar <marek.safar@seznam.cz>
1546 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
1549 2006-09-07 Martin Baulig <martin@ximian.com>
1552 (MainDriver): Revert r62663 from Marek; see #70506 for details.
1554 2006-08-29 Miguel de Icaza <miguel@novell.com>
1556 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
1558 2006-08-17 Miguel de Icaza <miguel@novell.com>
1560 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
1561 #52019 and #79064, the use of the \uXXXX sequence in source code
1562 to represent unicode characters.
1564 2006-08-15 Marek Safar <marek.safar@seznam.cz>
1566 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
1568 * class.cs, ecore.cs, statement.cs: Merged to one error message.
1570 2006-08-13 Miguel de Icaza <miguel@novell.com>
1572 * assign.cs: Catch attempts to assign to a method groups in += and
1575 2006-08-13 Marek Safar <marek.safar@seznam.cz>
1578 * cs-parser.jay: Don't destroy current array type by typeof of array's.
1580 2006-08-12 Marek Safar <marek.safar@seznam.cz>
1582 * class.cs (Method.Define): Issue a warning when generic method looks like
1584 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
1587 2006-08-09 Marek Safar <marek.safar@seznam.cz>
1589 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
1591 * decl.cs (MemberCache.FindMembers): When container is interface we need to
1592 search all base interfaces as a member can be ambiguous.
1593 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
1594 Constructor member type filter.
1595 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
1596 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
1597 reporting for returned memberinfos.
1598 * report.cs: Updated.
1599 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
1600 version to work on all runtimes.
1601 (TypeManager.RealMemberLookup): Removed members filtering.
1603 2006-08-08 Raja R Harinath <rharinath@novell.com>
1605 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
1606 (PropertyExpr.EmitAssign): Likewise.
1607 * expression.cs (Indirection.EmitAssign): Likewise.
1608 (LocalVariableReference.EmitAssign): Likewise.
1609 (ParameterReference.EmitAssign): Likewise.
1610 (Invocation.EmitArguments): Likewise.
1611 (ArrayAccess.EmitAssign): Likewise.
1612 (IndexerAccess.EmitAssign): Likewise.
1613 (This.EmitAssign): Likewise.
1614 (ConditionalLogicalOperator.Emit): Likewise.
1617 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
1618 instead of ArrayList. If the hashtable has a LocalBuilder, don't
1619 leave it in after returning it.
1620 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
1622 2006-08-06 Marek Safar <marek.safar@seznam.cz>
1624 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
1627 2006-08-03 Raja R Harinath <rharinath@novell.com>
1629 Fix cs0146-3.cs and cs0146-4.cs.
1630 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
1631 enclosing types don't depend on the current type.
1633 2006-08-02 Raja R Harinath <rharinath@novell.com>
1636 * class.cs (TypeContainer.DoDefineMembers): Use
1637 FindBaseMemberWithSameName on Parent, since we're interested in
1638 whether we hide inherited members or not.
1639 (FindBaseMemberWithSameName): Make slightly more robust.
1641 Fix the non-generic testcase from #77396
1642 * decl.cs (DeclSpace.DeclContainer): Remove override.
1644 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
1645 declspaces for doppelgangers too.
1646 (UsingEntry): Implement IResolveContext.
1647 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
1648 'this' as the resolve context.
1649 (LocalAliasEntry): Likewise.
1651 Implement parts of #77403
1652 * roottypes.cs (RootDeclSpace): New. Used to represent the
1653 toplevel declaration space. Each namespace declaration introduces
1654 a "partial" root declaretion space.
1655 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
1656 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
1657 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
1658 from 'current_namespace.SlaveDeclSpace'.
1659 (namespace_declaration): Likewise.
1660 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
1661 check. It can't happen now.
1662 * decl.cs (DeclSpace.LookupType): Likewise.
1663 * driver.cs (MainDriver): Sanity check.
1665 2006-08-01 Raja R Harinath <rharinath@novell.com>
1667 * decl.cs (DeclSpace.FindNestedType): Remove.
1668 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
1669 LookupTypeContainer to get the container of the nested type.
1670 * class.cs (TypeContainer.FindNestedType): Make non-override.
1672 2006-07-31 Raja R Harinath <rharinath@novell.com>
1674 * decl.cs (DeclSpace.PartialContainer): Move field from ...
1675 * class.cs (TypeContainer.PartialContainer): ... here.
1676 (TypeContainer.AddBasesForPart): New helper.
1677 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
1679 * cs-parser.jay (current_class): Convert to DeclSpace.
1680 (struct_declaration, interface_declaration, class_declaration):
1681 Use AddBasesForPart instead of .Bases directly.
1682 * const.cs, iterators.cs: Update to changes.
1684 2006-07-28 Raja R Harinath <rharinath@novell.com>
1686 * class.cs (TypeContainer.AddMemberType): Rename from
1688 (TypeContainer.AddMember): Rename from AddToMemberContainer.
1689 (AddTypeContainer): New. Combine AddClassOrStruct and
1691 (AddPartial): Update. Add 'is_partial' argument.
1692 * roottypes.cs: Update to changes.
1693 * cs-parser.jay (push_current_class): New helper for handling
1694 current_container and current_class.
1695 (struct_declaration, interface_declaration, class_declaration):
1698 2006-07-26 Raja R Harinath <rharinath@novell.com>
1700 * roottypes.cs: Rename from tree.cs.
1702 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
1703 * tree.cs (Tree, ITreeDump): Remove types.
1704 * rootcontext.cs (tree, Tree): Remove fields.
1705 (root, ToplevelTypes): New.
1706 * *.cs: Update to rename.
1708 * tree.cs (Tree.RecordDecl): Remove.
1709 (RootTypes.AddToTypeContainer): Record the toplevel type in its
1711 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
1713 2006-07-23 Raja R Harinath <harinath@gmail.com>
1715 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
1716 DoFlowAnalysis and OmitStructFlowAnalysis here.
1717 (ec.With): Rename from WithUnsafe and generalize.
1718 (ec.WithCheckState): Remove. All users can be handled by 'With'.
1719 (ec.WithFlowAnalyis): New.
1720 * ecore.cs, expression.cs, statement.cs: Update.
1722 2006-07-22 Raja R Harinath <harinath@gmail.com>
1724 * statement.cs (Block.ResolveMeta): Simplify slightly.
1726 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
1727 multiple boolean fields. Convert InUnsafe, constant_check_state,
1728 check_state to flags.
1729 (CheckState, ConstantCheckState): Update.
1730 (InUnsafe): New read-only property.
1731 (FlagsHandle): Rename from CheckStateHandle and convert to handle
1733 (WithUnsafe): New helper similar to WithCheckState.
1734 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
1735 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
1737 2006-07-21 Raja R Harinath <rharinath@novell.com>
1739 Make comparisons use the same IL irrespective of whether they're
1740 in a 'checked' or 'unchecked' context: one of the issues in #78899
1741 * codegen.cs (EmitContext.CheckState): Make read-only property.
1742 (EmitContext.ConstantCheckState): Likewise.
1743 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
1744 helper that implement a save/restore stack for CheckState
1745 values. This is the only way to change check-state.
1746 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
1747 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
1748 (CheckedExpr.EmitBranchable): New forwarding method.
1749 (UnCheckedExpr): Likewise.
1750 * statement.cs (Block.ResolveMeta): Use WithCheckState.
1751 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
1752 (Checked.Resolve, checked.DoEmit): Likewise.
1754 2006-07-20 Miguel de Icaza <miguel@novell.com>
1756 * anonymous.cs: Cache the resolved anonymous delegate, and return
1757 this so that the ResolveTopBlock is only triggered once, not
1760 Currently we trigger ResolvetopBlock twice due to a first pass of
1761 argument check compatibility, and a second pass that does the
1764 2006-07-15 Marek Safar <marek.safar@seznam.cz>
1766 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
1768 * rootcontext.cs (Reset): Add helper_classes.
1770 2006-07-15 Marek Safar <marek.safar@seznam.cz>
1773 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
1776 2006-07-13 Miguel de Icaza <miguel@novell.com>
1778 * statement.cs (Lock): Handle expressions of type
1779 TypeManager.null_type specially. Fixes #78770
1781 2006-07-08 Marek Safar <marek.safar@seznam.cz>
1783 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
1786 2006-07-08 Marek Safar <marek.safar@seznam.cz>
1788 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
1789 for accessors as well.
1790 * ecore.cs (EventExpr): Add AccessorTable.
1792 2006-07-01 Marek Safar <marek.safar@seznam.cz>
1795 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
1796 for CS0122 where appropriate.
1797 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
1799 (Filter): Assembly can be null in the case of top level attributes.
1801 2006-06-25 Marek Safar <marek.safar@seznam.cz>
1805 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
1806 is done at global level.
1808 2006-06-24 Marek Safar <marek.safar@seznam.cz>
1810 A fix for #77002, Implemented TypeForwarder support.
1812 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
1813 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
1814 * typemanager.cs (): Add type_forwarder_attr_type.
1816 2006-06-24 Marek Safar <marek.safar@seznam.cz>
1818 * report.cs: Add CS0469 warning.
1820 2006-06-21 Martin Baulig <martin@ximian.com>
1822 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
1823 the `try'-block, so we also report CS0016 etc. there.
1825 2006-06-21 Martin Baulig <martin@ximian.com>
1828 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
1830 2006-06-21 Martin Baulig <martin@ximian.com>
1832 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
1833 also report CS1686 for parameters.
1835 2006-06-21 Martin Baulig <martin@ximian.com>
1837 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
1838 instead of an error if the value is not implicitly convertible to
1839 the switch types; fixes #77964.
1841 2006-06-21 Raja R Harinath <rharinath@novell.com>
1844 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
1845 FieldBuilder is null.
1848 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
1849 'left' and 'right' before error-checking.
1851 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
1853 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
1855 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
1856 (FieldExpr.DoResolve): likewise.
1857 (PropertyExpr.InstanceResolve): likewise.
1858 (EventExpr.InstanceResolve): likewise.
1860 2006-06-04 Marek Safar <marek.safar@seznam.cz>
1862 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
1863 attribute applicable tests for attribute argument.
1865 2006-06-02 Raja R Harinath <rharinath@novell.com>
1868 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
1869 (Binary.OverloadResolve_PredefinedIntegral): New.
1870 (Binary.OverloadResolve_PredefinedFloating): New.
1871 (Binary.OverloadResolve_PredefinedString): New.
1872 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
1873 Follow the standard more closely, and treat numeric promotions in
1874 terms of overload resolution.
1875 (Binary.CheckShiftArguments): Simplify.
1877 2006-06-01 Raja R Harinath <rharinath@novell.com>
1879 * flowanalysis.cs (MyBitVector): Simplify representation.
1880 (MyBitVector.Clone): Avoid allocating BitArray.
1881 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
1882 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
1883 (*): Update. Change all references to MyBitVector.And and
1884 MyBitVector.Or to &= and |=.
1886 2006-05-29 Raja R Harinath <rharinath@novell.com>
1889 * cs-parser.jay (formal_parameter_list): Extend the pattern below
1890 to param arguments too.
1892 2006-05-26 Miguel de Icaza <miguel@novell.com>
1894 * cs-parser.jay: Catch another parsing form for arglist being
1895 followed by other arguments. Fixes #78313.
1897 2006-05-24 Raja R Harinath <rharinath@novell.com>
1899 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1900 checking of out parameters to ...
1901 (FlowBranchingToplevel.Merge): ... here.
1902 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1903 set, propagate the origin upward, and only complain if there was
1905 (FlowBranchingException.AddContinueOrigin): Likewise.
1906 (FlowBranchingException.AddReturnOrigin): Likewise.
1907 (FlowBranchingException.AddGotoOrigin): Likewise.
1909 2006-05-23 Raja R Harinath <rharinath@novell.com>
1911 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1912 unreachable, skip it.
1913 (FlowBranchingException.Merge): Always propagate jumps, even if
1914 the finally block renders subsequent code unreachable.
1916 2006-05-18 Raja R Harinath <rharinath@novell.com>
1919 * statement.cs (Goto.Resolve): Move responsibility for resolving
1920 'goto' to FlowBranching.AddGotoOrigin.
1921 (Goto.SetResolvedTarget): New. Callback to set the
1922 LabeledStatement that's the target of the goto.
1923 (Goto.DoEmit): Use Leave instead of Br when crossing an
1924 unwind-protect boundary.
1925 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1926 LookupLabel and adjust to new semantics.
1927 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1928 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1929 Goto.SetResolvedTarget to update target.
1930 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1931 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1932 AddBreakOrigin & co. Delay propagation until ...
1933 (FlowBranchingException.Merge): ... this.
1935 * statement.cs (Block.Resolve): Always depend on flow-branching to
1936 determine unreachability. Kill workaround that originally emitted
1937 only one statement after an "unreachable" label (see infloop in
1940 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1941 This is still "wrong", but anything better would probably need a
1942 multi-pass algorithm.
1943 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1944 usage vector. Force current usage vector to be reachable, to
1945 optimistically signify backward jumps.
1946 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1948 (FlowBranchingLabeled.Merge): New. If no backward jump was
1949 detected, return the original salted-away usage vector instead,
1950 updated with appropriate changes. Print unreachable warning if
1952 * statement.cs (Block.Resolve): Don't print unreachable warning on
1953 a labeled statement.
1955 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
1957 * driver.cs: Pass filename without path to AssemblyBuilder's
1958 AddResourceFile. Fixes bug #78407.
1960 2006-05-17 Raja R Harinath <rharinath@novell.com>
1962 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1963 * flowanalysis.cs (FlowBranchingLabeled): ... here.
1964 (FlowBranching.MergeChild): Overwrite
1965 reachability information from Labeled branchings too.
1967 2006-05-16 Raja R Harinath <rharinath@novell.com>
1969 * statement.cs (Goto.Resolve): Merge jump origins here ...
1970 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1972 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1973 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
1974 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
1975 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1977 * statement.cs (Goto.Resolve): ... not here.
1978 (Goto.Emit): Remove CS1632 check.
1980 2006-05-14 Marek Safar <marek.safar@seznam.cz>
1982 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1985 2006-05-11 Raja R Harinath <rharinath@novell.com>
1987 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1988 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1989 (FlowBranchingException.Label): Likewise.
1991 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
1993 (MyBitVector.Or): Use it to avoid losing information (Count).
1994 (FlowBranching.MergeOrigins): Likewise.
1996 * flowanalysis.cs (UsageVector.IsDirty): Remove.
1997 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1998 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1999 (UsageVector.ToString): Simplify.
2000 (UsageVector.MergeSiblings): Move here from ...
2001 (FlowBranching.Merge): ... here.
2002 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
2005 2006-05-10 Raja R Harinath <rharinath@novell.com>
2007 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
2008 null bitvector is treated as all-true.
2010 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
2011 (MyBitVector): Rationalize invariants. 'vector != null' implies
2012 that we have our own copy of the bitvector. Otherwise,
2013 'InheritsFrom == null' implies all inherited bits are true.
2015 2006-05-09 Marek Safar <marek.safar@seznam.cz>
2017 * statement.cs (LocalInfo): Add IsConstant.
2018 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
2019 local variable for constants.
2021 2006-05-09 Raja R Harinath <rharinath@novell.com>
2023 * flowanalysis.cs (MyBitVector.Empty): New.
2024 (MyBitVector): Don't allow InheritedFrom to be null.
2025 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
2026 (UsageVector, FlowBranching): Update to changes.
2028 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
2029 recursion. The 'Parent == null' condition isn't sufficient for
2031 (FlowBranching.AddBreakOrigin): Likewise.
2032 (FlowBranching.AddContinueOrigin): Likewise.
2033 (FlowBranching.AddReturnOrigin): Likewise.
2034 (FlowBranching.StealFinallyClauses): Likewise.
2035 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
2036 (FlowBranching.CheckOutParameters): Likewise.
2037 (FlowBranchingToplevel): Terminate all the above recursions here.
2038 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
2039 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
2041 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
2043 (FlowBranchingToplevel): New. Empty for now.
2044 (FlowBranching.MergeTopBlock): Update.
2045 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
2046 branching for the anonymous delegate.
2047 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
2049 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
2050 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
2051 information at the start of the merge. Reorganize.
2053 2006-05-07 Marek Safar <marek.safar@seznam.cz>
2055 * class.cs (MethodData.Define): Method cannot implement interface accessor.
2057 2006-05-07 Marek Safar <marek.safar@seznam.cz>
2059 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
2060 to newly introduced ctor.
2062 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
2063 message to one place.
2064 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
2067 2006-05-07 Marek Safar <marek.safar@seznam.cz>
2069 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
2071 * ecore.cs (Expression.ResolveAsConstant): Updated.
2073 * statement.cs (ResolveMeta): Updated.
2075 2006-05-06 Marek Safar <marek.safar@seznam.cz>
2077 * cs-parser.jay: __arglist cannot be used in initializer.
2079 2006-05-06 Marek Safar <marek.safar@seznam.cz>
2082 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
2085 2006-05-05 Raja R Harinath <rharinath@novell.com>
2087 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
2088 (LabeledStatement): Add 'name' parameter.
2089 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
2090 (Block.AddLabel): Update to changes.
2091 * cs-parser.jay (labeled_statement): Likewise.
2093 * flowanalysis.cs (BranchingType.Labeled): New.
2094 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
2095 (FlowBranchingLabeled): New. Does nothing for now, but will
2096 eventually handle 'goto' flows.
2097 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
2098 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
2099 that's terminated ...
2100 (Block.Resolve): ... here.
2102 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
2103 (UsageVector.MergeFinallyOrigins): Likewise.
2104 (FlowBranching.InTryOrCatch): Likewise.
2105 (FlowBranching.AddFinallyVector): Likewise.
2106 (FlowBranchingException): Update to changes.
2109 * statement.cs (Return.Resolve): Move error checking to ...
2110 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
2111 (FlowBranchingException): Handle return origins like break and
2113 (FlowBranching.UsageVector.CheckOutParameters): Remove.
2115 2006-05-04 Marek Safar <marek.safar@seznam.cz>
2118 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
2121 2006-05-04 Marek Safar <marek.safar@seznam.cz>
2124 * class.cs (MethodData.Define): Do public accessor check only when method
2125 implements an interface.
2127 2006-05-04 Raja R Harinath <rharinath@novell.com>
2129 Remove special handling of 'break'
2130 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
2131 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
2132 (UsageVector.Break): Remove.
2133 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
2135 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
2137 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
2138 UsageVector.Breaks (). Don't set NeedsReturnLabel.
2140 2006-05-03 Marek Safar <marek.safar@seznam.cz>
2143 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
2144 be the interface member.
2146 2006-05-03 Marek Safar <marek.safar@seznam.cz>
2149 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
2150 for emitting small (int) values.
2152 2006-05-03 Raja R Harinath <rharinath@novell.com>
2155 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
2156 control-flow passes through the 'finally' after merging-in all the
2157 control-flows from 'try' and the 'catch' clauses.
2159 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
2160 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
2161 always true at the only non-recursive entry point.
2162 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
2163 FlowBranchingBreakable.
2164 (FlowBranchingLoop): Remove.
2165 * statement.cs (Return.DoResolve): Update to changes.
2168 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
2169 (FlowBranching.CreateBranching): Handle it: create a
2170 FlowBranchingContinuable.
2171 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
2172 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
2173 except that it handles the 'continue' command.
2174 (FlowBranching.UsageVector.MergeOrigins): Rename from
2176 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
2177 except that it overrides AddContinueOrigin.
2178 (FlowBranchingException): Override AddContinueOrigin, similar to
2180 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
2181 Create a new branching around the embedded statement.
2182 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
2183 control flow after the embedded statement.
2184 (Continue.Resolve): Move all error checking to AddContinueOrigin.
2186 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
2187 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
2188 FlowBranchingBreakable.
2189 (FlowBranchingSwitch): Remove.
2192 * statement.cs (Break.Resolve): Simplify. Move responsibility for
2193 error reporting to ...
2194 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
2195 Rename from 'AddBreakVector'. Add new location argument. Return
2196 a bool indicating whether the 'break' crosses an unwind-protect.
2197 (FlowBranchingException.AddBreakOrigin): Add.
2198 (FlowBranchingException.Merge): Propagate 'break's to surrounding
2199 flowbranching after updating with the effects of the 'finally'
2201 (FlowBranchingBreakable): New common base class for
2202 FlowBranchingLoop and FlowBranchingSwitch.
2204 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
2206 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
2208 2006-05-02 Raja R Harinath <rharinath@novell.com>
2210 * statement.cs (Do.Resolve): If the loop is infinite, set the
2212 (While.Resolve, For.Resolve): Set a barrier after the embedded
2213 statement. There's no direct control flow that goes from the end
2214 of the embedded statement to the end of the loop.
2215 * flowanalysis.cs (FlowBranching.Infinite): Remove.
2216 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
2217 above ensure that the reachability is correctly computed.
2219 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
2220 (UsageVector.MergeBreakOrigins): If the current path is
2221 unreachable, treat it as if all parameters/locals are initialized.
2222 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
2223 infinite loops before merging-in break origins.
2225 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
2226 (Reachability.Reachable): Split part into ...
2227 (Reachability.Unreachable): ... this. Simplify.
2228 (Reachability.IsUnreachable): Use 'Unreachable' instead.
2230 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
2231 (Reachability.SetThrowsSometimes): Likewise.
2232 (FlowBranchingBlock.MergeTopBlock): Don't compare against
2233 TriState.Always, use corresponding property.
2234 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
2235 (Block.Resolve): Likewise. Remove some redundant checks.
2237 2006-05-02 Raja R Harinath <harinath@gmail.com>
2239 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
2240 (Reachability.Meet): Don't bother checking AlwaysThrows --
2241 barrier is always set.
2242 (FlowBranchingBlock.Merge): Likewise.
2244 2006-05-01 Raja R Harinath <harinath@gmail.com>
2246 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
2247 checks for unreachable.
2249 2006-05-01 Marek Safar <marek.safar@seznam.cz>
2252 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
2254 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
2255 whether field is really assigned.
2257 2006-04-30 Raja R Harinath <harinath@gmail.com>
2259 * flowanalysis.cs (Reachability): Make 4-argument constructor
2261 (Reachability.Meet): Rename from 'And'. Remove static variant.
2262 (Reachability.Always): Rename from the highly misleading
2263 'Reachability.Never'.
2264 (FlowBranching.Merge): Update to changes. Mark an impossible
2265 situation with a 'throw'.
2266 (*): Update to changes.
2268 2006-04-29 Raja R Harinath <harinath@gmail.com>
2270 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
2272 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
2273 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
2274 (*): Update to changes.
2275 * statement.cs: Update to changes.
2277 2006-04-28 Marek Safar <marek.safar@seznam.cz>
2280 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
2282 2006-04-28 Raja R Harinath <harinath@gmail.com>
2284 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
2287 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
2288 argument to two arguments: an usage-vector and a bool. Move call
2289 to FlowBranching.Merge () ...
2290 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
2292 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
2293 handling of loop and switch reachability to ...
2294 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
2296 2006-04-27 Raja R Harinath <harinath@gmail.com>
2298 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
2299 handling to FlowBranchingLoop.InLoop.
2300 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
2302 2006-04-26 Marek Safar <marek.safar@seznam.cz>
2305 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
2306 anonymous method is allowed from AnonymousContainer here.
2308 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
2310 2006-04-24 Raja R Harinath <rharinath@novell.com>
2313 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
2315 2006-04-23 Marek Safar <marek.safar@seznam.cz>
2318 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
2319 (DoubleConstant.Reduce): Ditto.
2321 2006-04-23 Raja R Harinath <rharinath@novell.com>
2323 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
2324 Remove 'lvalue_right_side' argument. Move parts to ...
2325 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
2326 (LocalVariable.DoResolveLValue): ... these.
2328 2006-04-21 Raja R Harinath <rharinath@novell.com>
2331 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
2332 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
2333 (LocalVariableReference.DoResolveBase): Use it to implement new
2335 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
2336 (Argument.Resolve): Simplify. Move CS1510 check ...
2337 * ecore.cs (Expression.ResolveLValue): ... here.
2338 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
2339 (PropertyExpr.DoResolveLValue): Likewise.
2340 (FieldExpr.Report_AssignToReadonly): Likewise.
2341 (FieldExpr.DoResolve): Add 'out_access' argument. Use
2342 LValueMemberAccess or LValueMemberOutAccess on instance depending
2344 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
2345 DoResolve as appropriate.
2347 2006-04-20 Raja R Harinath <rharinath@novell.com>
2350 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
2351 implicit conversions on 'out' and 'ref' arguments.
2353 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
2354 improve clarity. Remove dead code.
2357 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
2358 (Catch.Resolve): Resolve VarBlock if it exists.
2360 2006-04-19 Miguel de Icaza <miguel@novell.com>
2362 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
2363 twice, this was some residual code, the enumerator was emitted
2364 properly in the two branche of if later.
2366 2006-04-19 Raja R Harinath <rharinath@novell.com>
2368 * expression.cs (Cast.ResolveLValue): Remove. The result of a
2369 cast is never an lvalue.
2370 (Cast.DoResolve, Cast.ResolveRest): Combine.
2371 (Argument.Emit): Simplify slightly. Move 'Expr is
2372 IMemoryLocation' check ...
2373 (Argument.Resolve): ... here.
2374 (Argument.Error_LValueRequired): Remove. Inline into only user.
2376 Simplifications. Fix cs0191-2.cs
2377 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
2378 CS1649 and CS1651 to ...
2379 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
2380 the actual selection of the error code and message to a lookup
2381 table. Add a dummy return value to simplify callsites.
2382 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
2383 readonly fields of other instances of the same type. Move CS0197
2385 * expression.cs (Argument.Resolve): ... here. Simplify code.
2386 Ensure that ec.InRefOutArgumentResolving is only set during LValue
2387 resolution of an out or ref argument. The code simplification
2388 above uses this invariant.
2390 2006-04-18 Raja R Harinath <rharinath@novell.com>
2392 Possibly fix #77752. Fix cs1690-[4-7].cs.
2393 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
2394 CheckMarshallByRefAccess. Drop parameter.
2395 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
2397 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
2399 * report.cs (AllWarnings): Add CS1690.
2400 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
2402 (LocalVariableReference.DoResolveBase): Update.
2404 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2406 * class.cs (MethodOrOperator): Moved common parts from method class.
2407 detect obsolete attributes.
2408 (Method.Define): Simplified as it reuses code from base.
2409 (Constructor.ValidAttributeTargets): Fixed issue found during
2411 (Destructor.ValidAttributeTargets): Fixed issue found during
2413 (Operator): Finished refactoring set off by #78020. Operator class is now
2414 ordinary method class.
2416 * anonymous.cs: Updated.
2418 * decl.cs (DeclSpace): Add IsGeneric
2420 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2422 * class.cs (Constructor.Emit): Don't emit the attributes twice.
2424 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2426 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
2427 detect obsolete attributes.
2428 (Method.CreateEmitContext): Moved to MethodOrOperator.
2430 2006-04-09 Marek Safar <marek.safar@seznam.cz>
2433 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
2434 customized exception to make crash detection easier.
2435 (MethodOrOperator): Started to work on new base class for methods and
2437 (Method): Derives from MethodOrOperator.
2438 (Constructor.Emit): Emits its own attributes.
2439 (AbstractPropertyEventMethod.Emit): Ditto.
2440 (Operator): Derives from MethodOrOperator, will refactor fully in extra
2442 (Operator.Emit): It's temporary more tricky than should be.
2444 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
2446 * report.cs (InternalErrorException): Add ctor with inner exception.
2448 2006-04-08 Marek Safar <marek.safar@seznam.cz>
2451 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
2454 2006-04-07 Marek Safar <marek.safar@seznam.cz>
2457 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
2460 2006-04-06 Marek Safar <marek.safar@seznam.cz>
2462 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
2463 attribute is present and Guid not.
2464 (Interface.ApplyAttributeBuilder): Ditto.
2466 * attribute.cs: Add error message.
2468 2006-04-06 Marek Safar <marek.safar@seznam.cz>
2472 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
2473 sources (it's composite) so hold them in extra array as they are used in
2474 Emit phase only. It worked in the previous versions by mistake.
2475 (Attribute.Emit): Emit attribute for more owners when exist.
2477 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
2478 it has now different behaviour.
2480 2006-04-04 Marek Safar <marek.safar@seznam.cz>
2482 * constant.cs (Constant.IsDefaultInitializer): New method.
2484 * class.cs: Updated.
2486 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
2487 re-initialize default values. It saves KBs almost for every assembly.
2488 Thanks Zoltan for the idea.
2489 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
2490 (ArrayCreation.DoResolve): Resolve only once.
2491 (ArrayCreation.Emit): Emit static initializer only when it is faster.
2492 (ArrayCreation.GetAttributableValue): Cope with optimized values.
2494 2006-04-03 Zoltan Varga <vargaz@gmail.com>
2496 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
2499 2006-04-01 Marek Safar <marek.safar@seznam.cz>
2501 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
2502 in an embedded statement too.
2504 2006-04-01 Raja R Harinath <rharinath@novell.com>
2507 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
2509 2006-04-01 Marek Safar <marek.safar@seznam.cz>
2513 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
2516 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
2518 2006-03-31 Marek Safar <marek.safar@seznam.cz>
2520 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
2523 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
2524 LocalTemporary change.
2526 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
2528 (ClassOrStruct.DefineFieldInitializers): Implemented static field
2529 initializers optimization.
2530 (ClassOrStruct.TypeAttr): Moved from modifiers.
2531 (Constructor.CheckBase): Don't crash when static ctor has parameters.
2532 (FieldBase.ResolveInitializer): Resolves initializer.
2533 (FieldBase.HasDefaultInitializer): New property.
2535 * cs-parser.jay: Removed message.
2537 * expression.cs (CompilerGeneratedThis): New specialization.
2539 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
2541 2006-03-28 Marek Safar <marek.safar@seznam.cz>
2543 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
2545 2006-03-27 Marek Safar <marek.safar@seznam.cz>
2547 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
2548 be now EnumConstants only.
2550 2006-03-27 Marek Safar <marek.safar@seznam.cz>
2552 * attribute.cs, driver.cs: Reset more caches.
2554 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2556 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
2558 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2560 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
2561 for easier reuse. Updated all overrides.
2562 (IntegralConstant): New base class for all integral constants.
2563 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
2564 of the constant range, report custom error.
2565 (UIntConstant.Reduce): Fixed uint conversion.
2567 * ecore.cs, literal.cs: Reduce updates.
2569 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2573 * class.cs (Constructor.Define): Removed extra if for default ctors.
2574 A patch from Atsushi Enomoto.
2576 2006-03-26 Marek Safar <marek.safar@seznam.cz>
2578 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
2579 GetAttributableValue.
2581 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
2584 * convert.cs (ImplicitConversionRequired): Error message moved to
2587 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
2588 automatic implicit conversion of an output value.
2589 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
2591 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
2593 (TypeOf.GetAttributableValue): Add extra handling for object type.
2595 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
2596 special error message.
2598 2006-03-25 Marek Safar <marek.safar@seznam.cz>
2600 * class.cs (Constructor.Emit): Don't crash when struct ctor is
2602 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
2603 compatible with MS runtime.
2605 2006-03-23 Marek Safar <marek.safar@seznam.cz>
2607 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
2608 attribute arguments here.
2610 * class.cs (Indexer.Define): The check was moved to attribute class.
2612 2006-03-22 Marek Safar <marek.safar@seznam.cz>
2614 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
2615 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
2618 2006-03-22 Raja R Harinath <rharinath@novell.com>
2620 Support ParameterDefaultValueAttribute in gmcs. Also applied to
2621 mcs to keep code differences small.
2622 * attribute.cs (Attribute.GetParameterDefaultValue): New.
2623 * typemanager.cs (parameter_default_value_attribute_type): New.
2624 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
2627 2006-03-21 Marek Safar <marek.safar@seznam.cz>
2629 * expression.cs (StringConcat.Append): Reverted back to no warning state.
2631 2006-03-21 Marek Safar <marek.safar@seznam.cz>
2633 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
2635 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
2638 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
2640 * doc-bootstrap.cs : fix build.
2642 2006-03-20 Marek Safar <marek.safar@seznam.cz>
2644 * expression.cs (StringConcat.Append): Issue a warning when empty string
2647 2006-03-20 Marek Safar <marek.safar@seznam.cz>
2649 * assign.cs (CompoundAssign.ResolveSource): Removed.
2651 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
2654 * class.cs (TypeContainer.FindMethods): Removed.
2655 (TypeContainer.CheckMemberUsage): Made static.
2657 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
2659 * constant.cs (CheckRange): Removed unused type argument.
2660 (CheckUnsigned): Removed unused type argument.
2662 * cs-parser.jay: Updated after MemberAccess clean up.
2663 Uses Length for empty string test.
2665 * cs-tokenizer.cs: Uses Length for empty string test.
2666 (IsCastToken): Made static.
2667 (is_hex): Made static.
2668 (real_type_suffix): Made static.
2670 * decl.cs (SetupCache): Made static.
2671 (OnGenerateDocComment): Removed unused ds argument.
2673 * delegate.cs (VerifyDelegate): Removed unused argument.
2675 * doc.cs: Uses Length for empty string test.
2677 * driver.cs: Uses Length for empty string test.
2679 * enum.cs (IsValidEnumType): Made static
2681 * expression.cs (EnumLiftUp): Removed unused argument.
2682 (ResolveMethodGroup): Ditto.
2683 (BetterConversion): Ditto.
2684 (GetVarargsTypes): Ditto.
2685 (UpdateIndices): Ditto.
2686 (ValidateInitializers): Ditto.
2687 (MemberAccess.ctor): Ditto.
2688 (GetIndexersForType): Ditto.
2690 * flowanalysis.cs: (MergeFinally): Removed unused argument.
2692 * iterators.cs: Updated after MemberAccess clean up.
2694 * location.cs: Uses Length for empty string test.
2696 * namespace.cs: Uses Length for empty string test.
2698 * report.cs (CheckWarningCode): Made static.
2700 * statement.cs (LabeledStatement): Removed unused argument.
2702 * typemanager.cs (FilterNone): Removed.
2704 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2706 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
2709 * class.cs: Updated.
2711 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2713 * cs-parser.jay.cs: __arglist is not allowed for delegates.
2715 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2719 * expression.cs (VerifyArgumentsCompat): Reverted to double error
2720 reporting, it's more tricky than I thought.
2722 2006-03-18 Marek Safar <marek.safar@seznam.cz>
2726 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
2728 (AnonymousMethod.ImplicitStandardConversionExists): New method.
2729 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
2730 Add more error reporting; Fixed issue with params.
2732 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
2734 * cs-parser.jay: AnonymousMethod requires host container.
2736 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
2738 2006-03-18 Raja R Harinath <harinath@gmail.com>
2740 * class.cs: Change 'TypeContainer ds' constructor argument to
2741 'DeclSpace parent'. Some classes were missed below due to
2742 different naming convention.
2744 * class.cs (MemberCore.Parent): Delete. This makes the
2745 ParentContainer changes below enforceable by the compiler.
2747 Treat pointers to enclosing declaration space as 'DeclSpace', not
2749 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
2750 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
2752 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
2754 (Block.AddThisVariable): Likewise.
2755 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
2756 (AbstractPropertyEventMethod.Emit): Likewise.
2757 (AbstractPropertyEventMethod.EmitMethod): Likewise.
2758 (GetMethod.Define, SetMethod.Define): Likewise.
2759 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
2760 (DelegateMethod.EmitMethod): Likewise.
2762 Fix regression test-partial-13.cs.
2763 Rationalize use of PartialContainer. Ensure that the partial
2764 class semantics can be tied to type-correctness, i.e., any
2765 violation will cause a compile error.
2766 * class.cs, const.cs: Access all fields that belong to class
2767 TypeContainer via ParentContainer. Arguments of EmitContexts and
2768 Resolve()-like functions still use 'Parent'.
2770 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
2771 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
2772 (PropertyMethod.CheckModifiers): Remove unused argument.
2773 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
2776 2006-03-17 Raja R Harinath <harinath@gmail.com>
2778 Make semantics of PartialContainer simpler.
2779 * decl.cs (DeclSpace.IsPartial): Remove.
2780 * class.cs (TypeContainer.IsPartial): Likewise.
2781 (TypeContainer..ctor): Set PartialContainer to point to self.
2782 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
2783 (TypeContainer.FindNestedType): Likewise.
2784 (MemberCore.ParentContainer): Simplify. Remove deprecation.
2786 2006-03-17 Marek Safar <marek.safar@seznam.cz>
2788 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2790 2006-03-15 Marek Safar <marek.safar@seznam.cz>
2792 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
2795 2006-03-15 Marek Safar <marek.safar@seznam.cz>
2797 * class.cs (Operator.Define): An error for base conversion was not
2800 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
2802 * iterator.cs : yield break is allowed in try statement which has
2803 catch clauses. Fixed bug #77767.
2805 2006-03-13 Marek Safar <marek.safar@seznam.cz>
2807 A fix for #77593, #77574.
2809 * class.cs (MethodCore.CheckBase): Another if for operator.
2811 2006-03-09 Marek Safar <marek.safar@seznam.cz>
2813 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
2816 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
2817 (DelegateCreation.ImplicitStandardConversionExists): New method for just
2820 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
2823 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
2824 Updated after another emitcontext usage was clean up. It should help us to
2825 synchronize with gmcs easier.
2827 2006-03-04 Marek Safar <marek.safar@seznam.cz>
2831 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
2832 (Event.Define): ditto
2833 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
2835 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
2836 Removed redundant code and set NewSlot for Invoke method too.
2838 * parameter.cs (Parameters.ctor): Add custom, type ctor.
2839 (Parameters.MergeGenerated): New method. Use this method when you merge
2840 compiler generated argument with user arguments.
2842 2006-03-03 Marek Safar <marek.safar@seznam.cz>
2844 * attribute.cs (ResolveAsTypeTerminal): Removed.
2846 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
2847 specialization for predefined types; 30% speed up.
2848 Finally placed obsolete check to right place.
2849 (Expression.ResolveType): Removed.
2851 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
2852 Updated after ResolveType was removed.
2854 * expression.cs (Cast.ctor): Check void cast.
2855 (Binary.ResolveAsTypeTerminal): Is never type.
2856 (Conditional.ResolveAsTypeTerminal): Is never type.
2858 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
2860 2006-03-01 Raja R Harinath <rharinath@novell.com>
2863 * expression.cs (ParameterReference.DoResolveBase): Change return
2865 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2869 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2872 * typemanager.cs (GetFullNameSignature): Don't nullref on
2873 protected accessors.
2875 2006-02-27 Marek Safar <marek.safar@seznam.cz>
2877 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
2878 these two separated members to simplify the code.
2879 (Attribute.Resolve): Refactored to use new fields and methods.
2880 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
2881 implemented obsolete attribute checking.
2882 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2883 implemented obsolete checking again. It look line never ending quest ;-)
2884 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2886 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2888 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2890 *class.cs (Property.Define): Add RegisterProperty call.
2892 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2893 argument groups (only 2).
2895 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2896 encoding expression to arguments.
2897 (Expression.ExprClassToResolveFlags): Just turned to property.
2899 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2900 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2901 optimized as well as implemented support for zero-length attributes.
2903 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2904 Add caching of PropertyInfo's.
2906 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2908 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2909 error multiple times.
2911 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2913 New partial class implementation.
2914 A fix for #77027, #77029, #77403
2916 * attribute.cs (Attributable): Made attributes protected.
2918 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2919 the replacements of ClassPart and PartialContainer.
2920 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2921 (TypeContainer.AddInterface): Ditto.
2922 (TypeContainer.AddPartial): The main method for partial classes. It checks
2923 for errors and merges ModFlags and attributes. At the end class is added to
2925 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2927 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2928 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2929 from the rest of partial classes.
2930 (TypeContainer.GetClassBases): Simplified.
2931 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2933 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2934 (TypeContainer.HasExplicitLayout): Uses Flags now.
2935 (PartialContainer): Removed.
2936 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2937 (StaticClass): Was merged with Class.
2938 (Class.GetClassBases): class and static class bases are verified here.
2939 (Class.TypeAttr): Added static attributes when class is static.
2940 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2941 (MemberBase): In some cases we need to call parent container for partial
2942 class. It should be eliminated but it's not easy now.
2944 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2946 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2947 partial classed to accumulate class comments.
2948 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2950 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2952 * driver.cs (MainDriver): Tree.GetDecl was removed.
2954 * modifiers.cs (Modifiers): Add partial modifier.
2956 * tree.cs (Tree.decl): Removed.
2957 (RootTypes): Started to use this class more often for root types
2960 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2964 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2965 external interface does not have an attribute.
2967 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2969 Another prerequisites for new partial classs implementation.
2971 * attribute.cs (Attribute.Equal): Implemented.
2972 (Attribute.Emit): Changed as attributes can be applied more than twice.
2973 (Attributes.Emit): Check for duplicate attributes here.
2975 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2976 as a parameter, clean-up.
2978 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2982 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2983 contains obsolete attribute check which can in some cases look for base
2984 type of current class which is not initialized yet.
2985 (TypeContainer.BaseType): Replacement of ptype.
2987 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2989 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2991 First of prerequisites for new partial classs implemention.
2993 * attribute.cs (Attributable): Extended by ResolveContext;
2994 Attributes finally have correct context for resolving in all cases.
2995 (AttachTo): Attribute owner is assigned here.
2997 * codegen.cs (IResolveContext): Introduce new interface to hold
2998 all information needed in resolving phase.
2999 (EmitContext): Implements IResolveContext; more clean-up needed here.
3001 * decl.cs (MemberCore): Implemented IResolveContext.
3003 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
3004 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
3005 parameter.cs, statement.cs, tree.cs, typemanager.cs:
3006 Refactored to use new IResolveContext instead of EmitContext; cleanup
3008 2006-02-06 Miguel de Icaza <miguel@novell.com>
3010 * codegen.cs (EmitScopeInitFromBlock): check here the
3011 capture_context, there is no need to make two calls to the
3014 * anonymous.cs: Add some debugging messages that might help me
3015 track other instances of this problem in the future (the
3016 regression of test 467).
3018 * cs-parser.jay: track the variable block, as we need to initalize
3019 any captured variables declared in this block for the "catch"
3020 portion of the "Try" statement.
3022 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
3023 scope initialization for captured variables.
3025 Also, move the emit for the variables after the block location has
3028 2006-02-06 Marek Safar <marek.safar@seznam.cz>
3030 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
3032 2006-02-02 Miguel de Icaza <miguel@novell.com>
3034 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
3035 commit yesterday, the initialization for the roots is necessary.
3036 What is not necessary is the scope activation.
3038 2006-02-02 Raja R Harinath <rharinath@novell.com>
3040 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
3041 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
3043 (Argument.Resolve): Remove CS0206 checks.
3045 2006-02-01 Miguel de Icaza <miguel@novell.com>
3047 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
3048 scopes for all the roots, the scopes will now be emitted when the
3049 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
3051 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
3052 code. This reduces a lot of existing cruft.
3054 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
3055 that the ScopeInfo is generated as we enter the scope, not at the
3056 time of use, which is what we used to do before.
3058 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
3059 every time a Block is about to be emitted if we have a
3062 2006-02-01 Raja R Harinath <rharinath@novell.com>
3064 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
3066 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
3068 * typemanager.cs (cons_param_array_attribute): Make private.
3069 (Reset): Set it to null.
3070 (InitCoreHelpers): Don't initialize it.
3071 (ConsParamArrayAttribute): New. Initialize it as needed.
3072 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
3074 2006-01-31 Miguel de Icaza <miguel@novell.com>
3076 * expression.cs: There might be errors reported during the
3077 selection of applicable methods. If there are errors, do not
3078 continue execution as it will lead the compiler to crash.
3080 2006-01-30 Miguel de Icaza <miguel@novell.com>
3082 * expression.cs: Member access is not allowed on anonymous
3083 methods. Fixes #77402.
3085 2006-01-30 Raja R Harinath <rharinath@novell.com>
3088 * cs-parser.jay (VariableDeclaration): Don't set
3089 current_array_type to null.
3090 (field_declaration, event_declaration, declaration_statement):
3091 Set it to null here.
3093 2006-01-28 Raja R Harinath <harinath@gmail.com>
3095 * typemanager.cs (GenericParameterPosition): New.
3098 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
3100 * doc.cs : To process "include" elements, first we should create
3101 another list than XmlNodeList, because it could result in node
3102 removal, which could result in that the XmlNodeList gives up
3105 (Also made code identical to gmcs again.)
3107 2006-01-25 Miguel de Icaza <miguel@novell.com>
3109 * ecore.cs: Introduce an error report that we were not catching
3110 before, if not silent, we must report the error. Gonzalo ran into
3113 2006-01-23 Miguel de Icaza <miguel@novell.com>
3115 A fix for bug: #76957
3117 * iterators.cs (MoveNextMethod.CreateMethodHost): call
3118 ComputeMethodHost before creating the method, this is a new
3121 * anonymous.cs (AnonymousContainer): Now we track all the scopes
3122 that this method references (RegisterScope). The actual scope
3123 where the method is hosted is computed with the ComputeMethodHost
3124 before we create the method.
3126 Moved the Deepest routine here.
3128 (AnonymousContainer.ComputeMethodHost): New routine used to
3129 compute the proper ScopeInfo that will host the anonymous method.
3131 (ScopeInfo): Deal with multiple roots. The problem was that we
3132 did not have a unique root where all ScopeInfos could be hanged
3133 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
3136 Remove AdjustMethodScope which is now computed at the end. Remove
3137 LinkScope which did a partial link, instead link all ScopeInfos
3138 before code generation from the new "LinkScopes" routine.
3140 Simplify all the Add* routines as they no longer need to maintain
3141 the tree, they just need to record that they are using variables
3144 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
3145 routines to produce the forest of ScopeInfo trees.
3147 * class.cs (TypeContainer.AppendMethod): This is just like
3148 AddMethod, but ensures that an interface implementation method
3149 (IEnumerable.XXX) is not inserted at the beginning of the queue of
3150 methods, but at the end.
3152 We use this functionality to ensure that the generated MoveNext
3153 method in the iterator class is resolved/emitted before the
3154 enumerator methods created.
3156 This is required because the MoveNext method computes the right
3157 ScopeInfo for the method. And the other methods will eventually
3158 need to resolve and fetch information computed from the anonymous
3161 2006-01-21 Raja R Harinath <harinath@gmail.com>
3162 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3165 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
3167 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
3168 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
3170 2006-01-18 Raja R Harinath <rharinath@novell.com>
3172 Fix #76656, cs0231-2.cs.
3173 * cs-parser.jay (formal_parameter_list): Make error case catch
3175 (parenthesized_expression_0): Add CS1026 check.
3176 (invocation_expression): Remove unused { $$ = lexer.Location }.
3178 2006-01-17 Raja R Harinath <rharinath@novell.com>
3181 * cs-parser.jay (statement_expression): Don't list out the
3182 individual statement-expressions. Convert syntax error into
3185 2006-01-16 Raja R Harinath <rharinath@novell.com>
3188 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
3189 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
3190 CheckIntermediateModification.
3191 (FieldExpr.DoResolve): Add new two-argument version that
3192 allows us to resolve the InstanceExpression as an lvalue.
3193 The one-argument variant is now just a wrapper.
3194 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
3195 Resolve the lhs as an lvalue if the it has a value type.
3196 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
3197 from Assign.DoResolve.
3198 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
3199 resolved as an lvalue.
3200 (PropertyExpr.DoResolve): Update.
3201 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
3202 has a value type. Move CS1612 check here from
3203 CheckIntermediateModification.
3204 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
3205 * expression.cs (EmptyExpression.OutAccess): New. Used as the
3206 'right_side' of a ResolveLValue on an 'out' argument.
3207 (EmptyExpression.LValueMemberAccess): New. Used as the
3208 'right_side' of a propagated ResolveLValue on a value type.
3209 (LocalVariableReference.DoResolveBase): Recognize
3210 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
3212 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
3213 EmptyExpression.Null.
3215 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
3217 * typemanager.cs : added IsGenericParameter(). In mcs it always
3219 * doc.cs : for generic parameters, use GenericParameterPosition,
3222 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
3224 * expression.cs: Fix Console.WriteLine ((this = x).foo);
3226 2006-01-12 Miguel de Icaza <miguel@novell.com>
3228 This fixes the problem where we used ldfld instead of ldflda to
3229 load the "THIS" pointer on captured parameters, when THIS is a
3230 value type. See bug #77205.
3232 * iterators.cs (CapturedThisReference.Emit): Pass false to
3233 EmitThis (we do not need the address).
3235 * codegen.cs (EmitThis): it needs to know whether we need the
3236 address of `this' or not. This is used by value types.
3238 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
3239 every other call passes false.
3241 2006-01-12 Raja R Harinath <rharinath@novell.com>
3244 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
3246 * expression.cs (Invocation.OverloadResolve): Update.
3247 (Invocation.DoResolve): Avoid double resolution of invocation.
3249 2006-01-11 Raja R Harinath <rharinath@novell.com>
3252 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
3253 unary negation of floating point types as 0-expr; negation cannot
3254 overflow in floating point types.
3257 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
3258 on operands of 'void' type.
3261 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
3262 and ExclusiveOr for boolean constants too.
3264 2006-01-09 Raja R Harinath <rharinath@novell.com>
3267 * expression.cs (Invocation.OverloadResolve): Replace reflected
3268 override methods with their base virtual methods, rather than
3270 * typemanager.cs (TypeManager.GetOverride): New.
3272 2006-01-05 Jb Evain <jbevain@gmail.com>
3274 * class.cs (Property.Define, Indexer.Define): do not tag the
3275 properties as SpecialName | RTSpecialName.
3277 2006-01-04 Miguel de Icaza <miguel@novell.com>
3279 * class.cs (MethodCore.IsDuplicateImplementation): This method was
3280 doing a low-level comparission of parameter types. It was lacking
3281 a check for __argslist.
3283 2005-12-30 Miguel de Icaza <miguel@novell.com>
3285 * expression.cs (ParameterReference.DoResolveBase): Allow
3286 reference parameters if they are local to this block.
3288 This allows the ref and out parameters of a delegate to be used in
3289 an anonymous method, for example:
3291 delegate void set (out int x);
3293 set s = delegate (out int x){
3297 This is used by functionality introduced late in the C# language.
3299 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
3300 method that take ref and out parameters.
3302 Fixes #77119 which was a late change in the spec.
3304 2005-12-23 Miguel de Icaza <miguel@novell.com>
3306 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
3307 parent if its the same scope. Fixes #77060.
3309 2005-12-21 Miguel de Icaza <miguel@novell.com>
3311 * driver.cs: Report the case of no source files and no -out:
3314 2005-12-20 Raja R Harinath <rharinath@novell.com>
3317 * expression.cs (ComposedCast.GetSignatureForError): Define.
3319 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3323 * namespace.cs (NamespaceEntry): Add extern_aliases as a
3324 ListDictionary, to contain the ExternAliasEntry entries (in
3325 addition to the NamespaceEntry.aliases hashtable). This field is
3326 shared between the original entry and its doppelganger (bodyless
3328 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
3329 extern_aliases field.
3330 (NamespaceEntry.Lookup): Move the IsImplicit check after the
3331 lookup in extern_aliases.
3333 2005-12-16 Raja R Harinath <rharinath@novell.com>
3336 * class.cs (TypeContainer.Mark_HasEquals): New.
3337 (TypeContainer.Mark_HasGetHashCode): New.
3338 (ClassPart): Override them.
3339 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
3342 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
3343 'parent' argument to the base constructor.
3345 Remove all mention of TypeContainer from decl.cs.
3346 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
3347 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
3348 (DeclSpace.DeclSpace): Likewise.
3349 (DeclSpace.DefineMembers): Remove unused argument.
3350 * cs-parser.jay (pop_current_class): Update to changes. Simplify
3351 debugging check -- we don't care if the debug code throws an
3352 InvalidCastException instead of an InternalErrorException.
3353 * class.cs (TypeContainer.DefineMembers): Update to changes.
3354 (TypeContainer.DoDefineMembers): Likewise.
3355 (TypeContainer.GetMethods): Likewise.
3356 (PropertyMember.Define): Likewise.
3357 (MemberBase.Parent): New property that forwards to
3358 MemberCore.Parent, but ensures that we get a TypeContainer.
3359 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
3360 (RootContext.PopulateTypes): Likewise. Remove special case code
3361 for !RootContext.StdLib: DefineMembers is idempotent.
3363 2005-12-14 Miguel de Icaza <miguel@novell.com>
3365 * convert.cs (ExplicitConversionCore): Check the return value from
3366 ExplicitConversionCore which can return null on failure. Fixes #76914
3368 2005-12-13 Marek Safar <marek.safar@seznam.cz>
3370 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
3372 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
3374 * doc.cs : The search for referenced namespace was insufficient to
3375 get global one as it used to do. Fixed bug #76965.
3377 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
3379 * doc.cs : check name in cref in the last phase that whether it is
3382 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
3384 * cs-tokenizer.cs : reverted the latest change: it somehow broke
3387 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
3389 * doc.cs : so it turned out that we cannot skip override check for
3390 interface members. Fixed bug #76954.
3392 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
3394 * cs-tokenizer.cs : fixed bug #75984:
3395 - #warning and #error should not be handled when the source line
3397 - #line is not checked strictly when the source line is disabled.
3398 - #define and #undef is on the other hand checked strictly at any
3401 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
3403 * cs-tokenizer.cs : missing Location (actually, filename) in one of
3406 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3408 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
3410 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
3412 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
3413 (FieldBase.Initializer): Initializer is now optional.
3414 (EventField.Define): Only event field can have initializer.
3416 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
3418 * const.cs (Const): Reuse initializer.
3420 * cs-parser.jay: Updated after FieldBase changes.
3421 Added current_array_type to simplify array initializers.
3423 * ecore.cs (NullCast.IsDefaultValue): Implemented.
3425 * expression.cs, iterators.cs: Updated.
3427 * namespace.cs (NamespaceEntry): Made UsingFound private.
3429 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3431 * parameterCollection.cs: Obsolete, removed.
3432 * parser.cs: Obsolete, removed.
3434 2005-12-05 Marek Safar <marek.safar@seznam.cz>
3437 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
3439 * enum.cs (Enum.Define): Set obsolete context here.
3441 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
3444 - FindDocumentedMember() now expects 1) paramList as null
3445 when "we don't have to check the number of parameters" and
3446 2) Type.EmptyTypes when "there is no arguments".
3447 - Introduced FoundMember struct to hold the exact type which was
3448 used to find the documented member (the above change broke
3449 test-xml-044; it might be better just to use DeclaringType than
3450 what MS does, like this change does, but it depends on usage.)
3452 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
3454 * doc.cs : documented member might be from DeclaringType for nested
3455 types. Fixed bug #76782.
3457 2005-12-03 Ben Maurer <bmaurer@ximian.com>
3459 * anonymous.cs: Have the param code handle leaving copies on the
3460 stack etc. Allows anonymous params to take part in the assignment
3461 code (++, +=, etc). Fixes bug #76550
3463 * expression.cs: Handle the prepare_for_load/leave_copy by passing
3464 it down to the anon code.
3466 * iterators.cs: Use dummy var here
3468 * codegen.cs: Handle new vars
3470 2005-12-01 Marek Safar <marek.safar@seznam.cz>
3473 * class.cs (MethodData.Define): Set proper Obsolete context.
3475 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
3477 (FieldExpr.DoResolve): Ditto.
3479 2005-12-01 Marek Safar <marek.safar@seznam.cz>
3482 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
3483 parent is not obsolete.
3485 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
3487 * doc.cs : (FindDocumentedMember) find parameterless members first
3488 and get CS0419 in the early stage. Fixed first case of bug #76727.
3490 2005-11-30 Marek Safar <marek.safar@seznam.cz>
3493 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
3494 no error was reported.
3496 *expression.cs (Binary.DoResolve): left can be null.
3498 2005-11-22 Marek Safar <marek.safar@seznam.cz>
3501 * class.cs (MethodData.Emit): Parameters should be labeled first.
3503 2005-11-21 Marek Safar <marek.safar@seznam.cz>
3506 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
3508 2005-11-18 Marek Safar <marek.safar@seznam.cz>
3510 * attribute.cs (AreParametersCompliant): Moved to Parameter.
3512 * class.cs (MethodCore): Parameter clean up.
3513 (IMethodData): Added ParameterInfo.
3514 (MethodData): Parameter clean up.
3515 (Indexer.Define): Parameter clean up.
3527 * typemanager.cs: Parameter clean up.
3529 * delegate.cs (Define): Get rid of duplicated code.
3531 * expression.cs (ParameterReference): Removed useless parameters
3533 (Invocation): Ditto.
3535 * parameter.cs (ParamsParameter): New class, params specialization.
3536 (ArglistParameter): Attemp to separate arglist.
3537 (Parameter): Refactored to be reusable and faster.
3538 (Parameter.Modifier): Made understandable.
3539 (Parameters): Changed to be used as a class for `this' assembly
3540 parameters. Refactored to use new specialized classes.
3542 * support.cs (ParameterData): Added Types property.
3543 (InternalParameters): Deleted.
3545 2005-08-20 Martin Baulig <martin@ximian.com>
3547 Merging this patch from GMCS to fix #75867.
3549 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3550 scope if we don't already have it.
3552 2005-11-17 Martin Baulig <martin@ximian.com>
3555 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
3556 inherit the scope from our parent. Fixes #76653.
3558 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3560 * doc.cs : the previous patch does not actually fix the bug.
3561 PropertyInfo override check is now implemented and really fixed it.
3562 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
3564 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3566 * doc.cs : apply "override filter" also to properties.
3569 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
3571 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
3572 no need to check overrides. For classes, omit those results from
3573 interfaces since they must exist in the class. Fixed bug #76726.
3575 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3577 * typemanager.cs : (GetFullNameSignature) differentiate indexers
3578 with different parameters. Fixed the second problem in #76685.
3580 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3582 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3583 get expected 'protected' access in CheckValidFamilyAccess()).
3586 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
3588 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3589 Fixed bug #76705. CS1569 was incorrectly commented out.
3591 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3593 * doc.cs : use Invocation.IsOverride() to do real override check.
3594 * expression.cs : made Invocation.IsOverride() internal.
3596 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
3598 * doc.cs : use TypeManager.FindMembers() instead of (possible)
3599 TypeBuilder.FindMembers() and filter overriden base members out.
3602 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3604 * doc.cs : ref/out parameters are represented as '@' (instead of
3605 '&' in type FullName). Fixed bug #76630 (additionally crefs).
3607 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3609 * doc.cs : when there was no '.' in cref to methods in doc comment,
3610 then parameters were missing in the output. Fixed bug #76691.
3612 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3614 * driver.cs : don't output docs when there is an error.
3617 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3620 Now it should detect indexers. Fixed primary concern in bug #76685.
3621 Fixed CS0419 message to not show the identical member signature in
3624 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
3626 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3627 instead of Type.FindMembers() since it does not handle events.
3630 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
3632 * codegen.cs: Fixed typo (speficied -> specified).
3634 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3637 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3639 2005-11-11 Marek Safar <marek.safar@seznam.cz>
3641 * attribute.cs: Changed error message.
3643 * cs-tokenizer.cs: One more check.
3645 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3647 * statement.cs (Block.Resolve): Ignore empty statement.
3649 2005-11-10 Marek Safar <marek.safar@seznam.cz>
3651 * report.cs: Made error/warning methods more strict to avoid
3654 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3655 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3656 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3657 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3659 2005-11-08 Marek Safar <marek.safar@seznam.cz>
3661 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3662 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3664 * class.cs (TypeContainer.IsComImport): New property.
3665 (Constructor.Define): Create proper ctor for ComImport types.
3667 * expression.cs (New.CheckComImport): Fixed.
3669 2005-11-07 Miguel de Icaza <miguel@novell.com>
3671 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3672 that a parameter has been captured does not mean that we do not
3673 have to do the rest of the processing. This fixes the second part
3674 of #76592. If there was another anonymous method capturing
3675 values in the past, the Scope would never be set for the second
3676 method that captured the same parameter.
3678 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3679 properly manipulate the stack. Second part of fix for #76592.
3681 * expression.cs (New): Add support for invoking "new" on
3682 interfaces that have been flagged with the ComImport attribute and
3683 the CoClass. Fixes #76637
3685 * statement.cs (Try.DoEmit): When a variable is captured, do not
3686 try to emit the vi.LocalBuilder variable as it has been captured.
3687 Create a temporary variable and store the results on the
3688 FieldBuilder. Fixes #76642
3690 2005-11-07 Marek Safar <marek.safar@seznam.cz>
3692 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3694 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3696 * expression.cs (Binary.DoResolve): Added && optimalization.
3698 * typemanager.cs (AddUserType): Removed useless argument.
3700 2005-11-04 Marek Safar <marek.safar@seznam.cz>
3702 * statement.cs (Block.variables): Uses ListDictionary.
3704 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3707 * class.cs (PartialContainer.EmitType): Customized to emit
3708 security attributes.
3709 (ClassPart.ApplyAttributeBuilder): Transform security attribute
3710 for partial classes.
3712 2005-11-03 Marek Safar <marek.safar@seznam.cz>
3715 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3716 access has to be fixed.
3718 * typemanager.cs (IsUnmanagedType): Wrong common field type.
3720 2005-11-01 Marek Safar <marek.safar@seznam.cz>
3723 * ecore.cs (NullCast.Reduce): Implemented.
3725 * expression.cs (ArrayCreation.CheckIndices): Correcly check
3728 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3730 (Foreach.Resolve): Catch null properly.
3732 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3734 * cs-tokenizer.cs: Warning text fix.
3736 * driver.cs: AllWarningNumbers exposed on public interface.
3738 * report.cs (): Reviewed warning numbers.
3739 (IsValidWarning): Use binary search.
3741 2005-10-29 Marek Safar <marek.safar@seznam.cz>
3743 * driver.cs: Implemeted resource visibility.
3744 (Resources): New class for code sharing between /res: and
3747 2005-10-28 Marek Safar <marek.safar@seznam.cz>
3750 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3753 * convert (Convert.ImplicitReferenceConversion): NullCast holds
3756 * ecore.cs (NullCast): Child is contant only.
3758 * literal.cs (NullLiteral.Reduce): null can be converted to any
3761 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
3763 * driver.cs: Use Encoding.Default as default code page instead
3766 2005-10-27 Raja R Harinath <rharinath@novell.com>
3769 * expression.cs (Invocation.Error_InvalidArguments): Handle
3770 __arglist parameters.
3771 (Invocation.VerifyArgumentsCompat): Likewise.
3772 * support.cs (ReflectionParameters.GetSignatureForError): Print
3773 __arglist parameters.
3774 (InternalParamters.GetSignatureForError): Likewise.
3775 * parameter.cs (Parameters.GetSignatureForError): Likewise.
3777 2005-10-26 Marek Safar <marek.safar@seznam.cz>
3779 * attribute.cs (GetPropertyValue): Made public.
3781 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3783 Add new property WrapNonExceptionThrows to handle 2.0 assembly
3785 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3788 * driver.cs: Reflect method name change.
3790 * statement.cs (Try.Resolve): Warn when try has both general
3793 * typemanager.cs: runtime_compatibility_attr_type new predefined
3796 2005-10-26 Raja R Harinath <harinath@gmail.com>
3799 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3800 treat it as an empty parameter list.
3802 2005-10-26 Raja R Harinath <rharinath@novell.com>
3805 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
3806 ResolveAsTypeStep silent.
3807 * statement.cs (Block.AddConstant): Mark block as used.
3808 (Block.ResolveMeta): Avoid piling on error messages
3809 if a constant initializer resolution fails.
3811 2005-10-25 Raja R Harinath <rharinath@novell.com>
3813 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3815 (NamespaceEntry.VerifyAllUsing): New.
3816 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
3817 behaviour. Delegates actual resolution of alias to ...
3818 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
3819 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3821 * driver.cs (Driver.MainDriver): Update.
3823 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3824 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3826 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3828 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3829 RootNamespace.DefineNamespacesForAll.
3831 2005-10-24 Raja R Harinath <harinath@gmail.com>
3833 * typemanager.cs (assemblies, external_aliases, modules)
3834 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3835 (ComputeNamespaces, GetRootNamespace): Remove extra staging
3836 overhead. Move resposibility ...
3837 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
3838 * driver.cs, attribute.cs, codegen.cs: Update to changes.
3840 2005-10-23 Raja R Harinath <harinath@gmail.com>
3842 * namespace.cs (RootNamespace.all_namespaces): Renamed from
3843 cached_namespaces. Improve usage.
3844 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3845 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3846 Move from GlobalRootNamespace and simplify.
3847 (RootNamespace.Global): Make instance variable.
3848 (RootNamespace.RootNamespace): Add "alias name" parameter.
3849 (GlobalRootNamespace): Simplify drastically.
3850 (Namespace.Lookup): Don't use GetNamespace.
3851 * typemanager.cs (GetRootNamespace): Rename from
3852 ComputeNamespaceForAlias.
3853 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3855 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3857 * anonymous.cs (AnonymousContainer): Don't crash when container
3860 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3862 * expression.cs (Binary.DoResolve): Warn when comparing same
3865 2005-10-23 Marek Safar <marek.safar@seznam.cz>
3868 * expression.cs (Binary.DoResolve): It looks like there are no
3869 convetsion rules in enum context.
3871 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3873 Add support for extern alias qualifiers.
3874 * typemanager.cs: Move some LookupTypeReflection code
3875 to namespace.cs, to have cleaner code. Added some methods
3876 to help us keep track of the extern aliased references.
3877 * driver.cs: Add suport for extern alias assemblies on command
3878 line and check for their warnings/errors. Also keep track of the
3879 extern aliased assemblies.
3880 * namespace.cs: Move the global functionality of Namespace
3881 to GlobalRootNamespace/RootNamespace. Now the global namespace
3882 is GlobalRootNamespace.Globa. Also the code moved from
3883 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
3884 Finally added LocalAliasEntry (AliasEntry before) and
3885 ExternAliasEntry, to handle alias statements.
3886 * cs-parser.jay: Add support in the grammar for extern alias
3888 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
3889 Update callings to Namespace (now in GlobalRootNamespace).
3891 2005-10-18 Raja R Harinath <rharinath@novell.com>
3894 * class.cs (TypeContainer.DefineType): Move updating of
3895 topological sort earlier in the code.
3896 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3898 2005-10-18 Marek Safar <marek.safar@seznam.cz>
3901 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3903 * constant.cs (Constant.TryReduce): Moved from Cast class.
3904 (Reduce): Made little bit more OO and fixed missing conversions.
3906 * ecore.cs (Reduce): Implemented.
3907 (Binary.EnumLiftUp): New method to upgrade values to enum values.
3909 * literal.cs (Reduce): Implemented.
3911 * class.cs: Reverted Miguel's wrong commit.
3913 2005-10-14 Miguel de Icaza <miguel@novell.com>
3915 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3917 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
3919 * cs-parser.jay, expression.cs : CS0214 was missing error location
3920 for constants. Fixed bug #76404.
3922 2005-10-11 Marek Safar <marek.safar@seznam.cz>
3925 * convert.cs (ExplicitConversionCore): Fixed object->enum
3928 2005-10-10 Raja R Harinath <rharinath@novell.com>
3930 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3932 (PropertyExpr.EmitCall): Likewise.
3933 * expression.cs (Invocation.EmitArguments): Handle case where
3935 (Invocation.EmitCall): Avoid allocating temporary variable if
3936 there are no arguments.
3938 2005-10-07 Raja R Harinath <rharinath@novell.com>
3941 * convert.cs (ImplicitConversionStandard): Move conversion of
3942 void* to arbitrary pointer types ...
3943 (ExplicitConversionStandard): .. here.
3944 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3945 error to always print typenames.
3947 2005-10-07 Raja R Harinath <rharinath@novell.com>
3949 * convert.cs (GetConversionOperator): Rename from
3950 GetConversionOperators. Move operator selection code from ...
3951 (UserDefinedConversion): ... here.
3953 2005-10-06 Marek Safar <marek.safar@seznam.cz>
3955 * convert.cs (ExplicitConversionCore): Removed duplicate enum
3958 2005-10-05 Marek Safar <marek.safar@seznam.cz>
3960 * assign.cs (Assign.DoResolve): Error method changed.
3962 * cfold.cs (DoConstantNumericPromotions): Error method changed.
3964 * const.cs (ResolveValue): Reset in_transit immediately.
3966 * constant.cs: Error method changed.
3968 * convert.cs: Removed useless location parameter.
3969 (ExplicitNumericConversion): Don't do double enum check.
3970 (ExplicitConversionCore): Renamed from ExplicitConversion.
3971 (ExplicitUnsafe): Extracted from ExplicitConversion.
3972 (ExplicitConversion): Uses for error reporting.
3974 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3976 (ResolveBoolean): Uses common error method.
3977 (CastToDecimal): Get rid of ec.
3978 (CastFromDecimal): Optimized.
3979 (ConvCast): Get rid of ec.
3981 * enum.cs (ResolveValue): Reset in_transit immediately.
3982 (Emit): Return after first error.
3984 * expression.cs: Convert changes.
3986 * literal.cs: Error method changed.
3988 * statement.cs: Error method changed.
3990 2005-10-03 Raja R Harinath <rharinath@novell.com>
3992 * support.cs (SeekableStreamReader.Position): Don't error out when
3993 the requested position is just beyond the end of the current
3996 2005-09-28 Raja R Harinath <rharinath@novell.com>
3998 * support.cs (SeekableStreamReader): Simplify drastically. Don't
3999 try to keep in sync with the byte count of the underlying Stream.
4000 However, this limits us to a window size of 2048 characters: i.e.,
4001 the maximum lookahead of our lexer/parser can be 2048 characters.
4003 2005-09-28 Marek Safar <marek.safar@seznam.cz>
4006 * driver.cs: Fix compilation files with full root path.
4008 2005-09-25 Miguel de Icaza <miguel@novell.com>
4010 * report.cs (SymbolRelatedToPreviousError): Format the output so
4011 it does not use an open parenthesis that is never closed.
4013 * driver.cs: Follow coding guidelines
4015 2005-09-27 Marek Safar <marek.safar@seznam.cz>
4018 * const.cs (Const.ResolveValue): Check for assigning non-null
4019 value to reference type.
4021 2005-09-27 Marek Safar <marek.safar@seznam.cz>
4023 * anonymous.cs: Implemented ExprClassName.
4025 * assign.cs (Assign.DoResolve): Don't chrash when type is not
4028 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
4031 * class.cs (StaticClass.DefineContainerMembers): Report protected
4034 * codegen.cs: if(ed) PRODUCTION.
4036 * convert.cs (Error_CannotImplicitConversion): Better error
4039 * cs-parser.jay: More error checks.
4041 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
4043 * driver.cs (CSCParseOption): Enabled wrong option check.
4045 * ecore.cs (Expression.ExprClassName): Turned to property.
4046 (MemberExpr.CheckIntermediateModification): For checking boxed
4047 value types modification.
4049 * statement.cs (Fixed.Resolve): Expression type must be
4050 convertible to fixed type.
4051 (CollectionForeach.GetEnumeratorFilter,TryType):
4052 Small refactoring for easier error checking.
4054 2005-09-26 Marek Safar <marek.safar@seznam.cz>
4056 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
4059 * class.cs (GeneratedBaseInitializer): New class for customization
4060 compiler generated initializers.
4061 (MemberBase.DoDefine): Check Obsolete attribute here.
4062 (FieldMember.DoDefine): Ditto.
4064 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
4067 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
4068 (MemberCore.GetObsoleteAttribute): Removed argument.
4069 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
4070 (MemberCore.CheckObsoleteType): New helper.
4074 * statement.cs: Updates after MemberCore changes.
4076 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
4077 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
4079 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
4080 obsolete attribute for compiler construct.
4081 (As.DoResolve): Cache result.
4083 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
4085 2005-09-26 Raja R Harinath <rharinath@novell.com>
4088 * expression.cs (This.VerifyFixed): In a value type T, the type of
4089 'this' is T&, iow, 'this' is either an out or ref parameter. In a
4090 value type R, 'this' is treated as a value parameter.
4092 2005-09-22 Miguel de Icaza <miguel@novell.com>
4094 * statement.cs (Lock): Use the TemporaryVariable class instead of
4095 manually using local variables as those do not work when variables
4098 * ecore.cs: Moved the TemporaryVariable class from being a nested
4099 class inside Foreach to be a public class that can be employed in
4102 2005-09-19 Marek Safar <marek.safar@seznam.cz>
4104 * cs-parser.jay: interface_accessors replaced by
4105 accessor_declarations.
4107 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
4110 * statement.cs (GotoCase.Resolve): Convert null constant to
4112 (SwitchLabel.ResolveAndReduce): Ditto.
4113 (SwitchLabel.NullStringCase): Custom null stamp.
4114 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
4116 typemanager.cs (CSharpSignature): Don't skip first argument
4119 2005-09-18 Miguel de Icaza <miguel@novell.com>
4121 * driver.cs: Set InEmacs based on the environment variable EMACS.
4123 * location.cs (InEmacs): in this mode, do not report column
4124 location as it confuses Emacs.
4126 2005-09-16 Marek Safar <marek.safar@seznam.cz>
4128 * cfold.cs, constant.cs, convert.cs, ecore.cs,
4129 expression.cs, iterators.cs, literal.cs: Store constants and
4132 * class.cs (MemberBase.ShortName): Pass location.
4134 * cs-parser.jay: Some location fixes.
4136 * ecore.cs (Expression.Location): Made virtual.
4138 2005-09-05 Miguel de Icaza <miguel@novell.com>
4140 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
4141 if the underlying types are the same, otherwise we need to produce
4142 code that will do the proper cast.
4144 This was exposed by Marek's constant rewrite which produced
4145 invalid code for the call site:
4148 void Method (X v) {}
4152 This fixes test-49.cs
4154 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
4156 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
4157 Type/Object should be allowed as well. Fixed bug #75968.
4159 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
4161 * expression.cs : (Binary.DoResolve): when one is enum constant and
4162 another is constant 0, then return enum one *as enum type*.
4165 2005-09-02 Raja R Harinath <rharinath@novell.com>
4167 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
4171 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
4172 flow-branching for LocalVariableReferences in case we were invoked
4173 from a MemberAccess.
4174 * expression.cs (LocalVariableReference.VerifyAssigned): New.
4176 (LocalVariableReference.DoResolveBase): ... this.
4177 (MemberAccess.Resolve): Do the check that was disabled during
4180 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
4183 (PartialContainer.Create): check abstract/sealed/static strictly
4184 but abstract/sealed can exist only at one side. Fixed bug #75883.
4186 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
4189 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
4190 specified, don't default to UnmanagedType.I4.
4192 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
4194 * expression.cs : conditional operator should check possibly
4195 incorrect assign expression. Fixed bug #75946.
4197 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
4199 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
4200 Reverting the change. gmcs is much complex than mcs on this matter.
4202 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
4204 * cs-tokenizer.cs : To read another token ahead of the actual
4205 consumption, use new SavedToken and cache token instead of moving
4206 back the stream with SeekableStreamReader (it seemed problematic).
4208 driver.cs : Thus use StreamReader directly.
4209 * support.cs : Thus removed SeekableStreamReader.
4211 2005-08-30 Raja R Harinath <rharinath@novell.com>
4214 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
4215 (ScopeInfo.EmitScopeType): Use it to construct field names from
4216 names of captured locals.
4219 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
4220 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
4221 Pass 'target_type' to BoxedCast. Don't default to 'object'.
4222 (ExplicitConversion): Remove enum cases already handled by
4223 implicit conversion. Move implicit conversion check to the beginning.
4224 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
4225 * expression.cs (ArrayCreation.EmitDynamicInitializers):
4226 Don't treat System.Enum as a struct.
4228 2005-08-30 Jb Evain <jbevain@gmail.com>
4230 * attribute.cs: handles as expression in parameters.
4232 2005-08-30 Raja R Harinath <rharinath@novell.com>
4235 * class.cs (TypeContainer.VerifyClsName): Don't use a
4236 PartialContainer when verifying CLS compliance.
4237 (AbstractPropertyEventMethod): Set Parent here, ...
4238 (PropertyMethod): ... not here.
4240 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
4242 * attribute.cs : escaped attribute name should not be allowed to be
4243 resolved (e.g. @class as classAttribute). Fixed bug #75930.
4245 2005-08-29 Raja R Harinath <rharinath@novell.com>
4248 * convert.cs (ImplicitStandardConversionExists): Allow zero also
4249 when converting a long constant to unsigned long.
4250 * expression.cs (Invocation.OverloadResolve): Add sanity check to
4251 detect where IsApplicable and VerifyArgumentsCompat disagree.
4253 2005-08-29 Raja R Harinath <rharinath@novell.com>
4254 and Carlos Alberto Cortez <carlos@unixmexico.org>
4257 * class.cs (TypeContainer.CanElideInitializer): New helper.
4258 (TypeContainer.EmitFieldInitializers): Use it to determine if we
4259 can safely emitting the initializer of a field.
4261 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4263 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
4264 allowed inside a switch (without loop). Fixed bug #75433.
4266 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
4268 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4269 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4271 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4273 * driver.cs : kinda reverting the default encoding changes (not exact
4274 revert since I noticed that "codepage:reset" might not work fine).
4276 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4278 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
4279 Location. Now getter and setter store location correctly.
4280 (errors/cs0111-12.cs now reports the expected location.)
4282 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
4284 * driver.cs : Use default encoding on the environment.
4285 Removed (now that) extra parameter for SeekableStreamReader.
4286 * support.cs : (SeekableStreamReader) third .ctor() argument for
4287 StreamReader is not required (always true). preamble size could
4288 be acquired in simpler and safe way.
4290 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
4292 * cs-parser.jay: report CS0642 at warning level 3
4293 and report CS0642 for an if else statement also
4294 fixes bug #74745. Patch by John Luke (and a bit
4296 Removed extra CS0642 warning check for "while",
4298 * statement.cs: In Block.Resolve(), CS0642 check
4299 is reimplemented to check a sequence of an empty
4300 statement and a block.
4302 Both fix bug #66777.
4304 2005-08-24 Marek Safar <marek.safar@seznam.cz>
4306 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
4307 detection until I fix it.
4309 * cs-tokenizer.cs: Changed error message.
4311 * cs-parser.jay: Fixed 2 error locations.
4313 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
4314 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
4317 * enum.cs (GetSignatureForError): Fixed.
4319 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
4323 * typemanager.cs (RegisterProperty): Removed.
4325 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
4327 2005-08-24 Raja R Harinath <rharinath@novell.com>
4330 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
4331 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
4333 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4335 * expression.cs : tiny fix is required for not warning positive ulong.
4338 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4340 * expression.cs : add CS0652 check for constant and integral
4341 expression. Fixed bug #53974.
4343 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4345 * expression.cs : in DoNumericPromotions(), check if there is implicit
4346 conversion overload for string (to check CS0034). Fixed bug #52492.
4348 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4350 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
4352 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4354 * ecore.cs : report location when it is *not* Null.
4356 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
4362 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4363 correctly. Fixed bug #75721.
4365 2005-08-23 Raja R Harinath <rharinath@novell.com>
4367 * support.cs (SeekableStreamReader.Position): Avoid an expensive
4368 loop that performs 'min (pos, char_count)'.
4371 * expression.cs (Unary.ResolveOperator): Don't discard implicit
4372 converted value in Operator.OnesComplement.
4374 2005-08-22 Ben Maurer <bmaurer@ximian.com>
4376 * anonymous.cs: If the anon method is pulled into a helper class,
4377 it needs to be `internal' not `private'. Fixes runtime behavior on
4380 2005-08-20 Martin Baulig <martin@ximian.com>
4382 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4383 scope if we don't already have it.
4385 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4386 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4389 2005-08-17 Marek Safar <marek.safar@seznam.cz>
4392 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4395 2005-08-16 Marek Safar <marek.safar@seznam.cz>
4397 The big constants rewrite
4398 Fix #75746, #75685 and more
4399 As a side effect saved 1MB for MWF ;-)
4401 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4402 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4403 enum based for corlib compilation.
4405 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4408 * class.cs (FixedField.Define): Use ResolveAsConstant.
4410 * const.cs (IConstant): Interface constants and enums.
4411 (Const.ResolveValue): New method for constant resolvning.
4412 (ExternalConstant): Constants from imported assemblies.
4414 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4415 conversion; like enums.
4416 (Constant.ToType): Converts this constant to different type.
4417 (Constant.Increment): Adds 1.
4419 * convert.cs (ImplicitConversionRequired): Simplified.
4421 * cs-parser.jay: Create EnumMember directly.
4423 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4425 * doc.cs (GenerateEnumDocComment): Removed.
4427 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4428 (ConvertIntLiteral): Removed.
4429 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4431 * enum.cs (EnumMember): Implement IConstant.
4432 (Enum.IsValidEnumConstant): Removed.
4433 (Enum.GetNextDefaultValue): Removed.
4434 (Enum.FindMembers): Updated.
4435 (Enum.GenerateDocComment): Iterate enum members.
4437 * expression.cs (Cast.TryReduce): Handle enums correctly.
4438 (New.Constantify): Made public.
4439 (MemberAccess.DoResolve): Removed contant specific if(s).
4441 * literal.cs (NullLiteral): Implement new abstract methods.
4443 * statement.cs (GotoCase.Resolve): Use new constant methods.
4444 (SwitchLabel.ResolveAndReduce): Use new constant methods.
4446 * typemanager.cs (LookupEnum): Removed.
4447 (IsEnumType): Fixed to work with corlib.
4448 (RegisterConstant): Removed.
4449 (LookupConstant): Removed.
4450 (GetConstant): Changed to work with IConstant.
4452 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
4454 * location.cs : Fixed overflown (>255) column number.
4456 2005-08-03 Raja R Harinath <rharinath@novell.com>
4458 First cut of the qualified-alias-member feature.
4459 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4461 * cs-parser.jay (DOUBLE_COLON): New token.
4462 (namespace_or_type_name): Add rule for recognizing
4463 qualified-alias-members.
4464 (primary_expression): Likewise.
4465 (element_access): Allow QualifiedAliasMember as a possible
4466 type-bearing expression.
4467 (local_variable_type, local_variable_pointer_type): Likewise.
4468 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
4469 aliases in the current and enclosing namespace declarations.
4470 (NamespaceEntry.UsingAlias): Add CS0440 warning.
4471 * decl.cs (MemberName.is_double_colon): New.
4472 (MemberName.MemberName): Add new constructor for alias-member.
4473 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4474 * expression.cs (QualifiedAliasMember): New expression type.
4476 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4478 * location.cs : it borked when no argument was specified.
4480 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4482 * location.cs : tiny ToString() format fix.
4484 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4486 * statement.cs : oops, it was missing.
4488 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
4490 A set of fixes for precise line/column location.
4493 "token" field now holds a file/line "delta", a line number offset
4494 from the segment, and a column number. See also:
4495 http://lists.ximian.com/pipermail/mono-devel-list/2004-
4496 December/009508.html
4497 Removed static IsNull. Use instance IsNull property instead.
4499 For some tokens it stores Location. For Identifier it stores
4500 LocatedToken which is a pair of string name and location.
4501 Column numbers are adjusted only at getChar().
4503 Use Location.ToString() for reporting (it now contains column).
4505 Largely modified to use LocatedToken instead of
4506 string (IDENTIFIER), and to acquire Location from some tokens.
4507 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4508 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4510 Now MemberName holds Location. DeclSpace.ctor() receives Location
4511 as a parameter. Removed extra parameters to all derived classes.
4512 Replaced Location.IsNull() with instance property.
4513 * assign.cs, expression.cs :
4514 Added .ctor() overload that omits Location.
4516 Added "nameEscaped" flag that indicates the identifier was escaped
4517 in the source file. This fixes bug #57047.
4519 2005-08-02 Marek Safar <marek.safar@seznam.cz>
4521 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4522 New method, looking for lo-case imported cls type.
4524 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4527 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4529 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4531 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4533 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4535 Optimized to save 3.5 MB for SWF compilation.
4537 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4539 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4540 (PartialContainer.Create): Moved logic AddToContainer.
4541 (PartialContainer.MarkForDuplicationCheck): Shares name.
4543 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4546 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4548 (Namespace.GetSignatureForError): New method.
4550 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4551 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4553 2005-08-01 Raja R Harinath <rharinath@novell.com>
4556 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4557 member lookup rather than qualifier_type, since qualifier_type can
4560 2005-08-01 Marek Safar <marek.safar@seznam.cz>
4562 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4565 2005-07-31 Miguel de Icaza <miguel@novell.com>
4567 * statement.cs: Copy the local exception into the exception
4568 captured local. Fixes 75674
4570 2005-07-31 Raja R Harinath <harinath@gmail.com>
4573 * expression.cs (Invocation.OverloadResolve): Don't report error
4574 CS1501 if error CS1502 has been reported.
4575 (New.DoResolve): Delegate CS1501 reporting to
4576 Invocation.OverloadResolve.
4579 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4580 invariant-meaning-in-block property in an enclosing block if
4583 2005-07-29 Marek Safar <marek.safar@seznam.cz>
4585 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4586 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4587 (Switch.CheckSwitch): Just save 50kb for SWF.
4589 2005-07-27 Martin Baulig <martin@ximian.com>
4591 * anonymous.cs (CaptureContext.AddField): Added
4592 `AnonymousContainer am' argument; compute its toplevel scope if
4593 it's not already computed. Fixes #75649.
4595 2005-07-26 Raja R Harinath <rharinath@novell.com>
4598 * class.cs (Constructor.Emit): Reset block to null if the block
4601 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4603 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4605 2005-07-25 Marek Safar <marek.safar@seznam.cz>
4607 * class.cs (MethodData.Define): Check whether accessor implementing
4608 interface is public.
4610 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4612 2005-07-22 Marek Safar <marek.safar@seznam.cz>
4615 * namespace.cs (LookupType): Moved same type check to...
4617 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4620 2005-07-21 Raja R Harinath <rharinath@novell.com>
4622 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4623 already found a typebuilder.
4624 * class.cs (MethodCore.IsDuplicateImplementation): Compare
4625 MemberNames, not strings.
4627 * const.cs (Error_ExpressionMustBeConst):
4628 Rename from Error_EpressionMustBeConst.
4629 * const.cs, class.cs, statement.cd: Update.
4631 2005-07-21 Marek Safar <marek.safar@seznam.cz>
4635 * const.cs (Const.LookupConstantValue): Report missing contant expression
4637 (Error_EpressionMustBeConstant): Only one error method.
4639 * class.cs, statement.c: Updated.
4641 2005-07-20 Raja R Harinath <rharinath@novell.com>
4643 * statement.cs (Block.Flags): Add back HasVarargs.
4644 (Block.flags): Make protected.
4645 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4647 * typemanager.cs (types, typecontainers, user_types): Remove.
4648 (UserTypes, TypeContainers): Likewise.
4649 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4650 (CleanUp, Reset): Update.
4651 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
4652 (GetNestedType): Use Type.GetNestedType.
4653 (CoreLookupType): Take two arguments, the namespace and the
4654 basename of the type. Update to use the Namespace.Lookup
4656 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4657 (RealMemberLookup): Use IsNestedChildOf instead of playing with
4658 string concatenation and substring matches.
4659 * class.cs, enum.cs, delegate.cs: Update to changes.
4661 2005-07-20 Marek Safar <marek.safar@seznam.cz>
4663 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4664 Expression and made virtual.
4666 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4667 (ImplicitStandardConversionExists): Fixed `byte' typo ?
4669 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4671 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4674 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4677 2005-07-18 Marek Safar <marek.safar@seznam.cz>
4680 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4681 AssemblyCultureAttribute is not used on executable.
4684 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4686 2005-07-16 Raja R Harinath <rharinath@novell.com>
4689 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4690 New. Reports CS0252/CS0253.
4691 Mostly taken from preliminary patch by Duncak Mak.
4692 (Binary.DoResolveOperator): Store results of operator lookup.
4693 Use them to detect if we need to warn about unintended reference
4696 2005-07-15 Raja R Harinath <rharinath@novell.com>
4699 * namespace.cs (Namespace.Lookup): Add back location parameter.
4700 (Namespace.LookupType): Add CS0436 report. Add location parameter.
4701 * delegate.cs, ecore.cs, expression.cs: Update to changes.
4703 * codegen.cs (EmitContext.DeclSpace): Make readonly.
4704 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4705 (Namespace.LookupType): ... this.
4706 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4708 * typemanager.cs (LookupTypeReflection): Remove buggy code that
4709 purported to handle pointers.
4710 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4713 2005-07-15 Marek Safar <marek.safar@seznam.cz>
4715 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4718 2005-07-15 Raja R Harinath <rharinath@novell.com>
4720 * namespace.cs (Namespace.Lookup): Drop location parameter.
4721 (NamespaceEntry.LookupAlias): Remove. Merge into ...
4722 (NamespaceEntry.Lookup): ... this.
4723 (NamespaceEntry.Error_AmbiguousTypeReference):
4724 Move here from DeclSpace.
4725 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4727 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4728 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4729 Move to NamespaceEntry.
4730 * delegate.cs, expression.cs: Update to changes.
4732 2005-07-14 Marek Safar <marek.safar@seznam.cz>
4734 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4735 CheckAttributeType and refactored.
4736 (Attribute.ResolvePossibleAttributeType): Changed to reuse
4737 ResolveAsTypeTerminal error handling.
4738 (ResolveAsTypeTerminal): Introduced because of global attributes extra
4740 (GetSignatureForError): Print errors in same way.
4743 * codegen.cs: Reflect attribute GetSignatureForError change.
4746 * expression.cs: Add silent parameter to ResolveAsTypeStep.
4748 * namespace.cs (UsingEntry): Refactored to make fields private.
4751 statement.cs: Error_UnexpectedKind has extra parameter.
4753 2005-07-14 Raja R Harinath <rharinath@novell.com>
4755 * ecore.cs (IAlias): Remove.
4756 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
4757 that implement the interface.
4758 * namespace.cs (Namespace): Likewise.
4759 (Namespace.declspaces): Renamed from 'defined_names'.
4760 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
4761 DeclSpace instead of an IAlias.
4762 * tree.cs (Tree.AddDecl): Update.
4764 2005-07-12 Raja R Harinath <rharinath@novell.com>
4766 * statement.cs (Block.Flags); Remove HasVarargs.
4767 (Block.HasVarargs): Move to ToplevelBlock.
4768 (Block.ThisVariable, Block.AddThisVariable): Likewise.
4769 (Block.Variables): Make protected. Initialize variable hashtable
4771 (Block.AddVariable): Update.
4772 (Block.Resolve): Update to changes.
4773 (ToplevelBlock.HasVarargs): New boolean.
4774 (ToplevelBlock.ThisVariable): Move here from Block.
4775 (ToplevelBlock.AddThisVariable): Likewise.
4776 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
4777 * expression.cs (This.ResolveBase): Update to changes.
4778 (ArglistAccess.DoResolve): Likewise.
4780 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4783 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4785 * class.cs (TypeContainer.VerifyMembers): Distinguish between
4786 not used and not used & assigned.
4787 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4789 2005-07-11 Marek Safar <marek.safar@seznam.cz>
4792 * expression.cs (Is.DoResolve): null is never provided type.
4794 2005-07-08 Marek Safar <marek.safar@seznam.cz>
4797 * cs-parser.jay: Less strict event error rule to catch more errors.
4799 2005-07-08 Martin Baulig <martin@ximian.com>
4801 Fix test-iter-10.cs - distinguish whether we `yield' in a property
4802 gettter (allowed) or setter (not allowed).
4804 * class.cs (Accessor): Implement IIteratorContainer.
4805 (Accessor.Yields): New public field.
4806 (PropertyBase.PropertyMethod.Define): Handle iterators on a
4810 (get_accessor_declaration, set_accessor_declaration): Set the
4811 `yields' flag on the accessor, not the property.
4812 (property_declaration): Do the iterators check on a per-accessor
4813 basis and not for the whole property.
4815 2005-07-08 Martin Baulig <martin@ximian.com>
4817 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4818 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4820 2005-07-07 Marek Safar <marek.safar@seznam.cz>
4823 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4824 (ExtractSecurityPermissionSet): Cope with self referencing security
4825 attributes properly.
4827 * driver.cs (SetOutputFile): Made public property OutputFile.
4829 2005-07-07 Raja R Harinath <rharinath@novell.com>
4832 * class.cs (TypeContainer.first_nonstatic_field): Rename from
4833 has_nonstatic_fields. Make into a FieldBase pointer.
4834 (TypeContainer.AddField): Add CS0282 check.
4835 (TypeContainer.EmitType): Update.
4837 2005-07-06 Miguel de Icaza <miguel@novell.com>
4839 * cs-tokenizer.cs (consume_identifier): Do not create strings to
4840 compare if they start with __.
4842 2005-07-06 Raja R Harinath <rharinath@novell.com>
4844 * statement.cs (Switch.SwitchGoverningType): Only look at
4845 UserCasts that don't need implicit standard conversions to one of
4846 the allowed switch types (Fixes test-322.cs).
4847 (LocalInfo.Resolve): Re-enable sanity-test.
4849 2005-07-06 Marek Safar <marek.safar@seznam.cz>
4851 * cs-tokenizer.cs (consume_identifier): Detect double undescores
4853 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4855 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4857 2005-07-06 Raja R Harinath <rharinath@novell.com>
4860 * ecore.cs (SimpleName.GetSignatureForError): Add.
4861 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4862 (MemberAccess.GetSignatureForError): Add.
4864 2005-07-05 Marek Safar <marek.safar@seznam.cz>
4866 The big error and warning messages review.
4896 * typemanager.cs: Updated.
4898 * class.cs: (MethodCore.SetYields): Moved here to share.
4899 (PropertyMethod.Define): Moved iterator setup here.
4901 * iterators.cs: Add orig_method to have full access to parent
4904 2005-07-05 Raja R Harinath <rharinath@novell.com>
4906 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4907 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4908 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4909 variable of struct type.
4910 * expression.cs (Unary.ResolveOperator): Update to change.
4911 (Indirection.VerifyFixed): Likewise.
4912 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4913 (ParameterReference.VerifyFixed): Value parameters are fixed.
4914 (This.VerifyFixed): Treat 'this' as a value parameter.
4915 * statement.cs (LocalInfo.IsFixed): Remove.
4917 2005-07-01 Martin Baulig <martin@ximian.com>
4919 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4920 `ec.EmitThis ()' to get the correct scope.
4922 2005-07-01 Martin Baulig <martin@ximian.com>
4924 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4925 instance is a ParameterReference; fixes #75299.
4927 2005-07-01 Martin Baulig <martin@ximian.com>
4929 Reverted Marek's latest patch (r46725):
4930 - it contains structural changes which are neither mentioned in
4931 the ChangeLog nor explained anywhere; for example the additional
4932 argument of EmitContext's and Iterator's .ctor's and the
4933 TypeContainer.DefineMembers() change.
4934 - structural changes like this should go in in seperate patches
4935 and not be hidden in a huge patch which just seems to affect
4936 warnings and errors.
4937 a big and hard to understand patch.
4938 - it breaks iterators and causes regressions, for instance in
4941 2005-06-30 Raja R Harinath <rharinath@novell.com>
4944 * expression.cs (Indexers.map): Remove.
4945 (Indexers.Append): Filter out inaccessible setters and getters.
4946 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4949 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
4951 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4952 (FieldExpr.Emit, PropertyExpr.Emit): Update.
4953 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4954 * expression.cs (Invocation.EmitCall): Add CS0120 check.
4956 2005-06-30 Marek Safar <marek.safar@seznam.cz>
4959 * class.cs (FieldBase.GetInitializerExpression): One more field
4962 2005-06-28 Miguel de Icaza <miguel@novell.com>
4964 * pending.cs: Do not define a proxy if the base method is virtual,
4965 it will be picked up by the runtime (bug 75270).
4967 2005-06-08 Martin Baulig <martin@ximian.com>
4969 The big Iterators rewrite :-)
4971 * iterators.cs: Rewrite this to use the anonymous methods framework.
4973 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4974 before the TypeContainers; see 2test-21.cs.
4977 (TypeContainer.DefineType): Don't create a new EmitContext if we
4978 already have one (this only happens if we're an Iterator).
4979 (TypeContainer.Define): Also call Define() on all our iterators.
4980 (Method.CreateEmitContext): Added support for iterators.
4983 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4984 (AnonymousContainer.CreateMethodHost): Moved here from
4985 AnonymousMethod and made abstract.
4986 (AnonymousContainer.CreateScopeType): New abstract method.
4987 (AnonymousContainer.IsIterator): New public property.
4988 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4989 get the ScopeTypeBuilder rather than manually defining it here.
4990 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4993 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4994 before RootContext.DefineTypes().
4996 * codegen.cs (EmitContext.RemapToProxy): Removed.
4997 (EmitContext.CurrentAnonymousMethod): Changed type from
4998 AnonymousMethod -> AnonymousContainer.
4999 (EmitContext.ResolveTopBlock): Protect from being called twice.
5000 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5001 (EmitContext.EmitThis): Removed the iterators hacks; use the
5002 anonymous methods framework for that.
5005 (ToplevelBlock.Container): Make this a property, not a field.
5006 (ToplevelBlock.ReParent): New public method; move the
5007 ToplevelBlock into a new container.
5008 (Foreach.TemporaryVariable): Simplify.
5010 2005-06-05 Martin Baulig <martin@ximian.com>
5012 * statement.cs (LocalInfo.CompilerGenerated): New flag.
5013 (Block.AddTemporaryVariable): New public method; creates a new
5014 `LocalInfo' for a temporary variable.
5015 (Block.EmitMeta): Create the LocalBuilders for all the temporary
5017 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5018 non-iterator variables.
5020 2005-06-05 Martin Baulig <martin@ximian.com>
5022 * statement.cs (Foreach.TemporaryVariable): Create the
5023 LocalBuilder in the Emit phase and not in Resolve since in some
5024 situations, we don't have an ILGenerator during Resolve; see
5025 2test-19.cs for an example.
5027 2005-06-04 Martin Baulig <martin@ximian.com>
5029 **** Merged r45395 from GCS ****
5031 The big Foreach rewrite - Part II.
5033 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5034 with `PropertyInfo ienumerator_getcurrent'.
5036 * codegen.cs (VariableStorage): Removed.
5039 (Foreach): Derive from Statement, not ExceptionStatement.
5040 (Foreach.CollectionForeach): New nested class. Moved all the code
5041 dealing with collection foreach here.
5042 (Foreach.ForeachHelperMethods): Removed.
5043 (Foreach.TemporaryVariable): Implement IMemoryLocation.
5045 2005-05-23 Martin Baulig <martin@ximian.com>
5047 * statement.cs (Try.DoResolve): Don't create a `finally' if we
5048 don't need to. Fix #75014.
5050 2005-05-20 Martin Baulig <martin@ximian.com>
5052 Merged r44808 from GMCS.
5054 * class.cs (TypeContainer.CircularDepException): Removed.
5055 (TypeContainer.DefineType): Removed the `InTransit' stuff.
5056 (TypeContainer.CheckRecursiveDefinition): Check for circular class
5057 (CS0146) and interface (CS0529) dependencies here.
5059 2005-06-21 Raja R Harinath <rharinath@novell.com>
5061 * expression.cs (Invocation.EmitCall): Fix initialization
5062 'this_call' to reflect current behaviour. Fix indentation.
5064 * convert.cs (FindMostEncompassedType): Add two trivial special
5065 cases (number_of_types == 0 || number_of_types == 1).
5066 (FindMostEncompasingType): Likewise.
5068 2005-06-17 Raja R Harinath <rharinath@novell.com>
5070 Some cleanups preparing for the fix of #75283.
5071 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
5073 (EventExpr.InstanceResolve): Likewise.
5074 (EventExpr.DoResolve): Remove redundant checks.
5076 2005-06-10 Duncan Mak <duncan@novell.com>
5078 * cs-tokenizer.cs (process_directives): New flag for controlling
5079 the processing of preprocessor directives.
5080 (x_token): After seeing a '#', return Token.NONE instead of going
5081 to handle_preprocessing_directive() when not processing
5082 directives. This avoids unnecessary processing during the token peek in
5087 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
5088 the existing error reporting methods instead of Report.Error.
5090 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
5091 after Raja's rewrite.
5093 2005-06-08 Miguel de Icaza <miguel@novell.com>
5095 * class.cs: Small fix.
5097 2005-06-08 Raja R Harinath <rharinath@novell.com>
5100 * class.cs (GetPartialBases): Fix return value check of
5103 2005-06-07 Raja R Harinath <rharinath@novell.com>
5105 Ensure that partial classes are registered in their enclosing
5106 namespace. Initial part of fix of #75160.
5107 * tree.cs (Tree.RecordDecl): Add new namespace argument.
5108 Register declspace with namespace here, not in
5109 DeclSpace.RecordDecl.
5110 * cs-parser.jay: Pass namespace to RecordDecl.
5111 * class.cs (PartialContainer.Create): Likewise.
5112 (ClassPart.DefineType): New sanity-check. Throws an exception if
5114 * decl.cs (Declspace.RecordDecl): Remove.
5115 * namespace.cs (NamespaceEntry.DefineName): Remove.
5117 2005-06-06 Marek Safar <marek.safar@seznam.cz>
5119 * rootcontext.cs: Reset TargetExt as well.
5121 2005-06-03 Raja R Harinath <rharinath@novell.com>
5123 * ecore.cs (Expression.Resolve): Emit CS0654 error when
5126 2005-06-02 Raja R Harinath <rharinath@novell.com>
5128 Fix #75080, cs0119.cs.
5129 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
5131 (Expression.Resolve): ... this. Use it. Remove bogus code
5132 allowing ExprClass.Type and ExprClass.Namespace for
5133 ResolveFlags.VariableOrValue.
5134 (Expression.Resolve) [1-argument variant]: Change default resolve
5135 flags based on language version.
5136 (Expression.Error_UnexpectedKind): Use a simple string array
5137 rather than an ArrayList.
5138 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
5140 (TypeOfVoid.DoResolve): Likewise.
5141 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
5142 flags argument -- it always has the same value.
5144 2005-05-31 Raja R Harinath <rharinath@novell.com>
5147 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
5148 Use it in the error message.
5149 * assign.cs, expression.cs, statement.cs: Update.
5151 2005-05-30 Raja R Harinath <rharinath@novell.com>
5154 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
5155 the "almostMatchedMember" case too.
5156 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
5157 that failed the accessibility checks to 'almost_match'.
5159 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
5161 * attribute.cs: Use internal MethodBuilder methods to set
5162 ExactSpelling and SetLastError on PInvoke methods, instead
5163 of passing them via charset. Fixes #75060.
5165 2005-05-27 Raja R Harinath <rharinath@novell.com>
5167 * parameter.cs (Parameter): Remove TODO comment.
5168 (Parameter.DefineParameter): Remove Location parameter.
5169 (Parameters.LabelParameters): Likewise.
5170 * class.cs (Constructor.Emit): Update to change.
5171 (MethodData.Emit): Likewise.
5172 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
5173 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
5175 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
5178 Removed Parameters.Location and added Parameter.Location instead.
5179 Removed Location parameter from Emit() and GetSignature().
5186 Modified all related calls.
5188 2005-05-26 Raja R Harinath <rharinath@novell.com>
5190 Improve user-defined conversion handling.
5191 * convert.cs (GetConversionOperators): Rewrite. Return only the
5192 applicable operators.
5193 (AddConversionOperators): New. Helper for GetConversionOperators.
5194 (FindMostEncompassedType, FindMostEncompassingType): Verify that
5195 there is only one most encompassed/encompassing type.
5196 (FindMostSpecificSource, FindMostSpecificTarget): Remove
5197 "applicable operator" handling.
5198 (UserConversion): Move cache here from GetConversionOperators.
5199 Directly cache the chosen operator, rather than the whole
5201 (ExplicitNumericConversion): Fix buggy implementation of Decimal
5202 case. Allow conversion of decimal to sbyte and byte too.
5203 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5204 New static methods. Used to avoid allocating EmptyExpressions in
5207 2005-05-24 Duncan Mak <duncan@novell.com>
5209 * ecore.cs (CastFromDecimal): New class for casting a decimal to
5210 another class, used in Convert.ExplicitNumericConversion.
5211 (CastToDecimal): New class, similar to above, but casts to
5212 System.Decimal, used in Convert.ImplicitNumericConversion and also
5213 in explicit convesion from double/float to decimal.
5215 * convert.cs (ImplicitNumericConversion): Handle implicit
5216 conversions to System.Decimal.
5217 (ExplicitNumericConversion): handle explicit conversions to
5222 2005-05-20 Miguel de Icaza <miguel@novell.com>
5224 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
5225 know the type at this stage, just break through. Fixes #75008
5227 2005-05-19 Martin Baulig <martin@ximian.com>
5230 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5231 to disable error reporting.
5233 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5234 here since we don't want to report an error; see the new test-336.cs.
5236 2005-05-19 Raja R Harinath <rharinath@novell.com>
5238 * statement.cs (ToplevelBlock.GetParameterReference)
5239 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5240 Move here from class Block.
5241 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5242 * expression.cs (ParameterReference.DoResolveBase): Likewise.
5244 2005-05-18 Martin Baulig <martin@ximian.com>
5249 (FlowBranching.Reachability): Add non-static public And() and Or()
5251 (FlowBranchingSwitch): New class; do the `break_origins' thing
5252 like in FlowBranchingLoop.
5253 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5254 reachability, not just locals and parameters.
5255 (FlowBranching.MergeChild): Remove some of the hacks for loop and
5256 switch; MergeBreakOrigins() now takes care of that.
5258 2005-05-18 Martin Baulig <martin@ximian.com>
5260 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5261 a loop and may leave it, reset the barrier; fixes #74974.
5263 2005-05-17 Marek Safar <marek.safar@seznam.cz>
5265 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5268 * cs-parser.jay: Catch more lexical errors.
5270 * report.cs: Add one more Error method.
5273 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5275 2005-05-17 Martin Baulig <martin@ximian.com>
5277 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5280 2005-05-16 Raja R Harinath <rharinath@novell.com>
5282 Fix test-382.cs. Emit values of decimal constants.
5283 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5285 (TypeContainer.AddField): ... this.
5286 (TypeContainer.EmitFieldInitializers): Allow the list of fields
5287 with initializers to include 'Const's.
5288 (ClassPart.RegisterFieldForInitialization): Forward to
5290 * const.cs (Const.Const): Pass initializer to base class.
5291 (Const.Define): In case of decimal constants, register them for
5292 initialization in a static constructor.
5294 2005-05-14 Martin Baulig <martin@ximian.com>
5296 * statement.cs (Block.Resolve): Correctly handle unreachable code;
5297 do not call ResolveUnreachable() on unreachable statements in
5298 here, see the comment in the source code.
5300 2005-05-13 Raja R Harinath <rharinath@novell.com>
5303 * expression.cs (BinaryResolveOperator): If one of the operands of
5304 an equality comparison is 'null' and the other is a pointer type,
5305 convert the null to a NullPointer.
5306 * convert.cs (ImplicitReferenceConversion): If the expression is a
5307 NullLiteral and the target type is a pointer type, return a
5308 NullPointer instead.
5309 (ImplicitConversionStandard): Likewise.
5311 2005-05-13 Marek Safar <marek.safar@seznam.cz>
5313 * cs-parser.jay: Set readonly context based on special constructs.
5315 * expression.cs (LocalVariableReference.DoResolveBase): Improved
5316 readonly variable error handling.
5318 * rootcontext.cs (EmitCode): Don't verify members when error
5321 * statement.cs (LocalInfo): Add reaodnly context information.
5322 (SetReadOnlyContext, GetReadOnlyContext): New methods.
5324 2005-05-13 Raja R Harinath <rharinath@novell.com>
5326 * statement.cs (Block.Resolve): Revert change below. Modify fix
5327 for #74041 to initialize 'resolved' to false only for explicit
5328 blocks. Fixes #74873.
5330 2005-05-12 Raja R Harinath <harinath@gmail.com>
5333 * typemanager.cs (unmanaged_enclosing_types): New.
5334 (IsUnmanagedType): Avoid infloops by using
5335 'unmanaged_enclosing_types' to talk with recursive invocations.
5337 2005-05-13 Martin Baulig <martin@ximian.com>
5339 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5340 instance variable, not a local. Fix #74873.
5341 (Block.ResolveUnreachable): Set it to true here.
5343 2005-05-11 Duncan Mak <duncan@novell.com>
5345 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5346 continuing to process for 'arg'.
5347 (handle_preprocessing_directive): Check the argument of the #endif
5348 directive and report error CS1025 if there are any trailing
5351 According to the C# spec, having even whitespace after the #endif
5352 directive is illegal; however, because we call arg.TrimEnd ()
5353 beforehand, we have the same behavior as csc, allowing whitespace
5354 after the directive.
5358 2005-05-11 Marek Safar <marek.safar@seznam.cz>
5362 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5363 (Constructor.GetObsoleteAttribute): Implemented correctly.
5365 2005-05-10 Martin Baulig <martin@ximian.com>
5367 * support.cs (ReflectionParameters.ParameterModifier): Use
5368 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5369 and `ParameterAttributes.In'. Fixes #74884.
5371 2005-05-10 Marek Safar <marek.safar@seznam.cz>
5373 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5375 * expression.cs (Argument.GetParameterModifier): Turned to property.
5376 (Invocation.Error_InvalidArguments): Add more descriptive errors.
5378 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5381 2005-05-09 Raja R Harinath <rharinath@novell.com>
5384 * decl.cs (MemberCache.AddMethods): Register override methods,
5385 rather than non-override methods.
5386 * typemanager.cs (RegisterOverride): New.
5387 (IsOverride): Update.
5389 2005-05-09 Marek Safar <marek.safar@seznam.cz>
5393 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5394 recursive declaration.
5396 * statement.cs (Block.ResolveMeta): Report any error in resolving.
5398 2005-05-06 Marek Safar <marek.safar@seznam.cz>
5400 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5402 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5404 2005-05-05 Raja R Harinath <rharinath@novell.com>
5407 * decl.cs (DeclSpace.FamilyAccessible):
5408 Use TypeManager.IsNestedFamilyAccessible.
5410 Fix reopened #64812.
5411 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5414 2005-05-04 Raja R Harinath <rharinath@novell.com>
5415 Abin Thomas <projectmonokochi@rediffmail.com>
5416 Anoob V E <projectmonokochi@rediffmail.com>
5417 Harilal P R <projectmonokochi@rediffmail.com>
5420 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5421 allow access to all static members.
5423 2005-05-04 Martin Baulig <martin@ximian.com>
5425 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5427 2005-05-04 Martin Baulig <martin@ximian.com>
5431 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5432 section at the end; make things work if `default' is not the last
5435 2005-05-04 Martin Baulig <martin@ximian.com>
5439 * statement.cs (Switch): Replaced the `got_default' field with a
5440 `default_section' one.
5441 (Switch.CheckSwitch): Set `default_section' here.
5442 (Switch.Resolve): If we're a constant switch and the constant is
5443 not found, use the default section.
5445 2005-05-03 Martin Baulig <martin@ximian.com>
5447 * expression.cs (ArrayAccess.EmitGetLength): New public method.
5449 * statement.cs (Foreach.ArrayForeach): New nested class.
5450 (Foreach.TemporaryVariable): New nested class.
5451 (Foreach.EmitArrayForeach): Removed; this is now in the new
5454 2005-05-03 Raja R Harinath <rharinath@novell.com>
5456 * pending.cs (BaseImplements): Move the #74773 fix here. This is
5458 (VerifyPendingMethods): Revert change below.
5460 * typemanager.cs (IsOverride, RegisterNonOverride): New.
5461 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5462 that used to trigger warning -28. Remove warning -28.
5463 * expression.cs (Invocation.OverloadResolve): Use
5464 TypeManager.IsOverride to distinguish override methods.
5467 * pending.cs (VerifyPendingMethods): If a base type implements the
5468 requested interface, don't bother checking individual methods of
5469 the base type. As a side-effect, this prevents the creation of
5470 unnecessary proxies.
5472 2005-05-02 Martin Baulig <martin@ximian.com>
5476 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5477 Also `And' the locals if the old vector is null.
5478 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5479 null; in this case we basically reset all the variables.
5481 2005-05-02 Martin Baulig <martin@ximian.com>
5485 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5486 Added `FlowBranching branching' argument; always `and' the
5487 variables instead of `or'ing them unless we're an infinite loop.
5489 * statement.cs (While.Resolve): Create a new sibling unless we're
5492 2005-05-02 Martin Baulig <martin@ximian.com>
5496 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5497 arguments; use it instead of creating a new TopLevelBlock.
5498 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5499 our ConstructorInitializer.
5502 (TopLevelBlock.TopLevelBranching): New public property.
5503 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5504 and create our `TopLevelBranching'.
5506 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5507 anonymous method host, use `block.TopLevelBranching' rather than
5508 creating a new branching.
5510 2005-04-20 Miguel de Icaza <miguel@novell.com>
5512 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5513 a ScopeInfo, if any of the current children is a child of the new
5514 entry, move those children there.
5516 2005-04-30 Martin Baulig <martin@ximian.com>
5518 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5519 at the beginning of a SwitchSection. Fix #73335.
5521 2005-04-27 Marek Safar <marek.safar@seznam.cz>
5524 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5526 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5527 (FieldExpr.DoResolve): Obsolete members are ignored for field
5530 2005-04-26 Marek Safar <marek.safar@seznam.cz>
5532 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5533 of arrays detection.
5535 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5537 (Field.VerifyClsCompliance): Volatile fields are not compliant.
5539 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5542 2005-04-25 Ben Maurer <bmaurer@ximian.com>
5544 * cs-parser.jay: Use the prefered version of -unsafe in error
5547 2005-04-22 Marek Safar <marek.safar@seznam.cz>
5549 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5552 2005-04-20 John Luke <john.luke@gmail.com>
5554 * driver.cs: fix typo in error message, --outout to --output
5556 2005-04-20 Marek Safar <marek.safar@seznam.cz>
5558 * codegen.cs (InRefOutArgumentResolving): New field.
5560 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5561 fields outside contructor.
5563 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5565 2005-04-19 Miguel de Icaza <miguel@novell.com>
5567 * anonymous.cs (CaptureContext.EmitParameterInstance): The
5568 parameter code was not completed ever, so it was not as up-to-date
5569 as local variables. Must finish it.
5571 The bug fix was to compare the Toplevel of the block, not the
5572 current block. Thanks for Ben for pointing this out.
5574 2005-04-19 Raja R Harinath <rharinath@novell.com>
5576 * decl.cs (AddMethods): Use the declaring type of the problem
5577 method to determine if we want to squash a warning.
5579 2005-04-19 Marek Safar <marek.safar@seznam.cz>
5581 * attribute.cs: Removed debug output.
5583 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5585 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5588 2005-04-18 Raja R Harinath <rharinath@novell.com>
5591 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5592 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5593 all null comparisons against reference types.
5595 2005-04-18 Marek Safar <marek.safar@seznam.cz>
5598 * class.cs (TypeContainer.CircularDepException) New nested
5600 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5601 (TypeContainer.DefineType): Removed error, reset InTransit before
5603 (Class.DefineType): Throw exception when is in Transit.
5604 Catch exception and report error.
5605 (Struct.DefineType): Throw exception when is in Transit.
5606 Catch exception and report error.
5607 (Interface.DefineType): Throw exception when is in Transit.
5608 Catch exception and report error.
5610 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5611 handle nested exception handlers.
5613 * flowanalysis.cs (InTryWithCatch): New method, search for try with
5616 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5617 InFinally and InCatch storage.
5619 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5620 (Catch.Resolve): Set and Restore ec.InCatch.
5621 (Try.Resolve): Set and Restore ec.InFinally.
5622 (Try.HasCatch): True when try has catch.
5624 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
5626 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5627 for the same event member, so exclude such cases from warning 419.
5630 2005-04-16 Miguel de Icaza <miguel@novell.com>
5632 * expression.cs (Binary.ResolveOperator): Apply patch from John
5633 Luke to fix bug 59864: operators &, | and ^ on enumerations
5634 require that the same enum type on both sides.
5636 * driver.cs: Add warnings to old flag usage, this is to assist
5637 people who produce Makefiles and hope that the Makefiles will be
5640 * class.cs (TypeContainer.EmitType): Moved the definition of the
5641 special $PRIVATE$ field from the resolve phase to the Emit phase.
5642 During resolve we do not know if we are a struct with
5643 HasExplicitLayout, we know this only after the attributes for the
5646 Set the FieldOffset to zero on the dummy field that we create for
5647 the class. Fixes 74590.
5649 2005-04-16 Raja R Harinath <rharinath@novell.com>
5652 * ecore.cs (PropertyExpr.resolved): New.
5653 (DoResolve): Use it to handle a case of double resolution here.
5654 Handle a case of identical-name-and-type-name.
5655 * expression.cs (ArrayCreation.CheckIndices): Avoid double
5656 resolution by storing the results of expression resolution back
5657 into the "probes" array.
5659 2005-04-15 Raja R Harinath <rharinath@novell.com>
5661 Fix cs0208-7.cs and cs0208-8.cs.
5662 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5663 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
5664 error reporting to point out the reason a struct is not unmanaged.
5666 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5668 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
5669 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5671 2005-04-13 Raja R Harinath <rharinath@novell.com>
5674 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5675 IdenticalNameAndTypeName here.
5676 (EventExpr.InstanceResolve): Likewise.
5678 2005-04-13 Marek Safar <marek.safar@seznam.cz>
5680 C# 2.0 DefaultCharSetAttribute implementation
5682 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5683 which allows us to set GlobalNamespace for every resolve.
5684 (Attribute.ResolveArguments): Cut from Resolve.
5685 (Attribute.GetCharSetValue): Returns CharSet named argument.
5686 (Attribute.DefinePInvokeMethod): Gets default charset from
5688 (GlobalAttribute.ResolveAsTypeStep): Override.
5689 (GlobalAttribute.ResolveArguments): Override.
5691 * class.cs (TypeAttr): Is protected.
5693 * codegen.cs (ModuleClass.DefaultCharSet): New member.
5694 (ModuleClass.DefaultCharSetType): New memeber.
5695 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5697 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5698 charset from module.
5700 * delegate.cs (TypeAttr): Override.
5701 (Delegate.DefineType): Use this TypeAttr.
5703 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5704 at very early stage (before types are defined) to resolve model
5705 module attributes. It will probably not work with corlib but it
5708 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5709 charset from module.
5711 * typemanager.cs (default_charset_type): New type.
5713 2005-04-13 Raja R Harinath <rharinath@novell.com>
5715 * decl.cs (MemberCache.AddMethods): Don't warn if
5716 System.Object.Finalize has buggy MethodAttributes.
5718 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5721 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5723 * doc.cs : detect ambiguous reference to overloaded members.
5724 Fixed bug #71603. MS 1.1 csc does not detect it.
5726 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
5728 * doc.cs : delegates must not be referenced with parameters.
5731 2005-04-12 Miguel de Icaza <miguel@novell.com>
5733 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5735 2005-04-10 Miguel de Icaza <miguel@novell.com>
5737 * driver.cs (MainDriver): Stop processing if the CLS stage found
5740 (CompilerCallableEntryPoint.InvokeCompiler): Always
5741 reset after execution; Take a TextWriter argument for the
5744 * report.cs: Use the error stream instead of hardcoding stderr.
5746 2005-04-09 Miguel de Icaza <miguel@novell.com>
5748 * class.cs: Reduce code paths to test, too small of an
5749 optimization to make it worth the extra testing. Always perform
5752 2005-04-08 Raja R Harinath <rharinath@novell.com>
5755 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5756 operators that had errors reported on them.
5758 2005-04-08 Marek Safar <marek.safar@seznam.cz>
5760 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5762 (Attribute.Resolve): Add named argument type checking.
5764 * class.cs (FixedField.Define): Use IsPrimitiveType
5766 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5768 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5769 unsafe parameter types.
5771 * statement.cs (Using.ResolveExpression): Add better error description.
5773 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5775 2005-04-08 Raja R Harinath <rharinath@novell.com>
5778 * attribute.cs (Attribute.GetAttributeUsage): Resolve
5779 AttributeUsageAttribute in the emitcontext of the attribute class,
5780 not in the emitcontext of the attributable entity it was attached to.
5781 * cs-parser.jay: Use 'current_class', not 'current_container',
5782 when creating a GlobalAttribute.
5784 2005-04-08 Alp Toker <alp@atoker.com>
5786 * pending.cs: The fix to #58413 failed to compile methods implementing
5787 interfaces with/without params modifiers and vice versa, even though
5788 params modifiers aren't part of the signature. Make the modifier check
5789 less strict as in csc.
5791 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
5792 Anoob V E <projectmonokochi@rediffmail.com>
5793 Harilal P R <projectmonokochi@rediffmail.com>
5796 * pending.cs (TypeAndMethods.mods): New. Store the parameter
5797 modifiers of pending methods.
5798 (PendingImplementation.PendingImplementation): Initialize it.
5799 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5800 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5801 with ParameterData. Add check for modifiers.
5802 * class.cs (MethodData.Define): Update to changes.
5804 2005-04-07 Raja R Harinath <rharinath@novell.com>
5806 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5808 2005-04-07 Marek Safar <marek.safar@seznam.cz>
5810 * class.cs (PropertyMethod.Define): Check private accessor in abstract
5813 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5816 * typemanager.cs: Registered RequiredAttributeAttribute.
5818 2005-04-06 Marek Safar <marek.safar@seznam.cz>
5820 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5821 Warning CS0169 is back at level 3.
5822 (IMethodData.SetMemberIsUsed): New method.
5824 * decl.cs (IsUsed): New value; moved from FieldBase.Status
5825 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5827 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5829 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5831 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5834 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5837 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5838 to avoid the problems with nested types.
5840 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
5841 Anoob V.E <projectmonokochi@rediffmail.com>
5842 Harilal P.R <projectmonokochi@rediffmail.com>
5843 Raja R Harinath <rharinath@novell.com>
5846 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5848 * typemanager (GetConstructor): Make public.
5850 2005-04-05 John Luke <john.luke@gmail.com>
5851 Raja R Harinath <rharinath@novell.com>
5854 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5855 struct too. Return false quicker in a few cases.
5856 (VerifyUnManaged): Use it.
5858 2005-04-05 Raja R Harinath <rharinath@novell.com>
5861 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5862 not 'unreachable_seen'.
5864 2005-04-04 Marek Safar <marek.safar@seznam.cz>
5866 * attribute.cs (Attribute.GetValue): Removed unused.
5868 * codegen.cs (CodeGen.TrimExt): Removed unused.
5870 * cs-parser.jay (output): Removed unused.
5872 * cs-tokenizer.cs (hex_digits): Removed unused.
5874 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5876 * expression.cs (Indirection.LoadExprValue): Removed unused.
5877 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5879 * iterators.cs (Iterator.param_types): Removed unused.
5881 * statement.cs (Goto.block): Removed unused.
5882 (ToplevelBlock.did): Removed unused.
5883 (Switch.ResolveConstantSwitch): Removed unused.
5885 2005-04-01 Ben Maurer <bmaurer@ximian.com>
5887 * rootcontext.cs: Allow mcs to bootstrap with the compilation
5890 2005-04-01 Raja R Harinath <rharinath@novell.com>
5892 Fix #74232 and cs0208-3.cs.
5893 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5894 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5895 unmanaged type. Don't use FieldBuilders when 't' is a
5896 TypeBuilder. Use ModFlags and MemberType fields.
5897 * class.cs (MemberBase.member_type): Rename from MemberType.
5898 (MemberBase.MemberType): New property. Determines member_type on
5900 (MemberBase.DoDefine): Don't initialize MemberType here.
5901 (FieldMember.Define): Likewise.
5903 2005-04-01 Marek Safar <marek.safar@seznam.cz>
5906 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5907 Attributes are emitted there.
5909 2005-04-01 Raja R Harinath <rharinath@novell.com>
5911 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5912 keyword in 'partial enum' too.
5913 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5915 Report from Kamil Skalski <nazgul@omega.pl>.
5918 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5919 have partial containers too.
5921 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5922 in block' checks to Block.CheckInvariantMeaningInBlock.
5923 * statement.cs (Block.GetKnownVariableInfo): Make private.
5924 (Block.IsVariableUsedInChildBlock): Remove.
5925 (Block.IsVariableUsedInBlock): Likewise.
5926 (Block.CheckInvariantMeaningInBlock): New. Show location of
5927 conflicting declaration.
5928 (Block.AddVariable): Make error messages less long-winded and more
5929 specific. Show location of conflicting declaration.
5930 * parameter.cs (Parameters.Location): New readonly property.
5932 2005-03-31 Raja R Harinath <rharinath@novell.com>
5934 Clean up semantics of invoking ResolveMemberAccess.
5935 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5936 can have an instance, ensure that we pass in a non-TypeExpression
5937 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
5938 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5939 argument. Update to changes and simplify.
5940 (FieldExpr.Emitinstance): Remove CS0120 check.
5941 (PropertyExpr.EmitInstance): Likewise.
5942 * expression.cs (Argument.Resolve): Likewise.
5943 (Invocation.DoResolve): Update to changes in semantics of
5946 2005-03-31 Marek Safar <marek.safar@seznam.cz>
5949 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5952 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5954 2005-03-31 Raja R Harinath <rharinath@novell.com>
5956 Fix difference in behaviour with commandline invocation.
5957 * driver.cs (Driver.Reset): New.
5958 (CompilerCallableEntryPoint): Call it.
5960 * statement.cs (If.Resolve): Avoid spurious "uninitialized
5961 variable" warnings if the boolean expression failed to resolve.
5963 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
5965 * attribute.cs: Fix the union of several permissions when some of them
5966 are unrestricted (so the result isn't an unrestricted permission set).
5969 2005-03-30 Raja R Harinath <rharinath@novell.com>
5971 * ecore.cs (MemberExpr): New class. Convert from interface
5973 (MemberExpr.ResolveMemberAccess): Refactor and move here from
5974 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
5976 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5977 (MethodGroupExpr.IsExplicitImpl): Remove.
5978 (Expression.GetFieldFromEvent): Remove.
5979 (SimpleName.MemberStaticCheck): Remove.
5980 (SimpleName.DoSimpleNameResolve): Update to changes.
5981 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5982 (MemberAccess.IdenticalNameAndTypeName): Remove.
5983 (MemberAccess.error176): Move to MemberExpr.
5984 (MemberAccess.DoResolve): Update to changes.
5985 (BaseAccess.DoResolve): Likewise.
5987 2005-03-30 Marek Safar <marek.safar@seznam.cz>
5989 C# 2.0 Conditional attribute class implementation
5991 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5992 Analyzes class whether it has attribute which has ConditionalAttribute
5993 and its condition is not defined.
5995 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5996 (Class.IsExcluded): New method. Search for at least one defined
5997 condition in ConditionalAttribute of attribute class.
5999 2005-03-30 Raja R Harinath <rharinath@novell.com>
6001 * ecore.cs (PropertyExpr): Derive from Expression, not
6002 ExpressionStatement.
6003 (PropertyExpr.EmitStatement): Remove.
6005 2005-03-29 Raja R Harinath <rharinath@novell.com>
6008 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6009 internal field "value__" of an enum be private. The examples for
6010 "value__" that I found on MSDN all used FieldAttributes.Private.
6012 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6013 Don't mention IL method attribute names.
6015 Fix #47991. Remove a TODO.
6016 * statement.cs (Block.Toplevel): Make into a field.
6017 (Block.Parameters): Move into ToplevelBlock.
6018 (Block.known_variables): Rename from child_variable_names.
6019 (Block.Block): Remove variants that take Parameters. Initialize
6020 'Toplevel' with the immediately surrounding toplevel block.
6021 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
6022 LocalInfo parameter.
6023 (Block.GetKnownVariableInfo): New.
6024 (Block.IsVariableNameUsedInChildBlock): Update.
6025 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
6026 the block, even though it may not be in scope.
6027 (Block.AddVariable): Remove Parameters parameter. Use
6028 Toplevel.Parameters instead.
6029 (Block.AddConstant): Remove Parameters parameter.
6030 (Block.GetParameterReference): Update to use Toplevel.Parameters.
6031 (Block.IsParamaterReference): Likewise.
6032 (Block.IsLocalParameter): Likewise. Simplify a lot.
6033 (ToplevelBlock.Parameters): New. Moved from Block.
6034 (ToplevelBlock.ToplevelBlock): Update to changes. Always
6035 initialize Parameters to a non-null value.
6036 * cs-parser.jay: Update to changes.
6037 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6038 simple names that mean different things in the same block. Use
6039 Block.IsVariableNameUsedInBlock.
6041 2005-03-28 Raja R Harinath <rharinath@novell.com>
6043 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6044 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6045 GetTypeHandle. It is possible for a reflected type to derive from
6046 a TypeBuilder (e.g., int[] derives from the TypeBuilder
6047 System.Array during mscorlib compilation).
6048 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6049 contain a method_hash, don't create one either. Don't create a
6050 deep copy of the base cache's method_hash.
6051 (MemberCache.SetupCache): Rename back from DeepCopy.
6052 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6053 already initialized. If we see an override function, add its
6054 underlying base virtual function to the member_hash too.
6056 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6058 2005-03-26 Raja R Harinath <harinath@acm.org>
6061 * assign.cs (Assign.DoResolve): When the RHS of an assignment
6062 fails to resolve, ensure that the LHS is still resolved as an
6065 2005-03-25 Raja R Harinath <harinath@acm.org>
6067 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6069 (Enum.current_ec): Remove.
6070 (Enum.LookupEnumValue): Remove EmitContext argument.
6071 Just uses the one created during DefineType.
6072 (Enum.FindMembers): Update.
6073 * expression.cs (MemberAccess.DoResolve): Update.
6075 2005-03-22 Marek Safar <marek.safar@seznam.cz>
6077 * assign.cs (Assign.DoResolve): Check for CS1717 when
6078 source and target are same (uses Equals).
6080 * expression.cs (LocalVariableReference, ParameterReference,
6081 This): Implemented Equals, GetHashCode.
6083 * statement.cs (Block.GetParameterReference): Removed useless
6086 2005-03-22 Raja R Harinath <rharinath@novell.com>
6089 * statement.cs (Block.AddVariable): Ensure that we skip implicit
6090 blocks before deciding whether the error is cs0136 or cs0128.
6092 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6093 (using_alias_directive, using_namespace_directive): Pass
6094 MemberName, not an expression to Namespace.UsingAlias and
6096 (MakeName): Use the MemberName of the namespace.
6097 * namespace.cs (Namespace.MemberName): New.
6098 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6099 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6101 * decl.cs (MemberName.Name): Make readonly.
6102 (MemberName.FromDotted): New "constructor".
6103 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6104 (MemberCore.Name): Compute from MemberName on demand.
6105 (MemberCore.SetMemberName): Provide a way to change the
6107 (MemberCore.AddToContainer): Don't take a fullname parameter.
6108 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6109 fully qualified name of the container to the member name.
6110 (TypeContainer.AddToTypeContainer): Use a fully qualified name
6111 only if the type is a member of the root container.
6112 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6113 MemberName.Left rather than searching for an embedded ".".
6114 (PartialContainer.CreatePart): Update to changes in RootContext.
6115 (MemberBase.ShortName): Turn into a property. Use
6116 MemberCore.SetMemberName.
6117 (MemberBase.ExplicitInterfaceName): Remove.
6118 (MemberBase.UpdateMemberName): Remove.
6119 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6120 (PropertyBase.SetMemberName): New override.
6121 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6122 (Tree.GetDecl): New.
6123 (Tree.AllDecls): Rename from Decls.
6124 * attribute.cs, enum.cs, report.cs: Update to changes.
6125 * driver.cs (MainDriver): Use MemberName.FromDotted on
6126 RootContext.MainClass.
6128 2005-03-21 Marek Safar <marek.safar@seznam.cz>
6130 * class.cs (FixedField.Define): Check for CS1664 and more sanity
6133 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6135 2005-03-18 Marek Safar <marek.safar@seznam.cz>
6137 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6138 property accessor modifiers.
6140 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6141 fixed buffer attribute (CS1716).
6142 (PropertyMethod.HasCustomAccessModifier): When property accessor
6143 has custom modifier.
6145 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6147 (PropertyExpr.DoResolveLValue): Add CS0272.
6149 2005-03-17 Miguel de Icaza <miguel@novell.com>
6151 * convert.cs: When converting to a pointer, use the proper Conv.U
6152 or Conv.I depending on the source data type.
6154 * cs-tokenizer.cs: Make the size for large decimal constants,
6157 2005-03-17 Martin Baulig <martin@ximian.com>
6159 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6160 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6162 2005-03-17 Martin Baulig <martin@ximian.com>
6164 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6165 to bool so we can return an error condition.
6166 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6169 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
6171 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6174 2005-03-16 Raja R Harinath <rharinath@novell.com>
6176 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6177 Refactor to avoid traversing the list of assemblies, and to avoid
6178 string concatenation.
6179 * typemanager.cs (guid_attr_type): Remove.
6180 (negative_hits, pointers, references): Remove hashes.
6182 (GetConstructedType): New. Uses type_hash to handle constructed
6183 types (arrays, references, pointers).
6184 (GetReferenceType, GetPointerType): Use it.
6185 (GetNestedType): New. Uses type_hash to handle nested types of
6187 (LookupType, LookupTypeDirect): Remove.
6188 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
6189 'types' hash and LookupTypeReflection directly.
6190 (params_string, params_object): Use GetConstructedType.
6191 * namespace.cs (Namespace.cached_types): New. Cache of reflected
6193 (Namespace.Lookup): Use cached_types.
6194 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6195 provided by old TypeManager.LookupType.
6196 * rootcontext.cs (MakeFQN): Remove.
6197 * decl.cs (DeclSpace.MakeFQN): Likewise.
6198 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6199 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6200 TypeManager.GetConstructedType.
6201 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6203 2005-03-15 Marek Safar <marek.safar@seznam.cz>
6205 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
6208 * cs-parser.jay: Reports CS1527 for any namespace element.
6210 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6213 * expression.cs (ParameterReference.IsAssigned): Changed error to
6215 (Error_WrongNumArguments): Moved CS0245 detection here.
6217 * statement.cs (Return.Resolve): Add CS1622 report.
6219 2005-03-11 Marek Safar <marek.safar@seznam.cz>
6221 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6223 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
6225 * attribute.cs expression.cs: Get rid of some allocations.
6227 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
6229 * doc.cs : just eliminate the latest change.
6231 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6233 * doc.cs : commented out the latest change. It breaks xml-030.cs
6235 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6237 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6238 fail. So invoke CreateType() in FindDocumentedType().
6240 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
6242 * cs-tokenizer.cs : added IsKeyword().
6243 * doc.cs : Detect keyword incorrectly used as identifier.
6244 Allow identifiers prefixed by @.
6246 2005-03-10 Marek Safar <marek.safar@seznam.cz>
6248 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6249 It caused exception in namespace resolving (again!).
6251 * class.cs (Class.ctor): Removed exit.
6252 (PropertyMethod.ctor): ditto.
6254 * codegen.cs (Codegen.Reset): Reset static data.
6255 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6257 * cs-tokenizer.cs (Cleanup): Removed.
6259 * driver.cs (GetSystemDir): Rewrote to one line command.
6260 It caused problem with unloaded dynamic modules.
6261 (UnixParseOption): Removed Exit.
6262 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6263 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6264 Now can be mcs used as library.
6266 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6269 * location.cs (Reset): Reset static data.
6271 * namespace.cs (Reset): Reset static data.
6273 * report.cs (Report.Reset): Reset static data.
6275 * rootcontext.cs (RootContext.Reset): Reset static data.
6277 * tree.cs (RootTypes.ctor): Use Location.Null
6279 * typemanager.cs (TypeManager.Reset): Reset static data.
6280 (CoreLookupType): Removed Exit.
6281 (TypeHandle.Reset): Reset static data.
6283 2005-03-10 Raja R Harinath <rharinath@novell.com>
6286 * typemanager.cs (ComputeNamespaces): Import namespaces from
6287 referenced modules too.
6289 2005-03-09 Raja R Harinath <rharinath@novell.com>
6291 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6294 2005-03-09 Raja R Harinath <rharinath@novell.com>
6296 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6297 enclosing DeclSpace. This ensures that a name-lookup populates
6298 more caches and there are fewer 'TypeExpression's. Carve out
6299 nested type lookup into ...
6300 (LookupNestedTypeInHierarchy): ... this.
6302 2005-03-09 Raja R Harinath <rharinath@novell.com>
6304 Clean up a few partial-class semantics.
6305 Fixes test-357.cs and cs1618-2.cs.
6306 * cs-parser.jay (struct_declaration): Use 'current_class' as
6307 parent of newly-created struct. Remove call to Register ().
6308 Use 'pop_current_class' to complete handing the current struct.
6309 (interface_declaration): Likewise.
6310 (class_declaration): Likewise.
6311 (enum_declaration): Use 'current_class' as parent of newly created
6313 (delegate_declaration): Likewise.
6314 (pop_current_class): New function. This is used to handle closing
6315 up the 'current_class' and 'current_container', and pointing them
6316 to the enclosing class/container.
6317 (CSharpParser): Initialize 'current_class' too.
6318 * decl.cs (MemberCore): Add check for invariant: a partial
6319 container is not a parsed entity, and thus does not enclose any
6321 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6322 (DeclSpace.BaseTypeExpr): Use it.
6323 (DeclSpace.LookupType): Add check for invariant.
6324 * class.cs (TypeContainer): Add check for invariant: a nested
6325 class should have the same NamespaceEntry as its enclosing class.
6326 (TypeContainer.EmitFieldInitializers): Make virtual.
6327 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6329 (TypeContainer.Register): Remove.
6330 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6331 null. Use TypeResolveEmitContext for resolving base types and
6332 interfaces. Move initialization of Parts.TypeBuilder here from
6334 (TypeContainer.DefineNestedTypes): ... here.
6335 (PartialContainer): Take a Namespace not a NamespaceEntry.
6336 (PartialContainer.Create): Don't use Register. Call the
6337 appropriate Add... function directly.
6338 (ClassPart): Take both the PartialContainer and the enclosing
6339 class as constructor arguments.
6340 (ClassPart.EmitFieldInitializers): Override.
6341 (ClassPart.PartFindNestedTypes): Remove.
6342 (FieldBase.GetInitializerExpression): Resolve the initializer
6343 expression in the emit context of the enclosing class.
6344 * tree.cs (RootTypes): Remove Register ().
6346 2005-03-08 Marek Safar <marek.safar@seznam.cz>
6348 * cs-parser.jay: Removed CS0134.
6350 * driver.cs: Removed CS1901.
6352 * expression.cs (SizeOf.DoResolve): Don't report CS0233
6353 for predefined types.
6355 2005-03-07 Duncan Mak <duncan@novell.com>
6357 * codegen.cs (Save): Catch UnauthorizedAccessException as
6358 well. Fixes bug #73454.
6360 2005-03-07 Marek Safar <marek.safar@seznam.cz>
6362 * cs-tokenizer.cs (xtoken): Add CS1035.
6364 * class.cs (MethodData.Define): Add CS0683.
6365 (FieldMember.ctor): Add CS0681.
6367 2005-03-07 Raja R Harinath <rharinath@novell.com>
6369 * ecore.cs (SimpleName.DoResolve): Rename from
6370 SimpleName.DoResolveAllowStatic.
6371 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6372 Pass 'intermediate' flag to MemberStaticCheck.
6373 (SimpleName.MemberStaticCheck): Skip "static check" only in case
6374 of "intermediate" lookups via MemberAccess.
6375 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
6376 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6378 2005-03-07 Raja R Harinath <rharinath@novell.com>
6381 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6382 slipped in because of variable names that are identical to a
6383 builtin type's BCL equivalent ('string String;', 'int Int32;').
6384 (PropertyExpr.EmitInstance): Likewise.
6386 2005-03-04 Marek Safar <marek.safar@seznam.cz>
6388 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6390 * report.cs (warning_ignore_table): Made public.
6392 2005-03-04 Raja R Harinath <rharinath@novell.com>
6395 * class.cs (MethodData.Emit): Pass 'container' to
6396 container.GetObsoleteAttribute instead of 'container.Parent'.
6398 2005-03-03 Marek Safar <marek.safar@seznam.cz>
6400 * cs-parser.jay: Add 1534 error test.
6402 * iterators.cs (Yield.CheckContext): Add error 1629.
6403 (Iterator.ctor): Save unsafe modifier.
6404 (MoveNextMethod.DoEmit): Restore unsafe context.
6406 * namespace.cs (UsingAlias): Better error message.
6408 2005-03-03 Dan Winship <danw@novell.com>
6410 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6411 the warning message [#73219]
6413 2005-03-03 Raja R Harinath <rharinath@novell.com>
6415 Fix compile with MCS 1.0.0.0.
6416 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6417 w_restore to not depend on string constant folding.
6419 2005-03-03 Raja R Harinath <rharinath@novell.com>
6421 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
6422 CS0246 check to users who passed 'silent = false'.
6423 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6425 (SimpleName.SimpleNameResolve): Update.
6426 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6427 (MemberAccess.IdenticalNameAndTypeName): Update.
6428 * doc.cs (FindDocumentedTypeNonArray): Update.
6430 2005-03-03 Raja R Harinath <rharinath@novell.com>
6432 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6433 * parameters.cs (ComputeAndDefineParameters): Remove.
6434 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6435 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6436 Use GetParameterInfo.
6438 2005-03-02 Marek Safar <marek.safar@seznam.cz>
6440 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6442 2005-03-02 Raja R Harinath <rharinath@novell.com>
6444 Unify DeclSpace.LookupType and DeclSpace.FindType.
6445 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
6446 is in charge of defining nested types on demand.
6447 (DeclSpace.LookupType): Use it when the current_type is a
6448 TypeBuilder. Use LookupTypeDirect for reflected types.
6449 (DeclSpace.FindType): Remove.
6450 (DeclSpace.LookupInterfaceOrClass): Likewise.
6451 (DeclSpace.DefineTypeAndParents): Likewise.
6452 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6453 DeclSpace.LookupType.
6454 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6455 * typemanager.cs (LookupType): Simplify.
6456 (AddUserType): Remove type from negative_hits.
6457 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6458 * class.cs (TypeContainer.FindMembers): Move handling of nested
6460 (TypeContainer.FindMembers_NestedTypes): ... here.
6461 (TypeContainer.FindNestedType): Implement override.
6462 (ClassPart.FindNestedType): Delegate to PartialContainer.
6463 (ClassPart.PartFindNestedType): Looks up the nested types of the
6466 2005-03-02 Martin Baulig <martin@ximian.com>
6468 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6469 static constructor in static classes.
6471 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
6473 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6474 sizeParamIndex is not specified.
6476 2005-03-01 Marek Safar <marek.safar@seznam.cz>
6479 * report.cs (WarningMessage.IsEnabled): Missing null check.
6481 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6483 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6484 in the fields and not in the properties.
6486 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
6488 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
6491 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6493 * attribute.cs: Small refactoring (improved robustness).
6494 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6495 (ValidateGuid): Removed.
6496 (Resolve): Removed referenced to above mentioned.
6497 (GetAttributeUsage): Made private and changed to work without
6499 (GetIndexerAttributeValue): Don't crash.
6500 (GetConditionalAttributeValue): Ditto.
6501 (GetClsCompliantAttributeValue): Ditto.
6502 (ExtractSecurityPermissionSet): All attributes exceptions are
6504 (GetPropertyValue): New helper.
6505 (GetMethodImplOptions): New method.
6506 (DefinePInvokeMethod): Reuse common code. Implemented handling of
6507 some missing properties.
6509 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6510 (Method.ApplyAttributeBuilder): Updated.
6512 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6515 2005-02-28 Raja R Harinath <rharinath@novell.com>
6518 * report.cs (Report.SymbolRelatedToPreviousError): Handle
6519 non-simple types (array, pointer, reference).
6521 2005-02-28 Marek Safar <marek.safar@seznam.cz>
6523 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6525 * class.cs (MethodCore.IsDuplicateImplementation): Special error
6527 (Method.CheckBase): Catch wrong destructor here.
6528 (MethodData.Define): Add errors 550, 668.
6530 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6532 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6534 * pending.cs (VerifyPendingMethods): Add error 551.
6536 * typemanager.cs (CSharpName): Next error report helper.
6538 2005-02-25 Marek Safar <marek.safar@seznam.cz>
6540 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6541 attributes. Removed useless attribute double check.
6542 It saves almost 2MBs for corlib.
6544 2005-02-25 Raja R Harinath <rharinath@novell.com>
6547 * statement.cs (ExpressionStatement.Resolve): Make robust to being
6548 called twice in case of error.
6550 2005-02-23 Chris Toshok <toshok@ximian.com>
6552 Fix compiler portions of #72827.
6553 * statement.cs (Block.Emit): call Begin/EndScope on the
6554 EmitContext instead of the ILGenerator.
6556 * codegen.cs (EmitContext.BeginScope): new method, call
6557 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6559 (EmitContext.BeginScope): same, but EndScope and CloseScope
6561 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6562 offset and call the superclass's OpenScope(int) with it.
6563 (SymbolWriter.CloseScope): get the current il
6564 offset and call superclass's CloseScope(int) with it.
6566 2005-02-23 Marek Safar <marek.safar@seznam.cz>
6568 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6569 CS1677 for out and ref as well.
6571 * class.cs (Method.Define): Add error CS1599 detection.
6573 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6575 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6577 * delegate.cs (Delegate.Define): Add error CS1599 detection.
6579 * support.cs.cs (ModifierDesc): New helper method.
6581 2005-02-23 Raja R Harinath <rharinath@novell.com>
6582 Abin Thomas <projectmonokochi@rediffmail.com>
6583 Anoob V E <projectmonokochi@rediffmail.com>
6584 Harilal P R <projectmonokochi@rediffmail.com>
6587 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6588 MemberLookup (used for error reporting) actually returns a result.
6589 Fix error report number (122, not 112).
6591 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
6592 Anoob V E <projectmonokochi@rediffmail.com>
6593 Harilal P R <projectmonokochi@rediffmail.com>
6596 * pending.cs (PendingImplementation.GetAbstractMethods):
6597 Find NonPublic members too.
6599 2005-02-22 Marek Safar <marek.safar@seznam.cz>
6601 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6604 * class.cs (MethodCore.CheckMethodAgainstBase):
6605 Add error 239 report.
6607 2005-02-21 Raja R Harinath <rharinath@novell.com>
6610 * expression.cs (Invocation.IsApplicable): Make public.
6611 (Invocation.IsParamsMethodApplicable): Likewise.
6612 * delegate.cs (Delegate.VerifyApplicability): Don't use
6613 Invocation.VerifyArgumentCompat for parameter applicability
6614 testing. Use Invocation.IsApplicable and
6615 Invocation.IsParamsMethodApplicable.
6617 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6619 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6621 * class.cs (Operator.Define): Add error 217 report.
6623 2005-02-21 Raja R Harinath <rharinath@novell.com>
6625 * namespace.cs (UsingEntry.Resolve): Undo change below.
6627 2005-02-21 Raja R Harinath <rharinath@novell.com>
6630 * ecore.cs (Expression.MemberLookupFailed): Add argument to
6631 disable the error message when the extended MemberLookup also
6633 (Expression.MemberLookupFinal): Update.
6634 (SimpleName.DoSimpleNameResolve): Update.
6635 * expression.cs (MemberAccess.ResolveNamespaceOrType):
6636 Don't use MemberLookupFinal.
6637 (New.DoResolve): Update.
6638 (BaseAccess.CommonResolve): Update.
6640 2005-02-21 Raja R Harinath <rharinath@novell.com>
6643 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6644 occured previously, don't resolve again.
6646 2005-02-21 Marek Safar <marek.safar@seznam.cz>
6649 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6650 argument. Call ResolveAttributeUsage for unresolved.
6651 when types doesn't match ctor arguments.
6653 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6654 for nested attribute classes.
6655 (Class.attribute_usage): Removed.
6656 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6657 for attribute class.
6659 * ecore.cs (IsAttribute): Removed.
6661 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6663 * rootcontext.cs (RegisterAttribute): Removed, attributes are
6665 (attribute_types): Removed.
6666 (EmitCode): Global attributes are emited as the latest.
6668 2005-02-18 Marek Safar <marek.safar@seznam.cz>
6670 * class.cs (EmitFieldInitializers): Don't emit field initializer
6671 for default values when optimilization is on.
6673 * constant.cs (Constant.IsDefaultValue): New property.
6675 * driver.cs: Add /optimize handling.
6679 * literal.cs: Implement new IsDefaultValue property.
6681 * rootcontext.cs (Optimize): New field, holds /optimize option.
6683 2005-02-18 Raja R Harinath <rharinath@novell.com>
6685 Fix crasher in re-opened #72347.
6686 * namespace.cs (Namespace.Lookup): Return null if
6687 DeclSpace.DefineType returns null.
6690 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6692 2005-02-18 Raja R Harinath <rharinath@novell.com>
6694 Fix remainder of #63202. Change semantics of DoResolveLValue: it
6695 now returns null if it cannot resolve to an lvalue.
6696 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6697 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6698 returned null. Remove check for SimpleName.
6699 (EventExpr.DoResolveLValue): New.
6700 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6701 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
6703 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
6705 (Unary.ResolveOperator): Move CS0211 check ...
6706 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
6708 (Unary.DoResolveLValue): Simplify.
6709 (AddressOf.DoResolveLValue): New.
6710 (ArrayAccess.DoResolveLValue): New.
6712 2005-02-16 Marek Safar <marek.safar@seznam.cz>
6714 * attribute.cs (Attribute.Resolve): Add arguments casting for
6715 when types doesn't match ctor arguments.
6717 2005-02-16 Raja R Harinath <rharinath@novell.com>
6719 Fix parts of #63202.
6720 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6721 lookup of operator in base type. Ensure that all checks happen
6722 when the operator resolves to an "op_..." method.
6724 2005-02-15 Raja R Harinath <rharinath@novell.com>
6727 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6728 'ignore_cs0104' parameter. Pass it to ...
6729 (NamespaceEntry.Lookup): ... this.
6730 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6731 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6732 (TypeLookupExpression.DoResolveAsTypeStep): Update.
6733 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6734 Update. Request that cs0104 errors be ignored.
6735 (ComposedCast.ResolveAsTypeStep): Update.
6737 2005-02-14 Raja R Harinath <rharinath@novell.com>
6740 * expression.cs (Invocation.BetterFunction): Remove support for
6741 comparing virtual functions and their overrides.
6742 (Invocation.IsOverride): New.
6743 (Invocation.OverloadResolve): Don't consider 'override' functions
6744 during candidate selection. Store them in a lookaside list.
6745 If the selected method is a 'virtual' function, use the list to
6746 find any overrides that are closer to the LHS type.
6748 2005-02-14 Marek Safar <marek.safar@seznam.cz>
6750 * expression.cs (New.DoResolve): Add complex core type reduction.
6751 (New.Constantify): Converts complex core type syntax like 'new int ()'
6754 2005-02-14 Raja R Harinath <rharinath@novell.com>
6756 * decl.cs (EntryType.EntryType): New constructor to create an
6757 updated copy of a cache entry.
6758 (MemberCache.AddMethods): Use it.
6759 (MemberCache.ClearDeclaredOnly): Remove.
6760 (MemberCache.MemberCache): Update.
6762 2005-02-11 Miguel de Icaza <miguel@novell.com>
6764 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6765 variable. This one is represents the actual low-level declaration
6766 of the method, as opposed to the semantic level `IsStatic'.
6768 An anonymous method which is hosted into a static method might be
6769 actually an instance method. IsStatic would reflect the
6770 container, while MethodIsStatic represents the actual code
6773 * expression.cs (ParameterReference): Use the new MethodIsStatic
6774 instead of IsStatic.
6776 * anonymous.cs (AnonymousMethod.Compatible): Pass the
6777 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6778 set on the current EmitContext.
6780 * expression.cs (Cast): Overload DoResolveLValue so we can pass
6781 resolve our casted expression as an LValue. This triggers the
6782 proper LValue processing that is later required by Assign.
6786 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6788 2005-02-11 Marek Safar <marek.safar@seznam.cz>
6790 C# 2.0 Fixed buffer implementation
6792 * anonymous.cs: Update after RegisterHelperClass renaming.
6794 * attribute.cs (AttributeTester.fixed_buffer_cache):
6795 Cache of external fixed buffers.
6796 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6797 implementation if field is fixed buffer else null.
6800 (TypeContainer.AddField): Accept FieldMember instead of Field.
6801 (FieldBase.IsFieldClsCompliant): Extracted code from
6802 VerifyClsCompliance descendant customization.
6803 (FixedField): New class handles fixed buffer fields.
6804 (FixedFieldExternal): Keeps information about imported fixed
6806 (IFixedField): Make access to internal or external fixed buffer
6809 * cs-parser.jay: Add fixed buffer parsing.
6811 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6814 * expression.cs (Indirection): Extended implementation to accept
6816 (PointerArithmetic.Emit): Get element from fixed buffer as well.
6817 (ElementAccess.MakePointerAccess): Get type as parameter.
6818 (DoResolve): Add fixed buffer field expression conversion.
6819 (DoResolveLValue): Ditto.
6820 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6821 (ArrayPtr): Derives from FixedBufferPtr.
6822 (ArrayPtr.Emit): Add extra emit for array elements.
6824 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6826 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6827 for compiler generated types.
6828 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6830 * statement.cs (Fixed): Refactored to be easier add fixed buffer
6831 and consume less memory.
6832 (Fixed.Resolve): Add fixed buffer case.
6834 * typemanager.cs (compiler_generated_attr_ctor,
6835 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6836 (HasElementType): Add our own implementation to work on every
6839 2005-02-11 Miguel de Icaza <miguel@novell.com>
6841 * anonymous.cs (CaptureContext): Track whether `this' has been
6844 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
6845 only captured `this' if it was implicitly done (instance
6846 methods/variables were used).
6848 * codegen.cs (EmitContext.CaptureThis): New method to flag that
6849 `this' must be captured.
6851 2005-01-30 Miguel de Icaza <miguel@novell.com>
6853 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6854 is null it means that there has been no need to capture anything,
6855 so we just create a sibling.
6857 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6859 Just a partial fix. The other half is fairly elusive.
6861 2005-02-10 Raja R Harinath <rharinath@novell.com>
6863 Fix #52586, cs0121-4.cs.
6864 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
6865 and return a hashtable.
6866 (MemberCache.ClearDeclaredOnly): New.
6867 (MemberCache.MemberCache): Update to change. Make a deep copy of
6868 the method_hash of a base type too.
6869 (MemberCache.AddMethods): Adapt to having a deep copy of the base
6870 type methods. Overwrite entries with the same MethodHandle so
6871 that the ReflectedType is correct. The process leaves in base
6872 virtual functions and their overrides as distinct entries.
6873 (CacheEntry): Now a class instead of a struct. It shouldn't alter
6874 matters since it was boxed in a ArrayList before.
6875 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6877 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
6878 case of a virtual function and its override (choose the overload
6880 (Invocation.OverloadResolve): Avoid 'override' members during
6881 'applicable_type' calculation.
6883 2005-02-09 Raja R Harinath <rharinath@novell.com>
6885 Combine two near-redundant caches.
6886 * typemanager.cs (method_params): Rename from method_internal_params.
6887 (TypeManager.GetParameterData): New. Replace
6888 Invocation.GetParameterData.
6889 (TypeManager.LookupParametersByBuilder): Remove.
6890 * expression.cs (Invocation.method_parameter_cache): Remove.
6891 (Invocation.GetParameterData): Remove.
6893 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6896 2005-02-08 Raja R Harinath <rharinath@novell.com>
6899 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6900 TypeManager.multicast_delegate_type is null, resolve it by looking
6901 up "System.MulticastDelegate".
6902 * rootcontext.cs (RootContext.ResolveCore): Simplify.
6904 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
6905 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
6906 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
6909 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6910 (LabeledStatement.AddReference): New. Set 'referenced'.
6911 (Goto.Resolve): Use it.
6913 2005-02-05 John Luke <john.luke@gmail.com>
6915 * driver.cs: remove duplicate -doc line in Usage ()
6917 2005-02-04 Raja R Harinath <rharinath@novell.com>
6919 * location.cs (Location.AddFile): Fix CS2002 error report.
6921 2005-02-02 Martin Baulig <martin@ximian.com>
6923 * delegate.cs (Delegate.DefineType): Report an internal error if
6924 TypeManager.multicast_delegate_type is null. See bug #72015 for
6927 2005-02-02 Raja R Harinath <rharinath@novell.com>
6929 Fix a crasher in a variant of #31984.
6930 * const.cs (Constant.CheckBase): New override that defers the
6931 new-or-override check in case the base type hasn't been populated
6933 (Constant.Define): Ensure the new-or-override check is performed.
6935 2005-02-01 Duncan Mak <duncan@ximian.com>
6937 * const.cs (LookupConstantValue): Check that `ce' is not null
6938 before calling GetValue ().
6940 2005-02-01 Raja R Harinath <rharinath@novell.com>
6942 Fix test-334.cs (#69519).
6943 * cs-parser.jay (using_alias_directive): Pass in an expression to
6944 NamespaceEntry.UsingAlias.
6945 (using_namespace_directive): Pass in an expression to
6946 NamespaceEntry.Using.
6947 (namespace_name): Don't flatten to a string.
6948 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6949 (NamespaceEntry.AliasEntry.Resolve): Lookup using
6951 (NamespaceEntry.UsingEntry): Likewise.
6952 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6954 (NamespaceEntry.LookupForUsing): Remove.
6955 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6957 (NamespaceEntry.Lookup): Remove support for dotted names.
6959 2005-02-01 Raja R Harinath <rharinath@novell.com>
6961 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6963 (NamespaceEntry.ImplicitParent): Compute on demand.
6964 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6965 parallels the current.
6966 (NamespaceEntry.LookupForUsing): Use it.
6967 (NamespaceEntry.Lookup): If the current namespace-entry is
6968 implicit, don't search aliases and using tables.
6970 2005-02-01 Raja R Harinath <rharinath@novell.com>
6973 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6975 (TypeContainer.BaseCache): Compute on demand.
6976 (TypeContainer.FindMembers): Define constants and types if they're
6977 not already created.
6978 (FieldMember.Define): Move resetting of ec.InUnsafe before error
6980 * const.cs (Constant.Define): Make idempotent.
6982 2005-01-29 Miguel de Icaza <miguel@novell.com>
6984 * pending.cs: Produce better code (no nops produced by using Ldarg
6987 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6988 i - 1' it should be arg + 1.
6992 2005-01-28 Raja R Harinath <rharinath@novell.com>
6994 * attribute.cs (Attribute.CheckAttributeType): Make private
6996 (Attribute.ResolveType): Make virtual.
6997 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6998 handling of RootContext.Tree.Types.
7000 2005-01-27 Raja R Harinath <rharinath@novell.com>
7002 Update attribute-handling to use the SimpleName/MemberAccess
7004 * cs-parser.jay (attribute): Pass in an expression to the
7005 constructors of Attribute and GlobalAttribute.
7006 * attribute.cs (Attribute): Take an expression for the name.
7007 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
7008 passed in attribute name expression.
7009 (Attribute.CheckAttributeType): Use it.
7010 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7011 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7012 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
7013 argument to prevent error messages if the lookup fails.
7015 2005-01-27 Marek Safar <marek.safar@seznam.cz>
7017 * expression.cs (Indirection): Implemented IVariable interface
7018 to support indirection in AddressOf operator.
7019 (PointerArithmetic.Emit): Add optimalization for case where
7020 result can be precomputed.
7022 2005-01-26 Martin Baulig <martin@ximian.com>
7024 * class.cs (TypeContainer.AttributeTargets): Return the correct
7025 AttributeTargets depending on our `Kind' instead of throwing an
7026 exception; fixes #71632.
7028 2005-01-26 Marek Safar <marek.safar@seznam.cz>
7031 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7034 2005-01-25 Raja R Harinath <rharinath@novell.com>
7037 * expression.cs (MemberAccess.DoResolve): Don't complain with
7038 cs0572 when the LHS of a member access has identical name and type
7041 2005-01-25 Marek Safar <marek.safar@seznam.cz>
7044 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7046 Create custom PermissionSet only for PermissionSetAttribute.
7048 2005-01-24 Marek Safar <marek.safar@seznam.cz>
7051 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7052 delegates in static class.
7054 2005-01-24 Martin Baulig <martin@ximian.com>
7056 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7057 merging an implicit block, just use its reachability.
7059 * statement.cs (Block.Resolve): Make the unreachable code check
7060 work wrt. implicit blocks; see test-337 from #63842.
7062 2005-01-21 Alp Toker <alp@atoker.com>
7064 * cs-parser.jay: destructor_declaration's container is PartialContainer
7065 not Class when partial types are used, so use Kind prop instead of
7068 2005-01-22 Miguel de Icaza <miguel@ximian.com>
7070 * cs-parser.jay: Improve error reporting when an interface
7073 2005-01-20 Dick Porter <dick@ximian.com>
7075 * support.cs: SeekableStreamReader fix from Sandor Dobos
7076 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7077 chars are read. Fixes bug 70369.
7079 2005-01-20 Raja R Harinath <rharinath@novell.com>
7081 * cs-parser.jay (catch_clause): Simplify current_block handling
7084 2005-01-17 Miguel de Icaza <miguel@ximian.com>
7086 * convert.cs (ImplicitStandardConversionExists): Synchronize the
7087 code with ImplicitStandardConversion to handle the implicit
7088 conversion of method groups into valid delegate invocations.
7090 The problem is that in parameter handling we were using this code
7091 path. Fixes bug #64698
7093 2005-01-19 Raja R Harinath <rharinath@novell.com>
7095 * cs-parser.jay: Fix several infelicities.
7096 - Avoid assigning to the parser value stack. Code like
7097 '$3 = null' is unclean. Synthesize a value for the code block
7099 - Avoid using oob_stack for storing location information. Use ...
7100 (_mark_): ... this. New (empty) rule. Saves the current location
7102 (foreach_statement): Avoid using oob_stack for current_block
7103 handling. Use technique used in for_statement and
7104 using_statement. Synthesize a value for the code block to store
7105 additional intermediate information.
7107 2005-01-13 Miguel de Icaza <miguel@ximian.com>
7109 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7110 of a different type is only allowed to private fields of a
7111 containing type, not on fields of a base class.
7113 See test-174.cs and error cs0122-9.cs
7115 2005-01-13 Raja R Harinath <rharinath@novell.com>
7117 Fix test-335.cs (bug #58126).
7118 * cs-parser.jay (argument): Split out non-expression parts of the
7119 rule into 'non_simple_argument'.
7120 (invocation_expression): Support parenthesized invocations with
7121 multiple arguments, and with single non-simple arguments.
7123 2005-01-13 Raja R Harinath <rharinath@novell.com>
7125 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7128 2005-01-12 Raja R Harinath <rharinath@novell.com>
7130 Fix cs0038-1.cs, cs1640-6.cs.
7131 * ecore.cs (Expression.Resolve): Remove special-case for
7132 SimpleName in error-handling.
7133 (Expression.almostMatchedMembers): Relax access permission to
7135 (Expression.MemberLookupFailed): Handle duplicates in
7136 almostMatchedMembers list.
7137 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7138 * expression.cs (New.DoResolve): Report CS1540 for more cases.
7139 * typemanager.cs (GetFullNameSignature): Use the MethodBase
7140 overload if the passed in MemberInfo is a MethodBase.
7142 2005-01-12 Marek Safar <marek.safar@seznam.cz>
7145 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7146 for non-CAS & merge permission sets properly.
7148 2005-01-11 Raja R Harinath <rharinath@novell.com>
7150 Improve standard-compliance of simple name and member access
7151 resolution. Fixes bugs #52697, #57200, #67520, #69519.
7152 * ecore.cs (FullNamedExpression): New abstract base class
7153 for Namespaces and TypeExpressions.
7154 (ResolveFlags.SimpleName): Remove.
7155 (SimpleName): Remove support for dotted names.
7156 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
7157 DeclSpace.FindType and DeclSpace.LookupType.
7158 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7159 (Expression.ExprClassName): Make member function.
7160 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7161 a namespace. Remove creation of dotted "SimpleName"s.
7162 (MemberAccess.DoResolve): Likewise.
7163 * decl.cs (DeclSpace.Cache): Make private.
7164 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7165 (DeclSpace.FindType): Update.
7166 (DeclSpace.LookupType): Move here from RootContext. Return a
7167 FullNamedExpression.
7168 * namespace.cs (Namespace): Derive from FullNamedExpression
7169 so that it can be part of expression resolution.
7170 (Namespace.Lookup): Return an FullNamedExpression.
7171 (NamespaceEntry.LookupAlias): Lookup aliases only in current
7173 * rootcontext.cs (NamespaceLookup): Remove.
7174 (LookupType): Move to DeclSpace.
7175 * attribute.cs (CheckAttributeType): Update.
7176 * doc.cs (FindDocumentedType): Remove allowAlias argument.
7177 (FindDocumentedTypeNonArray): Likewise.
7179 2005-01-11 Raja R Harinath <rharinath@novell.com>
7181 Fix cs0509.cs, cs1632.cs.
7182 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7183 is the same as IsInterface.
7184 (TypeContainer.GetClassBases): Likewise.
7185 * statement.cs (LabeledStatement.ig): New field.
7186 (LabeledStatement.LabelTarget): Save ILGenerator which created the
7188 (LabeledStatement.DoEmit): Check that the label was created with
7189 the same ILGenerator.
7191 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7194 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7195 accessors to its properties.
7197 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7198 from accessors to property.
7200 2005-01-10 Marek Safar <marek.safar@seznam.cz>
7203 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7206 2005-01-08 Miguel de Icaza <miguel@ximian.com>
7208 * attribute.cs: Check for null and empty strings.
7210 I have lost another battle to Paolo.
7212 2005-01-07 Marek Safar <marek.safar@seznam.cz>
7215 * class.cs (PropertyMethod): Set Parent field in ctors.
7216 (SetMethod.InternalParameters): Add unsafe switch hack.
7217 Override MarkForDuplicationCheck where it is appropriate.
7219 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7220 It says whether container allows members with the same name.
7222 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7223 Removed is_method parameter.
7225 2005-01-06 Duncan Mak <duncan@ximian.com>
7227 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7228 because the previous change led to incorrect reporting of CS1032
7229 ("Cannot define/undefine preprocessor symbols after first token in
7230 file"). Instead of using `tokens_seen' as the only flag that
7231 triggers CS1040, introduce `comments_seen'. This new flag is used
7232 to signify having seen comments on the current line, so it is
7233 unset after a newline.
7235 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7237 * doc.cs : When searching for a type, find nested type too.
7238 This fixes bug #71040.
7240 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
7243 - Warn missing member comment on those classes which also does not
7244 have doc comments. Fixed bug #71041.
7245 - Don't warn missing doc comment on default constructor.
7248 2005-01-06 Duncan Mak <duncan@ximian.com>
7250 * cs-tokenizer.cs (xtoken): After handling traditional C-style
7251 comments, set `tokens_seen' to true. This allows us to detect
7252 misplaced preprocessor directives (i.e. not at the beginning of
7253 the a line, nor after whitespaces). In that case, report error
7254 CS1040. This fixes bug #56460.
7256 * cs-parser.jay (interface_member_declaration): Add checks for
7257 IsExplicitImpl, and report CS0541 error if an interface member is
7258 defined as an explicit interface declaration.
7260 2005-01-06 Marek Safar <marek.safar@seznam.cz>
7263 * class.cs (PropertyMethod): Set Parent field in ctors.
7264 (SetMethod.InternalParameters): Add unsafe switch hack.
7266 * decl.cs (MemberCore.Parent): Cannot be readonly.
7268 2005-01-06 Raja R Harinath <rharinath@novell.com>
7270 * decl.cs (DeclSpace.ResolveType): Remove.
7271 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7272 Merge in code from ...
7273 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
7274 * class.cs, enum.cs: Update to changes.
7276 2005-01-06 Miguel de Icaza <miguel@ximian.com>
7278 * anonymous.cs: Ensure that we init the scope of our parent if it
7279 has not been initialized yet.
7281 2004-12-30 Duncan Mak <duncan@ximian.com>
7283 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7284 if field.FieldBuilder is null. Fixes #70758.
7286 * convert.cs: Fixed some typos and updated some of the comments.
7287 (ImplicitStandardConversionExists):
7288 (TryImplicitIntConversion): If `target_type' is an interface and
7289 the type of `ic' implements this interface, return true or a new
7290 BoxedCast instead of null. This fixes #70468.
7292 2004-12-29 Duncan Mak <duncan@ximian.com>
7294 * expression.cs (Argument.Emit): Check that Expr is
7295 IMemoryLocation before casting to it, and report CS1510 otherwise.
7299 2004-12-21 Ben Maurer <bmaurer@ximian.com>
7301 * statement.cs (Block.ThisVariable): remove the recursion here, to
7302 make the --profile more sane.
7304 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
7306 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7307 assembly, by JB Evain.
7309 2004-12-17 Raja R Harinath <rharinath@novell.com>
7311 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
7312 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7313 "parent" refers to enclosing type/class. "base" refers to superclass.
7315 2004-12-17 Raja R Harinath <rharinath@novell.com>
7317 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7318 Ensure that we only have GlobalAttributes.
7319 * attribute.cs (Attribute.Emit): Make non-virtual.
7320 (GlobalAttribute.Emit): Remove.
7321 (Attribute.Resolve): Make virtual.
7322 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
7323 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7324 the argument. Don't create one.
7325 (Attribute.GetObsoleteAttribute): Likewise.
7326 (Attribute.GetClsCompliantAttributeValue): Likewise.
7327 * class.cs, decl.cs: Update to changes.
7329 2004-12-17 Marek Safar <marek.safar@seznam.cz>
7331 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7333 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7335 * statement.cs (Foreach.Resolve): Add error 186 report.
7337 2004-12-16 Marek Safar <marek.safar@seznam.cz>
7339 * expression.cs (Conditional.DoResolve): Add warning 429.
7341 * statement.cs (If.Resolve): Add warning 665.
7343 2004-12-16 Raja R Harinath <rharinath@novell.com>
7345 New invariant: RootContext.Tree.Types.NamespaceEntry == null
7346 except when in the parser, and in GlobalAttribute.
7347 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7348 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7349 RootContext.Tree.Types.NamespaceEntry once work is done.
7350 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
7351 and resets RootContext.Tree.Types.NamespaceEntry.
7353 2004-12-15 Marek Safar <marek.safar@seznam.cz>
7355 * cs-parser.jay: Don't create a block for every variable.
7357 2004-12-14 Miguel de Icaza <miguel@ximian.com>
7359 * location.cs: Provide extra information.
7361 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7362 variables from the captured environment, it is the ldarg_0.
7364 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7366 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7369 * class.cs: Changed warning level for 169 to avoid developer
7370 displeasure from warning flooding. It will be changed back when they
7371 fix most of current BCL warnings.
7373 * RootContext.cs: Pushed default WarningLevel to 3.
7375 * statement.cs: Removed unused variable.
7377 2004-12-14 Marek Safar <marek.safar@seznam.cz>
7379 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7380 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7381 Add error 502 report.
7382 (StaticClass.DefineType): Add error 441 report.
7383 (Class.AllowedModifiersProp): New virtual property as temporary
7384 extension to AllowedModifiers.
7385 (Class.DefineType): Add error 418 report. Moved ModFlags check here
7386 to share implementation with StaticClass and don't call virtual
7389 * driver.cs (MainDriver): Add error 1558 test.
7391 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7392 report. Moved error 36 test here.
7394 * statement.cs (Throw.Resolve): Add error 724 report.
7396 * typemanager.cs: Add out_attribute_type core type.
7398 2004-12-13 Marek Safar <marek.safar@seznam.cz>
7400 * class.cs (TypeContainer.VerifyClsCompliance): Add error
7402 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7404 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7407 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7409 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
7410 Add error 3023 report.
7411 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7413 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7416 2004-12-12 John Luke <john.luke@gmail.com>
7418 * driver.cs (AddArgs): take -- into account when
7419 adding arguments, fixes bug 65710
7421 2004-12-12 Martin Baulig <martin@ximian.com>
7423 * expression.cs (Unary.TryReduceNegative): Added support for
7424 SByteConstant and ByteConstant.
7425 (Unary.Reduce): Check error values from TryReduceNegative().
7427 2004-12-10 Marek Safar <marek.safar@seznam.cz>
7429 * attributes.cs (Attribute.Resolve): Avoid multiple error report
7430 and report exception as error 182.
7432 2004-12-10 Raja R Harinath <rharinath@novell.com>
7434 * driver.cs (Main): Fix message when there are warnings.
7436 2004-12-09 Miguel de Icaza <miguel@ximian.com>
7438 * delegate.cs: Fixed my fix from yesterday, sorry about that.
7440 2004-12-09 Marek Safar <marek.safar@seznam.cz>
7442 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
7443 Reduced number of warnings.
7445 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7447 2004-12-08 Miguel de Icaza <miguel@ximian.com>
7449 * driver.cs: Removed message.
7451 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7453 2004-12-08 <vargaz@freemail.hu>
7455 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7457 2004-12-08 Martin Baulig <martin@ximian.com>
7459 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7460 instead of a CS3002 for properties and indexer.
7462 2004-12-08 Martin Baulig <martin@ximian.com>
7464 * decl.cs (MemberName.ToString): Make this work again.
7466 2004-12-08 Marek Safar <marek.safar@seznam.cz>
7468 * attribute.cs (Resolve): Add error 591 detection.
7470 * class.cs (FieldMember.Define): Add error 1547 detection.
7471 (Indexer.Define): Add error 620 detection.
7472 (Operator.Define): Add error 590 detection.
7474 * ecore.cs: Missing argument for error 79.
7476 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7479 2004-12-07 Marek Safar <marek.safar@seznam.cz>
7482 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7485 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
7487 * cs-parser.jay : handle doc comments on implicit/explicit operators.
7488 Some operator comments were suppressed.
7489 * doc.cs : Implicit/explicit operator name in doc comments are like
7490 "op_Explicit(type)~returnType", so added suffix handling.
7492 2004-12-07 Martin Baulig <martin@ximian.com>
7495 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7496 (MemberCore.GetClsCompliantAttributeValue): Likewise.
7497 (DeclSpace.ec): New protected field; store the EmitContext here.
7498 (DeclSpace.EmitContext): New public property; moved here from
7500 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7503 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7504 (Enum.Emit): Don't create a new EmitContext.
7506 * delegate.cs (Delegate.DefineType): Always create the
7509 * iterators.cs (Iterators.DefineIterator): Create a new
7510 EmitContext and store it in `ec'.
7512 2004-08-24 Martin Baulig <martin@ximian.com>
7515 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7516 this for accessibility checks.
7517 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7518 IsNestedFamilyAccessible.
7519 (TypeManager.IsSubclassOf): New method, do what the name actually
7522 2004-12-06 Raja R Harinath <rharinath@novell.com>
7524 Fix crash on cs0657-17.cs.
7525 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7526 Use RootContext.Tree.Types, not 'new RootTypes ()'.
7527 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7528 the case where the NamespaceEntry gets overwritten.
7530 2004-12-06 Marek Safar <marek.safar@seznam.cz>
7532 Fixed #69195, #56821
7533 * ecore.cs (ResolveBoolean): Tiny refactoring.
7535 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7536 of right expression resolving when left is false constant and
7537 operator is LogicalAnd OR true constant and operator is LogicalOr.
7539 * statement.cs (ResolveUnreachable): Always reports warning.
7541 2004-12-05 Miguel de Icaza <miguel@ximian.com>
7543 * class.cs: Distinguish between 1721 and 1722 (just a little help
7544 for the programmer).
7546 2004-12-03 Miguel de Icaza <miguel@ximian.com>
7548 * delegate.cs: Only allow this on new versions of the language.
7550 2004-12-02 Duncan Mak <duncan@ximian.com>
7552 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7554 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7555 here as a static method. Take an additional bool out parameter
7556 `must_do_cs1540_check' for signaling to InstanceResolve.
7557 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7558 member field from PropertyExpr class and made it an argument of
7560 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7561 check for MarshalByRefObject, and report CS0122 instead of CS1540.
7562 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7563 and `remove_accessor' as well as InstanceResolve: report CS0122
7568 2004-12-03 Raja R Harinath <rharinath@novell.com>
7570 Fix test-327.cs, test-328.cs, and put in early infrastructure
7571 for eventually fixing #52697.
7572 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7573 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7575 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7576 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7577 (VerifyUsing, error246): Update.
7578 * rootcontext.cs (RootContext.NamespaceLookup): Just use
7579 'NamespaceEntry.LookupNamespaceOrType'.
7581 2004-12-03 Martin Baulig <martin@ximian.com>
7583 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7584 method as our child, call AnonymousMethod.Compatible() on it.
7586 2004-12-03 Raja R Harinath <rharinath@novell.com>
7588 Disable XML documentation support in 'basic' profile.
7589 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
7590 Redirect XmlElement to System.Object.
7591 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
7592 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
7593 * mcs.exe.sources: Add doc-bootstrap.cs.
7594 * doc-bootstrap.cs: New file. Contains empty stub implementation
7597 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
7599 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7600 comments are allowed.
7602 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7604 * delegate.cs: Add checks for subtypes in paramaters and return values
7605 in VerifyMethod () to add support for Covariance/Contravariance
7608 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7610 * report.cs: Remove extra closing parenthesis.
7612 * convert.cs (Error_CannotImplicitConversion): If the name of the
7613 types are the same, provide some extra information.
7615 * class.cs (FieldBase): Use an unused bit field from the field to
7616 encode the `has_offset' property from the FieldMember. This saves
7617 a couple of Ks on bootstrap compilation.
7619 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7620 method as our child, return the AnonymousMethod resolved
7623 * expression.cs (New.DoResolve): Allow return values from
7624 NewDelegate to also include AnonymousMethods.
7628 2004-12-02 Marek Safar <marek.safar@seznam.cz>
7631 * attribute.cs (Resolve): Improved implementation of params
7632 attribute arguments.
7634 * support.cs (ParameterData): Add HasParams to be faster.
7636 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
7638 all things are for /doc support:
7640 * doc.cs: new file that supports XML documentation generation.
7641 * mcs.exe.sources: added doc.cs.
7643 Handle /doc command line option.
7644 Report error 2006 instead of 5 for missing file name for /doc.
7645 Generate XML documentation when required, after type resolution.
7647 Added support for picking up documentation (/// and /** ... */),
7648 including a new XmlCommentState enumeration.
7650 Added lines to fill Documentation element for field, constant,
7651 property, indexer, method, constructor, destructor, operator, event
7652 and class, struct, interface, delegate, enum.
7653 Added lines to warn incorrect comment.
7655 Added Documentation field (passed only when /doc was specified).
7657 Added DocComment, DocCommentHeader, GenerateDocComment() and
7658 OnGenerateDocComment() and some supporting private members for
7659 /doc feature to MemberCore.
7661 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7663 Added overriden DocCommentHeader.
7665 Added overriden DocCommentHeader and GenerateDocComment().
7667 2004-12-01 Miguel de Icaza <miguel@ximian.com>
7669 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7670 unwrapping the enumeration values, chain to
7671 DoConstantNumericPromotions again, so we can promote things to the
7672 fundamental types (takes care of enums that are bytes, sbytes).
7676 2004-12-01 Raja R Harinath <rharinath@novell.com>
7678 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7679 Fix long-standing bug in type-lookup. Use FindType instead of
7680 LookupType when ec.ResolvingTypeTree.
7681 (Attribute.ResolveType, Attribute.Resolve)
7682 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7684 (Attributes.Search): Remove internal version. Update.
7685 (Attributes.SearchMulti): Update.
7686 (Attributes.GetClsCompliantAttribute): Remove.
7687 (Attributes.GetIndexerNameAttribute): Remove.
7688 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7689 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7690 * class.cs (Indexer.Define): Likewise.
7692 2004-12-01 Marek Safar <marek.safar@seznam.cz>
7695 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7696 MarshallByReference members access.
7698 * expression.cs: Use CheckMarshallByRefAccess;
7699 Better error CS0197 message.
7701 * report.cs: Print whole related error message.
7703 2004-11-30 Raja R Harinath <rharinath@novell.com>
7705 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
7706 the current directory to help debugging.
7708 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7710 * class (GetClassBases): Better error 60 report.
7711 (EventProperty): Disabled warning 67 detection.
7713 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7716 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7718 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7721 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7724 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7726 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7728 2004-11-26 Miguel de Icaza <miguel@ximian.com>
7730 * attribute.cs (Attribute.Resolve): Refine error reporting and
7731 report a cs0117 if the identifier does not exist, to distinguish
7732 from 0617 which is a miss-use of the actual identifier.
7734 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7735 between cs0070 and cs0079.
7737 * class.cs (MemberBase.DoDefine): When reporting a wrong
7738 accessibility level, we use MethodCore to compare instead of
7739 Method (this was a regression in some refactoring effort).
7741 So now we correctly report cs0056 again.
7743 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7744 testing the target_type (which was known to be object_type) and
7745 not the source type (which is anonymous_method).
7747 Fixed reporting of error cs1660.
7749 * expression.cs (UserCast.Source): Expose the underlying cast.
7751 * statement.cs (Switch.SwitchGoverningType): Sort the list of
7752 allowed types to find a match to int32 first (most common).
7754 In addition, it ignores any ImplicitUserConversions that did an
7755 internal implicit conversion (as the switch statement allows only
7756 one integral conversion to exist).
7758 * class.cs (PartialContainer.Create): rename `name' to
7759 `member_name' for clarity. Then replace the string calls with a
7760 call to MemberName.GetPartialName, as now using
7761 MemberName.ToString is an error (this is due to the side effects
7762 it had, that were fixed in the past).
7764 This will restore the error reporting on a number of partial class
7765 errors that were missusing this (and getting an exception as a
7766 results, which is now just a plain textual warning, because
7767 yyparse debug output would crash otherwise).
7769 2004-11-26 Raja R Harinath <rharinath@novell.com>
7771 * Makefile (PROGRAM_INSTALL_DIR): Remove.
7773 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7775 * rootcontext.cs (LookupType): Make sure to cache lookups that
7776 don't give us a negative result. This saves about 5% of corlib
7779 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7781 * report.cs (AbstractMessage.Print): messages are sent to stderr
7783 * class.cs (TypeContainer.GetClassBases): It is an error to have a
7784 non-interface in the list of interfaces (at this point, either
7785 parent was properly set, or a base class is being listed in the
7786 interfaces section).
7788 This flags error 1722, and resolves the crash from bug 69259.
7790 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7792 * statement.cs (Using.EmitExpressionFinally): make this work right
7793 for valuetypes. Fixes 69926.
7795 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7797 * const.cs (Const.ChangeType): Cope with the "0 literal can be
7798 converted to an enum" here, before we try to change the underlying
7799 type. This code exists, but it is a different code path than the
7800 one used while encoding constants.
7802 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7803 old bug: when converting from the null literal to a pointer,
7804 return an EmptyCast, not the NullLiteral.
7806 This fixes #69921, the recent null_type changes probably made this
7809 (ImplicitReferenceConversionExists): In addition, resynchronized
7810 the code here, so it matches the same code in
7811 ImplicitReferenceConversionExists for the `from any class-type S
7812 to any interface-type T'.
7815 2004-11-25 Marek Safar <marek.safar@seznam.cz>
7817 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7819 2004-11-24 Miguel de Icaza <miguel@ximian.com>
7821 * cs-parser.jay: Use verbosity accordingly.
7823 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7825 * expression.cs (Unary.ResolveOperator): Do not report warning;
7826 AddressOf reads from variable.
7828 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7830 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7834 * attribute.cs (Attributable): Removed CheckTargets.
7835 (Attributes.Emit): Explicit attribute targets are tested here.
7837 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7838 not enabled for interfaces.
7840 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7841 (GetAssemblyName): Ouch next bug there.
7843 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7845 * expression.cs: Error 275 added.
7847 2004-11-23 Marek Safar <marek.safar@seznam.cz>
7849 Fix bug #69177 (Implemented decimal constant support)
7851 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7852 (BinaryFold): Add DecimalConstant.
7854 * const.cs (Define): Decimal constant
7856 (ChangeType): Add decimal type handling.
7857 (LookupConstantValue): Don't set value for decimal type but
7858 emit DecimalConstantAttribute. Needed for constant optimization.
7860 * constant.cs (ToDecimal): New method.
7861 (ConvertToDecimal): New method.
7862 (IntConstant): Implemented ConvertToDecimal.
7863 (DecimalConstant.Emit): Emit optimized version for decimals in
7866 * expression.cs (ResolveOperator): Changed order of constant
7867 reduction to work correctly with native types which have
7868 overloaded operators.
7869 (ResolveMemberAccess): Extract constant value from attribute
7872 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7874 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7875 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7876 (ChangeType): Decimal is special.
7877 (TypeToCoreType): Add decimal type.
7879 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7881 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7884 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7886 * class.cs (EventField.ApplyAttributeBuilder): Fix error
7889 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7891 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7893 * pending.cs (PendingImplementation): Grab only interfaces.
7895 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7897 * statement.cs (ForeachHelperMethods): Add location member and
7898 error 202 detection.
7900 2004-11-19 Raja R Harinath <rharinath@novell.com>
7902 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
7903 automatically handled by executable.make.
7904 (PROGRAM): Make profile-specific.
7906 2004-11-18 Marek Safar <marek.safar@seznam.cz>
7908 * expression.cs (DoResolveBase): Fixed wrong warning for out
7911 2004-11-18 Martin Baulig <martin@ximian.com>
7913 Merged latest changes into gmcs. Please keep this comment in
7914 here, it makes it easier for me to see what changed in MCS since
7915 the last time I merged.
7917 2004-11-17 Raja R Harinath <rharinath@novell.com>
7919 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7920 (TypeHandle.GetMemberCache): New.
7921 (TypeHandle.TypeHandle): Update.
7922 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7923 (TypeManager.LookupParentInterfacesCache):
7924 Rename from LookupInterfaceCache. Optimize slightly.
7925 (TypeManager.MemberLookup_FindMembers): Update.
7926 * decl.cs (MemberCache.MemberCache): Set Container to null in the
7928 (AddCacheContents): Rename from AddHashtable.
7929 * class.cs (TypeContainer.parent_container): Remove.
7930 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7931 (TypeContainer.DoDefineMembers): Don't initialize it.
7932 Update to name changes.
7934 2004-11-17 Miguel de Icaza <miguel@ximian.com>
7936 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7937 that factors the code to check access modifiers on override.
7939 (PropertyBase): Use the code here.
7941 Patch from Lluis S'anchez, fixes bug #69361.
7943 2004-11-15 Miguel de Icaza <miguel@ximian.com>
7945 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7946 routine that is used to report the use of a captured variable
7947 whose address has been taken.
7949 There are two checks: one when variables are being captured and
7950 the other check is when the address of a variable is taken.
7952 (because an anonymous methods might be resolved before *or* after
7953 the address has been taken) and
7955 * expression.cs (Conditional.DoResolve): Remove the special
7956 casing that Martin added to trueExpr and falseExpr being both
7957 NullLiteral. We get the right behavior now just by introducing
7958 the null_type into the compiler.
7960 * convert.cs (ExplicitConversion): Change the code to use
7961 null_type instead of testing `expr is NullLiteral'.
7962 (ImplicitConversionStandard): use null_type too.
7963 (ImplicitReferenceConversionExists): use null_type too.
7964 (ImplicitReferenceConversion): use null_type too.
7966 * literal.cs: The type of `NullLiteral' is now null_type instead
7968 (Resolve): Set the type here.
7970 * typemanager.cs: Introduce null_type.
7972 2004-11-17 Martin Baulig <martin@ximian.com>
7974 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7975 direction, like FindMembers() does. Fixes #69546, testcase is in
7978 2004-11-16 Martin Baulig <martin@ximian.com>
7980 This is based on a patch from Marek Safar, see bug #69082.
7981 Fixes bugs #63705 and #67130.
7983 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7984 method; create a MemberCache for an interface type and cache the
7987 * decl.cs (IMemberContainer.ParentContainer): Removed.
7988 (IMemberContainer.ParentCache): New property.
7989 (MemberCache.SetupCacheForInterface): Removed.
7990 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7991 to create a cache for an interface's "parent".
7993 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7996 2004-11-16 Martin Baulig <martin@ximian.com>
7998 Merged back from gmcs; these changes already went into gmcs a
7999 couple of weeks ago.
8002 (TypeManager.AddUserType): Removed the `ifaces' argument.
8003 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
8005 (TypeManager.AddUserInterface): Removed.
8006 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
8008 (TypeManager.GetInterfaces): Likewise.
8009 (TypeManager.GetExplicitInterfaces): Likewise.
8011 * ecore.cs (TypeExpr.GetInterfaces): Removed.
8013 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
8014 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
8016 2004-11-14 Ben Maurer <bmaurer@ximian.com>
8018 * statement.cs: Avoid adding bools to a hashtable.
8020 2004-11-07 Miguel de Icaza <miguel@ximian.com>
8022 * expression.cs (Invocation.OverloadResolve): Flag error if we are
8023 calling an unsafe method from a safe location.
8025 2004-11-06 Marek Safar <marek.safar@seznam.cz>
8028 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8030 2004-11-06 Miguel de Icaza <miguel@ximian.com>
8032 * namespace.cs (VerifyUsing): use GetPartialName instead of
8035 2004-11-05 Miguel de Icaza <miguel@ximian.com>
8037 * statement.cs (Return.Resolve): Fix regression in typo: if
8038 `in_exc', we have to request a NeedReturnLabel, this was a typo
8039 introduced in the anonymous method check-in. Fixes #69131.
8041 * Indexers were using the ShortName when defining themselves,
8042 causing a regression in the compiler bootstrap when applying the
8043 patch from 2004-11-02 (first part), now they use their full name
8044 and the bug is gone.
8046 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
8048 * driver.cs: Strip the path from the names of embedded resources. Fixes
8051 2004-11-04 Raja R Harinath <rharinath@novell.com>
8053 Fix error message regression: cs0104-2.cs.
8054 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8055 (AliasEntry.Resolve): Update.
8056 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
8058 (RootContext.LookupType): Update.
8060 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
8062 * cs-parser.jay: Add support for handling accessor modifiers
8063 * class: Add support port accessor modifiers and error checking,
8064 define PropertyMethod.Define as virtual (not abstract anymore)
8065 * ecore.cs: Add checking for proeprties access with access modifiers
8066 * iterators.cs: Modify Accessor constructor call based in the modified
8068 2004-11-02 Ben Maurer <bmaurer@ximian.com>
8070 * expression.cs (StringConcat): Handle being called twice,
8071 as when we have a concat in a field init with more than two
8074 2004-11-02 Miguel de Icaza <miguel@ximian.com>
8076 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8077 special case explicit implementations, we should always produce
8078 the .property or .event declaration.
8080 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8081 since it will not return correct data if people use this
8082 unresolved in the presence of using statements (see test-313).
8084 * class.cs (MethodData.Define): If we are an explicit interface
8085 implementation, set the method name to the full name of the
8086 interface plus the name of the method.
8088 Notice that using the method.MethodName.GetFullName() does not
8089 work, as it will only contain the name as declared on the source
8090 file (it can be a shorthand in the presence of using statements)
8091 and not the fully qualifed type name, for example:
8095 class D : ICloneable {
8096 object ICloneable.Clone () {
8100 Would produce a method called `ICloneable.Clone' instead of
8101 `System.ICloneable.Clone'.
8103 * namespace.cs (Alias.Resolve): Use GetPartialName.
8105 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8107 * cs-parser.jay: Add error 1055 report.
8109 2004-11-01 Miguel de Icaza <miguel@ximian.com>
8111 * assign.cs (Assign.DoResolve): Only do the transform of
8112 assignment into a New if the types are compatible, if not, fall
8113 through and let the implicit code deal with the errors and with
8114 the necessary conversions.
8116 2004-11-01 Marek Safar <marek.safar@seznam.cz>
8118 * cs-parser.jay: Add error 1031 report.
8120 * cs-tokenizer.cs: Add location for error 1038.
8122 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8124 * cs-parser.jay: Add error 1016 report.
8126 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8128 * cs-parser.jay: Add errors 1575,1611 report.
8130 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8132 * cs-parser.jay: Add error 1001 report.
8134 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8137 * attribute.cs (GetMarshal): Add method argument for
8138 caller identification.
8140 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8141 agument for GetMarshal and RuntimeMissingSupport.
8143 2004-10-31 Marek Safar <marek.safar@seznam.cz>
8145 * attribute.cs (ExtractSecurityPermissionSet): Removed
8146 TypeManager.code_access_permission_type.
8148 * typemanager.cs: Removed TypeManager.code_access_permission_type.
8150 2004-10-27 Miguel de Icaza <miguel@ximian.com>
8152 * expression.cs (LocalVariableReference.DoResolveLValue): Check
8153 for obsolete use of a variable here. Fixes regression on errors
8154 cs0619-25 and cs0619-26.
8156 2004-10-27 Marek Safar <marek.safar@seznam.cz>
8158 Fix #62358, implemented security attribute encoding.
8160 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8161 Tests permitted SecurityAction for assembly or other types.
8162 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8163 data from SecurityPermissionAttribute to PermisionSet class.
8165 * class.cs (ApplyAttributeBuilder): Added special handling
8166 for System.Security.Permissions.SecurityAttribute based types.
8168 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8169 special handling for System.Security.Permissions.SecurityAttribute
8172 * enum.cs (ApplyAttributeBuilder): Added special handling
8173 for System.Security.Permissions.SecurityAttribute based types.
8175 * parameter.cs (ApplyAttributeBuilder): Added special handling
8176 for System.Security.Permissions.SecurityAttribute based types.
8178 * rootcontext.cs: Next 2 core types.
8180 * typemanager.cs (TypeManager.security_permission_attr_type):
8181 Built in type for the SecurityPermission Attribute.
8182 (code_access_permission_type): Build in type.
8184 2004-10-17 Miguel de Icaza <miguel@ximian.com>
8186 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8187 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8188 all of this information into
8189 EmitContext.EmitCapturedVariableInstance.
8191 * codegen.cs (EmitCapturedVariableInstance): move here the
8192 funcionality of emitting an ldarg.0 in the presence of a
8193 remapping. This centralizes the instance emit code.
8195 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8196 then emit a load of this: it means that we have reached the
8197 topmost ScopeInfo: the one that contains the pointer to the
8198 instance of the class hosting the anonymous method.
8200 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8201 captures to the topmost CaptureContext.
8203 2004-10-12 Miguel de Icaza <miguel@ximian.com>
8205 * expression.cs (LocalVariableReference): Move the knowledge about
8206 the iterators into codegen's EmitCapturedVariableInstance.
8208 2004-10-11 Miguel de Icaza <miguel@ximian.com>
8210 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8211 all code paths return a value from an anonymous method (it is the
8212 same as the 161 error, but for anonymous methods).
8214 2004-10-08 Miguel de Icaza <miguel@ximian.com>
8216 The introduction of anonymous methods in the compiler changed
8217 various ways of doing things in the compiler. The most
8218 significant one is the hard split between the resolution phase
8219 and the emission phases of the compiler.
8221 For instance, routines that referenced local variables no
8222 longer can safely create temporary variables during the
8223 resolution phase: they must do so from the emission phase,
8224 since the variable might have been "captured", hence access to
8225 it can not be done with the local-variable operations from the runtime.
8229 (Block.Flags): New flag `IsTopLevel' to indicate that this block
8230 is a toplevel block.
8232 (ToplevelBlock): A new kind of Block, these are the blocks that
8233 are created by the parser for all toplevel method bodies. These
8234 include methods, accessors and anonymous methods.
8236 These contain some extra information not found in regular blocks:
8237 A pointer to an optional CaptureContext (for tracking captured
8238 local variables and parameters). A pointer to the parent
8241 (Return.Resolve): Catch missmatches when returning a value from an
8242 anonymous method (error 1662).
8243 Invoke NeedReturnLabel from the Resolve phase instead of the emit
8246 (Break.Resolve): ditto.
8248 (SwitchLabel): instead of defining the labels during the
8249 resolution phase, we now turned the public ILLabel and ILLabelCode
8250 labels into methods called GetILLabelCode() and GetILLabel() that
8251 only define the label during the Emit phase.
8253 (GotoCase): Track the SwitchLabel instead of the computed label
8254 (its contained therein). Emit the code by using
8255 SwitchLabel.GetILLabelCode ().
8257 (LocalInfo.Flags.Captured): A new flag has been introduce to track
8258 whether the Local has been captured or not.
8260 (LocalInfo.IsCaptured): New property, used to tell whether the
8261 local has been captured.
8263 * anonymous.cs: Vastly updated to contain the anonymous method
8266 The main classes here are: CaptureContext which tracks any
8267 captured information for a toplevel block and ScopeInfo used to
8268 track the activation frames for various local variables.
8270 Each toplevel block has an optional capture context associated
8271 with it. When a method contains an anonymous method both the
8272 toplevel method and the anonymous method will create a capture
8273 context. When variables or parameters are captured, they are
8274 recorded on the CaptureContext that owns them, for example:
8278 MyDelegate d = delegate {
8283 Here `a' will be recorded as captured on the toplevel
8284 CapturedContext, the inner captured context will not have anything
8285 (it will only have data if local variables or parameters from it
8286 are captured in a nested anonymous method.
8288 The ScopeInfo is used to track the activation frames for local
8289 variables, for example:
8291 for (int i = 0; i < 10; i++)
8292 for (int j = 0; j < 10; j++){
8293 MyDelegate d = delegate {
8298 At runtime this captures a single captured variable `i', but it
8299 captures 10 different versions of the variable `j'. The variable
8300 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8301 recorded on a child.
8303 The toplevel ScopeInfo will also track information like the `this'
8304 pointer if instance variables were referenced (this is necessary
8305 as the anonymous method lives inside a nested class in the host
8306 type of the method).
8308 (AnonymousMethod): Expanded to track the Toplevel, implement
8309 `AnonymousMethod.Compatible' to tell whether an anonymous method
8310 can be converted to a target delegate type.
8312 The routine now also produces the anonymous method content
8314 (AnonymousDelegate): A helper class that derives from
8315 DelegateCreation, this is used to generate the code necessary to
8316 produce the delegate for the anonymous method that was created.
8318 * assign.cs: API adjustments for new changes in
8319 Convert.ImplicitStandardConversionExists.
8321 * class.cs: Adjustments to cope with the fact that now toplevel
8322 blocks are of type `ToplevelBlock'.
8324 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8325 insteda of standard blocks.
8327 Flag errors if params arguments are passed to anonymous methods.
8329 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8330 `CurrentAnonymousMethod' which points to the current Anonymous
8331 Method. The variable points to the AnonymousMethod class that
8332 holds the code being compiled. It is set in the new EmitContext
8333 created for the anonymous method.
8335 (EmitContext.Phase): Introduce a variable and an enumeration to
8336 assist in enforcing some rules about when and where we are allowed
8337 to invoke certain methods (EmitContext.NeedsReturnLabel is the
8338 only one that enfonces this right now).
8340 (EmitContext.HaveCaptureInfo): new helper method that returns
8341 whether we have a CapturedContext initialized.
8343 (EmitContext.CaptureVariable): New method used to register that a
8344 LocalInfo must be flagged for capturing.
8346 (EmitContext.CapturedParameter): New method used to register that a
8347 parameters must be flagged for capturing.
8349 (EmitContext.CapturedField): New method used to register that a
8350 field must be flagged for capturing.
8352 (EmitContext.HaveCapturedVariables,
8353 EmitContext.HaveCapturedFields): Return whether there are captured
8354 variables or fields.
8356 (EmitContext.EmitMethodHostInstance): This is used to emit the
8357 instance for the anonymous method. The instance might be null
8358 (static methods), this (for anonymous methods that capture nothing
8359 and happen to live side-by-side with the current method body) or a
8360 more complicated expression if the method has a CaptureContext.
8362 (EmitContext.EmitTopBlock): Routine that drives the emission of
8363 code: it will first resolve the top block, then emit any metadata
8364 and then emit the code. The split is done so that we can extract
8365 any anonymous methods and flag any captured variables/parameters.
8367 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8368 during this phase, the ILGenerator should not be used as labels
8369 and local variables declared here might not be accessible to any
8370 code that is part of an anonymous method.
8372 Exceptions to this include the temporary variables that are
8373 created by some statements internally for holding temporary
8376 (EmitContext.EmitMeta): New routine, in charge of emitting all the
8379 (EmitContext.TemporaryReturn): This method is typically called
8380 from the Emit phase, and its the only place where we allow the
8381 ReturnLabel to be defined other than the EmitMeta. The reason is
8382 that otherwise we would have to duplicate a lot of logic in the
8383 Resolve phases of various methods that today is on the Emit
8386 (EmitContext.NeedReturnLabel): This no longer creates the label,
8387 as the ILGenerator is not valid during the resolve phase.
8389 (EmitContext.EmitThis): Extended the knowledge in this class to
8390 work in anonymous methods in addition to iterators.
8392 (EmitContext.EmitCapturedVariableInstance): This emits whatever
8393 code is necessary on the stack to access the instance to a local
8394 variable (the variable will be accessed as a field).
8396 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8397 EmitContext.EmitAddressOfParameter): Routines to support
8398 parameters (not completed at this point).
8400 Removals: Removed RemapLocal and RemapLocalLValue. We probably
8401 will also remove the parameters.
8403 * convert.cs (Convert): Define a `ConstantEC' which points to a
8404 null. This is just to prefity some code that uses
8405 ImplicitStandardConversion code and do not have an EmitContext
8408 The idea is to flag explicitly that at that point in time, it is
8409 known that the conversion will not trigger the delegate checking
8410 code in implicit conversions (which requires a valid
8413 Everywhere: pass new EmitContext parameter since
8414 ImplicitStandardConversionExists now requires it to check for
8415 anonymous method conversions.
8417 (Convert.ImplicitStandardConversionExists): If the type of an
8418 expression is the anonymous_method_type, and the type is a
8419 delegate, we invoke the AnonymousMethod.Compatible method to check
8420 whether an implicit conversion is possible.
8422 (Convert.ImplicitConversionStandard): Only do implicit method
8423 group conversions if the language level is not ISO_1.
8425 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8426 MethodInfo for the Invoke method. used by Delegate and
8429 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8430 method conversions if the target type is a delegate.
8432 Removed extra debugging nops.
8434 (LocalVariableReference): Turn the `local_info' into a public
8437 Add `prepared' field, the same hack used for FieldExprs to cope
8438 with composed assignments, as Local variables do not necessarily
8439 operate purely on the stack as they used to: they can be captured
8442 Add `temp' for a temporary result, like fields.
8444 Refactor DoResolve and DoResolveLValue into DoResolveBase.
8446 It now copes with Local variables that are captured and emits the
8447 proper instance variable to load it from a field in the captured
8450 (ParameterReference.DoResolveBase): During the resolve phase,
8451 capture parameters if we are in an anonymous method.
8453 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8454 anonymous method, use the EmitContext helper routines to emit the
8455 parameter reference.
8457 * iterators.cs: Set RemapToProxy to true/false during the
8460 * parameters.cs (GetParameterByName): New helper method.
8462 * typemanager.cs (anonymous_method_type) a new type that
8463 represents an anonyous method. This is always an internal type,
8464 used as a fencepost to test against the anonymous-methodness of an
8467 2004-10-20 Marek Safar <marek.safar@seznam.cz>
8469 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8471 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8473 2004-10-18 Martin Baulig <martin@ximian.com>
8475 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8476 `Type' directly, but call ResolveType() on it.
8477 (Catch.Resolve): Likewise.
8478 (Foreach.Resolve): Likewise.
8480 2004-10-18 Martin Baulig <martin@ximian.com>
8482 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8483 `Type' directly, but call ResolveType() on it.
8484 (Probe.DoResolve): Likewise.
8485 (ArrayCreation.LookupType): Likewise.
8486 (TypeOf.DoResolve): Likewise.
8487 (SizeOf.DoResolve): Likewise.
8489 2004-10-18 Martin Baulig <martin@ximian.com>
8491 * expression.cs (Invocation.BetterFunction): Put back
8492 TypeManager.TypeToCoreType().
8494 2004-10-18 Raja R Harinath <rharinath@novell.com>
8496 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8499 2004-10-18 Martin Baulig <martin@ximian.com>
8501 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
8502 `Type' directly, but call ResolveType() on it.
8504 2004-10-18 Martin Baulig <martin@ximian.com>
8506 * class.cs (FieldMember.Define): Don't access the TypeExpr's
8507 `Type' directly, but call ResolveType() on it.
8508 (MemberBase.DoDefine): Likewise.
8510 * expression.cs (New.DoResolve): Don't access the TypeExpr's
8511 `Type' directly, but call ResolveType() on it.
8512 (ComposedCast.DoResolveAsTypeStep): Likewise.
8514 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8515 `Type' directly, but call ResolveType() on it.
8517 2004-10-17 John Luke <john.luke@gmail.com>
8519 * class.cs (Operator.GetSignatureForError): use CSharpName
8521 * parameter.cs (Parameter.GetSignatureForError): Returns
8522 correct name even if was not defined.
8524 2004-10-13 Raja R Harinath <rharinath@novell.com>
8527 * class.cs (TypeContainer.EmitContext): New property.
8528 (DefineNestedTypes): Create an emitcontext for each part.
8529 (MethodCore.DoDefineParameters): Use container's emitcontext.
8530 Pass type array to InternalParameters.
8531 (MemberBase.DoDefine): Use container's emitcontext.
8532 (FieldMember.Define): Likewise.
8533 (Event.Define): Likewise.
8534 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8535 Pass type array to InternalParameters.
8536 (SetIndexerMethod.GetParameterInfo): Likewise.
8537 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8538 * delegate.cs (Define): Pass emitcontext to
8539 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8540 array to InternalParameters.
8541 * expression.cs (ParameterReference.DoResolveBase): Pass
8542 emitcontext to GetParameterInfo.
8543 (ComposedCast.DoResolveAsTypeStep): Remove check on
8544 ec.ResolvingTypeTree.
8545 * parameter.cs (Parameter.Resolve): Change argument to
8546 EmitContext. Use ResolveAsTypeTerminal.
8547 (Parameter.GetSignature): Change argument to EmitContext.
8548 (Parameters.ComputeSignature): Likewise.
8549 (Parameters.ComputeParameterTypes): Likewise.
8550 (Parameters.GetParameterInfo): Likewise.
8551 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8552 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8553 * support.cs (InternalParameters..ctor): Remove variant that takes
8555 * typemanager.cs (system_intptr_expr): New.
8556 (InitExpressionTypes): Initialize it.
8558 2004-10-12 Chris Toshok <toshok@ximian.com>
8560 * cs-parser.jay: fix location for try_statement and catch_clause.
8562 2004-10-11 Martin Baulig <martin@ximian.com>
8564 * report.cs: Don't make --fatal abort on warnings, we have
8565 -warnaserror for that.
8567 2004-10-07 Raja R Harinath <rharinath@novell.com>
8569 More DeclSpace.ResolveType avoidance.
8570 * decl.cs (MemberCore.InUnsafe): New property.
8571 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
8572 with newly created EmitContext.
8573 (FieldMember.Define): Likewise.
8574 * delegate.cs (Delegate.Define): Likewise.
8575 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8576 only if normal name-lookup fails.
8577 (TypeExpr.DoResolve): Enable error-checking.
8578 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8579 (SizeOf.DoResolve): Likewise.
8580 (ComposedCast.DoResolveAsTypeStep): Likewise.
8581 (StackAlloc.DoResolve): Likewise.
8582 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8583 (Block.Unsafe): New property.
8584 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8585 (Unsafe): Set 'unsafe' flag of contained block.
8586 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8587 (Fixed.Resolve): Likewise.
8588 (Catch.Resolve): Likewise.
8589 (Using.ResolveLocalVariableDecls): Likewise.
8590 (Foreach.Resolve): Likewise.
8592 2004-10-05 John Luke <john.luke@gmail.com>
8594 * cs-parser.jay: add location to error CS0175
8596 2004-10-04 Miguel de Icaza <miguel@ximian.com>
8598 * ecore.cs (Expression.Constantity): Add support for turning null
8601 * const.cs (Const.Define): Allow constants to be reference types
8602 as long as the value is Null.
8604 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
8606 * namespace.cs (NamespaceEntry.Using): No matter which warning
8607 level is set, check if this namespace name has already been added.
8609 2004-10-03 Ben Maurer <bmaurer@ximian.com>
8611 * expression.cs: reftype [!=]= null should always use br[true,false].
8614 2004-10-03 Marek Safar <marek.safar@seznam.cz>
8617 * attribute.cs: Enum conversion moved to
8618 GetAttributeArgumentExpression to be applied to the all
8621 2004-10-01 Raja R Harinath <rharinath@novell.com>
8623 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8624 * class.c (TypeContainer.DefineType): Flag error if
8625 base types aren't accessible due to access permissions.
8626 * decl.cs (DeclSpace.ResolveType): Move logic to
8627 Expression.ResolveAsTypeTerminal.
8628 (DeclSpace.ResolveTypeExpr): Thin layer over
8629 Expression.ResolveAsTypeTerminal.
8630 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8631 Refactor code into NestedAccess. Use it.
8632 (DeclSpace.NestedAccess): New.
8633 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8634 argument to silence errors. Check access permissions.
8635 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8636 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8637 (Cast.DoResolve): Likewise.
8638 (New.DoResolve): Likewise.
8639 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8640 (TypeOf.DoResolve): Likewise.
8642 * expression.cs (Invocation.BetterConversion): Return the Type of
8643 the better conversion. Implement section 14.4.2.3 more faithfully.
8644 (Invocation.BetterFunction): Make boolean. Make correspondence to
8645 section 14.4.2.2 explicit.
8646 (Invocation.OverloadResolve): Update.
8647 (Invocation): Remove is_base field.
8648 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
8649 (Invocation.Emit): Likewise.
8651 2004-09-27 Raja R Harinath <rharinath@novell.com>
8653 * README: Update to changes.
8655 2004-09-24 Marek Safar <marek.safar@seznam.cz>
8657 * cs-parser.jay: Reverted 642 warning fix.
8659 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8662 * decl.cs (FindMemberWithSameName): Indexer can have more than
8665 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8667 * expression.cs (LocalVariableReference.DoResolveLValue):
8668 Do not report warning 219 for out values.
8669 (EmptyExpression.Null): New member to avoid extra allocations.
8671 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8673 * cs-parser.jay: Fix wrong warning 642 report.
8675 * cs-tokenizer.cs (CheckNextToken): New helper;
8676 Inspect next character if is same as expected.
8678 2004-09-23 Martin Baulig <martin@ximian.com>
8680 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8681 (Convert.ImplicitReferenceConversionExists): Likewise.
8683 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8685 * class.cs (Operator.Define): Add error 448 and 559 report.
8687 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8689 * class.cs (MemberBase.IsTypePermitted): New protected
8690 method for checking error CS0610.
8692 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8694 * class.cs (TypeContainer.HasExplicitLayout): New property
8695 Returns whether container has StructLayout attribute set Explicit.
8696 (FieldMember): New abstract class for consts and fields.
8697 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8698 (Field): Reuse FieldMember.
8700 * const.cs (Const): Reuse FieldMember.
8702 * rootcontext.cs: EmitConstants call moved to class.
8704 2004-09-22 Martin Baulig <martin@ximian.com>
8706 Thanks to Peter Sestoft for this bug report.
8708 * expression.cs (Conditional): If both the `trueExpr' and the
8709 `falseExpr' is a NullLiteral, return a NullLiteral.
8711 2004-09-22 Martin Baulig <martin@ximian.com>
8713 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8714 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8715 for the "get_Current" call.
8717 2004-09-22 Martin Baulig <martin@ximian.com>
8719 Marek and me just fixed one of our oldest bugs: #28562 :-)
8721 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8723 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8724 we're an EnumConstant, just return that.
8725 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8726 an EnumConstant. In this case, we need to use GetValueAsEnumType()
8727 to get the value which'll actually be written into the attribute.
8728 However, we have to use GetValue() to access the attribute's value
8731 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8733 * constant.cs (Constant.IsNegative): New abstract property
8736 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8737 (StackAlloc.DoResolve): Reused IsNegative.
8739 2004-09-21 Martin Baulig <martin@ximian.com>
8741 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
8742 if we're used in an iterator, we may be called from different
8745 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
8746 we actually have an exception block.
8748 2004-09-20 John Luke <jluke@cfl.rr.com>
8750 * class.cs, cs-parser.jay: Improve the error report for 1520:
8751 report the actual line where the error happens, not where the
8754 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
8755 Pass location information that was available elsewhere.
8757 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
8759 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
8760 runtime to delay sign assemblies.
8762 2004-09-19 Miguel de Icaza <miguel@ximian.com>
8764 * cs-parser.jay: Do not report the stack trace, this is barely
8767 2004-08-22 John Luke <john.luke@gmail.com>
8769 * driver.cs : check that a resource id is not already used
8770 before adding it, report CS1508 if it is, bug #63637
8772 2004-09-19 Miguel de Icaza <miguel@ximian.com>
8774 * ecore.cs: Removed dead code.
8776 2004-09-18 Marek Safar <marek.safar@seznam.cz>
8778 * class.cs: Do not report warning CS0067 on the interfaces.
8780 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8782 * cs-parser.jay: Add error 504 report.
8784 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8786 * rootcontext.cs: WarningLevel is 4 by default now.
8788 * statement.cs (Fixed.Resolve): Do not null
8791 2004-09-16 Marek Safar <marek.safar@seznam.cz>
8794 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
8795 deep search when property is not virtual.
8796 (PropertyExpr.ResolveAccessors): Make one call for both
8799 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8802 * statement.cs: Error 152 report constains also location.
8804 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8807 * const.cs: Explicitly set constant as static.
8809 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8812 * cs-parser.jay: Add error 1017 report.
8814 2004-09-15 Marek Safar <marek.safar@seznam.cz>
8816 Fixed bug #59980, #64224
8817 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
8819 * typemanager.cs (IsSpecialMethod): Simplified
8821 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8823 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
8824 condition with better params.
8826 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8829 * attribute.cs (Resolve): Property has to have both
8832 2004-09-14 Martin Baulig <martin@ximian.com>
8834 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8836 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8839 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8840 called and is obsolete then this member suppress message
8841 when call is inside next [Obsolete] method or type.
8843 * expression.cs: Use TestObsoleteMethodUsage member.
8845 2004-09-14 Martin Baulig <martin@ximian.com>
8847 * cs-parser.jay: Sync a bit with the GMCS version.
8849 2004-09-14 Martin Baulig <martin@ximian.com>
8851 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
8852 (CSharpParser.yacc_verbose_flag): New public field.
8854 * genericparser.cs: Removed.
8856 2004-09-14 Raja R Harinath <rharinath@novell.com>
8858 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
8860 2004-09-13 Marek Safar <marek.safar@seznam.cz>
8862 * class.cs (MethodCore.CheckBase): Fix bug #65757.
8864 2004-09-10 Martin Baulig <martin@ximian.com>
8866 Backported my MemberName changes from GMCS into MCS.
8868 - we are now using a special `MemberName' class instead of using
8869 strings; in GMCS, the `MemberName' also contains the type
8872 - changed the grammar rules a bit:
8873 * the old `member_name' is now a `namespace_or_type_name':
8874 The rule is that we use `namespace_or_type_name' everywhere
8875 where we expect either a "member name" (GetEnumerator) or a
8876 "member name" with an explicit interface name
8877 (IEnumerable.GetEnumerator).
8878 In GMCS, the explicit interface name may include type arguments
8879 (IEnumerable<T>.GetEnumerator).
8880 * we use `member_name' instead of just `IDENTIFIER' for
8882 The rule is that we use `member_name' wherever a member may
8883 have type parameters in GMCS.
8885 * decl.cs (MemberName): New public class.
8886 (MemberCore.MemberName): New public readonly field.
8887 (MemberCore.ctor): Take a `MemberName' argument, not a string.
8888 (DeclSpace): Likewise.
8890 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
8891 * enum.cs (Enum.ctor): Likewise.
8893 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
8895 (AliasEntry.ctor): Take a MemberName, not an Expression.
8896 (AliasEntry.UsingAlias): Likewise.
8898 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
8899 (IMethodData.MemberName): Changed type from string to MemberName.
8900 (MemberBase.ExplicitInterfaceName): Likewise.
8901 (AbstractPropertyEventMethod.SetupName): Make this private.
8902 (AbstractPropertyEventMethod.ctor): Added `string prefix'
8903 argument; compute the member name here.
8904 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
8905 on the `member.MemberName' and the `prefix'.
8907 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
8909 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
8910 thus, we get a `MemberName' instead of a `string'. These
8911 declarations may have type parameters in GMCS.
8912 (interface_method_declaration, delegate_declaration): Likewise.
8913 (class_declaration, interface_declaration): Likewise.
8914 (method_header): Use `namespace_or_type_name' instead of
8915 `member_name'. We may be an explicit interface implementation.
8916 (property_declaration, event_declaration): Likewise.
8917 (member_name): This is now just an `IDENTIFIER', not a
8918 `namespace_or_type_name'.
8919 (type_name, interface_type): Removed.
8920 (namespace_or_type_name): Return a MemberName, not an Expression.
8921 (primary_expression): Use `member_name' instead of `IDENTIFIER';
8922 call GetTypeExpression() on the MemberName to get an expression.
8923 (IndexerDeclaration.interface_type): Changed type from string to
8925 (MakeName): Operate on MemberName's instead of string's.
8927 2004-09-13 Raja R Harinath <rharinath@novell.com>
8930 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
8931 (NamespaceEntry.Lookup): Add new argument to flag if we want the
8932 lookup to avoid symbols introduced by 'using'.
8933 * rootcontext.cs (NamespaceLookup): Update.
8935 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8937 * class.cs (TypeContainer.DoDefineMembers): Do not call
8938 DefineDefaultConstructor for static classes.
8940 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8942 * attribute.cs (Attribute.Resolve): Add error 653 report.
8944 * class.cs (Class.ApplyAttributeBuilder): Add error 641
8946 (Method.ApplyAttributeBuilder): Add error 685 report.
8947 (Operator.Define): Add error 564 report.
8949 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8951 * expression.cs (Invocation.DoResolve): Add error
8954 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8957 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8959 * class.cs (ConstructorInitializer.Resolve):
8960 Wrong error number (515->516).
8962 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8964 * class.cs (Indexer.Define): Add error 631 report.
8966 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8968 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8970 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8972 * expression.cs (Probe.DoResolve): Add error CS0241 report.
8974 2004-09-10 Marek Safar <marek.safar@seznam.cz>
8976 * cs-parser.jay: Added error CS0241 report.
8978 2004-09-10 Raja R Harinath <rharinath@novell.com>
8980 * cs-parser.jay (fixed_statement): Introduce a scope for the
8981 declaration in the 'fixed' statement.
8983 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8985 * cs-parser.jay: Added CS0230 error report.
8987 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8989 * cs-parser.jay: Added errors CS0231 and CS0257 report.
8991 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8993 * expression.cs (Argument.Resolve): Added error CS0192 and
8996 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8998 C# 2.0 #pragma warning feature
9000 * cs-tokenizer.cs (PreProcessPragma): New method;
9001 Handles #pragma directive.
9003 * report.cs (WarningRegions): New class; Support
9004 class for #pragma warning directive. It tests whether
9005 warning is enabled for a given line.
9007 2004-09-08 Miguel de Icaza <miguel@ximian.com>
9009 * const.cs: Add more descriptive error report, tahnks to
9012 2004-09-08 Marek Safar <marek.safar@seznam.cz>
9014 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9016 2004-09-07 Miguel de Icaza <miguel@ximian.com>
9018 * expression.cs: Apply patch from Ben: Remove dead code from
9019 ArrayCreation, and remove the TurnintoConstant call in const.cs,
9020 as that code just threw an exception anwyays.
9022 * const.cs: Remove the call to the turnintoconstant, for details
9025 * literal.cs: The type of the null-literal is the null type; So
9026 we use a placeholder type (literal.cs:System.Null, defined here)
9029 * expression.cs (Conditional.DoResolve): Remove some old code that
9030 is no longer needed, conversions have been fixed.
9032 (ArrayCreationExpression.DoResolve): Return false if we fail to
9033 resolve the inner expression.
9035 2004-09-07 Raja R Harinath <rharinath@novell.com>
9038 * cs-parser.jay (delegate_declaration): Record a delegate
9039 declaration as a type declaration.
9040 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9042 2004-09-06 Miguel de Icaza <miguel@ximian.com>
9044 * parameter.cs: Do not crash if the type can not be resolved.
9046 * expression.cs: Report errors with unsafe pointers, fixes #64896
9048 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
9050 * expression.cs: Pointer arith always needs to do a conv.i
9051 if the operand is a long. fix 65320
9053 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9055 Fixed cs0619-37.cs, cs0619-38.cs
9057 * enum.cs (GetObsoleteAttribute): Removed.
9059 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9060 on Enum member is double staged. The first is tested member
9063 2004-09-04 Marek Safar <marek.safar@seznam.cz>
9065 Fixed #56986, #63631, #65231
9067 * class.cs: (TypeContainer.AddToMemberContainer): New method,
9068 adds member to name container.
9069 (TypeContainer.AddToTypeContainer): New method, adds type to
9071 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9072 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9073 AddOperator): Simplified by reusing AddToMemberContainer.
9074 (TypeContainer.UserDefinedStaticConstructor): Changed to property
9076 (Method.CheckForDuplications): Fixed implementation to test all
9078 (MemberBase): Detection whether member is explicit interface
9079 implementation is now in constructor.
9080 (MemberBase.UpdateMemberName): Handles IndexerName.
9081 (Accessor): Changed to keep also location information.
9082 (AbstractPropertyEventMethod): Is derived from MemberCore.
9083 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9084 will be emited or not.
9085 (PropertyBase.AreAccessorsDuplicateImplementation):
9086 Tests whether accessors are not in collision with some method.
9087 (Operator): Is derived from MethodCore to simplify common
9090 * decl.cs (Flags.TestMethodDuplication): Test for duplication
9092 (DeclSpace.AddToContainer): Adds the member to defined_names
9093 table. It tests for duplications and enclosing name conflicts.
9095 * enum.cs (EnumMember): Clean up to reuse the base structures
9097 2004-09-03 Martin Baulig <martin@ximian.com>
9099 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9100 into TypeContainer, to make partial classes work again.
9102 2004-09-03 Martin Baulig <martin@ximian.com>
9104 * rootcontext.cs (RootContext.V2): Removed.
9106 2004-03-23 Martin Baulig <martin@ximian.com>
9108 * expression.cs (Invocation.OverloadResolve): Added `bool
9109 may_fail' argument and use it instead of the Location.IsNull() hack.
9111 2004-09-03 Martin Baulig <martin@ximian.com>
9113 Merged latest changes into gmcs. Please keep this comment in
9114 here, it makes it easier for me to see what changed in MCS since
9115 the last time I merged.
9117 2004-09-03 Raja R Harinath <rharinath@novell.com>
9120 * expression.cs (BetterConversion): Don't allow either conversion
9121 to be null. Remove redundant implicit conversion test when 'q ==
9122 null' -- when this function is invoked, we already know that the
9123 implicit conversion exists.
9124 (BetterFunction): Assume that 'best' is non-null. Remove
9125 redundant reimplementation of IsApplicable when 'best' is null.
9126 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9127 number of arguments.
9128 (IsAncestralType): Extract from OverloadResolve.
9129 (OverloadResolve): Make robust to the MethodGroupExpr being
9130 unsorted. Implement all the logic of Section 14.5.5.1, and
9131 support overloading of methods from multiple applicable types.
9132 Clean up logic somewhat. Don't pass null methods to BetterFunction.
9134 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9135 (RealError, Warning): Append type of report to related symbol.
9137 2004-09-03 Marek Safar <marek.safar@seznam.cz>
9139 * enum.cs: Fixed CLS-Compliance checks for enum members.
9140 Error tests cs3008-8.cs, cs3014-8.cs
9142 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9144 Fixed bug #62342, #63102
9145 * class.cs: ImplementIndexer uses member.IsExplicitImpl
9146 like ImplementMethod.
9148 2004-09-02 Marek Safar <marek.safar@seznam.cz>
9150 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9153 2004-09-02 Martin Baulig <martin@ximian.com>
9155 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9156 TypeManager.GetArgumentTypes() rather than calling GetParameters()
9159 2004-09-01 Marek Safar <marek.safar@seznam.cz>
9161 C# 2.0 Static classes implemented
9163 * class.cs (TypeContainer): instance_constructors,
9164 initialized_fields, initialized_static_fields,
9165 default_constructor, base_inteface_types are protected to be
9166 accessible from StaticClass.
9167 (TypeContainer.DefineDefaultConstructor): New virtual method
9168 for custom default constructor generating
9169 (StaticClass): New class to handle "Static classes" feature.
9171 * cs-parser.jay: Handle static keyword on class like instance
9174 * driver.cs: Added "/langversion" command line switch with two
9175 options (iso-1, default).
9177 2004-08-31 Marek Safar <marek.safar@seznam.cz>
9179 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9181 2004-08-31 Miguel de Icaza <miguel@ximian.com>
9183 * delegate.cs: Style.
9185 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
9187 * delegate.cs: Add seperate instance expr field for miguel.
9189 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9191 * PointerArithmetic (Resolve): make sure we are not doing
9192 pointer arith on void*. Also, make sure we are resolved
9193 by not setting eclass until resolve.
9195 All callers: Make sure that PointerArithmetic gets resolved.
9197 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
9199 * ArrayCreation (LookupType): If the type does not resolve
9200 to an array, give an error.
9202 2004-08-27 Marek Safar <marek.safar@seznam.cz>
9204 * statement.cs (Try.Resolve): Fixed bug #64222
9206 2004-08-27 Martin Baulig <martin@ximian.com>
9209 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9212 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9214 * ecore.cs (Constantify): Get underlying type via
9215 System.Enum.GetUnderlyingType to avoid StackOverflow on the
9216 Windows in special cases.
9218 2004-08-26 Marek Safar <marek.safar@seznam.cz>
9220 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9221 for obtaining also private methods.
9222 (GetRemoveMethod): Used GetRemoveMethod (true)
9223 for obtaining also private methods.
9225 2004-08-24 Martin Baulig <martin@ximian.com>
9227 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9228 MethodAttributes.HideBySig for operators.
9230 2004-08-23 Martin Baulig <martin@ximian.com>
9232 Back to the old error reporting system :-)
9234 * report.cs (Message): Removed.
9235 (Report.MessageData, ErrorData, WarningData): Removed.
9236 (Report.Error, Warning): Back to the old system.
9238 2004-08-23 Martin Baulig <martin@ximian.com>
9240 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9242 * class.cs (TypeContainer.ParentContainer): New public virtual
9243 method; replaces the explicit interface implementation.
9244 (ClassPart.ParentContainer): Override.
9246 2004-08-23 Martin Baulig <martin@ximian.com>
9248 * statement.cs (Switch): Added support for constant switches; see
9249 #59428 or test-285.cs.
9251 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9254 * statement.cs (GetEnumeratorFilter): Removed useless
9255 logic because C# specs is strict. GetEnumerator must be
9258 2004-08-22 Martin Baulig <martin@ximian.com>
9260 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9261 a switch and may break, reset the barrier. Fixes #59867.
9263 2004-08-22 Marek Safar <marek.safar@seznam.cz>
9265 CLS-Compliance speed up (~5% for corlib)
9267 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9268 New method. Tests container for CLS-Compliant names
9270 * class.cs (TypeContainer.VerifyClsName): New method.
9271 Checks whether container name is CLS Compliant.
9272 (Constructor): Implements IMethodData.
9274 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9275 low-case table for CLS Compliance test.
9276 (MemberCache.VerifyClsParameterConflict): New method.
9277 Checks method parameters for CS3006 error.
9279 * enum.cs (EnumMember): Is derived from MemberCore.
9280 (Enum.VerifyClsName): Optimized for better performance.
9282 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9284 * report.cs: Renamed Error_T to Error and changed all
9287 2004-08-06 Marek Safar <marek.safar@seznam.cz>
9289 * class.cs (TypeContainer.IndexerArrayList): New inner class
9290 container for indexers.
9291 (TypeContainer.DefaultIndexerName): New constant for default
9292 indexer name. Replaced all "Item" with this constant.
9293 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9295 * typemanager.cs (TypeManager.default_member_ctor): Cache here
9296 DefaultMemberAttribute constructor.
9298 2004-08-05 Martin Baulig <martin@ximian.com>
9300 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9303 2004-08-05 Marek Safar <marek.safar@seznam.cz>
9305 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9306 multi platforms problem.
9308 * compiler.csproj: Included shared files.
9310 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9312 Fix bug 60333, 55971 in the more general way
9313 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9314 Added arg_type argument for constant conversion.
9315 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9317 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9320 * class.cs (TypeContainer ): New inner classes MethodArrayList,
9321 OperatorArrayList, MethodCoreArrayList for typecontainer
9322 containers. Changed class member types to these new types.
9323 (MethodArrayList.DefineMembers): Added test for CS0659.
9325 2004-08-04 Miguel de Icaza <miguel@ximian.com>
9327 * cfold.cs: Synchronize the folding with the code in expression.cs
9328 Binary.DoNumericPromotions for uint operands.
9330 * attribute.cs: Revert patch from Raja, it introduced a regression
9331 while building Blam-1.2.1 (hard to isolate a test case).
9333 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9337 (TypeContainer.Define): Renamed to DefineContainerMembers because of
9339 (MethodCore.parent_method): New member. The method we're overriding
9340 if this is an override method.
9341 (MethodCore.CheckBase): Moved from Method class and made common.
9342 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9344 (MethodCore.CheckForDuplications): New abstract method. For custom
9345 member duplication search in a container
9346 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9347 method and its return type.
9348 (Event.conflict_symbol): New member. Symbol with same name in the
9352 (MemberCache.FindMemberWithSameName): New method. The method
9353 is looking for conflict with inherited symbols.
9355 2004-08-04 Martin Baulig <martin@ximian.com>
9357 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9359 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9361 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9363 * report.cs (Message): New enum for better error, warning reference in
9365 (MessageData): New inner abstract class. It generally handles printing of
9366 error and warning messages.
9367 Removed unused Error, Warning, Message methods.
9369 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9371 Fix for cs0592-8.cs test
9373 (Attributable.ValidAttributeTargets): Made public.
9374 (Attribute.ExplicitTarget): New member for explicit target value.
9375 (Attribute.CheckTargets): Now we translate explicit attribute
9376 target to Target here.
9378 2004-08-03 Ben Maurer <bmaurer@ximian.com>
9380 * ecore.cs (MethodGroupExpr): new IsBase property.
9382 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9384 * delegate.cs (DelegateCreation): store a MethodGroupExpr
9385 rather than an instance expr.
9387 (DelegateCreation.Emit): Use the method group rather than
9388 the instance expression. Also, if you have base.Foo as the
9389 method for a delegate, make sure to emit ldftn, not ldftnvirt.
9391 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
9393 (NewDelegate.DoResolve): Only check for the existance of Invoke
9394 if the method is going to be needed. Use MethodGroupExpr.
9396 (NewDelegate.Emit): Remove, DelegateCreation implements this.
9398 * expression.cs: For pointer arith., make sure to use
9399 the size of the type, not the size of the pointer to
9402 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9405 * class.cs (Class): Added error CS0502 test.
9407 2004-08-03 John Luke <jluke@cfl.rr.com>
9408 Raja R Harinath <rharinath@novell.com>
9411 * attribute.cs (Attribute.complained_before): New flag.
9412 (Attribute.ResolveType, Attribute.Resolve),
9413 (Attribute.DefinePInvokeMethod): Set it.
9414 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9416 2004-08-03 Martin Baulig <martin@ximian.com>
9418 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9419 use a user-defined operator; we still need to do numeric
9420 promotions in case one argument is a builtin type and the other
9421 one has an implicit conversion to that type. Fixes #62322.
9423 2004-08-02 Martin Baulig <martin@ximian.com>
9425 * statement.cs (LocalInfo.Flags): Added `IsThis'.
9426 (LocalInfo.IsThis): New public property.
9427 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9429 2004-08-01 Martin Baulig <martin@ximian.com>
9431 * class.cs (TypeContainer.GetClassBases): Don't set the default
9432 here since we may get called from GetPartialBases().
9433 (TypeContainer.DefineType): If GetClassBases() didn't return a
9434 parent, use the default one.
9436 2004-07-30 Duncan Mak <duncan@ximian.com>
9438 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
9440 2004-07-30 Martin Baulig <martin@ximian.com>
9442 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9444 * class.cs (SourceMethod): New public class, derive from the
9445 symbol writer's ISourceMethod.
9446 (Method): Use the new symbol writer API.
9448 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9449 as argument and use the new symbol writer.
9452 (SourceFile): Implement the symbol writer's ISourceFile.
9453 (Location.SymbolDocument): Removed.
9454 (Location.SourceFile): New public property.
9456 * symbolwriter.cs: Use the new symbol writer API.
9458 2004-07-30 Raja R Harinath <rharinath@novell.com>
9460 * Makefile (install-local): Remove. Functionality moved to
9463 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
9465 * Makefile: Install mcs.exe.config file together with mcs.exe.
9466 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9467 correct runtime version.
9469 2004-07-25 Martin Baulig <martin@ximian.com>
9472 (TypeContainer.RegisterOrder): Removed, this was unused.
9473 (TypeContainer, interface_order): Removed.
9474 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9475 TypeContainer as argument since we can also be called with a
9476 `PartialContainer' for a partial class/struct/interface.
9477 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9478 of checking whether we're an `Interface' - we could be a
9480 (PartialContainer.Register): Override; call
9481 AddClass()/AddStruct()/AddInterface() on our parent.
9483 * cs-parser.jay (interface_member_declaration): Add things to the
9484 `current_container', not the `current_class'.
9486 * rootcontext.cs (RegisterOrder): The overloaded version which
9487 takes an `Interface' was unused, removed.
9489 * typemanager.cs (TypeManager.LookupInterface): Return a
9490 `TypeContainer', not an `Interface'.
9491 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9492 contain a `PartialContainer' for an interface, so check it's
9493 `Kind' to figure out what it is.
9495 2004-07-25 Martin Baulig <martin@ximian.com>
9497 * class.cs (Class.DefaultTypeAttributes): New public constant.
9498 (Struct.DefaultTypeAttributes): Likewise.
9499 (Interface.DefaultTypeAttributes): Likewise.
9500 (PartialContainer.TypeAttr): Override this and add the
9501 DefaultTypeAttributes.
9503 2004-07-25 Martin Baulig <martin@ximian.com>
9505 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9506 we can just use the `Parent' field instead.
9508 2004-07-25 Martin Baulig <martin@ximian.com>
9510 * class.cs (TypeContainer.Emit): Renamed to EmitType().
9512 2004-07-25 Martin Baulig <martin@ximian.com>
9514 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9515 our parts before defining any methods.
9516 (TypeContainer.VerifyImplements): Make this virtual.
9517 (ClassPart.VerifyImplements): Override and call VerifyImplements()
9518 on our PartialContainer.
9520 2004-07-25 Martin Baulig <martin@ximian.com>
9522 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9524 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9525 argument, we can just use the `Parent' field instead.
9528 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
9529 (MemberBase.DoDefine): Likewise.
9531 2004-07-24 Martin Baulig <martin@ximian.com>
9533 * decl.cs (MemberCore.Parent): New public field.
9534 (DeclSpace.Parent): Moved to MemberCore.
9536 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9537 (MemberBase.ctor): Added TypeContainer argument, pass it to our
9539 (FieldBase, Field, Operator): Likewise.
9540 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9541 (EventField, Event): Likewise.
9543 2004-07-23 Martin Baulig <martin@ximian.com>
9545 * class.cs (PartialContainer): New public class.
9546 (ClassPart): New public class.
9547 (TypeContainer): Added support for partial classes.
9548 (TypeContainer.GetClassBases): Splitted some of the functionality
9549 out into GetNormalBases() and GetPartialBases().
9551 * cs-tokenizer.cs (Token.PARTIAL): New token.
9552 (Tokenizer.consume_identifier): Added some hacks to recognize
9553 `partial', but only if it's immediately followed by `class',
9554 `struct' or `interface'.
9556 * cs-parser.jay: Added support for partial clases.
9558 2004-07-23 Martin Baulig <martin@ximian.com>
9560 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9561 a `DeclSpace' and also made it readonly.
9562 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9563 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9564 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9566 * cs-parser.jay: Pass the `current_class', not the
9567 `current_container' (at the moment, this is still the same thing)
9568 to a new Method, Property, Event, Indexer or Constructor.
9570 2004-07-23 Martin Baulig <martin@ximian.com>
9572 * cs-parser.jay (CSharpParser): Added a new `current_class' field
9573 and removed the `current_interface' one.
9574 (struct_declaration, class_declaration, interface_declaration):
9575 Set `current_class' to the newly created class/struct/interface;
9576 set their `Bases' and call Register() before parsing their body.
9578 2004-07-23 Martin Baulig <martin@ximian.com>
9580 * class.cs (Kind): New public enum.
9581 (TypeContainer): Made this class abstract.
9582 (TypeContainer.Kind): New public readonly field.
9583 (TypeContainer.CheckDef): New public method; moved here from
9585 (TypeContainer.Register): New public abstract method.
9586 (TypeContainer.GetPendingImplementations): New public abstract
9588 (TypeContainer.GetClassBases): Removed the `is_class' and
9589 `is_iface' parameters.
9590 (TypeContainer.DefineNestedTypes): Formerly known as
9592 (ClassOrStruct): Made this class abstract.
9594 * tree.cs (RootTypes): New public type.
9596 2004-07-20 Martin Baulig <martin@ximian.com>
9598 * tree.cs (Tree.RecordNamespace): Removed.
9599 (Tree.Namespaces): Removed.
9601 * rootcontext.cs (RootContext.IsNamespace): Removed.
9603 * cs-parser.jay (namespace_declaration): Just create a new
9604 NamespaceEntry here.
9606 2004-07-20 Martin Baulig <martin@ximian.com>
9608 * statement.cs (ExceptionStatement): New abstract class. This is
9609 now used as a base class for everyone who's using `finally'.
9610 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
9611 our local variables before using them.
9613 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
9614 virtual method. This is used by Yield.Resolve() to "steal" an
9615 outer block's `finally' clauses.
9616 (FlowBranchingException): The .ctor now takes an ExceptionStatement
9619 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
9620 version which takes an ExceptionStatement. This version must be
9621 used to create exception branchings.
9624 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
9625 (Iterator.EmitMoveNext): Added exception support; protect the
9626 block with a `fault' clause, properly handle 'finally' clauses.
9627 (Iterator.EmitDispose): Run all the `finally' clauses here.
9629 2004-07-20 Martin Baulig <martin@ximian.com>
9631 * iterator.cs: This is the first of a set of changes in the
9632 iterator code. Match the spec more closely: if we're an
9633 IEnumerable, then GetEnumerator() must be called. The first time
9634 GetEnumerator() is called, it returns the current instance; all
9635 subsequent invocations (if any) must create a copy.
9637 2004-07-19 Miguel de Icaza <miguel@ximian.com>
9639 * expression.cs: Resolve the constant expression before returning
9642 2004-07-19 Martin Baulig <martin@ximian.com>
9644 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
9645 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
9646 the return type of the new EmitContext.
9648 2004-07-18 Martin Baulig <martin@ximian.com>
9650 * class.cs (Property.Define): Fix iterators.
9652 * iterators.cs (Iterator.Define): Moved the
9653 `container.AddInterator (this)' call here from the .ctor; only do
9654 it if we resolved successfully.
9656 2004-07-17 Miguel de Icaza <miguel@ximian.com>
9658 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
9659 `true' for preprocessing directives that we parse. The return
9660 value indicates whether we should return to regular tokenizing or
9661 not, not whether it was parsed successfully.
9663 In the past if we were in: #if false ... #line #endif, we would
9664 resume parsing after `#line'. See bug 61604.
9666 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
9667 building: IsEnumType should return true only for enums, not for
9668 enums or System.Enum itself. This fixes #61593.
9670 Likely what happened is that corlib was wrong: mcs depended on
9671 this bug in some places. The bug got fixed, we had to add the
9672 hack, which caused bug 61593.
9674 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
9675 that was a workaround for the older conditions.
9677 2004-07-16 Ben Maurer <bmaurer@ximian.com>
9679 * assign.cs: IAssignMethod has a new interface, as documented
9680 inline. All assignment code now uses this new api.
9682 * ecore.cs, expression.cs: All classes which implement
9683 IAssignMethod now use the new interface.
9685 * expression.cs (Invocation): add a hack to EmitCall so that
9686 IndexerAccess can be the target of a compound assignment without
9687 evaluating its arguments twice.
9689 * statement.cs: Handle changes in Invocation api.
9691 2004-07-16 Martin Baulig <martin@ximian.com>
9693 * iterators.cs: Rewrote this. We're now using one single Proxy
9694 class for both the IEnumerable and the IEnumerator interface and
9695 `Iterator' derives from Class so we can use the high-level API.
9697 * class.cs (TypeContainer.AddIterator): New method.
9698 (TypeContainer.DoDefineType): New protected virtual method, which
9699 is called from DefineType().
9700 (TypeContainer.DoDefineMembers): Call DefineType() and
9701 DefineMembers() on all our iterators.
9702 (TypeContainer.Emit): Call Emit() on all our iterators.
9703 (TypeContainer.CloseType): Call CloseType() on all our iterators.
9705 * codegen.cs (EmitContext.CurrentIterator): New public field.
9707 2004-07-15 Martin Baulig <martin@ximian.com>
9710 (TypeManager.not_supported_exception_type): New type.
9712 2004-07-14 Martin Baulig <martin@ximian.com>
9714 * iterators.cs: Use real error numbers.
9716 2004-07-14 Martin Baulig <martin@ximian.com>
9718 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9719 requires this to be a System.Collection.IEnumerable and not a
9720 class implementing that interface.
9721 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
9723 2004-07-13 Marek Safar <marek.safar@seznam.cz>
9725 * class.cs: Fixed previous fix, it broke some error tests.
9727 2004-07-12 Martin Baulig <martin@ximian.com>
9729 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9732 2004-07-09 Miguel de Icaza <miguel@ximian.com>
9734 * assign.cs (LocalTemporary): Add new argument: is_address,If
9735 `is_address' is true, then the value that we store is the address
9736 to the real value, and not the value itself.
9738 * ecore.cs (PropertyExpr): use the new local temporary
9739 stuff to allow us to handle X.Y += z (where X is a struct)
9741 2004-07-08 Martin Baulig <martin@ximian.com>
9743 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9744 not always return, just like we're doing in Using.Resolve().
9746 2004-07-07 Miguel de Icaza <miguel@ximian.com>
9748 * cs-parser.jay (fixed_statement): flag this as Pinned.
9750 2004-07-06 Miguel de Icaza <miguel@ximian.com>
9752 * typemanager.cs (TypeManager): Removed MakePinned method, this
9753 mechanism is replaced with the .NET 2.x compatible mechanism of
9754 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9756 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
9757 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9758 `IsFixed' property which has a different meaning.
9760 2004-07-02 Raja R Harinath <rharinath@novell.com>
9762 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9763 visible from inside a nested class, not just the names of the
9764 immediately enclosing class.
9767 2004-06-24 Raja R Harinath <rharinath@novell.com>
9769 * expression.cs (BetterConversion): Remove buggy special-case
9770 handling of "implicit constant expression conversions". At this
9771 point, we already know that the conversion is possible -- we're
9772 only checking to see which is better.
9774 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9776 * cs-parser.jay: Added error CS0210 test.
9778 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9780 * cs-parser.jay: Added error CS0134 test.
9782 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9785 * cs-parser.jay: Added error CS0145 test.
9787 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9789 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9791 2004-06-23 Ben Maurer <bmaurer@ximian.com>
9793 * expression.cs (StackAlloc.Resolve): The argument may not
9794 be a constant; deal with this case.
9796 2004-06-23 Marek Safar <marek.safar@seznam.cz>
9798 * attribute.cs (IndexerName_GetIndexerName): Renamed to
9799 GetIndexerAttributeValue.
9800 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9802 * class.cs (Indexer.Define): Added error tests for CS0415,
9805 2004-06-23 Miguel de Icaza <miguel@ximian.com>
9807 * attribute.cs (Attribute.Resolve): Keep field code in sync with
9810 2004-06-23 Martin Baulig <martin@ximian.com>
9812 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9813 neither return nor throw, reset the barrier as well. Fixes #60457.
9815 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
9817 * class.cs : EventAttributes is now set to None by default.
9818 This fixes bug #60459.
9820 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9823 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9824 Don't throw exception but return null (it's sufficient now).
9826 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9828 * typemanager.cs (GetArgumentTypes): Faster implementation.
9830 2004-06-18 Martin Baulig <martin@ximian.com>
9832 * attribute.cs (Attribute.Resolve): Check whether we're an
9833 EmptyCast which a Constant child. Fixes #60333.
9835 2004-06-17 Ben Maurer <bmaurer@ximian.com>
9837 * statement.cs (EmitCollectionForeach): Account for the fact that
9838 not all valuetypes are in areas which we can take the address of.
9839 For these variables, we store to a temporary variable. Also, make
9840 sure that we dont emit a `callvirt' on a valuetype method.
9842 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9844 * expression.cs (StackAlloc.DoReSolve): Added test for
9845 negative parameter (CS0247).
9847 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9850 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9852 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9855 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9858 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9860 Fix bug #58254 & cs1555.cs, cs1556.cs
9861 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9863 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9865 * cs-parser.jay: Added error CS1669 test for indexers.
9867 2004-06-11 Martin Baulig <martin@ximian.com>
9869 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9870 call this twice: for params and varargs methods.
9872 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9875 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9877 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9879 * attribute.cs (Attribute.GetValidTargets): Made public.
9882 (AbstractPropertyEventMethod): New class for better code sharing.
9883 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9885 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9887 2004-06-11 Raja R Harinath <rharinath@novell.com>
9890 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
9891 that the call to Resolve is part of a MemberAccess.
9892 (Expression.Resolve): Use it for SimpleName resolution.
9893 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
9894 Add 'intermediate' boolean argument.
9895 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
9896 error message when the SimpleName can be resolved ambiguously
9897 between an expression and a type.
9898 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
9900 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
9901 call on the left-side.
9903 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9906 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
9908 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9910 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
9912 2004-06-11 Martin Baulig <martin@ximian.com>
9914 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
9915 varargs methods if applicable.
9917 2004-06-11 Martin Baulig <martin@ximian.com>
9919 * expression.cs (Invocation.EmitCall): Don't use
9920 `method.CallingConvention == CallingConventions.VarArgs' since the
9921 method could also have `CallingConventions.HasThis'.
9923 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9925 * class.cs (Event.GetSignatureForError): Implemented.
9926 Fixed crash in error test cs3010.cs
9928 2004-06-10 Miguel de Icaza <miguel@ximian.com>
9930 * cs-tokenizer.cs: Change the way we track __arglist to be
9931 consistent with the other keywords.
9933 2004-06-09 Miguel de Icaza <miguel@ximian.com>
9935 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
9938 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
9940 * codegen.cs: Check that all referenced assemblies have a strongname
9941 before strongnaming the compiled assembly. If not report error CS1577.
9942 Fix bug #56563. Patch by Jackson Harper.
9943 * typemanager.cs: Added a method to return all referenced assemblies.
9944 Fix bug #56563. Patch by Jackson Harper.
9946 2004-06-08 Marek Safar <marek.safar@seznam.cz>
9949 (Method.ApplyAttributeBuilder): Moved and added conditional
9950 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
9953 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
9955 2004-06-08 Marek Safar <marek.safar@seznam.cz>
9958 * class.cs: (EventField.attribute_targets): Changed default target.
9960 2004-06-08 Martin Baulig <martin@ximian.com>
9962 * expression.cs (Invocation.EmitCall): Enable varargs methods.
9964 2004-06-08 Martin Baulig <martin@ximian.com>
9966 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
9968 2004-06-07 Martin Baulig <martin@ximian.com>
9970 Added support for varargs methods.
9972 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
9975 * cs-parser.jay: Added support for `__arglist'.
9977 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
9979 * expression.cs (Argument.AType): Added `ArgList'.
9980 (Invocation): Added support for varargs methods.
9981 (ArglistAccess): New public class.
9982 (Arglist): New public class.
9984 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
9986 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
9987 a method's top-level block if the method has varargs.
9989 * support.cs (ReflectionParameters, InternalParameters): Added
9990 support for varargs methods.
9992 2004-06-07 Miguel de Icaza <miguel@ximian.com>
9994 * class.cs: Provide location in indexer error report.
9996 * driver.cs: Use standard names.
9998 * namespace.cs: Catch the use of using after a namespace has been
9999 declared also on using aliases.
10001 2004-06-03 Raja R Harinath <rharinath@novell.com>
10004 * typemanager.cs (closure_private_ok, closure_invocation_type)
10005 (closure_qualifier_type, closure_invocation_assembly)
10006 (FilterWithClosure): Move to ...
10007 (Closure): New internal nested class.
10008 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
10009 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
10010 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
10011 (MemberLookup, MemberLookupFailed): Use it.
10012 * expression.cs (New.DoResolve): Treat the lookup for the
10013 constructor as being qualified by the 'new'ed type.
10014 (Indexers.GetIndexersForTypeOrInterface): Update.
10016 2004-06-03 Marek Safar <marek.safar@seznam.cz>
10019 (GetConditionalAttributeValue): New method. Returns
10020 condition of ConditionalAttribute.
10021 (SearchMulti): New method. Returns all attributes of type 't'.
10022 Use it when attribute is AllowMultiple = true.
10023 (IsConditionalMethodExcluded): New method.
10026 (Method.IsExcluded): Implemented. Returns true if method has conditional
10027 attribute and the conditions is not defined (method is excluded).
10028 (IMethodData): Extended interface for ConditionalAttribute support.
10029 (PropertyMethod.IsExcluded): Implemented.
10032 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
10035 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
10038 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
10040 * expression.cs (ArrayCreationExpression): Make this just an
10041 `expression'. It can't be a statement, so the code here was
10044 2004-06-02 Marek Safar <marek.safar@seznam.cz>
10047 * typemanager.cs (GetFullNameSignature): New method for
10050 2004-06-02 Marek Safar <marek.safar@seznam.cz>
10053 * class.cs (MemberBase.GetSignatureForError): New virtual method.
10054 Use this method when MethodBuilder is null.
10055 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
10056 Added test for error CS0626 (MONO reports error for this situation).
10057 (IMethodData.GetSignatureForError): Extended interface.
10059 2004-06-01 Marek Safar <marek.safar@seznam.cz>
10062 (AttributeTester.GetObsoleteAttribute): Returns instance of
10063 ObsoleteAttribute when type is obsolete.
10066 (TypeContainer.VerifyObsoleteAttribute): Override.
10067 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10068 (MethodCode.VerifyObsoleteAttribute): Override.
10069 (MemberBase.VerifyObsoleteAttribute): Override.
10072 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10073 and report proper error.
10076 Delegate.VerifyObsoleteAttribute): Override.
10079 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10080 and report proper error.
10081 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10084 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10088 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10089 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10090 Added test for ObsoleteAttribute.
10093 (Catch): Derived from Statement.
10095 2004-06-01 Marek Safar <marek.safar@seznam.cz>
10097 Fixed bug #59071 & cs0160.cs
10099 * statement.cs (Try.Resolve): Check here whether order of catch
10100 clauses matches their dependencies.
10102 2004-05-31 Miguel de Icaza <miguel@ximian.com>
10104 * Reverted patch to namespace.cs (Use lookuptypedirect). This
10105 caused a regression: #59343. Referencing nested classes from an
10106 assembly stopped working.
10108 2004-05-31 Martin Baulig <martin@ximian.com>
10110 MCS is now frozen for beta 2.
10112 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10114 * convert.cs: add a trivial cache for overload operator resolution.
10116 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10118 * decl.cs: If possible, use lookuptypedirect here. We can only do
10119 this if there is no `.' after the namespace. Avoids using
10120 LookupType, which does lots of slow processing.
10121 (FindNestedType) New method, does what it says :-).
10122 * namespace.cs: use LookupTypeDirect.
10123 * rootcontext.cs: use membercache, if possible.
10124 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10126 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10129 According to the spec,
10131 In a member access of the form E.I, if E is a single identifier,
10132 and if the meaning of E as a simple-name (§7.5.2) is a constant,
10133 field, property, localvariable, or parameter with the same type as
10134 the meaning of E as a type-name (§3.8), then both possible
10135 meanings of E are permitted.
10137 We did not check that E as a simple-name had the same type as E as
10140 This trivial check gives us 5-7% on bootstrap time.
10142 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
10144 * expression.cs (Invocation.OverloadResolve): Avoid the
10145 use of hashtables and boxing here by allocating on demand.
10147 2004-05-30 Martin Baulig <martin@ximian.com>
10149 * rootcontext.cs (RootContext.LookupType): Don't cache things if
10150 we're doing a silent lookup. Don't try to lookup nested types in
10151 TypeManager.object_type (thanks to Ben Maurer).
10153 2004-05-30 Martin Baulig <martin@ximian.com>
10155 Committing a patch from Ben Maurer.
10157 * rootcontext.cs (RootContext.LookupType): Cache negative results.
10159 2004-05-29 Martin Baulig <martin@ximian.com>
10161 * class.cs (IMethodData.ShouldIgnore): New method.
10163 * typemanager.cs (TypeManager.MethodFlags): Don't take a
10164 `Location' argument, we don't need it anywhere. Use
10165 `IMethodData.ShouldIgnore ()' instead of
10166 `MethodData.GetMethodFlags ()'.
10167 (TypeManager.AddMethod): Removed.
10168 (TypeManager.AddMethod2): Renamed to AddMethod.
10170 2004-05-29 Martin Baulig <martin@ximian.com>
10172 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10174 * convert.cs (Convert.ImplicitReferenceConversion): If we're
10175 converting from a class type S to an interface type and we already
10176 have an object on the stack, don't box it again. Fixes #52578.
10178 2004-05-29 Martin Baulig <martin@ximian.com>
10180 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10181 Added support for `params' parameters. Fixes #59267.
10183 2004-05-29 Martin Baulig <martin@ximian.com>
10185 * literal.cs (NullPointer): Provide a private .ctor which sets
10186 `type' to TypeManager.object_type. Fixes #59048.
10188 2004-05-29 Martin Baulig <martin@ximian.com>
10190 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10191 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
10193 * ecore.cs (EventExpr.instance_expr): Make the field private.
10195 2004-05-26 Marek Safar <marek.safar@seznam.cz>
10197 Fixed bug #50080 & cs0214-2.cs
10198 * expression.cs (Cast.DoResolve): Check unsafe context here.
10200 * statement.cs (Resolve.DoResolve): Likewise.
10202 2004-05-26 Martin Baulig <martin@ximian.com>
10204 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10206 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10207 (RootContext.LookupType): Pass down the `silent' flag.
10209 2004-05-25 Martin Baulig <martin@ximian.com>
10212 (MethodGroupExpr.IdenticalTypeName): New public property.
10213 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10214 expression actually refers to a type.
10216 2004-05-25 Martin Baulig <martin@ximian.com>
10218 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10219 for #56176 and made it actually work.
10221 2004-05-25 Martin Baulig <martin@ximian.com>
10223 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10224 (FieldExpr, PropertyExpr): Override and implement
10225 CacheTemporaries. Fixes #52279.
10227 2004-05-25 Miguel de Icaza <miguel@ximian.com>
10229 * location.cs: In the new compiler listing a file twice is a
10230 warning, not an error.
10232 2004-05-24 Martin Baulig <martin@ximian.com>
10234 * enum.cs (Enum.DefineType): For the `BaseType' to be a
10235 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
10237 2004-05-24 Martin Baulig <martin@ximian.com>
10239 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10240 walking the `using' list. Fixes #53921.
10242 2004-05-24 Martin Baulig <martin@ximian.com>
10244 * const.cs (Const.LookupConstantValue): Added support for
10245 EmptyCast's; fixes #55251.
10247 2004-05-24 Martin Baulig <martin@ximian.com>
10249 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10250 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10251 which does the CS0135 check. The reason is that we first need to
10252 check whether the variable actually exists.
10254 2004-05-24 Martin Baulig <martin@ximian.com>
10256 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10257 than RootContext.LookupType() to find the explicit interface
10258 type. Fixes #58584.
10260 2004-05-24 Raja R Harinath <rharinath@novell.com>
10262 * Makefile: Simplify. Use executable.make.
10263 * mcs.exe.sources: New file. List of sources of mcs.exe.
10265 2004-05-24 Anders Carlsson <andersca@gnome.org>
10269 Use the invariant culture when doing String.Compare for CLS case
10272 2004-05-23 Martin Baulig <martin@ximian.com>
10274 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10275 don't have any dots. Fixes #52622, added cs0246-8.cs.
10277 * namespace.cs (NamespaceEntry.Lookup): Likewise.
10279 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10281 * class.cs (MemberBase.Define): Reuse MemberType member for
10282 resolved type. Other methods can use it too.
10284 2004-05-23 Martin Baulig <martin@ximian.com>
10286 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10287 the variable also exists in the current block (otherwise, we need
10288 to report a CS0103). Fixes #58670.
10290 2004-05-23 Martin Baulig <martin@ximian.com>
10292 * flowanalysis.cs (Reachability.Reachable): Compute this
10293 on-the-fly rather than storing it as a field.
10295 2004-05-23 Martin Baulig <martin@ximian.com>
10297 * flowanalysis.cs (Reachability.And): Manually compute the
10298 resulting `barrier' from the reachability.
10300 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10303 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10304 instance of ObsoleteAttribute when symbol is obsolete.
10307 (IMethodData): Extended interface for ObsoleteAttribute support.
10309 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10311 * attribute.cs: Fix bug #55970
10313 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10317 (GetObsoleteAttribute): New method. Creates the instance of
10319 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10320 ObsoleteAttribute when member is obsolete.
10321 (AttributeTester.Report_ObsoleteMessage): Common method for
10322 Obsolete error/warning reporting.
10325 (TypeContainer.base_classs_type): New member for storing parent type.
10328 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10329 for this MemberCore.
10331 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10333 * attribute.cs, const.cs: Fix bug #58590
10335 2004-05-21 Martin Baulig <martin@ximian.com>
10337 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10338 out parameters if the end of the method is unreachable. Fixes
10341 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10343 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10344 Hari was right, why extra method.
10346 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10348 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10350 2004-05-20 Martin Baulig <martin@ximian.com>
10352 Merged this back from gmcs to keep the differences to a minumum.
10354 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
10355 instead of a Declspace.
10356 (Attribute.ResolveType): Likewise.
10357 (Attributes.Search): Likewise.
10358 (Attributes.Contains): Likewise.
10359 (Attributes.GetClsCompliantAttribute): Likewise.
10361 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
10363 (MethodData.ApplyAttributes): Take an EmitContext instead of a
10366 2004-05-19 Marek Safar <marek.safar@seznam.cz>
10368 Fix bug #58688 (MCS does not report error when the same attribute
10371 * attribute.cs (Attribute.Emit): Distinction between null and default.
10373 2004-05-19 Raja R Harinath <rharinath@novell.com>
10375 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10376 of a top-level attribute without an attribute target.
10377 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
10379 (Attribute.Conditional_GetConditionName),
10380 (Attribute.Obsolete_GetObsoleteMessage): Update.
10381 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
10382 part of ScanForIndexerName.
10383 (Attribute.CanIgnoreInvalidAttribute): New function.
10384 (Attribute.ScanForIndexerName): Move to ...
10385 (Attributes.ScanForIndexerName): ... here.
10386 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10387 (Attributes.Search): New internal variant that can choose not to
10388 complain if types aren't resolved. The original signature now
10390 (Attributes.GetClsCompliantAttribute): Use internal variant, with
10391 complaints suppressed.
10392 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10393 only if it not useful.
10394 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10395 top-level for attributes that are shared between the assembly
10396 and a top-level class.
10397 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10398 * class.cs: Update to reflect changes.
10399 (DefineIndexers): Fuse loops.
10400 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
10401 a couple more variants of attribute names.
10403 2004-05-18 Marek Safar <marek.safar@seznam.cz>
10405 Fix bug #52585 (Implemented explicit attribute declaration)
10408 (Attributable.ValidAttributeTargets): New abstract method. It gets
10409 list of valid attribute targets for explicit target declaration.
10410 (Attribute.Target): It holds target itself.
10411 (AttributeSection): Removed.
10412 (Attribute.CheckTargets): New method. It checks whether attribute
10413 target is valid for the current element.
10416 (EventProperty): New class. For events that are declared like
10417 property (with add and remove accessors).
10418 (EventField): New class. For events that are declared like field.
10421 * cs-parser.jay: Implemented explicit attribute target declaration.
10423 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
10424 Override ValidAttributeTargets.
10427 (ReturnParameter): Class for applying custom attributes on
10429 (ParameterAtribute): New class. Class for applying custom
10430 attributes on the parameter type.
10432 2004-05-17 Miguel de Icaza <miguel@ximian.com>
10434 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10437 (Method): Allow UNSAFE here.
10439 * modifiers.cs: Support unsafe reporting.
10441 2004-05-17 Marek Safar <marek.safar@seznam.cz>
10443 * decl.cs: Fix bug #58478.
10445 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10447 * statement.cs: When checking for unreachable code on an EmptyStatement,
10448 set the location. Fixes bug #58488.
10450 2004-05-13 Miguel de Icaza <miguel@ximian.com>
10452 * driver.cs: Add -pkg handling.
10454 From Gonzalo: UseShelLExecute=false
10456 2004-05-12 Marek Safar <marek.safar@seznam.cz>
10459 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10461 (Attribute.IsClsCompliaceRequired): Moved to base for better
10463 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10464 when attribute is AttributeUsageAttribute.
10465 (Attribute.GetValidTargets): Simplified.
10466 (Attribute.GetAttributeUsage): New method returns AttributeUsage
10467 attribute for this type.
10468 (Attribute.ApplyAttributes): Method renamed to Emit and make
10470 (GlobalAttributeSection): New class for special handling of global
10471 attributes (assembly, module).
10472 (AttributeSection.Emit): New method.
10474 * class.cs: Implemented Attributable abstract methods.
10475 (MethodCore.LabelParameters): Moved to Parameter class.
10476 (Accessor): Is back simple class.
10477 (PropertyMethod): Implemented Attributable abstract class.
10478 (DelegateMethod): Implemented Attributable abstract class.
10479 (Event): New constructor for disctintion between normal Event
10480 and Event with accessors.
10482 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10484 * codegen.cs, const.cs, decl.cs, delegate.cs:
10485 (CommonAssemblyModulClass): Implemented Attributable abstract class
10488 * enum.cs: Implement IAttributeSupport interface.
10489 (EnumMember): New class for emum members. Implemented Attributable
10493 (ParameterBase): Is abstract.
10494 (ReturnParameter): New class for easier [return:] attribute handling.
10496 * typemanager.cs: Removed builder_to_attr.
10498 2004-05-11 Raja R Harinath <rharinath@novell.com>
10501 * attribute.cs (Attribute.GetPositionalValue): New function.
10502 * class.cs (TypeContainer.VerifyMembers): New function.
10503 (TypeContainer.Emit): Use it.
10504 (ClassOrStruct): New base class for Class and Struct.
10505 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
10506 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10508 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10509 then each non-static field should have a FieldOffset attribute.
10510 Otherwise, none of the fields should have a FieldOffset attribute.
10511 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
10512 and FieldOffset attributes.
10513 * typemanager.cs (TypeManager.struct_layout_attribute_type)
10514 (TypeManager.field_offset_attribute_type): New core types.
10515 (TypeManager.InitCoreTypes): Initialize them.
10517 2004-05-11 Michal Moskal <malekith@pld-linux.org>
10519 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10520 Return correct type.
10523 2004-05-09 Miguel de Icaza <miguel@ximian.com>
10525 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10526 be implicitly converted to ulong.
10528 * expression.cs: The logic for allowing operator &, | and ^ worked
10529 was wrong, it worked before because we did not report an error in
10530 an else branch. Fixes 57895.
10532 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10533 allow volatile fields to be reference types.
10535 2004-05-07 Miguel de Icaza <miguel@ximian.com>
10537 * driver.cs: Add support for /debug-
10539 2004-05-07 Raja R Harinath <rharinath@novell.com>
10541 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
10542 Add a 'complain' parameter to silence errors.
10543 (Attribute.Resolve): Update to changes. Put in sanity check to catch
10544 silently overlooked type-resolutions.
10545 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10546 to reflect changes.
10547 (Attributes.Search): New function.
10548 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10549 (Attributes.GetAttributeFullName): Remove hack.
10550 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
10551 Update to reflect changes.
10552 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10553 Use Attributes.Search instead of nested loops.
10555 2004-05-07 Marek Safar <marek.safar@seznam.cz>
10558 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10559 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10560 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10562 * report.cs: (Report.Warning): Renamed to Warning_T because of
10563 parameter collision.
10565 2004-05-05 Raja R Harinath <rharinath@novell.com>
10567 * expression.cs (MemberAccess.ResolveMemberAccess):
10568 Exit with non-zero status after Report.Error.
10569 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10571 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10573 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10575 * support.cs: Don't hang when the file is empty.
10577 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10579 * support.cs: In SeekableStreamReader, compute the preamble size of the
10580 underlying stream. Position changes should take into account that initial
10583 2004-05-03 Todd Berman <tberman@sevenl.net>
10585 * driver.cs: remove unused GetSysVersion function.
10587 2004-05-03 Todd Berman <tberman@sevenl.net>
10589 * driver.cs: Remove the hack from saturday, as well as the hack
10590 from jackson (LoadAssemblyFromGac), also adds the CWD to the
10591 link_paths to get that bit proper.
10593 2004-05-01 Todd Berman <tberman@sevenl.net>
10595 * driver.cs: Try a LoadFrom before a Load, this checks the current
10596 path. This is currently a bug in mono that is be fixed, however, this
10597 provides a workaround for now. This will be removed when the bug
10600 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
10602 * CryptoConvert.cs: Updated to latest version. Fix issue with
10603 incomplete key pairs (#57941).
10605 2004-05-01 Todd Berman <tberman@sevenl.net>
10607 * driver.cs: Remove '.' from path_chars, now System.* loads properly
10610 2004-04-30 Jackson Harper <jackson@ximian.com>
10612 * codegen.cs: Open keys readonly.
10614 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10616 * typemanager.cs: don't report cyclic struct layout when a struct
10617 contains 2 or more fields of the same type. Failed for Pango.AttrShape
10618 which has 2 Pango.Rectangle fields.
10620 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
10622 * expression.cs: Handle IntPtr comparisons with IL code
10623 rather than a method call.
10625 2004-04-29 Martin Baulig <martin@ximian.com>
10627 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
10628 the list of PropertyInfo's in class hierarchy and find the
10629 accessor. Fixes #56013.
10631 2004-04-29 Martin Baulig <martin@ximian.com>
10633 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10635 2004-04-29 Martin Baulig <martin@ximian.com>
10637 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10639 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10641 2004-04-29 Martin Baulig <martin@ximian.com>
10643 * class.cs (ConstructorInitializer.Resolve): Check whether the
10644 parent .ctor is accessible. Fixes #52146.
10646 2004-04-29 Martin Baulig <martin@ximian.com>
10648 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10650 * statement.cs (Using.EmitLocalVariableDecls): Use
10651 TypeManager.idisposable_type, not typeof (IDisposable).
10652 (Foreach.EmitCollectionForeach): Added support for valuetypes.
10654 2004-04-29 Martin Baulig <martin@ximian.com>
10656 * class.cs (Event.Define): Don't emit the field and don't set
10657 RTSpecialName and SpecialName for events on interfaces. Fixes
10660 2004-04-29 Raja R Harinath <rharinath@novell.com>
10662 Refactor Attribute.ApplyAttributes.
10663 * attribute.cs (Attributable): New base class for objects that can
10664 have Attributes applied on them.
10665 (Attribute): Make AttributeUsage fields public.
10666 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10667 (Attribute.IsInternalCall): New property.
10668 (Attribute.UsageAttr): Convert to a public read-only property.
10669 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10670 (Attribute.ResolveType, Attribute.Resolve)
10671 (Attribute.ScanForIndexerName): Update to reflect changes.
10672 (Attribute.CheckAttributeTarget): Re-format.
10673 (Attribute.ApplyAttributes): Refactor, to various
10674 Attributable.ApplyAttributeBuilder methods.
10675 * decl.cs (MemberCore): Make Attributable.
10676 * class.cs (Accessor): Make Attributable.
10677 (MethodData.ApplyAttributes): Use proper attribute types, not
10679 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10680 (TypeContainer.ApplyAttributeBuilder)
10681 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10682 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
10683 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10684 (Operator.ApplyAttributeBuilder): New factored-out methods.
10685 * const.cs (Const.ApplyAttributeBuilder): Likewise.
10686 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10687 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10688 * parameter.cs (ParameterBase): New Attributable base class
10689 that can also represent Return types.
10690 (Parameter): Update to the changes.
10692 2004-04-29 Jackson Harper <jackson@ximian.com>
10694 * driver.cs: Prefer the corlib system version when looking for
10695 assemblies in the GAC. This is still a hack, but its a better hack
10698 2004-04-29 Marek Safar <marek.safar@seznam.cz>
10700 * decl.cs, enum.cs: Improved error 3005 reporting.
10702 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10703 (related_symbols): New private member for list of symbols
10704 related to reported error/warning.
10706 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10708 2004-04-29 Martin Baulig <martin@ximian.com>
10710 * ecore.cs (Expression.Constantify): If we're an enum and
10711 TypeManager.TypeToCoreType() doesn't give us another type, use
10712 t.UnderlyingSystemType. Fixes #56178.
10714 2004-04-29 Martin Baulig <martin@ximian.com>
10716 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10717 interfaces and for each interface, only add members directly
10718 declared in that interface. Fixes #53255.
10720 2004-04-28 Martin Baulig <martin@ximian.com>
10722 * expression.cs (ConditionalLogicalOperator): Use a temporary
10723 variable for `left' to avoid that we evaluate it more than once;
10726 2004-04-28 Martin Baulig <martin@ximian.com>
10728 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10731 2004-04-28 Martin Baulig <martin@ximian.com>
10733 * statement.cs (LocalInfo.Resolve): Check whether the type is not
10736 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10737 whether the type is not void (CS1547).
10739 2004-04-28 Martin Baulig <martin@ximian.com>
10741 * expression.cs (Unary.DoResolveLValue): Override this and report
10742 CS0131 for anything but Operator.Indirection.
10744 2004-04-28 Martin Baulig <martin@ximian.com>
10746 Committing a patch from Ben Maurer; see bug #50820.
10748 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10751 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10754 2004-04-28 Martin Baulig <martin@ximian.com>
10756 Committing a patch from Ben Maurer; see bug #50820.
10758 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10761 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10764 2004-04-28 Martin Baulig <martin@ximian.com>
10766 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10767 (Block.AddLabel): Call DoLookupLabel() to only search in the
10770 2004-04-28 Martin Baulig <martin@ximian.com>
10772 * cfold.cs (ConstantFold.BinaryFold): Added special support for
10773 comparing StringConstants and NullLiterals in Equality and Inequality.
10775 2004-04-28 Jackson Harper <jackson@ximian.com>
10777 * driver.cs: Attempt to load referenced assemblies from the
10778 GAC. This is the quick and dirty version of this method that
10779 doesnt take into account versions and just takes the first
10780 canidate found. Will be good enough for now as we will not have more
10781 then one version installed into the GAC until I update this method.
10783 2004-04-28 Martin Baulig <martin@ximian.com>
10785 * typemanager.cs (TypeManager.CheckStructCycles): New public
10786 static method to check for cycles in the struct layout.
10788 * rootcontext.cs (RootContext.PopulateTypes): Call
10789 TypeManager.CheckStructCycles() for each TypeContainer.
10790 [Note: We only need to visit each type once.]
10792 2004-04-28 Martin Baulig <martin@ximian.com>
10794 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10796 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10797 success and added `out object value'. Use a `bool resolved' field
10798 to check whether we've already been called rather than
10799 `ConstantValue != null' since this breaks for NullLiterals.
10801 2004-04-28 Raja R Harinath <rharinath@novell.com>
10803 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10804 setting of this flag, since the 'set' method may be non-public.
10806 2004-04-28 Raja R Harinath <rharinath@novell.com>
10808 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10809 check on current_vector.Block.
10811 2004-04-27 Martin Baulig <martin@ximian.com>
10813 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10814 a field initializer. Fixes #56459.
10816 2004-04-27 Martin Baulig <martin@ximian.com>
10818 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10819 we're not attempting to use an indexer. Fixes #52154.
10821 2004-04-27 Martin Baulig <martin@ximian.com>
10823 * statement.cs (Return): Don't create a return label if we don't
10824 need it; reverts my change from January 20th. Thanks to Ben
10827 2004-04-27 Martin Baulig <martin@ximian.com>
10829 According to the spec, `goto' can only leave a nested scope, but
10832 * statement.cs (Block.LookupLabel): Only lookup in the current
10833 block, don't recurse into parent or child blocks.
10834 (Block.AddLabel): Check in parent and child blocks, report
10835 CS0140/CS0158 if we find a duplicate.
10836 (Block): Removed this indexer for label lookups.
10837 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10838 this already does the error reporting for us.
10841 (FlowBranching.UsageVector.Block): New public variable; may be null.
10842 (FlowBranching.CreateSibling): Added `Block' argument.
10843 (FlowBranching.LookupLabel): New public virtual method. Lookup a
10844 label for the target of a `goto' and check whether we're not
10845 leaving a `finally'.
10847 2004-04-27 Martin Baulig <martin@ximian.com>
10849 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10850 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10853 2004-04-27 Martin Baulig <martin@ximian.com>
10855 * statement.cs (Block.AddLabel): Also check for implicit blocks
10856 and added a CS0158 check.
10858 2004-04-27 Martin Baulig <martin@ximian.com>
10860 * flowanalysis.cs (FlowBranchingLoop): New class.
10861 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10862 UsageVector's instead of an ArrayList.
10863 (FlowBranching.Label): Likewise.
10864 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10865 (FlowBranching.AddBreakVector): New method.
10867 2004-04-27 Miguel de Icaza <miguel@ximian.com>
10869 * attribute.cs: Small regression fix: only convert the type if we
10870 the type is different, fixes System.Drawing build.
10872 2004-04-27 Martin Baulig <martin@ximian.com>
10874 * attribute.cs (Attribute.Resolve): If we have a constant value
10875 for a named field or property, implicity convert it to the correct
10878 2004-04-27 Raja R Harinath <rharinath@novell.com>
10880 * statement.cs (Block.Block): Implicit blocks share
10881 'child_variable_names' fields with parent blocks.
10882 (Block.AddChildVariableNames): Remove.
10883 (Block.AddVariable): Mark variable as "used by a child block" in
10884 every surrounding block.
10885 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10886 been used in a child block, complain about violation of "Invariant
10887 meaning in blocks" rule.
10888 * cs-parser.jay (declare_local_variables): Don't use
10889 AddChildVariableNames.
10890 (foreach_statement): Don't create an implicit block: 'foreach'
10891 introduces a scope.
10893 2004-04-23 Miguel de Icaza <miguel@ximian.com>
10895 * convert.cs (ImplicitNumericConversion): 0 is also positive when
10896 converting from 0L to ulong. Fixes 57522.
10898 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10900 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10901 derived class hides via 'new' keyword field from base class (test-242.cs).
10902 TODO: Handle this in the more general way.
10904 * class.cs (CheckBase): Ditto.
10906 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10908 * decl.cs (caching_flags): New member for storing cached values
10910 (MemberCore.Flags): New enum where bit flags for caching_flags
10912 (MemberCore.cls_compliance): Moved to caching_flags.
10913 (DeclSpace.Created): Moved to caching_flags.
10915 * class.cs: Use caching_flags instead of DeclSpace.Created
10917 2004-04-21 Miguel de Icaza <miguel@ximian.com>
10919 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10920 if we are only a derived class, not a nested class.
10922 * typemanager.cs: Same as above, but do this at the MemberLookup
10923 level (used by field and methods, properties are handled in
10924 PropertyExpr). Allow for the qualified access if we are a nested
10927 2004-04-21 Marek Safar <marek.safar@seznam.cz>
10929 * class.cs: Refactoring.
10930 (IMethodData): New inteface; Holds links to parent members
10931 to avoid member duplication (reduced memory allocation).
10932 (Method): Implemented IMethodData interface.
10933 (PropertyBase): New inner classes for get/set methods.
10934 (PropertyBase.PropertyMethod): Implemented IMethodData interface
10935 (Event): New inner classes for add/remove methods.
10936 (Event.DelegateMethod): Implemented IMethodData interface.
10938 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10939 EmitContext (related to class.cs refactoring).
10941 2004-04-21 Raja R Harinath <rharinath@novell.com>
10943 * delegate.cs (Delegate.VerifyApplicability): If the number of
10944 arguments are the same as the number of parameters, first try to
10945 verify applicability ignoring any 'params' modifier on the last
10949 2004-04-16 Raja R Harinath <rharinath@novell.com>
10951 * class.cs (TypeContainer.AddIndexer): Use
10952 'ExplicitInterfaceName' to determine if interface name was
10953 explicitly specified. 'InterfaceType' is not initialized at this time.
10954 (TypeContainer.DefineIndexers): Remove use of temporary list. The
10955 Indexers array is already in the required order. Initialize
10956 'IndexerName' only if there are normal indexers.
10957 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10958 (TypeContainer.Emit): Emit DefaultMember attribute only if
10959 IndexerName is initialized.
10962 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
10964 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10967 2004-04-15 Raja R Harinath <rharinath@novell.com>
10969 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10973 * attribute.cs (Attribute.Resolve): Check for duplicate named
10977 2004-04-15 Miguel de Icaza <miguel@ximian.com>
10979 * iterators.cs (MarkYield): track whether we are in an exception,
10980 and generate code accordingly. Use a temporary value to store the
10981 result for our state.
10983 I had ignored a bit the interaction of try/catch with iterators
10984 since their behavior was not entirely obvious, but now it is
10985 possible to verify that our behavior is the same as MS .NET 2.0
10989 2004-04-14 Miguel de Icaza <miguel@ximian.com>
10991 * iterators.cs: Avoid creating temporaries if there is no work to
10994 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10995 Enumerations, use TypeManager.EnumToUnderlying and call
10998 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11001 (This.Emit): Use EmitContext.EmitThis to emit our
11004 (This.EmitAssign): Ditto.
11006 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11007 codepaths, we will move all the functionality into
11010 (FieldExpr.EmitAssign): Ditto.
11012 This fixes several hidden bugs that I uncovered while doing a code
11013 review of this today.
11015 * codegen.cs (EmitThis): reworked so the semantics are more clear
11016 and also support value types "this" instances.
11018 * iterators.cs: Changed so that for iterators in value types, we
11019 do not pass the value type as a parameter.
11021 Initialization of the enumerator helpers is now done in the caller
11022 instead of passing the parameters to the constructors and having
11023 the constructor set the fields.
11025 The fields have now `assembly' visibility instead of private.
11027 2004-04-11 Miguel de Icaza <miguel@ximian.com>
11029 * expression.cs (Argument.Resolve): Check if fields passed as ref
11030 or out are contained in a MarshalByRefObject.
11032 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11033 another compiler type.
11035 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
11037 * class.cs (Indexer.Define): use the new name checking method.
11038 Also, return false on an error.
11039 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11040 (is_identifier_[start/part]_character): make static.
11042 2004-04-10 Miguel de Icaza <miguel@ximian.com>
11044 * expression.cs (Binary.ResolveOperator): Do no append strings
11045 twice: since we can be invoked more than once (array evaluation)
11046 on the same concatenation, take care of this here. Based on a fix
11047 from Ben (bug #56454)
11049 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
11051 * codegen.cs: Fix another case where CS1548 must be reported (when
11052 delay-sign isn't specified and no private is available #56564). Fix
11053 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
11054 error when MCS is used on the MS runtime and we need to delay-sign
11055 (which seems unsupported by AssemblyBuilder - see #56621).
11057 2004-04-08 Marek Safar <marek.safar@seznam.cz>
11059 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11060 (TypeManager.ComputeNamespaces): Faster implementation for
11063 * compiler.csproj: Updated AssemblyName to mcs.
11065 2004-04-07 Miguel de Icaza <miguel@ximian.com>
11067 * rootcontext.cs: Add new types to the boot resolution.
11069 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11070 MulticastDelegate is not allowed.
11072 * typemanager.cs: Add new types to lookup: System.TypedReference
11075 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11076 check for TypedReference or ArgIterator, they are not allowed.
11078 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11079 makes us properly catch 1510 in some conditions (see bug 56016 for
11082 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
11084 * CryptoConvert.cs: update from corlib version
11087 2004-04-05 Miguel de Icaza <miguel@ximian.com>
11089 * class.cs (Indexer.Define): Check indexername declaration
11091 2004-04-05 Marek Safar <marek.safar@seznam.cz>
11093 * attribute.cs (IsClsCompliant): Fixed problem with handling
11094 all three states (compliant, not-compliant, undetected).
11096 2004-03-30 Marek Safar <marek.safar@seznam.cz>
11098 * attribute.cs (Attribute): Location is now public.
11099 (Resolve): Store resolved arguments (pos_values) in attribute class.
11100 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11101 (GetClsCompliantAttributeValue): New method that gets
11102 CLSCompliantAttribute value.
11103 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11104 if exists else null.
11105 (AttributeTester): New class for CLS-Compliant verification routines.
11107 * class.cs (Emit): Add CLS-Compliant verification.
11108 (Method.GetSignatureForError): Implemented.
11109 (Constructor.GetSignatureForError): Implemented
11110 (Constructor.HasCompliantArgs): Returns if constructor has
11111 CLS-Compliant arguments.
11112 (Constructor.Emit): Override.
11113 (Construcor.IsIdentifierClsCompliant): New method; For constructors
11114 is needed to test only parameters.
11115 (FieldBase.GetSignatureForError): Implemented.
11116 (TypeContainer): New member for storing base interfaces.
11117 (TypeContainer.FindMembers): Search in base interfaces too.
11119 * codegen.cs (GetClsComplianceAttribute): New method that gets
11120 assembly or module CLSCompliantAttribute value.
11121 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11123 (ModuleClass.Emit): Add error 3012 test.
11125 * const.cs (Emit): Override and call base for CLS-Compliant tests.
11127 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11128 state for all decl types.
11129 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11130 if CLS-Compliant tests are required.
11131 (IsClsCompliaceRequired): New method. Analyze whether code
11132 must be CLS-Compliant.
11133 (IsExposedFromAssembly): New method. Returns true when MemberCore
11134 is exposed from assembly.
11135 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11136 value or gets cached value.
11137 (HasClsCompliantAttribute): New method. Returns true if MemberCore
11138 is explicitly marked with CLSCompliantAttribute.
11139 (IsIdentifierClsCompliant): New abstract method. This method is
11140 used to testing error 3005.
11141 (IsIdentifierAndParamClsCompliant): New method. Common helper method
11142 for identifier and parameters CLS-Compliant testing.
11143 (VerifyClsCompliance): New method. The main virtual method for
11144 CLS-Compliant verifications.
11145 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11146 null. I don't know why is null (too many public members !).
11147 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11148 and get value of first CLSCompliantAttribute that found.
11150 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11151 (VerifyClsCompliance): Override and add extra tests.
11153 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11154 clscheck- disable CLS-Compliant verification event if assembly is has
11155 CLSCompliantAttribute(true).
11157 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11158 ApllyAttribute is now called in emit section as in the other cases.
11159 Possible future Emit integration.
11160 (IsIdentifierClsCompliant): New override.
11161 (VerifyClsCompliance): New override.
11162 (GetEnumeratorName): Returns full enum name.
11164 * parameter.cs (GetSignatureForError): Implemented.
11166 * report.cs (WarningData): New struct for Warning message information.
11167 (LocationOfPreviousError): New method.
11168 (Warning): New method. Reports warning based on the warning table.
11169 (Error_T): New method. Reports error based on the error table.
11171 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11172 verifications are done here.
11174 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11176 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11177 CLSCompliantAttribute.
11178 (all_imported_types): New member holds all imported types from other
11180 (LoadAllImportedTypes): New method fills static table with exported types
11181 from all referenced assemblies.
11182 (Modules): New property returns all assembly modules.
11184 2004-03-30 Miguel de Icaza <miguel@ximian.com>
11186 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11187 throwing a parser error.
11189 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11190 which removes the hardcoded get_/set_ prefixes for properties, as
11191 IL allows for the properties to be named something else.
11195 * expression.cs: Do not override operand before we know if it is
11196 non-null. Fix 56207
11198 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11200 * typemanager.cs: support for pinned variables.
11202 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11204 * decl.cs, typemanager.cs: Avoid using an arraylist
11205 as a buffer if there is only one result set.
11207 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11209 * expression.cs: Make sure you cant call a static method
11210 with an instance expression, bug #56174.
11212 2004-03-29 Miguel de Icaza <miguel@ximian.com>
11214 * class.cs (IsDuplicateImplementation): Improve error reporting to
11215 flag 663 (method only differs in parameter modifier).
11217 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11218 in preprocessor directives.
11220 * location.cs (LookupFile): Allow for the empty path.
11222 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
11223 better approach for some of that patch, but its failing with the
11224 CharSet enumeration. For now try/catch will do.
11226 * typemanager.cs: Do not crash if a struct does not have fields.
11229 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11231 * expression.cs: cs0213, cant fix a fixed expression.
11234 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11236 * cs-parser.jay: detect invalid embeded statements gracefully.
11239 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11241 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11244 the invocation type may not be a subclass of the tye of the item/
11245 The type of the item must be a subclass of the invocation item.
11250 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
11252 * attribute.cs: Added methods to get a string and a bool from an
11253 attribute. Required to information from AssemblyKeyFileAttribute,
11254 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11255 * codegen.cs: Modified AssemblyName creation to include support for
11256 strongnames. Catch additional exceptions to report them as CS1548.
11257 * compiler.csproj: Updated include CryptoConvert.cs.
11258 * compiler.csproj.user: Removed file - user specific configuration.
11259 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
11260 Mono.Security assembly. The original class is maintained and tested in
11261 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11262 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11263 like CSC 8.0 (C# v2) supports.
11264 * Makefile: Added CryptoConvert.cs to mcs sources.
11265 * rootcontext.cs: Added new options for strongnames.
11267 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
11269 * driver.cs: For --expect-error, report error code `2'
11270 if the program compiled with no errors, error code `1' if
11271 it compiled with an error other than the one expected.
11273 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
11275 * compiler.csproj: Updated for Visual Studio .NET 2003.
11276 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11277 * compiler.sln: Updated for Visual Studio .NET 2003.
11279 2004-03-24 Ravi Pratap M <ravi@ximian.com>
11281 * expression.cs: Fix bug #47234. We basically need to apply the
11282 rule that we prefer the conversion of null to a reference type
11283 when faced with a conversion to 'object' (csc behaviour).
11285 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11287 * statement.cs: Shorter form for foreach, eliminates
11288 a local variable. r=Martin.
11290 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11292 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11293 checks if we can use brtrue/brfalse to test for 0.
11294 * expression.cs: use the above in the test for using brtrue/brfalse.
11295 cleanup code a bit.
11297 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11299 * expression.cs: Rewrite string concat stuff. Benefits:
11301 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11302 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11303 rather than a concat chain.
11305 * typemanager.cs: Add lookups for more concat overloads.
11307 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11309 * expression.cs: Emit shorter il code for array init.
11326 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
11328 * statement.cs: Before, two switch blocks would be merged if the
11329 total size of the blocks (end_item - begin_item + 1) was less than
11330 two times the combined sizes of the blocks.
11332 Now, it will only merge if after the merge at least half of the
11337 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
11339 * class.cs : csc build fix for GetMethods(). See bug #52503.
11341 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
11343 * expression.cs: Make sure fp comparisons work with NaN.
11344 This fixes bug #54303. Mig approved this patch a long
11345 time ago, but we were not able to test b/c the runtime
11348 2004-03-19 Miguel de Icaza <miguel@ximian.com>
11350 * ecore.cs (TypExpr.GetHashCode): implement this overload.
11352 2004-03-19 Martin Baulig <martin@ximian.com>
11354 * class.cs (MemberCore.IsDuplicateImplementation): Report the
11355 error here and not in our caller.
11357 2004-03-19 Martin Baulig <martin@ximian.com>
11359 * interface.cs: Completely killed this file.
11360 (Interface): We're now a TypeContainer and live in class.cs.
11362 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11363 argument; we're now also called for interfaces.
11364 (TypeContainer.DefineMembers): Allow this method being called
11366 (TypeContainer.GetMethods): New public method; formerly known as
11367 Interface.GetMethod(). This is used by PendingImplementation.
11368 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11369 it's now private and non-static.
11370 (Interface): Moved this here; it's now implemented similar to
11372 (Method, Property, Event, Indexer): Added `bool is_interface'
11373 argument to their .ctor's.
11374 (MemberBase.IsInterface): New public field.
11376 * cs-parser.jay: Create normal Method, Property, Event, Indexer
11377 instances instead of InterfaceMethod, InterfaceProperty, etc.
11378 (opt_interface_base): Removed; we now use `opt_class_base' instead.
11379 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11381 2004-03-19 Martin Baulig <martin@ximian.com>
11383 * class.cs (MethodCore.IsDuplicateImplementation): New private
11384 method which does the CS0111 checking.
11385 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11386 Use IsDuplicateImplementation().
11388 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
11390 * decl.cs (FindMemberToOverride): New method to find the correct
11391 method or property to override in the base class.
11393 - Make Method/Property use the above method to find the
11394 version in the base class.
11395 - Remove the InheritableMemberSignatureCompare as it is now
11398 This patch makes large code bases much faster to compile, as it is
11399 O(n) rather than O(n^2) to do this validation.
11401 Also, it fixes bug 52458 which is that nested classes are not
11402 taken into account when finding the base class member.
11404 Reviewed/Approved by Martin.
11406 2004-03-17 Marek Safar <marek.safar@seznam.cz>
11408 * interface.cs: In all interface classes removed redundant
11409 member initialization.
11411 2004-03-16 Martin Baulig <martin@ximian.com>
11413 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11415 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11417 * decl.cs (DefineTypeAndParents): New helper method to define a
11418 type's containers before the type itself is defined; This is a
11419 bug exposed by the recent changes to Windows.Forms when an
11420 implemented interface was defined inside a class that had not been
11423 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11425 (Check): Loop correctly to report errors modifiers
11426 (UNSAFE was not in the loop, since it was the same as TOP).
11428 * interface.cs: Every interface member now takes a ModFlags,
11429 instead of a "is_new" bool, which we set on the base MemberCore.
11431 Every place where we called "UnsafeOk" in the interface, now we
11432 call the proper member (InterfaceMethod.UnsafeOK) instead to get
11433 the unsafe settings from the member declaration instead of the
11434 container interface.
11436 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
11438 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11439 `set_indexer_name' to the pending bits (one per type).
11441 We fixed a bug today that was picking the wrong method to
11442 override, since for properties the existing InterfaceMethod code
11443 basically ignored the method name. Now we make sure that the
11444 method name is one of the valid indexer names.
11446 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
11448 * support.cs (SeekableStreamReader): Keep track of stream byte
11449 positions and don't mix them with character offsets to the buffer.
11451 Patch from Gustavo Giráldez
11453 2004-03-15 Marek Safar <marek.safar@seznam.cz>
11455 * interface.cs (InterfaceSetGetBase): Removed double member
11456 initialization, base class does it as well.
11458 2004-03-13 Martin Baulig <martin@ximian.com>
11460 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11461 when compiling corlib.
11463 2004-03-13 Miguel de Icaza <miguel@ximian.com>
11465 * convert.cs (ExplicitConversion): We were reporting an error on
11466 certain conversions (object_type source to a value type, when the
11467 expression was `null') before we had a chance to pass it through
11468 the user defined conversions.
11470 * driver.cs: Replace / and \ in resource specifications to dots.
11473 * class.cs: Add check for duplicate operators. Fixes 52477
11475 2004-03-11 Miguel de Icaza <miguel@ximian.com>
11477 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11478 that are in the middle of the statements, not only at the end.
11481 * class.cs (TypeContainer.AddField): No longer set the
11482 `HaveStaticConstructor' flag, now we call it
11483 `UserDefineStaticConstructor' to diferentiate the slightly
11484 semantic difference.
11486 The situation is that we were not adding BeforeFieldInit (from
11487 Modifiers.TypeAttr) to classes that could have it.
11488 BeforeFieldInit should be set to classes that have no static
11493 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11495 And most importantly Zoltan's comment:
11497 http://bugzilla.ximian.com/show_bug.cgi?id=44229
11499 "I think beforefieldinit means 'it's ok to initialize the type sometime
11500 before its static fields are used', i.e. initialization does not need
11501 to be triggered by the first access to the type. Setting this flag
11502 helps the JIT to compile better code, since it can run the static
11503 constructor at JIT time, and does not need to generate code to call it
11504 (possibly lots of times) at runtime. Unfortunately, mcs does not set
11505 this flag for lots of classes like String.
11507 csc sets this flag if the type does not have an explicit static
11508 constructor. The reasoning seems to be that if there are only static
11509 initalizers for a type, and no static constructor, then the programmer
11510 does not care when this initialization happens, so beforefieldinit
11513 This bug prevents the AOT compiler from being usable, since it
11514 generates so many calls to mono_runtime_class_init that the AOT code
11515 is much slower than the JITted code. The JITted code is faster,
11516 because it does not generate these calls if the vtable is type is
11517 already initialized, which is true in the majority of cases. But the
11518 AOT compiler can't do this."
11520 2004-03-10 Miguel de Icaza <miguel@ximian.com>
11522 * class.cs (MethodData.Emit): Refactor the code so symbolic
11523 information is generated for destructors; For some reasons we
11524 were taking a code path that did not generate symbolic information
11527 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
11529 * class.cs: Create a Constructor.CheckBase method that
11530 takes care of all validation type code. The method
11531 contains some code that was moved from Define.
11533 It also includes new code that checks for duplicate ctors.
11534 This fixes bug #55148.
11536 2004-03-09 Joshua Tauberer <tauberer@for.net>
11538 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11539 a { ... }-style array creation invokes EmitStaticInitializers
11540 which is not good for reference-type arrays. String, decimal
11541 and now null constants (NullCast) are not counted toward
11542 static initializers.
11544 2004-03-05 Martin Baulig <martin@ximian.com>
11546 * location.cs (SourceFile.HasLineDirective): New public field;
11547 specifies whether the file contains or is referenced by a "#line"
11549 (Location.DefineSymbolDocuments): Ignore source files which
11550 either contain or are referenced by a "#line" directive.
11552 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
11554 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11555 direct access to our parent, so check the method inline there.
11557 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
11559 * expression.cs (Invocation.EmitCall): Miguel's last commit
11560 caused a regression. If you had:
11565 In Foo the implict this would be null.
11567 2004-02-27 Miguel de Icaza <miguel@ximian.com>
11569 * expression.cs (Invocation.EmitCall): If the method is not
11570 virtual, do not emit a CallVirt to it, use Call.
11572 * typemanager.cs (GetFullNameSignature): Improve the method to
11573 cope with ".ctor" and replace it with the type name.
11575 * class.cs (ConstructorInitializer.Resolve): Now the method takes
11576 as an argument the ConstructorBuilder where it is being defined,
11577 to catch the recursive constructor invocations.
11579 2004-02-26 Miguel de Icaza <miguel@ximian.com>
11581 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11582 routines to check if a type is an enumerable/enumerator allow
11583 classes that implement the IEnumerable or IEnumerator interfaces.
11585 * class.cs (Property, Operator): Implement IIteratorContainer, and
11586 implement SetYields.
11588 (Property.Define): Do the block swapping for get_methods in the
11589 context of iterators. We need to check if Properties also
11590 include indexers or not.
11592 (Operator): Assign the Block before invoking the
11593 OperatorMethod.Define, so we can trigger the Iterator code
11596 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
11597 Property and Operator classes are not created when we parse the
11598 declarator but until we have the block completed, so we use a
11599 singleton SimpleIteratorContainer.Simple to flag whether the
11600 SetYields has been invoked.
11602 We propagate this setting then to the Property or the Operator to
11603 allow the `yield' to function.
11605 2004-02-25 Marek Safar <marek.safar@seznam.cz>
11607 * codegen.cs: Implemented attribute support for modules.
11608 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11609 Assembly/Module functionality.
11611 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11612 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11613 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11615 2004-02-16 Marek Safar <marek.safar@seznam.cz>
11617 * interface.cs (FindMembers): The operation is performed on all base
11618 interfaces and not only on the first. It is required for future CLS Compliance patch.
11620 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
11622 * statement.cs, codegen.cs:
11623 This patch deals with patterns such as:
11625 public class List : IEnumerable {
11627 public MyEnumerator GetEnumerator () {
11628 return new MyEnumerator(this);
11631 IEnumerator IEnumerable.GetEnumerator () {
11635 public struct MyEnumerator : IEnumerator {
11640 Before, there were a few things we did wrong:
11641 1) we would emit callvirt on a struct, which is illegal
11642 2) we emited ldarg when we needed to emit ldarga
11643 3) we would mistakenly call the interface methods on an enumerator
11644 type that derived from IEnumerator and was in another assembly. For example:
11646 public class MyEnumerator : IEnumerator
11648 Would have the interface methods called, even if there were public impls of the
11649 method. In a struct, this lead to invalid IL code.
11651 2004-02-11 Marek Safar <marek.safar@seznam.cz>
11653 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11656 * delegate.cs (Define): Fixed crash when delegate type is undefined.
11658 2004-02-11 Miguel de Icaza <miguel@ximian.com>
11660 * cs-parser.jay: Fix small regression: we were not testing V2
11661 compiler features correctly.
11663 * interface.cs: If the emit context is null, then create one
11665 2004-02-09 Marek Safar <marek.safar@seznam.cz>
11667 * decl.cs (GetSignatureForError): New virtual method to get full name
11668 for error messages.
11670 * attribute.cs (IAttributeSupport): New interface for attribute setting.
11671 Now it is possible to rewrite ApplyAttributes method to be less if/else.
11673 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11674 Duplicated members and code in these classes has been removed.
11675 Better encapsulation in these classes.
11677 2004-02-07 Miguel de Icaza <miguel@ximian.com>
11679 * assign.cs (Assign.DoResolve): When dealing with compound
11680 assignments, there is a new rule in ECMA C# 2.4 (might have been
11681 there before, but it is documented here) that states that in:
11685 If b is of type int, and the `op' is a shift-operator, then the
11686 above is evaluated as:
11690 * expression.cs (Binary.ResolveOperator): Instead of testing for
11691 int/uint/long/ulong, try to implicitly convert to any of those
11692 types and use that in pointer arithmetic.
11694 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11695 method to print information for from the type, not from the
11696 null-method we were given.
11698 2004-02-01 Duncan Mak <duncan@ximian.com>
11700 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11701 parsing for cmd, fixes bug #53694.
11703 2004-02-04 Marek Safar <marek.safar@seznam.cz>
11705 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11706 in the member name duplication tests. Property and operator name duplication
11707 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11709 2004-02-03 Marek Safar <marek.safar@seznam.cz>
11711 * interface.cs (PopulateMethod): Fixed crash when interface method
11712 returns not existing type (error test cs0246-3.cs).
11714 2004-02-02 Ravi Pratap M <ravi@ximian.com>
11716 * cs-parser.jay (interface_accessors): Re-write actions to also
11717 store attributes attached to get and set methods. Fix spelling
11720 (inteface_property_declaration): Modify accordingly.
11722 (InterfaceAccessorInfo): New helper class to store information to pass
11723 around between rules that use interface_accessors.
11725 * interface.cs (Emit): Apply attributes on the get and set
11726 accessors of properties and indexers too.
11728 * attribute.cs (ApplyAttributes): Modify accordingly to use the
11729 right MethodBuilder when applying attributes to the get and set accessors.
11731 2004-01-31 Miguel de Icaza <miguel@ximian.com>
11733 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11735 2004-01-26 Miguel de Icaza <miguel@ximian.com>
11737 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11739 2004-01-25 Miguel de Icaza <miguel@ximian.com>
11741 * cs-parser.jay: Remove YIELD token, instead use the new grammar
11742 changes that treat `yield' specially when present before `break'
11743 or `return' tokens.
11745 * cs-tokenizer.cs: yield is no longer a keyword.
11747 2004-01-23 Marek Safar <marek.safar@seznam.cz>
11749 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11750 setting for default constructors.
11751 For default constructors are almost every time set wrong Modifier. The
11752 generated IL code has been alright. But inside mcs this values was
11753 wrong and this was reason why several of my CLS Compliance tests
11756 2004-01-22 Martin Baulig <martin@ximian.com>
11758 * cs-parser.jay (namespace_or_type_name): Return an Expression,
11759 not a QualifiedIdentifier. This is what `type_name_expression'
11760 was previously doing.
11761 (type_name_expression): Removed; the code is now in
11762 `namespace_or_type_name'.
11763 (qualified_identifier): Removed, use `namespace_or_type_name'
11765 (QualifiedIdentifier): Removed this class.
11767 2004-01-22 Martin Baulig <martin@ximian.com>
11769 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11770 not a string as alias name.
11772 2004-01-21 Miguel de Icaza <miguel@ximian.com>
11774 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11775 #52730 bug, and instead compute correctly the need to use a
11776 temporary variable when requesting an address based on the
11777 static/instace modified of the field and the constructor.
11779 2004-01-21 Martin Baulig <martin@ximian.com>
11781 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11782 class and namespace before looking up aliases. Fixes #52517.
11784 2004-01-21 Martin Baulig <martin@ximian.com>
11786 * flowanalysis.cs (UsageVector.Merge): Allow variables being
11787 assinged in a 'try'; fixes exception4.cs.
11789 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11790 * class.cs : Implemented parameter-less constructor for TypeContainer
11792 * decl.cs: Attributes are now stored here. New property OptAttributes
11794 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11796 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11798 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11800 * typemanager.cs (CSharpSignature): Now reports also inner class name.
11801 (CSharpSignature): New method for indexer and property signature.
11803 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11805 * pending.cs (IsVirtualFilter): Faster implementation.
11807 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11809 * typemanager.cs: Avoid inclusion of same assembly more than once.
11811 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11813 * cs-parser.jay: Fixed problem where the last assembly attribute
11814 has been applied also to following declaration (class, struct, etc.)
11816 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11818 * class.cs: Added error CS0538, CS0539 reporting.
11819 Fixed crash on Microsoft runtime when field type is void.
11821 * cs-parser.jay: Added error CS0537 reporting.
11823 * pending.cs: Added error CS0535 reporting.
11824 Improved error report for errors CS0536, CS0534.
11826 2004-01-20 Miguel de Icaza <miguel@ximian.com>
11828 Merge a few bits from the Anonymous Method MCS tree.
11830 * statement.cs (ToplevelBlock): New class for toplevel methods,
11831 will hold anonymous methods, lifted variables.
11833 * cs-parser.jay: Create toplevel blocks for delegates and for
11834 regular blocks of code.
11836 2004-01-20 Martin Baulig <martin@ximian.com>
11838 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11839 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11840 and `NeedExplicitReturn'; added `IsLastStatement'.
11841 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11842 have a `ReturnLabel' or we're not unreachable.
11844 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11845 child's reachability; don't just override ours with it. Fixes
11846 #58058 (lluis's example).
11847 (FlowBranching): Added public InTryOrCatch(), InCatch(),
11848 InFinally(), InLoop(), InSwitch() and
11849 BreakCrossesTryCatchBoundary() methods.
11851 * statement.cs (Return): Do all error checking in Resolve().
11852 Unless we are the last statement in a top-level block, always
11853 create a return label and jump to it.
11854 (Break, Continue): Do all error checking in Resolve(); also make
11855 sure we aren't leaving a `finally'.
11856 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11857 statement in a top-level block.
11858 (Block.Flags): Added `IsDestructor'.
11859 (Block.IsDestructor): New public property.
11861 2004-01-20 Martin Baulig <martin@ximian.com>
11863 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11865 2004-01-20 Martin Baulig <martin@ximian.com>
11867 * statement.cs (Statement.ResolveUnreachable): New public method.
11868 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11869 (Block.Resolve): Resolve unreachable statements.
11871 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11873 * expression.cs: We need to fix the case where we do
11874 not have a temp variable here.
11876 * assign.cs: Only expression compound assignments need
11877 temporary variables.
11879 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11881 * flowanalysis.cs: Reduce memory allocation in a few ways:
11882 - A block with no variables should not allocate a bit
11884 - A method with no out parameters does not need any tracking
11885 for assignment of the parameters, so we need not allocate
11888 public readonly Type[] VariableTypes;
11889 public readonly string[] VariableNames;
11890 Are redundant. The data is already stored in the variable
11891 map, so we need not allocate another array for it.
11892 - We need to add alot of checks for if (params | locals) == null
11893 due to the first two changes.
11895 2004-01-18 Miguel de Icaza <miguel@ximian.com>
11897 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11898 implement IMemoryLocation, we store a copy on a local variable and
11899 take the address of it. Patch from Benjamin Jemlich
11901 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11902 to use a special "type_name_expression" rule which reduces the
11903 number of "QualifiedIdentifier" classes created, and instead
11904 directly creates MemberAccess expressions.
11906 2004-01-17 Miguel de Icaza <miguel@ximian.com>
11908 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11909 that fixes #52853. Null literal assignment to ValueType
11911 * class.cs (MethodData.Emit): Instead of checking the name of the
11912 method to determine if its a destructor, create a new derived
11913 class from Method called Destructor, and test for that.
11915 * cs-parser.jay: Create a Destructor object instead of a Method.
11917 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11921 2004-01-16 Miguel de Icaza <miguel@ximian.com>
11923 * expression.cs (Binary.ResolveOperator): Perform an implicit
11924 conversion from MethodGroups to their delegate types on the
11925 Addition operation.
11927 * delegate.cs: Introduce a new class DelegateCreation that is the
11928 base class for `NewDelegate' and `ImplicitDelegateCreation',
11929 factor some code in here.
11931 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11932 conversion from MethodGroups to compatible delegate types.
11934 * ecore.cs (Expression.Resolve): Do not flag error 654
11935 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11936 we allow conversions from MethodGroups to delegate types now.
11938 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11939 assignments in v2 either.
11941 2004-01-10 Miguel de Icaza <miguel@ximian.com>
11943 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11944 static read-only fields in ctors.
11946 Applied patch from Benjamin Jemlich
11948 * expression.cs (UnaryMutator): Avoid leaking local variables.
11950 2004-01-09 Miguel de Icaza <miguel@ximian.com>
11952 * cs-tokenizer.cs (IsCastToken): Allow the various native types
11953 here to return true, as they can be used like this:
11955 (XXX) int.MEMBER ()
11957 Fixed 49836 and all the other dups
11959 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
11961 * driver.cs: Implement /win32res and /win32icon.
11963 2004-01-08 Miguel de Icaza <miguel@ximian.com>
11965 * cs-parser.jay: Add a rule to improve error handling for the
11966 common mistake of placing modifiers after the type.
11968 2004-01-07 Miguel de Icaza <miguel@ximian.com>
11970 * cs-parser.jay (interface_event_declaration): Catch
11971 initialization of events on interfaces, and report cs0068
11973 * cs-parser.jay (interface_event_declaration): Catch
11974 initialization of events.
11976 * ecore.cs: Better report missing constructors.
11978 * expression.cs (Binary.ResolveOperator): My previous bug fix had
11979 the error reporting done in the wrong place. Fix.
11981 * expression.cs (Binary.ResolveOperator): Catch the
11982 operator + (E x, E y) error earlier, and later allow for implicit
11983 conversions in operator +/- (E e, U x) from U to the underlying
11986 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11987 52596, if the container class is abstract, the default constructor
11988 is protected otherwise its public (before, we were always public).
11990 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11993 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11994 Jemlich that fixes bug #52597, MCS was generating invalid code for
11995 idisposable structs. Thanks to Ben for following up with this
11998 2004-01-06 Miguel de Icaza <miguel@ximian.com>
12000 * driver.cs: Allow assemblies without code to be generated, fixes
12003 2004-01-07 Nick Drochak <ndrochak@gol.com>
12005 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12007 2004-01-05 Miguel de Icaza <miguel@ximian.com>
12009 * cs-parser.jay: Add rules to improve error reporting if fields or
12010 methods are declared at the namespace level (error 116)
12012 * Add rules to catch event add/remove
12014 2004-01-04 David Sheldon <dave-mono@earth.li>
12016 * expression.cs: Added matching ")" to error message for
12019 2004-01-03 Todd Berman <tberman@gentoo.org>
12021 * ecore.cs, attribute.cs:
12022 Applying fix from #52429.
12024 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12026 * ecore.cs, expression.cs, statement.cs:
12027 Total rewrite of how we handle branching. We
12028 now handle complex boolean expressions with fewer
12029 jumps. As well if (x == 0) no longer emits a ceq.
12031 if (x is Foo) is much faster now, because we generate
12034 Overall, we get a pretty big improvement on our benchmark
12035 tests. The code we generate is smaller and more readable.
12037 I did a full two-stage bootstrap. The patch was reviewed
12038 by Martin and Miguel.
12040 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12042 * cs-parser.jay: Make primary_expression not take a QI.
12043 we dont need this because the member_access rule covers
12044 us here. So we replace the rule with just IDENTIFIER.
12046 This has two good effects. First, we remove a s/r conflict.
12047 Second, we allocate many fewer QualifiedIdentifier objects.
12049 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12051 * attribute.cs: Handle MarshalAs attributes as pseudo, and
12052 set the correct information via SRE. This prevents
12053 hanging on the MS runtime. Fixes #29374.
12055 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12057 * convert.cs: correctly handle conversions to value types
12058 from Enum and ValueType as unboxing conversions.
12060 Fixes bug #52569. Patch by Benjamin Jemlich.
12062 2004-01-02 Ravi Pratap <ravi@ximian.com>
12064 * expression.cs (BetterConversion): Prefer int -> uint
12065 over int -> ulong (csc's behaviour). This fixed bug #52046.
12067 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
12069 * decl.cs (MemberCache.FindMembers): now returns a
12072 * typemanager.cs: In general, go with with ^^.
12073 (CopyNewMethods): take an IList.
12074 (RealMemberLookup): Only allocate an arraylist
12075 if we copy from two sets of methods.
12077 This change basically does two things:
12078 1) Fewer array lists allocated due to CopyNewMethods.
12079 2) the explicit cast in MemberList costed ALOT.
12081 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
12083 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12084 a hashtable to avoid needless string allocations when an identifier is
12085 used more than once (the common case).
12087 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12089 * pending.cs: MS's TypeBuilder.GetInterfaces ()
12090 is broken, it will not return anything. So, we
12091 have to use the information we have in mcs to
12094 * typemanager.cs: Add a cache for GetInterfaces,
12095 since this will now be used more often (due to ^^)
12097 (GetExplicitInterfaces) New method that gets the
12098 declared, not effective, interfaces on a type
12099 builder (eg, if you have interface IFoo, interface
12100 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12103 This patch makes MCS able to bootstrap itself on
12106 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12108 * expression.cs: Remove the Nop's that Miguel put
12111 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12113 * report.cs, codegen.cs: Give the real stack trace to
12114 the error when an exception is thrown.
12116 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12118 * decl.cs: only allocate hashtables for ifaces if
12121 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12123 * expression.cs: fix the error from cs0121-2.cs
12124 (a parent interface has two child interfaces that
12125 have a function with the same name and 0 params
12126 and the function is called through the parent).
12128 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
12130 * class.cs, rootcontext.cs, typmanager.cs: do not
12133 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
12135 * codegen.cs: remove stack for the ec flow branching.
12136 It is already a linked list, so no need.
12138 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
12140 * Makefile: Allow custom profiler here.
12142 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12144 * typemanager.cs (LookupType):
12145 - Use a static char [], because split takes
12146 a param array for args, so it was allocating
12148 - Do not store true in a hashtable, it boxes.
12150 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12152 * flowanalysis.cs: bytify common enums.
12154 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12156 * modifiers.cs: Add a new set of flags for the
12157 flags allowed on explicit interface impls.
12158 * cs-parser.jay: catch the use of modifiers in
12159 interfaces correctly.
12160 * class.cs: catch private void IFoo.Blah ().
12162 All related to bug #50572.
12164 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12166 * decl.cs: Rewrite the consistant accessability checking.
12167 Accessability is not linear, it must be implemented in
12168 a tableish way. Fixes #49704.
12170 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12172 * expression.cs: Handle negation in a checked context.
12173 We must use subtraction from zero. Fixes #38674.
12175 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12177 * class.cs: Ignore static void main in DLLs.
12178 * rootcontext.cs: Handle the target type here,
12179 since we are have to access it from class.cs
12180 * driver.cs: account for the above.
12182 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12184 * report.cs: Give line numbers and files if available.
12186 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
12188 * driver.cs: Implement /addmodule.
12190 * typemanager.cs: Change 'modules' field so it now contains Modules not
12193 2003-12-20 Martin Baulig <martin@ximian.com>
12195 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12196 (FieldBase.IsAssigned): Removed this field.
12197 (FieldBase.SetAssigned): New public method.
12198 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12200 2003-12-20 Martin Baulig <martin@ximian.com>
12202 * expression.cs (LocalVariableReference.DoResolve): Don't set
12203 `vi.Used' if we're called from DoResolveLValue().
12205 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12206 returns the usage vector it just merged into the current one -
12207 pass this one to UsageWarning().
12208 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12209 of the `EmitContext', don't call this recursively on our children.
12211 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
12213 * driver.cs: Implement /target:module.
12215 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
12217 * support.cs (CharArrayHashtable): New helper class.
12219 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
12220 char arrays, not strings, so we can avoid creating a string in
12221 consume_identifier if the identifier is a keyword.
12223 2003-12-16 Martin Baulig <martin@ximian.com>
12225 * statement.cs (LocalInfo.Assigned): Removed this property.
12226 (LocalInfo.Flags): Removed `Assigned'.
12227 (LocalInfo.IsAssigned): New public method; takes the EmitContext
12228 and uses flow analysis.
12229 (Block.UsageWarning): Made this method private.
12230 (Block.Resolve): Call UsageWarning() if appropriate.
12232 * expression.cs (LocalVariableReference.DoResolve): Always set
12233 LocalInfo.Used here.
12235 2003-12-13 Martin Baulig <martin@ximian.com>
12237 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12238 any value here; we're now using flow analysis to figure out
12239 whether a statement/block returns a value.
12241 2003-12-13 Martin Baulig <martin@ximian.com>
12243 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12245 (FlowBranching.MergeFinally): Don't call
12246 `branching.CheckOutParameters()' here, this is called in
12248 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12249 when adding the `finally' vector.
12251 2003-12-13 Martin Baulig <martin@ximian.com>
12254 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12255 actually work and also fix #48962.
12257 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
12259 * decl.cs: Do not check System.Object for nested types,
12260 since we know it does not have any. Big bang for buck:
12263 Run 1: 8.35 seconds
12264 Run 2: 8.32 seconds
12265 corlib: 17.99 seconds
12267 Run 1: 8.17 seconds
12268 Run 2: 8.17 seconds
12269 corlib: 17.39 seconds
12271 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
12273 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12274 time we are returning 0 members, so we save alot here.
12276 2003-12-11 Martin Baulig <martin@ximian.com>
12278 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12279 `MergeChild()', also just take the `FlowBranching' as argument;
12280 call Merge() on it and return the result.
12281 (FlowBranching.Merge): We don't need to do anything if we just
12284 2003-12-11 Martin Baulig <martin@ximian.com>
12286 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12287 them in an `ArrayList' to reduce memory usage. Thanks to Ben
12288 Maurer for this idea.
12290 2003-12-11 Martin Baulig <martin@ximian.com>
12292 * flowanalysis.cs (MergeResult): This class is now gone; we now
12293 use the `UsageVector' for this. The reason for this is that if a
12294 branching just has one sibling, we don't need to "merge" them at
12295 all - that's the next step to do.
12296 (FlowBranching.Merge): We now return a `UsageVector' instead of a
12299 2003-12-11 Martin Baulig <martin@ximian.com>
12301 Reworked flow analyis and made it more precise and bug-free. The
12302 most important change is that we're now using a special `Reachability'
12303 class instead of having "magic" meanings of `FlowReturns'. I'll
12304 do some more cleanups and optimizations and also add some more
12305 documentation this week.
12307 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12308 largely reworked this class.
12309 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12310 the new `Reachability' class instead of having "magic" values here.
12311 (FlowBranching): We're now using an instance of `Reachability'
12312 instead of having separate `Returns', `Breaks' etc. fields.
12314 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12315 based on flow analysis; ignore the return value of block.Emit ().
12317 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
12319 * driver.cs typemanager.cs: Find the mono extensions to corlib even
12320 if they are private.
12322 2003-12-09 Martin Baulig <martin@ximian.com>
12324 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12325 call them directly on the UsageVector.
12327 2003-12-09 Martin Baulig <martin@ximian.com>
12329 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12330 Changed return type from `FlowReturns' to `Reachability'.
12332 2003-12-09 Martin Baulig <martin@ximian.com>
12334 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12335 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12336 `Reachable' fields with a single `Reachability' one.
12338 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12340 * class.cs (FindMembers): Remove foreach's.
12345 Run 1: 8.74 seconds
12346 Run 2: 8.71 seconds
12349 Run 1: 8.64 seconds
12350 Run 2: 8.58 seconds
12353 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12358 This patch does a few things:
12359 1. EmptyStatement is now a singleton, so it is never reallocated.
12360 2. All blah is EmptyStatement constructs have been changed to
12361 blah == EmptyStatement.Value, which is much faster and valid
12362 now that EmptyStatement is a singleton.
12363 3. When resolving a block, rather than allocating a new array for
12364 the non-empty statements, empty statements are replaced with
12365 EmptyStatement.Value
12366 4. Some recursive functions have been made non-recursive.
12367 Mainly the performance impact is from (3), however (1) and (2) are needed for
12368 this to work. (4) does not make a big difference in normal situations, however
12369 it makes the profile look saner.
12374 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12375 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12376 Total memory allocated: 56397 KB
12379 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12380 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12381 Total memory allocated: 55666 KB
12383 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12385 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12386 than the hashtable in a hashtable version
12388 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12389 we always end up concating a string. This results in a huge perf
12390 loss, because many strings have to be tracked by the GC. In this
12391 patch, we first use a hashtable that works with two keys, so that
12392 the strings do not need to be concat'ed.
12396 Run 1: 8.74 seconds
12397 Run 2: 8.71 seconds
12400 Run 1: 8.65 seconds
12401 Run 2: 8.56 seconds
12403 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12405 * Makefile: Add a new target `do-time' that does a quick and simple
12406 profile, leaving easy to parse output.
12408 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
12410 * codegen.cs (Init): Create the dynamic assembly with
12411 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12413 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
12415 * support.cs: Make the PtrHashtable use only one
12416 instance of its comparer.
12418 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
12420 * typemanager.cs: Fix lookup of GetNamespaces.
12422 2003-11-29 Miguel de Icaza <miguel@ximian.com>
12424 * expression.cs: Removed redundant line.
12426 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12427 ArrayLists, use for loops with bounds.
12429 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12432 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12433 arraylists, use for loop with bounds.
12435 The above three changes give us a 0.071 second performance
12436 improvement out of 3.294 seconds down to 3.223. On my machine
12437 the above changes reduced the memory usage by 1,387 KB during
12438 compiler bootstrap.
12440 * cs-parser.jay (QualifiedIdentifier): New class used to represent
12441 QualifiedIdentifiers. Before we created a new string through
12442 concatenation, and mostly later on, the result would be
12443 manipulated by DecomposeQI through string manipulation.
12445 This reduced the compiler memory usage for bootstrapping from
12446 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12447 compile times in 0.05 seconds.
12449 2003-11-28 Dick Porter <dick@ximian.com>
12451 * support.cs: Do string compares with the Invariant culture.
12459 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12460 the comparison is done with the Invariant culture.
12462 2003-11-27 Miguel de Icaza <miguel@ximian.com>
12464 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12465 GetEnumerator method.
12467 (ProbeCollectionType): Iterate starting at the most specific type
12468 upwards looking for a GetEnumerator
12470 * expression.cs: Shift count can be up to 31 for int/uint and 63
12473 2003-11-26 Miguel de Icaza <miguel@ximian.com>
12475 * statement.cs (Block.LookupLabel): Also look for the label on the
12476 children blocks. Use a hash table to keep track of visited
12479 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12480 we actually did transform the other operand, otherwise fall back
12481 to the common codepath that casts to long.
12483 * cs-tokenizer.cs: Use the same code pattern as the int case.
12484 Maybe I should do the parsing myself, and avoid depending on the
12485 Parse routines to get this done.
12487 2003-11-25 Miguel de Icaza <miguel@ximian.com>
12489 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12490 which fixes bug 51347. This time test it.
12492 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12493 attributes for example can not tell the difference between these.
12494 The difference was only a syntax feature of the language.
12496 * attribute.cs: Apply attributes to delegates.
12498 * delegate.cs: Call the apply attributes method.
12500 2003-11-24 Miguel de Icaza <miguel@ximian.com>
12502 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12503 comparing 0 vs Byte.MinValue, not the value
12505 (ImplicitConversionRequired): When reporting a conversion error,
12506 use error 31 to print out the constant error instead of the
12509 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12510 which fixes bug 51347.
12512 2003-11-22 Miguel de Icaza <miguel@ximian.com>
12514 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
12515 which fixes the -warnaserror command line option.
12517 2003-11-21 Miguel de Icaza <miguel@ximian.com>
12519 * cfold.cs (DoNumericPromotions): During constant folding of
12520 additions on UIntConstant, special case intconstants with
12521 IntConstants like we do on the expression binary operator.
12523 2003-11-12 Miguel de Icaza <miguel@ximian.com>
12525 * convert.cs (ImplicitReferenceConversion): We were missing a case
12526 (System.Enum are not value types or class types, so we need to
12527 classify them separatedly).
12529 * driver.cs: We do not support error 2007.
12531 2003-11-12 Jackson Harper <jackson@ximian.com>
12533 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12534 system directory. Also use the full file name so users can
12535 libraries names mscorlib-o-tron.dll in a non system dir.
12537 2003-11-10 Martin Baulig <martin@ximian.com>
12539 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12540 (TypeManager.InitCoreTypes): Initialize them here, but instead of
12541 calling `ResolveType()' on them, directly assign their `Type'.
12543 2003-11-08 Martin Baulig <martin@ximian.com>
12545 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12546 return value and the `out parent' parameter.
12547 (TypeContainer.DefineType): Moved the CS0644 check into
12548 GetClassBases(). Don't pass the interface types to the
12549 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12550 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12552 * ecore.cs (TypeExpr.IsAttribute): New property.
12553 (TypeExpr.GetInterfaces): New method.
12555 * interface.cs (Interface.GetInterfaceTypeByName): Return a
12556 TypeExpr instead of a Type.
12557 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12558 (Interface.DefineType): Don't pass the interface types to the
12559 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12560 them later and then call `TypeBulider.AddInterfaceImplementation()'.
12562 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12563 instead of a `Type[]'.
12564 (TypeManager.RegisterBuilder): Likewise.
12565 (TypeManager.AddUserInterface): Likewise.
12566 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12567 `Type[]' and also return a `TypeExpr[]'.
12568 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12570 2003-11-08 Martin Baulig <martin@ximian.com>
12572 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12575 2003-11-08 Martin Baulig <martin@ximian.com>
12577 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12578 TypeManager.ResolveExpressionTypes().
12580 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12581 instead of an Expression.
12582 (TypeExpr): This is now an abstract base class for `TypeExpression'.
12583 (TypeExpression): New public class; formerly known as `TypeExpr'.
12585 * expression.cs (ComposedCast): Derive from TypeExpr.
12587 * typemanager.cs (TypeManager.system_*_expr): These are now
12588 TypExpr's instead of Expression's.
12589 (TypeManager.ResolveExpressionTypes): New public static function;
12590 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12593 2003-11-06 Miguel de Icaza <miguel@ximian.com>
12595 * expression.cs (New.DoResolve): Do not dereference value that
12596 might be a null return.
12598 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12599 sure that the constant value has the right type. Fixes an
12600 unreported bug, similar to 50425.
12602 * const.cs (Const.LookupConstantValue): Call
12603 ImplicitStandardConversionExists before doing a conversion to
12604 avoid havng the TypeManager.ChangeType do conversions.
12606 Reduced the number of casts used
12608 (Const.ChangeType): New routine to enable reuse of the constant
12609 type changing code from statement.
12611 * typemanager.cs (ChangeType): Move common initialization to
12612 static global variables.
12616 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12617 every value type to go through, even if it was void. Fix that.
12619 * cs-tokenizer.cs: Use is_identifier_start_character on the start
12620 character of the define, and the is_identifier_part_character for
12621 the rest of the string.
12623 2003-11-05 Miguel de Icaza <miguel@ximian.com>
12625 * expression.cs (UnaryMutator.EmitCode): When I updated
12626 LocalVariableReference.DoResolve, I overdid it, and dropped an
12627 optimization done on local variable references.
12629 2003-11-04 Miguel de Icaza <miguel@ximian.com>
12631 * ecore.cs: Convert the return from Ldlen into an int.
12633 2003-10-20 Miguel de Icaza <miguel@ximian.com>
12635 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12636 the accessibility, this is a special case for toplevel non-public
12637 classes (internal for instance).
12639 2003-10-20 Nick Drochak <ndrochak@gol.com>
12641 * ecore.cs: Fix typo and build. Needed another right paren.
12643 2003-10-19 Miguel de Icaza <miguel@ximian.com>
12645 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
12646 `internal' case regular and protected, but not allowing protected
12647 to be evaluated later. Bug 49840
12649 2003-10-15 Miguel de Icaza <miguel@ximian.com>
12651 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12652 to kb.Nlast, and not the kb.nFirst to isolate the switch
12655 Extract the underlying type, so enumerations of long/ulong are
12656 treated like long/ulong.
12658 2003-10-14 Miguel de Icaza <miguel@ximian.com>
12660 * expression.cs (New): Overload the meaning of RequestedType to
12661 track the possible creation of the NewDelegate type, since
12662 DoResolve is invoked more than once for new constructors on field
12665 See bugs: #48800 and #37014
12667 * cs-parser.jay (declare_local_constants): Take an arraylist
12668 instead of a single constant.
12670 (local_constant_declaration): It should take a
12671 constant_declarators, not a constant_declarator. Fixes 49487
12673 * convert.cs: Fix error report.
12675 2003-10-13 Jackson Harper <jackson@ximian.com>
12677 * typemanager.cs (TypeToCoreType): Add float and double this fixes
12680 2003-10-09 Martin Baulig <martin@ximian.com>
12682 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12684 (MethodCore.DoDefineParameters): Removed the TypeContainer
12685 argument; use the DeclSpace which was passed to the .ctor instead.
12686 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12687 TypeContainer; we only need a DeclSpace here.
12689 2003-10-09 Martin Baulig <martin@ximian.com>
12691 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12693 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12694 EmitContext's .ctor.
12696 2003-10-09 Martin Baulig <martin@ximian.com>
12698 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12699 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12700 AsAccessible(), moved them as well.
12702 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12704 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12706 * cs-parser.jay : Renamed yyName to yyNames related to jay.
12708 2003-10-07 Miguel de Icaza <miguel@ximian.com>
12710 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12711 generation for >=, as spotted by Paolo, bug 48679.
12712 Patch from David Waite.
12714 * cs-tokenizer.cs: Add handling for #pragma.
12716 * cs-parser.jay: Allow for both yield and yield return in the
12717 syntax. The anti-cobolization of C# fight will go on!
12719 * class.cs (TypeBuilder.DefineType): Catch error condition here
12720 (Parent.DefineType erroring out and returning null).
12722 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12723 coping with enumerations variables, we were mistakenly processing
12724 them as a regular value type instead of built-in types. Fixes the
12727 * typemanager.cs (IsBuiltinOrEnum): New method.
12729 2003-09-30 Miguel de Icaza <miguel@ximian.com>
12731 * cs-parser.jay: Upgrade: yield now needs the return clause.
12733 2003-09-19 Martin Baulig <martin@ximian.com>
12735 * decl.cs (MemberCache.SetupCacheForInterface): Take a
12736 `MemberCache parent' argument. Normally, an interface doesn't
12737 have a parent type except System.Object, but we use this in gmcs
12738 for generic type parameters.
12740 2003-09-18 Martin Baulig <martin@ximian.com>
12742 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12743 on `type.IsInterface'; don't check whether the type has a parent
12744 to determine whether it's an interface.
12746 2003-09-15 Martin Baulig <martin@ximian.com>
12748 * class.cs (TypeContainer.DefineType): Added an error flag to
12749 avoid reporting duplicate CS0146's ("class definition is
12752 * driver.cs (Driver.MainDriver): Abort if
12753 RootContext.ResolveTree() reported any errors.
12755 2003-09-07 Martin Baulig <martin@ximian.com>
12757 * report.cs (Error, Warning): Added overloaded versions which take
12758 a `params object[] args' and call String.Format().
12760 2003-09-07 Martin Baulig <martin@ximian.com>
12762 * decl.cs (DeclSpace..ctor): Don't call
12763 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12764 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
12765 (DeclSpace.RecordDecl): New method.
12767 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12769 2003-09-02 Ravi Pratap <ravi@ximian.com>
12771 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12772 value attributes to be applied to ParameterBuilders.
12774 * class.cs (MethodCore.LabelParameters): Make static and more
12775 generic so that it can be used from other places - like interface
12776 methods, for instance.
12778 * interface.cs (Interface.Emit): Call LabelParameters before
12779 emitting attributes on the InterfaceMethod.
12781 2003-08-26 Martin Baulig <martin@ximian.com>
12783 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12784 resolving aliases; fixes #47927.
12786 2003-08-26 Martin Baulig <martin@ximian.com>
12788 * statement.cs (Using.DoResolve): This is internally emitting a
12789 try/finally clause, so we need to set ec.NeedExplicitReturn if we
12790 do not always return. Fixes #47681.
12792 2003-08-26 Martin Baulig <martin@ximian.com>
12794 * decl.cs (MemberCore): Moved WarningNotHiding(),
12795 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12797 (AdditionResult): Make this nested in DeclSpace.
12798 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12799 argument; call NamespaceEntry.Define() unless we're nested in a
12802 * namespace.cs (Namespace.DefineName): New public function. This
12803 is called from DeclSpace's .ctor to add
12804 (Namespace.Lookup): Include DeclSpaces in the lookup.
12806 * class.cs (Operator): Derive from MemberBase, not MemberCore.
12808 * const.cs (Const): Derive from MemberBase, not MemberCore.
12810 2003-08-25 Martin Baulig <martin@ximian.com>
12812 * convert.cs (Convert.ExplicitReferenceConversion): When
12813 converting from an interface type to a class, unbox if the target
12814 type is a struct type. Fixes #47822.
12816 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12818 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12821 2003-08-22 Martin Baulig <martin@ximian.com>
12823 * class.cs (TypeManager.DefineType): When defining a nested type,
12824 call DefineType() on our parent; fixes #47801.
12826 2003-08-22 Martin Baulig <martin@ximian.com>
12828 * class.cs (MethodData.Define): While checking if a method is an
12829 interface implementation, improve the test a bit more to fix #47654.
12831 2003-08-22 Martin Baulig <martin@ximian.com>
12833 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12834 correctly; fixes #47722.
12836 2003-08-22 Martin Baulig <martin@ximian.com>
12838 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12839 LocalVariableReference, ensure it's not read-only. Fixes #47536.
12841 * statement.cs (Fixed.DoResolve): Make all variables read-only.
12843 2003-08-22 Martin Baulig <martin@ximian.com>
12845 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12846 can only be assigned in static constructors. Fixes #47161.
12848 2003-08-22 Martin Baulig <martin@ximian.com>
12850 Rewrote and improved the flow analysis code.
12852 * flowbranching.cs (FlowBranching): Make this class abstract.
12853 (FlowBranching.CreateBranching): New static function to create a
12854 new flow branching.
12855 (FlowBranchingBlock, FlowBranchingException): New classes.
12856 (FlowBranching.UsageVector.Type): New public readonly field.
12857 (FlowBranching.UsageVector.Breaks): Removed the setter.
12858 (FlowBranching.UsageVector.Returns): Removed the setter.
12859 (FlowBranching.UsageVector): Added Break(), Return(),
12860 NeverReachable() and Throw() methods to modify the reachability.
12861 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12862 done by FlowBranching.Merge().
12863 (FlowBranching.UsageVector.MergeChild): New method; merges the
12864 merge result into the current vector.
12865 (FlowBranching.Merge): New abstract method to merge a branching.
12867 2003-08-12 Martin Baulig <martin@ximian.com>
12869 * expression.cs (Indirection.CacheTemporaries): Create the
12870 LocalTemporary with the pointer type, not its element type.
12872 2003-08-10 Miguel de Icaza <miguel@ximian.com>
12874 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12875 token was a keyword or not.
12877 Add `error' options where an IDENTIFIER was expected; Provide
12878 CheckToken and CheckIdentifierToken convenience error reporting
12881 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12883 * decl.cs: Rename `NamespaceEntry Namespace' public field into
12884 NameSpaceEntry NameSpaceEntry.
12886 (LookupInterfaceOrClass): Avoid creating a full qualified name
12887 from namespace and name: avoid doing lookups when we know the
12888 namespace is non-existant. Use new Tree.LookupByNamespace which
12889 looks up DeclSpaces based on their namespace, name pair.
12891 * driver.cs: Provide a new `parser verbose' to display the
12892 exception thrown during parsing. This is turned off by default
12893 now, so the output of a failure from mcs is more graceful.
12895 * namespace.cs: Track all the namespaces defined in a hashtable
12898 (IsNamespace): New method
12900 2003-08-09 Miguel de Icaza <miguel@ximian.com>
12902 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
12903 we know that we need to concatenate (full typename can never be
12908 * statement.cs: Use a bitfield; Do not initialize to null things
12909 which are done by the constructor by default.
12911 * cs-parser.jay: bug fix, parameter was 4, not 3.
12913 * expression.cs: Just use the property;
12915 * statement.cs: No need for GetVariableInfo method.
12917 2003-08-08 Martin Baulig <martin@ximian.com>
12919 * flowanalysis.cs (FlowReturns): This is now nested in the
12920 `FlowBranching' class.
12921 (MyBitVector): Moved this here from statement.cs.
12922 (FlowBranching.SiblingType): New enum type.
12923 (FlowBranching.CreateSibling): Added `SiblingType' argument.
12925 2003-08-07 Martin Baulig <martin@ximian.com>
12927 * flowanalysis.cs (FlowBranchingType): This is now nested in the
12928 `FlowBranching' class and called `BranchingType'.
12930 2003-08-07 Martin Baulig <martin@ximian.com>
12932 * flowanalysis.cs: Moved all the control flow analysis code into
12935 2003-08-07 Martin Baulig <martin@ximian.com>
12937 * assign.cs (Assign.DoResolve): `target' must either be an
12938 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
12941 2003-08-07 Miguel de Icaza <miguel@ximian.com>
12943 * expression.cs (BinaryMethod): This kind of expression is created by the
12944 Binary class if it determines that the operator has to be handled
12947 (BinaryDelegate): This kind of expression is created if we are
12948 dealing with a + or - operator on delegates.
12950 (Binary): remove method, argumetns, and DelegateOperator: when
12951 dealing with methods,
12953 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12955 * statement.cs (Block): use bitfields for the three extra booleans
12956 we had in use. Remove unused topblock parameter.
12958 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12960 * assign.cs: Drop extra unneeded tests.
12962 2003-08-06 Miguel de Icaza <miguel@ximian.com>
12964 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12966 * statement.cs (Foreach): Use VariableStorage instead of
12969 * codegen.cs (VariableStorage): New class used by clients that
12970 require a variable stored: locals or fields for variables that
12971 need to live across yield.
12973 Maybe provide a convenience api for EmitThis+EmitLoad?
12975 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12978 2003-08-05 Miguel de Icaza <miguel@ximian.com>
12980 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12981 RemapParameterLValue): New methods that are used to turn a
12982 precomputed FieldInfo into an expression like this:
12986 The idea is to use this instead of making LocalVariableReference
12987 have more than one meaning.
12989 * cs-parser.jay: Add error production to BASE.
12991 * ecore.cs: Deal with TypeManager.GetField returning null, which
12992 is now a valid return value.
12994 (FieldExprNoAddress): New expression for Fields whose address can
12997 * expression.cs (LocalVariableReference): During the resolve
12998 phases, create new expressions if we are in a remapping context.
12999 Remove code that dealt with remapping here.
13001 (ParameterReference): same.
13003 (ProxyInstance): New expression, like the `This' expression, but
13004 it is born fully resolved. We know what we are doing, so remove
13005 the errors that are targeted to user-provided uses of `this'.
13007 * statement.cs (Foreach): our variable is now stored as an
13008 Expression; During resolution, follow the protocol, dont just
13009 assume it will return this.
13011 2003-08-06 Martin Baulig <martin@ximian.com>
13013 * support.cs (SeekableStreamReader.cs): New public class.
13015 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13016 SeekableStreamReader instead of the normal StreamReader.
13018 2003-08-04 Martin Baulig <martin@ximian.com>
13020 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13021 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13022 deambiguate casts and delegate invocations.
13023 (parenthesized_expression): Use the new tokens to ensure this is
13024 not a cast of method invocation.
13026 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13027 when reading a `)' and Deambiguate_CloseParens () was previously
13030 * expression.cs (ParenthesizedExpression): New class. This is
13031 just used for the CS0075 test.
13032 (Binary.DoResolve): Check for CS0075.
13034 2003-07-29 Ravi Pratap <ravi@ximian.com>
13036 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13037 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13038 reference comparison.
13040 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13041 examine the ReturnType for equality - this is necessary in the
13042 cases of implicit and explicit operators whose signature also
13043 includes the return type.
13045 2003-07-26 Miguel de Icaza <miguel@ximian.com>
13047 * namespace.cs: Cache the result of the namespace computation,
13048 instead of computing it every time.
13050 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13052 * decl.cs: Use a global arraylist that we reuse over invocations
13053 to avoid excesive memory consumption. Reduces memory usage on an
13054 mcs compile by one meg (45 average).
13056 * typemanager.cs (LookupTypeReflection): In .NET pointers are
13057 private, work around that.
13059 2003-07-23 Miguel de Icaza <miguel@ximian.com>
13061 * literal.cs (IntLiteral): Define Zero and One static literals.
13063 * cs-parser.jay (integer_literal): use static literals to reduce
13064 memory usage for the most used literals (0, 1 and -1). 211kb
13065 reduced in memory usage.
13067 Replace all calls to `new ArrayList' with `new
13068 ArrayList(4)' which is a good average number for most allocations,
13069 and also requires only 16 bytes of memory for its buffer by
13072 This reduced MCS memory usage in seven megabytes for the RSS after
13075 2003-07-28 Ravi Pratap <ravi@ximian.com>
13077 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13078 handle params methods the correct way by forming only one
13079 applicable set with params and normal methods in them. Earlier we
13080 were looking at params methods only if we found no normal methods
13081 which was not the correct thing to do.
13083 (Invocation.BetterFunction): Take separate arguments indicating
13084 when candidate and the best method are params methods in their
13087 This fixes bugs #43367 and #46199.
13089 * attribute.cs: Documentation updates.
13091 (CheckAttribute): Rename to CheckAttributeTarget.
13092 (GetValidPlaces): Rename to GetValidTargets.
13094 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13095 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13099 2003-07-28 Martin Baulig <martin@ximian.com>
13101 * class.cs (TypeContainer.DefineMembers): Use the base type's full
13102 name when looking up the base class of a nested class. Fixes #46977.
13104 2003-07-26 Martin Baulig <martin@ximian.com>
13106 * expression.cs (Indexers.Indexer): New nested struct; contains
13107 getter, setter and the indexer's type.
13108 (Indexers.Properties): This is now an ArrayList of
13109 Indexers.Indexer's.
13110 (IndexerAccess.DoResolveLValue): Correctly set the type if the
13111 indexer doesn't have any getters.
13113 * assign.cs (Assign.DoResolve): Also do the implicit conversions
13114 for embedded property and indexer assignments.
13116 2003-07-26 Martin Baulig <martin@ximian.com>
13118 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
13119 preprocessor directive is not the first non-whitespace character
13122 2003-07-26 Martin Baulig <martin@ximian.com>
13124 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
13125 namespace parsing, follow the spec more closely.
13127 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
13128 NamespaceEntry.Lookup().
13130 2003-07-25 Martin Baulig <martin@ximian.com>
13132 * MethodCore.cs (OverridesSomething): New public field; it's set
13133 from TypeContainer.DefineMembers if this method overrides
13134 something (which doesn't need to be a method). Fix #39462.
13136 2003-07-25 Ravi Pratap <ravi@ximian.com>
13138 * typemanager.cs (GetMembers): Ensure that the list of members is
13139 reversed. This keeps things in sync.
13141 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
13142 find an AttributeUsage attribute.
13144 * expression.cs (Invocation.OverloadResolve): Perform the check
13145 which disallows Invoke to be directly called on a Delegate.
13147 (Error_InvokeOnDelegate): Report error cs1533.
13149 2003-07-25 Martin Baulig <martin@ximian.com>
13151 * expression.cs (Indexers.GetIndexersForType): Only look in the
13152 interface hierarchy if the requested type is already an
13153 interface. Fixes #46788 while keeping #46502 fixed.
13155 2003-07-25 Martin Baulig <martin@ximian.com>
13157 * class.cs (TypeContainer.DefineMembers): Check whether all
13158 readonly fields have been assigned and report warning CS0649 if
13161 * statement.cs (LocalInfo.IsFixed): Always return true if this is
13164 2003-07-24 Ravi Pratap <ravi@ximian.com>
13166 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
13167 returned from GetMethods to make things consistent with the
13168 assumptions MCS makes about ordering of methods.
13170 This should comprehensively fix bug #45127 and it does :-)
13172 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
13173 ordering is actually reverse.
13175 * Clean up some debug messages I left lying around.
13177 * interface.cs (Populate*): Get rid of code which emits attributes
13178 since the stage in which we emit attributes is the 'Emit' stage,
13179 not the define stage.
13181 (Emit): Move attribute emission for interface members here.
13183 2003-07-22 Ravi Pratap <ravi@ximian.com>
13185 * expression.cs (Invocation.OverloadResolve): Follow the spec more
13186 closely: we eliminate methods in base types when we have an
13187 applicable method in a top-level type.
13189 Please see section 14.5.5.1 for an exact description of what goes
13192 This fixes bug #45127 and a host of other related to corlib compilation.
13194 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13195 array is the method corresponding to the top-level type (this is
13196 because of the changes made to icall.c) so we change this
13199 (MethodGroupExpr.Name): This too.
13201 * typemanager.cs (GetElementType): New method which does the right
13202 thing when compiling corlib.
13204 * everywhere: Make use of the above in the relevant places.
13206 2003-07-22 Martin Baulig <martin@ximian.com>
13208 * cs-parser.jay (invocation_expression): Moved
13209 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13210 `cast_expression', but create a InvocationOrCast which later
13211 resolves to either an Invocation or a Cast.
13213 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13214 method; call this before EmitStatement() to make sure that this
13215 expression can be used as a statement.
13217 * expression.cs (InvocationOrCast): New class; resolves to either
13218 an Invocation or a Cast.
13220 * statement.cs (StatementExpression): Call ResolveStatement() on
13221 the ExpressionStatement before emitting it.
13223 2003-07-21 Martin Baulig <martin@ximian.com>
13225 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13226 `ref' and `out' attributes match; fixes #46220.
13227 (MemberAccess.ResolveMemberAccess): You can't reference a type
13228 through an expression; fixes #33180.
13229 (Indexers.GetIndexersForType): Don't return the indexers from
13230 interfaces the class implements; fixes #46502.
13232 2003-07-21 Martin Baulig <martin@ximian.com>
13234 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13235 CS0661 checks; fixes bug #30442.
13237 2003-07-21 Martin Baulig <martin@ximian.com>
13239 * decl.cs (AdditionResult): Added `Error'.
13241 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13243 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
13244 makes cs0031.cs actually work.
13246 2003-07-20 Martin Baulig <martin@ximian.com>
13248 * namespace.cs: Fixed that bug which caused a crash when compiling
13249 the debugger's GUI.
13251 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13253 * typemanager.cs (LookupTypeReflection): Never expose types which
13254 are NotPublic, NestedPrivate, NestedAssembly, or
13255 NestedFamANDAssem. We used to return these, and later do a check
13256 that would report a meaningful error, but the problem is that we
13257 would not get the real match, if there was a name override.
13259 2003-07-18 Miguel de Icaza <miguel@ximian.com>
13261 * namespace.cs (Namespace, Name): Do not compute the namespace
13262 name dynamically, compute it in the constructor. This reduced
13263 memory usage by 1697 KB.
13265 * driver.cs: Use --pause to pause at the end.
13267 2003-07-17 Peter Williams <peter@newton.cx>
13269 * Makefile: Change the name of the test target so that it doesn't
13270 conflict with the recursive test target.
13272 2003-07-17 Miguel de Icaza <miguel@ximian.com>
13274 * expression.cs (LocalVariableReference.Emit, EmitAssign,
13275 AddressOf): Do not use EmitThis, that was wrong, use the actual
13278 2003-07-15 Miguel de Icaza <miguel@ximian.com>
13280 * class.cs (MethodData.Define): While checking if a method is an
13281 interface implementation, improve the test: If we are not public
13282 (use new test here: use the computed MethodAttributes directly,
13283 instead of the parsed modifier flags) check if the `implementing'
13284 method comes from an interface or not.
13286 * pending.cs (VerifyPendingMethods): Slightly better error
13289 * makefile: add test target that does the mcs bootstrap.
13291 2003-07-16 Ravi Pratap <ravi@ximian.com>
13293 * interface.cs (Define): Do nothing here since there are no
13294 members to populate etc. Move the attribute emission out of here
13295 since this was just totally the wrong place to put it. Attribute
13296 application happens during the 'Emit' phase, not in the 'Define'
13299 (Emit): Add this method and move the attribute emission here
13301 * rootcontext.cs (EmitCode): Call the Emit method on interface
13304 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13306 * expression.cs (OverloadResolve): Report error only if Location
13307 is not 'Null' which means that there was a probe going on.
13309 2003-07-14 Martin Baulig <martin@ximian.com>
13311 * expression.cs (ConditionalLogicalOperator): New public class to
13312 implement user defined conditional logical operators.
13313 This is section 14.11.2 in the spec and bug #40505.
13315 2003-07-14 Martin Baulig <martin@ximian.com>
13317 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13319 2003-07-14 Martin Baulig <martin@ximian.com>
13321 * codegen.cs (EmitContext.InFixedInitializer): New public field.
13323 * ecore.cs (IVariable.VerifyFixed): New interface method.
13325 * expression.cs (Unary.ResolveOperator): When resolving the `&'
13326 operator, check whether the variable is actually fixed. Fixes bug
13327 #36055. Set a variable definitely assigned when taking its
13328 address as required by the spec.
13330 * statement.cs (LocalInfo.IsFixed): New field.
13331 (LocalInfo.MakePinned): Set `IsFixed' to true.
13333 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13335 * attribute.cs (Attribute.Resolve): While doing a Member lookup
13336 for .ctors, ensure that we only ask for members declared in the
13337 attribute type (BindingFlags.DeclaredOnly).
13341 * expression.cs (Error_WrongNumArguments): Report error 1501
13342 correctly the way CSC does.
13344 2003-07-13 Martin Baulig <martin@ximian.com>
13346 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13347 lookup on the fully qualified name, to make things like "X.X" work
13348 where "X.X" is a fully qualified type name, but we also have a
13349 namespace "X" in the using list. Fixes #41975.
13351 2003-07-13 Martin Baulig <martin@ximian.com>
13353 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13354 function. If we're a CompoundAssign, we need to create an embedded
13355 CompoundAssign, not an embedded Assign.
13356 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13359 2003-07-13 Martin Baulig <martin@ximian.com>
13361 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13362 work to fix bug #46088.
13364 2003-07-13 Ravi Pratap <ravi@ximian.com>
13366 * class.cs (Operator.Emit): Do not emit attributes here - it is
13367 taken care of by the Method class that we delegate too. This takes
13368 care of bug #45876.
13370 2003-07-10 Martin Baulig <martin@ximian.com>
13372 * expression.cs (TypeOfVoid): New class.
13373 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
13375 2003-07-10 Martin Baulig <martin@ximian.com>
13377 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13380 2003-07-10 Martin Baulig <martin@ximian.com>
13382 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13383 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13385 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13387 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13389 2003-07-10 Martin Baulig <martin@ximian.com>
13391 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13392 of decimal. Fixes #42850.
13394 NOTE: I also fixed the created byte blob, but this doesn't work on
13395 the MS runtime and csc never produces any byte blobs for decimal
13398 2003-07-10 Martin Baulig <martin@ximian.com>
13400 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13401 structs; fixes #32068.
13402 (Block.AddChildVariableNames): Fixed #44302.
13404 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13406 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13408 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13410 * attribute.cs: And this test is onger needed.
13412 2003-07-08 Martin Baulig <martin@ximian.com>
13414 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13415 inaccessible types. Fixes #36313.
13417 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13419 * namespace.cs (NamespaceEntry): Create implicit entries for all
13420 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13421 implicit entries for N1.N2 and N1.
13423 2003-07-08 Martin Baulig <martin@ximian.com>
13425 Rewrote the handling of namespaces to fix a lot of the issues
13426 wrt. `using' aliases etc.
13428 * namespace.cs (Namespace): Splitted this class into a
13429 per-assembly `Namespace' and a per-file `NamespaceEntry'.
13431 * typemanager.cs (TypeManager.IsNamespace): Removed.
13432 (TypeManager.ComputeNamespaces): Only compute namespaces from
13433 loaded assemblies here, not the namespaces from the assembly we're
13434 currently compiling.
13436 2003-07-08 Martin Baulig <martin@ximian.com>
13438 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13440 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13442 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13445 I thought about the memory savings here, but LookupTypeReflection
13446 is used under already very constrained scenarios. Compiling
13447 corlib or mcs only exposes one hit, so it would not really reduce
13448 any memory consumption.
13450 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13452 * typemanager.cs: fixes bug #45889 by only adding public types from
13453 other assemblies to the list of known types.
13455 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13457 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13458 on the type we resolved.
13460 2003-07-05 Martin Baulig <martin@ximian.com>
13462 * pending.cs (PendingImplementation.ParentImplements): Don't
13463 create the proxy if the parent is abstract.
13465 * class.cs (TypeContainer.DefineIndexers): Process explicit
13466 interface implementations first. Fixes #37714.
13468 2003-07-04 Miguel de Icaza <miguel@ximian.com>
13470 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13471 defined recursively; but since we modify the input parameters
13472 (left is set to `this' temporarily), we reset this value if the
13473 left_is_explicit is false, which gives the original semantics to
13476 * literal.cs (NullPointer): new class used to represent a null
13477 literal in a pointer context.
13479 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13480 type is a pointer, use a NullPointer object instead of a
13481 NullLiteral. Closes 43687
13483 (ExplicitConversion): Convert pointer values using
13484 the conv opcode to the proper type.
13486 * ecore.cs (New): change ValueTypeVariable property into a method,
13487 that returns whether the valuetype is suitable for being used.
13489 * expression.cs (Binary.DoNumericPromotions): Only return if we
13490 the int constant was a valid uint, and we can return both left and
13491 right as uints. If not, we continue processing, to trigger the
13492 type conversion. This fixes 39018.
13494 * statement.cs (Block.EmitMeta): During constant resolution, set
13495 the CurrentBlock property on the emitcontext, so that we resolve
13496 constants propertly.
13498 2003-07-02 Martin Baulig <martin@ximian.com>
13500 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13501 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13503 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13504 than emitting it here.
13506 * statement.cs: Fixed some more flow analysis bugs.
13508 2003-07-02 Martin Baulig <martin@ximian.com>
13510 * class.cs (MethodData.Define): When implementing interface
13511 methods, set Final unless we're Virtual.
13513 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13514 check work for interface methods.
13516 2003-07-01 Martin Baulig <martin@ximian.com>
13518 * ecore.cs (EmitContext.This): Replaced this property with a
13519 GetThis() method which takes a Location argument. This ensures
13520 that we get the correct error location for a CS0188.
13522 2003-07-01 Miguel de Icaza <miguel@ximian.com>
13524 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13525 ImplicitStandardConversion.
13527 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13529 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
13531 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13534 2003-06-30 Miguel de Icaza <miguel@ximian.com>
13536 * class.cs (Constructor.Define): Turn off initlocals for unsafe
13539 (MethodData.Define): Turn off initlocals for unsafe methods.
13541 2003-06-29 Miguel de Icaza <miguel@ximian.com>
13543 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13544 complete; Fixes #37521.
13546 * delegate.cs: Use Modifiers.TypeAttr to compute the
13547 TypeAttributes, instead of rolling our own. This makes the flags
13548 correct for the delegates.
13550 2003-06-28 Miguel de Icaza <miguel@ximian.com>
13552 * class.cs (Constructor.Define): Set the private flag for static
13553 constructors as well.
13555 * cs-parser.jay (statement_expression): Set the return value to
13556 null, to avoid a crash when we catch an error.
13558 2003-06-24 Miguel de Icaza <miguel@ximian.com>
13560 * cs-parser.jay: Applied patch from Jackson that adds support for
13561 extern and unsafe modifiers to destructor declarations.
13563 * expression.cs: Report error 21 if the user is trying to index a
13566 * driver.cs: Add an error message, suggested by the bug report.
13568 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13569 if we do not have a ": this ()" constructor initializer. Fixes 45149
13571 2003-06-14 Miguel de Icaza <miguel@ximian.com>
13573 * namespace.cs: Add some information to reduce FAQs.
13575 2003-06-13 Miguel de Icaza <miguel@ximian.com>
13577 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13578 underlying enumeration types. Fixes #43915.
13580 * expression.cs: Treat ushort/short as legal values to be used in
13581 bitwise operations.
13583 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13585 * delegate.cs: transfer custom attributes for paramenters from
13586 the delegate declaration to Invoke and BeginInvoke.
13588 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13590 * attribute.cs: handle custom marshalers and emit marshal info
13593 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
13595 * makefile.gnu: Added anonymous.cs to the compiler sources.
13597 2003-05-28 Miguel de Icaza <miguel@ximian.com>
13599 * iterators.cs: Change the name of the proxy class to include two
13602 * cs-parser.jay: Update grammar to include anonymous methods.
13604 * anonymous.cs: new file.
13606 2003-05-27 Miguel de Icaza <miguel@ximian.com>
13608 * class.cs (Field.Define): Add missing test for pointers and
13611 2003-05-27 Ravi Pratap <ravi@ximian.com>
13613 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13614 we use the stobj opcode.
13616 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13617 since it wasn't the correct fix.
13619 It still is puzzling that we are required to use stobj for IntPtr
13620 which seems to be a ValueType.
13622 2003-05-26 Miguel de Icaza <miguel@ximian.com>
13624 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13625 during regular simple name resolution. Now, the trick is that
13626 instead of returning for processing the simplename, we do a
13627 TypeManager.LookupType (ie, a rooted lookup as opposed to a
13628 contextual lookup type). If a match is found, return that, if
13629 not, return for further composition.
13631 This fixes long-standing 30485.
13633 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13634 using the address to initialize an object, do an Stobj instead of
13635 using the regular Stelem.
13637 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13638 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13639 Because if we are a BaseIndexerAccess that value will be true.
13642 * statement.cs (GotoCase.Resolve): Return after reporting an
13643 error, do not attempt to continue.
13645 * expression.cs (PointerArithmetic.Emit): If our operand is a
13646 long, convert our constants to match the operand before
13647 multiplying. Convert to I type before adding. Fixes 43670.
13649 2003-05-14 Ravi Pratap <ravi@ximian.com>
13651 * enum.cs (ImplicitConversionExists) : Rename to
13652 ImplicitEnumConversionExists to remove ambiguity.
13654 * ecore.cs (NullCast): New type of cast expression class which
13655 basically is very similar to EmptyCast with the difference being
13656 it still is a constant since it is used only to cast a null to
13658 (eg. (string) null)
13660 * convert.cs (ImplicitReferenceConversion): When casting a null
13661 literal, we return a NullCast.
13663 * literal.cs (NullLiteralTyped): Remove - I don't see why this
13664 should be around anymore.
13666 The renaming (reported was slightly wrong). Corrections:
13668 ConvertImplicitStandard -> ImplicitConversionStandard
13669 ConvertExplicitStandard -> ExplicitConversionStandard
13671 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13672 before passing them in !
13674 * convert.cs (ImplicitConversionStandard): When comparing for
13675 equal expr and target types, ensure that expr is not a
13678 In general, we must not be checking (expr_type ==
13679 target_type) in the top level conversion methods
13680 (ImplicitConversion, ExplicitConversion etc). This checking is
13681 done in the methods that they delegate to.
13683 2003-05-20 Miguel de Icaza <miguel@ximian.com>
13685 * convert.cs: Move Error_CannotConvertType,
13686 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13687 ImplicitNumericConversion, ImplicitConversionExists,
13688 ImplicitUserConversionExists, StandardConversionExists,
13689 FindMostEncompassedType, FindMostSpecificSource,
13690 FindMostSpecificTarget, ImplicitUserConversion,
13691 ExplicitUserConversion, GetConversionOperators,
13692 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13693 TryImplicitIntConversion, Error_CannotConvertImplicit,
13694 ConvertImplicitRequired, ConvertNumericExplicit,
13695 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13696 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13699 Perform the following renames:
13701 StandardConversionExists -> ImplicitStandardConversionExists
13702 ConvertImplicit -> ImplicitConversion
13703 ConvertImplicitStandard -> ImplicitStandardConversion
13704 TryImplicitIntConversion -> ImplicitIntConversion
13705 ConvertImplicitRequired -> ImplicitConversionRequired
13706 ConvertNumericExplicit -> ExplicitNumericConversion
13707 ConvertReferenceExplicit -> ExplicitReferenceConversion
13708 ConvertExplicit -> ExplicitConversion
13709 ConvertExplicitStandard -> ExplicitStandardConversion
13711 2003-05-19 Martin Baulig <martin@ximian.com>
13713 * statement.cs (TypeInfo.StructInfo): Made this type protected.
13714 (TypeInfo): Added support for structs having structs as fields.
13716 * ecore.cs (FieldExpr): Implement IVariable.
13717 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13718 VariableInfo for the field.
13720 2003-05-18 Martin Baulig <martin@ximian.com>
13722 * expression.cs (This.DoResolve): Report a CS0027 if we're
13723 emitting a field initializer.
13725 2003-05-18 Martin Baulig <martin@ximian.com>
13727 * expression.cs (This.ResolveBase): New public function.
13728 (This.DoResolve): Check for CS0188.
13730 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13733 * ecore.cs (MethodGroupExpr.DoResolve): Set the
13734 `instance_expression' to null if we don't have any non-static
13737 2003-05-18 Martin Baulig <martin@ximian.com>
13739 Reworked the way how local variables and parameters are handled by
13740 the flow analysis code.
13742 * statement.cs (TypeInfo, VariableMap): New public classes.
13743 (VariableInfo): New public class. This is now responsible for
13744 checking whether a variable has been assigned. It is used for
13745 parameters and local variables.
13746 (Block.EmitMeta): Take the InternalParameters as argument; compute
13747 the layout of the flow vectors here.
13748 (Block.LocalMap, Block.ParameterMap): New public properties.
13749 (FlowBranching): The .ctor doesn't get the InternalParameters
13750 anymore since Block.EmitMeta() now computes the layout of the flow
13752 (MyStructInfo): This class is now known as `StructInfo' and nested
13753 in `TypeInfo'; we don't access this directly anymore.
13755 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13756 property and removed IsAssigned(), IsFieldAssigned(),
13757 SetAssigned() and SetFieldAssigned(); we now call them on the
13758 VariableInfo so we don't need to duplicate this code everywhere.
13760 * expression.cs (ParameterReference): Added `Block block' argument
13762 (LocalVariableReference, ParameterReference, This): The new
13763 VariableInfo class is now responsible for all the definite
13766 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13767 IsParameterAssigned, SetParameterAssigned): Removed.
13769 2003-05-18 Martin Baulig <martin@ximian.com>
13771 * typemanager.cs (InitCoreTypes): Try calling
13772 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13773 the 3-args-version. Corlib now also needs our `void_type'.
13774 (GetMethod): Added overloaded version which takes an optional
13775 `bool report_errors' to allow lookups of optional methods.
13777 2003-05-12 Martin Baulig <martin@ximian.com>
13779 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13780 only used for locals and not for parameters.
13782 2003-05-12 Miguel de Icaza <miguel@ximian.com>
13784 * support.cs (InternalParameters.ParameterType): Return the
13785 ExternalType of the parameter.
13787 * parameter.cs (Parameter.ExternalType): drop the two arguments,
13790 2003-05-11 Miguel de Icaza <miguel@ximian.com>
13792 * class.cs (MethodData.Define): Do not set the `newslot' on
13793 interface members, if they are also flagged as "override".
13795 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13796 better code for ++i and i++. This only works for static fields
13797 and local variables.
13799 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13800 want to pull the DeclSpace out of the builder_to_declspace instead
13801 of the TypeBuilder (like in TypeContainer.FindMembers).
13803 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13804 instead of LookupTypeContainer. Fixes the crash on .NET for
13805 looking up interface members.
13807 * const.cs: Create our own emit context during the Definition
13808 stage, so that constants are evaluated in the proper context, when
13809 a recursive definition happens.
13811 2003-05-11 Martin Baulig <martin@ximian.com>
13813 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
13814 new block for a switch section.
13815 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13816 the adding/lookup in the switch block. Fixes #39828.
13818 2003-05-09 Miguel de Icaza <miguel@ximian.com>
13820 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13821 functionality: I needed to convert the data after I had performed
13822 the add/sub operation into the operands type size.
13824 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13825 pass the type for the box operation, otherwise the resulting
13826 object would have been of type object.
13828 (BoxedCast): Add constructor to specify the type to box as.
13830 2003-05-07 Miguel de Icaza <miguel@ximian.com>
13832 * iterators.cs: I was reusing the `count' variable inadvertently,
13833 take steps to not allow this to happen.
13835 2003-05-06 Miguel de Icaza <miguel@ximian.com>
13837 * attribute.cs (Attribute.Resolve): Params attributes are encoded
13838 by creating an array at the point where the params starts and
13839 putting all those arguments there, then adjusting the size of the
13842 2003-05-05 Miguel de Icaza <miguel@ximian.com>
13844 * expression.cs (New.AddressOf): Implement interface
13845 IMemoryLocation. This is used when the `new' operator is used in
13846 the context of an invocation to a method on a value type.
13848 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13851 * namespace.cs: Also check the using aliases here.
13853 * driver.cs: Move the test for using validity after the types have
13854 been entered, so we do a single pass that also includes the using
13857 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13858 in the regular case. CreateSiblingForFinally is doing extra
13861 * attribute.cs (GetAttributeArgumentExpression): Store the result
13862 on an out value, and use the return value to indicate failure
13863 instead of using null (which is a valid return for Constant.GetValue).
13865 * statement.cs: Perform the analysis flow for the increment
13866 portion after the statement, because this will be the real flow of
13867 execution. Fixes #42385
13869 * codegen.cs (EmitContext.EmitArgument,
13870 EmitContext.EmitStoreArgument): New helper functions when the
13871 RemapToProxy flag is set.
13873 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13876 Add support for remapping parameters.
13878 * iterators.cs: Propagate parameter values; Store parameter
13879 values in the proxy classes.
13881 2003-05-04 Miguel de Icaza <miguel@ximian.com>
13883 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
13884 need a proxy reference; I do not know what I was thinking
13886 * cs-parser.jay (constructor_initializer): catch another error,
13887 and display nice message.
13889 (field_declaration): catch void field declaration
13890 to flag a better error.
13892 * class.cs (MemberBase.CheckBase): Report an error instead of a
13893 warning if a new protected member is declared in a struct.
13894 (Field.Define): catch the error of readonly/volatile.
13896 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13898 (FieldExpr.AddressOf): ditto. Catch error where the address of a
13899 volatile variable is taken
13901 2003-05-02 Miguel de Icaza <miguel@ximian.com>
13903 * statement.cs (Fixed.Resolve): Report an error if we are not in
13906 2003-05-01 Miguel de Icaza <miguel@ximian.com>
13908 * typemanager.cs: reuse the code that handles type clashes for
13909 delegates and enumerations.
13911 * class.cs (Report28): Always report.
13913 * expression.cs (EncodeAsAttribute): Allow nulls here.
13915 2003-04-28 Miguel de Icaza <miguel@ximian.com>
13917 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13918 the functionality for testing whether an expression is valid for
13919 an attribute here. Also handle the case of arrays of elements
13922 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13923 encoding a linear array into an array of objects that are suitable
13924 to be passed to an CustomAttributeBuilder.
13926 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13928 * ecore.cs: (FieldExpr): Handle field remapping here.
13930 * iteratators.cs: Pass the instance variable (if the method is an
13931 instance method) to the constructors, so we can access the field
13932 variables on the class.
13934 TODO: Test this with structs. I think the THIS variable on
13935 structs might have to be a pointer, and not a refenrece
13937 2003-04-27 Miguel de Icaza <miguel@ximian.com>
13939 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13940 local variables to fields in a proxy class.
13942 * iterators.cs (PopulateProxy): Rename our internal fields to
13944 Create a <THIS> field if we are an instance method, so we can
13945 reference our parent container variables.
13946 (MapVariable): Called back from the EmitContext code to enter a
13947 new variable to field mapping into the proxy class (we just create
13951 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13952 for using the remapped locals to fields.
13954 I placed the code here, because that gives the same semantics to
13955 local variables, and only changes the Emit code.
13957 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13958 statements inside iterators.
13959 (VariableInfo): Add a FieldBuilder for the cases when we are
13960 remapping local variables to fields in a proxy class
13962 * ecore.cs (SimpleNameResolve): Avoid testing two times for
13963 current_block != null.
13965 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13966 not cope with strings, as it has been moved to the
13967 TableSwitchEmit. Fixed bug in switch generation.
13969 * expression.cs (New.DoResolve): Provide more context for the user
13970 when reporting an error.
13972 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13975 * expression.cs (MemberAccess.DoResolve): When we get a type back,
13976 check the permissions for it. Note than in a type-resolution
13977 context the check was already present in DeclSpace.ResolveType,
13978 but was missing from the MemberAccess.
13980 (ArrayCreation.CheckIndices): warn if the user has
13981 more nested levels of expressions, but there are no more
13982 dimensions specified. Avoids crash on bug 41906.
13984 2003-04-26 Miguel de Icaza <miguel@ximian.com>
13986 * statement.cs (Block): replace Implicit bool, for a generic
13988 New flag: `Unchecked'. This is used during the EmitMeta phase
13989 (which is out-of-line with the regular Resolve/Emit process for a
13990 statement, as this is done ahead of time, but still gets a chance
13991 to call constant resolve).
13993 (Block.Flags): new enum for adding a new flag.
13995 (Block.EmitMeta): track the state of unchecked.
13997 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13998 to enable constant resolution to work there as well.
14000 2003-04-22 Miguel de Icaza <miguel@ximian.com>
14002 * typemanager.cs (ienumerable_type): Also look up
14003 System.Collections.IEnumerable.
14005 2003-04-21 Miguel de Icaza <miguel@ximian.com>
14007 TODO: Test more than one conditional per method.
14009 * class.cs (Indexer.Define): Report the location where the user is
14010 referencing the unsupported feature.
14012 (MethodData): Overload the use of `conditionals' to
14013 minimize the creation of needless ArrayLists. This saves roughly
14014 212kb on my machine.
14016 (Method): Implement the new IIteratorContainer interface.
14017 (Method.SetYields): Implement the method by setting the ModFlags
14018 to contain METHOD_YIELDS.
14020 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14021 which just got set to null.
14023 * iterators.cs: New file.
14025 (Yield, YieldBreak): New statements.
14027 * statement.cs (Return.Resolve): Flag an error if we are used in
14028 an iterator method.
14030 * codegen.cs (InIterator): New flag set if the code is being
14031 compiled in an iterator method.
14033 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
14034 internal modifier, and we just use it to avoid adding extra
14035 fields, as this is seldom used.
14037 * cs-parser.jay: Add yield_statement (yield and yield break).
14039 * driver.cs: New flag -v2 to turn on version 2 features.
14041 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14042 hashtable when v2 is enabled.
14044 2003-04-20 Miguel de Icaza <miguel@ximian.com>
14046 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14047 there is already a namespace defined with this name.
14049 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14050 people upgraded their corlibs.
14052 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14053 always use fully qualified types, no need to use the compiler
14056 (TypeManager.IsNamespace): Use binarysearch.
14058 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14059 AddDelegate): I did not quite use the new IsValid API properly: I
14060 have to pass the short-name and the fullname. I was passing only
14061 the basename instead of the fullname sometimes.
14063 (TypeContainer.DefineType): call NamespaceClash.
14065 * interface.cs (Interface.DefineType): use NamespaceClash before
14068 * delegate.cs (Delegate.DefineType): use NamespaceClash before
14071 * enum.cs: (Enum.DefineType): use NamespaceClash before
14074 * typemanager.cs (: 3-line patch that gives us some tasty 11%
14075 speed increase. First, use the negative_hits cache when we get a
14076 negative. Second, add the type with its full original name
14077 instead of the new . and + encoded name (reflection uses + to
14078 separate type from a nested type). Use LookupTypeReflection
14079 directly which bypasses the type->name hashtable (that we already
14080 know does not contain the type.
14082 * decl.cs (DeclSpace.ResolveTypeExpr): track the
14083 location/container type.
14085 * driver.cs: When passing utf8, use directly the UTF8Encoding.
14087 2003-04-19 Miguel de Icaza <miguel@ximian.com>
14089 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14091 * delegate.cs (NewDelegate.Resolve): Test whether an instance
14092 method is being referenced in the method group from a static
14093 context, and report error 120 if so.
14095 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14098 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14099 is created, we create the A namespace).
14101 * cs-parser.jay: A namespace also introduces a DeclarationFound.
14104 2003-04-18 Miguel de Icaza <miguel@ximian.com>
14106 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14107 invocation to ModuleBuilder.GetType with the same values will
14108 return a new type instance, so we need to cache its return
14111 * expression.cs (Binary.ResolveOperator): Only allow the compare
14112 operators on enums if they are of the same type.
14114 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14115 types of ValueType on their own case. Before we were giving them
14116 the same treatment as objects.
14118 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14119 fullname. Short name is used to compare against container name.
14120 Fullname is used to check against defined namespace names.
14122 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14123 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14125 (Method.CheckBase): Call parent.
14126 (MemberBase.CheckBase): Check for protected members on sealed
14128 (PropertyBase.CheckBase): Call parent.
14129 (Field.Define): Call parent.
14131 * report.cs: Negative error codes are now mapped to 8000 - code,
14132 so that the display is render more nicely.
14134 * typemanager.cs: Do not use try/catch, instead report a regular
14137 (GetPointerType, GetReferenceType): These methods provide
14138 mechanisms to obtain the T* and T& from a T. We had the code
14139 previously scattered around the code base, and it also used
14140 TypeManager.LookupType that would go through plenty of caches.
14141 This one goes directly to the type source.
14143 In some places we did the Type.GetType followed by
14144 ModuleBuilder.GetType, but not in others, so this unifies the
14145 processing as well.
14147 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14148 statements now that we have namespace information.
14150 * typemanager.cs (IsNamespace): New method, returns whether the
14151 string presented is a namespace or not.
14153 (ComputeNamespaces): New public entry point, computes the list of
14154 available namespaces, using the GetNamespaces API call in Mono, or
14155 the slower version in MS.NET.
14157 Now before we start the semantic analysis phase, we have a
14158 complete list of namespaces including everything that the user has
14161 Deleted old code to cache namespaces in .nsc files.
14163 2003-04-17 Miguel de Icaza <miguel@ximian.com>
14165 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14166 class/struct location definition Location for the implicit
14167 constructor location.
14169 (Operator.Define): Use the location of the operator for the
14170 implicit Method definition.
14172 (Constructor.Emit): use the constructor location for the implicit
14173 base initializer constructor.
14175 * ecore.cs: Remove ITypeExpression. This interface is now gone,
14176 and the Expression class now contains two new methods:
14178 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
14179 isolate type lookup from the rest of the resolution process.
14181 Since we use Expressions to hold type definitions due to the way
14182 we parse the input we have historically overloaded Resolve to
14183 perform the Type lookups if a special flag is passed. Now this is
14184 eliminated and two methods take their place.
14186 The differences in the two methods between xStep and xTerminal is
14187 that xStep is involved in our current lookup system that uses
14188 SimpleNames to compose a name, while xTerminal is used just to
14189 catch the case where the simplename lookup failed.
14191 2003-04-16 Miguel de Icaza <miguel@ximian.com>
14193 * expression.cs (ResolveMemberAccess): Remove redundant code.
14194 TypeExpr expressions are always born fully resolved.
14196 * interface.cs (PopulateMethod): Do not lookup the types twice.
14197 We were doing it once during SemanticAnalysis and once during
14200 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14201 in local variable type definitions, were being returned as a
14202 SimpleName (we decomposed everything into a string), that is
14203 because primary_expression was being used instead of a type in the
14204 grammar (reduce/reduce conflicts).
14206 The part that was wrong is that we converted the expression into a
14207 string (an oversimplification in one hand, compounded with primary
14208 expressions doing string concatenation).
14214 Would return "A.B.C[]" as a SimpleName. This stopped things like
14215 using clauses from working on this particular context. And a type
14216 was being matched directly against "A.B.C[]".
14218 We now use the correct approach, and allow for ComposedCast to be
14219 part of the unary expression. So the "A.B.C []" become a composed
14220 cast of "A.B.C" (as a nested group of MemberAccess with a
14221 SimpleName at the end) plus the rank composition "[]".
14225 2003-04-10 Miguel de Icaza <miguel@ximian.com>
14227 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14228 for the access level checking.
14230 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
14231 `TypeContainer container', because I kept getting confused when I
14232 was debugging this code.
14234 * expression.cs (Indexers): Instead of tracking getters/setters,
14235 we now track them in parallel. We create one arraylist less, but
14236 most importantly it is possible now for the LValue code to find a
14237 matching get for a set.
14239 (IndexerAccess.DoResolveLValue): Update the code.
14240 GetIndexersForType has been modified already to extract all the
14241 indexers from a type. The code assumed it did not.
14243 Also make the code set the correct return type for the indexer.
14244 This was fixed a long time ago for properties, but was missing for
14245 indexers. It used to be void_type.
14247 (Binary.Emit): Test first for doubles instead of
14248 floats, as they are more common.
14250 (Binary.EmitBranchable): Use the .un version of the branch opcodes
14251 when dealing with floats and the <=, >= operators. This fixes bug
14254 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14255 to load the array value by emitting a load on the foreach variable
14256 type. This was incorrect.
14258 We now emit the code to load an element using the the array
14259 variable type, and then we emit the conversion operator.
14263 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
14265 * attribute.cs: Avoid allocation of ArrayLists in the common case.
14267 2003-04-09 Miguel de Icaza <miguel@ximian.com>
14269 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14270 test for protection before we test for signatures.
14272 (MethodSignature.ToString): implement.
14274 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14275 to the case where we reduced into a LongConstant.
14277 * decl.cs (CheckAccessLevel): If the type is an array, we can not
14278 depend on whether the information is acurrate, because the
14279 Microsoft runtime will always claim that the array type is public,
14280 regardless of the real state.
14282 If the type is a pointer, another problem happens: the type is
14283 reported as non-public in Microsoft.
14285 In both cases we have to call CheckAccessLevel recursively with
14286 the underlying type as the argument to be tested.
14288 2003-04-08 Miguel de Icaza <miguel@ximian.com>
14290 * assign.cs (Assign.Emit): If we are dealing with a compound
14291 assignment expression, we should use the code path that stores the
14292 intermediate result in a temporary value. This fixes #40903.
14294 *expression.cs (Indirection.ToString): Provide ToString method for
14297 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
14299 * class.cs: Null out fields holding references to Block objects so
14300 they can be garbage collected.
14302 * expression.cs (OverloadResolve): Remove unused local.
14304 2003-04-07 Martin Baulig <martin@ximian.com>
14306 * codegen.cs (EmitContext.CurrentFile): New public field.
14307 (EmitContext.Mark): Use the CurrentFile to check whether the
14308 location is in the correct file.
14309 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14311 2003-04-07 Martin Baulig <martin@ximian.com>
14313 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14315 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14316 location. [FIXME: The location argument which gets passed to this
14317 method is sometimes wrong!]
14319 2003-04-07 Nick Drochak <ndrochak@gol.com>
14321 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14323 2003-04-07 Miguel de Icaza <miguel@ximian.com>
14325 * expression.cs (Indirection.EmitAssign): We were using the
14326 temporary, but returning immediately instead of continuing the
14329 2003-04-06 Martin Baulig <martin@ximian.com>
14331 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14332 if it's a nested child, but also deriving from the outer class.
14335 * typemanager.cs (IsNestedChildOf): Make this work if it's a
14336 nested child, but also deriving from the outer class. See
14338 (FilterWithClosure): We may access private members of the outer
14339 class if we're a nested child and deriving from the outer class.
14340 (RealMemberLookup): Only set `closure_private_ok' if the
14341 `original_bf' contained BindingFlags.NonPublic.
14343 2003-04-05 Martin Baulig <martin@ximian.com>
14345 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
14347 2003-04-02 Miguel de Icaza <miguel@ximian.com>
14349 * class.cs (Event.Define): Do not allow abstract events to have
14352 2003-04-01 Miguel de Icaza <miguel@ximian.com>
14354 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14355 block in event declarations.
14357 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14358 value type, get its address.
14360 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14361 leaving a class on the stack instead of a boolean value (int
14362 0/1). Change the code so we compare against null, and then the
14363 result against zero.
14365 * class.cs (TypeContainer.GetClassBases): We were checking for the
14366 parent class being sealed too late.
14368 * expression.cs (Binary.Emit): For <= and >= when dealing with
14369 floating point values, use cgt.un and clt.un instead of cgt and
14372 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
14374 * statement.cs: Apply the same optimization as MS: skip the
14375 GetEnumerator returning an IEnumerator, and use the one returning a
14376 CharEnumerator instead. This allows us to avoid the try-finally block
14379 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
14381 * cs-parser.jay: Attributes cannot be applied to
14382 namespaces. Fixes #40473
14384 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14387 (Add*): check if the name is valid using the full name for constants,
14388 fields, properties and events.
14390 2003-03-28 Miguel de Icaza <miguel@ximian.com>
14392 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14393 char constants to be part of the enumeration.
14395 * expression.cs (Conditional.DoResolve): Add support for operator
14396 true. Implements the missing functionality from 14.12
14398 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14399 operator true/false as required by the spec.
14401 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14402 implicit conversion to boolean.
14404 * statement.cs (Statement.ResolveBoolean): A boolean expression is
14405 also one where the type implements `operator true'.
14407 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14408 get an expression that will invoke operator true based on an
14411 (GetConversionOperators): Removed the hack that called op_True
14414 (Expression.ResolveBoolean): Move this from Statement.
14416 2003-03-17 Miguel de Icaza <miguel@ximian.com>
14418 * ecore.cs (FieldExpr): do not allow initialization of initonly
14419 fields on derived classes
14421 2003-03-13 Martin Baulig <martin@ximian.com>
14423 * statement.cs (Block.Emit): Call ig.BeginScope() and
14424 ig.EndScope() when compiling with debugging info; call
14425 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14427 2003-03-08 Miguel de Icaza <miguel@ximian.com>
14429 * expression.cs (Indexers): Do not construct immediately, allow
14430 for new members to be appended as we go. Fixes 38143
14432 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14434 * expression.cs: save/restore context when resolving an unchecked
14437 2003-03-05 Miguel de Icaza <miguel@ximian.com>
14439 * cfold.cs: Catch division by zero in modulus operator during
14442 2003-03-03 Miguel de Icaza <miguel@ximian.com>
14444 * interface.cs (Interface.DefineMembers): Avoid defining members
14447 2003-02-27 Miguel de Icaza <miguel@ximian.com>
14449 * driver.cs: handle the +/- options for -noconfig
14451 * statement.cs (Unckeched.Resolve): Also track the state of
14452 unchecked in the Resolve phase.
14454 2003-02-27 Martin Baulig <martin@ximian.com>
14456 * ecore.cs (Expression.MemberLookup): Don't create a
14457 MethodGroupExpr for something which is not a method. Fixes #38291.
14459 2003-02-25 Miguel de Icaza <miguel@ximian.com>
14461 * class.cs (MemberBase.CheckParameters): Also check that the type
14462 is unmanaged if it is a pointer.
14464 * expression.cs (SizeOf.Resolve): Add location information.
14466 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14467 a managed type is declared.
14469 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14470 parameter modifiers as well. Fixes bug 38606
14472 * class.cs: Very sad. Am backing out the speed up changes
14473 introduced by the ArrayList -> Array in the TypeContainer, as they
14474 were not actually that much faster, and introduced a bug (no error
14475 reports on duplicated methods).
14477 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14478 source first, this will guarantee that we have a valid expression
14479 before calling in lower levels functions that will require a
14480 resolved object. Then use this original_source in the
14481 target.ResolveLValue instead of the original source that was
14484 Another change. Use target.Resolve instead of LValueResolve.
14485 Although we are resolving for LValues, we will let the Assign code
14486 take care of that (it will be called again from Resolve). This
14487 basically allows code like this:
14489 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14490 class Y { void A (X x) { x [0] += o; }
14492 The problem was that the indexer was trying to resolve for
14493 set_Item (idx, object o) and never finding one. The real set_Item
14494 was set_Item (idx, X). By delaying the process we get the right
14499 2003-02-23 Martin Baulig <martin@ximian.com>
14501 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14502 while calling DoEmit ().
14504 * codegen.cs (EmitContext.Mark): Don't mark locations in other
14505 source files; if you use the #line directive inside a method, the
14506 compiler stops emitting line numbers for the debugger until it
14507 reaches the end of the method or another #line directive which
14508 restores the original file.
14510 2003-02-23 Martin Baulig <martin@ximian.com>
14512 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14514 2003-02-23 Martin Baulig <martin@ximian.com>
14516 * statement.cs (Block.AddChildVariableNames): We need to call this
14517 recursively, not just for our immediate children.
14519 2003-02-23 Martin Baulig <martin@ximian.com>
14521 * class.cs (Event.Define): Always make the field private, like csc does.
14523 * typemanager.cs (TypeManager.RealMemberLookup): Make events
14524 actually work, fixes bug #37521.
14526 2003-02-23 Miguel de Icaza <miguel@ximian.com>
14528 * delegate.cs: When creating the various temporary "Parameters"
14529 classes, make sure that we call the ComputeAndDefineParameterTypes
14530 on those new parameters (just like we do with the formal ones), to
14531 allow them to be resolved in the context of the DeclSpace.
14533 This fixes the bug that Dick observed in Bugzilla #38530.
14535 2003-02-22 Miguel de Icaza <miguel@ximian.com>
14537 * expression.cs (ResolveMemberAccess): When resolving a constant,
14538 do not attempt to pull a constant if the value was not able to
14539 generate a valid constant.
14541 * const.cs (LookupConstantValue): Do not report more errors than required.
14543 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14545 * expression.cs: fixes bug #38328.
14547 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14549 * class.cs: Changed all the various members that can be part of a
14550 class from being an ArrayList to be an Array of the right type.
14551 During the DefineType type_list, interface_list, delegate_list and
14552 enum_list are turned into types, interfaces, delegates and enums
14555 And during the member population, indexer_list, event_list,
14556 constant_list, field_list, instance_constructor_list, method_list,
14557 operator_list and property_list are turned into their real arrays.
14559 Although we could probably perform this operation earlier, for
14560 good error reporting we need to keep the lists and remove the
14561 lists for longer than required.
14563 This optimization was triggered by Paolo profiling the compiler
14564 speed on the output of `gen-sample-program.pl' perl script.
14566 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14567 not crash in methods like MemberLookupFailed that use this field.
14569 This problem arises when the compiler fails to resolve a type
14570 during interface type definition for example.
14572 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14574 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14575 inherit from System.Object, so we have to stop at null, not only
14576 when reaching System.Object.
14578 2003-02-17 Miguel de Icaza <miguel@ximian.com>
14580 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14581 DeclaredOnly because the parent indexer might have had a different
14582 name, but did not loop until the top of the hierarchy was reached.
14584 The problem this one fixes is 35492: when a class implemented an
14585 indexer from an interface, we were getting the interface method
14586 (which was abstract) and we were flagging an error (can not invoke
14589 This also keeps bug 33089 functioning, and test-148 functioning.
14591 * typemanager.cs (IsSpecialMethod): The correct way of figuring
14592 out if a method is special is to see if it is declared in a
14593 property or event, or whether it is one of the predefined operator
14594 names. This should fix correctly #36804.
14596 2003-02-15 Miguel de Icaza <miguel@ximian.com>
14598 The goal here is to remove the dependency on EmptyCast.Peel ().
14599 Killing it completely.
14601 The problem is that currently in a number of places where
14602 constants are expected, we have to "probe" for an EmptyCast, and
14603 Peel, which is not the correct thing to do, as this will be
14604 repetitive and will likely lead to errors.
14606 The idea is to remove any EmptyCasts that are used in casts that
14607 can be reduced to constants, so we only have to cope with
14610 This bug hunt was triggered by Bug 37363 and the desire to remove
14611 the duplicate pattern where we were "peeling" emptycasts to check
14612 whether they were constants. Now constants will always be
14615 * ecore.cs: Use an enumconstant here instead of wrapping with
14618 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14619 throwing me off. By handling this we can get rid of a few hacks.
14621 * statement.cs (Switch): Removed Peel() code.
14623 2003-02-14 Miguel de Icaza <miguel@ximian.com>
14625 * class.cs: Location information for error 508
14627 * expression.cs (New.DoResolve): Add a guard against double
14628 resolution of an expression.
14630 The New DoResolve might be called twice when initializing field
14631 expressions (see EmitFieldInitializers, the call to
14632 GetInitializerExpression will perform a resolve on the expression,
14633 and later the assign will trigger another resolution
14635 This leads to bugs (#37014)
14637 * delegate.cs: The signature for EndInvoke should contain any ref
14638 or out parameters as well. We were not doing this in the past.
14640 * class.cs (Field.Define): Do not overwrite the type definition
14641 inside the `volatile' group. Turns out that volatile enumerations
14642 were changing the type here to perform a validity test, which
14645 2003-02-12 Miguel de Icaza <miguel@ximian.com>
14647 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14648 and structs, we do not want to load the instance variable
14650 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14651 enum_type has to be handled like an object reference (implicit
14652 conversions exists from this to object), but the regular IsClass
14653 and IsValueType tests will never return true for this one.
14655 Also we use TypeManager.IsValueType instead of type.IsValueType,
14656 just for consistency with the rest of the code (this is only
14657 needed if we ever use the construct exposed by test-180.cs inside
14658 corlib, which we dont today).
14660 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
14662 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14665 2003-02-09 Martin Baulig <martin@ximian.com>
14667 * namespace.cs (Namespace..ctor): Added SourceFile argument.
14668 (Namespace.DefineNamespaces): New static public method; this is
14669 called when we're compiling with debugging to add all namespaces
14670 to the symbol file.
14672 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14673 pass it to the Namespace's .ctor.
14675 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14676 and MethodBase arguments; pass the namespace ID to the symwriter;
14677 pass the MethodBase instead of the token to the symwriter.
14678 (SymbolWriter.DefineNamespace): New method to add a namespace to
14681 2003-02-09 Martin Baulig <martin@ximian.com>
14683 * symbolwriter.cs: New file. This is a wrapper around
14684 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
14685 methods here in near future.
14687 2003-02-09 Martin Baulig <martin@ximian.com>
14689 * codegen.cs (EmitContext.Mark): Just pass the arguments to
14690 ILGenerator.MarkSequencePoint() which are actually used by the
14693 2003-02-09 Martin Baulig <martin@ximian.com>
14695 * location.cs (SourceFile): New public sealed class. This
14696 contains the name and an index which is used in the location's token.
14697 (Location): Reserve an appropriate number of bits in the token for
14698 the source file instead of walking over that list, this gives us a
14699 really huge performance improvement when compiling with debugging.
14701 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14702 `SourceFile' argument instead of a string.
14703 (Driver.ProcessFile): Add all the files via Location.AddFile(),
14704 but don't parse/tokenize here, we need to generate the list of all
14705 source files before we do that.
14706 (Driver.ProcessFiles): New static function. Parses/tokenizes all
14709 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14710 instead of a string.
14712 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14715 2003-02-09 Martin Baulig <martin@ximian.com>
14717 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14718 filename on `#line default'.
14720 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14722 * statement.cs: don't clear the pinned var when the fixed statement
14723 returns from the method (fixes bug#37752).
14725 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14727 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
14730 2003-02-07 Martin Baulig <martin@ximian.com>
14732 * driver.cs: Removed the `--debug-args' command line argument.
14734 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14735 automatically by the AsssemblyBuilder.
14736 (CodeGen.InitializeSymbolWriter): We don't need to call any
14737 initialization function on the symbol writer anymore. This method
14738 doesn't take any arguments.
14740 2003-02-03 Miguel de Icaza <miguel@ximian.com>
14742 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14743 from referenced assemblies as well.
14745 2003-02-02 Martin Baulig <martin@ximian.com>
14747 * class.cs (MethodData.Emit): Generate debugging info for external methods.
14749 2003-02-02 Martin Baulig <martin@ximian.com>
14751 * class.cs (Constructor.Emit): Open the symbol writer before
14752 emitting the constructor initializer.
14753 (ConstructorInitializer.Emit): Call ec.Mark() to allow
14754 single-stepping through constructor initializers.
14756 2003-01-30 Miguel de Icaza <miguel@ximian.com>
14758 * class.cs: Handle error 549: do not allow virtual methods in
14761 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14763 * decl.cs: Check access levels when resolving types
14765 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14767 * statement.cs: Add parameters and locals set in catch blocks that might
14768 return to set vector
14770 2003-01-29 Miguel de Icaza <miguel@ximian.com>
14772 * class.cs (Operator): Set the SpecialName flags for operators.
14774 * expression.cs (Invocation.DoResolve): Only block calls to
14775 accessors and operators on SpecialName methods.
14777 (Cast.TryReduce): Handle conversions from char constants.
14780 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14782 * statement.cs: small memory and time optimization in FlowBranching.
14784 2003-01-28 Pedro Mart <yoros@wanadoo.es>
14786 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14787 problem that the last fix but in the other sid (Set).
14789 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14790 access when there is no indexer in the hierarchy.
14792 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14794 * class.cs: Combine some if statements.
14796 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14798 * driver.cs: fixed bug #37187.
14800 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
14802 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14803 any indexer, it's needed to build a list with all the indexers in the
14804 hierarchy (AllGetters), else we have problems. Fixes #35653.
14806 2003-01-23 Miguel de Icaza <miguel@ximian.com>
14808 * class.cs (MethodData.Define): It is wrong for an interface
14809 implementation to be static in both cases: explicit and implicit.
14810 We were only handling this in one case.
14812 Improve the if situation there to not have negations.
14814 * class.cs (Field.Define): Turns out that we do not need to check
14815 the unsafe bit on field definition, only on usage. Remove the test.
14817 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14819 * driver.cs: use assembly.Location instead of Codebase (the latest
14820 patch made mcs fail when using MS assemblies).
14822 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
14824 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14825 get the path to *corlib.dll.
14827 2003-01-21 Nick Drochak <ndrochak@gol.com>
14831 * typemanager.cs: Remove compiler warnings
14833 2003-01-20 Duncan Mak <duncan@ximian.com>
14835 * AssemblyInfo.cs: Bump the version number to 0.19.
14837 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14839 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14841 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
14843 * class.cs (Constructor::Emit): Emit debugging info for constructors.
14845 2003-01-17 Miguel de Icaza <miguel@ximian.com>
14847 * cs-parser.jay: Small fix: we were not comparing the constructor
14848 name correctly. Thanks to Zoltan for the initial pointer.
14850 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14852 * cs-tokenizer.cs: Set file name when specified with #line
14854 2003-01-15 Miguel de Icaza <miguel@ximian.com>
14856 * cs-parser.jay: Only perform the constructor checks here if we
14857 are named like the class; This will help provider a better
14858 error. The constructor path is taken when a type definition is
14859 not found, but most likely the user forgot to add the type, so
14860 report that rather than the constructor error.
14862 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14864 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14867 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14869 * cs-parser.jay: Add cleanup call.
14871 2003-01-13 Duncan Mak <duncan@ximian.com>
14873 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14874 consistent with other methods.
14876 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14878 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14880 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14882 * attribute.cs: only set GuidAttr to true when we have a
14885 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14889 * typemanager.cs: fixes to allow mcs compile corlib with the new
14890 Type.IsSubclassOf fix.
14892 2003-01-08 Miguel de Icaza <miguel@ximian.com>
14894 * expression.cs (LocalVariableReference.DoResolve): Classify a
14895 constant as a value, not as a variable. Also, set the type for
14898 * cs-parser.jay (fixed_statement): take a type instead of a
14899 pointer_type, so we can produce a better error message later.
14901 * statement.cs (Fixed.Resolve): Flag types that are not pointers
14904 (For.DoEmit): Make inifinite loops have a
14905 non-conditional branch back.
14907 (Fixed.DoEmit): First populate the pinned variables, then emit the
14908 statement, then clear the variables. Before I was emitting the
14909 code once for each fixed piece.
14912 2003-01-08 Martin Baulig <martin@ximian.com>
14914 * statement.cs (FlowBranching.MergeChild): A break in a
14915 SWITCH_SECTION does not leave a loop. Fixes #36155.
14917 2003-01-08 Martin Baulig <martin@ximian.com>
14919 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14920 lives in the same number space than `param_map'. Fixes #36154.
14922 2003-01-07 Miguel de Icaza <miguel@ximian.com>
14924 * cs-parser.jay (constructor_declaration): Set the
14925 Constructor.ModFlags before probing for it. This makes the
14926 compiler report 514, 515 and 132 (the code was there, but got
14929 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14930 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14931 (GotoCase.Resolve): Set `Returns' to ALWAYS.
14933 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14935 * enum.cs: create the enum static fields using the enum type.
14937 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14939 * class.cs: don't try to create the ParamBuilder for the return
14940 type if it's not needed (and handle it breaking for the ms runtime
14943 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14945 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14947 2002-12-29 Miguel de Icaza <miguel@ximian.com>
14949 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14950 the command. This showed up while compiling the JANET source
14951 code, which used \r as its only newline separator.
14953 2002-12-28 Miguel de Icaza <miguel@ximian.com>
14955 * class.cs (Method.Define): If we are an operator (because it
14956 reuses our code), then set the SpecialName and HideBySig. #36128
14958 2002-12-22 Miguel de Icaza <miguel@ximian.com>
14960 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14961 exception, report error 120 `object reference required'.
14963 * driver.cs: Add --pause option, used during to measure the size
14964 of the process as it goes with --timestamp.
14966 * expression.cs (Invocation.DoResolve): Do not allow methods with
14967 SpecialName to be invoked.
14969 2002-12-21 Miguel de Icaza <miguel@ximian.com>
14971 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14972 number before adding it.
14974 2002-12-21 Ravi Pratap <ravi@ximian.com>
14976 * ecore.cs (StandardImplicitConversion): When in an unsafe
14977 context, we allow conversion between void * to any other pointer
14978 type. This fixes bug #35973.
14980 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14982 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14983 is not thrown when extensionless outputs are used
14985 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14987 * rootcontext.cs: fixed compilation of corlib.
14989 2002-12-19 Miguel de Icaza <miguel@ximian.com>
14991 * attribute.cs (Attributes.Contains): Add new method.
14993 * class.cs (MethodCore.LabelParameters): if the parameter is an
14994 `out' parameter, check that no attribute `[In]' has been passed.
14996 * enum.cs: Handle the `value__' name in an enumeration.
14998 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
15000 * decl.cs: Added special case to allow overrides on "protected
15003 2002-12-18 Ravi Pratap <ravi@ximian.com>
15005 * attribute.cs (Attributes.AddAttributeSection): Rename to this
15006 since it makes much more sense.
15008 (Attributes.ctor): Don't require a Location parameter.
15010 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15012 * attribute.cs (ApplyAttributes): Remove extra Location parameters
15013 since we already have that information per attribute.
15015 * everywhere : make appropriate changes.
15017 * class.cs (LabelParameters): Write the code which actually
15018 applies attributes to the return type. We can't do this on the MS
15019 .NET runtime so we flag a warning in the case an exception is
15022 2002-12-18 Miguel de Icaza <miguel@ximian.com>
15024 * const.cs: Handle implicit null conversions here too.
15026 2002-12-17 Ravi Pratap <ravi@ximian.com>
15028 * class.cs (MethodCore.LabelParameters): Remove the extra
15029 Type [] parameter since it is completely unnecessary. Instead
15030 pass in the method's attributes so that we can extract
15031 the "return" attribute.
15033 2002-12-17 Miguel de Icaza <miguel@ximian.com>
15035 * cs-parser.jay (parse): Use Report.Error to flag errors instead
15036 of ignoring it and letting the compile continue.
15038 * typemanager.cs (ChangeType): use an extra argument to return an
15039 error condition instead of throwing an exception.
15041 2002-12-15 Miguel de Icaza <miguel@ximian.com>
15043 * expression.cs (Unary.TryReduce): mimic the code for the regular
15044 code path. Perform an implicit cast in the cases where we can
15045 implicitly convert to one of the integral types, and then reduce
15046 based on that constant. This fixes bug #35483.
15048 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15050 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15052 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15054 * namespace.cs: fixed bug #35489.
15056 2002-12-12 Miguel de Icaza <miguel@ximian.com>
15058 * class.cs: Remove some dead code.
15060 * cs-parser.jay: Estimate the number of methods needed
15061 (RootContext.MethodCount);
15063 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15064 numbers instead of StringBuilders.
15066 * support.cs (PtrHashtable): Add constructor with initial size;
15067 We can now reduce reallocations of the method table.
15069 2002-12-10 Ravi Pratap <ravi@ximian.com>
15071 * attribute.cs (ApplyAttributes): Keep track of the emitted
15072 attributes on a per-target basis. This fixes bug #35413.
15074 2002-12-10 Miguel de Icaza <miguel@ximian.com>
15076 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15077 default to the Windows 1252 encoding.
15079 (UnixParseOption): Support version, thanks to Alp for the missing
15082 * AssemblyInfo.cs: Add nice assembly information.
15084 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15087 * cs-parser.jay: Allow a trailing comma before the close bracked
15088 in the attribute_section production.
15090 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15091 address of the instance was being taken, I will take this out,
15092 because we take the address of the object immediately here.
15094 2002-12-09 Ravi Pratap <ravi@ximian.com>
15096 * typemanager.cs (AreMultipleAllowed): Take care of the most
15097 obvious case where attribute type is not in the current assembly -
15100 2002-12-08 Miguel de Icaza <miguel@ximian.com>
15102 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15103 definitions, instead of doing that afterwards.
15105 Also we use a nice little hack, depending on the constructor, we
15106 know if we are a "composed" name or a simple name. Hence, we
15107 avoid the IndexOf test, and we avoid
15109 * codegen.cs: Add code to assist in a bug reporter to track down
15110 the source of a compiler crash.
15112 2002-12-07 Ravi Pratap <ravi@ximian.com>
15114 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15115 types have been emitted for a given element and flag an error
15116 if something which does not have AllowMultiple set is used more
15119 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15120 attribute types and their corresponding AllowMultiple properties
15122 (AreMultipleAllowed): Check the property for a given type.
15124 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15125 property in the case we have a TypeContainer.
15127 (Attributes.AddAttribute): Detect duplicates and just skip on
15128 adding them. This trivial fix catches a pretty gross error in our
15129 attribute emission - global attributes were being emitted twice!
15131 Bugzilla bug #33187 is now fixed.
15133 2002-12-06 Miguel de Icaza <miguel@ximian.com>
15135 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15136 instead of pp_and).
15138 * expression.cs (Binary.ResolveOperator): I can only use the
15139 Concat (string, string, string) and Concat (string, string,
15140 string, string) if the child is actually a concatenation of
15143 2002-12-04 Miguel de Icaza <miguel@ximian.com>
15145 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15146 context where we need a 2-character lookahead.
15148 * pending.cs (PendingImplementation): Rework so we can keep track
15149 of interface types all the time, and flag those which were
15150 implemented by parents as optional.
15152 2002-12-03 Miguel de Icaza <miguel@ximian.com>
15154 * expression.cs (Binary.ResolveOperator): Use
15155 String.Concat(string,string,string) or
15156 String.Concat(string,string,string,string) when possible.
15158 * typemanager: More helper methods.
15161 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15163 * pending.cs: remove the bogus return from GetMissingInterfaces()
15164 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15166 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15168 * namespace.cs: avoid duplicated 'using xxx' being added to
15169 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15170 when we get more than one 'using' statement for the same namespace.
15171 Report a CS0105 warning for it.
15173 2002-11-30 Miguel de Icaza <miguel@ximian.com>
15175 * cs-tokenizer.cs (consume_identifier): use read directly, instead
15176 of calling getChar/putback, uses internal knowledge of it.
15178 (xtoken): Reorder tokenizer so most common patterns are checked
15179 first. This reduces the compilation time in another 5% (from 8.11s
15180 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15182 The parsing time is 22% of the compilation in mcs, and from that
15183 64% is spent on the tokenization process.
15185 I tried using a binary search for keywords, but this is slower
15186 than the hashtable. Another option would be to do a couple of
15189 * Not use a StringBuilder, instead use an array of chars,
15190 with a set value. Notice that this way we could catch
15191 the 645 error without having to do it *afterwards*.
15193 * We could write a hand-parser to avoid the hashtable
15194 compares altogether.
15196 The identifier consumption process takes 37% of the tokenization
15197 time. Another 15% is spent on is_number. 56% of the time spent
15198 on is_number is spent on Int64.Parse:
15200 * We could probably choose based on the string length to
15201 use Int32.Parse or Int64.Parse and avoid all the 64-bit
15204 Another 3% is spend on wrapping `xtoken' in the `token' function.
15206 Handle 0xa0 as whitespace (#34752)
15208 2002-11-26 Miguel de Icaza <miguel@ximian.com>
15210 * typemanager.cs (IsCLRType): New routine to tell whether a type
15211 is one of the builtin types.
15213 Maybe it needs to use TypeCodes to be faster. Maybe we could use
15214 typecode in more places instead of doing pointer comparissions.
15215 We could leverage some knowledge about the way the typecodes are
15218 New code to cache namespaces in assemblies, it is currently not
15219 invoked, to be used soon.
15221 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15223 * expression.cs (Binary.ResolveOperator): specially handle
15224 strings, and do not perform user-defined operator overloading for
15227 2002-11-24 Miguel de Icaza <miguel@ximian.com>
15229 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15230 internalcall as it is a pretty simple operation; Avoid whenever
15231 possible to call Char.IsLetter.
15233 (consume_identifier): Cut by half the number of
15234 hashtable calls by merging the is_keyword and GetKeyword behavior.
15236 Do not short-circuit, because if we do, we
15237 report errors (ie, #if false && true would produce an invalid
15241 2002-11-24 Martin Baulig <martin@ximian.com>
15243 * expression.cs (Cast.TryReduce): If we're in checked syntax,
15244 check constant ranges and report a CS0221. Fixes #33186.
15246 2002-11-24 Martin Baulig <martin@ximian.com>
15248 * cs-parser.jay: Make this work for uninitialized variable
15249 declarations in the `for' initializer. Fixes #32416.
15251 2002-11-24 Martin Baulig <martin@ximian.com>
15253 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15254 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
15256 2002-11-24 Martin Baulig <martin@ximian.com>
15258 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15259 argument; if true, we also check for user-defined conversions.
15260 This is only needed if both arguments are of a user-defined type.
15261 Fixes #30443, added test-175.cs.
15262 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15264 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15266 2002-11-24 Martin Baulig <martin@ximian.com>
15268 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15269 function to get the store opcode.
15270 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15271 only emit the Ldelema if the store opcode is Stobj. You must run
15272 both test-34 and test-167 to test this. Fixes #34529.
15274 2002-11-23 Martin Baulig <martin@ximian.com>
15276 * ecore.cs (Expression.MemberLookup): Added additional
15277 `qualifier_type' argument which is used when we're being called
15278 from MemberAccess.DoResolve() and null if we're called from a
15280 (Expression.MemberLookupFailed): New method to report errors; this
15281 does the CS1540 check and reports the correct error message.
15283 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15284 argument for the CS1540 check and redone the way how we're dealing
15285 with private members. See the comment in the source code for details.
15286 (FilterWithClosure): Reverted this back to revision 1.197; renamed
15287 `closure_start_type' to `closure_qualifier_type' and check whether
15288 it's not null. It was not this filter being broken, it was just
15289 being called with the wrong arguments.
15291 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15292 and pass it the correct `qualifier_type'; this also does the error
15295 2002-11-22 Miguel de Icaza <miguel@ximian.com>
15297 * expression.cs (Invocation.EmitParams): If the we are dealing
15298 with a non-built-in value type, load its address as well.
15300 (ArrayCreation): Use a a pretty constant instead
15301 of the hardcoded value 2. Use 6 instead of 2 for the number of
15302 static initializers.
15304 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15305 because they are not really value types, just glorified integers.
15307 * driver.cs: Do not append .exe, the CSC compiler does not do it.
15309 * ecore.cs: Remove redundant code for enumerations, make them use
15310 the same code path as everything else, fixes the casting issue
15311 with enumerations in Windows.Forms.
15313 * attribute.cs: Do only cast to string if it is a string, the
15314 validation happens later.
15316 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15317 people upgrade their corlibs.
15319 * ecore.cs: Oops, enumerations were not following the entire code path
15321 2002-11-21 Miguel de Icaza <miguel@ximian.com>
15323 * typemanager.cs (FilterWithClosure): Commented out the test for
15324 1540 in typemanager.cs, as it has problems when accessing
15325 protected methods from a parent class (see test-174.cs).
15327 * attribute.cs (Attribute.ValidateGuid): new method.
15328 (Attribute.Resolve): Use above.
15330 2002-11-19 Miguel de Icaza <miguel@ximian.com>
15332 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15334 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15335 handling for enumerations, as we only needed the TypeContainer
15336 functionality to begin with (this is required for the fix below to
15337 work for enums that reference constants in a container class for
15340 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15342 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15343 a valid TypeBuilder to perform lookups on.o
15345 * class.cs (InheritableMemberSignatureCompare): Use true in the
15346 call to GetGetMethod and GetSetMethod, because we are comparing
15347 the signature, and we need to get the methods *even* if they are
15350 (PropertyBase.CheckBase): ditto.
15352 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15353 GotoCase.Resolve): Use Peel on EmpytCasts.
15355 * ecore.cs (EmptyCast): drop child, add Peel method.
15357 2002-11-17 Martin Baulig <martin@ximian.com>
15359 * ecore.cs (EmptyCast.Child): New public property.
15361 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15362 label resolved to an EmptyCast. Fixes #34162.
15363 (GotoCase.Resolve): Likewise.
15364 (Block.EmitMeta): Likewise.
15366 2002-11-17 Martin Baulig <martin@ximian.com>
15368 * expression.cs (Invocation.BetterConversion): Prefer int over
15369 uint; short over ushort; long over ulong for integer literals.
15370 Use ImplicitConversionExists instead of StandardConversionExists
15371 since we also need to check for user-defined implicit conversions.
15372 Fixes #34165. Added test-173.cs.
15374 2002-11-16 Martin Baulig <martin@ximian.com>
15376 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15377 with the `true' and `false' literals. Fixes #33151.
15379 2002-11-16 Martin Baulig <martin@ximian.com>
15381 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15382 October 22nd; don't do the cs1540 check for static members.
15384 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15385 now using our own filter here and doing the cs1540 check again.
15387 2002-11-16 Martin Baulig <martin@ximian.com>
15389 * support.cs (InternalParameters): Don't crash if we don't have
15390 any fixed parameters. Fixes #33532.
15392 2002-11-16 Martin Baulig <martin@ximian.com>
15394 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15395 when looking up static methods to make this work on Windows.
15398 2002-11-16 Martin Baulig <martin@ximian.com>
15400 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15401 a setter rather than using PropertyInfo.CanWrite.
15403 2002-11-15 Nick Drochak <ndrochak@gol.com>
15405 * class.cs: Allow acces to block member by subclasses. Fixes build
15408 2002-11-14 Martin Baulig <martin@ximian.com>
15410 * class.cs (Constructor.Emit): Added the extern/block check.
15413 2002-11-14 Martin Baulig <martin@ximian.com>
15415 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15416 iteration while looking for indexers, this is needed because the
15417 indexer may have a different name in our base classes. Fixed the
15418 error reporting (no indexers at all, not get accessor, no
15419 overloaded match). Fixes bug #33089.
15420 (IndexerAccess.DoResolveLValue): Likewise.
15422 2002-11-14 Martin Baulig <martin@ximian.com>
15424 * class.cs (PropertyBase.CheckBase): Make this work for multiple
15425 indexers. Fixes the first part of bug #33089.
15426 (MethodSignature.InheritableMemberSignatureCompare): Added support
15429 2002-11-13 Ravi Pratap <ravi@ximian.com>
15431 * attribute.cs (Attribute.Resolve): Catch the
15432 NullReferenceException and report it since it isn't supposed to
15435 2002-11-12 Miguel de Icaza <miguel@ximian.com>
15437 * expression.cs (Binary.EmitBranchable): Also handle the cases for
15438 LogicalOr and LogicalAnd that can benefit from recursively
15439 handling EmitBranchable. The code now should be nice for Paolo.
15441 2002-11-08 Miguel de Icaza <miguel@ximian.com>
15443 * typemanager.cs (LookupType): Added a negative-hit hashtable for
15444 the Type lookups, as we perform quite a number of lookups on
15445 non-Types. This can be removed once we can deterministically tell
15446 whether we have a type or a namespace in advance.
15448 But this might require special hacks from our corlib.
15452 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15453 and double which avoids a conversion from an integer to a double.
15455 * expression.cs: tiny optimization, avoid calling IsConstant,
15456 because it effectively performs the lookup twice.
15458 2002-11-06 Miguel de Icaza <miguel@ximian.com>
15460 But a bogus return here to keep the semantics of the old code
15461 until the Mono runtime is fixed.
15463 * pending.cs (GetMissingInterfaces): New method used to remove all
15464 the interfaces that are already implemented by our parent
15465 classes from the list of pending methods.
15467 * interface.cs: Add checks for calls after ResolveTypeExpr.
15469 2002-11-05 Miguel de Icaza <miguel@ximian.com>
15471 * class.cs (Class.Emit): Report warning 67: event not used if the
15472 warning level is beyond 3.
15474 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15475 being a NullLiteral.
15477 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15480 * class.cs (TypeContainer.GetClassBases): Cover a missing code
15481 path that might fail if a type can not be resolved.
15483 * expression.cs (Binary.Emit): Emit unsigned versions of the
15486 * driver.cs: use error 5.
15488 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15490 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15492 2002-11-01 Miguel de Icaza <miguel@ximian.com>
15494 * cs-parser.jay (switch_section): A beautiful patch from Martin
15495 Baulig that fixed 33094.
15497 2002-10-31 Miguel de Icaza <miguel@ximian.com>
15499 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15500 Check whether the base is abstract and report an error if so.
15502 * expression.cs (IndexerAccess.DoResolveLValue,
15503 IndexerAccess.DoResolve): ditto.
15505 (Invocation.DoResolve): ditto.
15507 (Invocation.FullMethodDesc): Improve the report string.
15509 * statement.cs (Block): Eliminate IsVariableDefined as it is
15510 basically just a wrapper for GetVariableInfo.
15512 * ecore.cs (SimpleName): Use new
15514 * support.cs (ReflectionParamter.ParameterType): We unwrap the
15515 type, as we return the actual parameter ref/unref state on a
15518 2002-10-30 Miguel de Icaza <miguel@ximian.com>
15520 * support.cs: Return proper flags REF/OUT fixing the previous
15523 * expression.cs: Reverted last patch, that was wrong. Is_ref is
15524 not used to mean `ref' but `ref or out' in ParameterReference
15526 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15527 full type signature instead of calling TypeManger.CSharpName
15530 * support.cs (InternalParameters.ParameterDesc): Do not compare
15531 directly to the modflags, because REF/OUT will actually be bitsets
15534 * delegate.cs (VerifyMethod): Check also the modifiers.
15536 * cs-tokenizer.cs: Fix bug where floating point values with an
15537 exponent where a sign was missing was ignored.
15539 * driver.cs: Allow multiple assemblies to be specified in a single
15542 2002-10-28 Miguel de Icaza <miguel@ximian.com>
15544 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
15545 because identifiers after a parenthesis would end up in this kind
15546 of production, and we needed to desamiguate it for having casts
15549 (UserDefinedType *) xxx
15551 2002-10-24 Miguel de Icaza <miguel@ximian.com>
15553 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15554 we should set on the Bindingflags.NonPublic, but not turn on
15555 private_ok. private_ok controls whether a Private member is
15556 returned (this is chekced on the filter routine), while the
15557 BindingFlags.NonPublic just controls whether private/protected
15558 will be allowed. This fixes the problem part of the problem of
15559 private properties being allowed to be used in derived classes.
15561 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15562 so we can call the children DoResolveLValue method (this will
15563 properly signal errors on lvalue assignments to base properties)
15565 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15566 getter are null, and we have a property info, we know that this
15567 happened because the lookup failed, so we report an error 122 for
15568 protection level violation.
15570 We also silently return if setter and getter are null in the
15571 resolve functions, this condition only happens if we have flagged
15572 the error before. This is the other half of the problem.
15574 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15575 not have accessibility information, that is why we were returning
15576 true in the filter function in typemanager.cs.
15578 To properly report 122 (property is inaccessible because of its
15579 protection level) correctly, we report this error in ResolveAccess
15580 by failing if both the setter and the getter are lacking (ie, the
15583 DoResolve and DoLResolve have been modified to check for both
15584 setter/getter being null and returning silently, the reason being
15585 that I did not want to put the knowledge about this error in upper
15588 int old = Report.Errors;
15589 x = new PropertyExpr (...);
15590 if (old != Report.Errors)
15595 So the property expr is returned, but it is invalid, so the error
15596 will be flagged during the resolve process.
15598 * class.cs: Remove InheritablePropertySignatureCompare from the
15599 class, as we no longer depend on the property signature to compute
15600 whether it is possible to implement a method or not.
15602 The reason is that calling PropertyInfo.GetGetMethod will return
15603 null (in .NET, in Mono it works, and we should change this), in
15604 cases where the Get Method does not exist in that particular
15609 class X { public virtual int A { get { return 1; } } }
15611 class Z : Y { public override int A { get { return 2; } } }
15613 Would fail in Z because the parent (Y) would not have the property
15614 defined. So we avoid this completely now (because the alternative
15615 fix was ugly and slow), and we now depend exclusively on the
15618 (PropertyBase.CheckBase): Use a method-base mechanism to find our
15619 reference method, instead of using the property.
15621 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15622 routines are gone now.
15624 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15625 names, they were incorrectly named.
15627 * cs-tokenizer.cs: Return are more gentle token on failure.
15629 * pending.cs (PendingImplementation.InterfaceMethod): This routine
15630 had an out-of-sync index variable, which caused it to remove from
15631 the list of pending methods the wrong method sometimes.
15633 2002-10-22 Miguel de Icaza <miguel@ximian.com>
15635 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15636 CanWrite, because those refer to this particular instance of the
15637 property, and do not take into account the fact that we can
15638 override single members of a property.
15640 Constructor requires an EmitContext. The resolution process does
15641 not happen here, but we need to compute the accessors before,
15642 because the resolution does not always happen for properties.
15644 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15645 subclass, before we did not update this flag, but we did update
15648 (GetAccessors): Drop this routine, as it did not work in the
15649 presence of partially overwritten set/get methods.
15651 Notice that this broke the cs1540 detection, but that will require
15654 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15658 * driver.cs: issue a warning instead of an error if we don't support
15659 debugging for the platform. Also ignore a couple of errors that may
15660 arise when trying to write the symbols. Undo my previous patch.
15662 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15664 * driver.cs: ignore /debug switch except for Unix platforms.
15666 2002-10-23 Nick Drochak <ndrochak@gol.com>
15668 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15670 2002-10-21 Miguel de Icaza <miguel@ximian.com>
15672 * driver.cs: Do not make mcs-debug conditional, so we do not break
15673 builds that use it.
15675 * statement.cs (UsageVector.MergeChildren): I would like Martin to
15676 review this patch. But basically after all the children variables
15677 have been merged, the value of "Breaks" was not being set to
15678 new_breaks for Switch blocks. I think that it should be set after
15679 it has executed. Currently I set this to the value of new_breaks,
15680 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15681 conservative, but I do not understand this code very well.
15683 I did not break anything in the build, so that is good ;-)
15685 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15687 2002-10-20 Mark Crichton <crichton@gimp.org>
15689 * cfold.cs: Fixed compile blocker. Really fixed it this time.
15691 2002-10-20 Nick Drochak <ndrochak@gol.com>
15693 * cfold.cs: Fixed compile blocker.
15695 2002-10-20 Miguel de Icaza <miguel@ximian.com>
15697 * driver.cs: I was chekcing the key, not the file.
15699 2002-10-19 Ravi Pratap <ravi@ximian.com>
15701 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15702 message that we were generating - we just need to silently return
15705 2002-10-19 Miguel de Icaza <miguel@ximian.com>
15707 * class.cs (Event.Define): Change my previous commit, as this
15708 breaks the debugger. This is a temporary hack, as it seems like
15709 the compiler is generating events incorrectly to begin with.
15711 * expression.cs (Binary.ResolveOperator): Added support for
15712 "U operator - (E x, E y)"
15714 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15717 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15718 init-only variables, but this path did not take into account that
15719 there might be also instance readonly variables. Correct this
15722 This fixes bug 32253
15724 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15727 * driver.cs: Change the extension for modules to `netmodule'
15729 * cs-parser.jay: Improved slightly the location tracking for
15730 the debugger symbols.
15732 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15733 modifiers that were specified instead of the hardcoded value
15734 (FamAndAssem). This was basically ignoring the static modifier,
15735 and others. Fixes 32429.
15737 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15738 fixed a bug in the process (32476)
15740 * expression.cs (ArrayAccess.EmitAssign): Patch from
15741 hwang_rob@yahoo.ca that fixes bug 31834.3
15743 2002-10-18 Miguel de Icaza <miguel@ximian.com>
15745 * driver.cs: Make the module extension .netmodule.
15747 2002-10-16 Miguel de Icaza <miguel@ximian.com>
15749 * driver.cs: Report an error if the resource file is not found
15750 instead of crashing.
15752 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15753 false, like Emit does.
15755 2002-10-16 Nick Drochak <ndrochak@gol.com>
15757 * typemanager.cs: Remove unused private member. Also reported mcs
15758 bug to report this as a warning like csc.
15760 2002-10-15 Martin Baulig <martin@gnome.org>
15762 * statement.cs (Statement.Emit): Made this a virtual method; emits
15763 the line number info and calls DoEmit().
15764 (Statement.DoEmit): New protected abstract method, formerly knows
15765 as Statement.Emit().
15767 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15769 2002-10-11 Miguel de Icaza <miguel@ximian.com>
15771 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15772 have fixed a remaining problem: not every AddXXXX was adding a
15773 fully qualified name.
15775 Now everyone registers a fully qualified name in the DeclSpace as
15776 being defined instead of the partial name.
15778 Downsides: we are slower than we need to be due to the excess
15779 copies and the names being registered this way.
15781 The reason for this is that we currently depend (on the corlib
15782 bootstrap for instance) that types are fully qualified, because
15783 we dump all the types in the namespace, and we should really have
15784 types inserted into the proper namespace, so we can only store the
15785 basenames in the defined_names array.
15787 2002-10-10 Martin Baulig <martin@gnome.org>
15789 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15790 from bug #31834, see the bug report for a testcase which is
15793 2002-10-10 Martin Baulig <martin@gnome.org>
15795 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15796 flow analysis code for this.
15798 * statement.cs (Do, While, For): Tell the flow analysis code about
15800 (FlowBranching.UsageVector): Added support for infinite loops.
15801 (Block.Resolve): Moved the dead code elimination here and use flow
15804 2002-10-09 Miguel de Icaza <miguel@ximian.com>
15806 * class.cs (Field.Define): Catch cycles on struct type
15809 * typemanager.cs (IsUnmanagedtype): Do not recursively check
15810 fields if the fields are static. We only need to check instance
15813 * expression.cs (As.DoResolve): Test for reference type.
15815 * statement.cs (Using.ResolveExpression): Use
15816 ConvertImplicitRequired, not ConvertImplicit which reports an
15818 (Using.ResolveLocalVariableDecls): ditto.
15820 * expression.cs (Binary.ResolveOperator): Report errors in a few
15821 places where we had to.
15823 * typemanager.cs (IsUnmanagedtype): Finish implementation.
15825 2002-10-08 Miguel de Icaza <miguel@ximian.com>
15827 * expression.cs: Use StoreFromPtr instead of extracting the type
15828 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
15830 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15831 an enumeration value to a System.Enum, but System.Enum is not a
15832 value type, but an class type, so we need to box.
15834 (Expression.ConvertExplicit): One codepath could return
15835 errors but not flag them. Fix this. Fixes #31853
15837 * parameter.cs (Resolve): Do not allow void as a parameter type.
15839 2002-10-06 Martin Baulig <martin@gnome.org>
15841 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15842 if it's a class type and not a struct. Fixes #31815.
15844 2002-10-06 Martin Baulig <martin@gnome.org>
15846 * statement.cs: Reworked the flow analysis code a bit to make it
15847 usable for dead code elimination.
15849 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15851 * cs-parser.jay: allow empty source files. Fixes bug #31781.
15853 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15855 * expression.cs (ComposedCast.DoResolveType): A quick workaround
15856 to fix the test 165, will investigate deeper.
15858 2002-10-04 Martin Baulig <martin@gnome.org>
15860 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15861 finally blocks actually work.
15862 (Try.Resolve): We don't need to create a sibling for `finally' if
15863 there is no finally block.
15865 2002-10-04 Martin Baulig <martin@gnome.org>
15867 * class.cs (Constructor.Define): The default accessibility for a
15868 non-default constructor is private, not public.
15870 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15872 * class.cs (Constructor): Make AllowedModifiers public, add
15875 * cs-parser.jay: Perform the modifiers test here, as the
15876 constructor for the Constructor class usually receives a zero
15877 because of the way we create it (first we create, later we
15878 customize, and we were never checking the modifiers).
15880 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15881 is a version of LookupTypeReflection that includes the type-name
15882 cache. This can be used as a fast path for functions that know
15883 the fully qualified name and are only calling into *.GetType() to
15884 obtain a composed type.
15886 This is also used by TypeManager.LookupType during its type
15889 (LookupType): We now also track the real type name, as sometimes
15890 we can get a quey for the real type name from things like
15891 ComposedCast. This fixes bug 31422.
15893 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15894 complete type fullname, it does not have to go through the type
15895 resolution system to obtain the composed version of the type (for
15896 obtaining arrays or pointers).
15898 (Conditional.Emit): Use the EmitBoolExpression to
15899 generate nicer code, as requested by Paolo.
15901 (ArrayCreation.CheckIndices): Use the patch from
15902 hwang_rob@yahoo.ca to validate the array initializers.
15904 2002-10-03 Miguel de Icaza <miguel@ximian.com>
15906 * class.cs (ConstructorInitializer.Emit): simplify code by using
15907 Invocation.EmitCall, and at the same time, fix the bugs in calling
15908 parent constructors that took variable arguments.
15910 * ecore.cs (Expression.ConvertNumericExplicit,
15911 Expression.ImplicitNumericConversion): Remove the code that
15912 manually wrapped decimal (InternalTypeConstructor call is now gone
15915 * expression.cs (Cast.TryReduce): Also handle decimal types when
15916 trying to perform a constant fold on the type.
15918 * typemanager.cs (IsUnmanagedtype): Partially implemented.
15920 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15921 that only turned off an error report, and did nothing else.
15923 2002-10-02 Miguel de Icaza <miguel@ximian.com>
15925 * driver.cs: Handle and ignore /fullpaths
15927 2002-10-01 Miguel de Icaza <miguel@ximian.com>
15929 * expression.cs (Binary.ResolveOperator): Catch the case where
15930 DoNumericPromotions returns true,
15932 (Binary.DoNumericPromotions): Simplify the code, and the tests.
15934 2002-09-27 Miguel de Icaza <miguel@ximian.com>
15936 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15939 2002-09-26 Miguel de Icaza <miguel@ximian.com>
15941 * ecore.cs (ConvertNumericExplicit): It is not enough that the
15942 conversion exists, but it is also required that the conversion be
15943 performed. This manifested in "(Type64Enum) 2".
15945 * class.cs (TypeManager.AddMethod): The fix is not to change
15946 AddEnum, because that one was using a fully qualified name (every
15947 DeclSpace derivative does), but to change the AddMethod routine
15948 that was using an un-namespaced name. This now correctly reports
15949 the duplicated name.
15951 Revert patch until I can properly fix it. The issue
15952 is that we have a shared Type space across all namespaces
15953 currently, which is wrong.
15955 Options include making the Namespace a DeclSpace, and merge
15956 current_namespace/current_container in the parser.
15958 2002-09-25 Miguel de Icaza <miguel@ximian.com>
15960 * cs-parser.jay: Improve error reporting when we get a different
15961 kind of expression in local_variable_type and
15962 local_variable_pointer_type.
15964 Propagate this to avoid missleading errors being reported.
15966 * ecore.cs (ImplicitReferenceConversion): treat
15967 TypeManager.value_type as a target just like object_type. As
15972 Is valid, and needs to result in the int 1 being boxed before it
15973 is assigned to the value type v.
15975 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15976 to validate the enumeration name.
15978 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15979 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
15980 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15982 * ecore.cs (TryImplicitIntConversion): When doing an
15983 implicit-enumeration-conversion, check if the type is 64-bits and
15984 perform a conversion before passing to EnumConstant.
15986 2002-09-23 Miguel de Icaza <miguel@ximian.com>
15988 * decl.cs (Error_AmbiguousTypeReference); New routine used to
15989 report ambiguous type references. Unlike the MS version, we
15990 report what the ambiguity is. Innovation at work ;-)
15992 (DeclSpace.FindType): Require a location argument to
15993 display when we display an ambiguous error.
15995 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15997 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15999 * expression.cs (EmitDynamicInitializers): Apply patch from
16000 hwang_rob@yahoo.ca that fixes the order in which we emit our
16003 2002-09-21 Martin Baulig <martin@gnome.org>
16005 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16006 delegate takes no arguments.
16008 2002-09-20 Miguel de Icaza <miguel@ximian.com>
16010 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16013 * expression.cs: Extract the underlying type.
16015 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16017 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16019 2002-09-19 Miguel de Icaza <miguel@ximian.com>
16021 * class.cs (TypeContainer.DefineType): We can not use the nice
16022 PackingSize with the size set to 1 DefineType method, because it
16023 will not allow us to define the interfaces that the struct
16026 This completes the fixing of bug 27287
16028 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16029 means also structs. This fixes part of the problem.
16030 (Expresion.ImplicitReferenceConversionExists): ditto.
16032 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16033 error if there were no errors reported during the type lookup
16034 process, to avoid duplicates or redundant errors. Without this
16035 you would get an ambiguous errors plus a type not found. We have
16036 beaten the user enough with the first error.
16038 (DeclSparce.FindType): Emit a warning if we have an ambiguous
16041 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16042 during the resolution process, stop the lookup, this avoids
16043 repeated error reports (same error twice).
16045 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16047 * typemanager.cs (LookupType): Redo the type lookup code to match
16048 the needs of System.Reflection.
16050 The issue is that System.Reflection requires references to nested
16051 types to begin with a "+" sign instead of a dot. So toplevel
16052 types look like: "NameSpace.TopLevelClass", and nested ones look
16053 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16056 2002-09-19 Martin Baulig <martin@gnome.org>
16058 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16059 says that a method always returns or always throws an exception,
16060 don't report the CS0161.
16062 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16063 set `Returns = new_returns'.
16065 2002-09-19 Martin Baulig <martin@gnome.org>
16067 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16068 to an enum constant, check for a CS0176.
16070 2002-09-18 Miguel de Icaza <miguel@ximian.com>
16072 * class.cs (TypeContainer.CheckPairedOperators): Now we check
16073 for operators that must be in pairs and report errors.
16075 * ecore.cs (SimpleName.DoResolveType): During the initial type
16076 resolution process, when we define types recursively, we must
16077 check first for types in our current scope before we perform
16078 lookups in the enclosing scopes.
16080 * expression.cs (MakeByteBlob): Handle Decimal blobs.
16082 (Invocation.VerifyArgumentsCompat): Call
16083 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16084 I thought we were supposed to always call this, but there are a
16085 few places in the code where we dont do it.
16087 2002-09-17 Miguel de Icaza <miguel@ximian.com>
16089 * driver.cs: Add support in -linkres and -resource to specify the
16090 name of the identifier.
16092 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16094 * ecore.cs (StandardConversionExists): Sync with the conversion
16095 code: allow anything-* to void* conversions.
16097 (FindMostSpecificSource): Use an Expression argument
16098 instead of a Type, because we might be handed over a Literal which
16099 gets a few more implicit conversions that plain types do not. So
16100 this information was being lost.
16102 Also, we drop the temporary type-holder expression when not
16105 2002-09-17 Martin Baulig <martin@gnome.org>
16107 * class.cs (PropertyBase.CheckBase): Don't check the base class if
16108 this is an explicit interface implementation.
16110 2002-09-17 Martin Baulig <martin@gnome.org>
16112 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16113 different `IndexerName' attributes.
16115 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16116 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16117 virtual CommonResolve().
16119 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16121 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16122 and convert that to the UnderlyingType.
16124 * statement.cs (Foreach.Resolve): Indexers are just like variables
16125 or PropertyAccesses.
16127 * cs-tokenizer.cs (consume_string): Track line numbers and columns
16128 inside quoted strings, we were not doing this before.
16130 2002-09-16 Martin Baulig <martin@gnome.org>
16132 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16133 resolve it. This is needed for the definite assignment check of the
16134 instance expression, fixes bug #29846.
16135 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16137 2002-09-16 Nick Drochak <ndrochak@gol.com>
16139 * parameter.cs: Fix compile error. Cannot reference static member
16140 from an instance object. Is this an mcs bug?
16142 2002-09-14 Martin Baulig <martin@gnome.org>
16144 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16145 multiple times. Fixes bug #30295, added test-166.cs.
16147 2002-09-14 Martin Baulig <martin@gnome.org>
16149 * statement.cs (Block.Emit): Don't emit unreachable code.
16150 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16151 `break' statements.
16152 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16154 2002-09-14 Martin Baulig <martin@gnome.org>
16156 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16159 2002-09-14 Martin Baulig <martin@gnome.org>
16161 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16162 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16163 be false on the ms runtime.
16165 2002-09-13 Martin Baulig <martin@gnome.org>
16167 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16168 the CS0038 error message.
16170 2002-09-12 Miguel de Icaza <miguel@ximian.com>
16172 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16173 constant inside, return it.
16175 2002-09-12 Martin Baulig <martin@gnome.org>
16177 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16178 implicit conversion can be done between enum types.
16180 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16181 check whether an implicit conversion to the current enum's UnderlyingType
16182 exists and report an error if not.
16184 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16185 without debugging support.
16187 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16188 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
16190 2002-09-12 Martin Baulig <martin@gnome.org>
16192 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16194 * ecore.cs (IMemberExpr.DeclaringType): New property.
16195 (SimpleName.SimpleNameResolve): Check whether we're accessing a
16196 nonstatic member of an outer type (CS0038).
16198 2002-09-11 Miguel de Icaza <miguel@ximian.com>
16200 * driver.cs: Activate the using-error detector at warning level
16201 4 (at least for MS-compatible APIs).
16203 * namespace.cs (VerifyUsing): Small buglett fix.
16205 * pending.cs (PendingImplementation): pass the container pointer.
16207 * interface.cs (GetMethods): Allow for recursive definition. Long
16208 term, I would like to move every type to support recursive
16209 definitions, not the current ordering mechanism that we have right
16212 The situation is this: Attributes are handled before interfaces,
16213 so we can apply attributes to interfaces. But some attributes
16214 implement interfaces, we will now handle the simple cases
16215 (recursive definitions will just get an error).
16217 * parameter.cs: Only invalidate types at the end if we fail to
16220 2002-09-09 Martin Baulig <martin@gnome.org>
16222 * ecore.cs (PropertyExpr.Emit): Also check for
16223 TypeManager.system_int_array_get_length so this'll also work when
16224 compiling corlib. Fixes #30003.
16226 2002-09-09 Martin Baulig <martin@gnome.org>
16228 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16229 and throw an exception if we can't get the type's size. Fixed #30040,
16232 2002-09-09 Martin Baulig <martin@gnome.org>
16234 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16236 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16237 context. Fixes bug #30027.
16239 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16240 virtual functions. Fixes bug #30043, added test-164.cs.
16242 2002-09-08 Ravi Pratap <ravi@ximian.com>
16244 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16246 2002-09-08 Nick Drochak <ndrochak@gol.com>
16248 * driver.cs: Use an object to get the windows codepage since it's not a
16251 2002-09-08 Miguel de Icaza <miguel@ximian.com>
16253 * statement.cs (For.Emit): for infinite loops (test == null)
16254 return whether there is a break inside, not always "true".
16256 * namespace.cs (UsingEntry): New struct to hold the name of the
16257 using definition, the location where it is defined, and whether it
16258 has been used in a successful type lookup.
16260 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16265 2002-09-06 Ravi Pratap <ravi@ximian.com>
16267 * attribute.cs : Fix incorrect code which relied on catching
16268 a NullReferenceException to detect a null being passed in
16269 where an object was expected.
16271 2002-09-06 Miguel de Icaza <miguel@ximian.com>
16273 * statement.cs (Try): flag the catch variable as assigned
16275 * expression.cs (Cast): Simplified by using ResolveType instead of
16276 manually resolving.
16278 * statement.cs (Catch): Fix bug by using ResolveType.
16280 2002-09-06 Ravi Pratap <ravi@ximian.com>
16282 * expression.cs (BetterConversion): Special case for when we have
16283 a NullLiteral as the argument and we have to choose between string
16284 and object types - we choose string the way csc does.
16286 * attribute.cs (Attribute.Resolve): Catch the
16287 NullReferenceException and report error #182 since the Mono
16288 runtime no more has the bug and having this exception raised means
16289 we tried to select a constructor which takes an object and is
16292 2002-09-05 Ravi Pratap <ravi@ximian.com>
16294 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16295 message (1502, 1503) when we can't locate a method after overload
16296 resolution. This is much more informative and closes the bug
16299 * interface.cs (PopulateMethod): Return if there are no argument
16300 types. Fixes a NullReferenceException bug.
16302 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16303 expressions too. Previously we were checking only in one place for
16304 positional arguments leaving out named arguments.
16306 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16307 type to the enum type is not allowed. Remove code corresponding to
16310 (ConvertNumericExplicit): Allow explicit conversions from
16311 the underlying type to enum type. This precisely follows the spec
16312 and closes a bug filed by Gonzalo.
16314 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16317 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16319 2002-09-03 Miguel de Icaza <miguel@ximian.com>
16321 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16322 it was important that we stored the right value after the
16323 reduction in `converted'.
16325 2002-09-04 Martin Baulig <martin@gnome.org>
16327 * location.cs (Location.SymbolDocument): Use full pathnames for the
16330 2002-08-30 Miguel de Icaza <miguel@ximian.com>
16332 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16333 of the expression resolve mechanism, because that will catch the
16334 SimpleName error failures.
16336 (Conditional): If we can not resolve the
16337 expression, return, do not crash.
16339 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16342 (location): display token name instead of its number.
16344 2002-08-28 Martin Baulig <martin@gnome.org>
16346 * expression.cs (Binary.ResolveOperator): Don't silently return
16347 but return an error if an operator cannot be applied between two
16350 2002-08-28 Martin Baulig <martin@gnome.org>
16352 * class.cs (Constructor.Define): Set the permission attributes
16353 correctly instead of making all constructors public.
16355 2002-08-28 Martin Baulig <martin@gnome.org>
16357 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16358 for private members before reporting a CS0103; if we find anything,
16361 2002-08-28 Martin Baulig <martin@gnome.org>
16363 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16364 to check whether `closure_start_type == closure_invocation_type',
16365 we also need to check whether `m.DeclaringType == closure_invocation_type'
16366 before bypassing the permission checks. We might be accessing
16367 protected/private members from the base class.
16368 (TypeManager.RealMemberLookup): Only set private_ok if private
16369 members were requested via BindingFlags.NonPublic.
16371 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16373 * expression.cs (MemberAccess.ResolveMemberAccess): Set
16374 MethodGroupExpr.IsExplicitImpl if appropriate.
16375 (Invocation.DoResolve): Don't report the CS0120 for explicit
16376 interface implementations.
16378 2002-08-27 Martin Baulig <martin@gnome.org>
16380 * expression.cs (Invocation.DoResolve): If this is a static
16381 method and we don't have an InstanceExpression, we must report
16384 2002-08-25 Martin Baulig <martin@gnome.org>
16386 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16387 `==' between a valuetype and an object.
16389 2002-08-25 Miguel de Icaza <miguel@ximian.com>
16391 * ecore.cs (TypeExpr): Provide a ToString method.
16393 2002-08-24 Martin Baulig <martin@gnome.org>
16395 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16396 now called proggie.dbg and it's a binary file.
16398 2002-08-23 Martin Baulig <martin@gnome.org>
16400 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16402 2002-08-23 Martin Baulig <martin@gnome.org>
16404 * struct.cs (MyStructInfo.ctor): Make this work with empty
16405 structs; it's not allowed to use foreach() on null.
16407 2002-08-23 Martin Baulig <martin@gnome.org>
16409 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16410 writer the full pathname of the generated assembly.
16412 2002-08-23 Martin Baulig <martin@gnome.org>
16414 * statements.cs (FlowBranching.UsageVector.MergeChildren):
16415 A `finally' block never returns or breaks; improved handling of
16418 2002-08-23 Martin Baulig <martin@gnome.org>
16420 * statement.cs (Throw.Resolve): Allow `throw null'.
16422 2002-08-23 Martin Baulig <martin@gnome.org>
16424 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16425 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16426 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
16427 MemberLookup would return a wrong event if this is an explicit
16428 interface implementation and the class has an event with the same
16431 2002-08-23 Martin Baulig <martin@gnome.org>
16433 * statement.cs (Block.AddChildVariableNames): New public method.
16434 (Block.AddChildVariableName): Likewise.
16435 (Block.IsVariableNameUsedInChildBlock): Likewise.
16436 (Block.AddVariable): Check whether a variable name has already
16437 been used in a child block.
16439 * cs-parser.jay (declare_local_variables): Mark all variable names
16440 from the current block as being used in a child block in the
16443 2002-08-23 Martin Baulig <martin@gnome.org>
16445 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16446 find the symbol writer.
16448 * driver.cs: csc also allows the arguments to /define being
16449 separated by commas, not only by semicolons.
16451 2002-08-23 Martin Baulig <martin@gnome.org>
16453 * interface.cs (Interface.GetMembers): Added static check for events.
16455 2002-08-15 Martin Baulig <martin@gnome.org>
16457 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16458 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16460 * ecore.cs (Expression.MemberLookup): Added documentation and explained
16461 why the MethodData.EmitDestructor() change was necessary.
16463 2002-08-20 Martin Baulig <martin@gnome.org>
16465 * class.cs (TypeContainer.FindMembers): Added static check for events.
16467 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16469 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16470 use Type.GetEvents(), not Type.FindMembers().
16472 2002-08-20 Martin Baulig <martin@gnome.org>
16474 * decl.cs (MemberCache): Added a special method cache which will
16475 be used for method-only searched. This ensures that a method
16476 search will return a MethodInfo with the correct ReflectedType for
16479 2002-08-20 Martin Baulig <martin@gnome.org>
16481 * decl.cs (DeclSpace.FindMembers): Made this public.
16483 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16485 * delegate.cs: fixed build on windows.
16486 [FIXME: Filed as bug #29150: MCS must report these errors.]
16488 2002-08-19 Ravi Pratap <ravi@ximian.com>
16490 * ecore.cs (StandardConversionExists): Return a false
16491 if we are trying to convert the void type to anything else
16492 since that is not allowed.
16494 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16495 we flag error 70 in the event an event is trying to be accessed
16496 directly from outside the declaring type.
16498 2002-08-20 Martin Baulig <martin@gnome.org>
16500 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16501 MemberCache from typemanager.cs to decl.cs.
16503 2002-08-19 Martin Baulig <martin@gnome.org>
16505 * class.cs (TypeContainer): Implement IMemberContainer.
16506 (TypeContainer.DefineMembers): Create the MemberCache.
16507 (TypeContainer.FindMembers): Do better BindingFlags checking; only
16508 return public members if BindingFlags.Public was given, check
16509 whether members are static.
16511 2002-08-16 Martin Baulig <martin@gnome.org>
16513 * decl.cs (DeclSpace.Define): Splitted this in Define and
16514 DefineMembers. DefineMembers is called first and initializes the
16517 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
16518 DefineMembers() on all our DeclSpaces.
16520 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16521 but call DefineMembers() on all nested interfaces. We call their
16522 Define() in our new Define() function.
16524 * interface.cs (Interface): Implement IMemberContainer.
16525 (Interface.Define): Moved all code except the attribute stuf to
16527 (Interface.DefineMembers): Initialize the member cache.
16529 * typemanager.cs (IMemberFinder): Removed this interface, we don't
16530 need this anymore since we can use MemberCache.FindMembers directly.
16532 2002-08-19 Martin Baulig <martin@gnome.org>
16534 * typemanager.cs (MemberCache): When creating the cache for an
16535 interface type, add all inherited members.
16536 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16537 to `out bool used_cache' and documented it.
16538 (TypeManager.MemberLookup): If we already used the cache in the first
16539 iteration, we don't need to do the interfaces check.
16541 2002-08-19 Martin Baulig <martin@gnome.org>
16543 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
16544 here from IMemberFinder and don't implement this interface anymore.
16545 (DeclSpace.MemberCache): Moved here from IMemberFinder.
16547 * typemanager.cs (IMemberFinder): This interface is now only used by
16548 classes which actually support the member cache.
16549 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16550 since we only put DeclSpaces into this Hashtable.
16551 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16552 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16554 2002-08-16 Martin Baulig <martin@gnome.org>
16556 * typemanager.cs (ICachingMemberFinder): Removed.
16557 (IMemberFinder.MemberCache): New property.
16558 (TypeManager.FindMembers): Merged this with RealFindMembers().
16559 This function will never be called from TypeManager.MemberLookup()
16560 so we can't use the cache here, just the IMemberFinder.
16561 (TypeManager.MemberLookup_FindMembers): Check whether the
16562 IMemberFinder has a MemberCache and call the cache's FindMembers
16564 (MemberCache): Rewrote larger parts of this yet another time and
16565 cleaned it up a bit.
16567 2002-08-15 Miguel de Icaza <miguel@ximian.com>
16569 * driver.cs (LoadArgs): Support quoting.
16571 (Usage): Show the CSC-like command line arguments.
16573 Improved a few error messages.
16575 2002-08-15 Martin Baulig <martin@gnome.org>
16577 * typemanager.cs (IMemberContainer.Type): New property.
16578 (IMemberContainer.IsInterface): New property.
16580 The following changes are conditional to BROKEN_RUNTIME, which is
16581 defined at the top of the file.
16583 * typemanager.cs (MemberCache.MemberCache): Don't add the base
16584 class'es members, but add all members from TypeHandle.ObjectType
16585 if we're an interface.
16586 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16587 is the current type.
16588 (MemberCache.CacheEntry.Container): Removed this field.
16589 (TypeHandle.GetMembers): Include inherited members.
16591 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16593 * typemanager.cs: fixed compilation and added a comment on a field that
16596 2002-08-15 Martin Baulig <martin@gnome.org>
16598 * class.cs (ConstructorInitializer.Resolve): In the
16599 Expression.MemberLookup call, use the queried_type as
16602 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16603 declared' attribute, it's always true.
16604 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16605 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16606 temporary wrapper for FindMembers which tells MemberLookup whether
16607 members from the base classes are included in the return value.
16608 This will go away soon.
16609 (TypeManager.MemberLookup): Use this temporary hack here; once the
16610 new MemberCache is completed, we don't need to do the DeclaredOnly
16611 looping here anymore since the MemberCache will take care of this.
16612 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16613 (MemberCache): When creating the MemberCache for a class, get
16614 members from the current class and all its base classes.
16615 (MemberCache.CacheEntry.Container): New field. This is a
16616 temporary hack until the Mono runtime is fixed to distinguish
16617 between ReflectedType and DeclaringType. It allows us to use MCS
16618 with both the MS runtime and the unfixed Mono runtime without
16619 problems and without accecting performance.
16620 (MemberCache.SearchMembers): The DeclaredOnly looping from
16621 TypeManager.MemberLookup is now done here.
16623 2002-08-14 Martin Baulig <martin@gnome.org>
16625 * statement.cs (MyStructInfo.MyStructInfo): Don't call
16626 Type.GetFields on dynamic types but get the fields from the
16627 corresponding TypeContainer.
16628 (MyStructInfo.GetStructInfo): Added check for enum types.
16630 * typemanager.cs (MemberList.IsSynchronized): Implemented.
16631 (MemberList.SyncRoot): Implemented.
16632 (TypeManager.FilterWithClosure): No need to check permissions if
16633 closure_start_type == closure_invocation_type, don't crash if
16634 closure_invocation_type is null.
16636 2002-08-13 Martin Baulig <martin@gnome.org>
16638 Rewrote TypeContainer.FindMembers to use a member cache. This
16639 gives us a speed increase of about 35% for the self-hosting MCS
16640 build and of about 15-20% for the class libs (both on GNU/Linux).
16642 * report.cs (Timer): New class to get enhanced profiling. This
16643 whole class is "TIMER" conditional since it remarkably slows down
16646 * class.cs (MemberList): New class. This is an IList wrapper
16647 which we're now using instead of passing MemberInfo[]'s around to
16648 avoid copying this array unnecessarily.
16649 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16650 (ICachingMemberFinder, IMemberContainer): New interface.
16651 (TypeManager.FilterWithClosure): If `criteria' is null, the name
16652 has already been checked, otherwise use it for the name comparision.
16653 (TypeManager.FindMembers): Renamed to RealMemberFinder and
16654 provided wrapper which tries to use ICachingMemberFinder.FindMembers
16655 if possible. Returns a MemberList, not a MemberInfo [].
16656 (TypeHandle): New class, implements IMemberContainer. We create
16657 one instance of this class per type, it contains a MemberCache
16658 which is used to do the member lookups.
16659 (MemberCache): New class. Each instance of this class contains
16660 all members of a type and a name-based hash table.
16661 (MemberCache.FindMembers): This is our new member lookup
16662 function. First, it looks up all members of the requested name in
16663 the hash table. Then, it walks this list and sorts out all
16664 applicable members and returns them.
16666 2002-08-13 Martin Baulig <martin@gnome.org>
16668 In addition to a nice code cleanup, this gives us a performance
16669 increase of about 1.4% on GNU/Linux - not much, but it's already
16670 half a second for the self-hosting MCS compilation.
16672 * typemanager.cs (IMemberFinder): New interface. It is used by
16673 TypeManager.FindMembers to call FindMembers on a TypeContainer,
16674 Enum, Delegate or Interface.
16675 (TypeManager.finder_to_member_finder): New PtrHashtable.
16676 (TypeManager.finder_to_container): Removed.
16677 (TypeManager.finder_to_delegate): Removed.
16678 (TypeManager.finder_to_interface): Removed.
16679 (TypeManager.finder_to_enum): Removed.
16681 * interface.cs (Interface): Implement IMemberFinder.
16683 * delegate.cs (Delegate): Implement IMemberFinder.
16685 * enum.cs (Enum): Implement IMemberFinder.
16687 * class.cs (TypeContainer): Implement IMemberFinder.
16689 2002-08-12 Martin Baulig <martin@gnome.org>
16691 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16693 2002-08-12 Martin Baulig <martin@gnome.org>
16695 * ecore.cs (ITypeExpression): New interface for expressions which
16697 (TypeExpression): Renamed to TypeLookupExpression.
16698 (Expression.DoResolve): If we're doing a types-only lookup, the
16699 expression must implement the ITypeExpression interface and we
16700 call DoResolveType() on it.
16701 (SimpleName): Implement the new ITypeExpression interface.
16702 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16703 hack, the situation that we're only looking up types can't happen
16704 anymore when this method is called. Moved the type lookup code to
16705 DoResolveType() and call it.
16706 (SimpleName.DoResolveType): This ITypeExpression interface method
16707 is now doing the types-only lookup.
16708 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16709 (ResolveFlags): Added MaskExprClass.
16711 * expression.cs (MemberAccess): Implement the ITypeExpression
16713 (MemberAccess.DoResolve): Added support for a types-only lookup
16714 when we're called via ITypeExpression.DoResolveType().
16715 (ComposedCast): Implement the ITypeExpression interface.
16717 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
16718 Expression.Resolve() with ResolveFlags.Type instead.
16720 2002-08-12 Martin Baulig <martin@gnome.org>
16722 * interface.cs (Interface.Define): Apply attributes.
16724 * attribute.cs (Attribute.ApplyAttributes): Added support for
16725 interface attributes.
16727 2002-08-11 Martin Baulig <martin@gnome.org>
16729 * statement.cs (Block.Emit): Only check the "this" variable if we
16730 do not always throw an exception.
16732 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16733 whether the property has a set accessor.
16735 2002-08-11 Martin Baulig <martin@gnome.org>
16737 Added control flow analysis support for structs.
16739 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16740 with control flow analysis turned off.
16741 (IVariable): New interface.
16742 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16743 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16744 (FieldExpr.DoResolve): Resolve the instance expression with flow
16745 analysis turned off and do the definite assignment check after the
16746 resolving when we know what the expression will resolve to.
16748 * expression.cs (LocalVariableReference, ParameterReference):
16749 Implement the new IVariable interface, only call the flow analysis
16750 code if ec.DoFlowAnalysis is true.
16751 (This): Added constructor which takes a Block argument. Implement
16752 the new IVariable interface.
16753 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16754 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16755 This does the definite assignment checks for struct members.
16757 * class.cs (Constructor.Emit): If this is a non-static `struct'
16758 constructor which doesn't have any initializer, call
16759 Block.AddThisVariable() to tell the flow analysis code that all
16760 struct elements must be initialized before control returns from
16763 * statement.cs (MyStructInfo): New public class.
16764 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16765 argument to this indexer. If non-zero, check an individual struct
16766 member, not the whole struct.
16767 (FlowBranching.CheckOutParameters): Check struct members.
16768 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16769 overloaded versions of these methods which take an additional
16770 `int field_idx' argument to check struct members.
16771 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16772 overloaded versions of these methods which take an additional
16773 `string field_name' argument to check struct member.s
16774 (VariableInfo): Implement the IVariable interface.
16775 (VariableInfo.StructInfo): New public property. Returns the
16776 MyStructInfo instance of the variable if it's a struct or null.
16777 (Block.AddThisVariable): New public method. This is called from
16778 Constructor.Emit() for non-static `struct' constructor which do
16779 not have any initializer. It creates a special variable for the
16780 "this" instance variable which will be checked by the flow
16781 analysis code to ensure that all of the struct's fields are
16782 initialized before control returns from the constructor.
16783 (UsageVector): Added support for struct members. If a
16784 variable/parameter is a struct with N members, we reserve a slot
16785 in the usage vector for each member. A struct is considered fully
16786 initialized if either the struct itself (slot 0) or all its
16787 members are initialized.
16789 2002-08-08 Martin Baulig <martin@gnome.org>
16791 * driver.cs (Driver.MainDriver): Only report an error CS5001
16792 if there were no compilation errors.
16794 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16795 `UnsafeContext' property to determine whether the parent is in
16796 unsafe context rather than checking the parent's ModFlags:
16797 classes nested in an unsafe class are unsafe as well.
16799 2002-08-08 Martin Baulig <martin@gnome.org>
16801 * statement.cs (UsageVector.MergeChildren): Distinguish between
16802 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16803 we return. Added test17() and test18() to test-154.cs.
16805 2002-08-08 Martin Baulig <martin@gnome.org>
16807 * typemanager.cs (TypeManager.FilterWithClosure): If we have
16808 Family access, make sure the invoking type isn't a subclass of the
16809 queried type (that'd be a CS1540).
16811 * ecore.cs (Expression.MemberLookup): Added overloaded version of
16812 this method which takes an additional `Type invocation_type'.
16814 * expression.cs (BaseAccess.DoResolve): Use the base type as
16815 invocation and query type.
16816 (MemberAccess.DoResolve): If the lookup failed and we're about to
16817 report a CS0122, try a lookup with the ec.ContainerType - if this
16818 succeeds, we must report a CS1540.
16820 2002-08-08 Martin Baulig <martin@gnome.org>
16822 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16823 (MethodGroupExpr): Implement the IMemberExpr interface.
16825 * expression (MemberAccess.ResolveMemberAccess): No need to have
16826 any special code for MethodGroupExprs anymore, they're now
16829 2002-08-08 Martin Baulig <martin@gnome.org>
16831 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16832 Family, FamANDAssem and FamORAssem permissions.
16833 (TypeManager.IsSubclassOrNestedChildOf): New public method.
16835 2002-08-08 Martin Baulig <martin@gnome.org>
16837 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16838 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16841 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16843 * driver.cs: implemented /resource option to embed managed resources.
16845 2002-08-07 Martin Baulig <martin@gnome.org>
16847 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16848 (FieldBase.HasFieldInitializer): New public property.
16849 (FieldBase.GetInitializerExpression): New public method. Resolves and
16850 returns the field initializer and makes sure it is only resolved once.
16851 (TypeContainer.EmitFieldInitializers): Call
16852 FieldBase.GetInitializerExpression to get the initializer, this ensures
16853 that it isn't resolved multiple times.
16855 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
16856 the resolving process (SimpleName/MemberLookup) that we're currently
16857 emitting a field initializer (which must not access any instance members,
16858 this is an error CS0236).
16860 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16861 argument, if the `IsFieldInitializer' flag is set, we must report and
16862 error CS0236 and not an error CS0120.
16864 2002-08-07 Martin Baulig <martin@gnome.org>
16866 * ecore.cs (IMemberExpr): New public interface.
16867 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16868 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16869 if the expression is an IMemberExpr.
16871 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16872 to be null, implicitly default to `this' if we're non-static in
16873 this case. Simplified the code a lot by using the new IMemberExpr
16874 interface. Also fixed bug #28176 here.
16876 2002-08-06 Martin Baulig <martin@gnome.org>
16878 * cs-parser.jay (SimpleLookup): Removed. We need to create
16879 ParameterReferences during semantic analysis so that we can do a
16880 type-only search when resolving Cast, TypeOf and SizeOf.
16881 (block): Pass the `current_local_parameters' to the Block's
16884 * class.cs (ConstructorInitializer): Added `Parameters parameters'
16885 argument to the constructor.
16886 (ConstructorInitializer.Resolve): Create a temporary implicit
16887 block with the parameters.
16889 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16890 references here if we aren't doing a type-only search.
16892 * statement.cs (Block): Added constructor which takes a
16893 `Parameters parameters' argument.
16894 (Block.Parameters): New public property.
16896 * support.cs (InternalParameters.Parameters): Renamed `parameters'
16897 to `Parameters' and made it public readonly.
16899 2002-08-06 Martin Baulig <martin@gnome.org>
16901 * ecore.cs (Expression.Warning): Made this public as well.
16903 * report.cs (Report.Debug): Print the contents of collections.
16905 2002-08-06 Martin Baulig <martin@gnome.org>
16907 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
16908 used to tell Resolve() which kinds of expressions it may return.
16909 (Expression.Resolve): Added overloaded version of this method which
16910 takes a `ResolveFlags flags' argument. This can be used to tell
16911 Resolve() which kinds of expressions it may return. Reports a
16913 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16914 ResolveFlags.SimpleName.
16915 (Expression.Error118): Added overloaded version of this method which
16916 takes a `ResolveFlags flags' argument. It uses the flags to determine
16917 which kinds of expressions are allowed.
16919 * expression.cs (Argument.ResolveMethodGroup): New public method.
16920 Resolves an argument, but allows a MethodGroup to be returned.
16921 This is used when invoking a delegate.
16923 * TODO: Updated a bit.
16925 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16927 Fixed compilation with csc.
16929 * ecore.cs: Expression.Error made public. Is this correct? Should
16930 Warning be made public too?
16932 * expression.cs: use ea.Location instead of ea.loc.
16933 [FIXME: Filed as bug #28607: MCS must report these errors.]
16935 2002-08-06 Martin Baulig <martin@gnome.org>
16937 * ecore.cs (Expression.loc): Moved the location here instead of
16938 duplicating it in all derived classes.
16939 (Expression.Location): New public property.
16940 (Expression.Error, Expression.Warning): Made them non-static and
16941 removed the location argument.
16942 (Expression.Warning): Added overloaded version which takes an
16943 `int level' argument.
16944 (Expression.Error118): Make this non-static and removed the
16945 expression and location arguments.
16946 (TypeExpr): Added location argument to the constructor.
16948 * expression.cs (StaticCallExpr): Added location argument to
16950 (Indirection, PointerArithmetic): Likewise.
16951 (CheckedExpr, UnCheckedExpr): Likewise.
16952 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16953 (StringPtr): Likewise.
16956 2002-08-05 Martin Baulig <martin@gnome.org>
16958 * expression.cs (BaseAccess.DoResolve): Actually report errors.
16960 * assign.cs (Assign.DoResolve): Check whether the source
16961 expression is a value or variable.
16963 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16964 while resolving the corresponding blocks.
16966 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16967 an error, don't silently return null.
16969 * statement.cs (Block.AddVariable): Do the error reporting here
16970 and distinguish between CS0128 and CS0136.
16971 (Block.DoResolve): Report all unused labels (warning CS0164).
16972 (LabeledStatement): Pass the location to the constructor.
16973 (LabeledStatement.HasBeenReferenced): New property.
16974 (LabeledStatement.Resolve): Set it to true here.
16976 * statement.cs (Return.Emit): Return success even after reporting
16977 a type mismatch error (CS0126 or CS0127), this is what csc does and
16978 it avoids confusing the users with any consecutive errors.
16980 2002-08-05 Martin Baulig <martin@gnome.org>
16982 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16984 * const.cs (Const.LookupConstantValue): Catch circular definitions.
16986 * expression.cs (MemberAccess.DoResolve): Silently return if an
16987 error has already been reported.
16989 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16990 error has already been reported.
16992 2002-08-05 Martin Baulig <martin@gnome.org>
16994 * statement.cs (UsageVector): Only initialize the `parameters'
16995 vector if we actually have any "out" parameters.
16997 2002-08-05 Martin Baulig <martin@gnome.org>
16999 * expression.cs (Binary.ResolveOperator): When combining delegates,
17000 they must have the same type.
17002 2002-08-05 Martin Baulig <martin@gnome.org>
17004 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17005 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17006 work with the ms runtime and we also don't need it: if we're a
17007 PropertyBuilder and not in the `indexer_arguments' hash, then we
17008 are a property and not an indexer.
17010 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17011 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17012 since the latter one doesn't work with the ms runtime.
17014 2002-08-03 Martin Baulig <martin@gnome.org>
17016 Fixed bugs #27998 and #22735.
17018 * class.cs (Method.IsOperator): New public field.
17019 (Method.CheckBase): Report CS0111 if there's already a method
17020 with the same parameters in the current class. Report CS0508 when
17021 attempting to change the return type of an inherited method.
17022 (MethodData.Emit): Report CS0179 if a method doesn't have a body
17023 and it's not marked abstract or extern.
17024 (PropertyBase): New abstract base class for Property and Indexer.
17025 (PropertyBase.CheckBase): Moved here from Property and made it work
17027 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17028 the same so we can reuse it there.
17029 (Property, Indexer): Derive from PropertyBase.
17030 (MethodSignature.inheritable_property_signature_filter): New delegate
17031 to find properties and indexers.
17033 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17034 argument and improved error reporting.
17036 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17037 EmptyReadOnlyParameters and made it a property.
17039 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17040 version of this method which takes a `PropertyInfo indexer'.
17041 (TypeManager.RegisterIndexer): New method.
17043 * class.cs: Added myself as author of this file :-)
17045 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17047 * class.cs: fixed compilation on windoze.
17049 2002-08-03 Martin Baulig <martin@gnome.org>
17051 * interface.cs (Interface.GetInterfaceBases): Check whether all
17052 base interfaces are at least as accessible than the current one.
17054 * class.cs (TypeContainer.GetClassBases): Check whether base types
17055 are at least as accessible than the current type.
17056 (TypeContainer.AsAccessible): Implemented and made non-static.
17057 (MemberBase.CheckParameters): Report errors if the accessibility
17060 * delegate.cs (Delegate.Delegate): The default visibility is
17061 internal for top-level types and private for nested types.
17062 (Delegate.Define): Report errors if the accessibility checks fail.
17064 * enum.cs (Enum.Enum): The default visibility is internal for
17065 top-level types and private for nested types.
17066 (Enum.DefineType): Compute the correct visibility.
17068 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17069 function which takes a `bool is_toplevel' instead of a TypeContainer.
17071 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17074 2002-08-02 Martin Baulig <martin@gnome.org>
17076 * expression.cs (LocalVariableReferenc): Added constructor which
17077 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17078 (LocalVariableReference.IsReadOnly): New property.
17079 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17080 variable is readonly, use our own readonly flag to do this; you can
17081 use the new constructor to get a writable reference to a read-only
17084 * cs-parser.jay (foreach_statement, using_statement): Get a writable
17085 reference to the local variable.
17087 2002-08-01 Miguel de Icaza <miguel@ximian.com>
17089 * rootcontext.cs (ResolveCore): Also include System.Exception
17091 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17092 we reach an EmptyStatement.
17094 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17097 * expression.cs (Binary.ResolveOperator): Check error result in
17100 use brtrue/brfalse directly and avoid compares to null.
17102 2002-08-02 Martin Baulig <martin@gnome.org>
17104 * class.cs (TypeContainer.Define): Define all nested interfaces here.
17105 Fixes bug #28407, added test-155.cs.
17107 2002-08-01 Martin Baulig <martin@gnome.org>
17109 * class.cs (Event.EmitDefaultMethod): Make this work with static
17110 events. Fixes #28311, added verify-3.cs.
17112 2002-08-01 Martin Baulig <martin@gnome.org>
17114 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17115 `is_disposable' fields.
17116 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17117 `hm.is_disposable' if we're using the collection pattern.
17118 (Foreach.EmitCollectionForeach): Use the correct type for the
17119 enumerator's local variable, only emit the try/finally block if
17120 necessary (fixes #27713).
17122 2002-08-01 Martin Baulig <martin@gnome.org>
17124 * ecore.cs (Expression.report118): Renamed to Error118 and made
17127 * statement.cs (Throw.Resolve): Check whether the expression is of
17128 the correct type (CS0118) and whether the type derives from
17129 System.Exception (CS0155).
17130 (Catch.Resolve): New method. Do the type lookup here and check
17131 whether it derives from System.Exception (CS0155).
17132 (Catch.CatchType, Catch.IsGeneral): New public properties.
17134 * typemanager.cs (TypeManager.exception_type): Added.
17136 2002-07-31 Miguel de Icaza <miguel@ximian.com>
17138 * driver.cs: Updated About function.
17140 2002-07-31 Martin Baulig <martin@gnome.org>
17142 Implemented Control Flow Analysis.
17144 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17145 (EmitContext.CurrentBranching): Added.
17146 (EmitContext.StartFlowBranching): Added.
17147 (EmitContext.EndFlowBranching): Added.
17148 (EmitContext.KillFlowBranching): Added.
17149 (EmitContext.IsVariableAssigned): Added.
17150 (EmitContext.SetVariableAssigned): Added.
17151 (EmitContext.IsParameterAssigned): Added.
17152 (EmitContext.SetParameterAssigned): Added.
17153 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17154 Added control flow analysis stuff here.
17156 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17157 resolve the expression as lvalue.
17158 (LocalVariableReference.DoResolve): Check whether the variable has
17159 already been assigned.
17160 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17161 the parameter as assigned here.
17162 (ParameterReference.DoResolve): Check whether the parameter has already
17164 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17165 expression as lvalue.
17167 * statement.cs (FlowBranching): New class for the flow analysis code.
17168 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17169 (LabeledStatement.IsDefined): New public property.
17170 (LabeledStatement.AddUsageVector): New public method to tell flow
17171 analyis that the label may be reached via a forward jump.
17172 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17174 (VariableInfo.Number): New public field. This is used by flow analysis
17175 to number all locals of a block.
17176 (Block.CountVariables): New public property. This is the number of
17177 local variables in this block (including the locals from all parent
17179 (Block.EmitMeta): Number all the variables.
17181 * statement.cs: Added flow analysis support to all classes.
17183 2002-07-31 Martin Baulig <martin@gnome.org>
17185 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17186 To get debugging messages, compile mcs with /define:MCS_DEBUG and
17187 then use this argument.
17189 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17191 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17192 use this to specify /define options.
17194 2002-07-29 Martin Baulig <martin@gnome.org>
17196 * statement.cs (Fixed): Moved all code that does variable lookups
17197 and resolvings from Emit to Resolve.
17199 * statement.cs (For): Moved all code that does variable lookups
17200 and resolvings from Emit to Resolve.
17202 * statement.cs (Using): Moved all code that does variable lookups
17203 and resolvings from Emit to Resolve.
17205 2002-07-29 Martin Baulig <martin@gnome.org>
17207 * attribute.cs (Attribute.Resolve): Explicitly catch a
17208 System.NullReferenceException when creating the
17209 CustromAttributeBuilder and report a different warning message.
17211 2002-07-29 Martin Baulig <martin@gnome.org>
17213 * support.cs (ParameterData.ParameterName): Added method to
17214 get the name of a parameter.
17216 * typemanager.cs (TypeManager.IsValueType): New public method.
17218 2002-07-29 Martin Baulig <martin@gnome.org>
17220 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
17221 is a flag which specifies that it's either ref or out.
17222 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17223 the out parameter to `out Parameter.Modifier mod', also set the
17224 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17226 * support.cs (InternalParameters.ParameterModifier): Distinguish
17227 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17228 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17230 * expression.cs (Argument.GetParameterModifier): Distinguish
17231 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17232 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17234 2002-07-29 Martin Baulig <martin@gnome.org>
17236 * expression.cs (ParameterReference.ParameterReference): Added
17237 `Location loc' argument to the constructor.
17239 * cs-parser.jay: Pass location to ParameterReference.
17241 2002-07-28 Miguel de Icaza <miguel@ximian.com>
17243 * statement.cs (Try): Initialize the location.
17245 * cs-parser.jay: pass location to Try.
17247 * expression.cs (Unary.Reduce): Change the prototype to return
17248 whether a constant fold could be performed or not. The result is
17249 returned in an out parameters. In the case of Indirection and
17250 AddressOf, we want to perform the full tests.
17252 2002-07-26 Miguel de Icaza <miguel@ximian.com>
17254 * statement.cs (Statement.Emit): Flag dead code.
17256 2002-07-27 Andrew Birkett <andy@nobugs.org>
17258 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17260 2002-07-27 Martin Baulig <martin@gnome.org>
17262 * class.cs (MethodData.Define): Put back call to
17263 TypeManager.AddMethod(), accidentally commented this out.
17265 * report.cs (Debug): New public method to print debugging information,
17266 this is `[Conditional ("DEBUG")]'.
17268 2002-07-26 Martin Baulig <martin@gnome.org>
17270 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17271 (switch_statement): Push the current_block to the switch_stack and
17272 pop it again when we're done with the switch.
17273 (switch_section): The new block is a child of the current_block.
17274 Fixes bug #24007, added test-152.cs.
17276 2002-07-27 Martin Baulig <martin@gnome.org>
17278 * expression.cs (Invocation.EmitArguments): When calling a varargs
17279 function with only its fixed arguments, we need to pass an empty
17282 2002-07-27 Martin Baulig <martin@gnome.org>
17284 Mono 0.13 has been released.
17286 2002-07-25 Miguel de Icaza <miguel@ximian.com>
17288 * driver.cs: Rename --resource to --linkres, because that is what
17289 we do currently, we dont support --resource yet.
17291 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17293 2002-07-25 Martin Baulig <martin@gnome.org>
17295 * class.cs (MethodData): New public class. This is a `method builder'
17296 class for a method or one accessor of a Property/Indexer/Event.
17297 (MethodData.GetMethodFlags): Moved here from MemberBase.
17298 (MethodData.ApplyAttributes): Likewise.
17299 (MethodData.ApplyObsoleteAttribute): Likewise.
17300 (MethodData.ApplyConditionalAttribute): Likewise.
17301 (MethodData.ApplyDllImportAttribute): Likewise.
17302 (MethodData.CheckAbstractAndExternal): Likewise.
17303 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17304 (MethodData.Emit): Formerly known as Method.Emit().
17305 (MemberBase): Moved everything which was specific to a single
17306 accessor/method to MethodData.
17307 (Method): Create a new MethodData and call Define() and Emit() on it.
17308 (Property, Indexer, Event): Create a new MethodData objects for each
17309 accessor and call Define() and Emit() on them.
17311 2002-07-25 Martin Baulig <martin@gnome.org>
17313 Made MethodCore derive from MemberBase to reuse the code from there.
17314 MemberBase now also checks for attributes.
17316 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17317 (MemberBase.GetMethodFlags): Moved here from class Method and marked
17319 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17320 `CallingConventions cc' and `Attributes opt_attrs' arguments.
17321 (MemberBase.ApplyAttributes): New virtual method; applies the
17322 attributes to a method or accessor.
17323 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17324 (MemberBase.ApplyConditionalAttribute): Likewise.
17325 (MemberBase.ApplyDllImportAttribute): Likewise.
17326 (MemberBase.CheckAbstractAndExternal): Likewise.
17327 (MethodCore.ParameterTypes): This is now a property instead of a
17328 method, it's initialized from DoDefineParameters().
17329 (MethodCore.ParameterInfo): Removed the set accessor.
17330 (MethodCore.DoDefineParameters): New protected virtual method to
17331 initialize ParameterTypes and ParameterInfo.
17332 (Method.GetReturnType): We can now simply return the MemberType.
17333 (Method.GetMethodFlags): Override the MemberBase version and add
17334 the conditional flags.
17335 (Method.CheckBase): Moved some code from Define() here, call
17336 DoDefineParameters() here.
17337 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17338 here to avoid some larger code duplication.
17339 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17340 ensure that abstract and external accessors don't declare a body.
17342 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17343 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17344 lookup in the attribute's parent classes, so we need to abort as soon
17345 as we found the first match.
17346 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17347 the attribute has no arguments.
17349 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17352 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17354 * cs-parser.jay: reverted previous patch.
17356 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17358 * cs-parser.jay: fixed bug #22119.
17360 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17362 * attribute.cs: fixed compilation. The error was:
17363 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
17364 be assigned to before control leaves the current method."
17365 [FIXME: Filed as bug #28186: MCS must report this error.]
17367 2002-07-25 Martin Baulig <martin@gnome.org>
17369 * attribute.cs (Attribute.Conditional_GetConditionName): New static
17370 method to pull the condition name ouf of a Conditional attribute.
17371 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17372 the obsolete message and error flag out of an Obsolete attribute.
17374 * class.cs (Method.GetMethodFlags): New public method to get the
17375 TypeManager.MethodFlags for this method.
17376 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17378 (Method.Define): Get and apply the Obsolete and Conditional attributes;
17379 if we're overriding a virtual function, set the new private variable
17380 `parent_method'; call the new TypeManager.AddMethod().
17382 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
17383 the MethodBuilder and the Method in a PtrHashtable.
17384 (TypeManager.builder_to_method): Added for this purpose.
17385 (TypeManager.MethodFlags): Added IsObsoleteError.
17386 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
17387 Obsolete and Conditional arguments in MethodBuilders. If we discover
17388 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17389 the message from the attribute.
17391 2002-07-24 Martin Baulig <martin@gnome.org>
17393 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17394 preprocessor directives, ensure that the argument to #define/#undef is
17395 exactly one identifier and that it's actually an identifier.
17397 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17400 2002-07-24 Martin Baulig <martin@gnome.org>
17402 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17403 initialize it to TypeManager.object_type in the constructor.
17404 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17405 of the `hm.get_current' method if we're using the collection pattern.
17406 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17407 for the explicit conversion to make it work when we're using the collection
17408 pattern and the `Current' property has a different return type than `object'.
17411 2002-07-24 Martin Baulig <martin@gnome.org>
17413 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17414 does not match, but don't report any errors. This method is called in
17415 order for all methods in a MethodGroupExpr until a matching method is
17416 found, so we don't want to bail out if the first method doesn't match.
17417 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17418 matches, report the 123. Fixes #28070.
17420 2002-07-24 Martin Baulig <martin@gnome.org>
17422 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17423 TypeManager.TypeToCoreType() to the top of the method so the
17424 following equality checks will work. Fixes #28107.
17426 2002-07-24 Martin Baulig <martin@gnome.org>
17428 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17429 operand is of type uint, and the other operand is of type sbyte,
17430 short or int, the operands are converted to type long." -
17431 Actually do what this comment already told us. Fixes bug #28106,
17434 2002-07-24 Martin Baulig <martin@gnome.org>
17436 * class.cs (MethodBase): New abstract class. This is now a base
17437 class for Property, Indexer and Event to avoid some code duplication
17438 in their Define() and DefineMethods() methods.
17439 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17440 generic methods for Define() and DefineMethods().
17441 (FieldBase): Derive from MemberBase, not MemberCore.
17442 (Property): Derive from MemberBase, not MemberCore.
17443 (Property.DefineMethod): Moved all the code from this method to the
17444 new MethodBase.DefineAccessor(), just call it with appropriate
17446 (Property.Define): Call the new Property.DoDefine(), this does some
17447 sanity checks and we don't need to duplicate the code everywhere.
17448 (Event): Derive from MemberBase, not MemberCore.
17449 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17450 accessors, this will also make them work with interface events.
17451 (Indexer): Derive from MemberBase, not MemberCore.
17452 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17453 (Indexer.Define): Use the new MethodBase functions.
17455 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17456 argument to the constructor.
17457 (Interface.FindMembers): Added support for interface events.
17458 (Interface.PopluateEvent): Implemented.
17460 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
17462 2002-07-22 Miguel de Icaza <miguel@ximian.com>
17464 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17465 but this is required to check for a method name being the same as
17466 the containing class.
17470 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17472 * interface.cs: initialize variable.
17474 2002-07-23 Martin Baulig <martin@gnome.org>
17476 Implemented the IndexerName attribute in interfaces.
17478 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17479 name if this is an explicit interface implementation.
17480 (Indexer.InterfaceIndexerName): New public variable. If we're
17481 implementing an interface indexer, this is the IndexerName in that
17482 interface. Otherwise, it's the IndexerName.
17483 (Indexer.DefineMethod): If we're implementing interface indexer,
17484 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
17485 and Pending.ImplementIndexer methods.
17486 (Indexer.Define): Also define the PropertyBuilder if we're
17487 implementing an interface indexer and this is neither an explicit
17488 interface implementation nor do the IndexerName match the one in
17491 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17492 If a method is defined here, then we always need to create a proxy
17493 for it. This is used when implementing interface indexers.
17494 (Pending.IsInterfaceIndexer): New public method.
17495 (Pending.ImplementIndexer): New public method.
17496 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17497 This is used when implementing interface indexers to define a proxy
17499 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17500 define a proxy if necessary.
17502 * interface.cs (Interface.IndexerName): New public variable.
17503 (Interface.PopulateIndexer): Set the IndexerName.
17504 (Interface.DefineIndexers): New private method. Populate all the
17505 indexers and make sure their IndexerNames match.
17507 * typemanager.cs (IndexerPropertyName): Added support for interface
17510 2002-07-22 Martin Baulig <martin@gnome.org>
17512 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17513 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17514 ret if HasReturnLabel.
17515 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17518 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17519 and set the ec.LoopBeginTryCatchLevel.
17520 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17521 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17522 the current ec.TryCatchLevel, the branch goes out of an exception
17523 block. In this case, we need to use Leave and not Br.
17525 2002-07-22 Martin Baulig <martin@gnome.org>
17527 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17528 block unless the block does not always return or it is contained in
17529 another try { ... } catch { ... } block. Fixes bug #26506.
17530 Added verify-1.cs to the test suite.
17532 2002-07-22 Martin Baulig <martin@gnome.org>
17534 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17535 then we do not always return. Fixes bug #24985.
17537 2002-07-22 Martin Baulig <martin@gnome.org>
17539 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17540 lookup on a per-class level; ie. walk up the class hierarchy until we
17541 found at least one applicable method, then choose the best among them.
17542 Fixes bug #24463 and test-29.cs.
17544 2002-07-22 Martin Baulig <martin@gnome.org>
17546 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17547 return types of the methods. The return type is not part of the
17548 signature and we must not check it to make the `new' modifier work.
17549 Fixes bug #27999, also added test-147.cs.
17550 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17552 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17553 on the method's return type.
17555 2002-07-21 Martin Baulig <martin@gnome.org>
17557 * assign.cs: Make this work if the rightmost source is a constant and
17558 we need to do an implicit type conversion. Also adding a few more tests
17559 to test-38.cs which should have caught this.
17561 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17562 target in the makefile for this. The makefile.gnu is primarily intended
17563 for end-users who don't want to debug the compiler.
17565 2002-07-21 Martin Baulig <martin@gnome.org>
17567 * assign.cs: Improved the Assign class so it can now handle embedded
17568 assignments (X = Y = Z = something). As a side-effect this'll now also
17569 consume less local variables. test-38.cs now passes with MCS, added
17570 a few new test cases to that test.
17572 2002-07-20 Martin Baulig <martin@gnome.org>
17574 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17575 instructions. Fixes bug #27977, also added test-146.cs.
17577 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17579 * cs-tokenizer.cs: fixed getHex ().
17581 2002-07-19 Martin Baulig <martin@gnome.org>
17583 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17584 not Type.GetType() to lookup the array type. This is needed when
17585 we're constructing an array of a user-defined type.
17586 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17587 single-dimensional arrays, but also for single-dimensial arrays of
17590 2002-07-19 Martin Baulig <martin@gnome.org>
17592 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17593 this function is called, it's not allowed to share LocalBuilders
17594 among ILGenerators.
17596 2002-07-19 Martin Baulig <martin@gnome.org>
17598 * expression.cs (Argument.Resolve): Report an error 118 when trying
17599 to pass a type as argument.
17601 2002-07-18 Martin Baulig <martin@gnome.org>
17603 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17604 Conv_R_Un for the signed `long' type.
17606 2002-07-15 Miguel de Icaza <miguel@ximian.com>
17608 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17609 `expr' for the temporary result, as that will fail if we do
17610 multiple resolves on the same expression.
17612 2002-07-05 Miguel de Icaza <miguel@ximian.com>
17614 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17615 ec.TypeContainer for looking up aliases.
17617 * class.cs (TypeContainer): Remove LookupAlias from here.
17619 * decl.cs (DeclSpace); Move here.
17621 2002-07-01 Miguel de Icaza <miguel@ximian.com>
17623 * class.cs (FindMembers): Only call filter if the constructor
17624 bulider is not null.
17626 Also handle delegates in `NestedTypes' now. Now we will perform
17627 type lookups using the standard resolution process. This also
17630 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17631 This uses Expressions (the limited kind that can be parsed by the
17632 tree) instead of strings.
17634 * expression.cs (ComposedCast.ToString): Implement, used to flag
17635 errors since now we have to render expressions.
17637 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
17640 * ecore.cs (SimpleName.ToString): ditto.
17642 * cs-parser.jay: Instead of using strings to assemble types, use
17643 Expressions to assemble the type (using SimpleName, ComposedCast,
17644 MemberAccess). This should fix the type lookups in declarations,
17645 because we were using a different code path for this.
17647 * statement.cs (Block.Resolve): Continue processing statements
17648 even when there is an error.
17650 2002-07-17 Miguel de Icaza <miguel@ximian.com>
17652 * class.cs (Event.Define): Also remove the `remove' method from
17653 the list of pending items.
17655 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17656 generate more compact code.
17658 2002-07-17 Martin Baulig <martin@gnome.org>
17660 * const.cs (Const.LookupConstantValue): Add support for constant
17661 `unchecked' and `checked' expressions.
17662 Also adding test case test-140.cs for this.
17664 2002-07-17 Martin Baulig <martin@gnome.org>
17666 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17667 check whether mi.ReturnType implements the IEnumerator interface; the
17668 `==' and the IsAssignableFrom() will fail in this situation.
17670 2002-07-16 Ravi Pratap <ravi@ximian.com>
17672 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
17675 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17677 * expression.cs: fixed bug #27811.
17679 2002-07-14 Miguel de Icaza <miguel@ximian.com>
17681 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17682 Molaro: when we are a ref, the value already contains a pointer
17683 value, do not take the address of it.
17685 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17686 * removed mb-parser.jay and mb-tokenizer.cs
17688 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17690 * expression.cs: check against the building corlib void type.
17692 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17694 * ecore.cs: fix for valuetype static readonly fields: when
17695 initializing them, we need their address, not the address of a copy.
17697 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17699 * typemanager.cs: register also enum_type in corlib.
17701 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17703 * class.cs: allow calling this (but not base) initializers in structs.
17705 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17707 * ecore.cs: make sure we compare against the building base types
17710 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17712 * typemanager.cs: fix TypeToCoreType() to handle void and object
17713 (corlib gets no more typerefs after this change).
17715 2002-07-12 Miguel de Icaza <miguel@ximian.com>
17717 * expression.cs (ArrayCreation.EmitArrayArguments): use
17718 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17720 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17721 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
17722 array indexes, the runtime actually forbids them.
17724 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17725 for array arguments here.
17727 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17728 instead of the default for ValueTypes.
17730 (New.DoEmit): Use IsValueType instead of
17731 IsSubclassOf (value_type)
17732 (New.DoResolve): ditto.
17733 (Invocation.EmitCall): ditto.
17735 * assign.cs (Assign): ditto.
17737 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17738 Statements *are* currently doing part of their resolution during
17741 Expressions do always resolve during resolve, but statements are
17742 only required to propagate resolution to their children.
17744 2002-07-11 Miguel de Icaza <miguel@ximian.com>
17746 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17748 (LoadAssembly): Do not add the dll if it is already specified
17750 (MainDriver): Add the System directory to the link path at the end,
17751 after all the other -L arguments.
17753 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17754 wrong opcode for loading bytes and bools (ldelem.i1 instead of
17755 ldelem.u1) and using the opposite for sbytes.
17757 This fixes Digger, and we can finally run it.
17759 * driver.cs (UnixParseOption): Move the option parsing here.
17760 (CSCParseOption): Implement CSC-like parsing of options.
17762 We now support both modes of operation, the old Unix way, and the
17763 new CSC-like way. This should help those who wanted to make cross
17764 platform makefiles.
17766 The only thing broken is that /r:, /reference: and /lib: are not
17767 implemented, because I want to make those have the same semantics
17768 as the CSC compiler has, and kill once and for all the confussion
17769 around this. Will be doing this tomorrow.
17771 * statement.cs (Unsafe.Resolve): The state is checked during
17772 resolve, not emit, so we have to set the flags for IsUnsfe here.
17774 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17776 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17777 not catch the Error_ObjectRefRequired in SimpleName (as it is
17778 possible to have a class/instance variable name that later gets
17779 deambiguated), we have to check this here.
17781 2002-07-10 Ravi Pratap <ravi@ximian.com>
17783 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17784 make static and put into Expression.
17786 (Event.Define): Register the private field of the event with the
17787 TypeManager so that GetFieldFromEvent can get at it.
17789 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17790 keep track of the private field associated with an event which
17793 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17796 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17798 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17800 * expression.cs (Binary.EmitBranchable): this routine emits the
17801 Binary expression in a branchable context. This basically means:
17802 we need to branch somewhere, not just get the value on the stack.
17804 This works together with Statement.EmitBoolExpression.
17806 * statement.cs (Statement.EmitBoolExpression): Use
17809 2002-07-09 Miguel de Icaza <miguel@ximian.com>
17811 * statement.cs (For): Reduce the number of jumps in loops.
17813 (For): Implement loop inversion for the For statement.
17815 (Break): We can be breaking out of a Try/Catch controlled section
17816 (foreach might have an implicit try/catch clause), so we need to
17817 use Leave instead of Br.
17819 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17820 now). If the instace expression supports IMemoryLocation, we use
17821 the AddressOf method from the IMemoryLocation to extract the
17822 address instead of emitting the instance.
17824 This showed up with `This', as we were emitting the instance
17825 always (Emit) instead of the Address of This. Particularly
17826 interesting when This is a value type, as we dont want the Emit
17827 effect (which was to load the object).
17829 2002-07-08 Miguel de Icaza <miguel@ximian.com>
17831 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17833 * statement.cs (Checked): Set the CheckedState during the resolve
17834 process too, as the ConvCast operations track the checked state on
17835 the resolve process, and not emit.
17837 * cs-parser.jay (namespace_member_declaration): Flag that we have
17838 found a declaration when we do. This is used to flag error 1529
17840 * driver.cs: Report ok when we display the help only.
17842 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
17844 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17846 2002-07-04 Miguel de Icaza <miguel@ximian.com>
17848 * cs-tokenizer.cs (define): We also have to track locally the
17849 defines. AllDefines is just used for the Conditional Attribute,
17850 but we also need the local defines for the current source code.
17852 2002-07-03 Miguel de Icaza <miguel@ximian.com>
17854 * statement.cs (While, For, Do): These loops can exit through a
17855 Break statement, use this information to tell whether the
17856 statement is the last piece of code.
17858 (Break): Flag that we break.
17860 * codegen.cs (EmitContexts): New `Breaks' state variable.
17862 2002-07-03 Martin Baulig <martin@gnome.org>
17864 * class.cs (TypeContainer.MethodModifiersValid): Allow override
17865 modifiers in method declarations in structs. Otherwise, you won't
17866 be able to override things like Object.Equals().
17868 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17870 * class.cs (Method, Property, Indexer): Do not allow the public
17871 modifier to be used in explicit interface implementations.
17873 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17874 override modifiers in method declarations in structs
17876 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
17878 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17879 integer or real overflow, report an error
17881 2002-07-02 Martin Baulig <martin@gnome.org>
17883 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17884 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17885 to tell the runtime about our newly created System.Object and
17886 System.ValueType types.
17888 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17890 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17891 struct instead of Ldarg/Starg.
17893 2002-07-02 Martin Baulig <martin@gnome.org>
17895 * expression.cs (Indirection.Indirection): Call
17896 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17898 2002-07-02 Martin Baulig <martin@gnome.org>
17900 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17901 ValueType, call TypeManager.TypeToCoreType() on it.
17902 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17903 the OpCodes.Newarr argument.
17905 2002-07-02 Martin Baulig <martin@gnome.org>
17907 * expression.cs (Invocation.EmitCall): When compiling corlib,
17908 replace all calls to the system's System.Array type to calls to
17909 the newly created one.
17911 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17912 System.Array methods.
17913 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17914 from the system's System.Array type which must be replaced.
17916 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17918 * typemanager.cs: load unverifiable_code_ctor so we can build
17919 corlib using the correct type. Avoid using GetTypeCode() with
17921 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17922 TypeManager.object_type to allow building corlib.
17924 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17926 * ecore.cs: handle System.Enum separately in LoadFromPtr().
17928 2002-07-01 Martin Baulig <martin@gnome.org>
17930 * class.cs: Make the last change actually work, we need to check
17931 whether `ifaces != null' to avoid a crash.
17933 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17935 * class.cs: when we build structs without fields that implement
17936 interfaces, we need to add the interfaces separately, since there is
17937 no API to both set the size and add the interfaces at type creation
17940 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17942 * expression.cs: the dimension arguments to the array constructors
17943 need to be converted if they are a long.
17945 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17947 * class.cs: don't emit ldarg.0 if there is no parent constructor
17948 (fixes showstopper for corlib).
17950 2002-06-29 Martin Baulig <martin@gnome.org>
17952 MCS now compiles corlib on GNU/Linux :-)
17954 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17955 ie. check for MethodImplOptions.InternalCall.
17957 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17958 and TypeManager.attribute_type are null, so we must explicitly check
17959 whether parent is not null to find out whether it's an attribute type.
17960 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17961 and SetBuilder, not only if the property is neither abstract nor external.
17962 This is necessary to set the MethodImplOptions on the accessor methods.
17963 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17964 SetBuilder, see Property.Emit().
17966 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17967 populate "System.Object", "System.ValueType" and "System.Attribute" since
17968 they've already been populated from BootCorlib_PopulateCoreTypes().
17970 2002-06-29 Martin Baulig <martin@gnome.org>
17972 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17973 is the NullLiteral, we also need to make sure that target_type is not
17976 2002-06-29 Martin Baulig <martin@gnome.org>
17978 * rootcontext.cs (RootContext.ResolveCore): We must initialize
17979 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17980 before calling BootstrapCorlib_ResolveDelegate ().
17982 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17984 * statement.cs: fixed build-breaker. All tests passed ok.
17986 2002-06-27 Martin Baulig <martin@gnome.org>
17988 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17989 for System.Decimal when compiling corlib.
17991 2002-06-27 Martin Baulig <martin@gnome.org>
17993 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17994 switch blocks which contain nothing but a default clause.
17996 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
17998 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18000 2002-06-27 Martin Baulig <martin@gnome.org>
18002 * ecore.cs (PropertyExpr.PropertyExpr): Call
18003 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18005 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18006 is already a TypeBuilder.
18008 2002-06-27 Martin Baulig <martin@gnome.org>
18010 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18011 `target_type == TypeManager.array_type', not IsAssignableFrom() in
18012 the "from an array-type to System.Array" case. This makes it work
18013 when compiling corlib.
18015 2002-06-27 Martin Baulig <martin@gnome.org>
18017 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18018 non-static PropertyExpr, set its InstanceExpression. This makes
18019 the `ICollection.Count' property work in System/Array.cs.
18021 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
18023 * driver.cs: Made error handling more consistent. Errors now
18024 tracked by Report class, so many methods which used to return int
18025 now return void. Main() now prints success/failure and
18026 errors/warnings message.
18028 Renamed '--probe' compiler argument to '--expect-error'. Removed
18029 the magic number return values (123 and 124). Now, if the
18030 expected error occurs, the compiler exits with success (exit value
18031 0). If the compilation completes without seeing that particular
18032 error, the compiler exits with failure (exit value 1). The
18033 makefile in mcs/errors has been changed to handle the new behaviour.
18035 * report.cs: Made 'expected error' number a property and renamed
18036 it from 'Probe' to 'ExpectedError'.
18038 * genericparser.cs: Removed error handling support, since it is
18039 now all done by Report class.
18041 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18042 class, so parse() no longer returns an int.
18044 * namespace.cs: Use Report.Error instead of GenericParser.error
18046 2002-06-22 Miguel de Icaza <miguel@ximian.com>
18048 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18049 TypeContainer.AddOperator): At the front of the list put the
18050 explicit implementations, so they get resolved/defined first.
18052 2002-06-21 Miguel de Icaza <miguel@ximian.com>
18054 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18055 interface type is implemented by this TypeContainer. Used during
18056 explicit interface implementation.
18058 (Property.Define, Indexer.Define, Method.Define): Validate that
18059 the given interface in the explicit implementation is one of the
18060 base classes for the containing type.
18062 Also if we are explicitly implementing an interface, but there is
18063 no match in the pending implementation table, report an error.
18065 (Property.Define): Only define the property if we are
18066 not explicitly implementing a property from an interface. Use the
18067 correct name also for those properties (the same CSC uses,
18068 although that is really not needed).
18070 (Property.Emit): Do not emit attributes for explicitly implemented
18071 properties, as there is no TypeBuilder.
18073 (Indexer.Emit): ditto.
18075 Hiding then means that we do not really *implement* a pending
18076 implementation, which makes code fail.
18078 2002-06-22 Martin Baulig <martin@gnome.org>
18080 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18081 the return value of Object.GetType(). [FIXME: we need to do this whenever
18082 we get a type back from the reflection library].
18084 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18086 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18088 2002-06-20 Miguel de Icaza <miguel@ximian.com>
18090 * attribute.cs: Return null if we can not look up the type.
18092 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18093 the interface types found.
18095 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18096 interface types found.
18098 * typemanager.cs (GetInterfaces): Make this routine returns alll
18099 the interfaces and work around the lame differences between
18100 System.Type and System.Reflection.Emit.TypeBuilder in the results
18101 result for GetInterfaces.
18103 (ExpandInterfaces): Given an array of interface types, expand and
18104 eliminate repeated ocurrences of an interface. This expands in
18105 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18108 2002-06-21 Martin Baulig <martin@gnome.org>
18110 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18113 2002-06-21 Martin Baulig <martin@gnome.org>
18115 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
18116 and called with one of the core types, return the corresponding typebuilder for
18119 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18122 2002-06-21 Martin Baulig <martin@gnome.org>
18124 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18125 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18126 (Expression.ConvertReferenceExplicit): Likewise.
18128 * expression.cs (ElementAccess.DoResolve): Likewise.
18129 (ElementAccess.DoResolveLValue): Likewise.
18131 2002-06-10 Martin Baulig <martin@gnome.org>
18133 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18134 add the "value" parameter to the parameter list.
18136 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18139 2002-06-19 Miguel de Icaza <miguel@ximian.com>
18141 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18142 the argument to an int, uint, long or ulong, per the spec. Also
18143 catch negative constants in array creation.
18145 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18147 * class.cs: do not allow the same interface to appear twice in
18148 the definition list.
18150 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18152 * ecore.cs: don't use ldlen with System.Array.
18154 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18156 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18158 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18160 * modifiers.cs: produce correct field attributes for protected
18161 internal. Easy fix so miguel can work on ther harder stuff:-)
18163 2002-06-18 Miguel de Icaza <miguel@ximian.com>
18165 * pending.cs: New file. Move the code from class.cs here.
18166 Support clearning the pending flag for all methods (when not doing
18167 explicit interface implementation).
18169 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18171 * rootcontext.cs: added a couple more types needed to bootstrap.
18173 2002-06-17 Miguel de Icaza <miguel@ximian.com>
18175 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18176 constructor in the type, instead of any constructor in the type
18177 hierarchy. Thanks to Paolo for finding this bug (it showed up as
18178 a bug in the Mono runtime when applying the params attribute).
18180 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18181 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18183 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
18185 * expression.cs (Unary.ResolveOperator): Use TypeManager
18186 to resolve the type.
18188 2002-06-13 Ravi Pratap <ravi@ximian.com>
18190 * cs-parser.jay (enum_member_declaration): Pass in the attributes
18193 * enum.cs (AddEnumMember): Add support to store the attributes associated
18194 with each member too.
18196 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18197 field builders too - this takes care of the enum member case.
18199 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
18201 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18202 address-of operator on both value types and pointers.
18204 2002-06-10 Martin Baulig <martin@gnome.org>
18206 * interface.cs (Interface.PopulateIndexer): Add the indexer's
18207 PropertyBuilder to the `property_builders' list.
18209 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18210 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18211 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
18212 find any indexers which are inherited from an interface.
18214 2002-06-09 Martin Baulig <martin@gnome.org>
18216 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18217 the same type as the constant if necessary. There's also a test-130.cs
18220 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18222 * typemanager.cs (TypeManager.ChangeType): Previously known as
18223 Enum.ChangeEnumType().
18225 2002-06-09 Martin Baulig <martin@gnome.org>
18227 * expression.cs (Cast.TryReduce): Added support for consts.
18229 2002-06-08 Ravi Pratap <ravi@ximian.com>
18231 * class.cs (Accessor): Hold attributes information so we can pass
18234 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18235 Modify to pass in attributes attached to the methods.
18237 (add_accessor_declaration, remove_accessor_declaration): Ditto.
18239 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18240 to handle the Accessor kind :-)
18242 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18244 2002-06-08 Martin Baulig <martin@gnome.org>
18246 * expression.cs (Unary.TryReduceNegative): Added support for
18249 2002-06-08 Martin Baulig <martin@gnome.org>
18251 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18252 name can't be found in the `defined_names' - the caller will do a
18253 MemberLookup in this case and thus find methods in System.Enum
18254 such as Enum.IsDefined().
18256 2002-06-08 Martin Baulig <martin@gnome.org>
18258 * enum.cs (Enum.ChangeEnumType): This is a custom version of
18259 Convert.ChangeType() which works with TypeBuilder created types.
18260 (Enum.LookupEnumValue, Enum.Define): Use it here.
18262 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18263 `TypeBuilder.BaseType != null' check.
18264 (TypeContainer.FindMembers): Only lookup parent members if we
18265 actually have a parent.
18266 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18267 (ConstructorInitializer.Resolve): Likewise.
18269 * interface.cs (Interface.FindMembers): Added
18270 `TypeBuilder.BaseType != null' check.
18272 * rootcontext.cs (RootContext.ResolveCore): Added
18273 "System.Runtime.CompilerServices.IndexerNameAttribute" to
18274 classes_second_stage.
18276 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18277 debug_type and trace_type when compiling with --nostdlib.
18279 2002-06-07 Martin Baulig <martin@gnome.org>
18281 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18282 (AddField): Set it to true when adding a non-static field.
18283 (DefineType): Use `have_nonstatic_fields' to find out whether we
18284 have non-static fields, not `Fields != null'.
18286 2002-06-02 Miguel de Icaza <miguel@ximian.com>
18288 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18289 dereferencing a null on the static-field code path)
18291 2002-05-30 Martin Baulig <martin@gnome.org>
18293 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18294 to take command line arguments. Use reflection to call the new
18295 custom `Initialize' function on the symbol writer and pass it the
18296 command line arguments.
18298 * driver.cs (--debug-args): New command line argument to pass command
18299 line arguments to the symbol writer.
18301 2002-05-28 Miguel de Icaza <miguel@ximian.com>
18303 * assign.cs (DoResolve): Forgot to do the implicit conversion to
18304 the target type for indexers and properties. Thanks to Joe for
18307 2002-05-27 Miguel de Icaza <miguel@ximian.com>
18309 * typemanager.cs (MethodFlags): returns the method flags
18310 (Obsolete/ShouldIgnore) that control warning emission and whether
18311 the invocation should be made, or ignored.
18313 * expression.cs (Invocation.Emit): Remove previous hack, we should
18314 not do this on matching a base type, we should do this based on an attribute
18316 Only emit calls to System.Diagnostics.Debug and
18317 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18318 on the command line.
18320 * rootcontext.cs: Global settings for tracing and debugging.
18322 * cs-tokenizer.cs (define): New utility function to track
18323 defines. Set the global settings for TRACE and DEBUG if found.
18325 2002-05-25 Ravi Pratap <ravi@ximian.com>
18327 * interface.cs (Populate*): Pass in the TypeContainer as well as
18328 the DeclSpace as parameters so that we can create EmitContexts and
18329 then use that to apply attributes etc.
18331 (PopulateMethod, PopulateEvent, PopulateProperty)
18332 (PopulateIndexer): Apply attributes everywhere.
18334 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18337 (ApplyAttributes): Update accordingly.
18339 We now apply interface attributes for all members too.
18341 2002-05-26 Miguel de Icaza <miguel@ximian.com>
18343 * class.cs (Indexer.Define); Correctly check if we are explicit
18344 implementation (instead of checking the Name for a ".", we
18345 directly look up if the InterfaceType was specified).
18347 Delay the creation of the PropertyBuilder.
18349 Only create the PropertyBuilder if we are not an explicit
18350 interface implementation. This means that explicit interface
18351 implementation members do not participate in regular function
18352 lookups, and hence fixes another major ambiguity problem in
18353 overload resolution (that was the visible effect).
18355 (DefineMethod): Return whether we are doing an interface
18358 * typemanager.cs: Temporary hack until we get attributes in
18359 interfaces (Ravi is working on that) and we get IndexerName
18360 support in interfaces.
18362 * interface.cs: Register the indexers as properties.
18364 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18365 warning, I have verified that this is a bug in the .NET runtime
18366 (JavaScript suffers of the same problem).
18368 * typemanager.cs (MemberLookup): When looking up members for
18369 interfaces, the parent of an interface is the implicit
18370 System.Object (so we succeed in searches of Object methods in an
18371 interface method invocation. Example: IEnumerable x; x.ToString
18374 2002-05-25 Miguel de Icaza <miguel@ximian.com>
18376 * class.cs (Event): Events should also register if they do
18377 implement the methods that an interface requires.
18379 * typemanager.cs (MemberLookup); use the new GetInterfaces
18382 (GetInterfaces): The code used to lookup interfaces for a type is
18383 used in more than one place, factor it here.
18385 * driver.cs: Track the errors at the bottom of the file, we kept
18388 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18389 instance if the method we are calling is static!
18391 2002-05-24 Miguel de Icaza <miguel@ximian.com>
18393 * attribute.cs (ApplyAttributes): Make this function filter out
18394 the IndexerName attribute (as that attribute in reality is never
18395 applied) and return the string constant for the IndexerName
18398 * class.cs (TypeContainer.Emit): Validate that all the indexers
18399 have the same IndexerName attribute, and if so, set the
18400 DefaultName attribute on the class.
18402 * typemanager.cs: The return value might contain other stuff (not
18403 only methods). For instance, consider a method with an "Item"
18404 property and an Item method.
18406 * class.cs: If there is a problem with the parameter types,
18409 2002-05-24 Ravi Pratap <ravi@ximian.com>
18411 * ecore.cs (ImplicitConversionExists): Wrapper function which also
18412 looks at user defined conversion after making a call to
18413 StandardConversionExists - we need this for overload resolution.
18415 * expression.cs : Update accordingly the various method calls.
18417 This fixes 2 bugs filed against implicit user defined conversions
18419 2002-05-22 Miguel de Icaza <miguel@ximian.com>
18421 * statement.cs: Track the result of the assignment.
18423 2002-05-21 Miguel de Icaza <miguel@ximian.com>
18425 * expression.cs (MemberAccess): Improved error reporting for
18426 inaccessible members.
18428 2002-05-22 Martin Baulig <martin@gnome.org>
18430 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
18431 itself with debugging support.
18433 2002-05-22 Martin Baulig <martin@gnome.org>
18435 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18436 Removed, this isn't needed anymore.
18438 2002-05-20 Martin Baulig <martin@gnome.org>
18440 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18441 be underlying type for an enum.
18443 2002-05-20 Miguel de Icaza <miguel@ximian.com>
18445 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18446 that splits out the loading of just the core types.
18448 * rootcontext.cs (ResolveCore): Split the struct resolution in
18449 two, so we can load the enumeration underlying types before any
18452 * expression.cs (Is): Bandaid until we fix properly Switch (see
18453 bug #24985 for details).
18455 * typemanager.cs (ImplementsInterface): The hashtable will contain
18456 a null if there are no interfaces implemented.
18458 2002-05-18 Miguel de Icaza <miguel@ximian.com>
18460 * cs-parser.jay (indexer_declarator): It is fine to have array
18463 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18465 * typemanager.cs: (RegisterBuilder): New function used to register
18466 TypeBuilders that implement interfaces. Since
18467 TypeBuilder.GetInterfaces (as usual) does not work with lame
18469 (AddUserType): register interfaces.
18471 (ImplementsInterface): Use the builder_to_ifaces hash if we are
18472 dealing with TypeBuilder. Also, arrays are showing up as
18473 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18474 methods can not be invoked on them!
18476 * ecore.cs (ExplicitReferenceConversionExists): Made public.
18477 (ImplicitReferenceConversionExists): Split out from
18478 StandardConversionExists.
18480 * expression.cs (As): We were only implementing one of the three
18481 cases for the as operator. We now implement them all.
18482 (Is): Implement the various other cases for Is as well.
18484 * typemanager.cs (CACHE): New define used to control if we want or
18485 not the FindMembers cache. Seems to have a negative impact on
18486 performance currently
18488 (MemberLookup): Nested types have full acess to
18489 enclosing type members
18491 Remove code that coped with instance/static returns for events, we
18492 now catch this in RealFindMembers.
18494 (RealFindMembers): only perform static lookup if the instance
18495 lookup did not return a type or an event.
18497 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18499 * assign.cs (CompoundAssign): We pass more semantic information
18500 now to Compound Assignments than we did before: now we have all
18501 the information at hand, and now we resolve the target *before* we
18502 do the expression expansion, which allows the "CacheValue" method
18503 to have the effect we intended (before, a [x] += 1 would generate
18504 two differen ArrayAccess expressions from the ElementAccess,
18505 during the resolution process).
18507 (CompoundAssign.DoResolve): Resolve target and original_source here.
18509 2002-05-16 Miguel de Icaza <miguel@ximian.com>
18511 * expression.cs (ArrayAccess): dropped debugging information.
18513 * typemanager.cs: Small bug fix: I was always returning i_members,
18514 instead of one of i_members or s_members (depending on which had
18517 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
18518 method is invoked before any code generation takes place, and it
18519 is a mechanism to inform that the expression will be invoked more
18520 than once, and that the method should use temporary values to
18521 avoid having side effects
18523 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18525 * ecore.cs (Expression.CacheTemporaries): Provide empty default
18528 * expression.cs (Indirection, ArrayAccess): Add support for
18529 CacheTemporaries in these two bad boys.
18531 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18532 ldobj or ldind_ref.
18533 (StoreFromPtr): Handle stobj as well.
18535 * expression.cs (UnaryMutator): Share more code.
18537 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18538 down: I was not tracking the Filter function as well, which
18539 was affecting the results of the cache.
18541 2002-05-15 Miguel de Icaza <miguel@ximian.com>
18543 * attribute.cs: Remove the hack to handle the CharSet property on
18546 2002-05-14 Miguel de Icaza <miguel@ximian.com>
18548 * attribute.cs (DoResolve): More uglyness, we now only try to
18549 resolve the attribute partially, to extract the CharSet
18550 information (only if we are a StructLayout attribute). Otherwise
18552 (GetExtraTypeInfo): Add some code to conditionally kill in the
18553 future this. I am more and more convinced that the .NET
18554 framework has special code to handle the attribute setting on
18557 * expression.cs (IsParamsMethodApplicable): Revert my previous
18558 foreach change here, it was wrong.
18560 2002-05-13 Miguel de Icaza <miguel@ximian.com>
18562 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18563 (pp_expr): do not abort on unknown input, just return.
18564 (eval): abort if there are pending chars.
18566 * attribute.cs (Attribute.Resolve): Positional parameters are
18567 optional. Deal with that case.
18569 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18570 the Ansi/Unicode/Auto information for the type.
18572 (TypeContainer.DefineType): instantiate the EmitContext here, as
18573 we will be using it during the type definition (to resolve
18574 attributes) and during the emit phase.
18576 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18577 to pull type information out of the attributes
18579 (Attribute.Resolve): track the constructor builder, and allow for
18580 multiple invocations (structs and classes will use this).
18582 * ecore.cs (MemberLookupFinal): new version with all the
18583 parameters customizable.
18585 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18586 constructors. Return if the result value is null (as the error
18587 would have been flagged already by MemberLookupFinal)
18589 Do not allow instances of abstract classes or interfaces to be
18592 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18593 We have to compare the assembly property here when dealing with
18594 FamANDAssem and Assembly access modifiers, because we might be
18595 creating an assembly from *modules* (that means that we are not
18596 getting TypeBuilders for types defined in other modules that are
18597 part of this assembly).
18599 (Method.Emit): If the method is marked abstract and has a body,
18602 (TypeContainer.DefineMembers): If both the defined member and the
18603 parent name match are methods, then do not emit any warnings: let
18604 the Method.Define routine take care of flagging warnings. But if
18605 there is a mismatch (method overrides something else, or method is
18606 overriwritten by something, then emit warning).
18608 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18609 set to null, this means `do not check for the return type on the
18612 (Method.Define): set the return type for the method signature to
18613 null, so that we get methods with the same name and parameters and
18614 different return types. This is used to flag warning 114 (you are
18615 hiding a method, and you probably want to use the new/override
18618 * typemanager.cs (MemberLookup): Implemented proper access
18619 control, closing a long standing set of bug reports. The problem
18620 was that the Framework only has two bits: Public and NonPublic,
18621 and NonPublic includes private and protected methods, but we need
18622 to enforce the FamANDAssem, FamOrAssem and Family.
18624 2002-05-11 Miguel de Icaza <miguel@ximian.com>
18626 * statement.cs (GotoCase): Return true: Ammounts to giving up
18627 knowledge on whether we return or not, and letting the other case
18628 be responsible for it.
18630 2002-05-10 Miguel de Icaza <miguel@ximian.com>
18632 * driver.cs: Do not load directories for each file processed, only
18633 do it if there is a pattern.
18635 * ecore.cs: Report readonly assigns here as well, as we might have
18636 been resolved only by MemberAccess.
18638 (SimpleName.SimpleNameResolve): Also be useful for LValue
18639 resolution. We need this to propagate assign to local readonly variables
18641 * typemanager.cs: Use a ptrhashtable for the criteria, because we
18642 do not want to reuse potential criteria memory.
18644 * class.cs (MyEventBuilder): Set reflected_type;
18646 * ecore.cs (Constantify): Added support for constifying bools.
18648 (RootContext.LookupType): Added a cache for values looked up in
18649 the declaration space.
18651 * typemanager.cs (FindMembers): Now is a front-end to
18652 RealFindMembers, and provides a two-level hashtable-based cache to
18655 15% performance improvement: from 22.5 to 19.2 seconds.
18657 * expression.cs (IsParamsMethodApplicable): use foreach.
18658 (Invocation.DoResolve): ditto.
18659 (New.DoResolve): ditto.
18660 (ArrayCreation.DoResolve): ditto.
18662 * ecore.cs (FindMostEncompassingType): use foreach.
18664 * delegate.cs (NewDelegate.DoResolve): Use foreach
18666 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18667 (RemoveMethods): use foreach.
18669 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18670 nested foreach statements instead of for, and also break out of
18671 the inner loop once a match is found.
18673 (Invocation.OverloadResolve): Use foreach, simplify the code.
18675 2002-05-08 Miguel de Icaza <miguel@ximian.com>
18677 * cfold.cs (BinaryFold): During an enumeration evaluation context,
18678 we actually unwrap the expression to allow for extra information
18681 * expression.cs: Use Shr_Un on unsigned operations.
18683 2002-05-08 Ravi Pratap <ravi@ximian.com>
18685 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
18686 applicable operators was not being considered correctly. This closes
18687 the bug Miguel reported.
18689 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18691 * attribute.cs: check that the type derives from System.Attribute
18692 and report the correct error in that case (moved the duplicate code to
18693 its own method, too).
18695 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18697 * attribute.cs: lookup attribute type name as the spec says: first the
18698 bare attribute name and then name + "Attribute" (nant compiles with
18699 mcs after this fix).
18701 2002-05-07 Miguel de Icaza <miguel@ximian.com>
18703 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
18704 Because of the way we parse things, we should try to see if a
18705 UIntConstant can fit in an integer.
18707 2002-05-07 Ravi Pratap <ravi@ximian.com>
18709 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18710 when we are in an explicit context.
18712 (ConvertReferenceExplicit): When converting from Iface type S to Class
18713 T make sure the rules are implemented as an OR.
18715 * parameter.cs (ParameterType): Make it a property for now although the
18716 purpose really isn't anything immediate.
18718 * expression.cs (Is*Applicable): Do better checking on the parameter type
18719 of a ref/out parameter. The ones from the system assemblies are already
18720 marked with the correct type so we don't need to do any correction.
18722 * ecore.cs (StandardConversionExists): Conversion from Interface types to
18723 the object type is standard too so include that.
18725 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18727 * ecore.cs (StandardConversionExists): Augment with missing code:
18728 deal with IntConstant, LongConstants and Enumerations.
18730 * assign.cs: Report the error, instead of failing silently
18732 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18733 typecontainer that they are declared, because the
18734 typecontainer/namespace will have the list of using clauses that
18735 need to be applied.
18737 Assembly Attributes were escaping the normal registration
18740 (EmitCode): Apply attributes within an EmitContext that represents
18741 the container they were declared on.
18743 * cs-parser.jay: Track bases for structs. How did I get this wrong?
18745 2002-05-06 Ravi Pratap <ravi@ximian.com>
18747 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18748 Revamp completely - make much cleaner as we now operate only
18751 (FindMostSpecificSource, FindMostSpecificTarget): New methods
18752 to implement the logic detailed in the spec more correctly.
18754 (UserDefinedConversion): Update accordingly.
18756 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18758 * statement.cs: Return flow analysis information up.
18760 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18763 (token): Do not consume an extra character before calling
18766 2002-05-06 Piers Haken <piersh@friskit.com>
18768 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18770 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18772 * class.cs (Constructor.Emit): Set the IsStatic flag in the
18773 EmitContext during the instance constructor initializer
18774 resolution, to stop access to instance variables.
18776 This is mandated by the spec, last paragraph of the `constructor
18777 initializers' section.
18779 2002-05-05 Miguel de Icaza <miguel@ximian.com>
18781 * cs-parser.jay, class.cs (Accessor): new class used to represent
18782 an accessor (get or set). In the past we used `null' to represent
18783 a missing accessor. But this is ambiguous because there was no
18784 way to tell in abstract indexers/properties if one of them was
18787 Now there is a way of addressing that.
18789 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18790 instead of FindMembers.
18792 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18793 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18795 * attribute.cs: Treat indexers and properties as the same in terms
18796 of applying attributes
18798 * ecore.cs (FindMostEncompassedType): Use statically initialized
18799 EmptyExpressions()s like we do elsewhere to avoid creating useless
18800 objects (and we take this out of the tight loop).
18802 (GetConversionOperators): Move the code to extract the actual
18803 operators to a separate routine to clean things up.
18805 2002-05-04 Miguel de Icaza <miguel@ximian.com>
18807 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18808 events are always registered FieldBuilders.
18810 * class.cs (FieldBase): New class shared by Fields
18812 * delegate.cs: If we are a toplevel delegate, use our full name.
18813 If we are a nested delegate, then only use our tail name.
18815 2002-05-02 Ravi Pratap <ravi@ximian.com>
18817 * expression.cs (IsApplicable): Ensure that we add the "&" to
18818 ref/out types before comparing it with the type of the argument.
18820 (IsParamsMethodApplicable): Ditto.
18822 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
18825 * delegate.cs : Handle the case when we have more than one applicable
18826 method. Flag an error only when we finish checking all.
18828 2002-05-02 Miguel de Icaza <miguel@ximian.com>
18830 * expression.cs: Add support for boolean static initializers.
18832 2002-05-01 Miguel de Icaza <miguel@ximian.com>
18834 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18836 * parameter.cs (ComputeParameterTypes,
18837 ComputeAndDefineParameterTypes): Better error handling: now we
18838 clear the `types' cache if we fail during any of the type lookups.
18839 We also return the status code correctly to our caller
18841 * delegate.cs: If we fail to define a delegate, abort the extra
18844 * expression.cs (Binary.ResolveOperator): for
18845 operator==(object,object) and operator !=(object, object) we also
18846 have to verify that there is an implicit conversion from one to
18849 (ArrayAccess.DoResolve): Array Access can operate on
18852 2002-04-30 Miguel de Icaza <miguel@ximian.com>
18854 * assign.cs (CompoundAssign): A new class used as a "flag" that
18855 the assignment actually is happening as part of a compound
18856 assignment operator.
18858 During compound assignment, a few new rules exist to enable things
18865 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18866 to the type of x) if y is implicitly convertible to the type of x,
18867 and the operator is a builtin operator and the return type of the
18868 operator is explicitly convertible to the type of x.
18870 * rootcontext.cs: Reset warning level to 2. 4 catches various
18871 "interesting" features in mcs, we must clean this up at some
18872 point, but currently am trying to kill other bugs ;-)
18874 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18875 in container classes as well.
18877 * expression.cs (Binary.ResolveOperator): Handle string case
18878 before anything else (as operator overloading does emit an error
18879 before doing anything else).
18881 This code could go away when we move to a table driven model, but
18882 i could not come up with a good plan last night.
18884 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
18886 * typemanager.cs (CSharpName): reimplementation using regex.
18887 * class.cs: added null check for fields in Emit
18888 * rootcontext.cs: set warninglevel to 4
18890 2002-04-29 Miguel de Icaza <miguel@ximian.com>
18892 * typemanager.cs (CSharpName): reimplemented with Lupus
18895 2002-04-28 Miguel de Icaza <miguel@ximian.com>
18897 * statement.cs (If): correclty implement Resolve, because we were
18898 not catching sem errors in there. The same process is needed
18900 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18903 (Statement.Warning_DeadCodeFound): Factorize code.
18904 (While): Report dead code here too.
18906 (Statement): Added Resolve virtual method to allow
18907 for resolution split from the emit code.
18909 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18911 * statement.cs (EmitBoolExpression): No longer try to resolve the
18913 (MakeBoolean): New utility function that resolve, implicitly
18914 converts to boolean and tags the expression.
18917 (If, Do): Implement dead code elimination.
18918 (While): Implement loop inversion
18920 (Do, While, For, If): Resolve the expression prior to calling our
18923 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
18926 - added method Report28 (warning: program has more than one entry point)
18927 - added method IsEntryPoint, implements paragraph 10.1 of the spec
18928 - modified method Method.Define, the part at the end of the method
18930 * rootcontext.cs: added static public Location EntryPointLocation;
18932 * ../errors/cs0028.cs : Add test case for the above warning.
18935 - modified method CSharpName to allow arrays of primitive type to
18936 be printed nicely (e.g. instead of System.Int32[][] it now prints
18938 - added method CSharpSignature: returns the signature of a method
18939 in string format to be used in reporting errors, warnings, etc.
18941 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18944 2002-04-26 Ravi Pratap <ravi@ximian.com>
18946 * delegate.cs (Define): Fix extremely silly bug where I was
18947 setting the type of the 'object' parameter of the BeginInvoke
18948 method to System.IAsyncResult instead of System.Object ;-)
18950 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18952 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18955 (Constructor.Emit): return if we fail to initialize the
18956 constructor. Another door closed!
18958 * expression.cs (New.DoResolve): Improve error message (from -6 to
18959 1501). Use DeclaredOnly lookup to find the exact constructor.
18961 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18962 loop. This is useful.
18964 * cs-parser.jay: Adjust the default parameters so that destructors
18965 have the proper signature.
18967 2002-04-26 Martin Baulig <martin@gnome.org>
18969 * driver.cs (LoadAssembly): If `assembly' contains any characters
18970 which are only valid in path names and not in assembly names
18971 (currently slash, backslash and point), use Assembly.LoadFrom ()
18972 instead of Assembly.Load () on the `assembly' (before iteration
18973 over the link_paths).
18975 2002-04-26 Martin Baulig <martin@gnome.org>
18977 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18979 2002-04-25 Miguel de Icaza <miguel@ximian.com>
18981 * class.cs (Property): use the new typemanager.MemberLookup
18983 (TypeContainer.MemberLookup): Implement using the
18984 TypeManager.MemberLookup now.
18986 * typemanager.cs: Make MemberLookup a function of the TypeManager,
18987 and return MemberInfos, so that these can be used without an
18988 EmitContext (what we had before).
18990 2002-04-24 Miguel de Icaza <miguel@ximian.com>
18992 * expression.cs: Fix the case where the argument to params if the
18993 type of the params. I omitted handling this before. Fixed
18995 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18997 * driver.cs: Call BootCorlib_PopulateCoreType
18999 * class.cs (Property.CheckBase): Check for properties only, not
19002 * interface.cs: Temporary hack: try/catch around the
19003 CustomAttributeBuilder, because I am getting an exception that I
19006 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19007 types whose definitions are required to be there (attributes are
19008 defined before standard types).
19010 Compute definitions as we boot the various types, as they are used
19011 immediately (value_type class will need object_type, but if we do
19012 not initialize object_type, we will pass a null, which will let
19013 the runtime pick the System.Object from the existing corlib, which
19014 is not what we want).
19016 2002-04-22 Patrik Torstensson <totte@labs2.com>
19018 * cs-tokenizer.cs: fixed a number of trim() issues.
19020 2002-04-22 Ravi Pratap <ravi@ximian.com>
19022 * expression.cs (Argument.Type): Ensure that we return the correct
19023 type when we have out or ref parameters [in which case we
19026 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19028 * class.cs (Property, Indexer): Allow extern modifier in there.
19030 * typemanager.cs (InitBaseTypes): Initializes object_type and
19031 value_type, since those will be used early on during the bootstrap
19032 process to compile corlib.
19034 (InitCoreTypes): Move code from here to InitBaseTypes.
19036 2002-04-21 Miguel de Icaza <miguel@ximian.com>
19038 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19039 single-dimension arrays as using the ldlen opcode.
19041 Daniel Lewis discovered this optimization.
19043 * typemanager.cs: Add signature for System.Array::get_Length
19045 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19047 * statement.cs: report the error when the foreach does not apply to an
19048 array nor a collection.
19050 2002-04-19 Miguel de Icaza <miguel@ximian.com>
19052 * expression.cs: Add implicit conversions to the operator ~.
19054 * constant.cs (DecimalConstant.Emit): Emit decimal value.
19056 * typemanager.cs: Locate the decimal constructor.
19058 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19060 * attribute.cs: use the new property of TypeOf.
19061 * expression.cs: added 'get' property around typearg.
19063 These changes fix a build breaker reported by NickD. Is this the
19064 correct way to fix? If not, please, revert my changes and make it
19067 2002-04-17 Miguel de Icaza <miguel@ximian.com>
19069 * attribute.cs: Add support for typeof in attribute invocations.
19070 I am not sure that this is right though.
19072 2002-04-14 Duncan Mak <duncan@ximian.com>
19074 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19075 Binary.Operator.Division case.
19077 2002-04-13 Ravi Pratap <ravi@ximian.com>
19079 * class.cs (DefineType): Ensure that we do a proper check on
19080 attribute types and also register it with the TypeManager.
19082 (TypeContainer.Targets): The default for attribute types is
19083 AttributeTargets.All.
19085 * attribute.cs (ApplyAttributes): Registering the attribute type
19086 is done elsewhere, not when we discover we have a Usage attribute.
19088 2002-04-12 Ravi Pratap <ravi@ximian.com>
19090 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19091 and get rid of is_delegate parameter.
19093 * everywhere : update.
19095 2002-04-12 Ravi Pratap <ravi@ximian.com>
19097 * cs-parser.jay (compilation_unit): Revamp completely to use
19098 some new ideas that I got from Rhys' grammar to solve the problems
19099 with assembly level attributes.
19101 (outer_declaration): New grammar production.
19103 (attribute_sections): Add.
19105 (opt_attributes): Base on attribute_sections
19107 (namespace_declaration): Allow opt_attributes to tackle the case
19108 when we have assembly level attributes - we are clever in this
19111 * attribute.cs (ApplyAttributes): Do not worry about assembly
19112 attributes in the non-global context.
19114 * rootcontext.cs (AddGlobalAttributes): Go back to using this
19115 instead of SetGlobalAttributes.
19117 * class.cs, rootcontext.cs : Ensure we define and generate
19118 attribute types before anything else.
19120 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19121 and flag the new error -20 for the case when the attribute type
19122 does not have valid targets specified. csc does not catch this.
19124 * ../errors/errors.txt : update for error # -20
19126 2002-04-11 Ravi Pratap <ravi@ximian.com>
19128 * support.cs (InternalParameters.ParameterModifier): Do some null
19129 checking and return sane values.
19131 * class.cs (Method.Define): If we are a PInvoke method, ensure
19132 that we are static and extern. Report error # 601
19134 * ../errors/cs0601.cs : Add test case for the above error.
19136 2002-04-07 Ravi Pratap <ravi@ximian.com>
19138 * rootcontext.cs (attribute_types): We need to keep type of
19139 all attribute types separately and emit code for them first.
19141 (RegisterAttribute) : Implement.
19143 * class.cs (DefineType): Check if the current Type is a custom
19144 attribute type and register it accordingly.
19146 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19147 adding the first attribute twice and rename to
19149 (SetGlobalAttributes): this.
19151 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19154 * attribute.cs (ApplyAttributes): Take an additional argument telling us
19155 if we are processing global arguments. Hmm, I am unsure of this.
19157 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19159 * expression.cs: added static array of strings to avoid calling
19160 Enum.ToString () for Operator in Binary. Significant recover of
19163 2002-04-10 Miguel de Icaza <miguel@ximian.com>
19165 * class.cs (FindMembers): Allow the Builders of the various
19166 members to be null. If they are skip them. This only happens
19167 during the PInvoke declaration.
19169 2002-04-09 Miguel de Icaza <miguel@ximian.com>
19171 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19172 failure, so we do not keep going afterwards.
19174 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19175 wanted to pass `false' as the `is_delegate' argument. If this is
19176 the case, why not use delegate_type == null to mean `is_delegate =
19177 false' and anything else as is_delegate = true.
19179 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
19181 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19182 code for the section, not the beginning of the tests.
19184 2002-04-08 Miguel de Icaza <miguel@ximian.com>
19186 * cfold.cs: Handle operator + (Enum x, Underlying x)
19188 * expression.cs (Binary): same. Warn about errors where we have
19189 Enum/Enum in operator + as well.
19191 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
19194 - added support for switch(bool)
19195 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19196 - add TableSwitchEmit() to handle table-based switch statements
19198 2002-04-05 Ravi Pratap <ravi@ximian.com>
19200 * expression.cs (Invocation.OverloadResolve): Factor out code which
19201 does parameter compatibility checking with arguments so that we can
19202 re-use the code even from Delegate.VerifyApplicability
19204 (VerifyArgumentsCompat): Move above code here.
19206 * delegate.cs (VerifyApplicability): Get rid of duplicate code
19207 and instead make a call to the above method.
19209 2002-03-31 Ravi Pratap <ravi@ximian.com>
19211 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19212 We use it to keep track of classes which are attribute types.
19214 2002-04-02 Miguel de Icaza <miguel@ximian.com>
19216 * delegate.cs (Delegate.Define): Correctly define the types in the
19217 presence of fixed and array parameters.
19219 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19222 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19223 include NonPublic after the first iteration.
19225 * class.cs (Indexer.CheckBase): Only check if both parents are
19228 * cs-parser.jay (accessor_body): If empty, set to null.
19230 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19231 same code path here to resolve constants names that we did have in
19232 MemberAccess.DoResolve. There is too much code duplicated here.
19234 2002-04-01 Miguel de Icaza <miguel@ximian.com>
19236 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19238 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19241 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19242 tokens, numbers and strings.
19244 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19247 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19248 asyncronous parameters and the regular parameters.
19250 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19251 specify the target directory.
19253 * expression.cs: (This.DoResolve): Simplify
19254 (As.Emit): Optimize, do not generate IsInst if the expression is
19255 always of the given type.
19257 (Is.DoResolve): Bug fix, we were reporting both always/never for
19260 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19261 creating too many unnecessary arrays.
19263 2002-03-31 Miguel de Icaza <miguel@ximian.com>
19265 * class.cs (EmitFieldInitializer): Use Assign expression to assign
19266 fields instead of rolling our own initializer. Takes care of all
19267 implicit conversions, and drops unnecessary static checks/argument.
19269 2002-03-31 Dick Porter <dick@ximian.com>
19271 * driver.cs: use the GetDirectories() return values properly, and
19272 use "/" as path separator.
19274 2002-03-30 Miguel de Icaza <miguel@ximian.com>
19276 * expression.cs (Unary): Optimize - - expr into expr.
19277 (Binary): Optimize a + (-b) into a -b.
19279 * codegen.cs (CodeGen): Made all methods static.
19281 2002-03-29 Miguel de Icaza <miguel@ximian.com>
19285 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19286 TypeBuilder property.
19288 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19291 * tree.cs: Removed the various RecordXXXX, and replaced with a
19292 single RecordDecl. Removed all the accessor methods, and just
19293 left a single access point Type
19295 * enum.cs: Rename DefineEnum to DefineType.
19297 * decl.cs: New abstract method `DefineType' used to unify the
19298 Defines for Enumerations, Interfaces, TypeContainers and
19301 (FindType): Moved LookupInterfaceOrClass here. Moved the
19302 LookupBaseClasses method that used to live in class.cs and
19303 interface.cs here, and renamed to FindType.
19305 * delegate.cs: Implement DefineType. Take advantage of the
19306 refactored pattern for locating the parent builder without taking
19307 the parent_builder argument (which we know does not work if we are
19308 nested, and triggering a toplevel definition).
19310 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19312 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19313 accessibility of a member has changed during override and report
19316 * class.cs (Method.Define, Property.Define): Only complain on
19317 overrides if the method is private, any other accessibility is
19318 fine (and since we just checked the permission is the same, we are
19321 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19322 and elif are processed always. The other pre-processing
19323 directives are only processed if we are "taking" the path
19325 2002-03-29 Martin Baulig <martin@gnome.org>
19327 * class.cs (Method.Emit): Only emit symbolic debugging info if the
19328 current location is not Null.
19330 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19331 a separate method so we can profile it.
19333 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19334 `span.Seconds' are just seconds, but no minutes or hours.
19335 (MainDriver): Profile the CodeGen.SaveSymbols calls.
19337 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19339 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19340 Remove the gratuitous set of Final:
19342 // If an interface implementation, then we can set Final.
19343 if (((flags & MethodAttributes.Abstract) == 0) &&
19344 implementing.DeclaringType.IsInterface)
19345 flags |= MethodAttributes.Final;
19347 I do not know what I was smoking when I used that.
19350 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19351 step into fixing the name resolution issues for delegates and
19352 unifying the toplevel name resolution.
19354 2002-03-28 Martin Baulig <martin@gnome.org>
19356 * class.cs (Method.Emit): If we have a symbol writer, call its
19357 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19358 tell it about the current method.
19360 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19361 writer that we're going to emit the first byte of IL code for a new
19362 statement (a new source line).
19363 (EmitContext.EmitTopBlock): If we have a symbol writer, call
19364 EmitContext.Mark() before emitting any code.
19366 * location.cs (SymbolDocument): Return null when we're Null.
19368 * statement.cs (Statement): Moved the `Location loc' variable here.
19369 (Statement.EmitBoolExpression): If we have a symbol writer, call
19370 ec.Mark() before emitting any code to tell it that we're at the
19371 beginning of a new statement.
19372 (StatementExpression): Added `Location' argument to the constructor.
19373 (Block): Added public readonly variable `StartLocation' and public
19374 variable `EndLocation'. The latter is to be set using SetEndLocation().
19375 (Block): Added constructor which takes a start and end location.
19376 (Block.SetEndLocation): New method. This sets the end location.
19377 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19378 local variables we create.
19379 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19380 each statement and do also mark the begin and end of the block.
19382 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19383 tell it the current lexer.Location, use Location.Null for the end of the
19385 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19386 current block, set its end location using SetEndLocation().
19387 (statement_expression): StatementExpression constructor now takes the
19388 lexer.Location as additional argument.
19389 (for_statement, declare_local_variables): Likewise.
19390 (declare_local_variables): When creating a new implicit block, use the
19391 new Block constructor and pass it the lexer.Location.
19393 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19395 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19396 members also on the parent interfaces recursively.
19398 2002-03-27 Miguel de Icaza <miguel@ximian.com>
19400 * report.cs: Use new formats, since Gonzalo finished the missing
19403 * expression.cs (Binary.ResolveOperator): added missing operator|
19404 operator& and operator^ for bool/bool.
19406 * cs-parser.jay: CheckDef now takes a Location argument that is
19407 used to report errors more precisly (instead of reporting the end
19408 of a definition, we try to track something which is a lot closer
19409 to the source of the problem).
19411 * cs-tokenizer.cs: Track global token use, so we can properly flag
19412 the use of #define/#undef after the first token has been seen.
19414 Also, rename the reportXXXX to Error_DescriptiveName
19416 * decl.cs (DeclSpace.IsTopLevel): Move property here from
19417 TypeContainer, so that Enum and Interface can use this too.
19419 * class.cs (TypeContainer.LookupInterfaceOrClass,
19420 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19421 `builder' argument. Typically this was used to pass the parent
19422 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19425 The problem is that a nested class could trigger the definition of
19426 a toplevel class, and the builder would be obviously wrong in that
19429 So we drop this argument, and we compute dynamically the
19430 TypeBuilder/ModuleBuilder (the correct information was available
19431 to us anyways from DeclSpace.Parent)
19433 * interface.cs (Interface.DefineInterface): Drop builder
19434 parameter cleanup like class.cs
19436 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
19439 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19442 (Try.Emit): Propagate the returns value from the statement.
19444 (Return.Emit): Even if we are leavning
19446 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19448 * modifiers.cs: Fix the computation of MethodAttributes flags.
19450 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19452 * driver.cs: allow compilation of files that start with '/'.
19453 Add a default case when checking the argument of --target.
19455 2002-03-25 Miguel de Icaza <miguel@ximian.com>
19457 * interface.cs: Implement the same search algorithm for types in
19458 the interface code.
19460 * delegate.cs: Do not allow multiple definition.
19462 * Recovered ChangeLog that got accidentally amputated
19464 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19466 * rootcontext.cs: Load manually enum to allow core classes to
19467 contain enumerations.
19469 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19470 Update to new static methods in TypeManager.
19472 * typemanager.cs (GetMethod, GetConstructor): Use our
19473 implementation of FindMembers to find the members, since during
19474 corlib compilation, the types are TypeBuilders and GetMethod and
19475 GetConstructor do not work.
19477 Make all methods in TypeManager static.
19479 (InitCodeHelpers): Split the functionality from
19480 the InitCodeTypes function.
19482 * driver.cs: Call InitCodeHelpers after we have populated the
19485 * cs-parser.jay (delegate_declaration): we did not used to compute
19486 the delegate name correctly for void delegates.
19488 2002-03-24 Miguel de Icaza <miguel@ximian.com>
19490 * rootcontext.cs (RootContext): Init the interface_resolve_order
19491 and type_container_resolve_order always.
19493 (ResolveCore, BootstrapCorlib_ResolveClass,
19494 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19495 compiler when compiling with --nostdlib
19497 * class.cs (TypeContainer.DefineType): Check that our parent is
19498 not null. This test is most important when we are bootstraping
19501 * codegen.cs: Split out the symbol writing code.
19503 2002-03-25 Martin Baulig <martin@gnome.org>
19505 * driver.cs (-g): Made -g an alias for --debug.
19507 2002-03-24 Martin Baulig <martin@gnome.org>
19509 * codegen.cs (SymbolWriter): New public variable. Returns the
19510 current symbol writer.
19511 (CodeGen): Added `bool want_debugging_support' argument to the
19512 constructor. If true, tell the ModuleBuild that we want debugging
19513 support and ask it for the ISymbolWriter.
19514 (Save): If we have a symbol writer, call it's Close() method after
19515 saving the assembly.
19517 * driver.c (--debug): New command line argument to create a
19518 debugger information file.
19520 * location.cs (SymbolDocument): New public property. Returns an
19521 ISymbolDocumentWriter object for the current source file or null
19522 if we don't have a symbol writer.
19524 2002-03-21 Miguel de Icaza <miguel@ximian.com>
19526 * driver.cs (LoadAssembly): Correctly return when all the paths
19527 have been tried and not before.
19529 * statement.cs (Switch.Emit): return the actual coverage for this
19530 statement (returns/not-returns)
19532 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19533 switch of the statement if we are the last switch section. That
19534 kills two problems: try/catch problems (we used to emit an empty
19535 nop at the end) and switch statements where all branches would
19538 2002-03-19 Miguel de Icaza <miguel@ximian.com>
19540 * driver.cs: Add default assemblies (the equivalent to the
19541 Microsoft CSC.RSP file)
19543 * cs-tokenizer.cs: When updating `cols and setting it to zero,
19544 also update tokens_seen and set it to false.
19546 * driver.cs: Implement --recurse for Mike.
19548 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19549 correctly splitting out the paths.
19551 2002-03-18 Miguel de Icaza <miguel@ximian.com>
19553 * interface.cs (Interface.PopulateProperty): Instead of using
19554 `parent' as the declaration space for the set parameters, use
19557 * support.cs (InternalParameters): InternalParameters constructor
19558 takes a DeclSpace instead of a TypeContainer.
19560 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19561 types are being initialized, load the address of it before calling
19564 (New): Provide a mechanism to disable the generation of local
19565 value type temporaries when the caller will be providing us with
19566 an address to store it.
19568 (ArrayCreation.EmitDynamicInitializers): Use it.
19570 2002-03-17 Miguel de Icaza <miguel@ximian.com>
19572 * expression.cs (Invocation.EmitArguments): Only probe for array
19573 property if there is more than one argument. Sorry about that.
19575 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19576 empty param arrays.
19578 * class.cs (Method.LabelParameters): Fix incorrect code path that
19579 prevented the `ParamArrayAttribute' from being applied to the
19582 2002-03-16 Miguel de Icaza <miguel@ximian.com>
19584 * support.cs (ReflectionParameters): Correctly compute whether the
19585 last argument is a params array. Fixes the problem with
19588 * typemanager.cs: Make the assemblies array always be non-null
19589 (empty, but non-null)
19591 * tree.cs (RecordDecl): New function that abstracts the recording
19592 of names. This reports error 101, and provides a pointer to the
19593 previous declaration. Fixes a crash in the compiler.
19595 * cs-parser.jay (constructor_declaration): Update to new grammar,
19596 and provide a constructor_body that can be empty.
19598 2002-03-15 Miguel de Icaza <miguel@ximian.com>
19600 * driver.cs: Add support for --resources.
19602 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19603 Make all types for the various array helper methods be integer.
19605 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19606 CheckState to ConvCast.
19608 (ConvCast): Now it takes a `checked' state argument, to avoid
19609 depending on the emit context for the conversion, and just using
19610 the resolve time setting.
19612 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19613 instead of Invocation.EmitArguments. We do not emit the original
19614 arguments, instead we emit those which have been converted to
19615 unsigned int expressions.
19617 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19619 * codegen.cs: ditto.
19621 * expression.cs (LocalVariableReference): Drop the use of the
19622 Store function that depended on the variable index.
19624 * statement.cs (VariableInfo): Drop the `Idx' property from this
19625 class, as this is not taking into account the indexes for
19626 temporaries tat we generate during the execution, getting the
19629 * class.cs: First emit class initializers, then call the parent
19632 * expression.cs (Binary): Fix opcode emision.
19633 (UnaryMutator.EmitCode): Support checked code generation
19635 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19636 matches for events for both the Static and Instance scans,
19637 pointing to the same element. Fix that.
19639 2002-03-14 Miguel de Icaza <miguel@ximian.com>
19641 * rootcontext.cs (ResolveTree): Always set the
19642 interface_resolve_order, because nested interfaces will be calling
19645 * class.cs (GetInterfaceOrClass): Track the same resolution
19646 process used by TypeManager.LookupType. This fixes the nested
19647 type lookups in class declarations (separate path from
19650 (TypeContainer.DefineType): Also define nested interfaces.
19651 (TypeContainer.RegisterOrder): New public function used to
19652 register the order in which child interfaces need to be closed.
19654 Nested interfaces need to be closed after their parents have been
19657 * interface.cs (InterfaceAttr): Put all the logic for computing
19658 the interface attribute here.
19660 (DefineInterface): Register our interface order with the
19661 RootContext or with the TypeContainer depending on the case.
19663 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19665 * cs-parser.jay: rework foreach statement to work with the new
19666 changes to the policy on SimpleNames.
19668 * report.cs: support Stacktrace on warnings as well.
19670 * makefile: drop --unsafe and /unsafe from the compile.
19672 2002-03-13 Ravi Pratap <ravi@ximian.com>
19674 * ecore.cs (StandardConversionExists): Modify to take an Expression
19675 as the first parameter. Ensure we do null -> reference type conversion
19678 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19679 temporary Expression objects.
19681 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19683 * interface.cs: workaround bug in method overloading resolution
19684 (there is already a bugzilla bug for it).
19686 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19688 We could also solve this problem by having a separate path for
19689 performing type lookups, instead of DoResolve, we could have a
19690 ResolveType entry point, and only participating pieces of the
19691 production (simplename, deref, array) would implement this.
19693 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19694 signal SimpleName to only resolve type names and not attempt to
19695 resolve anything else.
19697 * expression.cs (Cast): Set the flag.
19699 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19701 * class.cs: Only report 108 if there is no `new' modifier.
19703 * cs-parser.jay: rework foreach statement to work with the new
19704 changes to the policy on SimpleNames.
19706 * report.cs: support Stacktrace on warnings as well.
19708 * makefile: drop --unsafe and /unsafe from the compile.
19710 2002-03-11 Miguel de Icaza <miguel@ximian.com>
19712 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19713 lookups here, instead of doing that at parse time. This means
19714 that our grammar will not introduce `LocalVariableReferences' as
19715 expressions at this point. That solves the problem of code like
19719 static void Main ()
19723 This is only half the fix. The full fix requires parameters to
19724 also be handled in this way.
19726 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19727 makes the use more obvious of the DeclSpace. The
19728 ec.TypeContainer.TypeBuilder is now only used to pull the
19729 TypeBuilder for it.
19731 My theory is that I can get rid of the TypeBuilder completely from
19732 the EmitContext, and have typecasts where it is used (from
19733 DeclSpace to where it matters).
19735 The only pending problem is that the code that implements Aliases
19736 is on TypeContainer, and probably should go in DeclSpace.
19738 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19739 lookups here, instead of doing that at parse time. This means
19740 that our grammar will not introduce `LocalVariableReferences' as
19741 expressions at this point. That solves the problem of code like
19745 static void Main ()
19749 This is only half the fix. The full fix requires parameters to
19750 also be handled in this way.
19752 * class.cs (Property.DefineMethod): When implementing an interface
19753 method, set newslot, when implementing an abstract method, do not
19754 set the flag (before we tried never setting it, or always setting
19755 it, which is the difference).
19756 (Indexer.DefineMethod): same.
19757 (Method.DefineMethod): same.
19759 * ecore.cs: Only set the status used flag if we get back a Field.
19761 * attribute.cs: Temporary hack, so Paolo can keep working.
19763 2002-03-08 Ravi Pratap <ravi@ximian.com>
19765 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19766 the unmanaged type in the case we have a MarshalAs attribute.
19768 (Resolve): Handle the case when we are parsing the special MarshalAs
19769 attribute [we need to store the unmanaged type to use later]
19771 * typemanager.cs (marshal_as_attr_type): Built in type for the
19772 MarshalAs Attribute.
19774 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
19775 on parameters and accordingly set the marshalling info.
19777 2002-03-09 Miguel de Icaza <miguel@ximian.com>
19779 * class.cs: Optimizing slightly by removing redundant code after
19780 we switched to the `NoTypes' return value.
19781 (Property.DefineMethod): use NoTypes here too.
19783 This fixes the bug I introduced in my last batch of changes.
19785 2002-03-05 Ravi Pratap <ravi@ximian.com>
19787 * tree.cs (RecordEnum): Add. We now keep track of enums too.
19789 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19790 Enums since those are types too.
19792 * cs-parser.jay (enum_declaration): Record enums as we parse them.
19794 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
19795 thanks to a call during the lookup process.
19797 2002-03-07 Miguel de Icaza <miguel@ximian.com>
19799 * statement.cs (Foreach): Lots of work to accomodate a particular
19800 kind of foreach statement that I had not kept in mind. It is
19801 possible to have foreachs on classes that provide a GetEnumerator
19802 method that return objects that implement the "pattern" for using
19803 a foreach, there is no need to support GetEnumerator
19806 This is needed to compile nant.
19808 * decl.cs: Only report 114 if the member is not `Finalize' and if
19809 the warning level is at least 2.
19811 * class.cs: Moved the compare function from Method to
19814 (MethodSignature.InheritableMemberSignatureCompare): Add new
19815 filter function that is used to extract inheritable methods from a
19818 (Method.Define): Use the new `inheritable_method_signature_filter'
19821 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19824 2002-03-06 Miguel de Icaza <miguel@ximian.com>
19826 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19828 * cs-parser.jay: Add opt_semicolon to the interface declaration.
19830 * expression.cs: Pass location information to
19831 ConvertImplicitStandard.
19833 * class.cs: Added debugging code to track return values from
19836 2002-03-05 Miguel de Icaza <miguel@ximian.com>
19838 * expression.cs (Is.DoResolve): If either side of the `is' is an
19839 interface, do not flag the warning.
19841 * ecore.cs (ImplicitReferenceConversion): We need a separate test
19844 * report.cs: Allow for --fatal to be used with --probe.
19846 * typemanager.cs (NoTypes): Move the definition for the empty Type
19849 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19851 (TypeContainer.DefineProxy): New function used to proxy to parent
19852 implementations when implementing interfaces.
19853 (TypeContainer.ParentImplements): used to lookup if our parent
19854 implements a public function that is required by an interface.
19855 (TypeContainer.VerifyPendingMethods): Hook this up.
19857 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19858 `modules' and `assemblies' arraylists into arrays. We only grow
19859 these are the very early start up of the program, so this improves
19860 the speedof LookupType (nicely measured).
19862 * expression.cs (MakeByteBlob): Replaced unsafe code with
19863 BitConverter, as suggested by Paolo.
19865 * cfold.cs (ConstantFold.Binary): Special case: perform constant
19866 folding of string concatenation, but if either side is a string,
19867 and the other is not, then return null, and let the runtime use
19868 the concatenation on the string plus the object (using
19869 `Object.ToString').
19871 2002-03-04 Miguel de Icaza <miguel@ximian.com>
19873 Constant Folding has been implemented now.
19875 * expression.cs (Unary.Reduce): Do not throw an exception, catch
19876 the error instead on types that are not supported in one's
19879 * constant.cs (Constant and all children): New set of functions to
19880 perform implict and explicit conversions.
19882 * ecore.cs (EnumConstant): Implement the new functions to perform
19883 conversion by proxying to the child expression.
19885 * codegen.cs: (ConstantCheckState): Constant evaluation has its
19886 own separate setting that can not be turned off from the command
19887 line using --unchecked or --checked and is only controlled using
19888 the checked/unchecked statements and expressions. This setting is
19889 used by the constant folder to flag errors.
19891 * expression.cs (CheckedExpr, UncheckedExpr): Set the
19892 ConstantCheckState as well.
19894 During Resolve, they also have to flag the state, because the
19895 constant folder runs completely in the Resolve phase.
19897 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19900 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19902 * cfold.cs: New file, this file contains the constant folder.
19904 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19905 argument to track whether we are using the resulting address to
19906 load or store a value and provide better error messages.
19908 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19909 new AddressOf arguments.
19911 * statement.cs (Foreach.EmitCollectionForeach): Update
19913 * expression.cs (Argument.Emit): Call AddressOf with proper
19914 arguments to track usage.
19916 (New.DoEmit): Call AddressOf with new arguments.
19918 (Unary.Emit): Adjust AddressOf call.
19920 2002-03-01 Ravi Pratap <ravi@ximian.com>
19922 * cs-parser.jay (member_access): Change the case for pre-defined types
19923 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
19926 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19929 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19930 essentially like methods and apply attributes like MethodImplOptions to them too.
19932 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19935 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19936 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19939 * Update code everywhere accordingly.
19941 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19943 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19945 2002-02-28 Ravi Pratap <ravi@ximian.com>
19947 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19948 try performing lookups against those instead of jumping straight into using
19949 the 'using' clauses.
19951 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19953 (LookupType): Perform lookups in implicit parents too.
19955 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19956 sequence as RootContext.LookupType.
19958 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
19959 the various cases of namespace lookups into this method.
19961 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19963 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19964 in positional arguments)
19966 * class.cs (Operator): Update the AllowedModifiers to contain
19969 * cs-parser.jay: Update operator declaration to allow for the
19970 operator body to be empty.
19972 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19975 2002-02-27 Miguel de Icaza <miguel@ximian.com>
19977 * class.cs (Method.Emit): Label parameters.
19979 * driver.cs: Return 1 or 0 as the program exit code.
19981 2002-02-26 Miguel de Icaza <miguel@ximian.com>
19983 * expression.cs: Special case the `null' object when trying to
19984 auto-compute the type, as anything can be explicitly converted to
19987 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19988 spotting this Paolo.
19990 (Expression.ImplicitNumericConversion): Perform comparissions of
19991 the type using the underlying type in the case of an enumeration
19992 rather than using the enumeration type for the compare.
19994 Cope with the underlying == type case, which is not possible to
19997 (Expression.ConvertNumericExplicit): Perform comparissions of
19998 the type using the underlying type in the case of an enumeration
19999 rather than using the enumeration type for the compare.
20001 * driver.cs: If the user does not supply an extension, assume .exe
20003 * cs-parser.jay (if_statement): Rewrote so that we can track the
20004 location for the if statement.
20006 * expression.cs (Binary.ConstantFold): Only concat strings when
20007 the operation is "+", not everything ;-)
20009 * statement.cs (Statement.EmitBoolExpression): Take a location
20011 (If, While, Do): Track location.
20013 * expression.cs (Binary.ResolveOperator): In the object + string
20014 case, I was missing a call to ConvertImplicit
20016 2002-02-25 Ravi Pratap <ravi@ximian.com>
20018 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20019 Location arguments. Ensure we use RootContext.LookupType to do our work
20020 and not try to do a direct Type.GetType and ModuleBuilder.GetType
20022 * interface.cs (PopulateMethod): Handle the type of the parameter being
20025 * expression.cs (Invocation.BetterFunction): Handle the case when we
20026 have a params method with no fixed arguments and a call is made with no
20029 2002-02-25 Miguel de Icaza <miguel@ximian.com>
20031 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20032 the verbatim-string-literal
20034 * support.cs (InternalParameters.ParameterModifier): handle null
20036 (InternalParameters.ParameterType): ditto.
20038 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20039 duplicating the name of the variable parameter.
20040 (GetParameterByName): Fix bug where we were not looking up array
20041 paramters if they were the only present (thanks Paolo!).
20042 (GetParameterInfo): We only have an empty set of types if both
20043 fixed and array are set to null.
20044 (GetParameterInfo-idx): Handle FixedParameter == null
20046 * cs-parser.jay: Handle the case where there is no catch
20047 statements (missing null test).
20049 2002-02-22 Miguel de Icaza <miguel@ximian.com>
20051 * driver.cs (MainDriver): Be conservative on our command line
20054 Catch DirectoryNotFoundException when calling GetFiles.
20056 (SplitPathAndPattern): Used to split the input specification into
20057 a path and a pattern that we can feed to Directory.GetFiles.
20059 2002-02-21 Miguel de Icaza <miguel@ximian.com>
20061 * statement.cs (Fixed): Implement the last case of the Fixed
20062 statement (string handling).
20064 * expression.cs (StringPtr): New class used to return a char * to
20065 a string; Used by the Fixed statement.
20067 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
20069 * expression.cs (Binary.ResolveOperator): Remove redundant
20070 MemberLookup pn parent type.
20071 Optimize union call, we do not need a union if the types are the same.
20072 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20075 Specialize the use of MemberLookup everywhere, instead of using
20076 the default settings.
20078 (StackAlloc): Implement stackalloc keyword.
20080 * cs-parser.jay: Add rule to parse stackalloc.
20082 * driver.cs: Handle /h, /help, /?
20084 * expression.cs (MakeByteBlob): Removed the hacks we had in place
20085 before we supported unsafe code.
20087 * makefile: add --unsafe to the self compilation of mcs.
20089 2002-02-20 Miguel de Icaza <miguel@ximian.com>
20091 * expression.cs (PointerArithmetic): New class that is used to
20092 perform pointer arithmetic.
20093 (Binary.Resolve): Handle pointer arithmetic
20094 Handle pointer comparission.
20095 (ArrayPtr): Utility expression class that is used to take the
20096 address of an array.
20098 (ElementAccess): Implement array access for pointers
20100 * statement.cs (Fixed): Implement fixed statement for arrays, we
20101 are missing one more case before we are done.
20103 * expression.cs (Indirection): Implement EmitAssign and set the
20104 ExprClass to Variable. This allows pointer dereferences to be
20105 treated as variables, and to have values assigned to them.
20107 * ecore.cs (Expression.StoreFromPtr): New utility function to
20108 store values dereferencing.
20110 2002-02-20 Ravi Pratap <ravi@ximian.com>
20112 * expression.cs (Binary.ResolveOperator): Ensure that we are
20113 not trying to operate on a void type - this fixes the reported
20116 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20117 the parent implementation is sealed.
20119 * ../errors/cs0239.cs : Add.
20121 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20123 * typemanager.cs (unverifiable_code_type): Corresponds to
20124 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20125 which have unsafe code in them.
20127 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
20130 2002-02-19 Miguel de Icaza <miguel@ximian.com>
20132 * cs-tokenizer.cs: Add support for @"litreal strings"
20134 Make tokenizer accept pre-processor directives
20135 on any column (remove the old C-like limitation).
20137 * rootcontext.cs (EmitCode): Emit any global attributes.
20138 (AddGlobalAttributes): Used to keep track of assembly attributes.
20140 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20142 * cs-parser.jay: Add support for global attributes.
20144 2002-02-17 Miguel de Icaza <miguel@ximian.com>
20146 * expression.cs (Indirection): New helper class. Unary will
20147 create Indirection classes to be able to implement the
20148 IMemoryLocation interface on it.
20150 2002-02-16 Miguel de Icaza <miguel@ximian.com>
20152 * cs-parser.jay (fixed_statement): reference the right statement.
20154 * statement.cs (Fixed.Emit): Finish implementing the fixed
20155 statement for the &x case.
20157 2002-02-14 Miguel de Icaza <miguel@ximian.com>
20159 * class.cs (Property.Define, Method.Define): Remove newslot when
20162 * modifiers.cs: My use of NewSlot when `Abstract' was set was
20163 wrong. NewSlot should only be used if the `new' keyword is present.
20165 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20166 locating our system dir. Sorry about this.
20168 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20170 * driver.cs (GetSystemDir): Compute correctly the location of our
20171 system assemblies. I was using the compiler directory instead of
20172 the library directory.
20174 2002-02-13 Ravi Pratap <ravi@ximian.com>
20176 * expression.cs (BetterFunction): Put back in what Miguel commented out
20177 since it is the correct fix. The problem is elsewhere ;-)
20179 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20180 parameters of the parms method are themselves compatible or not !
20182 (StandardConversionExists): Fix very dangerous bug where we were forgetting
20183 to check that a class implements an interface before saying that an implicit
20184 conversion was allowed. Use ImplementsInterface to do the checking.
20186 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20188 * class.cs (Method.Define): Track whether we are an explicit
20189 implementation or not. And only call DefineMethodOverride if we
20190 are an explicit implementation.
20192 (Property.DefineMethod): Ditto.
20194 2002-02-11 Ravi Pratap <ravi@ximian.com>
20196 * expression.cs (BetterFunction): Catch hideous bug which was
20197 preventing us from detecting ambiguous calls due to implicit casts i.e
20200 2002-01-29 Miguel de Icaza <miguel@ximian.com>
20202 * support.cs (Pair): Remove un-needed method. I figured why I was
20203 getting the error in cs-parser.jay, the variable in a foreach loop
20204 is readonly, and the compiler does not really treat this as a variable.
20206 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
20207 instead of EQUALS in grammar.
20209 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20211 * expression.cs (Unary.DoResolve): Check whether the argument is
20214 2002-01-28 Miguel de Icaza <miguel@ximian.com>
20216 * support.cs: Api for Pair to set a value. Despite the fact that
20217 the variables are public the MS C# compiler refuses to compile
20218 code that accesses the field if the variable is part of a foreach
20221 * statement.cs (Fixed): Begin implementation of the fixed
20224 (Block.AddVariable): Return the VariableInfo on success and null
20225 on failure instead of true/false.
20227 * cs-parser.jay (foreach): Catch errors on variables already
20228 defined (we were ignoring this value before) and properly unwind
20229 the block hierarchy
20231 (fixed_statement): grammar for the fixed statement.
20233 2002-01-25 Miguel de Icaza <miguel@ximian.com>
20235 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20236 pointer types to be incretemented.
20238 (SizeOf): Implement.
20240 * cs-parser.jay (pointer_member_access): Implement
20241 expr->IDENTIFIER production.
20243 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20244 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20247 (Unary): Implement indirection.
20249 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20250 use in non-unsafe context).
20252 (SimpleName.DoResolve): Check for pointers in field access on safe
20255 (Expression.LoadFromPtr): Factor the load-indirect code in this
20256 function. This was duplicated in UnboxCast and ParameterReference
20258 2002-01-24 Miguel de Icaza <miguel@ximian.com>
20260 * expression.cs (ComposedCast): report an error if a pointer cast
20261 is used in a safe region.
20263 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20264 pointer type casts in unsafe context.
20266 * codegen.cs (EmitContext): Set up IsUnsafe.
20268 * cs-parser.jay (non_expression_type): Add productions for pointer
20271 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20272 code. We should not use force into static mode if the method is
20273 not virtual. Fixes bug in MIS
20275 * statement.cs (Do.Emit, While.Emit, For.Emit,
20276 Statement.EmitBoolExpression): Add support to Do and While to
20277 propagate infinite loop as `I do return' semantics.
20279 Improve the For case to also test for boolean constants.
20281 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20282 to the list of attributes we can add.
20284 Remove `EmitContext' argument.
20286 * class.cs (Method.Define): Apply parameter attributes.
20287 (Constructor.Define): Apply parameter attributes.
20288 (MethodCore.LabelParameters): Move here the core of labeling
20291 * support.cs (ReflectionParameters.ParameterModifier,
20292 InternalParameters.ParameterModifier): Use IsByRef on the type and
20293 only return the OUT bit for these parameters instead of in/out/ref
20296 This is because I miss-understood things. The ParameterInfo.IsIn
20297 and IsOut represent whether the parameter has the [In] and [Out]
20300 2002-01-22 Miguel de Icaza <miguel@ximian.com>
20302 * ecore.cs (FieldExpr.Emit): Release temporaries.
20304 * assign.cs (LocalTemporary.Release): new function.
20306 * codegen.cs (EmitContext.GetTemporaryStorage,
20307 EmitContext.FreeTemporaryStorage): Rework the way we deal with
20308 temporary storage. Now we can "put back" localbuilders when we
20311 2002-01-21 Miguel de Icaza <miguel@ximian.com>
20313 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20314 need to make a copy of the variable to generate verifiable code.
20316 2002-01-19 Miguel de Icaza <miguel@ximian.com>
20318 * driver.cs: Compute dynamically the system directory.
20320 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20321 Slower, but more generally useful. Used by the abstract
20322 registering implementation.
20324 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20325 the rules for the special rule on Type/instances. First check if
20326 we have the same name, and if so, try that special static path
20327 rather than the instance path.
20329 2002-01-18 Miguel de Icaza <miguel@ximian.com>
20331 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20334 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20335 Enum, ValueType, Delegate or Array for non-corlib compiles.
20337 * cs-tokenizer.cs: Catch long identifiers (645)
20339 * typemanager.cs (IndexerPropetyName): Ravi never tested this
20342 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20343 fix, we were returning too early, so we were not registering
20344 pending methods from abstract classes.
20346 Do not register pending methods if the class is abstract.
20348 * expression.cs (Conditional.DoResolve): Report circular implicit
20349 conversions when we neecd to compute it for conditional
20352 (Is.DoResolve): If the expression is always of the provided type,
20353 flag warning 183. If the expression can not ever be of the
20354 provided type flag warning 184.
20356 * class.cs: Catch 169 as well.
20358 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20361 2002-01-18 Nick Drochak <ndrochak@gol.com>
20363 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
20365 2002-01-17 Miguel de Icaza <miguel@ximian.com>
20367 * interface.cs: (PopulateMethod): Check for pointers being defined
20368 only if the unsafe context is active.
20369 (PopulateProperty): ditto.
20370 (PopulateIndexer): ditto.
20372 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20373 specified. If pointers are present, make sure that they are
20374 present in an unsafe context.
20375 (Constructor, Constructor.Define): ditto.
20376 (Field, Field.Define): ditto.
20377 (Property, Property.Define): ditto.
20378 (Event, Event.Define): ditto.
20380 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20381 hashtable if there are classes or structs defined.
20383 * expression.cs (LocalVariableReference.DoResolve): Simplify this
20384 code, as the constant resolution moved.
20386 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20387 the metadata, so we can flag error 133.
20389 * decl.cs (MemberCore.UnsafeOK): New function to test that a
20390 pointer is being declared in an unsafe context.
20392 2002-01-16 Miguel de Icaza <miguel@ximian.com>
20394 * modifiers.cs (Modifiers.Check): Require a Location argument.
20395 Report error 227 for Unsafe use.
20397 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20399 * statement.cs (For.Emit): If the test is null, then report that
20400 we do `return', as we wont reach anything afterwards.
20402 (Switch.SwitchGoverningType): Track the expression that matched
20405 * driver.cs: Allow negative numbers as an error code to flag.
20407 * cs-parser.jay: Handle 1551.
20409 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20411 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20413 * cs-parser.jay: Report 1518 (type declaration can only contain
20414 class, struct, interface, enum or delegate)
20416 (switch_label): Report 1523 (keywords `case' or `default' must
20419 (opt_switch_sections): Report 1522 (empty switch)
20421 * driver.cs: Report 1515 (response file specified multiple times)
20422 Report 1516 (Source file specified multiple times).
20424 * expression.cs (Argument.Resolve): Signal 1510
20426 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20427 access not allowed in static code)
20429 2002-01-11 Ravi Pratap <ravi@ximian.com>
20431 * typemanager.cs (IsPointerType): Utility method which we are going
20434 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20435 the object type, so we take care of that.
20437 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20439 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20440 added to non-params parameters :-)
20442 * typemanager.cs (CSharpName): Include 'void' type too.
20444 (void_ptr_type): Include in the set of core types.
20446 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
20449 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
20452 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
20453 completely forgotten about it.
20455 2002-01-10 Ravi Pratap <ravi@ximian.com>
20457 * cs-parser.jay (pointer_type): Add. This begins our implementation
20458 of parsing rules for unsafe code.
20460 (unsafe_statement): Implement.
20462 (embedded_statement): Modify to include the above.
20464 * statement.cs (Unsafe): Implement new class for unsafe blocks.
20466 * codegen.cs (EmitContext.InUnsafe): Add. This determines
20467 if the current context is an unsafe one.
20469 * cs-parser.jay (local_variable_pointer_type): Since local variable types
20470 are handled differently, we need separate rules for them.
20472 (local_variable_declaration): Update to use local_variable_pointer_type
20473 to allow variable declarations of unmanaged pointer types.
20475 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20476 in unsafe contexts.
20478 * ../errors/cs0214.cs : Add.
20480 2002-01-16 Nick Drochak <ndrochak@gol.com>
20482 * makefile: remove 'response' file when cleaning.
20484 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20486 * cs-parser.jay: Report 1524.
20488 2002-01-14 Miguel de Icaza <miguel@ximian.com>
20490 * typemanager.cs (RegisterMethod): drop checking if we have
20491 registered this from here
20493 2002-01-12 Miguel de Icaza <miguel@ximian.com>
20495 * class.cs (Method.EmitDestructor): Implement calling our base
20498 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20499 value of InFinally.
20501 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20502 this routine and will wrap the call in a try/catch block. Deal
20505 2002-01-11 Miguel de Icaza <miguel@ximian.com>
20507 * ecore.cs (Expression.MemberLookup): instead of taking a
20508 parameter `same_type' that was used to tell whether we could
20509 access private members we compute our containing type from the
20512 (FieldExpr): Added partial support for volatile fields. This does
20513 not work for volatile fields exposed from assemblies, as I can not
20514 figure out how to extract the modreq from it.
20516 Updated all the source files to use this.
20518 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20519 because it is referenced by MemberLookup very often.
20521 2002-01-09 Ravi Pratap <ravi@ximian.com>
20523 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20524 TypeBuilder.GetCustomAttributes to retrieve what we need.
20526 Get rid of redundant default_member_attr_type as this is the same as
20527 default_member_type which already exists.
20529 * interface.cs, attribute.cs : Update accordingly.
20531 2002-01-08 Miguel de Icaza <miguel@ximian.com>
20533 * typemanager.cs: Enable IndexerPropertyName again. It does not
20534 work for TYpeBuilders though. Ravi, can you please fix this?
20536 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20538 * expression.cs (Argument.Emit): Handle the case of ref objects
20539 being passed to ref functions;
20541 (ParameterReference.EmitLoad): Loads the content of the pointer
20542 without dereferencing.
20544 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20546 * cs-tokenizer.cs: Implemented the pre-processing expressions.
20548 2002-01-08 Ravi Pratap <ravi@ximian.com>
20550 * class.cs (Indexer.DefineMethod): Incorporate the interface
20551 type in the name of the method if we are doing explicit interface
20554 * expression.cs (ConversionExists): Remove as it is completely obsolete.
20556 (BetterConversion): Fix extremely trivial bug where we were referring to
20557 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20560 * ../errors/bug16.cs : Add although we have fixed it.
20562 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20564 * expression.cs (BaseIndexer): Begin implementation.
20566 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20568 * cs-parser.jay (indexer_declarator): Use qualified_identifier
20569 production directly to remove a shift/reduce, and implement
20570 explicit interface implementation.
20572 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20573 after a floating point suffix.
20575 * expression.cs (DoNumericPromotions): Improved the conversion for
20576 uint/uint. If we have a constant, we avoid doing a typecast to a
20579 * class.cs (Indexer): Implement explicit interface implementation
20582 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20584 * class.cs: make the default instance constructor public and hidebysig.
20586 2001-01-03 Ravi Pratap <ravi@ximian.com>
20588 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20589 so we can call it from elsewhere.
20591 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20592 we emit it internally if the class has a defined indexer; otherwise the user
20593 emits it by decorating the class definition with the DefaultMemberAttribute.
20595 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20596 attribute is not used on a type which defines an indexer.
20598 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20599 character when we skip whitespace.
20601 * ../errors/cs0646.cs : Add.
20603 2002-01-03 Miguel de Icaza <miguel@ximian.com>
20605 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20608 * makefile: Add practical target `mcs3.exe' which builds the third
20609 generation compiler.
20611 * expression.cs (New): Fix structures constructor calling.
20613 * class.cs (Property, Method, Indexer): Emit Final flag on the
20614 method if we are an interface implementation and we are not
20617 * ecore.cs (PropertyExpr): New public field `IsBase', tells
20618 whether this property is referencing a `base' method.
20620 * expression.cs (Invocation.EmitCall): take an extra argument:
20621 is_base, this is used to determine whether the `call' or
20622 `callvirt' opcode should be used.
20625 * delegate.cs: update EmitCall.
20627 * class.cs (Method.Define): Set NewSlot for the cases where we are
20628 not implementing an interface method.
20630 (Property.Define): ditto.
20632 2002-01-02 Miguel de Icaza <miguel@ximian.com>
20634 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20635 'r'. Allows mcs to parse itself fully.
20637 2002-01-02 Ravi Pratap <ravi@ximian.com>
20639 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20640 of the number of initializers that require the InitializeArray method.
20642 (CheckIndices): Store the Expression in all cases - not the plain value. Also
20643 update the above field where necessary.
20645 (MakeByteBlob): Update accordingly.
20647 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
20650 (EmitDynamicInitializers): Update in accordance with the new optimization.
20652 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20653 same OpCode applies.
20655 * cs-parser.jay : Fix some glaring errors I introduced.
20657 2002-01-01 Ravi Pratap <ravi@ximian.com>
20659 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20660 so that we can check for name clashes there too.
20662 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20663 for interface indexers.
20665 * interfaces.cs (Define): Emit the default member attribute.
20667 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20668 variable was being referred to while setting the value ;-)
20670 2002-01-01 Miguel de Icaza <miguel@ximian.com>
20672 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20673 byte-by-byte information when we know the data is zero.
20675 Make the block always a multiple of 4, because
20676 DefineInitializedData has a bug.
20678 * assign.cs: Fix, we should assign from the temporary, not from
20681 * expression.cs (MakeByteBlob): Fix my incorrect code.
20683 2001-12-31 Miguel de Icaza <miguel@ximian.com>
20685 * typemanager.cs (EnumToUnderlying): This function is used to get
20686 the underlying type from an enumeration, because it does not
20689 * constant.cs: Use the I4_S form for values between -128 and 127.
20691 * statement.cs (Block.LookupLabel): Looks up a label.
20692 (Block): Drop support for labeled blocks.
20694 (LabeledStatement): New kind of statement that represents a label
20697 (Goto): Finally implement this bad boy.
20699 * cs-parser.jay: Update to reflect new mechanism to implement
20702 2001-12-30 Miguel de Icaza <miguel@ximian.com>
20704 * codegen.cs (EmitContext.This): a codegen property that keeps the
20705 a single instance of this instead of creating many different this
20708 * delegate.cs (Delegate.DoResolve): Update to use the property;
20710 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20712 * expression.cs (BaseAccess.DoResolve): Ditto.
20714 2001-12-29 Ravi Pratap <ravi@ximian.com>
20716 * typemanager.cs (methodimpl_attr_type): Add to hold the type
20717 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20719 (InitCoreTypes): Update accordingly.
20721 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20722 so we can quickly store the state.
20724 (ApplyAttributes): Set the correct implementation flags
20725 for InternalCall methods.
20727 2001-12-29 Miguel de Icaza <miguel@ximian.com>
20729 * expression.cs (EmitCall): if a method is not virtual, then do
20730 not use callvirt on it.
20732 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20733 user defined stuff) requires the use of stobj, which takes an
20734 address on the stack instead of an array and an index. So emit
20735 the Ldelema operation for it.
20737 (EmitStoreOpcode): Use stobj for valuetypes.
20739 (UnaryMutator.EmitCode): Use the right 1 value depending on
20740 whether we are dealing with int64/uint64, float or doubles.
20742 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20743 constructors that I implemented last night.
20745 (Constructor.IsDefault): Fix to work properly for static
20748 * cs-parser.jay (CheckDef): report method signature errors.
20749 Update error number 103 to be 132.
20751 * decl.cs: New AdditionResult enumeration value: MethodExists.
20752 Although we do this check for methods later on in the semantic
20753 analysis, catching repeated default constructors is so easy that
20754 we catch these here.
20756 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20759 (ParameterReference.EmitAssign, Emit): handle
20762 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20763 (ArrayAccess.EmitStoreOpcode): ditto.
20765 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20767 * expression.cs (MakeByteBlob): Complete all the missing types
20768 (uint, short, ushort, byte, sbyte)
20770 * class.cs: Only init instance field initializers on instance
20773 Rename `constructors' to instance_constructors.
20775 (TypeContainer.AddConstructor): Only add constructors to the list
20776 if it is not static.
20778 Make sure that we handle default_static_constructor independently
20779 everywhere where we handle instance_constructors
20781 2001-12-28 Miguel de Icaza <miguel@ximian.com>
20783 * class.cs: Do not lookup or create a base initializer for a
20784 static constructor.
20786 (ConstructorInitializer.Resolve): use the proper type to lookup
20789 * cs-parser.jay: Report error 1585 (modifiers between type and name).
20791 * enum.cs, interface.cs: Remove CloseType, this is taken care by
20794 * decl.cs: CloseType is now an virtual method, the default
20795 implementation just closes this type.
20797 2001-12-28 Ravi Pratap <ravi@ximian.com>
20799 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20800 to PreserveSig by default. Also emit HideBySig on such methods.
20802 Basically, set the defaults to standard values.
20804 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20805 argument, if candidate is better, it can't be worse than the best !
20807 (Invocation): Re-write bits to differentiate between methods being
20808 applicable in their expanded form and their normal form - for params
20811 Get rid of use_standard everywhere as only standard conversions are allowed
20812 in overload resolution.
20814 More spec conformance.
20816 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20818 * driver.cs: Add --timestamp, to see where the compiler spends
20821 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20822 `this' in static code.
20824 (SimpleName.DoResolve): Implement in terms of a helper function
20825 that allows static-references to be passed upstream to
20828 (Expression.ResolveWithSimpleName): Resolve specially simple
20829 names when called by MemberAccess to implement the special
20832 (Expression.ImplicitReferenceConversion): Handle conversions from
20833 Null to reference types before others, as Null's type is
20836 * expression.cs (Invocation.EmitCall): Handle the special case of
20837 calling methods declared on a reference type from a ValueType
20838 (Base classes System.Object and System.Enum)
20840 (MemberAccess.Resolve): Only perform lookups on Enumerations if
20841 the left hand side is a TypeExpr, not on every enumeration.
20843 (Binary.Resolve): If types are reference types, then do a cast to
20844 object on operators != and == of both arguments.
20846 * typemanager.cs (FindMembers): Extract instance and static
20847 members if requested.
20849 * interface.cs (PopulateProperty): Use void_type instead of null
20850 as the return type for the setter method.
20852 (PopulateIndexer): ditto.
20854 2001-12-27 Ravi Pratap <ravi@ximian.com>
20856 * support.cs (ReflectionParameters): Fix minor bug where we
20857 were examining the wrong parameter for the ParamArray attribute.
20859 Cope with requests for the type of the parameter at position
20860 greater than the params parameter's. We now return the element
20861 type of the params array as that makes more sense.
20863 * expression.cs (Invocation.IsParamsMethodApplicable): Update
20864 accordingly as we no longer have to extract the element type
20867 (Invocation.OverloadResolve): Update.
20869 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20871 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20872 against IEnumerator, test whether the return value is a descendant
20873 of the IEnumerator interface.
20875 * class.cs (Indexer.Define): Use an auxiliary method to implement
20876 the other bits of the method definition. Begin support for
20877 explicit interface implementation.
20879 (Property.DefineMethod): Use TypeManager.void_type instead of null
20880 for an empty return value.
20882 2001-12-26 Miguel de Icaza <miguel@ximian.com>
20884 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20885 dealing with a FieldExpr which is composed of a FieldBuilder, in
20886 the code path we did extract the constant, but we should have
20887 obtained the underlying value to be able to cast it (otherwise we
20888 end up in an infinite loop, this is what Ravi was running into).
20890 (ArrayCreation.UpdateIndices): Arrays might be empty.
20892 (MemberAccess.ResolveMemberAccess): Add support for section
20893 14.5.4.1 that deals with the special case of E.I when E is a type
20894 and something else, that I can be a reference to a static member.
20896 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20897 handle a particular array type to create byte blobs, it is just
20898 something we dont generate byteblobs for.
20900 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20903 * location.cs (Push): remove the key from the hashtable that we
20904 are about to add. This happens for empty files.
20906 * driver.cs: Dispose files after we have parsed them.
20908 (tokenize): new function that only runs the tokenizer on its
20909 input, for speed testing.
20911 2001-12-26 Ravi Pratap <ravi@ximian.com>
20913 * class.cs (Event.Define): Define the private field only if there
20914 are no accessors defined.
20916 * expression.cs (ResolveMemberAccess): If there is no associated
20917 field with the event, that means we have an event defined with its
20918 own accessors and we should flag error cs0070 since transforming
20919 ourselves into a field is not valid in that case.
20921 * ecore.cs (SimpleName.DoResolve): Same as above.
20923 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20924 and charset to sane values.
20926 2001-12-25 Ravi Pratap <ravi@ximian.com>
20928 * assign.cs (DoResolve): Perform check on events only if they
20929 are being accessed outside the declaring type.
20931 * cs-parser.jay (event_declarations): Update rules to correctly
20932 set the type of the implicit parameter etc.
20934 (add_accessor, remove_accessor): Set current local parameters.
20936 * expression.cs (Binary): For delegate addition and subtraction,
20937 cast the return value from the method into the appropriate delegate
20940 2001-12-24 Ravi Pratap <ravi@ximian.com>
20942 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20943 of these as the workaround is unnecessary.
20945 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20946 delegate data - none of that is needed at all.
20948 Re-write bits to extract the instance expression and the delegate method
20951 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
20954 * attribute.cs (ApplyAttributes): New method to take care of common tasks
20955 of attaching attributes instead of duplicating code everywhere.
20957 * everywhere : Update code to do attribute emission using the above method.
20959 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20961 * expression.cs (IsParamsMethodApplicable): if there are not
20962 parameters, return immediately.
20964 * ecore.cs: The 0 literal can be implicity converted to an enum
20967 (SimpleName.DoResolve): First lookup the type, then lookup the
20970 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20971 want to get its address. If the InstanceExpression is not
20972 addressable, store the result in a temporary variable, then get
20975 * codegen.cs: Only display 219 errors on warning level or above.
20977 * expression.cs (ArrayAccess): Make it implement the
20978 IMemoryLocation interface.
20980 (Binary.DoResolve): handle the operator == (object a, object b)
20981 and operator != (object a, object b) without incurring into a
20982 BoxedCast (because 5 != o should never be performed).
20984 Handle binary enumerator operators.
20986 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20987 value type, otherwise use Ldelem_ref.
20989 Use precomputed names;
20991 (AddressOf): Implement address of
20993 * cs-parser.jay (labeled_statement): Fix recursive block
20994 addition by reworking the production.
20996 * expression.cs (New.DoEmit): New has a special case:
20998 If we are dealing with a ValueType, we have a few
20999 situations to deal with:
21001 * The target of New is a ValueType variable, that is
21002 easy, we just pass this as the variable reference
21004 * The target of New is being passed as an argument,
21005 to a boxing operation or a function that takes a
21008 In this case, we need to create a temporary variable
21009 that is the argument of New.
21012 2001-12-23 Ravi Pratap <ravi@ximian.com>
21014 * rootcontext.cs (LookupType): Check that current_type is not null before
21015 going about looking at nested types.
21017 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21018 not implement the IAssignMethod interface any more.
21020 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21021 where we tranform them into FieldExprs if they are being resolved from within
21022 the declaring type.
21024 * ecore.cs (SimpleName.DoResolve): Do the same here.
21026 * assign.cs (DoResolve, Emit): Clean up code considerably.
21028 * ../errors/bug10.cs : Add.
21030 * ../errors/cs0070.cs : Add.
21032 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21034 * assign.cs : Get rid of EventIsLocal everywhere.
21036 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21038 * ecore.cs (ConvertIntLiteral): finished the implementation.
21040 * statement.cs (SwitchLabel): Convert the value we are using as a
21041 key before looking up the table.
21043 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21045 * codegen.cs (EmitTopBlock): Require a Location argument now.
21047 * cs-parser.jay (constructor_declarator): We need to setup
21048 current_local_parameters before we parse the
21049 opt_constructor_initializer, to allow the variables to be bound
21050 to the constructor arguments.
21052 * rootcontext.cs (LookupType): First lookup nested classes in our
21053 class and our parents before we go looking outside our class.
21055 * expression.cs (ConstantFold): Extract/debox the values at the
21058 * rootcontext.cs (EmitCode): Resolve the constants first before we
21059 resolve the types. This is not really needed, but it helps debugging.
21061 * statement.cs: report location.
21063 * cs-parser.jay: pass location to throw statement.
21065 * driver.cs: Small bug fix.
21067 * report.cs: Updated format to be 4-zero filled digits.
21069 2001-12-22 Ravi Pratap <ravi@ximian.com>
21071 * expression.cs (CheckIndices): Fix minor bug where the wrong
21072 variable was being referred to ;-)
21074 (DoEmit): Do not call EmitStaticInitializers when the
21075 underlying type is System.Object.
21077 2001-12-21 Ravi Pratap <ravi@ximian.com>
21079 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21080 and do the usual workaround for SRE.
21082 * class.cs (MyEventBuilder.EventType): New member to get at the type
21083 of the event, quickly.
21085 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21087 * assign.cs (Assign.DoResolve): Handle the case when the target
21088 is an EventExpr and perform the necessary checks.
21090 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21093 (SimpleName.MemberStaticCheck): Include check for EventExpr.
21095 (EventExpr): Set the type in the constructor itself since we
21096 are meant to be born fully resolved.
21098 (EventExpr.Define): Revert code I wrote earlier.
21100 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21101 instance expression is null. The instance expression is a This in that case
21102 or a null, depending on whether it is a static method or not.
21104 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21105 refers to more than one method.
21107 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21108 and accordingly flag errors.
21110 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21112 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21114 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21116 * location.cs (ToString): Provide useful rutine.
21118 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21120 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21121 objects, return the actual integral boxed.
21123 * statement.cs (SwitchLabel): define an ILLabel for each
21126 (Switch.CheckSwitch): If the value is a Literal, extract
21127 the underlying literal.
21129 Also in the unused hashtable we had, add the SwitchLabel so we can
21130 quickly look this value up.
21132 * constant.cs: Implement a bunch of new constants. Rewrite
21133 Literal based on this. Made changes everywhere to adapt to this.
21135 * expression.cs (Expression.MakeByteBlob): Optimize routine by
21136 dereferencing array only once, and also copes with enumrations.
21138 bytes are two bytes wide, not one.
21140 (Cast): Perform constant conversions.
21142 * ecore.cs (TryImplicitIntConversion): Return literals instead of
21143 wrappers to the literals here.
21145 * expression.cs (DoNumericPromotions): long literals can converted
21146 to ulong implicity (this is taken care of elsewhere, but I was
21147 missing this spot).
21149 * ecore.cs (Expression.Literalize): Make the return type Literal,
21150 to improve type checking.
21152 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21154 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21156 * literal.cs: Revert code from ravi that checked the bounds. The
21157 bounds are sane by the definition of the type itself.
21159 * typemanager.cs: Fix implementation of ImplementsInterface. We
21160 need to actually look up in our parent hierarchy for interfaces
21163 * const.cs: Use the underlying type for enumerations
21165 * delegate.cs: Compute the basename for the delegate creation,
21166 that should fix the delegate test case, and restore the correct
21167 Type Lookup semantics in rootcontext
21169 * rootcontext.cs: Revert Ravi's last patch. The correct way of
21170 referencing a nested type with the Reflection API is using the "+"
21173 * cs-parser.jay: Do not require EOF token at the end.
21175 2001-12-20 Ravi Pratap <ravi@ximian.com>
21177 * rootcontext.cs (LookupType): Concatenate type names with
21178 a '.' instead of a '+' The test suite passes again.
21180 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21181 field of the enumeration.
21183 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21184 the case when the member is an EventExpr.
21186 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21187 static has an associated instance expression.
21189 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21191 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21193 * class.cs (Event.Define): Register event and perform appropriate checks
21196 We define the Add and Remove methods even if the use provides none because
21197 in that case, we provide default implementations ourselves.
21199 Define a private field of the type of the event. This is done by the CSC compiler
21200 and we should be doing it too ;-)
21202 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21203 More methods we use in code we generate.
21205 (multicast_delegate_type, delegate_type): Two separate types since the distinction
21208 (InitCoreTypes): Update accordingly for the above.
21210 * class.cs (Event.Emit): Generate code for default accessors that we provide
21212 (EmitDefaultMethod): Do the job in the above.
21214 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
21217 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21219 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21220 builders even if we were missing one.
21222 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21223 pass the Basename as our class name instead of the Name. The
21224 basename will be correctly composed for us.
21226 * parameter.cs (Paramters): Now takes a Location argument.
21228 * decl.cs (DeclSpace.LookupType): Removed convenience function and
21229 make all the code call directly LookupType in RootContext and take
21230 this chance to pass the Location information everywhere.
21232 * Everywhere: pass Location information.
21234 2001-12-19 Miguel de Icaza <miguel@ximian.com>
21236 * class.cs (Constructor.Define): Updated way of detecting the
21237 length of the parameters.
21239 (TypeContainer.DefineType): Use basename as the type name for
21242 (TypeContainer.Define): Do not recursively define types here, as
21243 definition is taken care in order by the RootContext.
21245 * tree.cs: Keep track of namespaces in a per-file basis.
21247 * parameter.cs (Parameter.ComputeSignature): Update to use
21250 (Parameters.GetSignature): ditto.
21252 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21253 instead of a TypeContainer.
21255 (Interface.SemanticAnalysis): Use `this' instead of our parent to
21256 resolve names. Because we need to be resolve in our context, not
21259 * driver.cs: Implement response files.
21261 * class.cs (TypeContainer.DefineType): If we are defined, do not
21262 redefine ourselves.
21264 (Event.Emit): Emit the code for add/remove handlers.
21265 (Event.Define): Save the MethodBuilders for add/remove.
21267 * typemanager.cs: Use pair here too.
21269 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21270 DictionaryEntry requires the first argument to be non-null.
21272 (enum_declaration): Compute full name for registering the
21275 (delegate_declaration): Instead of using
21276 formal_parameter_list, use opt_formal_parameter_list as the list
21279 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21280 (EventParsing): New property that controls whether `add' and
21281 `remove' are returned as tokens or identifiers (for events);
21283 2001-12-19 Ravi Pratap <ravi@ximian.com>
21285 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21286 use MyEventBuilder only and let it wrap the real builder for us.
21288 (MyEventBuilder): Revamp constructor etc.
21290 Implement all operations that we perform on EventBuilder in precisely the same
21293 (FindMembers): Update to use the EventBuilder member.
21295 (Event.Emit): Update accordingly.
21297 2001-12-18 Ravi Pratap <ravi@ximian.com>
21299 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21300 by calling the appropriate methods.
21302 (GetCustomAttributes): Make stubs as they cannot possibly do anything
21305 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21307 2001-12-17 Ravi Pratap <ravi@ximian.com>
21309 * delegate.cs (Delegate.Populate): Check that the return type
21310 and various parameters types are indeed accessible.
21312 * class.cs (Constructor.Define): Same here.
21314 (Field.Define): Ditto.
21316 (Event.Define): Ditto.
21318 (Operator.Define): Check that the underlying Method defined itself
21319 correctly - so it's MethodBuilder should not be null.
21321 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21322 expression happens to be null.
21324 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21325 members but as of now we don't seem to be able to do anything really useful with it.
21327 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21328 not the EventBuilder.
21330 2001-12-18 Miguel de Icaza <miguel@ximian.com>
21332 * cs-tokenizer.cs: Add support for defines.
21333 Add support for #if, #elif, #else, #endif
21335 (eval_var): evaluates a variable.
21336 (eval): stubbed for evaluating functions.
21338 * cs-parser.jay: Pass the defines information
21340 * driver.cs: Add --define command line option.
21342 * decl.cs: Move MemberCore here.
21344 Make it the base class for DeclSpace. This allows us to catch and
21345 report 108 and 109 for everything now.
21347 * class.cs (TypeContainer.Define): Extract all the members
21348 before populating and emit the warning 108 (new keyword required
21349 to override) instead of having each member implement this.
21351 (MemberCore.Define): New abstract method, we will be using this in
21352 the warning reporting engine in Populate.
21354 (Operator.Define): Adjust to new MemberCore protocol.
21356 * const.cs (Const): This does not derive from Expression, it is a
21357 temporary object we use to create fields, it is a MemberCore.
21359 * class.cs (Method.Define): Allow the entry point to be in a
21362 * driver.cs: Rewrite the argument handler to clean it up a bit.
21364 * rootcontext.cs: Made it just an auxiliary namespace feature by
21365 making everything static.
21367 * driver.cs: Adapt code to use RootContext type name instead of
21370 * delegate.cs: Remove RootContext argument.
21372 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21375 * class.cs (Event.Define): The lookup can fail.
21377 * cs-tokenizer.cs: Begin implementation of pre-procesor.
21379 * expression.cs: Resolve the this instance before invoking the code.
21381 2001-12-17 Miguel de Icaza <miguel@ximian.com>
21383 * cs-parser.jay: Add a production in element_access that allows
21384 the thing to become a "type" reference. This way we can parse
21385 things like "(string [])" as a type.
21387 Note that this still does not handle the more complex rules of
21391 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
21393 * ecore.cs: (CopyNewMethods): new utility function used to
21394 assemble the list of methods from running FindMembers.
21396 (MemberLookup): Rework FindMembers so that
21398 2001-12-16 Miguel de Icaza <miguel@ximian.com>
21400 * class.cs (TypeContainer): Remove Delegates who fail to be
21403 * delegate.cs (Populate): Verify that we dont get null return
21404 values. TODO: Check for AsAccessible.
21406 * cs-parser.jay: Use basename to emit error 574 (destructor should
21407 have the same name as container class), not the full name.
21409 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21410 possible representation.
21412 Also implements integer type suffixes U and L.
21414 2001-12-15 Miguel de Icaza <miguel@ximian.com>
21416 * expression.cs (ArrayCreation.DoResolve): We need to do the
21417 argument resolution *always*.
21419 * decl.cs: Make this hold the namespace. Hold the root context as
21421 (LookupType): Move here.
21423 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21425 * location.cs (Row, Name): Fixed the code, it was always returning
21426 references to the first file.
21428 * interface.cs: Register properties defined through interfaces.
21430 * driver.cs: Add support for globbing on the command line
21432 * class.cs (Field): Make it derive from MemberCore as well.
21435 2001-12-15 Ravi Pratap <ravi@ximian.com>
21437 * class.cs (Event::Define): Check that the type of the event is a delegate
21438 type else flag error #66.
21440 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21443 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21444 values of EntryPoint, CharSet etc etc.
21446 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21448 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21449 be null and we should ignore this. I am not sure if this is really clean. Apparently,
21450 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21451 which needs this to do its work.
21453 * ../errors/cs0066.cs : Add.
21455 2001-12-14 Miguel de Icaza <miguel@ximian.com>
21457 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21460 * class.cs: (MethodSignature.MethodSignature): Removed hack that
21461 clears out the parameters field.
21462 (MemberSignatureCompare): Cleanup
21464 (MemberCore): New base class used to share code between MethodCore
21467 (RegisterRequiredImplementations) BindingFlags.Public requires
21468 either BindingFlags.Instace or Static. Use instance here.
21470 (Property): Refactored code to cope better with the full spec.
21472 * parameter.cs (GetParameterInfo): Return an empty array instead
21475 * class.cs (Property): Abstract or extern properties have no bodies.
21477 * parameter.cs (GetParameterInfo): return a zero-sized array.
21479 * class.cs (TypeContainer.MethodModifiersValid): Move all the
21480 method modifier validation to the typecontainer so we can reuse
21481 this on properties.
21483 (MethodCore.ParameterTypes): return an empty sized array of types.
21485 (Property.Define): Test property modifier validity.
21487 Add tests for sealed/override too.
21489 (Method.Emit): abstract or extern methods have no bodies.
21491 2001-12-14 Ravi Pratap <ravi@ximian.com>
21493 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21496 (Method::Define, ::Emit): Modify accordingly.
21498 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21500 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21502 * makefile: Pass in /unsafe.
21504 2001-12-13 Miguel de Icaza <miguel@ximian.com>
21506 * class.cs (MakeKey): Kill routine.
21508 * class.cs (TypeContainer.Define): Correctly define explicit
21509 method implementations (they require the full interface name plus
21512 * typemanager.cs: Deply the PtrHashtable here and stop using the
21513 lame keys. Things work so much better.
21515 This of course broke everyone who depended on `RegisterMethod' to
21516 do the `test for existance' test. This has to be done elsewhere.
21518 * support.cs (PtrHashtable): A hashtable that avoid comparing with
21519 the object stupid Equals method (because, that like fails all over
21520 the place). We still do not use it.
21522 * class.cs (TypeContainer.SetRequiredInterface,
21523 TypeContainer.RequireMethods): Killed these two routines and moved
21524 all the functionality to RegisterRequiredImplementations.
21526 (TypeContainer.RegisterRequiredImplementations): This routine now
21527 registers all the implementations required in an array for the
21528 interfaces and abstract methods. We use an array of structures
21529 which can be computed ahead of time to reduce memory usage and we
21530 also assume that lookups are cheap as most classes will not
21531 implement too many interfaces.
21533 We also avoid creating too many MethodSignatures.
21535 (TypeContainer.IsInterfaceMethod): Update and optionally does not
21536 clear the "pending" bit if we find that there are problems with
21539 (TypeContainer.VerifyPendingMethods): Update to report errors of
21540 methods that look like implementations but are not.
21542 (TypeContainer.Define): Add support for explicit interface method
21545 2001-12-12 Miguel de Icaza <miguel@ximian.com>
21547 * typemanager.cs: Keep track of the parameters here instead of
21548 being a feature of the TypeContainer.
21550 * class.cs: Drop the registration of parameters here, as
21551 InterfaceMethods are also interface declarations.
21553 * delegate.cs: Register methods with the TypeManager not only with
21554 the TypeContainer. This code was buggy.
21556 * interface.cs: Full registation here.
21558 2001-12-11 Miguel de Icaza <miguel@ximian.com>
21560 * expression.cs: Remove reducer for binary expressions, it can not
21563 * const.cs: Put here the code that used to go into constant.cs
21565 * constant.cs: Put here the code for constants, this is a new base
21566 class for Literals.
21568 * literal.cs: Make Literal derive from Constant.
21570 2001-12-09 Miguel de Icaza <miguel@ximian.com>
21572 * statement.cs (Return.Emit): Report error 157 if the user
21573 attempts to return from a finally block.
21575 (Return.Emit): Instead of emitting a return, jump to the end of
21578 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21579 LocalBuilder to store the result of the function. ReturnLabel is
21580 the target where we jump.
21583 2001-12-09 Radek Doulik <rodo@ximian.com>
21585 * cs-parser.jay: remember alias in current namespace
21587 * ecore.cs (SimpleName::DoResolve): use aliases for types or
21590 * class.cs (LookupAlias): lookup alias in my_namespace
21592 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21594 (LookupAlias): lookup alias in this and if needed in parent
21597 2001-12-08 Miguel de Icaza <miguel@ximian.com>
21601 * rootcontext.cs: (ModuleBuilder) Made static, first step into
21602 making things static. I need this to avoid passing the
21603 TypeContainer when calling ParameterType.
21605 * support.cs (InternalParameters.ParameterType): Remove ugly hack
21606 that did string manipulation to compute the type and then call
21607 GetType. Use Parameter.ParameterType instead.
21609 * cs-tokenizer.cs: Consume the suffix for floating values.
21611 * expression.cs (ParameterReference): figure out whether this is a
21612 reference parameter or not. Kill an extra variable by computing
21613 the arg_idx during emission.
21615 * parameter.cs (Parameters.GetParameterInfo): New overloaded
21616 function that returns whether a parameter is an out/ref value or not.
21618 (Parameter.ParameterType): The type of the parameter (base,
21619 without ref/out applied).
21621 (Parameter.Resolve): Perform resolution here.
21622 (Parameter.ExternalType): The full type (with ref/out applied).
21624 * statement.cs (Using.Emit, Using.EmitExpression): Implement
21625 support for expressions on the using statement.
21627 2001-12-07 Miguel de Icaza <miguel@ximian.com>
21629 * statement.cs (Using.EmitLocalVariableDecls): Split the
21630 localvariable handling of the using statement.
21632 (Block.EmitMeta): Keep track of variable count across blocks. We
21633 were reusing slots on separate branches of blocks.
21635 (Try.Emit): Emit the general code block, we were not emitting it.
21637 Check the type of the declaration to be an IDisposable or
21638 something that can be implicity converted to it.
21640 Emit conversions if required.
21642 * ecore.cs (EmptyExpression): New utility class.
21643 (Expression.ImplicitConversionExists): New utility function.
21645 2001-12-06 Miguel de Icaza <miguel@ximian.com>
21647 * statement.cs (Using): Implement.
21649 * expression.cs (LocalVariableReference): Support read only variables.
21651 * statement.cs: Remove the explicit emit for the Leave opcode.
21652 (VariableInfo): Add a readonly field.
21654 2001-12-05 Miguel de Icaza <miguel@ximian.com>
21656 * ecore.cs (ConvCast): new class used to encapsulate the various
21657 explicit integer conversions that works in both checked and
21658 unchecked contexts.
21660 (Expression.ConvertNumericExplicit): Use new ConvCast class to
21661 properly generate the overflow opcodes.
21663 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21665 * statement.cs: The correct type for the EmptyExpression is the
21666 element_type, not the variable type. Ravi pointed this out.
21668 2001-12-04 Ravi Pratap <ravi@ximian.com>
21670 * class.cs (Method::Define): Handle PInvoke methods specially
21671 by using DefinePInvokeMethod instead of the usual one.
21673 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21674 above to do the task of extracting information and defining the method.
21676 2001-12-04 Ravi Pratap <ravi@ximian.com>
21678 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21679 of the condition for string type.
21681 (Emit): Move that here.
21683 (ArrayCreation::CheckIndices): Keep string literals in their expression
21686 (EmitDynamicInitializers): Handle strings appropriately.
21688 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21690 * codegen.cs (EmitContext): Replace multiple variables with a
21691 single pointer to the current Switch statement.
21693 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21696 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21700 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21703 (Foreach.Emit): Foreach on arrays was not setting
21704 up the loop variables (for break/continue).
21706 (GotoCase): Semi-implented.
21708 2001-12-03 Ravi Pratap <ravi@ximian.com>
21710 * attribute.cs (CheckAttribute): Handle system attributes by using
21711 Attribute.GetAttributes to examine information we need.
21713 (GetValidPlaces): Same here.
21715 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21717 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21719 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21721 (Method::Define): Set appropriate flags if we have a DllImport attribute.
21723 (Method::Emit): Handle the case when we are a PInvoke method.
21725 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21727 * expression.cs: Use ResolveWithSimpleName on compound names.
21729 2001-12-02 Ravi Pratap <ravi@ximian.com>
21731 * constant.cs (EmitConstant): Make sure we resolve the associated expression
21732 before trying to reduce it.
21734 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21736 * constant.cs (LookupConstantValue): Implement.
21738 (EmitConstant): Use the above in emitting the constant.
21740 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21741 that are user-defined by doing a LookupConstantValue on them.
21743 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21746 2001-11-29 Miguel de Icaza <miguel@ximian.com>
21748 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21750 (BaseAccess.DoResolve): Implement.
21752 (MemberAccess.DoResolve): Split this routine into a
21753 ResolveMemberAccess routine that can be used independently
21755 2001-11-28 Miguel de Icaza <miguel@ximian.com>
21757 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21758 As that share bits of the implementation. Is returns a boolean,
21759 while As returns the Type that is being probed.
21761 2001-12-01 Ravi Pratap <ravi@ximian.com>
21763 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21764 instead of a Literal - much easier.
21766 (EnumInTransit): Remove - utterly useless :-)
21768 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21770 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21772 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21773 chain when we have no associated expression.
21775 2001-11-30 Ravi Pratap <ravi@ximian.com>
21777 * constant.cs (Define): Use Location while reporting the errror.
21779 Also emit a warning when 'new' is used and there is no inherited
21782 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
21785 (LookupEnumValue): Implement to lookup an enum member's value and define it
21788 (Populate): Re-write accordingly to use the above routine.
21790 2001-11-27 Miguel de Icaza <miguel@ximian.com>
21792 * expression.cs (This): Fix prototype for DoResolveLValue to
21793 override the base class DoResolveLValue.
21795 * cs-parser.cs: Report errors cs574 and cs575 (destructor
21798 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21799 (we need to load the address of the field here). This fixes
21802 (FieldExpr.DoResolveLValue): Call the DoResolve
21803 function to initialize the Instance expression.
21805 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21806 correctly the GetEnumerator operation on a value type.
21808 * cs-parser.jay: Add more simple parsing error catches.
21810 * statement.cs (Switch): Add support for string switches.
21811 Handle null specially.
21813 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
21815 2001-11-28 Ravi Pratap <ravi@ximian.com>
21817 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21819 (declare_local_constant): New helper function.
21821 * statement.cs (AddConstant): Keep a separate record of constants
21823 (IsConstant): Implement to determine if a variable is a constant.
21825 (GetConstantExpression): Implement.
21827 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21829 * statement.cs (IsVariableDefined): Re-write.
21831 2001-11-27 Ravi Pratap <ravi@ximian.com>
21833 * class.cs (TypeContainer::FindMembers): Look for constants
21834 in the case when we are looking for MemberTypes.Field
21836 * expression.cs (MemberAccess::DoResolve): Check that in the
21837 case we are a FieldExpr and a Literal, we are not being accessed
21838 by an instance reference.
21840 * cs-parser.jay (local_constant_declaration): Implement.
21842 (declaration_statement): Implement for constant declarations.
21844 2001-11-26 Miguel de Icaza <miguel@ximian.com>
21846 * statement.cs (Switch): Catch double defaults.
21848 (Switch): More work on the switch() statement
21849 implementation. It works for integral values now, need to finish
21853 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21855 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21856 integer literals into other integer literals. To be used by
21859 2001-11-24 Ravi Pratap <ravi@ximian.com>
21861 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21864 (EmitDynamicInitializers): Cope with the above since we extract data
21865 directly from ArrayData now.
21867 (ExpectInitializers): Keep track of whether initializers are mandatory
21870 (Bounds): Make it a hashtable to prevent the same dimension being
21871 recorded for every element in that dimension.
21873 (EmitDynamicInitializers): Fix bug which prevented the Set array method
21876 Also fix bug which was causing the indices to be emitted in the reverse
21879 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21881 * expression.cs (ArrayCreation): Implement the bits that Ravi left
21882 unfinished. They do not work, because the underlying code is
21885 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21887 * cs-parser.jay: Remove bogus fixme.
21889 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21890 on Switch statement.
21892 2001-11-23 Ravi Pratap <ravi@ximian.com>
21894 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21897 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21898 parameter. Apparently, any expression is allowed.
21900 (ValidateInitializers): Update accordingly.
21902 (CheckIndices): Fix some tricky bugs thanks to recursion.
21904 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
21905 I was being completely brain-dead.
21907 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21908 and re-write acordingly.
21910 (DelegateInvocation): Re-write accordingly.
21912 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21914 (MakeByteBlob): Handle types more correctly.
21916 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21917 initialization from expressions but it is incomplete because I am a complete
21920 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21922 * statement.cs (If.Emit): Fix a bug that generated incorrect code
21923 on If. Basically, we have to return `true' (ie, we do return to
21924 our caller) only if both branches of the if return.
21926 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21927 short-circuit operators, handle them as short circuit operators.
21929 (Cast.DoResolve): Resolve type.
21930 (Cast.Cast): Take an expression as the target type.
21932 * cs-parser.jay (cast_expression): Remove old hack that only
21933 allowed a limited set of types to be handled. Now we take a
21934 unary_expression and we resolve to a type during semantic
21937 Use the grammar productions from Rhys to handle casts (this is
21938 not complete like Rhys syntax yet, we fail to handle that corner
21939 case that C# has regarding (-x), but we will get there.
21941 2001-11-22 Ravi Pratap <ravi@ximian.com>
21943 * class.cs (EmitFieldInitializer): Take care of the case when we have a
21944 field which is an array type.
21946 * cs-parser.jay (declare_local_variables): Support array initialization too.
21948 * typemanager.cs (MakeKey): Implement.
21950 (everywhere): Use the above appropriately.
21952 * cs-parser.jay (for_statement): Update for array initialization while
21953 declaring variables.
21955 * ecore.cs : The error message was correct, it's the variable's names that
21956 were misleading ;-) Make the code more readable.
21958 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21959 the correct type etc.
21961 (ConvertExplicit): Handle Enum types by examining the underlying type.
21963 2001-11-21 Ravi Pratap <ravi@ximian.com>
21965 * parameter.cs (GetCallingConvention): Always return
21966 CallingConventions.Standard for now.
21968 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21970 * expression.cs (Binary.ResolveOperator): Update the values of `l'
21971 and `r' after calling DoNumericPromotions.
21973 * ecore.cs: Fix error message (the types were in the wrong order).
21975 * statement.cs (Foreach.ProbeCollectionType): Need to pass
21976 BindingFlags.Instance as well
21978 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21979 implicit int literal conversion in an empty cast so that we
21980 propagate the right type upstream.
21982 (UnboxCast): new class used to unbox value types.
21983 (Expression.ConvertExplicit): Add explicit type conversions done
21986 (Expression.ImplicitNumericConversion): Oops, forgot to test for
21987 the target type before applying the implicit LongLiterals to ULong
21990 2001-11-21 Miguel de Icaza <miguel@ximian.com>
21992 * cs-parser.jay (for_statement): Reworked the way For works: now
21993 we declare manually any variables that are introduced in
21994 for_initializer to solve the problem of having out-of-band code
21995 emition (that is what got for broken).
21997 (declaration_statement): Perform the actual variable declaration
21998 that used to be done in local_variable_declaration here.
22000 (local_variable_declaration): Do not declare anything, just pass
22001 the information on a DictionaryEntry
22003 2001-11-20 Ravi Pratap <ravi@ximian.com>
22005 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22006 re-write of the logic to now make it recursive.
22008 (UpdateIndices): Re-write accordingly.
22010 Store element data in a separate ArrayData list in the above methods.
22012 (MakeByteBlob): Implement to dump the array data into a byte array.
22014 2001-11-19 Ravi Pratap <ravi@ximian.com>
22016 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22019 * constant.cs (Define): Implement.
22021 (EmitConstant): Re-write fully.
22023 Pass in location info.
22025 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22028 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22029 DictionaryEntry since we need location info too.
22031 (constant_declaration): Update accordingly.
22033 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22034 code into another method : UpdateIndices.
22036 2001-11-18 Ravi Pratap <ravi@ximian.com>
22038 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22039 some type checking etc.
22041 2001-11-17 Ravi Pratap <ravi@ximian.com>
22043 * expression.cs (ArrayCreation::ValidateInitializers): Implement
22044 bits to provide dimension info if the user skips doing that.
22046 Update second constructor to store the rank correctly.
22048 2001-11-16 Ravi Pratap <ravi@ximian.com>
22050 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22051 and try to implement.
22053 * ../errors/cs0150.cs : Add.
22055 * ../errors/cs0178.cs : Add.
22057 2001-11-16 Miguel de Icaza <miguel@ximian.com>
22059 * statement.cs: Implement foreach on multi-dimensional arrays.
22061 * parameter.cs (Parameters.GetParameterByName): Also lookup the
22062 name of the params argument.
22064 * expression.cs: Use EmitStoreOpcode to get the right opcode while
22065 initializing the array.
22067 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22068 we can use this elsewhere.
22070 * statement.cs: Finish implementation of foreach for single
22073 * cs-parser.jay: Use an out-of-band stack to pass information
22074 around, I wonder why I need this.
22076 foreach_block: Make the new foreach_block the current_block.
22078 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22079 function used to return a static Parameters structure. Used for
22080 empty parameters, as those are created very frequently.
22082 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22084 2001-11-15 Ravi Pratap <ravi@ximian.com>
22086 * interface.cs : Default modifier is private, not public. The
22087 make verify test passes again.
22089 2001-11-15 Ravi Pratap <ravi@ximian.com>
22091 * support.cs (ReflectionParameters): Fix logic to determine
22092 whether the last parameter is a params one. Test 9 passes again.
22094 * delegate.cs (Populate): Register the builders we define with
22095 RegisterParameterForBuilder. Test 19 passes again.
22097 * cs-parser.jay (property_declaration): Reference $6 instead
22098 of $$ to get at the location.
22100 (indexer_declaration): Similar stuff.
22102 (attribute): Ditto.
22104 * class.cs (Property): Register parameters for the Get and Set methods
22105 if they exist. Test 23 passes again.
22107 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22108 call to EmitArguments as we are sure there aren't any params arguments.
22109 Test 32 passes again.
22111 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22112 IndexOutOfRangeException.
22114 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22115 Test 33 now passes again.
22117 2001-11-15 Miguel de Icaza <miguel@ximian.com>
22119 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22120 broke a bunch of things. Will have to come up with a better way
22121 of tracking locations.
22123 * statement.cs: Implemented foreach for single dimension arrays.
22125 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22127 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22128 an error. This removes the lookup from the critical path.
22130 * cs-parser.jay: Removed use of temporary_loc, which is completely
22133 2001-11-14 Miguel de Icaza <miguel@ximian.com>
22135 * support.cs (ReflectionParameters.ParameterModifier): Report
22136 whether the argument is a PARAMS argument or not.
22138 * class.cs: Set the attribute `ParamArrayAttribute' on the
22139 parameter argument.
22141 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22142 and cons_param_array_attribute (ConstructorInfo for
22143 ParamArrayAttribute).,
22145 * codegen.cs: Emit the return using the `Return' statement, that
22146 way we can report the error correctly for missing return values.
22148 * class.cs (Method.Emit): Clean up.
22150 * expression.cs (Argument.Resolve): Take another argument: the
22151 location where this argument is used. Notice that this is not
22152 part of the "Argument" class as to reduce the size of the
22153 structure (we know the approximate location anyways).
22155 Test if the argument is a variable-reference, if not, then
22156 complain with a 206.
22158 (Argument.Emit): Emit addresses of variables.
22160 (Argument.FullDesc): Simplify.
22162 (Invocation.DoResolve): Update for Argument.Resolve.
22164 (ElementAccess.DoResolve): ditto.
22166 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22167 method should be virtual, as this method is always virtual.
22169 (NewDelegate.DoResolve): Update for Argument.Resolve.
22171 * class.cs (ConstructorInitializer.DoResolve): ditto.
22173 * attribute.cs (Attribute.Resolve): ditto.
22175 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22177 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22179 * expression.cs (ParameterReference): Drop IStackStorage and implement
22180 IAssignMethod instead.
22182 (LocalVariableReference): ditto.
22184 * ecore.cs (FieldExpr): Drop IStackStorage and implement
22185 IAssignMethod instead.
22187 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22189 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22190 enumerations that are used in heavily used structures derive from
22191 byte in a laughable and pathetic attempt to reduce memory usage.
22192 This is the kind of pre-optimzations that you should not do at
22193 home without adult supervision.
22195 * expression.cs (UnaryMutator): New class, used to handle ++ and
22196 -- separatedly from the other unary operators. Cleans up the
22197 code, and kills the ExpressionStatement dependency in Unary.
22199 (Unary): Removed `method' and `Arguments' from this class, making
22200 it smaller, and moving it all to SimpleCall, so I can reuse this
22201 code in other locations and avoid creating a lot of transient data
22202 strucutres when not required.
22204 * cs-parser.jay: Adjust for new changes.
22206 2001-11-11 Miguel de Icaza <miguel@ximian.com>
22208 * enum.cs (Enum.Populate): If there is a failure during
22211 * cs-parser.jay (opt_enum_base): we used to catch type errors
22212 here, but this is really incorrect. The type error should be
22213 catched during semantic analysis.
22215 2001-12-11 Ravi Pratap <ravi@ximian.com>
22217 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22218 current_local_parameters as expected since I, in my stupidity, had forgotten
22221 * attribute.cs (GetValidPlaces): Fix stupid bug.
22223 * class.cs (Method::Emit): Perform check on applicability of attributes.
22225 (Constructor::Emit): Ditto.
22227 (Field::Emit): Ditto.
22229 (Field.Location): Store location information.
22231 (Property, Event, Indexer, Operator): Ditto.
22233 * cs-parser.jay (field_declaration): Pass in location for each field.
22235 * ../errors/cs0592.cs : Add.
22237 2001-11-12 Ravi Pratap <ravi@ximian.com>
22239 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22241 (InitCoreTypes): Update accordingly.
22243 (RegisterAttrType, LookupAttr): Implement.
22245 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22246 info about the same.
22248 (Resolve): Update to populate the above as necessary.
22250 (Error592): Helper.
22252 (GetValidPlaces): Helper to the above.
22254 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22256 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22258 2001-11-12 Ravi Pratap <ravi@ximian.com>
22260 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22262 * ../errors/cs0617.cs : Add.
22264 2001-11-11 Ravi Pratap <ravi@ximian.com>
22266 * enum.cs (Emit): Rename to Populate to be more consistent with what
22267 we expect it to do and when exactly it is called.
22269 * class.cs, rootcontext.cs : Update accordingly.
22271 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22272 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22274 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22276 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22277 of a fieldinfo using the above, when dealing with a FieldBuilder.
22279 2001-11-10 Ravi Pratap <ravi@ximian.com>
22281 * ../errors/cs0031.cs : Add.
22283 * ../errors/cs1008.cs : Add.
22285 * ../errrors/cs0543.cs : Add.
22287 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22290 (FindMembers): Implement.
22292 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22293 enums and delegates too.
22295 (enum_types): Rename to builder_to_enum.
22297 (delegate_types): Rename to builder_to_delegate.
22299 * delegate.cs (FindMembers): Implement.
22301 2001-11-09 Ravi Pratap <ravi@ximian.com>
22303 * typemanager.cs (IsEnumType): Implement.
22305 * enum.cs (Emit): Re-write parts to account for the underlying type
22306 better and perform checking etc.
22308 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22309 of the underlying type.
22311 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22314 * enum.cs (error31): Helper to report error #31.
22316 * cs-parser.jay (enum_declaration): Store location of each member too.
22318 * enum.cs (member_to_location): New hashtable.
22320 (AddEnumMember): Update location hashtable.
22322 (Emit): Use the location of each member while reporting errors.
22324 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22326 * cs-parser.jay: A for_initializer if is a
22327 local_variable_declaration really ammount to have an implicit
22328 block with the variable declaration and no initializer for for.
22330 * statement.cs (For.Emit): Cope with null initializers.
22332 This fixes the infinite loop on for initializers.
22334 2001-11-08 Miguel de Icaza <miguel@ximian.com>
22336 * enum.cs: More cleanup.
22338 * ecore.cs: Remove dead code.
22340 * class.cs (Property.Emit): More simplification.
22341 (Event.Emit): ditto.
22343 Reworked to have less levels of indentation.
22345 2001-11-08 Ravi Pratap <ravi@ximian.com>
22347 * class.cs (Property): Emit attributes.
22357 * enum.cs (Emit): Ditto.
22359 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22362 * class.cs (Field, Event, etc.): Move attribute generation into the
22363 Emit method everywhere.
22365 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22366 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22367 as we had no way of defining nested enums !
22369 * rootcontext.cs : Adjust code accordingly.
22371 * typemanager.cs (AddEnumType): To keep track of enum types separately.
22373 2001-11-07 Ravi Pratap <ravi@ximian.com>
22375 * expression.cs (EvalConstantExpression): Move into ecore.cs
22377 * enum.cs (Enum): Rename some members and make them public and readonly
22378 according to our convention.
22380 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22383 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22385 (Enum::Emit): Write a simple version for now which doesn't try to compute
22386 expressions. I shall modify this to be more robust in just a while.
22388 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22390 (TypeContainer::CloseType): Create the Enum types too.
22392 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22394 * expression.cs (EvalConstantExpression): Get rid of completely.
22396 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22397 user-defined values and other cases.
22399 (IsValidEnumLiteral): Helper function.
22401 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
22402 out there in the case we had a literal FieldExpr.
22404 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22406 (Literalize): Revamp a bit to take two arguments.
22408 (EnumLiteral): New class which derives from Literal to wrap enum literals.
22410 2001-11-06 Ravi Pratap <ravi@ximian.com>
22412 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22414 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22416 (Resolve): Use the above to ensure we have proper initializers.
22418 2001-11-05 Ravi Pratap <ravi@ximian.com>
22420 * expression.cs (Expression::EvalConstantExpression): New method to
22421 evaluate constant expressions.
22423 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22425 2001-11-07 Miguel de Icaza <miguel@ximian.com>
22427 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22430 (Binary.ResolveOperator): Handle operator != (object a, object b)
22431 and operator == (object a, object b);
22433 (Binary.DoNumericPromotions): Indicate whether the numeric
22434 promotion was possible.
22436 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22439 Made the ArrayAccess implement interface IAssignMethod instead of
22440 IStackStore as the order in which arguments are passed reflects
22443 * assign.cs: Instead of using expr.ExprClass to select the way of
22444 assinging, probe for the IStackStore/IAssignMethod interfaces.
22446 * typemanager.cs: Load InitializeArray definition.
22448 * rootcontext.cs (RootContext.MakeStaticData): Used to define
22449 static data that can be used to initialize arrays.
22451 2001-11-05 Miguel de Icaza <miguel@ximian.com>
22453 * expression.cs: Handle operator== and operator!= for booleans.
22455 (Conditioal.Reduce): Implement reducer for the ?: operator.
22457 (Conditional.Resolve): Implement dead code elimination.
22459 (Binary.Resolve): Catch string literals and return a new
22460 concatenated string.
22462 (Unary.Reduce): Implement reduction of unary expressions.
22464 * ecore.cs: Split out the expression core handling here.
22466 (Expression.Reduce): New method used to perform constant folding
22467 and CSE. This is needed to support constant-expressions.
22469 * statement.cs (Statement.EmitBoolExpression): Pass true and false
22470 targets, and optimize for !x.
22472 2001-11-04 Ravi Pratap <ravi@ximian.com>
22474 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22475 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22476 set custom atttributes.
22478 * literal.cs (Literal::GetValue): New abstract method to return the actual
22479 value of the literal, cast as an object.
22481 (*Literal): Implement GetValue method.
22483 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22484 expressions to the arraylist but objects of type Argument.
22486 * class.cs (TypeContainer::Emit): Emit our attributes too.
22488 (Method::Emit, Constructor::Emit): Ditto.
22490 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22491 to be ignoring earlier.
22493 2001-11-03 Ravi Pratap <ravi@ximian.com>
22495 * attribute.cs (AttributeSection::Define): Implement to do the business
22496 of constructing a CustomAttributeBuilder.
22498 (Attribute): New trivial class. Increases readability of code.
22500 * cs-parser.jay : Update accordingly.
22502 (positional_argument_list, named_argument_list, named_argument): New rules
22504 (attribute_arguments): Use the above so that we are more correct.
22506 2001-11-02 Ravi Pratap <ravi@ximian.com>
22508 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22509 to perform all checks for a method with a params parameter.
22511 (Invocation::OverloadResolve): Update to use the above method and therefore
22512 cope correctly with params method invocations.
22514 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
22517 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22518 constructors in our parent too because we can't afford to miss out on
22521 * attribute.cs (AttributeSection): New name for the class Attribute
22523 Other trivial changes to improve readability.
22525 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22526 use the new class names.
22528 2001-11-01 Ravi Pratap <ravi@ximian.com>
22530 * class.cs (Method::Define): Complete definition for params types too
22532 (Indexer::Define): Ditto.
22534 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22535 Cope everywhere with a request for info about the array parameter.
22537 2001-11-01 Ravi Pratap <ravi@ximian.com>
22539 * tree.cs (RecordNamespace): Fix up to check for the correct key.
22541 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
22542 local_variable_type to extract the string corresponding to the type.
22544 (local_variable_type): Fixup the action to use the new helper method.
22546 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
22549 * expression.cs : Clean out code which uses the above.
22551 2001-10-31 Ravi Pratap <ravi@ximian.com>
22553 * typemanager.cs (RegisterMethod): Check if we already have an existing key
22554 and bale out if necessary by returning a false.
22556 (RegisterProperty): Ditto.
22558 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22559 and print out appropriate error messages.
22561 * interface.cs (everywhere): Ditto.
22563 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22564 location to constructor.
22566 * class.cs (Property, Event, Indexer): Update accordingly.
22568 * ../errors/cs111.cs : Added.
22570 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22571 of a method, as laid down by the spec.
22573 (Invocation::OverloadResolve): Use the above method.
22575 2001-10-31 Ravi Pratap <ravi@ximian.com>
22577 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22578 now take a TypeContainer and a Parameters object.
22580 (ParameterData): Modify return type of ParameterModifier method to be
22581 Parameter.Modifier and not a string.
22583 (ReflectionParameters, InternalParameters): Update accordingly.
22585 * expression.cs (Argument::GetParameterModifier): Same here.
22587 * support.cs (InternalParameters::ParameterType): Find a better way of determining
22588 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22589 symbol in it at all so maybe this is only for now.
22591 2001-10-30 Ravi Pratap <ravi@ximian.com>
22593 * support.cs (InternalParameters): Constructor now takes an extra argument
22594 which is the actual Parameters class.
22596 (ParameterDesc): Update to provide info on ref/out modifiers.
22598 * class.cs (everywhere): Update call to InternalParameters to pass in
22599 the second argument too.
22601 * support.cs (ParameterData): Add ParameterModifier, which is a method
22602 to return the modifier info [ref/out etc]
22604 (InternalParameters, ReflectionParameters): Implement the above.
22606 * expression.cs (Argument::ParameterModifier): Similar function to return
22607 info about the argument's modifiers.
22609 (Invocation::OverloadResolve): Update to take into account matching modifiers
22612 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22613 a new SetFormalParameters object which we pass to InternalParameters.
22615 2001-10-30 Ravi Pratap <ravi@ximian.com>
22617 * expression.cs (NewArray): Merge into the ArrayCreation class.
22619 2001-10-29 Ravi Pratap <ravi@ximian.com>
22621 * expression.cs (NewArray): Merge classes NewBuiltinArray and
22622 NewUserdefinedArray into one as there wasn't much of a use in having
22625 * expression.cs (Argument): Change field's name to ArgType from Type.
22627 (Type): New readonly property which returns the proper type, taking into
22628 account ref/out modifiers.
22630 (everywhere): Adjust code accordingly for the above.
22632 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22633 whether we are emitting for a ref or out parameter.
22635 * expression.cs (Argument::Emit): Use the above field to set the state.
22637 (LocalVariableReference::Emit): Update to honour the flag and emit the
22640 * parameter.cs (Attributes): Set the correct flags for ref parameters.
22642 * expression.cs (Argument::FullDesc): New function to provide a full desc.
22644 * support.cs (ParameterData): Add method ParameterDesc to the interface.
22646 (ReflectionParameters, InternalParameters): Implement the above method.
22648 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22651 (Invocation::FullMethodDesc): Ditto.
22653 2001-10-29 Miguel de Icaza <miguel@ximian.com>
22655 * cs-parser.jay: Add extra production for the second form of array
22658 * expression.cs (ArrayCreation): Update to reflect the above
22661 * Small changes to prepare for Array initialization.
22663 2001-10-28 Miguel de Icaza <miguel@ximian.com>
22665 * typemanager.cs (ImplementsInterface): interface might be null;
22666 Deal with this problem;
22668 Also, we do store negative hits on the cache (null values), so use
22669 this instead of calling t.GetInterfaces on the type everytime.
22671 2001-10-28 Ravi Pratap <ravi@ximian.com>
22673 * typemanager.cs (IsBuiltinType): New method to help determine the same.
22675 * expression.cs (New::DoResolve): Get rid of array creation code and instead
22676 split functionality out into different classes.
22678 (New::FormArrayType): Move into NewBuiltinArray.
22680 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22683 (NewBuiltinArray): New class to handle creation of built-in arrays.
22685 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22686 account creation of one-dimensional arrays.
22688 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22690 (NewUserdefinedArray::DoResolve): Implement.
22692 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22694 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22695 we maintain inside the TypeManager. This is necessary to perform lookups on the
22698 (LookupType): Update to perform GetType on the module builders too.
22700 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22702 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22704 2001-10-23 Ravi Pratap <ravi@ximian.com>
22706 * expression.cs (New::DoResolve): Implement guts of array creation.
22708 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22710 2001-10-27 Miguel de Icaza <miguel@ximian.com>
22712 * expression.cs: Fix bug I introduced lsat night that broke
22715 (Expression.Resolve): Report a 246 error (can not resolve name)
22716 if we find a SimpleName in the stream.
22718 (Expression.ResolveLValue): Ditto.
22720 (Expression.ResolveWithSimpleName): This function is a variant of
22721 ResolveName, this one allows SimpleNames to be returned without a
22722 warning. The only consumer of SimpleNames is MemberAccess
22724 2001-10-26 Miguel de Icaza <miguel@ximian.com>
22726 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22727 might arrive here. I have my doubts that this is correct.
22729 * statement.cs (Lock): Implement lock statement.
22731 * cs-parser.jay: Small fixes to support `lock' and `using'
22733 * cs-tokenizer.cs: Remove extra space
22735 * driver.cs: New flag --checked, allows to turn on integer math
22738 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22739 Threading.Monitor.Exit
22741 2001-10-23 Miguel de Icaza <miguel@ximian.com>
22743 * expression.cs (IndexerAccess::DoResolveLValue): Set the
22744 Expression Class to be IndexerAccess.
22746 Notice that Indexer::DoResolve sets the eclass to Value.
22748 2001-10-22 Miguel de Icaza <miguel@ximian.com>
22750 * class.cs (TypeContainer::Emit): Emit code for indexers.
22752 * assign.cs (IAssignMethod): New interface implemented by Indexers
22753 and Properties for handling assignment.
22755 (Assign::Emit): Simplify and reuse code.
22757 * expression.cs (IndexerAccess, PropertyExpr): Implement
22758 IAssignMethod, clean up old code.
22760 2001-10-22 Ravi Pratap <ravi@ximian.com>
22762 * typemanager.cs (ImplementsInterface): New method to determine if a type
22763 implements a given interface. Provides a nice cache too.
22765 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22768 (ConvertReferenceExplicit): Ditto.
22770 * delegate.cs (Delegate::Populate): Update to define the parameters on the
22771 various methods, with correct names etc.
22773 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
22774 Operator.UnaryNegation.
22776 * cs-parser.jay (operator_declarator): Be a little clever in the case where
22777 we have a unary plus or minus operator.
22779 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
22782 * everywhere : update accordingly.
22784 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22787 * class.cs (Method::Define): For the case where we are implementing a method
22788 inherited from an interface, we need to set the MethodAttributes.Final flag too.
22789 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22791 2001-10-21 Ravi Pratap <ravi@ximian.com>
22793 * interface.cs (FindMembers): Implement to work around S.R.E
22796 * typemanager.cs (IsInterfaceType): Implement.
22798 (FindMembers): Update to handle interface types too.
22800 * expression.cs (ImplicitReferenceConversion): Re-write bits which
22801 use IsAssignableFrom as that is not correct - it doesn't work.
22803 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22804 and accordingly override EmitStatement.
22806 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22807 using the correct logic :-)
22809 2001-10-19 Ravi Pratap <ravi@ximian.com>
22811 * ../errors/cs-11.cs : Add to demonstrate error -11
22813 2001-10-17 Miguel de Icaza <miguel@ximian.com>
22815 * assign.cs (Assign::Resolve): Resolve right hand side first, and
22816 then pass this as a hint to ResolveLValue.
22818 * expression.cs (FieldExpr): Add Location information
22820 (FieldExpr::LValueResolve): Report assignment to readonly
22823 (Expression::ExprClassFromMemberInfo): Pass location information.
22825 (Expression::ResolveLValue): Add new method that resolves an
22828 (Expression::DoResolveLValue): Default invocation calls
22831 (Indexers): New class used to keep track of indexers in a given
22834 (IStackStore): Renamed from LValue, as it did not really describe
22835 what this did. Also ResolveLValue is gone from this interface and
22836 now is part of Expression.
22838 (ElementAccess): Depending on the element access type
22840 * typemanager.cs: Add `indexer_name_type' as a Core type
22841 (System.Runtime.CompilerServices.IndexerNameAttribute)
22843 * statement.cs (Goto): Take a location.
22845 2001-10-18 Ravi Pratap <ravi@ximian.com>
22847 * delegate.cs (Delegate::VerifyDelegate): New method to verify
22848 if two delegates are compatible.
22850 (NewDelegate::DoResolve): Update to take care of the case when
22851 we instantiate a delegate from another delegate.
22853 * typemanager.cs (FindMembers): Don't even try to look up members
22854 of Delegate types for now.
22856 2001-10-18 Ravi Pratap <ravi@ximian.com>
22858 * delegate.cs (NewDelegate): New class to take care of delegate
22861 * expression.cs (New): Split the delegate related code out into
22862 the NewDelegate class.
22864 * delegate.cs (DelegateInvocation): New class to handle delegate
22867 * expression.cs (Invocation): Split out delegate related code into
22868 the DelegateInvocation class.
22870 2001-10-17 Ravi Pratap <ravi@ximian.com>
22872 * expression.cs (New::DoResolve): Implement delegate creation fully
22873 and according to the spec.
22875 (New::DoEmit): Update to handle delegates differently.
22877 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22878 because of which we were printing out arguments in reverse order !
22880 * delegate.cs (VerifyMethod): Implement to check if the given method
22881 matches the delegate.
22883 (FullDelegateDesc): Implement.
22885 (VerifyApplicability): Implement.
22887 * expression.cs (Invocation::DoResolve): Update to accordingly handle
22888 delegate invocations too.
22890 (Invocation::Emit): Ditto.
22892 * ../errors/cs1593.cs : Added.
22894 * ../errors/cs1594.cs : Added.
22896 * delegate.cs (InstanceExpression, TargetMethod): New properties.
22898 2001-10-16 Ravi Pratap <ravi@ximian.com>
22900 * typemanager.cs (intptr_type): Core type for System.IntPtr
22902 (InitCoreTypes): Update for the same.
22904 (iasyncresult_type, asynccallback_type): Ditto.
22906 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22909 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22912 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22913 the builders for the 4 members of a delegate type :-)
22915 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22918 * expression.cs (New::DoResolve): Implement guts for delegate creation.
22920 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22922 2001-10-15 Miguel de Icaza <miguel@ximian.com>
22924 * statement.cs (Break::Emit): Implement.
22925 (Continue::Emit): Implement.
22927 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
22928 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
22929 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
22930 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
22933 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22934 properties that track the label for the current loop (begin of the
22935 loop and end of the loop).
22937 2001-10-15 Ravi Pratap <ravi@ximian.com>
22939 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22940 use of emitting anything at all.
22942 * class.cs, rootcontext.cs : Get rid of calls to the same.
22944 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22946 (Populate): Define the constructor correctly and set the implementation
22949 * typemanager.cs (delegate_types): New hashtable to hold delegates that
22952 (AddDelegateType): Implement.
22954 (IsDelegateType): Implement helper method.
22956 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22958 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22959 and accordingly handle it.
22961 * delegate.cs (Populate): Take TypeContainer argument.
22962 Implement bits to define the Invoke method. However, I still haven't figured out
22963 how to take care of the native int bit :-(
22965 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
22966 Qualify the name of the delegate, not its return type !
22968 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22971 (StandardConversionExists): Checking for array types turns out to be recursive.
22973 (ConvertReferenceExplicit): Implement array conversion.
22975 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22977 2001-10-12 Ravi Pratap <ravi@ximian.com>
22979 * cs-parser.jay (delegate_declaration): Store the fully qualified
22980 name as it is a type declaration.
22982 * delegate.cs (ReturnType, Name): Rename members to these. Make them
22985 (DefineDelegate): Renamed from Define. Does the same thing essentially,
22986 as TypeContainer::DefineType.
22988 (Populate): Method in which all the definition of the various methods (Invoke)
22991 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22994 (CloseDelegate): Finally creates the delegate.
22996 * class.cs (TypeContainer::DefineType): Update to define delegates.
22997 (Populate, Emit and CloseType): Do the same thing here too.
22999 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23000 delegates in all these operations.
23002 2001-10-14 Miguel de Icaza <miguel@ximian.com>
23004 * expression.cs: LocalTemporary: a new expression used to
23005 reference a temporary that has been created.
23007 * assign.cs: Handle PropertyAccess back here, so that we can
23008 provide the proper semantic access to properties.
23010 * expression.cs (Expression::ConvertReferenceExplicit): Implement
23011 a few more explicit conversions.
23013 * modifiers.cs: `NEW' modifier maps to HideBySig.
23015 * expression.cs (PropertyExpr): Make this into an
23016 ExpressionStatement, and support the EmitStatement code path.
23018 Perform get/set error checking, clean up the interface.
23020 * assign.cs: recognize PropertyExprs as targets, and if so, turn
23021 them into toplevel access objects.
23023 2001-10-12 Miguel de Icaza <miguel@ximian.com>
23025 * expression.cs: PropertyExpr::PropertyExpr: use work around the
23028 * typemanager.cs: Keep track here of our PropertyBuilders again to
23029 work around lameness in SRE.
23031 2001-10-11 Miguel de Icaza <miguel@ximian.com>
23033 * expression.cs (LValue::LValueResolve): New method in the
23034 interface, used to perform a second resolution pass for LValues.
23036 (This::DoResolve): Catch the use of this in static methods.
23038 (This::LValueResolve): Implement.
23040 (This::Store): Remove warning, assigning to `this' in structures
23043 (Invocation::Emit): Deal with invocation of
23044 methods on value types. We need to pass the address to structure
23045 methods rather than the object itself. (The equivalent code to
23046 emit "this" for structures leaves the entire structure on the
23047 stack instead of a pointer to it).
23049 (ParameterReference::DoResolve): Compute the real index for the
23050 argument based on whether the method takes or not a `this' pointer
23051 (ie, the method is static).
23053 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23054 value types returned from functions when we need to invoke a
23055 method on the sturcture.
23058 2001-10-11 Ravi Pratap <ravi@ximian.com>
23060 * class.cs (TypeContainer::DefineType): Method to actually do the business of
23061 defining the type in the Modulebuilder or Typebuilder. This is to take
23062 care of nested types which need to be defined on the TypeBuilder using
23063 DefineNestedMethod.
23065 (TypeContainer::GetClassBases): Implement. Essentially the code from the
23066 methods in RootContext, only ported to be part of TypeContainer.
23068 (TypeContainer::GetInterfaceOrClass): Ditto.
23070 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23072 * interface.cs (Interface::DefineInterface): New method. Does exactly
23073 what RootContext.CreateInterface did earlier, only it takes care of nested types
23076 (Interface::GetInterfaces): Move from RootContext here and port.
23078 (Interface::GetInterfaceByName): Same here.
23080 * rootcontext.cs (ResolveTree): Re-write.
23082 (PopulateTypes): Re-write.
23084 * class.cs (TypeContainer::Populate): Populate nested types too.
23085 (TypeContainer::Emit): Emit nested members too.
23087 * typemanager.cs (AddUserType): Do not make use of the FullName property,
23088 instead just use the name argument passed in as it is already fully
23091 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23092 to TypeContainer mapping to see if a type is user-defined.
23094 * class.cs (TypeContainer::CloseType): Implement.
23096 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23097 the default constructor.
23099 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23102 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23104 * interface.cs (CloseType): Create the type here.
23106 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23109 Remove all the methods which are now in TypeContainer.
23111 2001-10-10 Ravi Pratap <ravi@ximian.com>
23113 * delegate.cs (Define): Re-write bits to define the delegate
23116 2001-10-10 Miguel de Icaza <miguel@ximian.com>
23118 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23120 * expression.cs (ImplicitReferenceConversion): handle null as well
23121 as a source to convert to any reference type.
23123 * statement.cs (Return): Perform any implicit conversions to
23124 expected return type.
23126 Validate use of return statement.
23128 * codegen.cs (EmitContext): Pass the expected return type here.
23130 * class.cs (Method, Constructor, Property): Pass expected return
23131 type to EmitContext.
23133 2001-10-09 Miguel de Icaza <miguel@ximian.com>
23135 * expression.cs: Make DoResolve take an EmitContext instead of a
23138 Replaced `l' and `location' for `loc', for consistency.
23140 (Error, Warning): Remove unneeded Tc argument.
23142 * assign.cs, literal.cs, constant.cs: Update to new calling
23145 * codegen.cs: EmitContext now contains a flag indicating whether
23146 code is being generated in a static method or not.
23148 * cs-parser.jay: DecomposeQI, new function that replaces the old
23149 QualifiedIdentifier. Now we always decompose the assembled
23150 strings from qualified_identifier productions into a group of
23153 2001-10-08 Miguel de Icaza <miguel@ximian.com>
23155 * rootcontext.cs: Deal with field-less struct types correctly now
23156 by passing the size option to Define Type.
23158 * class.cs: Removed hack that created one static field.
23160 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23162 * statement.cs: Moved most of the code generation here.
23164 2001-10-09 Ravi Pratap <ravi@ximian.com>
23166 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23169 (ElementAccess): Remove useless bits for now - keep checks as the spec
23172 2001-10-08 Ravi Pratap <ravi@ximian.com>
23174 * expression.cs (ElementAccess::DoResolve): Remove my crap code
23175 and start performing checks according to the spec.
23177 2001-10-07 Ravi Pratap <ravi@ximian.com>
23179 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23180 rank_specifiers instead.
23182 (rank_specifiers): Change the order in which the rank specifiers are stored
23184 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23186 * expression.cs (ElementAccess): Implement the LValue interface too.
23188 2001-10-06 Ravi Pratap <ravi@ximian.com>
23190 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23191 except that user defined conversions are not included.
23193 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
23194 perform the conversion of the return type, if necessary.
23196 (New::DoResolve): Check whether we are creating an array or an object
23197 and accordingly do the needful.
23199 (New::Emit): Same here.
23201 (New::DoResolve): Implement guts of array creation.
23203 (New::FormLookupType): Helper function.
23205 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23207 * codegen.cs: Removed most of the code generation here, and move the
23208 corresponding code generation bits to the statement classes.
23210 Added support for try/catch/finalize and throw.
23212 * cs-parser.jay: Added support for try/catch/finalize.
23214 * class.cs: Catch static methods having the flags override,
23215 virtual or abstract.
23217 * expression.cs (UserCast): This user cast was not really doing
23218 what it was supposed to do. Which is to be born in fully resolved
23219 state. Parts of the resolution were being performed at Emit time!
23223 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23225 * expression.cs: Implicity convert the result from UserCast.
23227 2001-10-05 Ravi Pratap <ravi@ximian.com>
23229 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23230 prevented it from working correctly.
23232 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23233 merely ConvertImplicit.
23235 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23237 * typemanager.cs: Make the LookupTypeContainer function static,
23238 and not per-instance.
23240 * class.cs: Make static FindMembers (the one that takes a Type
23243 * codegen.cs: Add EmitForeach here.
23245 * cs-parser.jay: Make foreach a toplevel object instead of the
23246 inline expansion, as we need to perform semantic analysis on it.
23248 2001-10-05 Ravi Pratap <ravi@ximian.com>
23250 * expression.cs (Expression::ImplicitUserConversion): Rename to
23251 UserDefinedConversion.
23253 (Expression::UserDefinedConversion): Take an extra argument specifying
23254 whether we look for explicit user conversions too.
23256 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23258 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23260 (ExplicitUserConversion): Make it a call to UserDefinedConversion
23261 with the appropriate arguments.
23263 * cs-parser.jay (cast_expression): Record location too.
23265 * expression.cs (Cast): Record location info.
23267 (Expression::ConvertExplicit): Take location argument.
23269 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23270 to determine if we are doing explicit conversions.
23272 (UserCast::Emit): Update accordingly.
23274 (Expression::ConvertExplicit): Report an error if everything fails.
23276 * ../errors/cs0030.cs : Add.
23278 2001-10-04 Miguel de Icaza <miguel@ximian.com>
23280 * modifiers.cs: If the ABSTRACT keyword is present, also set the
23281 virtual and newslot bits.
23283 * class.cs (TypeContainer::RegisterRequiredImplementations):
23284 Record methods we need.
23286 (TypeContainer::MakeKey): Helper function to make keys for
23287 MethodBases, since the Methodbase key is useless.
23289 (TypeContainer::Populate): Call RegisterRequiredImplementations
23290 before defining the methods.
23292 Create a mapping for method_builders_to_methods ahead of time
23293 instead of inside a tight loop.
23295 (::RequireMethods): Accept an object as the data to set into the
23296 hashtable so we can report interface vs abstract method mismatch.
23298 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23300 * report.cs: Make all of it static.
23302 * rootcontext.cs: Drop object_type and value_type computations, as
23303 we have those in the TypeManager anyways.
23305 Drop report instance variable too, now it is a global.
23307 * driver.cs: Use try/catch on command line handling.
23309 Add --probe option to debug the error reporting system with a test
23312 * report.cs: Add support for exiting program when a probe
23313 condition is reached.
23315 2001-10-03 Ravi Pratap <ravi@ximian.com>
23317 * expression.cs (Binary::DoNumericPromotions): Fix the case when
23318 we do a forcible conversion regardless of type, to check if
23319 ForceConversion returns a null.
23321 (Binary::error19): Use location to report error.
23323 (Unary::error23): Use location here too.
23325 * ../errors/cs0019.cs : Check in.
23327 * ../errors/cs0023.cs : Check in.
23329 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23330 case of a non-null MethodInfo object with a length of 0 !
23332 (Binary::ResolveOperator): Flag error if overload resolution fails to find
23333 an applicable member - according to the spec :-)
23334 Also fix logic to find members in base types.
23336 (Unary::ResolveOperator): Same here.
23338 (Unary::report23): Change name to error23 and make first argument a TypeContainer
23339 as I was getting thoroughly confused between this and error19 :-)
23341 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23342 (::FindMostEncompassedType): Implement.
23343 (::FindMostEncompassingType): Implement.
23344 (::StandardConversionExists): Implement.
23346 (UserImplicitCast): Re-vamp. We now need info about most specific
23347 source and target types so that we can do the necessary conversions.
23349 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23350 mathematical union with no duplicates.
23352 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23354 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23355 in order from base classes to child classes, so that we can in
23356 child classes look up in our parent for method names and
23357 attributes (required for handling abstract, virtual, new, override
23358 constructs: we need to instrospect our base class, and if we dont
23359 populate the classes in order, the introspection might be
23360 incorrect. For example, a method could query its parent before
23361 the parent has any methods and would determine that the parent has
23362 no abstract methods (while it could have had them)).
23364 (RootContext::CreateType): Record the order in which we define the
23367 2001-10-02 Miguel de Icaza <miguel@ximian.com>
23369 * class.cs (TypeContainer::Populate): Also method definitions can
23370 fail now, keep track of this.
23372 (TypeContainer::FindMembers): Implement support for
23373 DeclaredOnly/noDeclaredOnly flag.
23375 (Constructor::Emit) Return the ConstructorBuilder.
23377 (Method::Emit) Return the MethodBuilder.
23378 Check for abstract or virtual methods to be public.
23380 * rootcontext.cs (RootContext::CreateType): Register all the
23381 abstract methods required for the class to be complete and the
23382 interface methods that must be implemented.
23384 * cs-parser.jay: Report error 501 (method requires body if it is
23385 not marked abstract or extern).
23387 * expression.cs (TypeOf::Emit): Implement.
23389 * typemanager.cs: runtime_handle_type, new global type.
23391 * class.cs (Property::Emit): Generate code for properties.
23393 2001-10-02 Ravi Pratap <ravi@ximian.com>
23395 * expression.cs (Unary::ResolveOperator): Find operators on base type
23396 too - we now conform exactly to the spec.
23398 (Binary::ResolveOperator): Same here.
23400 * class.cs (Operator::Define): Fix minor quirk in the tests.
23402 * ../errors/cs0215.cs : Added.
23404 * ../errors/cs0556.cs : Added.
23406 * ../errors/cs0555.cs : Added.
23408 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23410 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23411 single integer which is really efficient
23413 2001-10-01 Ravi Pratap <ravi@ximian.com>
23415 * expression.cs (Expression::ImplicitUserConversion): Use location
23416 even in the case when we are examining True operators.
23418 * class.cs (Operator::Define): Perform extensive checks to conform
23419 with the rules for operator overloading in the spec.
23421 * expression.cs (Expression::ImplicitReferenceConversion): Implement
23422 some of the other conversions mentioned in the spec.
23424 * typemanager.cs (array_type): New static member for the System.Array built-in
23427 (cloneable_interface): For System.ICloneable interface.
23429 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23430 we start resolving the tree and populating types.
23432 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23434 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23436 * expression.cs (Expression::ExprClassFromMemberInfo,
23437 Expression::Literalize): Create literal expressions from
23438 FieldInfos which are literals.
23440 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23441 type casts, because they were wrong. The test suite in tests
23444 (ImplicitNumericConversion): ushort to ulong requires a widening
23447 Int32 constant to long requires widening cast as well.
23449 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23450 for integers because the type on the stack is not i4.
23452 2001-09-30 Miguel de Icaza <miguel@ximian.com>
23454 * expression.cs (report118): require location argument.
23456 * parameter.cs: Do not dereference potential null value.
23458 * class.cs: Catch methods that lack the `new' keyword when
23459 overriding a name. Report warnings when `new' is used without
23460 anything being there to override.
23462 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23464 * class.cs: Only add constructor to hashtable if it is non-null
23465 (as now constructors can fail on define).
23467 (TypeManager, Class, Struct): Take location arguments.
23469 Catch field instance initialization in structs as errors.
23471 accepting_filter: a new filter for FindMembers that is static so
23472 that we dont create an instance per invocation.
23474 (Constructor::Define): Catch errors where a struct constructor is
23477 * cs-parser.jay: Pass location information for various new
23480 * delegate.cs (Delegate): take a location argument.
23482 * driver.cs: Do not call EmitCode if there were problesm in the
23483 Definition of the types, as many Builders wont be there.
23485 * decl.cs (Decl::Decl): Require a location argument.
23487 * cs-tokenizer.cs: Handle properly hex constants that can not fit
23488 into integers, and find the most appropiate integer for it.
23490 * literal.cs: Implement ULongLiteral.
23492 * rootcontext.cs: Provide better information about the location of
23493 failure when CreateType fails.
23495 2001-09-29 Miguel de Icaza <miguel@ximian.com>
23497 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23500 * expression.cs (Binary::CheckShiftArguments): Add missing type
23502 (Binary::ResolveOperator): Add type to the logical and and logical
23503 or, Bitwise And/Or and Exclusive Or code paths, it was missing
23506 (Binary::DoNumericPromotions): In the case where either argument
23507 is ulong (and most signed types combined with ulong cause an
23508 error) perform implicit integer constant conversions as well.
23510 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23512 * expression.cs (UserImplicitCast): Method should always be
23514 (Invocation::BetterConversion): Simplified test for IntLiteral.
23516 (Expression::ImplicitNumericConversion): Split this routine out.
23517 Put the code that performs implicit constant integer conversions
23520 (Expression::Resolve): Become a wrapper around DoResolve so we can
23521 check eclass and type being set after resolve.
23523 (Invocation::Badness): Remove this dead function
23525 (Binary::ResolveOperator): Do not compute the expensive argumnets
23526 unless we have a union for it.
23528 (Probe::Emit): Is needs to do an isinst and then
23529 compare against null.
23531 (::CanConvert): Added Location argument. If the Location argument
23532 is null (Location.Null), then we do not report errors. This is
23533 used by the `probe' mechanism of the Explicit conversion. We do
23534 not want to generate an error for something that the user
23535 explicitly requested to be casted. But the pipeline for an
23536 explicit cast first tests for potential implicit casts.
23538 So for now, if the Location is null, it means `Probe only' to
23539 avoid adding another argument. Might have to revise this
23542 (ClassCast): New class used to type cast objects into arbitrary
23543 classes (used in Explicit Reference Conversions).
23545 Implement `as' as well.
23547 Reverted all the patches from Ravi below: they were broken:
23549 * The use of `level' as a mechanism to stop recursive
23550 invocations is wrong. That was there just to catch the
23551 bug with a strack trace but not as a way of addressing
23554 To fix the problem we have to *understand* what is going
23555 on and the interactions and come up with a plan, not
23556 just get things going.
23558 * The use of the type conversion cache that I proposed
23559 last night had an open topic: How does this work across
23560 protection domains. A user defined conversion might not
23561 be public in the location where we are applying the
23562 conversion, a different conversion might be selected
23563 (ie, private A->B (better) but public B->A (worse),
23564 inside A, A->B applies, but outside it, B->A will
23567 * On top of that (ie, even if the above is solved),
23568 conversions in a cache need to be abstract. Ie, `To
23569 convert from an Int to a Short use an OpcodeCast', not
23570 `To convert from an Int to a Short use the OpcodeCast on
23571 the variable 5' (which is what this patch was doing).
23573 2001-09-28 Ravi Pratap <ravi@ximian.com>
23575 * expression.cs (Invocation::ConversionExists): Re-write to use
23576 the conversion cache
23578 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23579 cache all conversions done, not just user-defined ones.
23581 (Invocation::BetterConversion): The real culprit. Use ConversionExists
23582 to determine if a conversion exists instead of acutually trying to
23583 perform the conversion. It's faster too.
23585 (Expression::ConvertExplicit): Modify to use ConversionExists to check
23586 and only then attempt the implicit conversion.
23588 2001-09-28 Ravi Pratap <ravi@ximian.com>
23590 * expression.cs (ConvertImplicit): Use a cache for conversions
23591 already found. Check level of recursion and bail out if necessary.
23593 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23595 * typemanager.cs (string_concat_string_string, string_concat_object_object):
23596 Export standard methods that we expect for string operations.
23598 * statement.cs (Block::UsageWarning): Track usage of variables and
23599 report the errors for not used variables.
23601 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23604 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23606 * codegen.cs: remove unnneded code
23608 * expression.cs: Removed BuiltinTypeAccess class
23610 Fix the order in which implicit conversions are
23613 The previous fixed dropped support for boxed conversions (adding a
23614 test to the test suite now)
23616 (UserImplicitCast::CanConvert): Remove test for source being null,
23617 that code is broken. We should not feed a null to begin with, if
23618 we do, then we should track the bug where the problem originates
23619 and not try to cover it up here.
23621 Return a resolved expression of type UserImplicitCast on success
23622 rather than true/false. Ravi: this is what I was talking about,
23623 the pattern is to use a static method as a "constructor" for
23626 Also, do not create arguments until the very last minute,
23627 otherwise we always create the arguments even for lookups that
23628 will never be performed.
23630 (UserImplicitCast::Resolve): Eliminate, objects of type
23631 UserImplicitCast are born in a fully resolved state.
23633 * typemanager.cs (InitCoreTypes): Init also value_type
23634 (System.ValueType).
23636 * expression.cs (Cast::Resolve): First resolve the child expression.
23638 (LValue): Add new method AddressOf to be used by
23641 Change the argument of Store to take an EmitContext instead of an
23642 ILGenerator, because things like FieldExpr need to be able to call
23643 their children expression to generate the instance code.
23645 (Expression::Error, Expression::Warning): Sugar functions for
23648 (Expression::MemberLookup): Accept a TypeContainer instead of a
23649 Report as the first argument.
23651 (Expression::ResolvePrimary): Killed. I still want to improve
23652 this as currently the code is just not right.
23654 (Expression::ResolveMemberAccess): Simplify, but it is still
23657 (Unary::Resolve): Catch errors in AddressOf operators.
23659 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23660 index to a byte for the short-version, or the compiler will choose
23661 the wrong Emit call, which generates the wrong data.
23663 (ParameterReference::Emit, ::Store): same.
23665 (FieldExpr::AddressOf): Implement.
23667 * typemanager.cs: TypeManager: made public variable instead of
23670 * driver.cs: document --fatal.
23672 * report.cs (ErrorMessage, WarningMessage): new names for the old
23673 Error and Warning classes.
23675 * cs-parser.jay (member_access): Turn built-in access to types
23676 into a normal simplename
23678 2001-09-27 Ravi Pratap <ravi@ximian.com>
23680 * expression.cs (Invocation::BetterConversion): Fix to cope
23681 with q being null, since this was introducing a bug.
23683 * expression.cs (ConvertImplicit): Do built-in conversions first.
23685 2001-09-27 Ravi Pratap <ravi@ximian.com>
23687 * expression.cs (UserImplicitCast::Resolve): Fix bug.
23689 2001-09-27 Ravi Pratap <ravi@ximian.com>
23691 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23692 I had introduced long ago (what's new ?).
23694 * expression.cs (UserImplicitCast::CanConvert): Static method to do
23695 the work of all the checking.
23696 (ConvertImplicit): Call CanConvert and only then create object if necessary.
23697 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23699 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23700 that is the right way.
23702 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
23703 overloading resolution. Use everywhere instead of cutting and pasting code.
23705 (Binary::ResolveOperator): Use MakeUnionSet.
23707 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
23708 we have to convert to bool types. Not complete yet.
23710 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23712 * typemanager.cs (TypeManager::CSharpName): support ushort.
23714 * expression.cs (Expression::TryImplicitIntConversion): Attempts
23715 to provide an expression that performsn an implicit constant int
23716 conversion (section 6.1.6).
23717 (Expression::ConvertImplicitRequired): Reworked to include
23718 implicit constant expression conversions.
23720 (Expression::ConvertNumericExplicit): Finished.
23722 (Invocation::Emit): If InstanceExpression is null, then it means
23723 that we perform a call on this.
23725 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23727 * expression.cs (Unary::Emit): Remove some dead code.
23728 (Probe): Implement Resolve and Emit for `is'.
23729 (Expression::ConvertImplicitRequired): Attempt to do constant
23730 expression conversions here. Maybe should be moved to
23731 ConvertImplicit, but I am not sure.
23732 (Expression::ImplicitLongConstantConversionPossible,
23733 Expression::ImplicitIntConstantConversionPossible): New functions
23734 that tell whether is it possible to apply an implicit constant
23735 expression conversion.
23737 (ConvertNumericExplicit): Started work on explicit numeric
23740 * cs-parser.jay: Update operator constants.
23742 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23743 (Parameters::GetSignature): Hook up VerifyArgs here.
23744 (Parameters::VerifyArgs): Verifies that no two arguments have the
23747 * class.cs (Operator): Update the operator names to reflect the
23748 ones that the spec expects (as we are just stringizing the
23751 * expression.cs (Unary::ResolveOperator): Fix bug: Use
23752 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23753 previous usage did only work for our methods.
23754 (Expression::ConvertImplicit): Handle decimal implicit numeric
23755 conversions as well.
23756 (Expression::InternalTypeConstructor): Used to invoke constructors
23757 on internal types for default promotions.
23759 (Unary::Emit): Implement special handling for the pre/post
23760 increment/decrement for overloaded operators, as they need to have
23761 the same semantics as the other operators.
23763 (Binary::ResolveOperator): ditto.
23764 (Invocation::ConversionExists): ditto.
23765 (UserImplicitCast::Resolve): ditto.
23767 2001-09-26 Ravi Pratap <ravi@ximian.com>
23769 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23770 operator, return after emitting body. Regression tests pass again !
23772 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23773 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23774 (Invocation::OverloadResolve): Ditto.
23775 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23777 * everywhere : update calls to the above methods accordingly.
23779 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23781 * assign.cs (Assign): Make it inherit from ExpressionStatement.
23783 * expression.cs (ExpressionStatement): New base class used for
23784 expressions that can appear in statements, so that we can provide
23785 an alternate path to generate expression that do not leave a value
23788 (Expression::Emit, and all the derivatives): We no longer return
23789 whether a value is left on the stack or not. Every expression
23790 after being emitted leaves a single value on the stack.
23792 * codegen.cs (EmitContext::EmitStatementExpression): Use the
23793 facilties of ExpressionStatement if possible.
23795 * cs-parser.jay: Update statement_expression.
23797 2001-09-25 Miguel de Icaza <miguel@ximian.com>
23799 * driver.cs: Change the wording of message
23801 2001-09-25 Ravi Pratap <ravi@ximian.com>
23803 * expression.cs (Binary::ResolveOperator): Had forgottten to set
23804 the type of the expression to the return type of the method if
23805 we have an overloaded operator match ! The regression tests pass again !
23806 (Unary::ResolveOperator): Ditto.
23808 * expression.cs (Invocation::ConversionExists): Correct the member lookup
23809 to find "op_Implicit", not "implicit" ;-)
23810 (UserImplicitCast): New class to take care of user-defined implicit conversions.
23811 (ConvertImplicit, ForceConversion): Take TypeContainer argument
23813 * everywhere : Correct calls to the above accordingly.
23815 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23816 (ConvertImplicit): Do user-defined conversion if it exists.
23818 2001-09-24 Miguel de Icaza <miguel@ximian.com>
23820 * assign.cs: track location.
23821 (Resolve): Use implicit conversions on assignment.
23823 * literal.cs: Oops. Not good, Emit of short access values should
23824 pass (Bytes) or the wrong argument will be selected.
23826 * expression.cs (Unary::Emit): Emit code for -expr.
23828 (Unary::ResolveOperator): Handle `Substract' for non-constants
23829 (substract from zero from the non-constants).
23830 Deal with Doubles as well.
23832 (Expression::ConvertImplicitRequired): New routine that reports an
23833 error if no implicit conversion exists.
23835 (Invocation::OverloadResolve): Store the converted implicit
23836 expressions if we make them
23838 2001-09-24 Ravi Pratap <ravi@ximian.com>
23840 * class.cs (ConstructorInitializer): Take a Location argument.
23841 (ConstructorBaseInitializer): Same here.
23842 (ConstructorThisInitializer): Same here.
23844 * cs-parser.jay : Update all calls accordingly.
23846 * expression.cs (Unary, Binary, New): Take location argument.
23847 Update accordingly everywhere.
23849 * cs-parser.jay : Update all calls to the above to take a location
23852 * class.cs : Ditto.
23854 2001-09-24 Ravi Pratap <ravi@ximian.com>
23856 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23857 (Invocation::BetterConversion): Same here
23858 (Invocation::ConversionExists): Ditto.
23860 (Invocation::ConversionExists): Implement.
23862 2001-09-22 Ravi Pratap <ravi@ximian.com>
23864 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23865 Also take an additional TypeContainer argument.
23867 * All over : Pass in TypeContainer as argument to OverloadResolve.
23869 * typemanager.cs (CSharpName): Update to check for the string type and return
23872 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23875 2001-09-21 Ravi Pratap <ravi@ximian.com>
23877 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23878 (Invocation::BetterFunction): Implement.
23879 (Invocation::BetterConversion): Implement.
23880 (Invocation::ConversionExists): Skeleton, no implementation yet.
23882 Okay, things work fine !
23884 2001-09-21 Miguel de Icaza <miguel@ximian.com>
23886 * typemanager.cs: declare and load enum_type, delegate_type and
23889 * expression.cs (Expression::Emit): Now emit returns a value that
23890 tells whether a value is left on the stack or not. This strategy
23891 might be reveted tomorrow with a mechanism that would address
23892 multiple assignments.
23893 (Expression::report118): Utility routine to report mismatches on
23896 (Unary::Report23): Report impossible type/operator combination
23899 (Unary::IsIncrementableNumber): Whether the type can be
23900 incremented or decremented with add.
23901 (Unary::ResolveOperator): Also allow enumerations to be bitwise
23903 (Unary::ResolveOperator): Implement ++, !, ~,
23905 (Invocation::Emit): Deal with new Emit convetion.
23907 * All Expression derivatives: Updated their Emit method to return
23908 whether they leave values on the stack or not.
23910 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23911 stack for expressions that are statements.
23913 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23915 * expression.cs (LValue): New interface. Must be implemented by
23917 (LocalVariableReference, ParameterReference, FieldExpr): Implement
23920 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23921 interface for generating code, simplifies the code.
23923 2001-09-20 Ravi Pratap <ravi@ximian.com>
23925 * expression.cs (everywhere): Comment out return statements in ::Resolve
23926 methods to avoid the warnings.
23928 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23930 * driver.cs (parse): Report error 2001 if we can not open the
23933 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23936 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23939 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23940 otherwise nested blocks end up with the same index.
23942 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23944 * expression.cs: Instead of having FIXMEs in the Resolve
23945 functions, throw exceptions so it is obvious that we are facing a
23948 * cs-parser.jay (invocation_expression): Pass Location information.
23950 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23951 Use a basename for those routines because .NET does not like paths
23954 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23957 2001-09-19 Miguel de Icaza <miguel@ximian.com>
23959 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23960 are loading the correct data types (throws an exception if not).
23961 (TypeManager::InitCoreTypes): Use CoreLookupType
23963 * expression.cs (Unary::ResolveOperator): return the child
23964 expression for expressions which are just +expr.
23965 (Unary::ResolveOperator): Return negative literals for -LITERAL
23966 expressions (otherwise they are Unary {Literal}).
23967 (Invocation::Badness): Take into account `Implicit constant
23968 expression conversions'.
23970 * literal.cs (LongLiteral): Implement long literal class.
23971 (IntLiteral): export the `Value' of the intliteral.
23973 2001-09-19 Ravi Pratap <ravi@ximian.com>
23975 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23977 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
23978 instead of 'Operator'
23980 * expression.cs (Binary::ResolveOperator): Update accordingly.
23981 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23984 * cs-parser.jay (unary_expression): Update to use the new names.
23986 * gen-treedump.cs (GetUnary): Same here.
23988 * expression.cs (Unary::Resolve): Implement.
23989 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
23990 operators are found instead of making noise ;-)
23991 (Unary::ResolveOperator): New method to do precisely the same thing which
23992 Binary::ResolveOperator does for Binary expressions.
23993 (Unary.method, .Arguments): Add.
23994 (Unary::OperName): Implement.
23995 (Unary::ForceConversion): Copy and Paste !
23997 * class.cs (Operator::Define): Fix a small bug for the case when we have
24000 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24001 for the inbuilt operators. Only overloading works for now ;-)
24003 2001-09-18 Miguel de Icaza <miguel@ximian.com>
24005 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24006 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24008 * expression.cs (This::Emit): Implement.
24009 (This::Resolve): Implement.
24010 (TypeOf:Resolve): Implement.
24011 (Expression::ResolveSimpleName): Add an implicit this to instance
24013 (MemberAccess::Resolve): Deal with Parameters and Fields.
24014 Bind instance variable to Field expressions.
24015 (FieldExpr::Instance): New field used to track the expression that
24016 represents the object instance.
24017 (FieldExpr::Resolve): Track potential errors from MemberLookup not
24019 (FieldExpr::Emit): Implement.
24021 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24022 the last instruction contains a return opcode to avoid generating
24023 the last `ret' instruction (this generates correct code, and it is
24024 nice to pass the peverify output).
24026 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24027 initializer for static and instance variables.
24028 (Constructor::Emit): Allow initializer to be null in the case of
24029 static constructors. Only emit initializer for instance
24032 (TypeContainer::FindMembers): Return a null array if there are no
24035 Also fix the code for the MemberTypes.Method branch, as it was not
24036 scanning that for operators (or tried to access null variables before).
24038 * assign.cs (Assign::Emit): Handle instance and static fields.
24042 * driver.cs: Stop compilation if there are parse errors.
24044 * cs-parser.jay (constructor_declaration): Provide default base
24045 initializer for non-static constructors.
24046 (constructor_declarator): Do not provide a default base
24047 initializers if none was specified.
24048 Catch the fact that constructors should not have parameters.
24050 * class.cs: Do not emit parent class initializers for static
24051 constructors, that should be flagged as an error.
24053 2001-09-18 Ravi Pratap <ravi@ximian.com>
24055 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24056 Move back code into TypeContainer::Populate.
24058 2001-09-18 Ravi Pratap <ravi@ximian.com>
24060 * class.cs (TypeContainer::AddConstructor): Fix the check to
24061 compare against Name, not Basename.
24062 (Operator::OpType): Change Plus and Minus to Add and Subtract.
24064 * cs-parser.jay : Update accordingly.
24066 * class.cs (TypeContainer::FindMembers): For the case where we are searching
24067 for methods, don't forget to look into the operators too.
24068 (RegisterMethodBuilder): Helper method to take care of this for
24069 methods, constructors and operators.
24070 (Operator::Define): Completely revamp.
24071 (Operator.OperatorMethod, MethodName): New fields.
24072 (TypeContainer::Populate): Move the registering of builders into
24073 RegisterMethodBuilder.
24074 (Operator::Emit): Re-write.
24076 * expression.cs (Binary::Emit): Comment out code path to emit method
24077 invocation stuff for the case when we have a user defined operator. I am
24078 just not able to get it right !
24080 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24082 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24085 (Expression::MemberLookup): Provide a version that allows to
24086 specify the MemberTypes and BindingFlags.
24088 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24089 so it was not fetching variable information from outer blocks.
24091 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24092 Beforefieldinit as it was buggy.
24094 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24095 that Ravi put here.
24097 * class.cs (Constructor::Emit): Only emit if block is not null.
24098 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24099 deal with this by semantically definining it as if the user had
24102 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24103 constructors as we now "emit" them at a higher level.
24105 (TypeContainer::DefineDefaultConstructor): Used to define the
24106 default constructors if none was provided.
24108 (ConstructorInitializer): Add methods Resolve and Emit.
24110 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24112 2001-09-17 Ravi Pratap <ravi@ximian.com>
24114 * class.cs (TypeContainer::EmitDefaultConstructor): Register
24115 the default constructor builder with our hashtable for methodbuilders
24118 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24119 and argument_count is 0 in which case we have a match.
24120 (Binary::ResolveOperator): More null checking and miscellaneous coding
24123 2001-09-17 Ravi Pratap <ravi@ximian.com>
24125 * rootcontext.cs (IsNameSpace): Compare against null.
24127 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24129 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24130 and Unary::Operator.
24132 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24135 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24136 we have overloaded operators.
24137 (Binary::ResolveOperator): Implement the part which does the operator overload
24140 * class.cs (Operator::Emit): Implement.
24141 (TypeContainer::Emit): Emit the operators we have too.
24143 * expression.cs (Binary::Emit): Update to emit the appropriate code for
24144 the case when we have a user-defined operator.
24146 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24148 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24150 2001-09-16 Ravi Pratap <ravi@ximian.com>
24152 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24153 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24154 (Constructor::Emit): Implement.
24155 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24156 if we have no work to do.
24157 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
24160 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24161 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24163 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24166 2001-09-15 Ravi Pratap <ravi@ximian.com>
24168 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24170 (Tree::RecordNamespace): Method to do what the name says ;-)
24171 (Tree::Namespaces): Property to get at the namespaces hashtable.
24173 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
24176 * rootcontext.cs (IsNamespace): Fixed it :-)
24178 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24180 * class.cs (TypeContainer::FindMembers): Add support for
24182 (MethodCore): New class that encapsulates both the shared aspects
24183 of a Constructor and a Method.
24184 (Method, Constructor): Factored pieces into MethodCore.
24186 * driver.cs: Added --fatal which makes errors throw exceptions.
24187 Load System assembly as well as part of the standard library.
24189 * report.cs: Allow throwing exceptions on errors for debugging.
24191 * modifiers.cs: Do not use `parent', instead use the real type
24192 container to evaluate permission settings.
24194 * class.cs: Put Ravi's patch back in. He is right, and we will
24195 have to cope with the
24197 2001-09-14 Ravi Pratap <ravi@ximian.com>
24199 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24200 FamORAssem, not FamANDAssem.
24202 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24204 * driver.cs: Added --parse option that only parses its input files
24207 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
24208 incorrect. IsTopLevel is not used to tell whether an object is
24209 root_types or not (that can be achieved by testing this ==
24210 root_types). But to see if this is a top-level *class* (not
24211 necessarly our "toplevel" container).
24213 2001-09-14 Ravi Pratap <ravi@ximian.com>
24215 * enum.cs (Enum::Define): Modify to call the Lookup method on the
24216 parent instead of a direct call to GetType.
24218 2001-09-14 Ravi Pratap <ravi@ximian.com>
24220 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24221 Modifiers.TypeAttr. This should just be a call to that method.
24223 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24224 object so that we can determine if we are top-level or not.
24226 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
24229 * enum.cs (Enum::Define): Ditto.
24231 * modifiers.cs (FieldAttr): Re-write.
24233 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24234 (TypeContainer::HaveStaticConstructor): New property to provide access
24235 to precisely that info.
24237 * modifiers.cs (MethodAttr): Re-write.
24238 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24240 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24241 of top-level types as claimed.
24243 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24245 * expression.cs (MemberLookup): Fruitless attempt to lookup
24246 constructors. Maybe I need to emit default constructors? That
24247 might be it (currently .NET emits this for me automatically).
24248 (Invocation::OverloadResolve): Cope with Arguments == null.
24249 (Invocation::EmitArguments): new function, shared by the new
24250 constructor and us.
24251 (Invocation::Emit): Handle static and instance methods. Emit
24252 proper call instruction for virtual or non-virtual invocations.
24253 (New::Emit): Implement.
24254 (New::Resolve): Implement.
24255 (MemberAccess:Resolve): Implement.
24256 (MethodGroupExpr::InstanceExpression): used conforming to the spec
24257 to track instances.
24258 (FieldExpr::Resolve): Set type.
24260 * support.cs: Handle empty arguments.
24262 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24263 SimpleLookup): Auxiliary routines to help parse a qualifier
24266 Update qualifier_identifier rule.
24268 * codegen.cs: Removed debugging messages.
24270 * class.cs: Make this a global thing, this acts just as a "key" to
24271 objects that we might have around.
24273 (Populate): Only initialize method_builders_to_methods once.
24275 * expression.cs (PropertyExpr): Initialize type from the
24278 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24279 Resolve pattern. Attempt to implicitly convert value to boolean.
24282 * expression.cs: Set the type for the int32/int32 argument case.
24283 (Binary::ResolveOperator): Set the return type to boolean for
24284 comparission operators
24286 * typemanager.cs: Remove debugging print code.
24288 (Invocation::Resolve): resolve type.
24290 * class.cs: Allocate a MemberInfo of the correct size, as the code
24291 elsewhere depends on the test to reflect the correct contents.
24293 (Method::) Keep track of parameters, due to System.Reflection holes
24295 (TypeContainer::Populate): Keep track of MethodBuilders to Method
24298 (TypeContainer::FindMembers): Use ArrayList and then copy an array
24299 of the exact size and return that.
24301 (Class::LookupMethodByBuilder): New function that maps
24302 MethodBuilders to its methods. Required to locate the information
24303 on methods because System.Reflection bit us again.
24305 * support.cs: New file, contains an interface ParameterData and
24306 two implementations: ReflectionParameters and InternalParameters
24307 used to access Parameter information. We will need to grow this
24310 * expression.cs (Invocation::GetParameterData): implement a cache
24311 and a wrapper around the ParameterData creation for methods.
24312 (Invocation::OverloadResolve): Use new code.
24314 2001-09-13 Ravi Pratap <ravi@ximian.com>
24316 * class.cs (TypeContainer::EmitField): Remove and move into
24317 (Field::Define): here and modify accordingly.
24318 (Field.FieldBuilder): New member.
24319 (TypeContainer::Populate): Update accordingly.
24320 (TypeContainer::FindMembers): Implement.
24322 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24324 * statement.cs: (VariableInfo::VariableType): New field to be
24325 initialized with the full type once it is resolved.
24327 2001-09-12 Miguel de Icaza <miguel@ximian.com>
24329 * parameter.cs (GetParameterInfo): Use a type cache to compute
24330 things only once, and to reuse this information
24332 * expression.cs (LocalVariableReference::Emit): Implement.
24333 (OpcodeCast::Emit): fix.
24335 (ParameterReference::Resolve): Implement.
24336 (ParameterReference::Emit): Implement.
24338 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24339 that are expressions need to stay as Expressions.
24341 * typemanager.cs (CSharpName): Returns the C# name of a type if
24344 * expression.cs (Expression::ConvertImplicit): New function that
24345 implements implicit type conversions.
24347 (Expression::ImplicitReferenceConversion): Implements implicit
24348 reference conversions.
24350 (EmptyCast): New type for transparent casts.
24352 (OpcodeCast): New type for casts of types that are performed with
24353 a sequence of bytecodes.
24355 (BoxedCast): New type used for casting value types into reference
24356 types. Emits a box opcode.
24358 (Binary::DoNumericPromotions): Implements numeric promotions of
24359 and computation of the Binary::Type.
24361 (Binary::EmitBranchable): Optimization.
24363 (Binary::Emit): Implement code emission for expressions.
24365 * typemanager.cs (TypeManager): Added two new core types: sbyte
24368 2001-09-12 Ravi Pratap <ravi@ximian.com>
24370 * class.cs (TypeContainer::FindMembers): Method which does exactly
24371 what Type.FindMembers does, only we don't have to use reflection. No
24372 implementation yet.
24374 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24375 typecontainer objects as we need to get at them.
24376 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24378 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24379 typecontainer object.
24381 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24382 of just a Report object.
24384 2001-09-11 Ravi Pratap <ravi@ximian.com>
24386 * class.cs (Event::Define): Go back to using the prefixes "add_" and
24388 (TypeContainer::Populate): Now define the delegates of the type too.
24389 (TypeContainer.Delegates): Property to access the list of delegates defined
24392 * delegates.cs (Delegate::Define): Implement partially.
24394 * modifiers.cs (TypeAttr): Handle more flags.
24396 2001-09-11 Ravi Pratap <ravi@ximian.com>
24398 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24400 (Operator::Define): Re-write logic to get types by using the LookupType method
24401 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24402 (Indexer::Define): Ditto.
24403 (Event::Define): Ditto.
24404 (Property::Define): Ditto.
24406 2001-09-10 Ravi Pratap <ravi@ximian.com>
24408 * class.cs (TypeContainer::Populate): Now define operators too.
24409 (TypeContainer.Operators): New property to access the list of operators
24411 (Operator.OperatorMethodBuilder): New member to hold the method builder
24412 for the operator we are defining.
24413 (Operator::Define): Implement.
24415 2001-09-10 Ravi Pratap <ravi@ximian.com>
24417 * class.cs (Event::Define): Make the prefixes of the accessor methods
24418 addOn_ and removeOn_
24420 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24421 of the location being passed in too. Ideally, this should go later since all
24422 error reporting should be done through the Report object.
24424 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24425 (Populate): Iterate thru the indexers we have and define them too.
24426 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24427 for the get and set accessors.
24428 (Indexer::Define): Implement.
24430 2001-09-09 Miguel de Icaza <miguel@ximian.com>
24432 * expression.cs (Binary::Resolve): Beginning of it. I scratched
24433 my previous implementation, did not work.
24435 * typemanager.cs: Add a couple of missing types (the longs).
24437 * literal.cs: Use TypeManager.bool_type instead of getting it.
24439 * expression.cs (EventExpr): New kind of expressions.
24440 (Expressio::ExprClassFromMemberInfo): finish
24442 2001-09-08 Miguel de Icaza <miguel@ximian.com>
24444 * assign.cs: Emit stores to static fields differently.
24446 2001-09-08 Ravi Pratap <ravi@ximian.com>
24448 * Merge in changes and adjust code to tackle conflicts. Backed out my
24449 code in Assign::Resolve ;-)
24451 2001-09-08 Ravi Pratap <ravi@ximian.com>
24453 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24454 instead Report.Error and also pass in the location.
24455 (CSharpParser::Lexer): New readonly property to return the reference
24456 to the Tokenizer object.
24457 (declare_local_variables): Use Report.Error with location instead of plain
24461 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24462 (Operator.CheckBinaryOperator): Ditto.
24464 * cs-parser.jay (operator_declarator): Update accordingly.
24466 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24467 (CheckBinaryOperator): Same here.
24469 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24470 on the name without any prefixes of namespace names etc. This is because we
24471 already might have something already fully qualified like
24472 'System.Console.WriteLine'
24474 * assign.cs (Resolve): Begin implementation. Stuck ;-)
24476 2001-09-07 Ravi Pratap <ravi@ximian.com>
24478 * cs-tokenizer.cs (location): Return a string which also contains
24481 * expression.cs (ElementAccess): New class for expressions of the
24482 type 'element access.'
24483 (BaseAccess): New class for expressions of the type 'base access.'
24484 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24487 * cs-parser.jay (element_access): Implement action.
24488 (base_access): Implement actions.
24489 (checked_expression, unchecked_expression): Implement.
24491 * cs-parser.jay (local_variable_type): Correct and implement.
24492 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24494 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24496 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24497 name and the specifiers.
24499 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24501 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
24502 making them all public ;-)
24504 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24507 2001-09-07 Miguel de Icaza <miguel@ximian.com>
24509 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24511 (FieldExpr, PropertyExprs): New resolved expressions.
24512 (SimpleName::MemberStaticCheck): Perform static checks for access
24513 to non-static fields on static methods. Maybe this should be
24514 generalized for MemberAccesses.
24515 (SimpleName::ResolveSimpleName): More work on simple name
24518 * cs-parser.jay (primary_expression/qualified_identifier): track
24519 the parameter index.
24521 * codegen.cs (CodeGen::Save): Catch save exception, report error.
24522 (EmitContext::EmitBoolExpression): Chain to expression generation
24523 instead of temporary hack.
24524 (::EmitStatementExpression): Put generic expression code generation.
24526 * assign.cs (Assign::Emit): Implement variable assignments to
24527 local variables, parameters and fields.
24529 2001-09-06 Miguel de Icaza <miguel@ximian.com>
24531 * statement.cs (Block::GetVariableInfo): New method, returns the
24532 VariableInfo for a variable name in a block.
24533 (Block::GetVariableType): Implement in terms of GetVariableInfo
24535 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24536 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24538 2001-09-06 Ravi Pratap <ravi@ximian.com>
24540 * cs-parser.jay (operator_declaration): Continue on my quest : update
24541 to take attributes argument.
24542 (event_declaration): Ditto.
24543 (enum_declaration): Ditto.
24544 (indexer_declaration): Ditto.
24546 * class.cs (Operator::Operator): Update constructor accordingly.
24547 (Event::Event): Ditto.
24549 * delegate.cs (Delegate::Delegate): Same here.
24551 * enum.cs (Enum::Enum): Same here.
24553 2001-09-05 Ravi Pratap <ravi@ximian.com>
24555 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24557 * ../tests/cs0658.cs : New file to demonstrate error 0658.
24559 * attribute.cs (Attributes): New class to encapsulate all attributes which were
24560 being passed around as an arraylist.
24561 (Attributes::AddAttribute): Method to add attribute sections.
24563 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24564 (struct_declaration): Update accordingly.
24565 (constant_declaration): Update.
24566 (field_declaration): Update.
24567 (method_header): Update.
24568 (fixed_parameter): Update.
24569 (parameter_array): Ditto.
24570 (property_declaration): Ditto.
24571 (destructor_declaration): Ditto.
24573 * class.cs (Struct::Struct): Update constructors accordingly.
24574 (Class::Class): Ditto.
24575 (Field::Field): Ditto.
24576 (Method::Method): Ditto.
24577 (Property::Property): Ditto.
24578 (TypeContainer::OptAttribute): update property's return type.
24580 * interface.cs (Interface.opt_attributes): New member.
24581 (Interface::Interface): Update to take the extra Attributes argument.
24583 * parameter.cs (Parameter::Parameter): Ditto.
24585 * constant.cs (Constant::Constant): Ditto.
24587 * interface.cs (InterfaceMemberBase): New OptAttributes field.
24588 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
24589 the attributes as a parameter.
24590 (InterfaceProperty): Update constructor call.
24591 (InterfaceEvent): Ditto.
24592 (InterfaceMethod): Ditto.
24593 (InterfaceIndexer): Ditto.
24595 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
24596 pass the attributes too.
24597 (interface_event_declaration): Ditto.
24598 (interface_property_declaration): Ditto.
24599 (interface_method_declaration): Ditto.
24600 (interface_declaration): Ditto.
24602 2001-09-05 Miguel de Icaza <miguel@ximian.com>
24604 * class.cs (Method::Define): Track the "static Main" definition to
24605 create an entry point.
24607 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24608 EntryPoint if we find it.
24610 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24611 (EmitContext::ig): Make this variable public.
24613 * driver.cs: Make the default output file be the first file name
24614 with the .exe extension.
24616 Detect empty compilations
24618 Handle various kinds of output targets. Handle --target and
24619 rename -t to --dumper.
24621 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24622 methods inherited from Expression return now an Expression. This
24623 will is used during the tree rewriting as we resolve them during
24626 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24627 the spec. Missing entirely is the information about
24628 accessability of elements of it.
24630 (Expression::ExprClassFromMemberInfo): New constructor for
24631 Expressions that creates a fully initialized Expression based on
24632 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24635 (Invocation::Resolve): Begin implementing resolution of invocations.
24637 * literal.cs (StringLiteral): Implement Emit.
24639 2001-09-05 Ravi Pratap <ravi@ximian.com>
24641 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24644 2001-09-04 Ravi Pratap <ravi@ximian.com>
24646 * cs-parser.jay (attribute_arguments): Implement actions.
24647 (attribute): Fix bug in production. Implement action.
24648 (attribute_list): Implement.
24649 (attribute_target): Implement.
24650 (attribute_target_specifier, opt_target_specifier): Implement
24651 (CheckAttributeTarget): New method to check if the attribute target
24653 (attribute_section): Implement.
24654 (opt_attributes): Implement.
24656 * attribute.cs : New file to handle attributes.
24657 (Attribute): Class to hold attribute info.
24659 * cs-parser.jay (opt_attribute_target_specifier): Remove production
24660 (attribute_section): Modify production to use 2 different rules to
24661 achieve the same thing. 1 s/r conflict down !
24662 Clean out commented, useless, non-reducing dimension_separator rules.
24664 * class.cs (TypeContainer.attributes): New member to hold list
24665 of attributes for a type.
24666 (Struct::Struct): Modify to take one more argument, the attribute list.
24667 (Class::Class): Ditto.
24668 (Field::Field): Ditto.
24669 (Method::Method): Ditto.
24670 (Property::Property): Ditto.
24672 * cs-parser.jay (struct_declaration): Update constructor call to
24673 pass in the attributes too.
24674 (class_declaration): Ditto.
24675 (constant_declaration): Ditto.
24676 (field_declaration): Ditto.
24677 (method_header): Ditto.
24678 (fixed_parameter): Ditto.
24679 (parameter_array): Ditto.
24680 (property_declaration): Ditto.
24682 * constant.cs (Constant::Constant): Update constructor similarly.
24683 Use System.Collections.
24685 * parameter.cs (Parameter::Parameter): Update as above.
24687 2001-09-02 Ravi Pratap <ravi@ximian.com>
24689 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24690 (TypeContainer.delegates): New member to hold list of delegates.
24692 * cs-parser.jay (delegate_declaration): Implement the action correctly
24693 this time as I seem to be on crack ;-)
24695 2001-09-02 Miguel de Icaza <miguel@ximian.com>
24697 * rootcontext.cs (RootContext::IsNamespace): new function, used to
24698 tell whether an identifier represents a namespace.
24700 * expression.cs (NamespaceExpr): A namespace expression, used only
24701 temporarly during expression resolution.
24702 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24703 utility functions to resolve names on expressions.
24705 2001-09-01 Miguel de Icaza <miguel@ximian.com>
24707 * codegen.cs: Add hook for StatementExpressions.
24709 * class.cs: Fix inverted test for static flag in methods.
24711 2001-09-02 Ravi Pratap <ravi@ximian.com>
24713 * class.cs (Operator::CheckUnaryOperator): Correct error number used
24714 to make it coincide with MS' number.
24715 (Operator::CheckBinaryOperator): Ditto.
24717 * ../errors/errors.txt : Remove error numbers added earlier.
24719 * ../errors/cs1019.cs : Test case for error # 1019
24721 * ../errros/cs1020.cs : Test case for error # 1020
24723 * cs-parser.jay : Clean out commented cruft.
24724 (dimension_separators, dimension_separator): Comment out. Ostensibly not
24725 used anywhere - non-reducing rule.
24726 (namespace_declarations): Non-reducing rule - comment out.
24728 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24729 with TypeContainer::AddEnum.
24731 * delegate.cs : New file for delegate handling classes.
24732 (Delegate): Class for declaring delegates.
24734 * makefile : Update.
24736 * cs-parser.jay (delegate_declaration): Implement.
24738 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
24740 * class.cs (Event::Define): Implement.
24741 (Event.EventBuilder): New member.
24743 * class.cs (TypeContainer::Populate): Update to define all enums and events
24745 (Events): New property for the events arraylist we hold. Shouldn't we move to using
24746 readonly fields for all these cases ?
24748 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24750 * class.cs (Property): Revamp to use the convention of making fields readonly.
24751 Accordingly modify code elsewhere.
24753 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24754 the Define method of the Property class.
24756 * class.cs : Clean up applied patch and update references to variables etc. Fix
24758 (TypeContainer::Populate): Update to define all the properties we have. Also
24759 define all enumerations.
24761 * enum.cs (Define): Implement.
24763 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24765 * cs-parser.jay (overloadable_operator): The semantic value is an
24766 enum of the Operator class.
24767 (operator_declarator): Implement actions.
24768 (operator_declaration): Implement.
24770 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24771 validity of definitions.
24772 (Operator::CheckBinaryOperator): Static method to check for binary operators
24773 (TypeContainer::AddOperator): New method to add an operator to a type.
24775 * cs-parser.jay (indexer_declaration): Added line to actually call the
24776 AddIndexer method so it gets added ;-)
24778 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
24779 already taken care of by the MS compiler ?
24781 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24783 * class.cs (Operator): New class for operator declarations.
24784 (Operator::OpType): Enum for the various operators.
24786 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24788 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24789 ostensibly handle this in semantic analysis.
24791 * cs-parser.jay (general_catch_clause): Comment out
24792 (specific_catch_clauses, specific_catch_clause): Ditto.
24793 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24794 (catch_args, opt_catch_args): New productions.
24795 (catch_clause): Rewrite to use the new productions above
24796 (catch_clauses): Modify accordingly.
24797 (opt_catch_clauses): New production to use in try_statement
24798 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24799 and re-write the code in the actions to extract the specific and
24800 general catch clauses by being a little smart ;-)
24802 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24803 Hooray, try and catch statements parse fine !
24805 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24807 * statement.cs (Block::GetVariableType): Fix logic to extract the type
24808 string from the hashtable of variables.
24810 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24811 I end up making that mistake ;-)
24812 (catch_clauses): Fixed gross error which made Key and Value of the
24813 DictionaryEntry the same : $1 !!
24815 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24817 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24819 * cs-parser.jay (event_declaration): Correct to remove the semicolon
24820 when the add and remove accessors are specified.
24822 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24824 * cs-parser.jay (IndexerDeclaration): New helper class to hold
24825 information about indexer_declarator.
24826 (indexer_declarator): Implement actions.
24827 (parsing_indexer): New local boolean used to keep track of whether
24828 we are parsing indexers or properties. This is necessary because
24829 implicit_parameters come into picture even for the get accessor in the
24830 case of an indexer.
24831 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24833 * class.cs (Indexer): New class for indexer declarations.
24834 (TypeContainer::AddIndexer): New method to add an indexer to a type.
24835 (TypeContainer::indexers): New member to hold list of indexers for the
24838 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24840 * cs-parser.jay (add_accessor_declaration): Implement action.
24841 (remove_accessor_declaration): Implement action.
24842 (event_accessors_declaration): Implement
24843 (variable_declarators): swap statements for first rule - trivial.
24845 * class.cs (Event): New class to hold information about event
24847 (TypeContainer::AddEvent): New method to add an event to a type
24848 (TypeContainer::events): New member to hold list of events.
24850 * cs-parser.jay (event_declaration): Implement actions.
24852 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24854 * cs-parser.jay (dim_separators): Implement. Make it a string
24855 concatenating all the commas together, just as they appear.
24856 (opt_dim_separators): Modify accordingly
24857 (rank_specifiers): Update accordingly. Basically do the same
24858 thing - instead, collect the brackets here.
24859 (opt_rank_sepcifiers): Modify accordingly.
24860 (array_type): Modify to actually return the complete type string
24861 instead of ignoring the rank_specifiers.
24862 (expression_list): Implement to collect the expressions
24863 (variable_initializer): Implement. We make it a list of expressions
24864 essentially so that we can handle the array_initializer case neatly too.
24865 (variable_initializer_list): Implement.
24866 (array_initializer): Make it a list of variable_initializers
24867 (opt_array_initializer): Modify accordingly.
24869 * expression.cs (New::NType): Add enumeration to help us
24870 keep track of whether we have an object/delegate creation
24871 or an array creation.
24872 (New:NewType, New::Rank, New::Indices, New::Initializers): New
24873 members to hold data about array creation.
24874 (New:New): Modify to update NewType
24875 (New:New): New Overloaded contructor for the array creation
24878 * cs-parser.jay (array_creation_expression): Implement to call
24879 the overloaded New constructor.
24881 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
24883 * class.cs (TypeContainer::Constructors): Return member
24884 constructors instead of returning null.
24886 2001-08-26 Miguel de Icaza <miguel@ximian.com>
24888 * typemanager.cs (InitCoreTypes): Initialize the various core
24889 types after we have populated the type manager with the user
24890 defined types (this distinction will be important later while
24891 compiling corlib.dll)
24893 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24894 on Expression Classification. Now all expressions have a method
24895 `Resolve' and a method `Emit'.
24897 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24898 generation from working. Also add some temporary debugging
24901 2001-08-24 Miguel de Icaza <miguel@ximian.com>
24903 * codegen.cs: Lots of code generation pieces. This is only the
24904 beginning, will continue tomorrow with more touches of polish. We
24905 handle the fundamentals of if, while, do, for, return. Others are
24906 trickier and I need to start working on invocations soon.
24908 * gen-treedump.cs: Bug fix, use s.Increment here instead of
24911 * codegen.cs (EmitContext): New struct, used during code
24912 emission to keep a context. Most of the code generation will be
24915 * cs-parser.jay: Add embedded blocks to the list of statements of
24916 this block. So code generation proceeds in a top down fashion.
24918 2001-08-23 Miguel de Icaza <miguel@ximian.com>
24920 * statement.cs: Add support for multiple child blocks.
24922 2001-08-22 Miguel de Icaza <miguel@ximian.com>
24924 * codegen.cs (EmitCode): New function, will emit the code for a
24925 Block of code given a TypeContainer and its ILGenerator.
24927 * statement.cs (Block): Standard public readonly optimization.
24928 (Block::Block constructors): Link children.
24929 (Block::Child): Child Linker.
24930 (Block::EmitVariables): Emits IL variable declarations.
24932 * class.cs: Drop support for MethodGroups here, delay until
24934 (Method::): Applied the same simplification that I did before, and
24935 move from Properties to public readonly fields.
24936 (Method::ParameterTypes): Returns the parameter types for the
24937 function, and implements a cache that will be useful later when I
24938 do error checking and the semantic analysis on the methods is
24940 (Constructor::GetCallingConvention): Renamed from CallingConvetion
24941 and made a method, optional argument tells whether this is a class
24942 or a structure to apply the `has-this' bit.
24943 (Method::GetCallingConvention): Implement, returns the calling
24945 (Method::Define): Defines the type, a second pass is performed
24946 later to populate the methods.
24948 (Constructor::ParameterTypes): implement a cache similar to the
24949 one on Method::ParameterTypes, useful later when we do semantic
24952 (TypeContainer::EmitMethod): New method. Emits methods.
24954 * expression.cs: Removed MethodGroup class from here.
24956 * parameter.cs (Parameters::GetCallingConvention): new method.
24958 2001-08-21 Miguel de Icaza <miguel@ximian.com>
24960 * class.cs (TypeContainer::Populate): Drop RootContext from the
24963 (Constructor::CallingConvention): Returns the calling convention.
24964 (Constructor::ParameterTypes): Returns the constructor parameter
24967 (TypeContainer::AddConstructor): Keep track of default constructor
24968 and the default static constructor.
24970 (Constructor::) Another class that starts using `public readonly'
24971 instead of properties.
24973 (Constructor::IsDefault): Whether this is a default constructor.
24975 (Field::) use readonly public fields instead of properties also.
24977 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24978 track of static constructors; If none is used, turn on
24979 BeforeFieldInit in the TypeAttributes.
24981 * cs-parser.jay (opt_argument_list): now the return can be null
24982 for the cases where there are no arguments.
24984 (constructor_declarator): If there is no implicit `base' or
24985 `this', then invoke the default parent constructor.
24987 * modifiers.cs (MethodAttr): New static function maps a set of
24988 modifiers flags into a MethodAttributes enum
24989 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
24990 MethodAttr, TypeAttr to represent the various mappings where the
24991 modifiers are used.
24992 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
24994 2001-08-19 Miguel de Icaza <miguel@ximian.com>
24996 * parameter.cs (GetParameterInfo): Fix bug where there would be no
24999 * interface.cs (PopulateIndexer): Implemented the code generator
25000 for interface indexers.
25002 2001-08-17 Miguel de Icaza <miguel@ximian.com>
25004 * interface.cs (InterfaceMemberBase): Now we track the new status
25007 (PopulateProperty): Implement property population. Woohoo! Got
25008 Methods and Properties going today.
25010 Removed all the properties for interfaces, and replaced them with
25011 `public readonly' fields.
25013 2001-08-16 Miguel de Icaza <miguel@ximian.com>
25015 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25016 initialize their hashtables/arraylists only when they are needed
25017 instead of doing this always.
25019 * parameter.cs: Handle refs and out parameters.
25021 * cs-parser.jay: Use an ArrayList to construct the arguments
25022 instead of the ParameterCollection, and then cast that to a
25025 * parameter.cs: Drop the use of ParameterCollection and use
25026 instead arrays of Parameters.
25028 (GetParameterInfo): Use the Type, not the Name when resolving
25031 2001-08-13 Miguel de Icaza <miguel@ximian.com>
25033 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25034 and instead use public readonly fields.
25036 * class.cs: Put back walking code for type containers.
25038 2001-08-11 Miguel de Icaza <miguel@ximian.com>
25040 * class.cs (MakeConstant): Code to define constants.
25042 * rootcontext.cs (LookupType): New function. Used to locate types
25045 2001-08-08 Miguel de Icaza <miguel@ximian.com>
25047 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
25048 this System.Reflection code is. Kudos to Microsoft
25050 * typemanager.cs: Implement a type cache and avoid loading all
25051 types at boot time. Wrap in LookupType the internals. This made
25052 the compiler so much faster. Wow. I rule!
25054 * driver.cs: Make sure we always load mscorlib first (for
25055 debugging purposes, nothing really important).
25057 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
25058 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
25060 * rootcontext.cs: Lookup types on their namespace; Lookup types
25061 on namespaces that have been imported using the `using' keyword.
25063 * class.cs (TypeContainer::TypeAttr): Virtualize.
25064 (Class::TypeAttr): Return attributes suitable for this bad boy.
25065 (Struct::TypeAttr): ditto.
25066 Handle nested classes.
25067 (TypeContainer::) Remove all the type visiting code, it is now
25068 replaced with the rootcontext.cs code
25070 * rootcontext.cs (GetClassBases): Added support for structs.
25072 2001-08-06 Miguel de Icaza <miguel@ximian.com>
25074 * interface.cs, statement.cs, class.cs, parameter.cs,
25075 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25076 Drop use of TypeRefs, and use strings instead.
25078 2001-08-04 Miguel de Icaza <miguel@ximian.com>
25082 * class.cs (Struct::Struct): set the SEALED flags after
25083 checking the modifiers.
25084 (TypeContainer::TypeAttr): new property, returns the
25085 TypeAttributes for a class.
25087 * cs-parser.jay (type_list): Oops, list production was creating a
25088 new list of base types.
25090 * rootcontext.cs (StdLib): New property.
25091 (GetInterfaceTypeByName): returns an interface by type name, and
25092 encapsulates error handling here.
25093 (GetInterfaces): simplified.
25094 (ResolveTree): Encapsulated all the tree resolution here.
25095 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25098 * driver.cs: Add support for --nostdlib, to avoid loading the
25099 default assemblies.
25100 (Main): Do not put tree resolution here.
25102 * rootcontext.cs: Beginning of the class resolution.
25104 2001-08-03 Miguel de Icaza <miguel@ximian.com>
25106 * rootcontext.cs: Provide better error reporting.
25108 * cs-parser.jay (interface_base): set our $$ to be interfaces.
25110 * rootcontext.cs (CreateInterface): Handle the case where there
25111 are no parent interfaces.
25113 (CloseTypes): Routine to flush types at the end.
25114 (CreateInterface): Track types.
25115 (GetInterfaces): Returns an array of Types from the list of
25116 defined interfaces.
25118 * typemanager.c (AddUserType): Mechanism to track user types (puts
25119 the type on the global type hash, and allows us to close it at the
25122 2001-08-02 Miguel de Icaza <miguel@ximian.com>
25124 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25125 RecordInterface instead.
25127 * cs-parser.jay: Updated to reflect changes above.
25129 * decl.cs (Definition): Keep track of the TypeBuilder type that
25130 represents this type here. Not sure we will use it in the long
25131 run, but wont hurt for now.
25133 * driver.cs: Smaller changes to accomodate the new code.
25135 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25138 * rootcontext.cs (CreateInterface): New method, used to create
25139 the System.TypeBuilder type for interfaces.
25140 (ResolveInterfaces): new entry point to resolve the interface
25142 (CodeGen): Property, used to keep track of the code generator.
25144 2001-07-26 Miguel de Icaza <miguel@ximian.com>
25146 * cs-parser.jay: Add a second production for delegate_declaration
25149 (enum_body): Put an opt_comma here instead of putting it on
25150 enum_body or enum_member_declarations so we can handle trailing
25151 commas on enumeration members. Gets rid of a shift/reduce.
25153 (type_list): Need a COMMA in the middle.
25155 (indexer_declaration): Tell tokenizer to recognize get/set
25157 * Remove old targets.
25159 * Re-add the parser target.
25161 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25163 * cs-parser.jay: Add precendence rules for a number of operators
25164 ot reduce the number of shift/reduce conflicts in the grammar.
25166 2001-07-17 Miguel de Icaza <miguel@ximian.com>
25168 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25171 Get rid of old crufty code.
25173 * rootcontext.cs: Use this to keep track of the parsed
25174 representation and the defined types available to the program.
25176 * gen-treedump.cs: adjust for new convention.
25178 * type.cs: Split out the type manager, and the assembly builder
25181 * typemanager.cs: the type manager will live here now.
25183 * cil-codegen.cs: And the code generator here.
25185 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
25187 * makefile: Fixed up for easy making.
25189 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25191 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25194 (unary_expression): Expand pre_increment_expression and
25195 post_decrement_expression to reduce a shift/reduce.
25197 2001-07-11 Simon Cozens
25199 * cs-tokenizer.cs: Hex numbers should begin with a 0.
25201 Improve allow_keyword_as_indent name.
25203 2001-06-19 Miguel de Icaza <miguel@ximian.com>
25205 * Adjustments for Beta2.
25207 2001-06-13 Miguel de Icaza <miguel@ximian.com>
25209 * decl.cs: Added `Define' abstract method.
25210 (InTransit): new property, used to catch recursive definitions.
25212 * interface.cs: Implement `Define'.
25214 * modifiers.cs: Map Modifiers.constants to
25215 System.Reflection.TypeAttribute flags.
25217 * class.cs: Keep track of types and user-defined types.
25218 (BuilderInit): New method for creating an assembly
25219 (ResolveType): New function to launch the resolution process, only
25220 used by interfaces for now.
25222 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25223 that are inserted into the name space.
25225 2001-06-08 Miguel de Icaza <miguel@ximian.com>
25227 * ARGH. I have screwed up my tree so many times due to the use of
25228 rsync rather than using CVS. Going to fix this at once.
25230 * driver.cs: Objetify driver. Load assemblies, use assemblies to
25233 2001-06-07 Miguel de Icaza <miguel@ximian.com>
25235 * Experiment successful: Use System.Type rather that our own
25238 2001-05-25 Miguel de Icaza <miguel@ximian.com>
25240 * cs-parser.jay: Removed nsAliases from here.
25242 Use new namespaces, handle `using XXX;'
25244 * namespace.cs: Reimplemented namespace handling, use a recursive
25245 definition of the class. Now we can keep track of using clauses
25246 and catch invalid using clauses.
25248 2001-05-24 Miguel de Icaza <miguel@ximian.com>
25250 * gen-treedump.cs: Adapted for all the renaming.
25252 * expression.cs (Expression): this class now has a Type property
25253 which returns an expression Type.
25255 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25256 `Type', as this has a different meaning now in the base
25258 2001-05-22 Miguel de Icaza <miguel@ximian.com>
25260 * interface.cs, class.cs: Removed from all the sources the
25261 references to signature computation, as we can not do method
25262 signature computation during the parsing time, as we are not
25263 trying to solve at that point distinguishing:
25267 void a (NS.Blah x) {}
25270 Which depending on the context might be valid or not, as we do not
25271 know if Blah is the same thing as NS.Blah at that point.
25273 * Redid everything so the code uses TypeRefs now instead of
25274 Types. TypeRefs are just temporary type placeholders, that need
25275 to be resolved. They initially have a pointer to a string and the
25276 current scope in which they are used. This is used later by the
25277 compiler to resolve the reference to an actual Type.
25279 * DeclSpace is no longer a CIR.Type, and neither are
25280 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
25281 are all DeclSpaces, but no Types.
25283 * type.cs (TypeRefManager): This implements the TypeRef manager,
25284 which keeps track of all the types that need to be resolved after
25285 the parsing has finished.
25287 2001-05-13 Miguel de Icaza <miguel@ximian.com>
25289 * ARGH. We are going to have to store `foreach' as a class rather
25290 than resolving it, as we need to verify error 1579 after name
25291 resolution. *OR* we could keep a flag that says `This request to
25292 IEnumerator comes from a foreach statement' which we can then use
25293 to generate the error.
25295 2001-05-10 Miguel de Icaza <miguel@ximian.com>
25297 * class.cs (TypeContainer.AddMethod): we now add methods to the
25298 MethodGroup instead of the method hashtable.
25300 * expression.cs: Add MethodGroup abstraction, which gets us one
25301 step closer to the specification in the way we handle method
25304 * cs-parser.jay (primary_expression): qualified_identifier now
25305 tried to match up an identifier to a local variable reference or
25306 to a parameter reference.
25308 current_local_parameters is now a parser global variable that
25309 points to the current parameters for the block, used during name
25312 (property_declaration): Now creates an implicit `value' argument to
25315 2001-05-09 Miguel de Icaza <miguel@ximian.com>
25317 * parameter.cs: Do not use `param' arguments as part of the
25318 signature, per the spec.
25320 2001-05-08 Miguel de Icaza <miguel@ximian.com>
25322 * decl.cs: Base class for classes, structs and interfaces. This
25323 is the "Declaration Space"
25325 * cs-parser.jay: Use CheckDef for checking declaration errors
25326 instead of having one on each function.
25328 * class.cs: Factor out some code for handling error handling in
25329 accordance to the "Declarations" section in the "Basic Concepts"
25330 chapter in the ECMA C# spec.
25332 * interface.cs: Make all interface member classes derive from
25333 InterfaceMemberBase.
25335 2001-05-07 Miguel de Icaza <miguel@ximian.com>
25337 * Many things: all interfaces are parsed and generated in
25338 gen-treedump. Support for member variables, constructors,
25339 destructors, properties, constants is there.
25341 Beginning of the IL backend, but very little done, just there for
25344 2001-04-29 Miguel de Icaza <miguel@ximian.com>
25346 * cs-parser.jay: Fix labeled statement.
25348 * cs-tokenizer.cs (escape): Escape " and ' always.
25349 ref_line, ref_name: keep track of the line/filename as instructed
25350 by #line by the compiler.
25353 2001-04-27 Miguel de Icaza <miguel@ximian.com>
25355 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25356 to match the values in System.CodeDOM.
25358 Divid renamed to Divide.
25360 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25362 (Statements.set): remove.
25364 * System.CodeDOM/CodeCatchClause.cs: always have a valid
25367 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25368 falseStatements always have valid values.
25370 * cs-parser.jay: Use System.CodeDOM now.