1 2006-03-18 Marek Safar <marek.safar@seznam.cz>
5 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
7 (AnonymousMethod.ImplicitStandardConversionExists): New method.
8 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
9 Add more error reporting; Fixed issue with params.
11 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
13 * cs-parser.jay: AnonymousMethod requires host container.
15 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
17 2006-03-18 Raja R Harinath <harinath@gmail.com>
19 * class.cs: Change 'TypeContainer ds' constructor argument to
20 'DeclSpace parent'. Some classes were missed below due to
21 different naming convention.
23 * class.cs (MemberCore.Parent): Delete. This makes the
24 ParentContainer changes below enforceable by the compiler.
26 Treat pointers to enclosing declaration space as 'DeclSpace', not
28 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
29 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
31 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
33 (Block.AddThisVariable): Likewise.
34 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
35 (AbstractPropertyEventMethod.Emit): Likewise.
36 (AbstractPropertyEventMethod.EmitMethod): Likewise.
37 (GetMethod.Define, SetMethod.Define): Likewise.
38 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
39 (DelegateMethod.EmitMethod): Likewise.
41 Fix regression test-partial-13.cs.
42 Rationalize use of PartialContainer. Ensure that the partial
43 class semantics can be tied to type-correctness, i.e., any
44 violation will cause a compile error.
45 * class.cs, const.cs: Access all fields that belong to class
46 TypeContainer via ParentContainer. Arguments of EmitContexts and
47 Resolve()-like functions still use 'Parent'.
49 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
50 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
51 (PropertyMethod.CheckModifiers): Remove unused argument.
52 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
55 2006-03-28 Raja R Harinath <rharinath@novell.com>
57 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
59 2006-03-17 Raja R Harinath <harinath@gmail.com>
61 Make semantics of PartialContainer simpler.
62 * decl.cs (DeclSpace.IsPartial): Remove.
63 * class.cs (TypeContainer.IsPartial): Likewise.
64 (TypeContainer..ctor): Set PartialContainer to point to self.
65 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
66 (TypeContainer.FindNestedType): Likewise.
67 (MemberCore.ParentContainer): Simplify. Remove deprecation.
69 2006-03-17 Marek Safar <marek.safar@seznam.cz>
71 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
73 2006-03-15 Marek Safar <marek.safar@seznam.cz>
75 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
78 2006-03-15 Marek Safar <marek.safar@seznam.cz>
80 * class.cs (Operator.Define): An error for base conversion was not
83 2006-03-13 Marek Safar <marek.safar@seznam.cz>
85 A fix for #77593, #77574.
87 * class.cs (MethodCore.CheckBase): Another if for operator.
89 2006-03-18 Marek Safar <marek.safar@seznam.cz>
93 * expression.cs (VerifyArgumentsCompat): Reverted to double error
94 reporting, it's more tricky than I thought.
96 2006-03-09 Marek Safar <marek.safar@seznam.cz>
98 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
101 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
102 (DelegateCreation.ImplicitStandardConversionExists): New method for just
105 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
108 2006-03-04 Marek Safar <marek.safar@seznam.cz>
112 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
113 (Event.Define): ditto
114 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
116 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
117 Removed redundant code and set NewSlot for Invoke method too.
119 * parameter.cs (Parameters.ctor): Add custom, type ctor.
120 (Parameters.MergeGenerated): New method. Use this method when you merge
121 compiler generated argument with user arguments.
123 2006-03-03 Marek Safar <marek.safar@seznam.cz>
125 * attribute.cs (ResolveAsTypeTerminal): Removed.
127 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
128 specialization for predefined types; 30% speed up.
129 Finally placed obsolete check to right place.
130 (Expression.ResolveType): Removed.
132 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
133 Updated after ResolveType was removed.
135 * expression.cs (Cast.ctor): Check void cast.
136 (Binary.ResolveAsTypeTerminal): Is never type.
137 (Conditional.ResolveAsTypeTerminal): Is never type.
139 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
141 2006-03-26 Marek Safar <marek.safar@seznam.cz>
143 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
145 2006-03-23 Martin Baulig <martin@ximian.com>
147 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
148 type check if either of the types is an open generic type.
150 2006-03-23 Martin Baulig <martin@ximian.com>
153 (Convert.ExplicitTypeParameterConversion): New method; implement
154 explicit type parameter conversions.
156 2006-03-23 Martin Baulig <martin@ximian.com>
158 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
159 blindly allow all conversions if we do not have any constraints.
161 2006-02-27 Marek Safar <marek.safar@seznam.cz>
163 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
164 these two separated members to simplify the code.
165 (Attribute.Resolve): Refactored to use new fields and methods.
166 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
167 implemented obsolete attribute checking.
168 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
169 implemented obsolete checking again. It look line never ending quest ;-)
170 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
172 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
174 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
176 *class.cs (Property.Define): Add RegisterProperty call.
178 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
179 argument groups (only 2).
181 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
182 encoding expression to arguments.
183 (Expression.ExprClassToResolveFlags): Just turned to property.
185 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
186 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
187 optimized as well as implemented support for zero-length attributes.
189 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
190 Add caching of PropertyInfo's.
192 2006-02-25 Marek Safar <marek.safar@seznam.cz>
194 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
195 error multiple times.
197 2006-02-25 Marek Safar <marek.safar@seznam.cz>
199 New partial class implementation.
200 A fix for #77027, #77029, #77403
202 * attribute.cs (Attributable): Made attributes protected.
204 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
205 the replacements of ClassPart and PartialContainer.
206 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
207 (TypeContainer.AddInterface): Ditto.
208 (TypeContainer.AddPartial): The main method for partial classes. It checks
209 for errors and merges ModFlags and attributes. At the end class is added to
211 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
213 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
214 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
215 from the rest of partial classes.
216 (TypeContainer.GetClassBases): Simplified.
217 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
219 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
220 (TypeContainer.HasExplicitLayout): Uses Flags now.
221 (PartialContainer): Removed.
222 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
223 (StaticClass): Was merged with Class.
224 (Class.GetClassBases): class and static class bases are verified here.
225 (Class.TypeAttr): Added static attributes when class is static.
226 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
227 (MemberBase): In some cases we need to call parent container for partial
228 class. It should be eliminated but it's not easy now.
230 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
232 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
233 partial classed to accumulate class comments.
234 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
236 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
238 * driver.cs (MainDriver): Tree.GetDecl was removed.
240 * modifiers.cs (Modifiers): Add partial modifier.
242 * tree.cs (Tree.decl): Removed.
243 (RootTypes): Started to use this class more often for root types
246 2006-03-23 Raja R Harinath <rharinath@novell.com>
248 * generic.cs (TypeParameter.UpdateConstraints): Update
249 'constraints' if null.
251 2006-02-22 Marek Safar <marek.safar@seznam.cz>
255 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
256 external interface does not have an attribute.
258 2006-02-22 Marek Safar <marek.safar@seznam.cz>
260 Another prerequisites for new partial classs implementation.
262 * attribute.cs (Attribute.Equal): Implemented.
263 (Attribute.Emit): Changed as attributes can be applied more than twice.
264 (Attributes.Emit): Check for duplicate attributes here.
266 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
267 as a parameter, clean-up.
269 2006-02-11 Marek Safar <marek.safar@seznam.cz>
273 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
274 contains obsolete attribute check which can in some cases look for base
275 type of current class which is not initialized yet.
276 (TypeContainer.BaseType): Replacement of ptype.
278 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
280 2006-02-11 Marek Safar <marek.safar@seznam.cz>
282 First of prerequisites for new partial classs implemention.
284 * attribute.cs (Attributable): Extended by ResolveContext;
285 Attributes finally have correct context for resolving in all cases.
286 (AttachTo): Attribute owner is assigned here.
288 * codegen.cs (IResolveContext): Introduce new interface to hold
289 all information needed in resolving phase.
290 (EmitContext): Implements IResolveContext; more clean-up needed here.
292 * decl.cs (MemberCore): Implemented IResolveContext.
294 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
295 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
296 parameter.cs, statement.cs, tree.cs, typemanager.cs:
297 Refactored to use new IResolveContext instead of EmitContext; cleanup
299 2006-03-22 Raja R Harinath <rharinath@novell.com>
301 Support ParameterDefaultValueAttribute in gmcs. Also applied to
302 mcs to keep code differences small.
303 * attribute.cs (Attribute.GetParameterDefaultValue): New.
304 * typemanager.cs (parameter_default_value_attribute_type): New.
305 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
308 2006-03-22 Martin Baulig <martin@ximian.com>
311 (Nullable.NullableLiteral): Derive from `NullLiteral'.
314 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
315 instead of the normal `NullLiteral'.
317 2006-03-21 Martin Baulig <martin@ximian.com>
320 * generic.cs (TypeManager.InferType): If `pt' is a generic
321 parameter, don't check whether `pt == at'.
323 2006-03-20 Raja R Harinath <rharinath@novell.com>
326 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
327 (TypeParameter.Resolve): Update to change.
328 (ConstraintChecker.CheckConstraints): Resolve type-argument
329 constraints before use.
331 2006-03-16 Martin Baulig <martin@ximian.com>
334 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
335 and don't have any instance constructors, also lookup in the base class.
336 (TypeManager.IsNullableValueType): New public method.
338 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
339 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
340 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
342 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
343 instead of just TypeManager.IsNullableType() to determine whether
344 a lifted operator exists.
345 (UnaryMutator.DoResolve): Likewise.
346 (Conditional.DoResolve): Likewise.
347 (Binary.DoResolve): A lifted operator only exists if both operands
348 are valuetypes and at least one of them is a nullable type.
350 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
352 * iterator.cs : yield break is allowed in try statement which has
353 catch clauses. Fixed bug #77767.
355 2006-03-12 Martin Baulig <martin@ximian.com>
357 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
358 private IsSignatureEqual() to compare types; see the comment in
359 that method; fixes #77674.
361 2006-03-10 Raja R Harinath <rharinath@novell.com>
363 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
364 (Expression.ResolveAsTypeTerminal): Likewise.
365 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
366 * expression.cs, generic.cs, iterators.cs: Likewise.
367 * parameter.cs, statement.cs, typemanager.cs: Likewise.
369 2006-03-09 Martin Baulig <martin@ximian.com>
371 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
372 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
374 2006-03-09 Martin Baulig <martin@ximian.com>
376 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
377 `prepared' flag is set.
379 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
380 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
381 issues; see gtest-254.cs.
383 2006-03-07 Martin Baulig <martin@ximian.com>
385 * generic.cs (TypeManager.InferType): Allow infering
386 `IEnumerable<T>' with an array of T; see gtest-251.cs.
388 2006-03-06 Martin Baulig <martin@ximian.com>
391 (TypeManager.InferType): Fix gtest-250.cs.
394 (TypeManager.IsSubclassOf): Also check the base class.
397 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
400 2006-03-01 Raja R Harinath <rharinath@novell.com>
403 * expression.cs (ParameterReference.DoResolveBase): Change return
405 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
409 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
412 * typemanager.cs (GetFullNameSignature): Don't nullref on
415 2006-02-16 Martin Baulig <martin@ximian.com>
418 (TypeManager.GetGenericFieldDefinition): New public method; use it
419 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
421 2006-02-14 Martin Baulig <martin@ximian.com>
423 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
425 2006-02-14 Martin Baulig <martin@ximian.com>
428 (TypeManager.DropGenericMethodArguments): New public method; don't
429 use GetGenericMethodDefinition() on something which is not a
432 2006-02-14 Martin Baulig <martin@ximian.com>
435 (ConstraintChecker.CheckConstraints): If a type parameter has the
436 `struct' constraint, the type must be a non-nullable valuetype.
438 2006-02-10 Martin Baulig <martin@ximian.com>
441 (TypeManager.IsOverride): Make this work for instantiated methods
442 in a generic class; fixes #77509.
443 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
444 rather than calling it directly; fixes #77488.
446 2006-02-08 Martin Baulig <martin@ximian.com>
448 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
449 reporting into CheckConstraint() so we can use the correctly
452 2006-02-08 Martin Baulig <martin@ximian.com>
454 * expression.cs (BaseAccess): Add support for generic methods.
456 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
457 the new MethodGroupExpr.
459 2006-02-07 Martin Baulig <martin@ximian.com>
461 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
462 also reference types; fixes #77483.
464 2006-02-07 Martin Baulig <martin@ximian.com>
467 (TypeManager.IsGenericMethod): We now return whether something is
468 an instantiated generic method (and not a generic method def).
469 (TypeManager.IsGenericMethodDefinition): New public method.
472 (TypeManager.CSharpSignature): Only include type arguments for
473 "real" generic methods, not for any instantiated method.
474 (TypeManager.GetMethodName): Likewise, but also allow generic
475 method definitions here.
477 2006-02-06 Miguel de Icaza <miguel@novell.com>
479 * codegen.cs (EmitScopeInitFromBlock): check here the
480 capture_context, there is no need to make two calls to the
483 * anonymous.cs: Add some debugging messages that might help me
484 track other instances of this problem in the future (the
485 regression of test 467).
487 * cs-parser.jay: track the variable block, as we need to initalize
488 any captured variables declared in this block for the "catch"
489 portion of the "Try" statement.
491 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
492 scope initialization for captured variables.
494 Also, move the emit for the variables after the block location has
497 2006-02-06 Marek Safar <marek.safar@seznam.cz>
499 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
501 2006-02-06 Martin Baulig <martin@ximian.com>
503 * class.cs (TypeContainer.DefineType): If we're a struct, pass
504 `TypeManager.value_type' as parent type to
505 ModuleBuilder.DefineType(). Fixes #77358.
507 2006-02-02 Miguel de Icaza <miguel@novell.com>
509 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
510 commit yesterday, the initialization for the roots is necessary.
511 What is not necessary is the scope activation.
513 2006-02-02 Raja R Harinath <rharinath@novell.com>
515 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
516 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
518 (Argument.Resolve): Remove CS0206 checks.
520 2006-02-01 Miguel de Icaza <miguel@novell.com>
522 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
523 scopes for all the roots, the scopes will now be emitted when the
524 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
526 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
527 code. This reduces a lot of existing cruft.
529 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
530 that the ScopeInfo is generated as we enter the scope, not at the
531 time of use, which is what we used to do before.
533 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
534 every time a Block is about to be emitted if we have a
537 2006-02-01 Raja R Harinath <rharinath@novell.com>
539 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
540 attribute for mscorlib too.
542 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
544 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
546 * typemanager.cs (cons_param_array_attribute): Make private.
547 (Reset): Set it to null.
548 (InitCoreHelpers): Don't initialize it.
549 (ConsParamArrayAttribute): New. Initialize it as needed.
550 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
552 2006-01-31 Miguel de Icaza <miguel@novell.com>
554 * expression.cs: There might be errors reported during the
555 selection of applicable methods. If there are errors, do not
556 continue execution as it will lead the compiler to crash.
558 2006-01-30 Miguel de Icaza <miguel@novell.com>
560 * expression.cs: Member access is not allowed on anonymous
561 methods. Fixes #77402.
563 2006-01-30 Raja R Harinath <rharinath@novell.com>
566 * cs-parser.jay (VariableDeclaration): Don't set
567 current_array_type to null.
568 (field_declaration, event_declaration, declaration_statement):
571 2006-01-29 Raja R Harinath <harinath@gmail.com>
574 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
576 2006-01-28 Raja R Harinath <harinath@gmail.com>
578 * typemanager.cs (GenericParameterPosition): New.
581 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
583 * doc.cs : To process "include" elements, first we should create
584 another list than XmlNodeList, because it could result in node
585 removal, which could result in that the XmlNodeList gives up
588 2006-01-25 Miguel de Icaza <miguel@novell.com>
590 * expression.cs: Introduce an error report that we were not
591 catching before. Gonzalo ran into it.
593 2006-01-23 Miguel de Icaza <miguel@novell.com>
595 A fix for bug: #76957
597 * iterators.cs (MoveNextMethod.CreateMethodHost): call
598 ComputeMethodHost before creating the method, this is a new
601 * anonymous.cs (AnonymousContainer): Now we track all the scopes
602 that this method references (RegisterScope). The actual scope
603 where the method is hosted is computed with the ComputeMethodHost
604 before we create the method.
606 Moved the Deepest routine here.
608 (AnonymousContainer.ComputeMethodHost): New routine used to
609 compute the proper ScopeInfo that will host the anonymous method.
611 (ScopeInfo): Deal with multiple roots. The problem was that we
612 did not have a unique root where all ScopeInfos could be hanged
613 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
616 Remove AdjustMethodScope which is now computed at the end. Remove
617 LinkScope which did a partial link, instead link all ScopeInfos
618 before code generation from the new "LinkScopes" routine.
620 Simplify all the Add* routines as they no longer need to maintain
621 the tree, they just need to record that they are using variables
624 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
625 routines to produce the forest of ScopeInfo trees.
627 * class.cs (TypeContainer.AppendMethod): This is just like
628 AddMethod, but ensures that an interface implementation method
629 (IEnumerable.XXX) is not inserted at the beginning of the queue of
630 methods, but at the end.
632 We use this functionality to ensure that the generated MoveNext
633 method in the iterator class is resolved/emitted before the
634 enumerator methods created.
636 This is required because the MoveNext method computes the right
637 ScopeInfo for the method. And the other methods will eventually
638 need to resolve and fetch information computed from the anonymous
642 2006-01-23 Raja R Harinath <rharinath@novell.com>
644 Improve implementation of section 14.4.2.2 (Better function member).
645 * expression.cs (Invocation.MoreSpecific): Compare all type
646 arguments before deciding if one type is more specific than
647 another. Handle array types too. Return the more specific type.
648 (Invocation.BetterFunction): Add more tie-breaking rules from
649 section 14.4.2.2. Perform "more specific" check after
650 other tie-breaking rules. Compare all parameter types before
651 choosing the "more specific" method.
653 2006-01-21 Raja R Harinath <harinath@gmail.com>
654 Carlos Alberto Cortez <calberto.cortez@gmail.com>
657 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
659 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
660 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
662 2006-01-18 Martin Baulig <martin@ximian.com>
664 * class.cs (TypeContainer.AddToMemberContainer): Use
665 `symbol.MemberName.MethodName' instead of just `symbol.Name';
668 2006-01-18 Martin Baulig <martin@ximian.com>
670 Fix #76417: a generic class may now have methods which may unify
671 for some type parameter substitutions.
673 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
674 for methods which may unify anymore.
676 * expression.cs (Invocation.MoreSpecific): New private static
677 method; checks whether one method is more specific than another
678 according to 14.4.2.2 of the spec.
679 (Invocation.BetterFunction): Implement the tie-breaking rules from
680 14.4.2.2 of the spec: if two methods unify for some type parameter
681 substitution, we need to pick the more specific one.
683 2006-01-18 Raja R Harinath <rharinath@novell.com>
685 Fix #76656, cs0231-2.cs.
686 * cs-parser.jay (formal_parameter_list): Make error case catch
688 (parenthesized_expression_0): Add CS1026 check.
689 (invocation_expression): Remove unused { $$ = lexer.Location }.
691 2006-01-17 Raja R Harinath <rharinath@novell.com>
694 * cs-parser.jay (statement_expression): Don't list out the
695 individual statement-expressions. Convert syntax error into
698 2006-01-16 Raja R Harinath <rharinath@novell.com>
701 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
702 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
703 CheckIntermediateModification.
704 (FieldExpr.DoResolve): Add new two-argument version that
705 allows us to resolve the InstanceExpression as an lvalue.
706 The one-argument variant is now just a wrapper.
707 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
708 Resolve the lhs as an lvalue if the it has a value type.
709 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
710 from Assign.DoResolve.
711 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
712 resolved as an lvalue.
713 (PropertyExpr.DoResolve): Update.
714 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
715 has a value type. Move CS1612 check here from
716 CheckIntermediateModification.
717 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
718 * expression.cs (EmptyExpression.OutAccess): New. Used as the
719 'right_side' of a ResolveLValue on an 'out' argument.
720 (EmptyExpression.LValueMemberAccess): New. Used as the
721 'right_side' of a propagated ResolveLValue on a value type.
722 (LocalVariableReference.DoResolveBase): Recognize
723 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
725 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
726 EmptyExpression.Null.
728 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
730 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
731 Type.IsGenericParameter(). Fixed bug #77183.
732 * doc.cs : it is now identical to doc.cs in mcs.
734 2006-01-16 Martin Baulig <martin@ximian.com>
736 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
738 2006-01-16 Martin Baulig <martin@ximian.com>
740 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
743 2006-01-12 Miguel de Icaza <miguel@novell.com>
745 This fixes the problem where we used ldfld instead of ldflda to
746 load the "THIS" pointer on captured parameters, when THIS is a
747 value type. See bug #77205.
749 * iterators.cs (CapturedThisReference.Emit): Pass false to
750 EmitThis (we do not need the address).
752 * codegen.cs (EmitThis): it needs to know whether we need the
753 address of `this' or not. This is used by value types.
755 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
756 every other call passes false.
758 2006-01-12 Raja R Harinath <rharinath@novell.com>
761 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
763 * expression.cs (Invocation.OverloadResolve): Update.
764 (Invocation.DoResolve): Avoid double resolution of invocation.
766 2006-01-11 Raja R Harinath <rharinath@novell.com>
769 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
770 unary negation of floating point types as 0-expr; negation cannot
771 overflow in floating point types.
774 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
775 on operands of 'void' type.
778 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
779 and ExclusiveOr for boolean constants too.
781 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
783 * expression.cs: Fix Console.WriteLine ((this = x).foo);
785 2006-01-12 Miguel de Icaza <miguel@novell.com>
787 * cs-tokenizer.cs (Position): New class used to save and restore
788 the position state in the tokenizer. Before this patch the save
789 and restore was not complete enough so the line and columns would
790 start to drift and the debugger and stack traces will get the
793 2006-01-10 Martin Baulig <martin@ximian.com>
796 (TypeParameter.InflateConstraints): New public method.
798 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
799 constraints; fixes #77042.
801 2006-01-10 Martin Baulig <martin@ximian.com>
803 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
804 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
807 2006-01-09 Raja R Harinath <rharinath@novell.com>
810 * expression.cs (Invocation.OverloadResolve): Replace reflected
811 override methods with their base virtual methods, rather than
813 * typemanager.cs (TypeManager.GetOverride): New.
815 2005-12-21 Miguel de Icaza <miguel@novell.com>
817 * driver.cs: Report the case of no source files and no -out:
820 2005-12-20 Raja R Harinath <rharinath@novell.com>
823 * expression.cs (ComposedCast.GetSignatureForError): Define.
825 2006-01-05 Jb Evain <jbevain@gmail.com>
827 * class.cs (Property.Define, Indexer.Define): do not tag the
828 properties as SpecialName | RTSpecialName.
830 2006-01-04 Miguel de Icaza <miguel@novell.com>
832 * class.cs (MethodCore.IsDuplicateImplementation): This method was
833 doing a low-level comparission of parameter types. It was lacking
834 a check for __argslist.
836 2005-12-30 Miguel de Icaza <miguel@novell.com>
838 * expression.cs (ParameterReference.DoResolveBase): Allow
839 reference parameters if they are local to this block.
841 This allows the ref and out parameters of a delegate to be used in
842 an anonymous method, for example:
844 delegate void set (out int x);
846 set s = delegate (out int x){
850 This is used by functionality introduced late in the C# language.
852 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
853 method that take ref and out parameters.
855 Fixes #77119 which was a late change in the spec.
857 2005-12-23 Miguel de Icaza <miguel@novell.com>
859 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
860 parent if its the same scope. Fixes #77060.
862 2005-12-22 Marek Safar <marek.safar@seznam.cz>
864 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
866 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
868 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
869 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
870 that doesn't contain the full public key. This is a update of the
871 friend assemblies in .Net 2.0 release.
873 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
877 * namespace.cs (NamespaceEntry): Add extern_aliases as a
878 ListDictionary, to contain the ExternAliasEntry entries (in
879 addition to the NamespaceEntry.aliases hashtable). This field is
880 shared between the original entry and its doppelganger (bodyless
882 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
883 extern_aliases field.
884 (NamespaceEntry.Lookup): Move the IsImplicit check after the
885 lookup in extern_aliases.
887 2005-12-16 Raja R Harinath <rharinath@novell.com>
890 * class.cs (TypeContainer.Mark_HasEquals): New.
891 (TypeContainer.Mark_HasGetHashCode): New.
892 (ClassPart): Override them.
893 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
895 * generic.cs (GenericMethod.DefineMembers): Update to changes.
896 (TypeParameter.TypeParameter): Change type of 'parent' argument to
900 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
901 'parent' argument to the base constructor.
903 Remove all mention of TypeContainer from decl.cs.
904 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
905 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
906 (DeclSpace.DeclSpace): Likewise.
907 (DeclSpace.DefineMembers): Remove unused argument.
908 * cs-parser.jay (pop_current_class): Update to changes. Simplify
909 debugging check -- we don't care if the debug code throws an
910 InvalidCastException instead of an InternalErrorException.
911 * class.cs (TypeContainer.DefineMembers): Update to changes.
912 (TypeContainer.DoDefineMembers): Likewise.
913 (TypeContainer.GetMethods): Likewise.
914 (PropertyMember.Define): Likewise.
915 (MemberBase.Parent): New property that forwards to
916 MemberCore.Parent, but ensures that we get a TypeContainer.
917 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
918 (RootContext.PopulateTypes): Likewise. Remove special case code
919 for !RootContext.StdLib: DefineMembers is idempotent.
921 2005-12-13 Marek Safar <marek.safar@seznam.cz>
923 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
925 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
927 * doc.cs : The search for referenced namespace was insufficient to
928 get global one as it used to do. Fixed bug #76965.
930 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
932 * doc.cs : check name in cref in the last phase that whether it is
935 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
937 * cs-tokenizer.cs : reverted the latest change: it somehow broke
940 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
942 * doc.cs : so it turned out that we cannot skip override check for
943 interface members. Fixed bug #76954.
945 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
947 * cs-tokenizer.cs : fixed bug #75984:
948 - #warning and #error should not be handled when the source line
950 - #line is not checked strictly when the source line is disabled.
951 - #define and #undef is on the other hand checked strictly at any
954 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
956 * cs-tokenizer.cs : missing Location (actually, filename) in one of
959 2005-12-15 Raja R Harinath <rharinath@novell.com>
961 * generic.cs (TypeManager.IsGeneric): Remove unused method.
963 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
966 2005-12-14 Martin Baulig <martin@ximian.com>
968 * typemanager.cs (TypeManager.GetFullName): Make this public;
969 `Type.Fullname' now never returns null.
971 * class.cs (Method.Define): Use TypeManager.GetFullName() for
972 explicit interface implementations; we're now using the same
973 naming convention than csc does.
975 2005-12-14 Miguel de Icaza <miguel@novell.com>
977 * convert.cs (ExplicitConversionCore): Check the return value from
978 ExplicitConversionCore which can return null on failure. Fixes #76914
980 2005-12-09 Raja R Harinath <rharinath@novell.com>
982 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
983 instead of IsGenericInstance.
984 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
985 code that's now covered by the more general test.
986 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
988 * generic.cs (DropGenericTypeArguments): New. Captures the common
989 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
990 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
991 * generic.cs, report.cs, typemanager.cs: Likewise.
993 2005-12-08 Martin Baulig <martin@ximian.com>
995 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
997 * typemanager.cs (TypeManager.CSharpSignature): Include type
998 arguments in the signature of a generic method.
1000 2005-12-07 Martin Baulig <martin@ximian.com>
1002 Add support for custom attributes on type parameters.
1004 * cs-parser.jay (type_arguments): Added `opt_attributes'.
1006 * generic.cs (TypeParameterName): New public class; we use this
1007 instead of a `string' to store the name of a type parameter, so we
1008 can also have `Attributes'.
1009 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1010 array instead of a `string[]' array.
1011 (TypeParameter.ctor): We now also take an `Attributes' argument.
1012 (TypeParameter.EmitAttributes): New public method; emit our
1013 `OptAttributes' here.
1014 (GenericMethod.EmitAttributes): New public method; emit the custom
1015 attributes on all our type parameters.
1017 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1018 our type parameters.
1019 (MethodData.Define): If we're a generic method, call
1020 EmitAttributes() on it.
1022 2005-12-07 Martin Baulig <martin@ximian.com>
1025 (ConstraintChecker): New public abstract class; move the
1026 constraint checking here from `ConstructedType' and also do
1027 constraint checking for generic methods here.
1029 * expression.cs (Invocation.OverloadResolve): Use
1030 ConstraintChecker.CheckConstraints() if we resolved to a generic
1033 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1035 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1037 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1039 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1040 (FieldBase.Initializer): Initializer is now optional.
1041 (EventField.Define): Only event field can have initializer.
1043 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1045 * const.cs (Const): Reuse initializer.
1047 * cs-parser.jay: Updated after FieldBase changes.
1048 Added current_array_type to simplify array initializers.
1050 * ecore.cs (NullCast.IsDefaultValue): Implemented.
1052 * expression.cs, iterators.cs: Updated.
1054 * namespace.cs (NamespaceEntry): Made UsingFound private.
1056 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1058 * parameterCollection.cs: Obsolete, removed.
1059 * parser.cs: Obsolete, removed.
1061 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1064 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1066 * enum.cs (Enum.Define): Set obsolete context here.
1068 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1071 - FindDocumentedMember() now expects 1) paramList as null
1072 when "we don't have to check the number of parameters" and
1073 2) Type.EmptyTypes when "there is no arguments".
1074 - Introduced FoundMember struct to hold the exact type which was
1075 used to find the documented member (the above change broke
1076 test-xml-044; it might be better just to use DeclaringType than
1077 what MS does, like this change does, but it depends on usage.)
1079 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1081 * doc.cs : documented member might be from DeclaringType for nested
1082 types. Fixed bug #76782.
1084 2005-12-03 Ben Maurer <bmaurer@ximian.com>
1086 * anonymous.cs: Have the param code handle leaving copies on the
1087 stack etc. Allows anonymous params to take part in the assignment
1088 code (++, +=, etc). Fixes bug #76550
1090 * expression.cs: Handle the prepare_for_load/leave_copy by passing
1091 it down to the anon code.
1093 * iterators.cs: Use dummy var here
1095 * codegen.cs: Handle new vars
1097 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1100 * class.cs (MethodData.Define): Set proper Obsolete context.
1102 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1104 (FieldExpr.DoResolve): Ditto.
1106 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1109 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1110 parent is not obsolete.
1112 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
1114 * doc.cs : (FindDocumentedMember) find parameterless members first
1115 and get CS0419 in the early stage. Fixed first case of bug #76727.
1117 2005-11-30 Marek Safar <marek.safar@seznam.cz>
1120 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1121 no error was reported.
1123 *expression.cs (Binary.DoResolve): left can be null.
1125 2005-12-06 Raja R Harinath <rharinath@novell.com>
1127 * class.cs (MethodCore.CheckGenericOverride): Delete unused
1128 abstract method and all overrides.
1129 * support.cs (ParameterData.GenericConstraints): Delete.
1130 (ReflectionParameters.type_params): Delete.
1131 (ReflectionParameters.ReflectionParameters): Make private.
1132 (ReflectionParameters.GetConstaints): New factory method.
1133 * generic.cs (TypeParameterDefineType): Use it.
1134 (TypeManager.GetTypeParameterConstraints): Likewise.
1136 2005-11-22 Marek Safar <marek.safar@seznam.cz>
1139 * class.cs (MethodData.Emit): Parameters should be labeled first.
1141 2005-11-21 Marek Safar <marek.safar@seznam.cz>
1144 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1146 2005-11-18 Marek Safar <marek.safar@seznam.cz>
1148 * attribute.cs (AreParametersCompliant): Moved to Parameter.
1150 * class.cs (MethodCore): Parameter clean up.
1151 (IMethodData): Added ParameterInfo.
1152 (MethodData): Parameter clean up.
1153 (Indexer.Define): Parameter clean up.
1165 * typemanager.cs: Parameter clean up.
1167 * delegate.cs (Define): Get rid of duplicated code.
1169 * expression.cs (ParameterReference): Removed useless parameters
1171 (Invocation): Ditto.
1173 * parameter.cs (ParamsParameter): New class, params specialization.
1174 (ArglistParameter): Attemp to separate arglist.
1175 (Parameter): Refactored to be reusable and faster.
1176 (Parameter.Modifier): Made understandable.
1177 (Parameters): Changed to be used as a class for `this' assembly
1178 parameters. Refactored to use new specialized classes.
1180 * support.cs (ParameterData): Added Types property.
1181 (InternalParameters): Deleted.
1183 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1185 * doc.cs : the previous patch does not actually fix the bug.
1186 PropertyInfo override check is now implemented and really fixed it.
1187 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1189 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1191 * doc.cs : apply "override filter" also to properties.
1194 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1196 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1197 no need to check overrides. For classes, omit those results from
1198 interfaces since they must exist in the class. Fixed bug #76726.
1200 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1202 * typemanager.cs : (GetFullNameSignature) differentiate indexers
1203 with different parameters. Fixed the second problem in #76685.
1205 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1207 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1208 get expected 'protected' access in CheckValidFamilyAccess()).
1211 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1213 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1214 Fixed bug #76705. CS1569 was incorrectly commented out.
1216 2005-11-23 Martin Baulig <martin@ximian.com>
1218 * generic.cs (Constraints.Define): Removed.
1219 (TypeParameter.DefineConstraints): Removed.
1220 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1221 on the GenericTypeParameterBuilder here.
1223 2005-11-23 Martin Baulig <martin@ximian.com>
1225 * typemanager.cs (TypeManager.GetProperty): Make this public.
1227 * generic.cs (Nullable.NullableInfo.ctor): Use
1228 TypeManager.GetProperty() rather than using reflection directly.
1230 2005-11-17 Martin Baulig <martin@ximian.com>
1232 * expression.cs (Indexers.GetIndexersForType): Added support for
1233 generic parameters; fixes #76587.
1235 2005-11-17 Martin Baulig <martin@ximian.com>
1238 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1239 inherit the scope from our parent. Fixes #76653.
1241 2005-11-15 Martin Baulig <martin@ximian.com>
1243 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1244 instead of `ScopeTypeBuilder' to refer to the "current" type.
1245 (AnonymousMethod.CreateScopeType): Correctly create the helper
1246 class if we're inside a generic type definition.
1248 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1250 * doc.cs : use Invocation.IsOverride() to do real override check.
1251 * expression.cs : made Invocation.IsOverride() internal.
1253 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1255 * doc.cs : use TypeManager.FindMembers() instead of (possible)
1256 TypeBuilder.FindMembers() and filter overriden base members out.
1259 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1261 * doc.cs : ref/out parameters are represented as '@' (instead of
1262 '&' in type FullName). Fixed bug #76630 (additionally crefs).
1264 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1266 * doc.cs : when there was no '.' in cref to methods in doc comment,
1267 then parameters were missing in the output. Fixed bug #76691.
1269 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1271 * driver.cs : don't output docs when there is an error.
1274 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1277 Now it should detect indexers. Fixed primary concern in bug #76685.
1278 Fixed CS0419 message to not show the identical member signature in
1281 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1283 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1284 instead of Type.FindMembers() since it does not handle events.
1287 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
1289 * codegen.cs: Fixed typo (speficied -> specified).
1291 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1294 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1296 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1298 * attribute.cs: Changed error message.
1300 * cs-tokenizer.cs: One more check.
1302 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1304 * statement.cs (Block.Resolve): Ignore empty statement.
1306 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1308 * report.cs: Made error/warning methods more strict to avoid
1311 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1312 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1313 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1314 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1316 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1318 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
1319 Use the more explicit AssemblyName.FullName instead of
1320 AssemblyName.Name to report errors.
1322 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1324 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1327 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1337 * report.cs: Fixed error reporting and typos.
1339 * generic.cs (TypeParameter.GetSignatureForError): New method.
1340 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1342 * typemanager.cs (GetFullName): Refactored.
1344 2005-11-08 Marek Safar <marek.safar@seznam.cz>
1346 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1347 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1349 * class.cs (TypeContainer.IsComImport): New property.
1350 (Constructor.Define): Create proper ctor for ComImport types.
1352 * expression.cs (New.CheckComImport): Fixed.
1354 2005-11-07 Miguel de Icaza <miguel@novell.com>
1356 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1357 that a parameter has been captured does not mean that we do not
1358 have to do the rest of the processing. This fixes the second part
1359 of #76592. If there was another anonymous method capturing
1360 values in the past, the Scope would never be set for the second
1361 method that captured the same parameter.
1363 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1364 properly manipulate the stack. Second part of fix for #76592.
1366 * expression.cs (New): Add support for invoking "new" on
1367 interfaces that have been flagged with the ComImport attribute and
1368 the CoClass. Fixes #76637
1370 * statement.cs (Try.DoEmit): When a variable is captured, do not
1371 try to emit the vi.LocalBuilder variable as it has been captured.
1372 Create a temporary variable and store the results on the
1373 FieldBuilder. Fixes #76642
1375 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1377 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1379 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1381 * expression.cs (Binary.DoResolve): Added && optimalization.
1383 * typemanager.cs (AddUserType): Removed useless argument.
1385 2005-11-04 Marek Safar <marek.safar@seznam.cz>
1387 * statement.cs (Block.variables): Uses ListDictionary.
1389 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1392 * class.cs (PartialContainer.EmitType): Customized to emit
1393 security attributes.
1394 (ClassPart.ApplyAttributeBuilder): Transform security attribute
1395 for partial classes.
1397 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1400 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1401 access has to be fixed.
1403 * typemanager.cs (IsUnmanagedType): Wrong common field type.
1405 2005-11-01 Marek Safar <marek.safar@seznam.cz>
1408 * ecore.cs (NullCast.Reduce): Implemented.
1410 * expression.cs (ArrayCreation.CheckIndices): Correcly check
1413 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1415 (Foreach.Resolve): Catch null properly.
1417 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1419 * cs-tokenizer.cs: Warning text fix.
1421 * driver.cs: AllWarningNumbers exposed on public interface.
1423 * report.cs (): Reviewed warning numbers.
1424 (IsValidWarning): Use binary search.
1426 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1428 * driver.cs: Implemeted resource visibility.
1429 (Resources): New class for code sharing between /res: and
1432 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1434 decl.cs (CurrentTypeParameters): Fixed to be public.
1436 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1438 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1440 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1442 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1444 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
1446 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1448 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1450 Add friend assembly access support.
1451 * typemanager.cs: assembly_internals_vis_attrs
1452 cache for friend assembly access.
1453 (TypeManager.IsFriendAssembly): New method for
1454 checking friend assembly access.
1455 (TypeManager.Error_FriendAccessNameNotMatching): New
1457 (TypeManager.CompareKeyTokens): Likewise.
1458 (TypeManager.Filter): Handle friend accessible
1461 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1462 friend accessible types.
1464 * ecore.cs (Expression.IsAccessorAccessible): Handle
1465 friend accessible properties.
1467 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1470 2005-10-28 Marek Safar <marek.safar@seznam.cz>
1473 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1476 * convert (Convert.ImplicitReferenceConversion): NullCast holds
1479 * ecore.cs (NullCast): Child is contant only.
1481 * literal.cs (NullLiteral.Reduce): null can be converted to any
1484 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
1486 * driver.cs: Use Encoding.Default as default code page instead
1489 2005-10-27 Raja R Harinath <rharinath@novell.com>
1492 * expression.cs (Invocation.Error_InvalidArguments): Handle
1493 __arglist parameters.
1494 (Invocation.VerifyArgumentsCompat): Likewise.
1495 * support.cs (ReflectionParameters.GetSignatureForError): Print
1496 __arglist parameters.
1497 (InternalParamters.GetSignatureForError): Likewise.
1498 * parameter.cs (Parameters.GetSignatureForError): Likewise.
1500 2005-10-26 Marek Safar <marek.safar@seznam.cz>
1502 * attribute.cs (GetPropertyValue): Made public.
1504 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1506 Add new property WrapNonExceptionThrows to handle 2.0 assembly
1508 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1511 * driver.cs: Reflect method name change.
1513 * statement.cs (Try.Resolve): Warn when try has both general
1516 * typemanager.cs: runtime_compatibility_attr_type new predefined
1519 2005-10-26 Raja R Harinath <harinath@gmail.com>
1522 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1523 treat it as an empty parameter list.
1525 2005-10-26 Raja R Harinath <rharinath@novell.com>
1528 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
1529 ResolveAsTypeStep silent.
1530 * statement.cs (Block.AddConstant): Mark block as used.
1531 (Block.ResolveMeta): Avoid piling on error messages
1532 if a constant initializer resolution fails.
1534 2005-10-25 Raja R Harinath <rharinath@novell.com>
1536 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1538 (NamespaceEntry.VerifyAllUsing): New.
1539 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
1540 behaviour. Delegates actual resolution of alias to ...
1541 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
1542 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1544 * driver.cs (Driver.MainDriver): Update.
1546 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1547 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1549 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1551 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1552 RootNamespace.DefineNamespacesForAll.
1554 2005-10-24 Raja R Harinath <harinath@gmail.com>
1556 * typemanager.cs (assemblies, external_aliases, modules)
1557 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1558 (ComputeNamespaces, GetRootNamespace): Remove extra staging
1559 overhead. Move resposibility ...
1560 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
1561 * driver.cs, attribute.cs, codegen.cs: Update to changes.
1563 2005-10-23 Raja R Harinath <harinath@gmail.com>
1565 * namespace.cs (RootNamespace.all_namespaces): Renamed from
1566 cached_namespaces. Improve usage.
1567 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1568 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1569 Move from GlobalRootNamespace and simplify.
1570 (RootNamespace.Global): Make instance variable.
1571 (RootNamespace.RootNamespace): Add "alias name" parameter.
1572 (GlobalRootNamespace): Simplify drastically.
1573 (Namespace.Lookup): Don't use GetNamespace.
1574 * typemanager.cs (GetRootNamespace): Rename from
1575 ComputeNamespaceForAlias.
1576 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1578 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1580 * anonymous.cs (AnonymousContainer): Don't crash when container
1583 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1585 * expression.cs (Binary.DoResolve): Warn when comparing same
1588 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1591 * expression.cs (Binary.DoResolve): It looks like there are no
1592 convetsion rules in enum context.
1594 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1596 Add support for extern alias qualifiers.
1597 * typemanager.cs: Move some LookupTypeReflection code
1598 to namespace.cs, to have cleaner code. Added some methods
1599 to help us keep track of the extern aliased references.
1600 * driver.cs: Add suport for extern alias assemblies on command
1601 line and check for their warnings/errors. Also keep track of the
1602 extern aliased assemblies.
1603 * namespace.cs: Move the global functionality of Namespace
1604 to GlobalRootNamespace/RootNamespace. Now the global namespace
1605 is GlobalRootNamespace.Globa. Also the code moved from
1606 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
1607 Finally added LocalAliasEntry (AliasEntry before) and
1608 ExternAliasEntry, to handle alias statements.
1609 * cs-parser.jay: Add support in the grammar for extern alias
1611 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
1612 Update callings to Namespace (now in GlobalRootNamespace).
1614 2005-10-25 Martin Baulig <martin@ximian.com>
1616 * convert.cs (ImplicitTypeParameterConversion): Make base
1617 interfaces actually work; fixes #76557.
1619 2005-10-25 Martin Baulig <martin@ximian.com>
1622 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1623 all the type parameters; fixes #76551.
1625 2005-10-25 Martin Baulig <martin@ximian.com>
1630 (GenericMethod.ctor): Added `Expression return_type' and
1631 `Parameters parameters' arguments.
1632 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1633 parameter and return types to check their constraints if they're
1636 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1639 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1640 constraints of a generic type if `ec.ResolvingGenericMethod'.
1642 * class.cs (MethodCore.DoDefineParameters): Set
1643 `ec.ResolvingGenericMethod' if we're a generic method.
1644 (MemberBase.MemberType): Likewise.
1646 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1648 * typemanager.cs (TypeManager): Added
1649 TypeManager.internals_visible_attr_type to cache
1650 S.R.CompilerServices.InternalsVisibleToAttribute.
1652 * codegen.cs (AssemblyClass): Added checks for
1653 InternalsVisibleToAttribute in new method
1654 CheckInternalsVisibleAttribute () and also cache the
1655 AssemblyName in AssemblyClass.Name.
1657 2005-10-24 Martin Baulig <martin@ximian.com>
1660 (TypeManager.ExpandInterfaces): Added overloaded version which
1661 just takes a `Type[]' array.
1664 (Constraints.Resolve): Don't expand the interfaces here; ie. we
1665 just use the interfaces which were explicitly specified and not
1666 the interfaces they inherit. Fixes #76482.
1667 (TypeParameter.FindMembers): Expand the interfaces here.
1669 2005-10-21 Martin Baulig <martin@ximian.com>
1672 (Constraints.Resolve): Also resolve the actual types here.
1673 (Constraints.ResolveTypes): Just check the constraints here.
1674 Fixes #76363; see gtest-218.cs.
1676 2005-10-21 Martin Baulig <martin@ximian.com>
1679 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1680 instead of a `BoxedCast'; fixes gtest-217.cs.
1682 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
1684 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1685 1) "new()" is specified as generic parameter constraint and 2) the
1686 type is TypeBuilder and 3) the type is abstract even if it has a
1687 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1689 2005-10-20 Martin Baulig <martin@ximian.com>
1692 (GenericConstraints.TypeParameter): New public property.
1693 (TypeParameter.ctor): Also take a `DeclSpace' argument.
1694 (TypeParameter.DeclSpace): New public property.
1695 (TypeParameter.DefineType): Inflate the constraints if our
1696 `DeclSpace' is an `Iterator'.
1698 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
1700 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
1701 GenericMethod argument to compare methods' generic type arguments.
1704 2005-10-19 Martin Baulig <martin@ximian.com>
1706 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1707 not ResolveType() when resolving the base type, so we're not
1708 checking the constraints here.
1709 (TypeContainer.ResolveType): Call ResolveType() on our base_type
1712 2005-10-19 Martin Baulig <martin@ximian.com>
1714 * generic.cs (ConstructedType.CheckConstraints): Committing
1715 untested fix for #76441.
1717 2005-10-18 Raja R Harinath <rharinath@novell.com>
1720 * class.cs (TypeContainer.DefineType): Move updating of
1721 topological sort earlier in the code.
1722 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1724 2005-10-18 Marek Safar <marek.safar@seznam.cz>
1727 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1729 * constant.cs (Constant.TryReduce): Moved from Cast class.
1730 (Reduce): Made little bit more OO and fixed missing conversions.
1732 * ecore.cs (Reduce): Implemented.
1733 (Binary.EnumLiftUp): New method to upgrade values to enum values.
1735 * literal.cs (Reduce): Implemented.
1737 * class.cs: Reverted Miguel's wrong commit.
1739 2005-10-14 Miguel de Icaza <miguel@novell.com>
1741 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1743 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
1745 * cs-parser.jay, expression.cs : CS0214 was missing error location
1746 for constants. Fixed bug #76404.
1748 2005-10-10 Raja R Harinath <rharinath@novell.com>
1750 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1752 (PropertyExpr.EmitCall): Likewise.
1753 * expression.cs (Invocation.EmitArguments): Handle case where
1755 (Invocation.EmitCall): Avoid allocating temporary variable if
1756 there are no arguments.
1758 2005-10-11 Marek Safar <marek.safar@seznam.cz>
1761 * convert.cs (ExplicitConversionCore): Fixed object->enum
1764 2005-10-07 Raja R Harinath <rharinath@novell.com>
1767 * convert.cs (ImplicitConversionStandard): Move conversion of
1768 void* to arbitrary pointer types ...
1769 (ExplicitConversionStandard): .. here.
1770 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1771 error to always print typenames.
1773 2005-10-07 Raja R Harinath <rharinath@novell.com>
1775 * convert.cs (GetConversionOperator): Rename from
1776 GetConversionOperators. Move operator selection code from ...
1777 (UserDefinedConversion): ... here.
1779 2005-10-06 Marek Safar <marek.safar@seznam.cz>
1781 * convert.cs (ExplicitConversionCore): Removed duplicate enum
1784 2005-10-05 Marek Safar <marek.safar@seznam.cz>
1786 * assign.cs (Assign.DoResolve): Error method changed.
1788 * cfold.cs (DoConstantNumericPromotions): Error method changed.
1790 * const.cs (ResolveValue): Reset in_transit immediately.
1792 * constant.cs: Error method changed.
1794 * convert.cs: Removed useless location parameter.
1795 (ExplicitNumericConversion): Don't do double enum check.
1796 (ExplicitConversionCore): Renamed from ExplicitConversion.
1797 (ExplicitUnsafe): Extracted from ExplicitConversion.
1798 (ExplicitConversion): Uses for error reporting.
1800 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
1802 (ResolveBoolean): Uses common error method.
1803 (CastToDecimal): Get rid of ec.
1804 (CastFromDecimal): Optimized.
1805 (ConvCast): Get rid of ec.
1807 * enum.cs (ResolveValue): Reset in_transit immediately.
1808 (Emit): Return after first error.
1810 * expression.cs: Convert changes.
1812 * literal.cs: Error method changed.
1814 * statement.cs: Error method changed.
1816 2005-10-06 Raja R Harinath <rharinath@novell.com>
1818 Fix gtest-131.cs and gtest-211.cs.
1819 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
1820 Only emit code for a label if it is used. Unreachable code can
1821 violate ECMA evaluation stack invariants.
1823 2005-09-27 Marek Safar <marek.safar@seznam.cz>
1825 * anonymous.cs: Implemented ExprClassName.
1827 * assign.cs (Assign.DoResolve): Don't chrash when type is not
1830 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
1833 * class.cs (StaticClass.DefineContainerMembers): Report protected
1836 * codegen.cs: if(ed) PRODUCTION.
1838 * convert.cs (Error_CannotImplicitConversion): Better error
1841 * cs-parser.jay: More error checks.
1843 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
1845 * driver.cs (CSCParseOption): Enabled wrong option check.
1847 * ecore.cs (Expression.ExprClassName): Turned to property.
1848 (MemberExpr.CheckIntermediateModification): For checking boxed
1849 value types modification.
1851 * statement.cs (Fixed.Resolve): Expression type must be
1852 convertible to fixed type.
1853 (CollectionForeach.GetEnumeratorFilter,TryType):
1854 Small refactoring for easier error checking.
1856 2005-09-26 Marek Safar <marek.safar@seznam.cz>
1858 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
1861 * class.cs (GeneratedBaseInitializer): New class for customization
1862 compiler generated initializers.
1863 (MemberBase.DoDefine): Check Obsolete attribute here.
1864 (FieldMember.DoDefine): Ditto.
1866 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1869 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1870 (MemberCore.GetObsoleteAttribute): Removed argument.
1871 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1872 (MemberCore.CheckObsoleteType): New helper.
1876 * statement.cs: Updates after MemberCore changes.
1878 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1879 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1881 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1882 obsolete attribute for compiler construct.
1883 (As.DoResolve): Cache result.
1885 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1887 2005-10-01 Miguel de Icaza <miguel@novell.com>
1889 * expression.cs (Probe): instead of having a "Type probe_type"
1890 keep the extra information as a TypeExpr probe_type_expr since the
1891 "As" operator needs to perform some type checks.
1893 * (As.DoResolve): If the type is a type parameter, ensure that it
1894 is constrained by a class.
1896 2005-09-22 Miguel de Icaza <miguel@novell.com>
1898 * statement.cs (Lock): Use the TemporaryVariable class instead of
1899 manually using local variables as those do not work when variables
1902 * ecore.cs: Moved the TemporaryVariable class from being a nested
1903 class inside Foreach to be a public class that can be employed in
1906 2005-09-19 Marek Safar <marek.safar@seznam.cz>
1908 * cs-parser.jay: interface_accessors replaced by
1909 accessor_declarations.
1911 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1914 * statement.cs (GotoCase.Resolve): Convert null constant to
1916 (SwitchLabel.ResolveAndReduce): Ditto.
1917 (SwitchLabel.NullStringCase): Custom null stamp.
1918 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1920 typemanager.cs (CSharpSignature): Don't skip first argument
1923 2005-09-16 Marek Safar <marek.safar@seznam.cz>
1925 * cfold.cs, constant.cs, convert.cs, ecore.cs,
1926 expression.cs, iterators.cs, literal.cs: Store constants and
1929 * class.cs (MemberBase.ShortName): Pass location.
1931 * cs-parser.jay: Some location fixes.
1933 * ecore.cs (Expression.Location): Made virtual.
1935 2005-09-27 Marek Safar <marek.safar@seznam.cz>
1938 * const.cs (Const.ResolveValue): Check for assigning non-null
1939 value to reference type.
1941 2005-09-26 Raja R Harinath <rharinath@novell.com>
1944 * expression.cs (This.VerifyFixed): In a value type T, the type of
1945 'this' is T&, iow, 'this' is either an out or ref parameter. In a
1946 value type R, 'this' is treated as a value parameter.
1948 2005-09-05 Miguel de Icaza <miguel@novell.com>
1950 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1951 if the underlying types are the same, otherwise we need to produce
1952 code that will do the proper cast.
1954 This was exposed by Marek's constant rewrite which produced
1955 invalid code for the call site:
1958 void Method (X v) {}
1962 This fixes test-49.cs
1964 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1966 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1967 Type/Object should be allowed as well. Fixed bug #75968.
1969 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1971 * expression.cs : (Binary.DoResolve): when one is enum constant and
1972 another is constant 0, then return enum one *as enum type*.
1975 2005-10-04 Martin Baulig <martin@ximian.com>
1977 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
1978 `SetMemberIsUsed()' work for generics, too.
1980 2005-10-04 Martin Baulig <martin@ximian.com>
1982 * expression.cs (DelegateInvocation.EmitStatement): Make this work
1983 for corlib. Fixes #75691.
1985 2005-09-28 Marek Safar <marek.safar@seznam.cz>
1988 * driver.cs: Fix compilation files with full root path.
1990 2005-09-25 Miguel de Icaza <miguel@novell.com>
1992 * report.cs (SymbolRelatedToPreviousError): Format the output so
1993 it does not use an open parenthesis that is never closed.
1995 * driver.cs: Follow coding guidelines
1997 2005-09-18 Miguel de Icaza <miguel@novell.com>
1999 * driver.cs: Set InEmacs based on the environment variable EMACS.
2001 * location.cs (InEmacs): in this mode, do not report column
2002 location as it confuses Emacs.
2004 2005-10-03 Raja R Harinath <rharinath@novell.com>
2006 * support.cs (SeekableStreamReader.Position): Don't error out when
2007 the requested position is just beyond the end of the current
2010 2005-09-28 Raja R Harinath <rharinath@novell.com>
2012 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2013 try to keep in sync with the byte count of the underlying Stream.
2014 However, this limits us to a window size of 2048 characters: i.e.,
2015 the maximum lookahead of our lexer/parser can be 2048 characters.
2017 2005-09-22 Martin Baulig <martin@ximian.com>
2019 * driver.cs: Removed a debugging FIXME.
2021 2005-09-21 Raja R Harinath <rharinath@novell.com>
2023 * cs-parser.jay (type_arguments): Add CS1644 check.
2024 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2026 2005-09-15 Raja R Harinath <rharinath@novell.com>
2028 * Makefile (PROGRAM): Make profile specific.
2029 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2030 the current directory.
2033 * expression.cs (Invocation.EmitCall): Remove optimization on
2034 this_call since it doesn't handle 'this' being a value type.
2036 2005-09-05 Geoff Norton <gnorton@customerdna.com>
2038 * driver.cs: Ensure file handles are closed after parsing
2040 2005-09-05 Miguel de Icaza <miguel@novell.com>
2042 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2043 if the underlying types are the same, otherwise we need to produce
2044 code that will do the proper cast.
2046 This was exposed by Marek's constant rewrite which produced
2047 invalid code for the call site:
2050 void Method (X v) {}
2054 This fixes test-49.cs
2056 2005-09-05 Martin Baulig <martin@ximian.com>
2058 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2059 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2061 * cs-parser.jay (delegate_declaration): Small fix for #75852.
2063 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2065 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2066 to be a pointer type due to the spec 25.2, so check if declaring
2067 type is generic type definition. Fixed bug #75772.
2069 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2072 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2073 both types are not defined by methods.
2074 * expression.cs : (Invocation.IsApplicable): it should work when
2075 the argument type is equal to the parameter type, not only when
2076 ImplicitConversionExists() returns true.
2078 2005-09-02 Raja R Harinath <rharinath@novell.com>
2080 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2084 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2085 flow-branching for LocalVariableReferences in case we were invoked
2086 from a MemberAccess.
2087 * expression.cs (LocalVariableReference.VerifyAssigned): New.
2089 (LocalVariableReference.DoResolveBase): ... this.
2090 (MemberAccess.Resolve): Do the check that was disabled during
2093 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2096 (PartialContainer.Create): check abstract/sealed/static strictly
2097 but abstract/sealed can exist only at one side. Fixed bug #75883.
2099 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
2102 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2103 specified, don't default to UnmanagedType.I4.
2105 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2107 * expression.cs : conditional operator should check possibly
2108 incorrect assign expression. Fixed bug #75946.
2110 2005-08-30 Raja R Harinath <rharinath@novell.com>
2113 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2114 (ScopeInfo.EmitScopeType): Use it to construct field names from
2115 names of captured locals.
2118 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2119 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2120 Pass 'target_type' to BoxedCast. Don't default to 'object'.
2121 (ExplicitConversion): Remove enum cases already handled by
2122 implicit conversion. Move implicit conversion check to the beginning.
2123 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2124 * expression.cs (ArrayCreation.EmitDynamicInitializers):
2125 Don't treat System.Enum as a struct.
2127 2005-08-30 Jb Evain <jbevain@gmail.com>
2129 * attribute.cs: handles as expression in parameters.
2131 2005-08-30 Raja R Harinath <rharinath@novell.com>
2134 * class.cs (TypeContainer.VerifyClsName): Don't use a
2135 PartialContainer when verifying CLS compliance.
2136 (AbstractPropertyEventMethod): Set Parent here, ...
2137 (PropertyMethod): ... not here.
2139 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
2141 * attribute.cs : escaped attribute name should not be allowed to be
2142 resolved (e.g. @class as classAttribute). Fixed bug #75930.
2144 2005-08-29 Raja R Harinath <rharinath@novell.com>
2147 * convert.cs (ImplicitStandardConversionExists): Allow zero also
2148 when converting a long constant to unsigned long.
2149 * expression.cs (Invocation.OverloadResolve): Add sanity check to
2150 detect where IsApplicable and VerifyArgumentsCompat disagree.
2152 2005-08-29 Raja R Harinath <rharinath@novell.com>
2153 and Carlos Alberto Cortez <carlos@unixmexico.org>
2156 * class.cs (TypeContainer.CanElideInitializer): New helper.
2157 (TypeContainer.EmitFieldInitializers): Use it to determine if we
2158 can safely emitting the initializer of a field.
2160 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2162 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2163 allowed inside a switch (without loop). Fixed bug #75433.
2165 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2167 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2168 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2170 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2172 * driver.cs : kinda reverting the default encoding changes (not exact
2173 revert since I noticed that "codepage:reset" might not work fine).
2175 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2177 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2178 Location. Now getter and setter store location correctly.
2179 (errors/cs0111-12.cs now reports the expected location.)
2181 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2183 * driver.cs : Use default encoding on the environment.
2184 Removed (now that) extra parameter for SeekableStreamReader.
2185 * support.cs : (SeekableStreamReader) third .ctor() argument for
2186 StreamReader is not required (always true). preamble size could
2187 be acquired in simpler and safe way.
2189 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
2191 * cs-parser.jay: report CS0642 at warning level 3
2192 and report CS0642 for an if else statement also
2193 fixes bug #74745. Patch by John Luke (and a bit
2195 Removed extra CS0642 warning check for "while",
2197 * statement.cs: In Block.Resolve(), CS0642 check
2198 is reimplemented to check a sequence of an empty
2199 statement and a block.
2201 Both fix bug #66777.
2203 2005-08-24 Marek Safar <marek.safar@seznam.cz>
2205 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2206 detection until I fix it.
2208 * cs-tokenizer.cs: Changed error message.
2210 * cs-parser.jay: Fixed 2 error locations.
2212 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2213 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2216 * enum.cs (GetSignatureForError): Fixed.
2218 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2222 * typemanager.cs (RegisterProperty): Removed.
2224 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2226 2005-08-24 Raja R Harinath <rharinath@novell.com>
2229 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2230 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2232 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2234 * expression.cs : tiny fix is required for not warning positive ulong.
2237 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2239 * expression.cs : add CS0652 check for constant and integral
2240 expression. Fixed bug #53974.
2242 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2244 * expression.cs : in DoNumericPromotions(), check if there is implicit
2245 conversion overload for string (to check CS0034). Fixed bug #52492.
2247 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2249 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2251 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2253 * ecore.cs : report location when it is *not* Null.
2255 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2261 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2262 correctly. Fixed bug #75721.
2264 2005-08-23 Raja R Harinath <rharinath@novell.com>
2266 * support.cs (SeekableStreamReader.Position): Avoid an expensive
2267 loop that performs 'min (pos, char_count)'.
2270 * expression.cs (Unary.ResolveOperator): Don't discard implicit
2271 converted value in Operator.OnesComplement.
2273 2005-08-22 Ben Maurer <bmaurer@ximian.com>
2275 * anonymous.cs: If the anon method is pulled into a helper class,
2276 it needs to be `internal' not `private'. Fixes runtime behavior on
2279 2005-08-17 Marek Safar <marek.safar@seznam.cz>
2282 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2285 2005-08-16 Marek Safar <marek.safar@seznam.cz>
2287 The big constants rewrite
2288 Fix #75746, #75685 and more
2289 As a side effect saved 1MB for MWF ;-)
2291 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2292 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2293 enum based for corlib compilation.
2295 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2298 * class.cs (FixedField.Define): Use ResolveAsConstant.
2300 * const.cs (IConstant): Interface constants and enums.
2301 (Const.ResolveValue): New method for constant resolvning.
2302 (ExternalConstant): Constants from imported assemblies.
2304 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2305 conversion; like enums.
2306 (Constant.ToType): Converts this constant to different type.
2307 (Constant.Increment): Adds 1.
2309 * convert.cs (ImplicitConversionRequired): Simplified.
2311 * cs-parser.jay: Create EnumMember directly.
2313 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2315 * doc.cs (GenerateEnumDocComment): Removed.
2317 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2318 (ConvertIntLiteral): Removed.
2319 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2321 * enum.cs (EnumMember): Implement IConstant.
2322 (Enum.IsValidEnumConstant): Removed.
2323 (Enum.GetNextDefaultValue): Removed.
2324 (Enum.FindMembers): Updated.
2325 (Enum.GenerateDocComment): Iterate enum members.
2327 * expression.cs (Cast.TryReduce): Handle enums correctly.
2328 (New.Constantify): Made public.
2329 (MemberAccess.DoResolve): Removed contant specific if(s).
2331 * literal.cs (NullLiteral): Implement new abstract methods.
2333 * statement.cs (GotoCase.Resolve): Use new constant methods.
2334 (SwitchLabel.ResolveAndReduce): Use new constant methods.
2336 * typemanager.cs (LookupEnum): Removed.
2337 (IsEnumType): Fixed to work with corlib.
2338 (RegisterConstant): Removed.
2339 (LookupConstant): Removed.
2340 (GetConstant): Changed to work with IConstant.
2342 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
2344 * location.cs : Fixed overflown (>255) column number.
2346 2005-08-03 Raja R Harinath <rharinath@novell.com>
2348 First cut of the qualified-alias-member feature.
2349 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2351 * cs-parser.jay (DOUBLE_COLON): New token.
2352 (namespace_or_type_name): Add rule for recognizing
2353 qualified-alias-members.
2354 (primary_expression): Likewise.
2355 (element_access): Allow QualifiedAliasMember as a possible
2356 type-bearing expression.
2357 (local_variable_type, local_variable_pointer_type): Likewise.
2358 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
2359 aliases in the current and enclosing namespace declarations.
2360 (NamespaceEntry.UsingAlias): Add CS0440 warning.
2361 * decl.cs (MemberName.is_double_colon): New.
2362 (MemberName.MemberName): Add new constructor for alias-member.
2363 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2364 * expression.cs (QualifiedAliasMember): New expression type.
2366 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2368 * location.cs : it borked when no argument was specified.
2370 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2372 * location.cs : tiny ToString() format fix.
2374 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2376 * statement.cs : oops, it was missing.
2378 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2380 A set of fixes for precise line/column location.
2383 "token" field now holds a file/line "delta", a line number offset
2384 from the segment, and a column number. See also:
2385 http://lists.ximian.com/pipermail/mono-devel-list/2004-
2386 December/009508.html
2387 Removed static IsNull. Use instance IsNull property instead.
2389 For some tokens it stores Location. For Identifier it stores
2390 LocatedToken which is a pair of string name and location.
2391 Column numbers are adjusted only at getChar().
2393 Use Location.ToString() for reporting (it now contains column).
2395 Largely modified to use LocatedToken instead of
2396 string (IDENTIFIER), and to acquire Location from some tokens.
2397 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2398 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2400 Now MemberName holds Location. DeclSpace.ctor() receives Location
2401 as a parameter. Removed extra parameters to all derived classes.
2402 Replaced Location.IsNull() with instance property.
2403 * assign.cs, expression.cs :
2404 Added .ctor() overload that omits Location.
2406 Added "nameEscaped" flag that indicates the identifier was escaped
2407 in the source file. This fixes bug #57047.
2409 2005-09-02 Martin Baulig <martin@ximian.com>
2411 * class.cs: Make CS3005 a warning, not an error.
2413 2005-08-02 Marek Safar <marek.safar@seznam.cz>
2415 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2416 New method, looking for lo-case imported cls type.
2418 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2421 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2423 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2425 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2427 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2429 Optimized to save 3.5 MB for SWF compilation.
2431 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2433 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2434 (PartialContainer.Create): Moved logic AddToContainer.
2435 (PartialContainer.MarkForDuplicationCheck): Shares name.
2437 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2440 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2442 (Namespace.GetSignatureForError): New method.
2444 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2445 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2447 2005-08-01 Raja R Harinath <rharinath@novell.com>
2450 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2451 member lookup rather than qualifier_type, since qualifier_type can
2454 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2456 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2459 2005-07-31 Miguel de Icaza <miguel@novell.com>
2461 * statement.cs: Copy the local exception into the exception
2462 captured local. Fixes 75674
2464 2005-07-31 Raja R Harinath <harinath@gmail.com>
2467 * expression.cs (Invocation.OverloadResolve): Don't report error
2468 CS1501 if error CS1502 has been reported.
2469 (New.DoResolve): Delegate CS1501 reporting to
2470 Invocation.OverloadResolve.
2473 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2474 invariant-meaning-in-block property in an enclosing block if
2477 2005-07-29 Marek Safar <marek.safar@seznam.cz>
2479 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2480 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2481 (Switch.CheckSwitch): Just save 50kb for SWF.
2483 2005-07-27 Martin Baulig <martin@ximian.com>
2485 * anonymous.cs (CaptureContext.AddField): Added
2486 `AnonymousContainer am' argument; compute its toplevel scope if
2487 it's not already computed. Fixes #75649.
2489 2005-07-26 Raja R Harinath <rharinath@novell.com>
2492 * class.cs (Constructor.Emit): Reset block to null if the block
2495 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2497 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2499 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2501 * class.cs (MethodData.Define): Check whether accessor implementing
2502 interface is public.
2504 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2506 2005-07-22 Marek Safar <marek.safar@seznam.cz>
2509 * namespace.cs (LookupType): Moved same type check to...
2511 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2514 2005-07-21 Raja R Harinath <rharinath@novell.com>
2516 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2517 already found a typebuilder.
2518 * class.cs (MethodCore.IsDuplicateImplementation): Compare
2519 MemberNames, not strings.
2521 * const.cs (Error_ExpressionMustBeConst):
2522 Rename from Error_EpressionMustBeConst.
2523 * const.cs, class.cs, statement.cd: Update.
2525 2005-07-21 Marek Safar <marek.safar@seznam.cz>
2529 * const.cs (Const.LookupConstantValue): Report missing contant expression
2531 (Error_EpressionMustBeConstant): Only one error method.
2533 * class.cs, statement.c: Updated.
2535 2005-07-20 Raja R Harinath <rharinath@novell.com>
2537 * statement.cs (Block.Flags): Add back HasVarargs.
2538 (Block.flags): Make protected.
2539 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2541 * typemanager.cs (types, typecontainers, user_types): Remove.
2542 (UserTypes, TypeContainers): Likewise.
2543 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2544 (CleanUp, Reset): Update.
2545 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
2546 (GetNestedType): Use Type.GetNestedType.
2547 (CoreLookupType): Take two arguments, the namespace and the
2548 basename of the type. Update to use the Namespace.Lookup
2550 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2551 (RealMemberLookup): Use IsNestedChildOf instead of playing with
2552 string concatenation and substring matches.
2553 * class.cs, enum.cs, delegate.cs: Update to changes.
2555 2005-07-20 Marek Safar <marek.safar@seznam.cz>
2557 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2558 Expression and made virtual.
2560 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2561 (ImplicitStandardConversionExists): Fixed `byte' typo ?
2563 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2565 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2568 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2571 2005-07-18 Marek Safar <marek.safar@seznam.cz>
2574 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2575 AssemblyCultureAttribute is not used on executable.
2578 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2580 2005-07-16 Raja R Harinath <rharinath@novell.com>
2583 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2584 New. Reports CS0252/CS0253.
2585 Mostly taken from preliminary patch by Duncak Mak.
2586 (Binary.DoResolveOperator): Store results of operator lookup.
2587 Use them to detect if we need to warn about unintended reference
2590 2005-07-15 Raja R Harinath <rharinath@novell.com>
2593 * namespace.cs (Namespace.Lookup): Add back location parameter.
2594 (Namespace.LookupType): Add CS0436 report. Add location parameter.
2595 * delegate.cs, ecore.cs, expression.cs: Update to changes.
2597 * codegen.cs (EmitContext.DeclSpace): Make readonly.
2598 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2599 (Namespace.LookupType): ... this.
2600 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2602 * typemanager.cs (LookupTypeReflection): Remove buggy code that
2603 purported to handle pointers.
2604 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2607 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2609 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2612 2005-07-15 Raja R Harinath <rharinath@novell.com>
2614 * namespace.cs (Namespace.Lookup): Drop location parameter.
2615 (NamespaceEntry.LookupAlias): Remove. Merge into ...
2616 (NamespaceEntry.Lookup): ... this.
2617 (NamespaceEntry.Error_AmbiguousTypeReference):
2618 Move here from DeclSpace.
2619 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2621 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2622 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2623 Move to NamespaceEntry.
2624 * delegate.cs, expression.cs: Update to changes.
2626 2005-08-31 Martin Baulig <martin@ximian.com>
2628 Committing a patch from Atsushi Enomoto for #75850.
2630 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2631 Prefer a generic enumerator over a non-generic one.
2633 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2635 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2636 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2638 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2640 * driver.cs : reverting default encoding change as well as mcs.
2642 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2644 * driver.cs, support.cs : merged r48826.
2646 > could you integrate your mcs changes to gmcs otherwise
2647 > gmcs cannot compile some files.
2649 2005-08-20 Martin Baulig <martin@ximian.com>
2651 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2652 scope if we don't already have it.
2654 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2655 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2658 2005-07-31 Miguel de Icaza <miguel@novell.com>
2660 * statement.cs: Copy the local exception into the exception
2661 captured local. Fixes 75674
2663 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2665 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2668 2005-08-12 Martin Baulig <martin@ximian.com>
2670 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2671 for nested types here to avoid hitting the cache too early.
2673 2005-08-09 Miguel de Icaza <miguel@novell.com>
2675 * enum.cs: On the new compiler CLS error 3005 is now a warning not
2678 2005-08-03 Martin Baulig <martin@ximian.com>
2680 Make iterators in generic methods work; see gtest-191.cs.
2683 (Constraints.Resolve): Protect against being called twice.
2686 (TypeContainer.GetClassBases): Make this `protected virtual'.
2688 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2689 (Iterator.GetClassBases): Override this and compute the base
2691 (Iterator.DefineNestedTypes): If we're a generic method, all our
2692 method type parameters become class type parameters on the proxy
2696 (ToplevelBlock.Parameters): Make this a property, not a field.
2697 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2699 2005-08-03 Martin Baulig <martin@ximian.com>
2701 * typemanager.cs (TypeManager.IsSubclassOf): Use
2702 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2703 (TypeManager.GetFullName_recursed): Improved.
2705 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2708 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2709 Private accessor case, using TypeManager.IsPrivateAccessible instead of
2710 invocation_type == mi.DeclaringType, since the first one also checks
2711 other condition used by generic instances.
2713 2005-07-27 Martin Baulig <martin@ximian.com>
2715 * anonymous.cs (CaptureContext.AddField): Added
2716 `AnonymousContainer am' argument; compute its toplevel scope if
2717 it's not already computed. Fixes #75649.
2719 2005-07-14 Marek Safar <marek.safar@seznam.cz>
2721 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2722 CheckAttributeType and refactored.
2723 (Attribute.ResolvePossibleAttributeType): Changed to reuse
2724 ResolveAsTypeTerminal error handling.
2725 (ResolveAsTypeTerminal): Introduced because of global attributes extra
2727 (GetSignatureForError): Print errors in same way.
2730 * codegen.cs: Reflect attribute GetSignatureForError change.
2733 * expression.cs: Add silent parameter to ResolveAsTypeStep.
2735 * namespace.cs (UsingEntry): Refactored to make fields private.
2738 statement.cs: Error_UnexpectedKind has extra parameter.
2740 2005-07-14 Raja R Harinath <rharinath@novell.com>
2742 * ecore.cs (IAlias): Remove.
2743 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
2744 that implement the interface.
2745 * namespace.cs (Namespace): Likewise.
2746 (Namespace.declspaces): Renamed from 'defined_names'.
2747 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
2748 DeclSpace instead of an IAlias.
2749 * tree.cs (Tree.AddDecl): Update.
2751 2005-07-12 Raja R Harinath <rharinath@novell.com>
2753 * statement.cs (Block.Flags); Remove HasVarargs.
2754 (Block.HasVarargs): Move to ToplevelBlock.
2755 (Block.ThisVariable, Block.AddThisVariable): Likewise.
2756 (Block.Variables): Make protected. Initialize variable hashtable
2758 (Block.AddVariable): Update.
2759 (Block.Resolve): Update to changes.
2760 (ToplevelBlock.HasVarargs): New boolean.
2761 (ToplevelBlock.ThisVariable): Move here from Block.
2762 (ToplevelBlock.AddThisVariable): Likewise.
2763 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
2764 * expression.cs (This.ResolveBase): Update to changes.
2765 (ArglistAccess.DoResolve): Likewise.
2767 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2770 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2772 * class.cs (TypeContainer.VerifyMembers): Distinguish between
2773 not used and not used & assigned.
2774 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2776 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2779 * expression.cs (Is.DoResolve): null is never provided type.
2781 2005-07-08 Marek Safar <marek.safar@seznam.cz>
2784 * cs-parser.jay: Less strict event error rule to catch more errors.
2786 2005-07-11 Martin Baulig <martin@ximian.com>
2788 * generic.cs (ConstructedType.CheckConstraints): Improve the check
2789 for the constructor constraint: we do not only have to check
2790 whether the class has a public constructor, but also ensure that
2791 it's parameterless. Fixes #75492.
2793 2005-07-11 Martin Baulig <martin@ximian.com>
2795 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
2796 between type parameters if they either have the reference type
2797 constraint or the class constraint.
2799 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
2801 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
2803 2005-07-07 Marek Safar <marek.safar@seznam.cz>
2806 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2807 (ExtractSecurityPermissionSet): Cope with self referencing security
2808 attributes properly.
2810 * driver.cs (SetOutputFile): Made public property OutputFile.
2812 2005-07-07 Raja R Harinath <rharinath@novell.com>
2815 * class.cs (TypeContainer.first_nonstatic_field): Rename from
2816 has_nonstatic_fields. Make into a FieldBase pointer.
2817 (TypeContainer.AddField): Add CS0282 check.
2818 (TypeContainer.EmitType): Update.
2820 2005-07-06 Miguel de Icaza <miguel@novell.com>
2822 * cs-tokenizer.cs (consume_identifier): Do not create strings to
2823 compare if they start with __.
2825 2005-07-06 Raja R Harinath <rharinath@novell.com>
2827 * statement.cs (Switch.SwitchGoverningType): Only look at
2828 UserCasts that don't need implicit standard conversions to one of
2829 the allowed switch types (Fixes test-322.cs).
2830 (LocalInfo.Resolve): Re-enable sanity-test.
2832 2005-07-06 Marek Safar <marek.safar@seznam.cz>
2834 * cs-tokenizer.cs (consume_identifier): Detect double undescores
2836 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2838 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2840 2005-07-06 Raja R Harinath <rharinath@novell.com>
2843 * ecore.cs (SimpleName.GetSignatureForError): Add.
2844 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2845 (MemberAccess.GetSignatureForError): Add.
2847 2005-07-05 Marek Safar <marek.safar@seznam.cz>
2849 The big error and warning messages review.
2879 * typemanager.cs: Updated.
2881 * class.cs: (MethodCore.SetYields): Moved here to share.
2882 (PropertyMethod.Define): Moved iterator setup here.
2884 * iterators.cs: Add orig_method to have full access to parent
2887 2005-07-05 Raja R Harinath <rharinath@novell.com>
2889 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2890 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2891 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2892 variable of struct type.
2893 * expression.cs (Unary.ResolveOperator): Update to change.
2894 (Indirection.VerifyFixed): Likewise.
2895 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2896 (ParameterReference.VerifyFixed): Value parameters are fixed.
2897 (This.VerifyFixed): Treat 'this' as a value parameter.
2898 * statement.cs (LocalInfo.IsFixed): Remove.
2900 2005-07-01 Martin Baulig <martin@ximian.com>
2902 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2903 `ec.EmitThis ()' to get the correct scope.
2905 2005-07-01 Martin Baulig <martin@ximian.com>
2907 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2908 instance is a ParameterReference; fixes #75299.
2910 2005-06-30 Raja R Harinath <rharinath@novell.com>
2913 * expression.cs (Indexers.map): Remove.
2914 (Indexers.Append): Filter out inaccessible setters and getters.
2915 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2918 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
2920 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2921 (FieldExpr.Emit, PropertyExpr.Emit): Update.
2922 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2923 * expression.cs (Invocation.EmitCall): Add CS0120 check.
2925 2005-06-30 Marek Safar <marek.safar@seznam.cz>
2928 * class.cs (FieldBase.GetInitializerExpression): One more field
2931 2005-06-28 Miguel de Icaza <miguel@novell.com>
2933 * pending.cs: Do not define a proxy if the base method is virtual,
2934 it will be picked up by the runtime (bug 75270).
2936 2005-07-08 Martin Baulig <martin@ximian.com>
2938 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2939 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2941 2005-07-07 Martin Baulig <martin@ximian.com>
2943 * generic.cs (ConstructedType.CheckConstraint): Use
2944 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
2945 called recursively; fixes #75329.
2947 2005-07-06 Martin Baulig <martin@ximian.com>
2949 * generic.cs (TypeManager.InferTypeArguments): Added support for
2950 anonymous methods; fixes #75461.
2952 2005-07-01 Martin Baulig <martin@ximian.com>
2954 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2955 `ec.EmitThis ()' to get the correct scope.
2957 2005-07-01 Martin Baulig <martin@ximian.com>
2959 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
2960 instance is `This'; fixes #75299.
2962 2005-06-30 Martin Baulig <martin@ximian.com>
2964 * class.cs (Indexer): Implement IIteratorContainer; added support
2965 for iterators in indexers.
2968 (EmitContext.CurrentIterator): Make this a property, not a field.
2970 * anonymous.cs (AnonymousContainer.Iterator): New public property.
2972 2005-06-28 Miguel de Icaza <miguel@novell.com>
2974 * pending.cs: Do not define a proxy if the base method is virtual,
2975 it will be picked up by the runtime (bug 75270).
2977 2005-06-28 Martin Baulig <martin@ximian.com>
2979 * cs-parser.jay (interface_method_declaration): Avoid a
2980 reduce/reduce conflict by moving some of the code into a separate
2981 `interface_method_declaration_body' rule; fixes #75368.
2983 2005-06-28 Martin Baulig <martin@ximian.com>
2985 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
2986 array check after the check for TypeBuilder's.
2988 2005-06-21 Raja R Harinath <rharinath@novell.com>
2990 * convert.cs (FindMostEncompassedType): Add two trivial special
2991 cases (number_of_types == 0 || number_of_types == 1).
2992 (FindMostEncompasingType): Likewise.
2994 2005-06-17 Raja R Harinath <rharinath@novell.com>
2996 Some cleanups preparing for the fix of #75283.
2997 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2999 (EventExpr.InstanceResolve): Likewise.
3000 (EventExpr.DoResolve): Remove redundant checks.
3002 2005-06-08 Miguel de Icaza <miguel@novell.com>
3004 * class.cs: Small fix.
3006 2005-06-08 Raja R Harinath <rharinath@novell.com>
3009 * class.cs (GetPartialBases): Fix return value check of
3012 2005-06-07 Raja R Harinath <rharinath@novell.com>
3014 Ensure that partial classes are registered in their enclosing
3015 namespace. Initial part of fix of #75160.
3016 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3017 Register declspace with namespace here, not in
3018 DeclSpace.RecordDecl.
3019 * cs-parser.jay: Pass namespace to RecordDecl.
3020 * class.cs (PartialContainer.Create): Likewise.
3021 (ClassPart.DefineType): New sanity-check. Throws an exception if
3023 * decl.cs (Declspace.RecordDecl): Remove.
3024 * namespace.cs (NamespaceEntry.DefineName): Remove.
3026 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3028 * rootcontext.cs: Reset TargetExt as well.
3030 2005-06-03 Raja R Harinath <rharinath@novell.com>
3032 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3035 2005-06-02 Raja R Harinath <rharinath@novell.com>
3037 Fix #75080, cs0119.cs.
3038 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3040 (Expression.Resolve): ... this. Use it. Remove bogus code
3041 allowing ExprClass.Type and ExprClass.Namespace for
3042 ResolveFlags.VariableOrValue.
3043 (Expression.Resolve) [1-argument variant]: Change default resolve
3044 flags based on language version.
3045 (Expression.Error_UnexpectedKind): Use a simple string array
3046 rather than an ArrayList.
3047 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3049 (TypeOfVoid.DoResolve): Likewise.
3050 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3051 flags argument -- it always has the same value.
3053 2005-05-31 Raja R Harinath <rharinath@novell.com>
3056 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3057 Use it in the error message.
3058 * assign.cs, expression.cs, statement.cs: Update.
3060 2005-05-30 Raja R Harinath <rharinath@novell.com>
3063 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3064 the "almostMatchedMember" case too.
3065 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3066 that failed the accessibility checks to 'almost_match'.
3068 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
3070 * attribute.cs: Use internal MethodBuilder methods to set
3071 ExactSpelling and SetLastError on PInvoke methods, instead
3072 of passing them via charset. Fixes #75060.
3074 2005-05-27 Raja R Harinath <rharinath@novell.com>
3076 * parameter.cs (Parameter): Remove TODO comment.
3077 (Parameter.DefineParameter): Remove Location parameter.
3078 (Parameters.LabelParameters): Likewise.
3079 * class.cs (Constructor.Emit): Update to change.
3080 (MethodData.Emit): Likewise.
3081 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
3082 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3084 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
3087 Removed Parameters.Location and added Parameter.Location instead.
3088 Removed Location parameter from Emit() and GetSignature().
3095 Modified all related calls.
3097 2005-06-21 Martin Baulig <martin@ximian.com>
3099 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3100 left-hand side is not a nullable type; fixes #75328.
3102 2005-06-21 Martin Baulig <martin@ximian.com>
3105 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3106 (TypeManager.GetFullNameSignature): Likewise.
3108 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3109 `source.FullName' and `target.FullName' to check whether there are
3110 two conflicting definitions.
3112 2005-06-21 Martin Baulig <martin@ximian.com>
3114 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3115 a BoxedCast - also for reference types - to be compatible with csc.
3117 2005-06-21 Martin Baulig <martin@ximian.com>
3119 * expression.cs (MemberAccess.DoResolve): Add support for nested
3120 types in a generic instance; fixes #75320.
3122 2005-06-20 Martin Baulig <martin@ximian.com>
3124 * generic.cs (TypeManager.InferType): Also walk the class
3125 hierarchy for generic instances; fixes #75261.
3127 2005-06-17 Martin Baulig <martin@ximian.com>
3129 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3130 to make things work for corlib.
3132 2005-06-15 Martin Baulig <martin@ximian.com>
3134 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3135 obsolete `SecurityAction' values.
3137 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3139 * rootcontext.cs: Reset TargetExt as well.
3141 2005-06-09 Martin Baulig <martin@ximian.com>
3143 * delegate.cs (Delegate.VerifyMethod): Added
3144 `MethodGroupExpr old_mg' argument; inherit its
3145 `HasTypeParameters'; fix #75085.
3147 2005-06-09 Martin Baulig <martin@ximian.com>
3149 * expression.cs (Invocation.OverloadResolve): Correctly handle
3150 generic methods for the SetMemberIsUsed(); fix #75064.
3152 2005-06-09 Martin Baulig <martin@ximian.com>
3154 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3157 2005-06-08 Martin Baulig <martin@ximian.com>
3159 * cs-parser.jay (nullable_type_or_conditional): If we put the
3160 nullable back and our `type' is a `ComposedCast', remove the
3161 nullable from it. Fixes #75156.
3163 * expression.cs (ComposedCast.RemoveNullable): New public method.
3165 2005-06-08 Martin Baulig <martin@ximian.com>
3167 The big Iterators rewrite :-)
3169 * iterators.cs: Rewrite this to use the anonymous methods framework.
3171 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3172 before the TypeContainers; see 2test-21.cs.
3175 (TypeContainer.DefineType): Don't create a new EmitContext if we
3176 already have one (this only happens if we're an Iterator).
3177 (TypeContainer.Define): Also call Define() on all our iterators.
3178 (Method.CreateEmitContext): Added support for iterators.
3181 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3182 (AnonymousContainer.CreateMethodHost): Moved here from
3183 AnonymousMethod and made abstract.
3184 (AnonymousContainer.CreateScopeType): New abstract method.
3185 (AnonymousContainer.IsIterator): New public property.
3186 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3187 get the ScopeTypeBuilder rather than manually defining it here.
3188 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3191 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3192 before RootContext.DefineTypes().
3194 * codegen.cs (EmitContext.RemapToProxy): Removed.
3195 (EmitContext.CurrentAnonymousMethod): Changed type from
3196 AnonymousMethod -> AnonymousContainer.
3197 (EmitContext.ResolveTopBlock): Protect from being called twice.
3198 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3199 (EmitContext.EmitThis): Removed the iterators hacks; use the
3200 anonymous methods framework for that.
3203 (ToplevelBlock.Container): Make this a property, not a field.
3204 (ToplevelBlock.ReParent): New public method; move the
3205 ToplevelBlock into a new container.
3206 (Foreach.TemporaryVariable): Simplify.
3208 2005-06-05 Martin Baulig <martin@ximian.com>
3210 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3211 (Block.AddTemporaryVariable): New public method; creates a new
3212 `LocalInfo' for a temporary variable.
3213 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3215 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3216 non-iterator variables.
3218 2005-06-05 Martin Baulig <martin@ximian.com>
3220 * statement.cs (Foreach.TemporaryVariable): Create the
3221 LocalBuilder in the Emit phase and not in Resolve since in some
3222 situations, we don't have an ILGenerator during Resolve; see
3223 2test-19.cs for an example.
3225 2005-06-04 Martin Baulig <martin@ximian.com>
3227 The big Foreach rewrite - Part II.
3229 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3230 with `PropertyInfo ienumerator_getcurrent'.
3232 * codegen.cs (VariableStorage): Removed.
3235 (Foreach): Derive from Statement, not ExceptionStatement.
3236 (Foreach.CollectionForeach): New nested class. Moved all the code
3237 dealing with collection foreach here.
3238 (Foreach.ForeachHelperMethods): Removed.
3239 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3241 2005-05-23 Martin Baulig <martin@ximian.com>
3243 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3244 don't need to. Fix #75014.
3246 2005-05-26 Raja R Harinath <rharinath@novell.com>
3248 Improve user-defined conversion handling.
3249 * convert.cs (GetConversionOperators): Rewrite. Return only the
3250 applicable operators.
3251 (AddConversionOperators): New. Helper for GetConversionOperators.
3252 (FindMostEncompassedType, FindMostEncompassingType): Verify that
3253 there is only one most encompassed/encompassing type.
3254 (FindMostSpecificSource, FindMostSpecificTarget): Remove
3255 "applicable operator" handling.
3256 (UserConversion): Move cache here from GetConversionOperators.
3257 Directly cache the chosen operator, rather than the whole
3259 (ExplicitNumericConversion): Fix buggy implementation of Decimal
3260 case. Allow conversion of decimal to sbyte and byte too.
3261 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3262 New static methods. Used to avoid allocating EmptyExpressions in
3265 2005-05-24 Duncan Mak <duncan@novell.com>
3267 * ecore.cs (CastFromDecimal): New class for casting a decimal to
3268 another class, used in Convert.ExplicitNumericConversion.
3269 (CastToDecimal): New class, similar to above, but casts to
3270 System.Decimal, used in Convert.ImplicitNumericConversion and also
3271 in explicit convesion from double/float to decimal.
3273 * convert.cs (ImplicitNumericConversion): Handle implicit
3274 conversions to System.Decimal.
3275 (ExplicitNumericConversion): handle explicit conversions to
3280 2005-05-20 Miguel de Icaza <miguel@novell.com>
3282 * typemanager.cs: Do not throw an exception in the TypeBuilder
3283 case, we take care of it on the TypeCode.
3285 2005-05-17 Marek Safar <marek.safar@seznam.cz>
3287 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3290 * cs-parser.jay: Catch more lexical errors.
3292 * report.cs: Add one more Error method.
3295 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3297 2005-05-20 Martin Baulig <martin@ximian.com>
3299 * class.cs (TypeContainer.CircularDepException): Removed.
3300 (TypeContainer.DefineType): Removed the `InTransit' stuff.
3301 (TypeContainer.CheckRecursiveDefinition): Check for circular class
3302 (CS0146) and interface (CS0529) dependencies here.
3304 2005-05-20 Martin Baulig <martin@ximian.com>
3306 * expression.cs (New.DoResolve): Move the CS0712 check above the
3307 CS0144 check; otherwise it can never be reached.
3309 2005-05-20 Martin Baulig <martin@ximian.com>
3311 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3313 2005-05-20 Martin Baulig <martin@ximian.com>
3315 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3317 * typemanager.cs (TypeManager.IsAttributeType): New public method.
3319 2005-05-19 Martin Baulig <martin@ximian.com>
3322 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3323 to disable error reporting.
3325 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3326 here since we don't want to report an error; see the new test-336.cs.
3328 2005-05-19 Raja R Harinath <rharinath@novell.com>
3330 * statement.cs (ToplevelBlock.GetParameterReference)
3331 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3332 Move here from class Block.
3333 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3334 * expression.cs (ParameterReference.DoResolveBase): Likewise.
3336 2005-05-18 Martin Baulig <martin@ximian.com>
3341 (FlowBranching.Reachability): Add non-static public And() and Or()
3343 (FlowBranchingSwitch): New class; do the `break_origins' thing
3344 like in FlowBranchingLoop.
3345 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3346 reachability, not just locals and parameters.
3347 (FlowBranching.MergeChild): Remove some of the hacks for loop and
3348 switch; MergeBreakOrigins() now takes care of that.
3350 2005-05-18 Martin Baulig <martin@ximian.com>
3352 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3353 a loop and may leave it, reset the barrier; fixes #74974.
3355 2005-05-16 Raja R Harinath <rharinath@novell.com>
3357 Fix test-382.cs. Emit values of decimal constants.
3358 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3360 (TypeContainer.AddField): ... this.
3361 (TypeContainer.EmitFieldInitializers): Allow the list of fields
3362 with initializers to include 'Const's.
3363 (ClassPart.RegisterFieldForInitialization): Forward to
3365 * const.cs (Const.Const): Pass initializer to base class.
3366 (Const.Define): In case of decimal constants, register them for
3367 initialization in a static constructor.
3369 2005-05-14 Martin Baulig <martin@ximian.com>
3371 * statement.cs (Block.Resolve): Correctly handle unreachable code;
3372 do not call ResolveUnreachable() on unreachable statements in
3373 here, see the comment in the source code.
3375 2005-05-13 Raja R Harinath <rharinath@novell.com>
3378 * expression.cs (BinaryResolveOperator): If one of the operands of
3379 an equality comparison is 'null' and the other is a pointer type,
3380 convert the null to a NullPointer.
3381 * convert.cs (ImplicitReferenceConversion): If the expression is a
3382 NullLiteral and the target type is a pointer type, return a
3383 NullPointer instead.
3384 (ImplicitConversionStandard): Likewise.
3386 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3388 * cs-parser.jay: Set readonly context based on special constructs.
3390 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3391 readonly variable error handling.
3393 * rootcontext.cs (EmitCode): Don't verify members when error
3396 * statement.cs (LocalInfo): Add reaodnly context information.
3397 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3399 2005-05-17 Martin Baulig <martin@ximian.com>
3401 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3404 2005-05-13 Martin Baulig <martin@ximian.com>
3406 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3407 handle unreachable blocks.
3409 2005-05-13 Martin Baulig <martin@ximian.com>
3412 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3413 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3416 2005-05-13 Martin Baulig <martin@ximian.com>
3418 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3419 instance variable, not a local. Fix #74873.
3420 (Block.ResolveUnreachable): Set it to true here.
3422 2005-05-12 Martin Baulig <martin@ximian.com>
3424 * cs-parser.jay (property_declaration): Pass the `current_class',
3425 not the `current_container' to Property's .ctor. Fixes #74912.
3427 2005-05-11 Martin Baulig <martin@ximian.com>
3429 * typemanager.cs (Closure): Copy this from MCS and merge all the
3430 GMCS-specific changes into it.
3432 2005-05-12 Raja R Harinath <harinath@gmail.com>
3435 * typemanager.cs (unmanaged_enclosing_types): New.
3436 (IsUnmanagedType): Avoid infloops by using
3437 'unmanaged_enclosing_types' to talk with recursive invocations.
3439 2005-05-11 Duncan Mak <duncan@novell.com>
3441 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3442 continuing to process for 'arg'.
3443 (handle_preprocessing_directive): Check the argument of the #endif
3444 directive and report error CS1025 if there are any trailing
3447 According to the C# spec, having even whitespace after the #endif
3448 directive is illegal; however, because we call arg.TrimEnd ()
3449 beforehand, we have the same behavior as csc, allowing whitespace
3450 after the directive.
3454 2005-05-11 Marek Safar <marek.safar@seznam.cz>
3458 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3459 (Constructor.GetObsoleteAttribute): Implemented correctly.
3461 2005-05-10 Martin Baulig <martin@ximian.com>
3463 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3464 resolve the type; fixes #74864.
3465 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3466 in DoResolve(); fixes #74862.
3468 2005-05-10 Martin Baulig <martin@ximian.com>
3470 * support.cs (ReflectionParameters.ParameterModifier): Use
3471 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3472 and `ParameterAttributes.In'. Fixes #74884.
3474 2005-05-10 Martin Baulig <martin@ximian.com>
3476 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3477 the cache if we're just looking for `MemberTypes.NestedType' in a
3480 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3481 constraints if we're still resolving the type tree.
3482 (Expression.MemberLookup): If we're resolving the type tree, only
3483 look for `MemberTypes.NestedType' since we're only interested in
3486 * class.cs (TypeContainer.DefineType): Don't resolve the type
3487 parameters here; do this later in ResolveType() after the type
3488 tree has been resolved.
3489 (TypeContainer.ResolveType): New public method; this is called
3490 after the type tree is resolved and before the types are being
3491 populated. We resolve the generic constraints here.
3492 (TypeContainer.DoDefineMember): Check the constraints on our base
3493 class and interfaces.
3495 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3496 set the `ResolvingTypeTree' flag on the EmitContext.
3498 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3500 2005-05-10 Marek Safar <marek.safar@seznam.cz>
3502 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3504 * expression.cs (Argument.GetParameterModifier): Turned to property.
3505 (Invocation.Error_InvalidArguments): Add more descriptive errors.
3507 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3510 2005-05-09 Raja R Harinath <rharinath@novell.com>
3513 * decl.cs (MemberCache.AddMethods): Register override methods,
3514 rather than non-override methods.
3515 * typemanager.cs (RegisterOverride): New.
3516 (IsOverride): Update.
3518 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3520 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3522 2005-05-06 Martin Baulig <martin@ximian.com>
3525 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3526 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3528 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3532 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3533 recursive declaration.
3535 * statement.cs (Block.ResolveMeta): Report any error in resolving.
3537 2005-05-06 Marek Safar <marek.safar@seznam.cz>
3539 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3541 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3543 2005-05-05 Raja R Harinath <rharinath@novell.com>
3546 * decl.cs (DeclSpace.FamilyAccessible):
3547 Use TypeManager.IsNestedFamilyAccessible.
3549 Fix reopened #64812.
3550 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3553 2005-05-04 Raja R Harinath <rharinath@novell.com>
3554 Abin Thomas <projectmonokochi@rediffmail.com>
3555 Anoob V E <projectmonokochi@rediffmail.com>
3556 Harilal P R <projectmonokochi@rediffmail.com>
3559 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3560 allow access to all static members.
3562 2005-05-04 Martin Baulig <martin@ximian.com>
3564 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3566 2005-05-04 Martin Baulig <martin@ximian.com>
3570 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3571 section at the end; make things work if `default' is not the last
3574 2005-05-04 Martin Baulig <martin@ximian.com>
3578 * statement.cs (Switch): Replaced the `got_default' field with a
3579 `default_section' one.
3580 (Switch.CheckSwitch): Set `default_section' here.
3581 (Switch.Resolve): If we're a constant switch and the constant is
3582 not found, use the default section.
3584 2005-05-03 Martin Baulig <martin@ximian.com>
3586 * expression.cs (ArrayAccess.EmitGetLength): New public method.
3588 * statement.cs (Foreach.ArrayForeach): New nested class.
3589 (Foreach.TemporaryVariable): New nested class.
3590 (Foreach.EmitArrayForeach): Removed; this is now in the new
3593 2005-05-03 Raja R Harinath <rharinath@novell.com>
3595 * pending.cs (BaseImplements): Move the #74773 fix here. This is
3597 (VerifyPendingMethods): Revert change below.
3599 * typemanager.cs (IsOverride, RegisterNonOverride): New.
3600 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3601 that used to trigger warning -28. Remove warning -28.
3602 * expression.cs (Invocation.OverloadResolve): Use
3603 TypeManager.IsOverride to distinguish override methods.
3606 * pending.cs (VerifyPendingMethods): If a base type implements the
3607 requested interface, don't bother checking individual methods of
3608 the base type. As a side-effect, this prevents the creation of
3609 unnecessary proxies.
3611 2005-05-02 Martin Baulig <martin@ximian.com>
3615 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3616 Also `And' the locals if the old vector is null.
3617 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3618 null; in this case we basically reset all the variables.
3620 2005-05-02 Martin Baulig <martin@ximian.com>
3624 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3625 Added `FlowBranching branching' argument; always `and' the
3626 variables instead of `or'ing them unless we're an infinite loop.
3628 * statement.cs (While.Resolve): Create a new sibling unless we're
3631 2005-05-02 Martin Baulig <martin@ximian.com>
3635 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3636 arguments; use it instead of creating a new TopLevelBlock.
3637 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3638 our ConstructorInitializer.
3641 (TopLevelBlock.TopLevelBranching): New public property.
3642 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3643 and create our `TopLevelBranching'.
3645 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3646 anonymous method host, use `block.TopLevelBranching' rather than
3647 creating a new branching.
3649 2005-04-20 Miguel de Icaza <miguel@novell.com>
3651 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3652 a ScopeInfo, if any of the current children is a child of the new
3653 entry, move those children there.
3655 2005-04-30 Martin Baulig <martin@ximian.com>
3657 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3658 at the beginning of a SwitchSection. Fix #73335.
3660 2005-04-27 Marek Safar <marek.safar@seznam.cz>
3663 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3665 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3666 (FieldExpr.DoResolve): Obsolete members are ignored for field
3669 2005-04-26 Marek Safar <marek.safar@seznam.cz>
3671 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3672 of arrays detection.
3674 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3676 (Field.VerifyClsCompliance): Volatile fields are not compliant.
3678 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3681 2005-04-25 Ben Maurer <bmaurer@ximian.com>
3683 * cs-parser.jay: Use the prefered version of -unsafe in error
3686 2005-04-22 Marek Safar <marek.safar@seznam.cz>
3688 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3691 2005-04-20 John Luke <john.luke@gmail.com>
3693 * driver.cs: fix typo in error message, --outout to --output
3695 2005-04-30 Martin Baulig <martin@ximian.com>
3697 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3698 handle the .NET 2.x security attributes.
3700 2005-04-30 Martin Baulig <martin@ximian.com>
3703 (TypeManager.ExpandInterfaces): Don't add things twice.
3706 (TypeContainer.VerifyClsCompliance): Allow generic instances.
3708 2005-04-29 Martin Baulig <martin@ximian.com>
3710 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3712 * anonymous.cs: Added support for anonymous generic methods.
3714 2005-04-29 Martin Baulig <martin@ximian.com>
3716 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3719 2005-04-29 Martin Baulig <martin@ximian.com>
3721 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3723 * expression.cs (New.DoResolve): Fix the CS0304 check.
3725 2005-04-29 Martin Baulig <martin@ximian.com>
3727 * typemanager.cs (TypeManager.GetFullName): Updated to the new
3730 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3731 explicit interface implementation, compare the interface types.
3732 (MethodData.Define): Use the new naming scheme from the latest
3734 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3736 * decl.cs (MemberName.GetMemberName): Removed.
3737 (MemberName.MethodName, FullName): New properties.
3739 2005-04-25 Raja R Harinath <rharinath@novell.com>
3741 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3743 2005-04-22 Martin Baulig <martin@ximian.com>
3745 * generic.cs (GenericMethod): Create the EmitContext in the
3746 `Define()'; in `Define(MethodBuilder)', create the type parameters
3747 before calling `Define()'. Fixes #73933.
3749 2005-04-22 Martin Baulig <martin@ximian.com>
3752 (Constraints.Resolve): Make things work wrt. the new type lookup system.
3753 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3755 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3756 ConstructedType, check its constraints.
3758 2005-04-20 Marek Safar <marek.safar@seznam.cz>
3760 * codegen.cs (InRefOutArgumentResolving): New field.
3762 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3763 fields outside contructor.
3765 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3767 2005-04-19 Miguel de Icaza <miguel@novell.com>
3769 * anonymous.cs (CaptureContext.EmitParameterInstance): The
3770 parameter code was not completed ever, so it was not as up-to-date
3771 as local variables. Must finish it.
3773 The bug fix was to compare the Toplevel of the block, not the
3774 current block. Thanks for Ben for pointing this out.
3776 2005-04-19 Raja R Harinath <rharinath@novell.com>
3778 * decl.cs (AddMethods): Use the declaring type of the problem
3779 method to determine if we want to squash a warning.
3781 2005-04-19 Marek Safar <marek.safar@seznam.cz>
3783 * attribute.cs: Removed debug output.
3785 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3787 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3790 2005-04-18 Raja R Harinath <rharinath@novell.com>
3793 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3794 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3795 all null comparisons against reference types.
3797 2005-04-18 Marek Safar <marek.safar@seznam.cz>
3800 * class.cs (TypeContainer.CircularDepException) New nested
3802 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3803 (TypeContainer.DefineType): Removed error, reset InTransit before
3805 (Class.DefineType): Throw exception when is in Transit.
3806 Catch exception and report error.
3807 (Struct.DefineType): Throw exception when is in Transit.
3808 Catch exception and report error.
3809 (Interface.DefineType): Throw exception when is in Transit.
3810 Catch exception and report error.
3812 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3813 handle nested exception handlers.
3815 * flowanalysis.cs (InTryWithCatch): New method, search for try with
3818 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3819 InFinally and InCatch storage.
3821 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3822 (Catch.Resolve): Set and Restore ec.InCatch.
3823 (Try.Resolve): Set and Restore ec.InFinally.
3824 (Try.HasCatch): True when try has catch.
3826 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
3828 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3829 for the same event member, so exclude such cases from warning 419.
3832 2005-04-16 Miguel de Icaza <miguel@novell.com>
3834 * expression.cs (Binary.ResolveOperator): Apply patch from John
3835 Luke to fix bug 59864: operators &, | and ^ on enumerations
3836 require that the same enum type on both sides.
3838 * driver.cs: Add warnings to old flag usage, this is to assist
3839 people who produce Makefiles and hope that the Makefiles will be
3842 * class.cs (TypeContainer.EmitType): Moved the definition of the
3843 special $PRIVATE$ field from the resolve phase to the Emit phase.
3844 During resolve we do not know if we are a struct with
3845 HasExplicitLayout, we know this only after the attributes for the
3848 Set the FieldOffset to zero on the dummy field that we create for
3849 the class. Fixes 74590.
3851 2005-04-16 Raja R Harinath <rharinath@novell.com>
3854 * ecore.cs (PropertyExpr.resolved): New.
3855 (DoResolve): Use it to handle a case of double resolution here.
3856 Handle a case of identical-name-and-type-name.
3857 * expression.cs (ArrayCreation.CheckIndices): Avoid double
3858 resolution by storing the results of expression resolution back
3859 into the "probes" array.
3861 2005-04-15 Raja R Harinath <rharinath@novell.com>
3863 Fix cs0208-7.cs and cs0208-8.cs.
3864 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3865 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
3866 error reporting to point out the reason a struct is not unmanaged.
3868 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3870 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
3871 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3873 2005-04-13 Raja R Harinath <rharinath@novell.com>
3876 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3877 IdenticalNameAndTypeName here.
3878 (EventExpr.InstanceResolve): Likewise.
3880 2005-04-13 Marek Safar <marek.safar@seznam.cz>
3882 C# 2.0 DefaultCharSetAttribute implementation
3884 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3885 which allows us to set GlobalNamespace for every resolve.
3886 (Attribute.ResolveArguments): Cut from Resolve.
3887 (Attribute.GetCharSetValue): Returns CharSet named argument.
3888 (Attribute.DefinePInvokeMethod): Gets default charset from
3890 (GlobalAttribute.ResolveAsTypeStep): Override.
3891 (GlobalAttribute.ResolveArguments): Override.
3893 * class.cs (TypeAttr): Is protected.
3895 * codegen.cs (ModuleClass.DefaultCharSet): New member.
3896 (ModuleClass.DefaultCharSetType): New memeber.
3897 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3899 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3900 charset from module.
3902 * delegate.cs (TypeAttr): Override.
3903 (Delegate.DefineType): Use this TypeAttr.
3905 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3906 at very early stage (before types are defined) to resolve model
3907 module attributes. It will probably not work with corlib but it
3910 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3911 charset from module.
3913 * typemanager.cs (default_charset_type): New type.
3915 2005-04-13 Raja R Harinath <rharinath@novell.com>
3917 * decl.cs (MemberCache.AddMethods): Don't warn if
3918 System.Object.Finalize has buggy MethodAttributes.
3920 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3923 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3925 * doc.cs : detect ambiguous reference to overloaded members.
3926 Fixed bug #71603. MS 1.1 csc does not detect it.
3928 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3930 * doc.cs : delegates must not be referenced with parameters.
3933 2005-04-12 Miguel de Icaza <miguel@novell.com>
3935 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3937 2005-04-10 Miguel de Icaza <miguel@novell.com>
3939 * driver.cs (MainDriver): Stop processing if the CLS stage found
3942 (CompilerCallableEntryPoint.InvokeCompiler): Always
3943 reset after execution; Take a TextWriter argument for the
3946 * report.cs: Use the error stream instead of hardcoding stderr.
3948 2005-04-09 Miguel de Icaza <miguel@novell.com>
3950 * class.cs: Reduce code paths to test, too small of an
3951 optimization to make it worth the extra testing. Always perform
3954 2005-04-08 Raja R Harinath <rharinath@novell.com>
3957 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3958 operators that had errors reported on them.
3960 2005-04-08 Marek Safar <marek.safar@seznam.cz>
3962 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3964 (Attribute.Resolve): Add named argument type checking.
3966 * class.cs (FixedField.Define): Use IsPrimitiveType
3968 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3970 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3971 unsafe parameter types.
3973 * statement.cs (Using.ResolveExpression): Add better error description.
3975 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3977 2005-04-08 Raja R Harinath <rharinath@novell.com>
3980 * attribute.cs (Attribute.GetAttributeUsage): Resolve
3981 AttributeUsageAttribute in the emitcontext of the attribute class,
3982 not in the emitcontext of the attributable entity it was attached to.
3983 * cs-parser.jay: Use 'current_class', not 'current_container',
3984 when creating a GlobalAttribute.
3986 2005-04-08 Alp Toker <alp@atoker.com>
3988 * pending.cs: The fix to #58413 failed to compile methods implementing
3989 interfaces with/without params modifiers and vice versa, even though
3990 params modifiers aren't part of the signature. Make the modifier check
3991 less strict as in csc.
3993 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
3994 Anoob V E <projectmonokochi@rediffmail.com>
3995 Harilal P R <projectmonokochi@rediffmail.com>
3998 * pending.cs (TypeAndMethods.mods): New. Store the parameter
3999 modifiers of pending methods.
4000 (PendingImplementation.PendingImplementation): Initialize it.
4001 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4002 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4003 with ParameterData. Add check for modifiers.
4004 * class.cs (MethodData.Define): Update to changes.
4006 2005-04-07 Raja R Harinath <rharinath@novell.com>
4008 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4010 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4012 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4015 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4018 * typemanager.cs: Registered RequiredAttributeAttribute.
4020 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4022 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4023 Warning CS0169 is back at level 3.
4024 (IMethodData.SetMemberIsUsed): New method.
4026 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4027 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4029 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4031 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4033 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4036 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4039 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4040 to avoid the problems with nested types.
4042 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4043 Anoob V.E <projectmonokochi@rediffmail.com>
4044 Harilal P.R <projectmonokochi@rediffmail.com>
4045 Raja R Harinath <rharinath@novell.com>
4048 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4050 * typemanager (GetConstructor): Make public.
4052 2005-04-05 John Luke <john.luke@gmail.com>
4053 Raja R Harinath <rharinath@novell.com>
4056 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4057 struct too. Return false quicker in a few cases.
4058 (VerifyUnManaged): Use it.
4060 2005-04-05 Raja R Harinath <rharinath@novell.com>
4063 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4064 not 'unreachable_seen'.
4066 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4068 * attribute.cs (Attribute.GetValue): Removed unused.
4070 * codegen.cs (CodeGen.TrimExt): Removed unused.
4072 * cs-parser.jay (output): Removed unused.
4074 * cs-tokenizer.cs (hex_digits): Removed unused.
4076 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4078 * expression.cs (Indirection.LoadExprValue): Removed unused.
4079 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4081 * iterators.cs (Iterator.param_types): Removed unused.
4083 * statement.cs (Goto.block): Removed unused.
4084 (ToplevelBlock.did): Removed unused.
4085 (Switch.ResolveConstantSwitch): Removed unused.
4087 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4089 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4092 2005-04-19 Martin Baulig <martin@ximian.com>
4094 Merged r42462 from MCS and made it work for GMCS.
4096 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4098 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4100 2005-04-01 Raja R Harinath <rharinath@novell.com>
4102 Fix #74232 and cs0208-3.cs.
4103 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4104 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4105 unmanaged type. Don't use FieldBuilders when 't' is a
4106 TypeBuilder. Use ModFlags and MemberType fields.
4107 * class.cs (MemberBase.member_type): Rename from MemberType.
4108 (MemberBase.MemberType): New property. Determines member_type on
4110 (MemberBase.DoDefine): Don't initialize MemberType here.
4111 (FieldMember.Define): Likewise.
4113 2005-04-01 Marek Safar <marek.safar@seznam.cz>
4116 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4117 Attributes are emitted there.
4119 2005-04-01 Raja R Harinath <rharinath@novell.com>
4121 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4122 keyword in 'partial enum' too.
4123 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4125 Report from Kamil Skalski <nazgul@omega.pl>.
4128 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4129 have partial containers too.
4131 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4132 in block' checks to Block.CheckInvariantMeaningInBlock.
4133 * statement.cs (Block.GetKnownVariableInfo): Make private.
4134 (Block.IsVariableUsedInChildBlock): Remove.
4135 (Block.IsVariableUsedInBlock): Likewise.
4136 (Block.CheckInvariantMeaningInBlock): New. Show location of
4137 conflicting declaration.
4138 (Block.AddVariable): Make error messages less long-winded and more
4139 specific. Show location of conflicting declaration.
4140 * parameter.cs (Parameters.Location): New readonly property.
4142 2005-03-31 Raja R Harinath <rharinath@novell.com>
4144 Clean up semantics of invoking ResolveMemberAccess.
4145 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4146 can have an instance, ensure that we pass in a non-TypeExpression
4147 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
4148 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4149 argument. Update to changes and simplify.
4150 (FieldExpr.Emitinstance): Remove CS0120 check.
4151 (PropertyExpr.EmitInstance): Likewise.
4152 * expression.cs (Argument.Resolve): Likewise.
4153 (Invocation.DoResolve): Update to changes in semantics of
4156 2005-03-31 Marek Safar <marek.safar@seznam.cz>
4159 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4162 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4164 2005-03-31 Raja R Harinath <rharinath@novell.com>
4166 Fix difference in behaviour with commandline invocation.
4167 * driver.cs (Driver.Reset): New.
4168 (CompilerCallableEntryPoint): Call it.
4170 * statement.cs (If.Resolve): Avoid spurious "uninitialized
4171 variable" warnings if the boolean expression failed to resolve.
4173 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
4175 * attribute.cs: Fix the union of several permissions when some of them
4176 are unrestricted (so the result isn't an unrestricted permission set).
4179 2005-03-30 Raja R Harinath <rharinath@novell.com>
4181 * ecore.cs (MemberExpr): New class. Convert from interface
4183 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4184 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4186 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4187 (MethodGroupExpr.IsExplicitImpl): Remove.
4188 (Expression.GetFieldFromEvent): Remove.
4189 (SimpleName.MemberStaticCheck): Remove.
4190 (SimpleName.DoSimpleNameResolve): Update to changes.
4191 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4192 (MemberAccess.IdenticalNameAndTypeName): Remove.
4193 (MemberAccess.error176): Move to MemberExpr.
4194 (MemberAccess.DoResolve): Update to changes.
4195 (BaseAccess.DoResolve): Likewise.
4197 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4199 C# 2.0 Conditional attribute class implementation
4201 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4202 Analyzes class whether it has attribute which has ConditionalAttribute
4203 and its condition is not defined.
4205 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4206 (Class.IsExcluded): New method. Search for at least one defined
4207 condition in ConditionalAttribute of attribute class.
4209 2005-03-30 Raja R Harinath <rharinath@novell.com>
4211 * ecore.cs (PropertyExpr): Derive from Expression, not
4212 ExpressionStatement.
4213 (PropertyExpr.EmitStatement): Remove.
4215 2005-03-29 Raja R Harinath <rharinath@novell.com>
4218 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4219 internal field "value__" of an enum be private. The examples for
4220 "value__" that I found on MSDN all used FieldAttributes.Private.
4222 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4223 Don't mention IL method attribute names.
4225 Fix #47991. Remove a TODO.
4226 * statement.cs (Block.Toplevel): Make into a field.
4227 (Block.Parameters): Move into ToplevelBlock.
4228 (Block.known_variables): Rename from child_variable_names.
4229 (Block.Block): Remove variants that take Parameters. Initialize
4230 'Toplevel' with the immediately surrounding toplevel block.
4231 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4232 LocalInfo parameter.
4233 (Block.GetKnownVariableInfo): New.
4234 (Block.IsVariableNameUsedInChildBlock): Update.
4235 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4236 the block, even though it may not be in scope.
4237 (Block.AddVariable): Remove Parameters parameter. Use
4238 Toplevel.Parameters instead.
4239 (Block.AddConstant): Remove Parameters parameter.
4240 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4241 (Block.IsParamaterReference): Likewise.
4242 (Block.IsLocalParameter): Likewise. Simplify a lot.
4243 (ToplevelBlock.Parameters): New. Moved from Block.
4244 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4245 initialize Parameters to a non-null value.
4246 * cs-parser.jay: Update to changes.
4247 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4248 simple names that mean different things in the same block. Use
4249 Block.IsVariableNameUsedInBlock.
4251 2005-03-28 Raja R Harinath <rharinath@novell.com>
4253 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4255 2005-03-26 Raja R Harinath <harinath@acm.org>
4258 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4259 fails to resolve, ensure that the LHS is still resolved as an
4262 2005-03-25 Raja R Harinath <harinath@acm.org>
4264 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4266 (Enum.current_ec): Remove.
4267 (Enum.LookupEnumValue): Remove EmitContext argument.
4268 Just uses the one created during DefineType.
4269 (Enum.FindMembers): Update.
4270 * expression.cs (MemberAccess.DoResolve): Update.
4272 2005-03-22 Marek Safar <marek.safar@seznam.cz>
4274 * assign.cs (Assign.DoResolve): Check for CS1717 when
4275 source and target are same (uses Equals).
4277 * expression.cs (LocalVariableReference, ParameterReference,
4278 This): Implemented Equals, GetHashCode.
4280 * statement.cs (Block.GetParameterReference): Removed useless
4283 2005-03-22 Raja R Harinath <rharinath@novell.com>
4286 * statement.cs (Block.AddVariable): Ensure that we skip implicit
4287 blocks before deciding whether the error is cs0136 or cs0128.
4289 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4290 (using_alias_directive, using_namespace_directive): Pass
4291 MemberName, not an expression to Namespace.UsingAlias and
4293 (MakeName): Use the MemberName of the namespace.
4294 * namespace.cs (Namespace.MemberName): New.
4295 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4296 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4298 * decl.cs (MemberName.Name): Make readonly.
4299 (MemberName.FromDotted): New "constructor".
4300 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4301 (MemberCore.Name): Compute from MemberName on demand.
4302 (MemberCore.SetMemberName): Provide a way to change the
4304 (MemberCore.AddToContainer): Don't take a fullname parameter.
4305 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4306 fully qualified name of the container to the member name.
4307 (TypeContainer.AddToTypeContainer): Use a fully qualified name
4308 only if the type is a member of the root container.
4309 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4310 MemberName.Left rather than searching for an embedded ".".
4311 (PartialContainer.CreatePart): Update to changes in RootContext.
4312 (MemberBase.ShortName): Turn into a property. Use
4313 MemberCore.SetMemberName.
4314 (MemberBase.ExplicitInterfaceName): Remove.
4315 (MemberBase.UpdateMemberName): Remove.
4316 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4317 (PropertyBase.SetMemberName): New override.
4318 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4319 (Tree.GetDecl): New.
4320 (Tree.AllDecls): Rename from Decls.
4321 * attribute.cs, enum.cs, report.cs: Update to changes.
4322 * driver.cs (MainDriver): Use MemberName.FromDotted on
4323 RootContext.MainClass.
4325 2005-03-21 Marek Safar <marek.safar@seznam.cz>
4327 * class.cs (FixedField.Define): Check for CS1664 and more sanity
4330 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4332 2005-03-18 Marek Safar <marek.safar@seznam.cz>
4334 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4335 property accessor modifiers.
4337 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4338 fixed buffer attribute (CS1716).
4339 (PropertyMethod.HasCustomAccessModifier): When property accessor
4340 has custom modifier.
4342 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4344 (PropertyExpr.DoResolveLValue): Add CS0272.
4346 2005-03-17 Miguel de Icaza <miguel@novell.com>
4348 * convert.cs: When converting to a pointer, use the proper Conv.U
4349 or Conv.I depending on the source data type.
4351 * cs-tokenizer.cs: Make the size for large decimal constants,
4354 2005-03-17 Martin Baulig <martin@ximian.com>
4356 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4357 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4359 2005-03-17 Martin Baulig <martin@ximian.com>
4361 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4362 to bool so we can return an error condition.
4363 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4366 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
4368 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4371 2005-03-16 Raja R Harinath <rharinath@novell.com>
4373 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4374 Refactor to avoid traversing the list of assemblies, and to avoid
4375 string concatenation.
4376 * typemanager.cs (guid_attr_type): Remove.
4377 (negative_hits, pointers, references): Remove hashes.
4379 (GetConstructedType): New. Uses type_hash to handle constructed
4380 types (arrays, references, pointers).
4381 (GetReferenceType, GetPointerType): Use it.
4382 (GetNestedType): New. Uses type_hash to handle nested types of
4384 (LookupType, LookupTypeDirect): Remove.
4385 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4386 'types' hash and LookupTypeReflection directly.
4387 (params_string, params_object): Use GetConstructedType.
4388 * namespace.cs (Namespace.cached_types): New. Cache of reflected
4390 (Namespace.Lookup): Use cached_types.
4391 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4392 provided by old TypeManager.LookupType.
4393 * rootcontext.cs (MakeFQN): Remove.
4394 * decl.cs (DeclSpace.MakeFQN): Likewise.
4395 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4396 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4397 TypeManager.GetConstructedType.
4398 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4400 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
4402 * cs-parser.jay: Fix build.
4404 2005-03-15 Marek Safar <marek.safar@seznam.cz>
4406 * class.cs (TypeContainer.CircularDepException) New nested
4407 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4409 * cs-parser.jay: Reports CS1527 for any namespace element.
4411 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4414 * expression.cs (ParameterReference.IsAssigned): Changed error to
4416 (Error_WrongNumArguments): Moved CS0245 detection here.
4418 * statement.cs (Return.Resolve): Add CS1622 report.
4420 2005-03-11 Marek Safar <marek.safar@seznam.cz>
4422 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4424 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
4426 * attribute.cs expression.cs: Get rid of some allocations.
4428 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
4430 * doc.cs : just eliminate the latest change.
4432 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4434 * doc.cs : commented out the latest change. It breaks xml-030.cs
4436 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4438 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4439 fail. So invoke CreateType() in FindDocumentedType().
4441 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4443 * cs-tokenizer.cs : added IsKeyword().
4444 * doc.cs : Detect keyword incorrectly used as identifier.
4445 Allow identifiers prefixed by @.
4447 2005-03-10 Marek Safar <marek.safar@seznam.cz>
4449 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4450 It caused exception in namespace resolving (again!).
4452 * class.cs (Class.ctor): Removed exit.
4453 (PropertyMethod.ctor): ditto.
4455 * codegen.cs (Codegen.Reset): Reset static data.
4456 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4458 * cs-tokenizer.cs (Cleanup): Removed.
4460 * driver.cs (GetSystemDir): Rewrote to one line command.
4461 It caused problem with unloaded dynamic modules.
4462 (UnixParseOption): Removed Exit.
4463 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4464 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4465 Now can be mcs used as library.
4467 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4470 * location.cs (Reset): Reset static data.
4472 * namespace.cs (Reset): Reset static data.
4474 * report.cs (Report.Reset): Reset static data.
4476 * rootcontext.cs (RootContext.Reset): Reset static data.
4478 * tree.cs (RootTypes.ctor): Use Location.Null
4480 * typemanager.cs (TypeManager.Reset): Reset static data.
4481 (CoreLookupType): Removed Exit.
4482 (TypeHandle.Reset): Reset static data.
4484 2005-03-10 Raja R Harinath <rharinath@novell.com>
4487 * typemanager.cs (ComputeNamespaces): Import namespaces from
4488 referenced modules too.
4490 2005-03-09 Raja R Harinath <rharinath@novell.com>
4492 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4495 2005-03-09 Raja R Harinath <rharinath@novell.com>
4497 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4498 enclosing DeclSpace. This ensures that a name-lookup populates
4499 more caches and there are fewer 'TypeExpression's. Carve out
4500 nested type lookup into ...
4501 (LookupNestedTypeInHierarchy): ... this.
4503 2005-04-15 Martin Baulig <martin@ximian.com>
4505 Merged r41590 from MCS and make it work in the generics land.
4507 * generic.cs (TypeParameter.UpdateConstraints): Removed the
4510 * class.cs (PartialContainer.UpdateConstraints): Removed.
4511 (PartialContainer.CheckConstraints): Removed.
4512 (PartialContainer.SetParameterInfo): Store the constraints here.
4513 (PartialContainer.DefineTypeParameters): New public method;
4514 resolve the type parameter's constraints here. Note that the
4515 PartialContainer doesn't have an EmitContext anymore, so we must
4516 do this in the ClassPart.
4518 2005-03-09 Raja R Harinath <rharinath@novell.com>
4520 Clean up a few partial-class semantics.
4521 Fixes test-357.cs and cs1618-2.cs.
4522 * cs-parser.jay (struct_declaration): Use 'current_class' as
4523 parent of newly-created struct. Remove call to Register ().
4524 Use 'pop_current_class' to complete handing the current struct.
4525 (interface_declaration): Likewise.
4526 (class_declaration): Likewise.
4527 (enum_declaration): Use 'current_class' as parent of newly created
4529 (delegate_declaration): Likewise.
4530 (pop_current_class): New function. This is used to handle closing
4531 up the 'current_class' and 'current_container', and pointing them
4532 to the enclosing class/container.
4533 (CSharpParser): Initialize 'current_class' too.
4534 * decl.cs (MemberCore): Add check for invariant: a partial
4535 container is not a parsed entity, and thus does not enclose any
4537 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4538 (DeclSpace.BaseTypeExpr): Use it.
4539 (DeclSpace.LookupType): Add check for invariant.
4540 * class.cs (TypeContainer): Add check for invariant: a nested
4541 class should have the same NamespaceEntry as its enclosing class.
4542 (TypeContainer.EmitFieldInitializers): Make virtual.
4543 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4545 (TypeContainer.Register): Remove.
4546 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4547 null. Use TypeResolveEmitContext for resolving base types and
4548 interfaces. Move initialization of Parts.TypeBuilder here from
4550 (TypeContainer.DefineNestedTypes): ... here.
4551 (PartialContainer): Take a Namespace not a NamespaceEntry.
4552 (PartialContainer.Create): Don't use Register. Call the
4553 appropriate Add... function directly.
4554 (ClassPart): Take both the PartialContainer and the enclosing
4555 class as constructor arguments.
4556 (ClassPart.EmitFieldInitializers): Override.
4557 (ClassPart.PartFindNestedTypes): Remove.
4558 (FieldBase.GetInitializerExpression): Resolve the initializer
4559 expression in the emit context of the enclosing class.
4560 * tree.cs (RootTypes): Remove Register ().
4562 2005-03-08 Marek Safar <marek.safar@seznam.cz>
4564 * cs-parser.jay: Removed CS0134.
4566 * driver.cs: Removed CS1901.
4568 * expression.cs (SizeOf.DoResolve): Don't report CS0233
4569 for predefined types.
4571 2005-03-07 Duncan Mak <duncan@novell.com>
4573 * codegen.cs (Save): Catch UnauthorizedAccessException as
4574 well. Fixes bug #73454.
4576 2005-03-07 Marek Safar <marek.safar@seznam.cz>
4578 * cs-tokenizer.cs (xtoken): Add CS1035.
4580 * class.cs (MethodData.Define): Add CS0683.
4581 (FieldMember.ctor): Add CS0681.
4583 2005-03-07 Raja R Harinath <rharinath@novell.com>
4585 * ecore.cs (SimpleName.DoResolve): Rename from
4586 SimpleName.DoResolveAllowStatic.
4587 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4588 Pass 'intermediate' flag to MemberStaticCheck.
4589 (SimpleName.MemberStaticCheck): Skip "static check" only in case
4590 of "intermediate" lookups via MemberAccess.
4591 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
4592 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4594 2005-03-07 Raja R Harinath <rharinath@novell.com>
4597 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4598 slipped in because of variable names that are identical to a
4599 builtin type's BCL equivalent ('string String;', 'int Int32;').
4600 (PropertyExpr.EmitInstance): Likewise.
4602 2005-03-04 Marek Safar <marek.safar@seznam.cz>
4604 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4606 * report.cs (warning_ignore_table): Made public.
4608 2005-03-04 Raja R Harinath <rharinath@novell.com>
4611 * class.cs (MethodData.Emit): Pass 'container' to
4612 container.GetObsoleteAttribute instead of 'container.Parent'.
4614 2005-03-03 Marek Safar <marek.safar@seznam.cz>
4616 * cs-parser.jay: Add 1534 error test.
4618 * iterators.cs (Yield.CheckContext): Add error 1629.
4619 (Iterator.ctor): Save unsafe modifier.
4620 (MoveNextMethod.DoEmit): Restore unsafe context.
4622 * namespace.cs (UsingAlias): Better error message.
4624 2005-03-03 Dan Winship <danw@novell.com>
4626 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4627 the warning message [#73219]
4629 2005-03-03 Raja R Harinath <rharinath@novell.com>
4631 Fix compile with MCS 1.0.0.0.
4632 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4633 w_restore to not depend on string constant folding.
4635 2005-03-03 Raja R Harinath <rharinath@novell.com>
4637 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
4638 CS0246 check to users who passed 'silent = false'.
4639 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4641 (SimpleName.SimpleNameResolve): Update.
4642 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4643 (MemberAccess.IdenticalNameAndTypeName): Update.
4644 * doc.cs (FindDocumentedTypeNonArray): Update.
4646 2005-03-03 Raja R Harinath <rharinath@novell.com>
4648 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4649 * parameters.cs (ComputeAndDefineParameters): Remove.
4650 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4651 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4652 Use GetParameterInfo.
4654 2005-03-02 Marek Safar <marek.safar@seznam.cz>
4656 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4658 2005-03-02 Raja R Harinath <rharinath@novell.com>
4660 Unify DeclSpace.LookupType and DeclSpace.FindType.
4661 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
4662 is in charge of defining nested types on demand.
4663 (DeclSpace.LookupType): Use it when the current_type is a
4664 TypeBuilder. Use LookupTypeDirect for reflected types.
4665 (DeclSpace.FindType): Remove.
4666 (DeclSpace.LookupInterfaceOrClass): Likewise.
4667 (DeclSpace.DefineTypeAndParents): Likewise.
4668 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4669 DeclSpace.LookupType.
4670 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4671 * typemanager.cs (LookupType): Simplify.
4672 (AddUserType): Remove type from negative_hits.
4673 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4674 * class.cs (TypeContainer.FindMembers): Move handling of nested
4676 (TypeContainer.FindMembers_NestedTypes): ... here.
4677 (TypeContainer.FindNestedType): Implement override.
4678 (ClassPart.FindNestedType): Delegate to PartialContainer.
4679 (ClassPart.PartFindNestedType): Looks up the nested types of the
4682 2005-04-14 Martin Baulig <martin@ximian.com>
4684 * generic.cs (ConstructedType): Moved all the type lookup and
4685 nested class logic into SimpleName.
4686 (ConstructedType.ResolveConstructedType): Our underlying type is
4687 already fully resolved; all the type lookup stuff is in
4690 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4691 constructed types here instead of in ConstructedType.
4693 * decl.cs (MemberName.GetTypeExpression): Always create a
4694 SimpleName, not a ConstructedType.
4695 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4697 2005-03-02 Martin Baulig <martin@ximian.com>
4699 * class.cs (TypeContainer.DoDefineMembers): We also need a default
4700 static constructor in static classes.
4702 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
4704 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4705 sizeParamIndex is not specified.
4707 2005-03-01 Marek Safar <marek.safar@seznam.cz>
4710 * report.cs (WarningMessage.IsEnabled): Missing null check.
4712 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4714 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4715 in the fields and not in the properties.
4717 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
4719 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
4722 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4724 * attribute.cs: Small refactoring (improved robustness).
4725 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4726 (ValidateGuid): Removed.
4727 (Resolve): Removed referenced to above mentioned.
4728 (GetAttributeUsage): Made private and changed to work without
4730 (GetIndexerAttributeValue): Don't crash.
4731 (GetConditionalAttributeValue): Ditto.
4732 (GetClsCompliantAttributeValue): Ditto.
4733 (ExtractSecurityPermissionSet): All attributes exceptions are
4735 (GetPropertyValue): New helper.
4736 (GetMethodImplOptions): New method.
4737 (DefinePInvokeMethod): Reuse common code. Implemented handling of
4738 some missing properties.
4740 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4741 (Method.ApplyAttributeBuilder): Updated.
4743 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4746 2005-02-28 Raja R Harinath <rharinath@novell.com>
4749 * report.cs (Report.SymbolRelatedToPreviousError): Handle
4750 non-simple types (array, pointer, reference).
4752 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4754 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4756 * class.cs (MethodCore.IsDuplicateImplementation): Special error
4758 (Method.CheckBase): Catch wrong destructor here.
4759 (MethodData.Define): Add errors 550, 668.
4761 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4763 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4765 * pending.cs (VerifyPendingMethods): Add error 551.
4767 * typemanager.cs (CSharpName): Next error report helper.
4769 2005-02-25 Marek Safar <marek.safar@seznam.cz>
4771 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4772 attributes. Removed useless attribute double check.
4773 It saves almost 2MBs for corlib.
4775 2005-02-25 Raja R Harinath <rharinath@novell.com>
4778 * statement.cs (ExpressionStatement.Resolve): Make robust to being
4779 called twice in case of error.
4781 2005-02-23 Chris Toshok <toshok@ximian.com>
4783 Fix compiler portions of #72827.
4784 * statement.cs (Block.Emit): call Begin/EndScope on the
4785 EmitContext instead of the ILGenerator.
4787 * codegen.cs (EmitContext.BeginScope): new method, call
4788 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4790 (EmitContext.BeginScope): same, but EndScope and CloseScope
4792 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4793 offset and call the superclass's OpenScope(int) with it.
4794 (SymbolWriter.CloseScope): get the current il
4795 offset and call superclass's CloseScope(int) with it.
4797 2005-02-23 Marek Safar <marek.safar@seznam.cz>
4799 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4800 CS1677 for out and ref as well.
4802 * class.cs (Method.Define): Add error CS1599 detection.
4804 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4806 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4808 * delegate.cs (Delegate.Define): Add error CS1599 detection.
4810 * support.cs.cs (ModifierDesc): New helper method.
4812 2005-02-23 Raja R Harinath <rharinath@novell.com>
4813 Abin Thomas <projectmonokochi@rediffmail.com>
4814 Anoob V E <projectmonokochi@rediffmail.com>
4815 Harilal P R <projectmonokochi@rediffmail.com>
4818 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4819 MemberLookup (used for error reporting) actually returns a result.
4820 Fix error report number (122, not 112).
4822 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
4823 Anoob V E <projectmonokochi@rediffmail.com>
4824 Harilal P R <projectmonokochi@rediffmail.com>
4827 * pending.cs (PendingImplementation.GetAbstractMethods):
4828 Find NonPublic members too.
4830 2005-02-22 Marek Safar <marek.safar@seznam.cz>
4832 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4835 * class.cs (MethodCore.CheckMethodAgainstBase):
4836 Add error 239 report.
4838 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4840 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4842 * class.cs (Operator.Define): Add error 217 report.
4844 2005-02-21 Raja R Harinath <rharinath@novell.com>
4847 * expression.cs (Invocation.IsApplicable): Make public.
4848 (Invocation.IsParamsMethodApplicable): Likewise.
4849 * delegate.cs (Delegate.VerifyApplicability): Don't use
4850 Invocation.VerifyArgumentCompat for parameter applicability
4851 testing. Use Invocation.IsApplicable and
4852 Invocation.IsParamsMethodApplicable.
4854 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4856 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4858 * class.cs (Operator.Define): Add error 217 report.
4860 2005-02-21 Raja R Harinath <rharinath@novell.com>
4862 * namespace.cs (UsingEntry.Resolve): Undo change below.
4864 2005-02-21 Raja R Harinath <rharinath@novell.com>
4867 * ecore.cs (Expression.MemberLookupFailed): Add argument to
4868 disable the error message when the extended MemberLookup also
4870 (Expression.MemberLookupFinal): Update.
4871 (SimpleName.DoSimpleNameResolve): Update.
4872 * expression.cs (MemberAccess.ResolveNamespaceOrType):
4873 Don't use MemberLookupFinal.
4874 (New.DoResolve): Update.
4875 (BaseAccess.CommonResolve): Update.
4877 2005-02-21 Raja R Harinath <rharinath@novell.com>
4880 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4881 occured previously, don't resolve again.
4883 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4886 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4887 argument. Call ResolveAttributeUsage for unresolved.
4888 when types doesn't match ctor arguments.
4890 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4891 for nested attribute classes.
4892 (Class.attribute_usage): Removed.
4893 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4894 for attribute class.
4896 * ecore.cs (IsAttribute): Removed.
4898 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4900 * rootcontext.cs (RegisterAttribute): Removed, attributes are
4902 (attribute_types): Removed.
4903 (EmitCode): Global attributes are emited as the latest.
4905 2005-02-18 Marek Safar <marek.safar@seznam.cz>
4907 * class.cs (EmitFieldInitializers): Don't emit field initializer
4908 for default values when optimilization is on.
4910 * constant.cs (Constant.IsDefaultValue): New property.
4912 * driver.cs: Add /optimize handling.
4916 * literal.cs: Implement new IsDefaultValue property.
4918 * rootcontext.cs (Optimize): New field, holds /optimize option.
4920 2005-02-18 Raja R Harinath <rharinath@novell.com>
4922 Fix crasher in re-opened #72347.
4923 * namespace.cs (Namespace.Lookup): Return null if
4924 DeclSpace.DefineType returns null.
4927 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4929 2005-02-18 Raja R Harinath <rharinath@novell.com>
4931 Fix remainder of #63202. Change semantics of DoResolveLValue: it
4932 now returns null if it cannot resolve to an lvalue.
4933 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4934 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4935 returned null. Remove check for SimpleName.
4936 (EventExpr.DoResolveLValue): New.
4937 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4938 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
4940 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
4942 (Unary.ResolveOperator): Move CS0211 check ...
4943 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
4945 (Unary.DoResolveLValue): Simplify.
4946 (AddressOf.DoResolveLValue): New.
4947 (ArrayAccess.DoResolveLValue): New.
4949 2005-02-16 Marek Safar <marek.safar@seznam.cz>
4951 * attribute.cs (Attribute.Resolve): Add arguments casting for
4952 when types doesn't match ctor arguments.
4954 2005-02-16 Raja R Harinath <rharinath@novell.com>
4956 Fix parts of #63202.
4957 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4958 lookup of operator in base type. Ensure that all checks happen
4959 when the operator resolves to an "op_..." method.
4961 2005-02-15 Raja R Harinath <rharinath@novell.com>
4964 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4965 'ignore_cs0104' parameter. Pass it to ...
4966 (NamespaceEntry.Lookup): ... this.
4967 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4968 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4969 (TypeLookupExpression.DoResolveAsTypeStep): Update.
4970 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4971 Update. Request that cs0104 errors be ignored.
4972 (ComposedCast.ResolveAsTypeStep): Update.
4974 2005-02-14 Raja R Harinath <rharinath@novell.com>
4977 * expression.cs (Invocation.BetterFunction): Remove support for
4978 comparing virtual functions and their overrides.
4979 (Invocation.IsOverride): New.
4980 (Invocation.OverloadResolve): Don't consider 'override' functions
4981 during candidate selection. Store them in a lookaside list.
4982 If the selected method is a 'virtual' function, use the list to
4983 find any overrides that are closer to the LHS type.
4985 2005-02-14 Marek Safar <marek.safar@seznam.cz>
4987 * expression.cs (New.DoResolve): Add complex core type reduction.
4988 (New.Constantify): Converts complex core type syntax like 'new int ()'
4991 2005-02-14 Raja R Harinath <rharinath@novell.com>
4993 * decl.cs (EntryType.EntryType): New constructor to create an
4994 updated copy of a cache entry.
4995 (MemberCache.AddMethods): Use it.
4996 (MemberCache.ClearDeclaredOnly): Remove.
4997 (MemberCache.MemberCache): Update.
4999 2005-02-11 Miguel de Icaza <miguel@novell.com>
5001 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5002 variable. This one is represents the actual low-level declaration
5003 of the method, as opposed to the semantic level `IsStatic'.
5005 An anonymous method which is hosted into a static method might be
5006 actually an instance method. IsStatic would reflect the
5007 container, while MethodIsStatic represents the actual code
5010 * expression.cs (ParameterReference): Use the new MethodIsStatic
5011 instead of IsStatic.
5013 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5014 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5015 set on the current EmitContext.
5017 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5018 resolve our casted expression as an LValue. This triggers the
5019 proper LValue processing that is later required by Assign.
5023 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5025 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5027 C# 2.0 Fixed buffer implementation
5029 * anonymous.cs: Update after RegisterHelperClass renaming.
5031 * attribute.cs (AttributeTester.fixed_buffer_cache):
5032 Cache of external fixed buffers.
5033 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5034 implementation if field is fixed buffer else null.
5037 (TypeContainer.AddField): Accept FieldMember instead of Field.
5038 (FieldBase.IsFieldClsCompliant): Extracted code from
5039 VerifyClsCompliance descendant customization.
5040 (FixedField): New class handles fixed buffer fields.
5041 (FixedFieldExternal): Keeps information about imported fixed
5043 (IFixedField): Make access to internal or external fixed buffer
5046 * cs-parser.jay: Add fixed buffer parsing.
5048 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5051 * expression.cs (Indirection): Extended implementation to accept
5053 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5054 (ElementAccess.MakePointerAccess): Get type as parameter.
5055 (DoResolve): Add fixed buffer field expression conversion.
5056 (DoResolveLValue): Ditto.
5057 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5058 (ArrayPtr): Derives from FixedBufferPtr.
5059 (ArrayPtr.Emit): Add extra emit for array elements.
5061 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5063 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5064 for compiler generated types.
5065 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5067 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5068 and consume less memory.
5069 (Fixed.Resolve): Add fixed buffer case.
5071 * typemanager.cs (compiler_generated_attr_ctor,
5072 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5073 (HasElementType): Add our own implementation to work on every
5076 2005-02-11 Miguel de Icaza <miguel@novell.com>
5078 * anonymous.cs (CaptureContext): Track whether `this' has been
5081 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5082 only captured `this' if it was implicitly done (instance
5083 methods/variables were used).
5085 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5086 `this' must be captured.
5088 2005-01-30 Miguel de Icaza <miguel@novell.com>
5090 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5091 is null it means that there has been no need to capture anything,
5092 so we just create a sibling.
5094 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5096 Just a partial fix. The other half is fairly elusive.
5098 2005-02-10 Raja R Harinath <rharinath@novell.com>
5100 Fix #52586, cs0121-4.cs.
5101 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5102 and return a hashtable.
5103 (MemberCache.ClearDeclaredOnly): New.
5104 (MemberCache.MemberCache): Update to change. Make a deep copy of
5105 the method_hash of a base type too.
5106 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5107 type methods. Overwrite entries with the same MethodHandle so
5108 that the ReflectedType is correct. The process leaves in base
5109 virtual functions and their overrides as distinct entries.
5110 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5111 matters since it was boxed in a ArrayList before.
5112 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5114 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5115 case of a virtual function and its override (choose the overload
5117 (Invocation.OverloadResolve): Avoid 'override' members during
5118 'applicable_type' calculation.
5120 2005-03-28 Raja R Harinath <rharinath@novell.com>
5122 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5123 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5124 GetTypeHandle. It is possible for a reflected type to derive from
5125 a TypeBuilder (e.g., int[] derives from the TypeBuilder
5126 System.Array during mscorlib compilation).
5127 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5128 contain a method_hash, don't create one either. Don't create a
5129 deep copy of the base cache's method_hash.
5130 (MemberCache.SetupCache): Rename back from DeepCopy.
5131 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5132 already initialized. If we see an override function, add its
5133 underlying base virtual function to the member_hash too.
5135 2005-02-09 Raja R Harinath <rharinath@novell.com>
5137 Combine two near-redundant caches.
5138 * typemanager.cs (method_params): Rename from method_internal_params.
5139 (TypeManager.GetParameterData): New. Replace
5140 Invocation.GetParameterData.
5141 (TypeManager.LookupParametersByBuilder): Remove.
5142 * expression.cs (Invocation.method_parameter_cache): Remove.
5143 (Invocation.GetParameterData): Remove.
5145 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5148 2005-02-08 Raja R Harinath <rharinath@novell.com>
5151 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5152 TypeManager.multicast_delegate_type is null, resolve it by looking
5153 up "System.MulticastDelegate".
5154 * rootcontext.cs (RootContext.ResolveCore): Simplify.
5156 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
5157 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
5158 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
5161 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5162 (LabeledStatement.AddReference): New. Set 'referenced'.
5163 (Goto.Resolve): Use it.
5165 2005-02-05 John Luke <john.luke@gmail.com>
5167 * driver.cs: remove duplicate -doc line in Usage ()
5169 2005-02-04 Raja R Harinath <rharinath@novell.com>
5171 * location.cs (Location.AddFile): Fix CS2002 error report.
5173 2005-02-02 Martin Baulig <martin@ximian.com>
5175 * delegate.cs (Delegate.DefineType): Report an internal error if
5176 TypeManager.multicast_delegate_type is null. See bug #72015 for
5179 2005-02-02 Raja R Harinath <rharinath@novell.com>
5181 Fix a crasher in a variant of #31984.
5182 * const.cs (Constant.CheckBase): New override that defers the
5183 new-or-override check in case the base type hasn't been populated
5185 (Constant.Define): Ensure the new-or-override check is performed.
5187 2005-02-01 Duncan Mak <duncan@ximian.com>
5189 * const.cs (LookupConstantValue): Check that `ce' is not null
5190 before calling GetValue ().
5192 2005-02-01 Raja R Harinath <rharinath@novell.com>
5194 Fix test-334.cs (#69519).
5195 * cs-parser.jay (using_alias_directive): Pass in an expression to
5196 NamespaceEntry.UsingAlias.
5197 (using_namespace_directive): Pass in an expression to
5198 NamespaceEntry.Using.
5199 (namespace_name): Don't flatten to a string.
5200 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5201 (NamespaceEntry.AliasEntry.Resolve): Lookup using
5203 (NamespaceEntry.UsingEntry): Likewise.
5204 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5206 (NamespaceEntry.LookupForUsing): Remove.
5207 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5209 (NamespaceEntry.Lookup): Remove support for dotted names.
5211 2005-02-01 Raja R Harinath <rharinath@novell.com>
5213 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5215 (NamespaceEntry.ImplicitParent): Compute on demand.
5216 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5217 parallels the current.
5218 (NamespaceEntry.LookupForUsing): Use it.
5219 (NamespaceEntry.Lookup): If the current namespace-entry is
5220 implicit, don't search aliases and using tables.
5222 2005-02-01 Raja R Harinath <rharinath@novell.com>
5225 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5227 (TypeContainer.BaseCache): Compute on demand.
5228 (TypeContainer.FindMembers): Define constants and types if they're
5229 not already created.
5230 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5232 * const.cs (Constant.Define): Make idempotent.
5234 2005-01-29 Miguel de Icaza <miguel@novell.com>
5236 * pending.cs: Produce better code (no nops produced by using Ldarg
5239 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5240 i - 1' it should be arg + 1.
5244 2005-01-28 Raja R Harinath <rharinath@novell.com>
5246 * attribute.cs (Attribute.CheckAttributeType): Make private
5248 (Attribute.ResolveType): Make virtual.
5249 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5250 handling of RootContext.Tree.Types.
5252 2005-01-27 Raja R Harinath <rharinath@novell.com>
5254 Update attribute-handling to use the SimpleName/MemberAccess
5256 * cs-parser.jay (attribute): Pass in an expression to the
5257 constructors of Attribute and GlobalAttribute.
5258 * attribute.cs (Attribute): Take an expression for the name.
5259 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5260 passed in attribute name expression.
5261 (Attribute.CheckAttributeType): Use it.
5262 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5263 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5264 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
5265 argument to prevent error messages if the lookup fails.
5267 2005-01-27 Marek Safar <marek.safar@seznam.cz>
5269 * expression.cs (Indirection): Implemented IVariable interface
5270 to support indirection in AddressOf operator.
5271 (PointerArithmetic.Emit): Add optimalization for case where
5272 result can be precomputed.
5274 2005-01-26 Martin Baulig <martin@ximian.com>
5276 * class.cs (TypeContainer.AttributeTargets): Return the correct
5277 AttributeTargets depending on our `Kind' instead of throwing an
5278 exception; fixes #71632.
5280 2005-01-26 Marek Safar <marek.safar@seznam.cz>
5283 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5286 2005-03-17 Martin Baulig <martin@ximian.com>
5288 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5289 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5291 2005-03-17 Martin Baulig <martin@ximian.com>
5293 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5294 to bool so we can return an error condition.
5295 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5298 2005-03-17 Martin Baulig <martin@ximian.com>
5300 * generic.cs (TypeMananager.IsIEnumerable): New public method.
5302 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5303 converting from an array-type of T to `IEnumerable<T>'.
5305 2005-03-16 Martin Baulig <martin@ximian.com>
5307 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5308 (Nullable.LiftedUnaryMutator): New public class.
5310 * expression.cs (UnaryMutator.DoResolve): Added support for
5313 2005-03-14 Martin Baulig <martin@ximian.com>
5315 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5317 2005-03-14 Martin Baulig <martin@ximian.com>
5319 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5320 the comparision operators `<', `>', `<=' and `>='.
5322 2005-03-13 Martin Baulig <martin@ximian.com>
5325 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5326 avoid confusion with the `NullLiteral'.
5327 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5329 2005-03-13 Martin Baulig <martin@ximian.com>
5331 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5332 comparing arbitrary types with the null literal.
5334 2005-03-13 Martin Baulig <martin@ximian.com>
5336 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5337 boolean operators '&&', '||', '&' and '|'.
5338 (Nullable.OperatorTrueOrFalse): New public class.
5340 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5341 instead of a `StaticCallExpr'; added support for nullables.
5343 2005-03-10 Martin Baulig <martin@ximian.com>
5346 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5347 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
5349 2005-03-07 Martin Baulig <martin@ximian.com>
5351 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5352 it work if `expr' is not an IMemoryLocation.
5353 (Nullable.Lifted): Implement IMemoryLocation.
5354 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5357 2005-03-05 Martin Baulig <martin@ximian.com>
5359 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5360 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5361 (Nullable): Added support for lifted unary and binary operators.
5363 * expression.cs (Unary.DoResolve): Added support for nullable types.
5364 (Binary.DoResolve): Likewise.
5365 (Conditional.DoResolve): Likewise.
5367 2005-03-02 Martin Baulig <martin@ximian.com>
5369 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5371 * class.cs (ClassPart.SetParameterInfo): Override this.
5372 (PartialContainer.SetParameterInfo): Override this.
5373 (TypeContainer.CheckConstraints): New protected method.
5374 (PartialContainer.CheckConstraints): Override this and check
5375 whether the same contraints were specified in all parts of a
5376 partial generic type definition.
5377 (PartialContainer.UpdateConstraints): New public method.
5379 * generic.cs (TypeParameter.UpdateConstraints): New public method.
5381 2005-03-02 Martin Baulig <martin@ximian.com>
5383 Committing a patch from Carlos Alberto Cortez to fix #72887.
5385 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5386 casts from `T []' to `int []'.
5388 2005-03-02 Martin Baulig <martin@ximian.com>
5390 * generic.cs (TypeManager.IsEqual): Make this symmetric.
5392 * expression.cs (Binary.ResolveOperator): When resolving a
5393 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5394 `=='. Fixes #71866. See gen-127.cs.
5396 2005-03-02 Martin Baulig <martin@ximian.com>
5398 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5399 static constructor in static classes.
5401 2005-03-02 Martin Baulig <martin@ximian.com>
5404 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5405 (Nullable.LiftedConversion): Added support for user-defined
5408 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5410 * cs-parser.jay: Use ComposedCast everywhere instead of
5411 NullableType, so we don't need to check for NullableType
5413 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5414 case where we'll be resolved into a `parenthesized_expression_0'
5418 (Convert.UserDefinedConversion): Added nullable conversions.
5420 2005-02-28 Martin Baulig <martin@ximian.com>
5422 * generic.cs (TypeManager.IsNullableType): New static method.
5423 (Nullable): New abstract class.
5424 (Nullable.NullLiteral): New public class.
5425 (Nullable.LiftedConversion): New public class.
5427 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5428 `builtin_types opt_nullable'.
5431 (Convert.ImplicitConversionStandard): Added nullable conversions.
5432 (Convert.ExplicitConversionStandard): Likewise.
5433 (Convert.ExplicitConversion): Likewise.
5435 2005-02-26 Martin Baulig <martin@ximian.com>
5437 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5438 begin with a "?", for instance "?[]". Don't do a type lookup if
5441 2005-02-25 Martin Baulig <martin@ximian.com>
5443 The first part of Nullable Types :-)
5445 * generic.cs (NullableType): New public class.
5446 (NullCoalescingOperator): New public class.
5447 (TypeArguments.Resolve): Add a CS0306 check.
5449 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5450 (opt_nullable): New rule.
5451 (type): Added `opt_nullable' to `namespace_or_type_name',
5452 `builtin_types' and `pointer_type'.
5453 (array_type): Added `opt_nullable'.
5454 (opt_rank_specifier_or_nullable): New rule; this is the
5455 combination of `opt_rank_specifier' and `opt_nullable'.
5456 (opt_error): New rule; catch errors here.
5457 (nullable_type_or_conditional): New rule; we use this to check for
5458 nullable and still detect the conditional operator.
5459 (local_variable_type): Use `opt_rank_specifier_or_nullable'
5460 instead `opt_rank_specifier'.
5462 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5465 2005-02-24 Martin Baulig <martin@ximian.com>
5467 * README, README.Changes: Removed; they're old and obsolete.
5469 2005-02-22 Martin Baulig <martin@ximian.com>
5471 * generic.cs (TypeParameter.Resolve): If resolving the constraints
5472 returned an error, set `constraints' to null to avoid a crash
5474 (TypeParameter.ResolveType): Likewise.
5476 2005-02-22 Martin Baulig <martin@ximian.com>
5479 (Constraints.ResolveTypes): Protect against being called twice.
5480 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5481 (TypeParameter.ResolveType): New public method; calls
5482 constraints.ResolveTypes().
5483 (TypeParameter.DefineType): Moved constraints.ResolveType() out
5484 into the new ResolveType().
5485 (GenericMethod.Define): Call ResolveType() on all our
5488 2005-02-21 Martin Baulig <martin@ximian.com>
5491 (TypeManager.generic_nullable_type): New static public field.
5492 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5495 (RootContext.ResolveCore): Resolve "System.Nullable`1".
5497 2005-02-15 Martin Baulig <martin@ximian.com>
5499 * generic.cs (ConstructedType.Constraints): Correctly check
5500 constraints if the argument type is a type parameter; fixes
5503 2005-02-02 Martin Baulig <martin@ximian.com>
5505 * delegate.cs (Delegate.DefineType): Report an internal error if
5506 TypeManager.multicast_delegate_type is null. See bug #72015 for
5509 2005-01-29 Miguel de Icaza <miguel@novell.com>
5511 * pending.cs: Produce better code (no nops produced by using Ldarg
5514 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5515 i - 1' it should be arg + 1.
5519 2005-01-26 Martin Baulig <martin@ximian.com>
5521 * cs-parser.jay (indexer_declarator): Don't report an error if we
5522 have type parameters since we can be an explicit interface
5523 implementation; fixes #71449.
5525 2005-01-26 Martin Baulig <martin@ximian.com>
5527 * class.cs (TypeContainer.AttributeTargets): Return the correct
5528 AttributeTargets depending on our `Kind' instead of throwing an
5529 exception; fixes #71632.
5531 2005-01-26 Martin Baulig <martin@ximian.com>
5533 * delegate.cs (Delegate.DefineType): Correctly define our type
5534 parameters. Fixes #71483.
5536 2005-01-25 Raja R Harinath <rharinath@novell.com>
5539 * expression.cs (MemberAccess.DoResolve): Don't complain with
5540 cs0572 when the LHS of a member access has identical name and type
5543 2005-01-25 Marek Safar <marek.safar@seznam.cz>
5546 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5548 Create custom PermissionSet only for PermissionSetAttribute.
5550 2005-01-24 Marek Safar <marek.safar@seznam.cz>
5553 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5554 delegates in static class.
5556 2005-01-24 Martin Baulig <martin@ximian.com>
5558 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5559 merging an implicit block, just use its reachability.
5561 * statement.cs (Block.Resolve): Make the unreachable code check
5562 work wrt. implicit blocks; see test-337 from #63842.
5564 2005-01-21 Alp Toker <alp@atoker.com>
5566 * cs-parser.jay: destructor_declaration's container is PartialContainer
5567 not Class when partial types are used, so use Kind prop instead of
5570 2005-01-22 Miguel de Icaza <miguel@ximian.com>
5572 * cs-parser.jay: Improve error reporting when an interface
5575 2005-01-20 Dick Porter <dick@ximian.com>
5577 * support.cs: SeekableStreamReader fix from Sandor Dobos
5578 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5579 chars are read. Fixes bug 70369.
5581 2005-01-20 Raja R Harinath <rharinath@novell.com>
5583 * cs-parser.jay (catch_clause): Simplify current_block handling
5586 2005-01-17 Miguel de Icaza <miguel@ximian.com>
5588 * convert.cs (ImplicitStandardConversionExists): Synchronize the
5589 code with ImplicitStandardConversion to handle the implicit
5590 conversion of method groups into valid delegate invocations.
5592 The problem is that in parameter handling we were using this code
5593 path. Fixes bug #64698
5595 2005-01-19 Raja R Harinath <rharinath@novell.com>
5597 * cs-parser.jay: Fix several infelicities.
5598 - Avoid assigning to the parser value stack. Code like
5599 '$3 = null' is unclean. Synthesize a value for the code block
5601 - Avoid using oob_stack for storing location information. Use ...
5602 (_mark_): ... this. New (empty) rule. Saves the current location
5604 (foreach_statement): Avoid using oob_stack for current_block
5605 handling. Use technique used in for_statement and
5606 using_statement. Synthesize a value for the code block to store
5607 additional intermediate information.
5609 2005-01-13 Miguel de Icaza <miguel@ximian.com>
5611 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5612 of a different type is only allowed to private fields of a
5613 containing type, not on fields of a base class.
5615 See test-174.cs and error cs0122-9.cs
5617 2005-01-13 Raja R Harinath <rharinath@novell.com>
5619 Fix test-335.cs (bug #58126).
5620 * cs-parser.jay (argument): Split out non-expression parts of the
5621 rule into 'non_simple_argument'.
5622 (invocation_expression): Support parenthesized invocations with
5623 multiple arguments, and with single non-simple arguments.
5625 2005-01-13 Raja R Harinath <rharinath@novell.com>
5627 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5630 2005-01-12 Raja R Harinath <rharinath@novell.com>
5632 Fix cs0038-1.cs, cs1640-6.cs.
5633 * ecore.cs (Expression.Resolve): Remove special-case for
5634 SimpleName in error-handling.
5635 (Expression.almostMatchedMembers): Relax access permission to
5637 (Expression.MemberLookupFailed): Handle duplicates in
5638 almostMatchedMembers list.
5639 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5640 * expression.cs (New.DoResolve): Report CS1540 for more cases.
5641 * typemanager.cs (GetFullNameSignature): Use the MethodBase
5642 overload if the passed in MemberInfo is a MethodBase.
5644 2005-01-25 Martin Baulig <martin@ximian.com>
5647 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5649 2005-01-12 Marek Safar <marek.safar@seznam.cz>
5652 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5653 for non-CAS & merge permission sets properly.
5655 2005-01-11 Raja R Harinath <rharinath@novell.com>
5657 Improve standard-compliance of simple name and member access
5658 resolution. Fixes bugs #52697, #57200, #67520, #69519.
5659 * ecore.cs (FullNamedExpression): New abstract base class
5660 for Namespaces and TypeExpressions.
5661 (ResolveFlags.SimpleName): Remove.
5662 (SimpleName): Remove support for dotted names.
5663 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
5664 DeclSpace.FindType and DeclSpace.LookupType.
5665 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5666 (Expression.ExprClassName): Make member function.
5667 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5668 a namespace. Remove creation of dotted "SimpleName"s.
5669 (MemberAccess.DoResolve): Likewise.
5670 * decl.cs (DeclSpace.Cache): Make private.
5671 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5672 (DeclSpace.FindType): Update.
5673 (DeclSpace.LookupType): Move here from RootContext. Return a
5674 FullNamedExpression.
5675 * namespace.cs (Namespace): Derive from FullNamedExpression
5676 so that it can be part of expression resolution.
5677 (Namespace.Lookup): Return an FullNamedExpression.
5678 (NamespaceEntry.LookupAlias): Lookup aliases only in current
5680 * rootcontext.cs (NamespaceLookup): Remove.
5681 (LookupType): Move to DeclSpace.
5682 * attribute.cs (CheckAttributeType): Update.
5683 * doc.cs (FindDocumentedType): Remove allowAlias argument.
5684 (FindDocumentedTypeNonArray): Likewise.
5686 2005-01-11 Raja R Harinath <rharinath@novell.com>
5688 Fix cs0509.cs, cs1632.cs.
5689 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5690 is the same as IsInterface.
5691 (TypeContainer.GetClassBases): Likewise.
5692 * statement.cs (LabeledStatement.ig): New field.
5693 (LabeledStatement.LabelTarget): Save ILGenerator which created the
5695 (LabeledStatement.DoEmit): Check that the label was created with
5696 the same ILGenerator.
5698 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5701 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5702 accessors to its properties.
5704 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5705 from accessors to property.
5707 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5710 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5713 2005-01-08 Miguel de Icaza <miguel@ximian.com>
5715 * attribute.cs: Check for null and empty strings.
5717 I have lost another battle to Paolo.
5719 2005-01-07 Marek Safar <marek.safar@seznam.cz>
5722 * class.cs (PropertyMethod): Set Parent field in ctors.
5723 (SetMethod.InternalParameters): Add unsafe switch hack.
5724 Override MarkForDuplicationCheck where it is appropriate.
5726 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5727 It says whether container allows members with the same name.
5729 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5730 Removed is_method parameter.
5732 2005-01-06 Duncan Mak <duncan@ximian.com>
5734 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5735 because the previous change led to incorrect reporting of CS1032
5736 ("Cannot define/undefine preprocessor symbols after first token in
5737 file"). Instead of using `tokens_seen' as the only flag that
5738 triggers CS1040, introduce `comments_seen'. This new flag is used
5739 to signify having seen comments on the current line, so it is
5740 unset after a newline.
5742 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5744 * doc.cs : When searching for a type, find nested type too.
5745 This fixes bug #71040.
5747 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5750 - Warn missing member comment on those classes which also does not
5751 have doc comments. Fixed bug #71041.
5752 - Don't warn missing doc comment on default constructor.
5755 2005-01-06 Duncan Mak <duncan@ximian.com>
5757 * cs-tokenizer.cs (xtoken): After handling traditional C-style
5758 comments, set `tokens_seen' to true. This allows us to detect
5759 misplaced preprocessor directives (i.e. not at the beginning of
5760 the a line, nor after whitespaces). In that case, report error
5761 CS1040. This fixes bug #56460.
5763 * cs-parser.jay (interface_member_declaration): Add checks for
5764 IsExplicitImpl, and report CS0541 error if an interface member is
5765 defined as an explicit interface declaration.
5767 2005-01-06 Marek Safar <marek.safar@seznam.cz>
5770 * class.cs (PropertyMethod): Set Parent field in ctors.
5771 (SetMethod.InternalParameters): Add unsafe switch hack.
5773 * decl.cs (MemberCore.Parent): Cannot be readonly.
5775 2005-01-06 Raja R Harinath <rharinath@novell.com>
5777 * decl.cs (DeclSpace.ResolveType): Remove.
5778 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5779 Merge in code from ...
5780 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
5781 * class.cs, enum.cs: Update to changes.
5783 2005-01-06 Miguel de Icaza <miguel@ximian.com>
5785 * anonymous.cs: Ensure that we init the scope of our parent if it
5786 has not been initialized yet.
5788 2004-12-30 Duncan Mak <duncan@ximian.com>
5790 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5791 if field.FieldBuilder is null. Fixes #70758.
5793 * convert.cs: Fixed some typos and updated some of the comments.
5794 (ImplicitStandardConversionExists):
5795 (TryImplicitIntConversion): If `target_type' is an interface and
5796 the type of `ic' implements this interface, return true or a new
5797 BoxedCast instead of null. This fixes #70468.
5799 2004-12-29 Duncan Mak <duncan@ximian.com>
5801 * expression.cs (Argument.Emit): Check that Expr is
5802 IMemoryLocation before casting to it, and report CS1510 otherwise.
5806 2004-12-21 Ben Maurer <bmaurer@ximian.com>
5808 * statement.cs (Block.ThisVariable): remove the recursion here, to
5809 make the --profile more sane.
5811 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
5813 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5814 assembly, by JB Evain.
5816 2004-12-17 Raja R Harinath <rharinath@novell.com>
5818 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
5819 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5820 "parent" refers to enclosing type/class. "base" refers to superclass.
5822 2004-12-17 Raja R Harinath <rharinath@novell.com>
5824 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5825 Ensure that we only have GlobalAttributes.
5826 * attribute.cs (Attribute.Emit): Make non-virtual.
5827 (GlobalAttribute.Emit): Remove.
5828 (Attribute.Resolve): Make virtual.
5829 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
5830 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5831 the argument. Don't create one.
5832 (Attribute.GetObsoleteAttribute): Likewise.
5833 (Attribute.GetClsCompliantAttributeValue): Likewise.
5834 * class.cs, decl.cs: Update to changes.
5836 2004-12-17 Marek Safar <marek.safar@seznam.cz>
5838 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5840 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5842 * statement.cs (Foreach.Resolve): Add error 186 report.
5844 2004-12-16 Marek Safar <marek.safar@seznam.cz>
5846 * expression.cs (Conditional.DoResolve): Add warning 429.
5848 * statement.cs (If.Resolve): Add warning 665.
5850 2004-12-16 Raja R Harinath <rharinath@novell.com>
5852 New invariant: RootContext.Tree.Types.NamespaceEntry == null
5853 except when in the parser, and in GlobalAttribute.
5854 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5855 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5856 RootContext.Tree.Types.NamespaceEntry once work is done.
5857 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
5858 and resets RootContext.Tree.Types.NamespaceEntry.
5860 2004-12-15 Marek Safar <marek.safar@seznam.cz>
5862 * cs-parser.jay: Don't create a block for every variable.
5864 2004-12-14 Miguel de Icaza <miguel@ximian.com>
5866 * location.cs: Provide extra information.
5868 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5869 variables from the captured environment, it is the ldarg_0.
5871 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5873 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5876 * class.cs: Changed warning level for 169 to avoid developer
5877 displeasure from warning flooding. It will be changed back when they
5878 fix most of current BCL warnings.
5880 * RootContext.cs: Pushed default WarningLevel to 3.
5882 * statement.cs: Removed unused variable.
5884 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5886 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5887 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5888 Add error 502 report.
5889 (StaticClass.DefineType): Add error 441 report.
5890 (Class.AllowedModifiersProp): New virtual property as temporary
5891 extension to AllowedModifiers.
5892 (Class.DefineType): Add error 418 report. Moved ModFlags check here
5893 to share implementation with StaticClass and don't call virtual
5896 * driver.cs (MainDriver): Add error 1558 test.
5898 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5899 report. Moved error 36 test here.
5901 * statement.cs (Throw.Resolve): Add error 724 report.
5903 * typemanager.cs: Add out_attribute_type core type.
5905 2004-12-13 Marek Safar <marek.safar@seznam.cz>
5907 * class.cs (TypeContainer.VerifyClsCompliance): Add error
5909 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5911 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5914 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5916 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
5917 Add error 3023 report.
5918 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5920 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5923 2004-12-12 John Luke <john.luke@gmail.com>
5925 * driver.cs (AddArgs): take -- into account when
5926 adding arguments, fixes bug 65710
5928 2004-12-12 Martin Baulig <martin@ximian.com>
5930 * expression.cs (Unary.TryReduceNegative): Added support for
5931 SByteConstant and ByteConstant.
5932 (Unary.Reduce): Check error values from TryReduceNegative().
5934 2004-12-10 Marek Safar <marek.safar@seznam.cz>
5936 * attributes.cs (Attribute.Resolve): Avoid multiple error report
5937 and report exception as error 182.
5939 2004-12-10 Raja R Harinath <rharinath@novell.com>
5941 * driver.cs (Main): Fix message when there are warnings.
5943 2004-12-09 Miguel de Icaza <miguel@ximian.com>
5945 * delegate.cs: Fixed my fix from yesterday, sorry about that.
5947 2004-12-09 Marek Safar <marek.safar@seznam.cz>
5949 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
5950 Reduced number of warnings.
5952 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5954 2004-12-08 Miguel de Icaza <miguel@ximian.com>
5956 * driver.cs: Removed message.
5958 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5960 2004-12-08 <vargaz@freemail.hu>
5962 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5964 2004-12-08 Martin Baulig <martin@ximian.com>
5966 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5967 instead of a CS3002 for properties and indexer.
5969 2004-12-08 Martin Baulig <martin@ximian.com>
5971 * decl.cs (MemberName.ToString): Make this work again.
5973 2004-12-08 Marek Safar <marek.safar@seznam.cz>
5975 * attribute.cs (Resolve): Add error 591 detection.
5977 * class.cs (FieldMember.Define): Add error 1547 detection.
5978 (Indexer.Define): Add error 620 detection.
5979 (Operator.Define): Add error 590 detection.
5981 * ecore.cs: Missing argument for error 79.
5983 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5986 2004-12-07 Marek Safar <marek.safar@seznam.cz>
5989 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5992 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
5994 * cs-parser.jay : handle doc comments on implicit/explicit operators.
5995 Some operator comments were suppressed.
5996 * doc.cs : Implicit/explicit operator name in doc comments are like
5997 "op_Explicit(type)~returnType", so added suffix handling.
5999 2005-01-21 Alp Toker <alp@atoker.com>
6001 * cs-parser.jay: destructor_declaration's container is PartialContainer
6002 not Class when partial types are used, so use Kind prop instead of 'is'.
6004 2004-12-12 Martin Baulig <martin@ximian.com>
6006 * expression.cs (Unary.TryReduceNegative): Added support for
6007 SByteConstant and ByteConstant.
6008 (Unary.Reduce): Check error values from TryReduceNegative().
6010 2004-12-11 Martin Baulig <martin@ximian.com>
6012 * support.cs (ReflectionParameters.ParameterName): If we have a
6013 `gpd', call `ParameterName' on it.
6015 * parameter.cs (Parameter.GetParameterAttributes): New static method.
6017 * pending.cs (PendingImplementation.DefineProxy): Call
6018 DefineParameter() for all of the MethodBuilder's arguments.
6020 2004-12-09 Martin Baulig <martin@ximian.com>
6022 * doc.cs (DocUtil): Make this a static class.
6024 2004-12-09 Martin Baulig <martin@ximian.com>
6026 * expression.cs (Invocation.InferType): Moved the type inference
6027 implementation into TypeManager.
6029 * generics.cs (TypeManager): Moved the type inference
6030 implementation here.
6032 2004-12-09 Martin Baulig <martin@ximian.com>
6034 * typemanager.cs (TypeManager): Make this a partial class.
6037 (TypeManager): Move the generics part of `TypeManager' here.
6039 2004-12-08 Martin Baulig <martin@ximian.com>
6041 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6042 instead of a CS3002 for properties and indexer. Added CS3024
6043 check for generic interfaces.
6045 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6046 instances are not CLS-compliant.
6048 2004-12-08 Martin Baulig <martin@ximian.com>
6051 (void_pointer_expression): New rule for `void*', `void**' etc.
6052 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
6054 2004-12-08 Martin Baulig <martin@ximian.com>
6056 * expression.cs (Invocation.InferType): Removed the hack for
6057 MethodCore.MayUnify().
6059 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6062 * class.cs (MethodCore.MayUnify): Use
6063 TypeManager.MayBecomeEqualGenericTypes().
6065 2004-12-08 Martin Baulig <martin@ximian.com>
6067 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6068 parameter, box it. Fixes #69233.
6070 2004-12-08 Martin Baulig <martin@ximian.com>
6072 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6073 have the ctor constraint. Fixes #68326.
6075 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6077 * cs-parser.jay : interface comment was not consumed because of
6078 extra opt_semicolon before doc handling.
6080 2004-12-03 Raja R Harinath <rharinath@novell.com>
6082 Fix test-327.cs, test-328.cs, and put in early infrastructure
6083 for eventually fixing #52697.
6084 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6085 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6087 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6088 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6089 (VerifyUsing, error246): Update.
6090 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6091 'NamespaceEntry.LookupNamespaceOrType'.
6093 2004-12-07 Martin Baulig <martin@ximian.com>
6095 * driver.cs: Call it "BETA SOFTWARE" :-)
6097 2004-12-06 Raja R Harinath <rharinath@novell.com>
6099 Fix crash on cs0657-17.cs.
6100 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6101 Use RootContext.Tree.Types, not 'new RootTypes ()'.
6102 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6103 the case where the NamespaceEntry gets overwritten.
6105 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6107 Fixed #69195, #56821
6108 * ecore.cs (ResolveBoolean): Tiny refactoring.
6110 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6111 of right expression resolving when left is false constant and
6112 operator is LogicalAnd OR true constant and operator is LogicalOr.
6114 * statement.cs (ResolveUnreachable): Always reports warning.
6116 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6118 * class.cs: Distinguish between 1721 and 1722 (just a little help
6119 for the programmer).
6121 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6123 * delegate.cs: Only allow this on new versions of the language.
6125 2004-12-02 Duncan Mak <duncan@ximian.com>
6127 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6129 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6130 here as a static method. Take an additional bool out parameter
6131 `must_do_cs1540_check' for signaling to InstanceResolve.
6132 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6133 member field from PropertyExpr class and made it an argument of
6135 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6136 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6137 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6138 and `remove_accessor' as well as InstanceResolve: report CS0122
6143 2004-12-07 Martin Baulig <martin@ximian.com>
6145 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6146 and CS0692 where appropriate.
6148 2004-12-06 Martin Baulig <martin@ximian.com>
6150 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6151 IsDuplicateImplementation() and improved it.
6153 * expression.cs (Invocation.InferTypeArguments): Added
6154 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6155 and removed the "ref" modifier from `infered_types'.
6157 * decl.cs (MemberName.ToString): Removed the exception.
6159 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6161 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6162 comments are allowed.
6164 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6166 * delegate.cs: Add checks for subtypes in paramaters and return values
6167 in VerifyMethod () to add support for Covariance/Contravariance
6170 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6172 * report.cs: Remove extra closing parenthesis.
6174 * convert.cs (Error_CannotImplicitConversion): If the name of the
6175 types are the same, provide some extra information.
6177 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6180 * attribute.cs (Resolve): Improved implementation of params
6181 attribute arguments.
6183 * support.cs (ParameterData): Add HasParams to be faster.
6185 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6187 all things are for /doc support:
6189 * doc.cs: new file that supports XML documentation generation.
6190 * mcs.exe.sources: added doc.cs.
6192 Handle /doc command line option.
6193 Report error 2006 instead of 5 for missing file name for /doc.
6194 Generate XML documentation when required, after type resolution.
6196 Added support for picking up documentation (/// and /** ... */),
6197 including a new XmlCommentState enumeration.
6199 Added lines to fill Documentation element for field, constant,
6200 property, indexer, method, constructor, destructor, operator, event
6201 and class, struct, interface, delegate, enum.
6202 Added lines to warn incorrect comment.
6204 Added Documentation field (passed only when /doc was specified).
6206 Added DocComment, DocCommentHeader, GenerateDocComment() and
6207 OnGenerateDocComment() and some supporting private members for
6208 /doc feature to MemberCore.
6210 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6212 Added overriden DocCommentHeader.
6214 Added overriden DocCommentHeader and GenerateDocComment().
6216 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6218 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6219 unwrapping the enumeration values, chain to
6220 DoConstantNumericPromotions again, so we can promote things to the
6221 fundamental types (takes care of enums that are bytes, sbytes).
6225 2004-12-01 Raja R Harinath <rharinath@novell.com>
6227 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6228 Fix long-standing bug in type-lookup. Use FindType instead of
6229 LookupType when ec.ResolvingTypeTree.
6230 (Attribute.ResolveType, Attribute.Resolve)
6231 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6233 (Attributes.Search): Remove internal version. Update.
6234 (Attributes.SearchMulti): Update.
6235 (Attributes.GetClsCompliantAttribute): Remove.
6236 (Attributes.GetIndexerNameAttribute): Remove.
6237 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6238 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6239 * class.cs (Indexer.Define): Likewise.
6241 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6244 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6245 MarshallByReference members access.
6247 * expression.cs: Use CheckMarshallByRefAccess;
6248 Better error CS0197 message.
6250 * report.cs: Print whole related error message.
6252 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6254 * class (GetClassBases): Better error 60 report.
6255 (EventProperty): Disabled warning 67 detection.
6257 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6260 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6262 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6265 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6268 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6270 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6272 2004-11-26 Miguel de Icaza <miguel@ximian.com>
6274 * attribute.cs (Attribute.Resolve): Refine error reporting and
6275 report a cs0117 if the identifier does not exist, to distinguish
6276 from 0617 which is a miss-use of the actual identifier.
6278 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6279 between cs0070 and cs0079.
6281 * class.cs (MemberBase.DoDefine): When reporting a wrong
6282 accessibility level, we use MethodCore to compare instead of
6283 Method (this was a regression in some refactoring effort).
6285 So now we correctly report cs0056 again.
6287 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6288 testing the target_type (which was known to be object_type) and
6289 not the source type (which is anonymous_method).
6291 Fixed reporting of error cs1660.
6293 * expression.cs (UserCast.Source): Expose the underlying cast.
6295 * statement.cs (Switch.SwitchGoverningType): Sort the list of
6296 allowed types to find a match to int32 first (most common).
6298 In addition, it ignores any ImplicitUserConversions that did an
6299 internal implicit conversion (as the switch statement allows only
6300 one integral conversion to exist).
6302 * class.cs (PartialContainer.Create): rename `name' to
6303 `member_name' for clarity. Then replace the string calls with a
6304 call to MemberName.GetPartialName, as now using
6305 MemberName.ToString is an error (this is due to the side effects
6306 it had, that were fixed in the past).
6308 This will restore the error reporting on a number of partial class
6309 errors that were missusing this (and getting an exception as a
6310 results, which is now just a plain textual warning, because
6311 yyparse debug output would crash otherwise).
6313 2004-11-26 Raja R Harinath <rharinath@novell.com>
6315 * Makefile (PROGRAM_INSTALL_DIR): Remove.
6317 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6319 * rootcontext.cs (LookupType): Make sure to cache lookups that
6320 don't give us a negative result. This saves about 5% of corlib
6323 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6325 * report.cs (AbstractMessage.Print): messages are sent to stderr
6327 * class.cs (TypeContainer.GetClassBases): It is an error to have a
6328 non-interface in the list of interfaces (at this point, either
6329 parent was properly set, or a base class is being listed in the
6330 interfaces section).
6332 This flags error 1722, and resolves the crash from bug 69259.
6334 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6336 * statement.cs (Using.EmitExpressionFinally): make this work right
6337 for valuetypes. Fixes 69926.
6339 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6341 * const.cs (Const.ChangeType): Cope with the "0 literal can be
6342 converted to an enum" here, before we try to change the underlying
6343 type. This code exists, but it is a different code path than the
6344 one used while encoding constants.
6346 (ImplicitReferenceConversionExists): In addition, resynchronized
6347 the code here, so it matches the same code in
6348 ImplicitReferenceConversionExists for the `from any class-type S
6349 to any interface-type T'.
6351 2004-11-25 Marek Safar <marek.safar@seznam.cz>
6353 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6355 2004-11-24 Miguel de Icaza <miguel@ximian.com>
6357 * cs-parser.jay: Use verbosity accordingly.
6359 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6361 * expression.cs (Unary.ResolveOperator): Do not report warning;
6362 AddressOf reads from variable.
6364 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6366 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6370 * attribute.cs (Attributable): Removed CheckTargets.
6371 (Attributes.Emit): Explicit attribute targets are tested here.
6373 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6374 not enabled for interfaces.
6376 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6377 (GetAssemblyName): Ouch next bug there.
6379 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6381 * expression.cs: Error 275 added.
6383 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6385 Fix bug #69177 (Implemented decimal constant support)
6387 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6388 (BinaryFold): Add DecimalConstant.
6390 * const.cs (Define): Decimal constant
6392 (ChangeType): Add decimal type handling.
6393 (LookupConstantValue): Don't set value for decimal type but
6394 emit DecimalConstantAttribute. Needed for constant optimization.
6396 * constant.cs (ToDecimal): New method.
6397 (ConvertToDecimal): New method.
6398 (IntConstant): Implemented ConvertToDecimal.
6399 (DecimalConstant.Emit): Emit optimized version for decimals in
6402 * expression.cs (ResolveOperator): Changed order of constant
6403 reduction to work correctly with native types which have
6404 overloaded operators.
6405 (ResolveMemberAccess): Extract constant value from attribute
6408 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6410 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6411 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6412 (ChangeType): Decimal is special.
6413 (TypeToCoreType): Add decimal type.
6415 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6417 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6420 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6422 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6425 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6427 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6429 * pending.cs (PendingImplementation): Grab only interfaces.
6431 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6433 * statement.cs (ForeachHelperMethods): Add location member and
6434 error 202 detection.
6436 2004-11-18 Marek Safar <marek.safar@seznam.cz>
6438 * expression.cs (DoResolveBase): Fixed wrong warning for out
6441 2004-12-04 Martin Baulig <martin@ximian.com>
6443 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6444 to check whether the conversion is ok.
6446 * typemanager.cs (TypeManager.GetTypeArguments): Just return
6447 `Type.EmptyTypes' if we're not a generic TypeContainer.
6449 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6451 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6452 old bug: when converting from the null literal to a pointer,
6453 return an EmptyCast, not the NullLiteral.
6455 This fixes #69921, the recent null_type changes probably made this
6458 2004-12-03 Martin Baulig <martin@ximian.com>
6460 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6461 method as our child, call AnonymousMethod.Compatible() on it.
6463 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6465 * class.cs (FieldBase): Use an unused bit field from the field to
6466 encode the `has_offset' property from the FieldMember. This saves
6467 a couple of Ks on bootstrap compilation.
6469 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6470 method as our child, return the AnonymousMethod resolved
6473 * expression.cs (New.DoResolve): Allow return values from
6474 NewDelegate to also include AnonymousMethods.
6478 2004-11-29 Raja R Harinath <rharinath@novell.com>
6480 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6482 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6483 System.Runtime.InteropServices._Exception, since it's a base
6484 interface of the core type System.Exception in the net_2_0 profile.
6486 2004-11-27 Martin Baulig <martin@ximian.com>
6488 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6490 2004-11-26 Raja R Harinath <rharinath@novell.com>
6492 * Makefile: Convert to use executable.make.
6493 * gmcs.exe.sources: New.
6495 2004-11-25 Martin Baulig <martin@ximian.com>
6497 * expression.cs (Invocation.InferType): Added support for byref types.
6499 2004-11-25 Martin Baulig <martin@ximian.com>
6501 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6502 in TypeManager.TypeToCoreType().
6504 2004-11-25 Martin Baulig <martin@ximian.com>
6506 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6507 "Dispose" method from the `current_type'.
6508 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6509 DoDefineMembers() instead of using the MethodBuilder; this is
6510 required for generic iterators.
6512 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6514 2004-11-24 Martin Baulig <martin@ximian.com>
6516 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6518 2004-11-20 Martin Baulig <martin@ximian.com>
6520 * expression.cs (Invocation.InferType): Correctly infer generic
6521 instances; see gen-103.cs.
6522 (Invocation.InferTypeArguments): If a generic method doesn't have
6523 any unbound type parameters, we don't need to infer anything.
6525 2004-11-19 Raja R Harinath <rharinath@novell.com>
6527 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6529 2004-11-17 Raja R Harinath <rharinath@novell.com>
6531 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6532 (TypeHandle.GetMemberCache): New.
6533 (TypeHandle.TypeHandle): Update.
6534 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6535 (TypeManager.LookupParentInterfacesCache):
6536 Rename from LookupInterfaceCache. Optimize slightly.
6537 (TypeManager.MemberLookup_FindMembers): Update.
6538 * decl.cs (MemberCache.MemberCache): Set Container to null in the
6540 (AddCacheContents): Rename from AddHashtable.
6541 * class.cs (TypeContainer.parent_container): Remove.
6542 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6543 (TypeContainer.DoDefineMembers): Don't initialize it.
6544 Update to name changes.
6546 2004-11-17 Miguel de Icaza <miguel@ximian.com>
6548 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6549 that factors the code to check access modifiers on override.
6551 (PropertyBase): Use the code here.
6553 Patch from Lluis S'anchez, fixes bug #69361.
6555 2004-11-15 Miguel de Icaza <miguel@ximian.com>
6557 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6558 routine that is used to report the use of a captured variable
6559 whose address has been taken.
6561 There are two checks: one when variables are being captured and
6562 the other check is when the address of a variable is taken.
6564 (because an anonymous methods might be resolved before *or* after
6565 the address has been taken) and
6567 * expression.cs (Conditional.DoResolve): Remove the special
6568 casing that Martin added to trueExpr and falseExpr being both
6569 NullLiteral. We get the right behavior now just by introducing
6570 the null_type into the compiler.
6572 * convert.cs (ExplicitConversion): Change the code to use
6573 null_type instead of testing `expr is NullLiteral'.
6574 (ImplicitConversionStandard): use null_type too.
6575 (ImplicitReferenceConversionExists): use null_type too.
6576 (ImplicitReferenceConversion): use null_type too.
6578 * literal.cs: The type of `NullLiteral' is now null_type instead
6580 (Resolve): Set the type here.
6582 * typemanager.cs: Introduce null_type.
6584 2004-11-18 Martin Baulig <martin@ximian.com>
6587 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6589 2004-11-18 Martin Baulig <martin@ximian.com>
6591 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6593 2004-11-18 Martin Baulig <martin@ximian.com>
6595 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6596 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
6597 call ResolveConstructedType() on it to resolve it without checking
6599 (Constraints.ResolveTypes): Check them here.
6600 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6601 but don't check constraints.
6602 (ConstructedType.ResolveAsTypeTerminal): Override this and also
6603 check constraints here.
6604 (ConstructedType.ResolveConstructedType): New public method. This
6605 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6606 resolve ourselves without checking constraints.
6608 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6610 2004-11-18 Martin Baulig <martin@ximian.com>
6613 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6615 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6617 2004-11-18 Martin Baulig <martin@ximian.com>
6619 * ecore.cs (TypeExpr.ResolveType): Removed.
6620 (Expression.ResolveAsTypeTerminal): We always return a fully
6621 resolved `TypeExpr', so we can just access its `Type'.
6623 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6625 2004-11-17 Martin Baulig <martin@ximian.com>
6627 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6628 sure we don't return any unresolved TypeExpr's.
6629 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6631 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6633 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6634 unresolved `ConstructedType's.
6636 2004-11-17 Martin Baulig <martin@ximian.com>
6638 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6640 2004-11-17 Martin Baulig <martin@ximian.com>
6643 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6645 * decl.cs (DeclSpace.ResolveType): Removed.
6646 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6648 2004-11-17 Martin Baulig <martin@ximian.com>
6650 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6651 direction, like FindMembers() does. Fixes #69546, testcase is in
6654 2004-11-16 Martin Baulig <martin@ximian.com>
6656 This is based on a patch from Marek Safar, see bug #69082.
6657 Fixes bugs #63705 and #67130.
6659 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6660 method; create a MemberCache for an interface type and cache the
6663 * decl.cs (IMemberContainer.ParentContainer): Removed.
6664 (IMemberContainer.ParentCache): New property.
6665 (MemberCache.SetupCacheForInterface): Removed.
6666 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6667 to create a cache for an interface's "parent".
6669 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6672 2004-11-14 Ben Maurer <bmaurer@ximian.com>
6674 * statement.cs: Avoid adding bools to a hashtable.
6676 2004-11-15 Martin Baulig <martin@ximian.com>
6678 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6680 2004-11-11 Martin Baulig <martin@ximian.com>
6682 * typemanager.cs (TypeManager.GetMethodName): New method.
6684 * class.cs (MethodData.Define): Include the generic arity in the
6685 name of an explicit interface; also add it to the method name.
6687 * pending.cs (PendingImplementation.InterfaceMethod): The method
6688 name now includes the generic arity.
6690 2004-11-07 Miguel de Icaza <miguel@ximian.com>
6692 * expression.cs (Invocation.OverloadResolve): Flag error if we are
6693 calling an unsafe method from a safe location.
6695 2004-11-06 Marek Safar <marek.safar@seznam.cz>
6698 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6700 2004-11-06 Miguel de Icaza <miguel@ximian.com>
6702 * namespace.cs (VerifyUsing): use GetPartialName instead of
6705 2004-11-05 Miguel de Icaza <miguel@ximian.com>
6707 * statement.cs (Return.Resolve): Fix regression in typo: if
6708 `in_exc', we have to request a NeedReturnLabel, this was a typo
6709 introduced in the anonymous method check-in. Fixes #69131.
6711 * Indexers were using the ShortName when defining themselves,
6712 causing a regression in the compiler bootstrap when applying the
6713 patch from 2004-11-02 (first part), now they use their full name
6714 and the bug is gone.
6716 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
6718 * driver.cs: Strip the path from the names of embedded resources. Fixes
6721 2004-11-04 Raja R Harinath <rharinath@novell.com>
6723 Fix error message regression: cs0104-2.cs.
6724 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6725 (AliasEntry.Resolve): Update.
6726 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
6728 (RootContext.LookupType): Update.
6730 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
6732 * cs-parser.jay: Add support for handling accessor modifiers
6733 * class: Add support port accessor modifiers and error checking,
6734 define PropertyMethod.Define as virtual (not abstract anymore)
6735 * ecore.cs: Add checking for proeprties access with access modifiers
6736 * iterators.cs: Modify Accessor constructor call based in the modified
6738 2004-11-02 Ben Maurer <bmaurer@ximian.com>
6740 * expression.cs (StringConcat): Handle being called twice,
6741 as when we have a concat in a field init with more than two
6744 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6746 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6747 special case explicit implementations, we should always produce
6748 the .property or .event declaration.
6750 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6751 since it will not return correct data if people use this
6752 unresolved in the presence of using statements (see test-313).
6754 * class.cs (MethodData.Define): If we are an explicit interface
6755 implementation, set the method name to the full name of the
6756 interface plus the name of the method.
6758 Notice that using the method.MethodName.GetFullName() does not
6759 work, as it will only contain the name as declared on the source
6760 file (it can be a shorthand in the presence of using statements)
6761 and not the fully qualifed type name, for example:
6765 class D : ICloneable {
6766 object ICloneable.Clone () {
6770 Would produce a method called `ICloneable.Clone' instead of
6771 `System.ICloneable.Clone'.
6773 * namespace.cs (Alias.Resolve): Use GetPartialName.
6775 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6777 * cs-parser.jay: Add error 1055 report.
6779 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6781 * assign.cs (Assign.DoResolve): Only do the transform of
6782 assignment into a New if the types are compatible, if not, fall
6783 through and let the implicit code deal with the errors and with
6784 the necessary conversions.
6786 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6788 * cs-parser.jay: Add error 1031 report.
6790 * cs-tokenizer.cs: Add location for error 1038.
6792 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6794 * cs-parser.jay: Add error 1016 report.
6796 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6798 * cs-parser.jay: Add errors 1575,1611 report.
6800 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6802 * cs-parser.jay: Add error 1001 report.
6804 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6807 * attribute.cs (GetMarshal): Add method argument for
6808 caller identification.
6810 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6811 agument for GetMarshal and RuntimeMissingSupport.
6813 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6815 * attribute.cs (ExtractSecurityPermissionSet): Removed
6816 TypeManager.code_access_permission_type.
6818 * typemanager.cs: Removed TypeManager.code_access_permission_type.
6820 2004-10-27 Miguel de Icaza <miguel@ximian.com>
6822 * expression.cs (LocalVariableReference.DoResolveLValue): Check
6823 for obsolete use of a variable here. Fixes regression on errors
6824 cs0619-25 and cs0619-26.
6826 2004-10-27 Marek Safar <marek.safar@seznam.cz>
6828 Fix #62358, implemented security attribute encoding.
6830 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6831 Tests permitted SecurityAction for assembly or other types.
6832 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6833 data from SecurityPermissionAttribute to PermisionSet class.
6835 * class.cs (ApplyAttributeBuilder): Added special handling
6836 for System.Security.Permissions.SecurityAttribute based types.
6838 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6839 special handling for System.Security.Permissions.SecurityAttribute
6842 * enum.cs (ApplyAttributeBuilder): Added special handling
6843 for System.Security.Permissions.SecurityAttribute based types.
6845 * parameter.cs (ApplyAttributeBuilder): Added special handling
6846 for System.Security.Permissions.SecurityAttribute based types.
6848 * rootcontext.cs: Next 2 core types.
6850 * typemanager.cs (TypeManager.security_permission_attr_type):
6851 Built in type for the SecurityPermission Attribute.
6852 (code_access_permission_type): Build in type.
6854 2004-10-17 Miguel de Icaza <miguel@ximian.com>
6856 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6857 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6858 all of this information into
6859 EmitContext.EmitCapturedVariableInstance.
6861 * codegen.cs (EmitCapturedVariableInstance): move here the
6862 funcionality of emitting an ldarg.0 in the presence of a
6863 remapping. This centralizes the instance emit code.
6865 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6866 then emit a load of this: it means that we have reached the
6867 topmost ScopeInfo: the one that contains the pointer to the
6868 instance of the class hosting the anonymous method.
6870 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6871 captures to the topmost CaptureContext.
6873 2004-10-12 Miguel de Icaza <miguel@ximian.com>
6875 * expression.cs (LocalVariableReference): Move the knowledge about
6876 the iterators into codegen's EmitCapturedVariableInstance.
6878 2004-10-11 Miguel de Icaza <miguel@ximian.com>
6880 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6881 all code paths return a value from an anonymous method (it is the
6882 same as the 161 error, but for anonymous methods).
6884 2004-10-08 Miguel de Icaza <miguel@ximian.com>
6886 The introduction of anonymous methods in the compiler changed
6887 various ways of doing things in the compiler. The most
6888 significant one is the hard split between the resolution phase
6889 and the emission phases of the compiler.
6891 For instance, routines that referenced local variables no
6892 longer can safely create temporary variables during the
6893 resolution phase: they must do so from the emission phase,
6894 since the variable might have been "captured", hence access to
6895 it can not be done with the local-variable operations from the runtime.
6899 (Block.Flags): New flag `IsTopLevel' to indicate that this block
6900 is a toplevel block.
6902 (ToplevelBlock): A new kind of Block, these are the blocks that
6903 are created by the parser for all toplevel method bodies. These
6904 include methods, accessors and anonymous methods.
6906 These contain some extra information not found in regular blocks:
6907 A pointer to an optional CaptureContext (for tracking captured
6908 local variables and parameters). A pointer to the parent
6911 (Return.Resolve): Catch missmatches when returning a value from an
6912 anonymous method (error 1662).
6913 Invoke NeedReturnLabel from the Resolve phase instead of the emit
6916 (Break.Resolve): ditto.
6918 (SwitchLabel): instead of defining the labels during the
6919 resolution phase, we now turned the public ILLabel and ILLabelCode
6920 labels into methods called GetILLabelCode() and GetILLabel() that
6921 only define the label during the Emit phase.
6923 (GotoCase): Track the SwitchLabel instead of the computed label
6924 (its contained therein). Emit the code by using
6925 SwitchLabel.GetILLabelCode ().
6927 (LocalInfo.Flags.Captured): A new flag has been introduce to track
6928 whether the Local has been captured or not.
6930 (LocalInfo.IsCaptured): New property, used to tell whether the
6931 local has been captured.
6933 * anonymous.cs: Vastly updated to contain the anonymous method
6936 The main classes here are: CaptureContext which tracks any
6937 captured information for a toplevel block and ScopeInfo used to
6938 track the activation frames for various local variables.
6940 Each toplevel block has an optional capture context associated
6941 with it. When a method contains an anonymous method both the
6942 toplevel method and the anonymous method will create a capture
6943 context. When variables or parameters are captured, they are
6944 recorded on the CaptureContext that owns them, for example:
6948 MyDelegate d = delegate {
6953 Here `a' will be recorded as captured on the toplevel
6954 CapturedContext, the inner captured context will not have anything
6955 (it will only have data if local variables or parameters from it
6956 are captured in a nested anonymous method.
6958 The ScopeInfo is used to track the activation frames for local
6959 variables, for example:
6961 for (int i = 0; i < 10; i++)
6962 for (int j = 0; j < 10; j++){
6963 MyDelegate d = delegate {
6968 At runtime this captures a single captured variable `i', but it
6969 captures 10 different versions of the variable `j'. The variable
6970 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6971 recorded on a child.
6973 The toplevel ScopeInfo will also track information like the `this'
6974 pointer if instance variables were referenced (this is necessary
6975 as the anonymous method lives inside a nested class in the host
6976 type of the method).
6978 (AnonymousMethod): Expanded to track the Toplevel, implement
6979 `AnonymousMethod.Compatible' to tell whether an anonymous method
6980 can be converted to a target delegate type.
6982 The routine now also produces the anonymous method content
6984 (AnonymousDelegate): A helper class that derives from
6985 DelegateCreation, this is used to generate the code necessary to
6986 produce the delegate for the anonymous method that was created.
6988 * assign.cs: API adjustments for new changes in
6989 Convert.ImplicitStandardConversionExists.
6991 * class.cs: Adjustments to cope with the fact that now toplevel
6992 blocks are of type `ToplevelBlock'.
6994 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6995 insteda of standard blocks.
6997 Flag errors if params arguments are passed to anonymous methods.
6999 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7000 `CurrentAnonymousMethod' which points to the current Anonymous
7001 Method. The variable points to the AnonymousMethod class that
7002 holds the code being compiled. It is set in the new EmitContext
7003 created for the anonymous method.
7005 (EmitContext.Phase): Introduce a variable and an enumeration to
7006 assist in enforcing some rules about when and where we are allowed
7007 to invoke certain methods (EmitContext.NeedsReturnLabel is the
7008 only one that enfonces this right now).
7010 (EmitContext.HaveCaptureInfo): new helper method that returns
7011 whether we have a CapturedContext initialized.
7013 (EmitContext.CaptureVariable): New method used to register that a
7014 LocalInfo must be flagged for capturing.
7016 (EmitContext.CapturedParameter): New method used to register that a
7017 parameters must be flagged for capturing.
7019 (EmitContext.CapturedField): New method used to register that a
7020 field must be flagged for capturing.
7022 (EmitContext.HaveCapturedVariables,
7023 EmitContext.HaveCapturedFields): Return whether there are captured
7024 variables or fields.
7026 (EmitContext.EmitMethodHostInstance): This is used to emit the
7027 instance for the anonymous method. The instance might be null
7028 (static methods), this (for anonymous methods that capture nothing
7029 and happen to live side-by-side with the current method body) or a
7030 more complicated expression if the method has a CaptureContext.
7032 (EmitContext.EmitTopBlock): Routine that drives the emission of
7033 code: it will first resolve the top block, then emit any metadata
7034 and then emit the code. The split is done so that we can extract
7035 any anonymous methods and flag any captured variables/parameters.
7037 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7038 during this phase, the ILGenerator should not be used as labels
7039 and local variables declared here might not be accessible to any
7040 code that is part of an anonymous method.
7042 Exceptions to this include the temporary variables that are
7043 created by some statements internally for holding temporary
7046 (EmitContext.EmitMeta): New routine, in charge of emitting all the
7049 (EmitContext.TemporaryReturn): This method is typically called
7050 from the Emit phase, and its the only place where we allow the
7051 ReturnLabel to be defined other than the EmitMeta. The reason is
7052 that otherwise we would have to duplicate a lot of logic in the
7053 Resolve phases of various methods that today is on the Emit
7056 (EmitContext.NeedReturnLabel): This no longer creates the label,
7057 as the ILGenerator is not valid during the resolve phase.
7059 (EmitContext.EmitThis): Extended the knowledge in this class to
7060 work in anonymous methods in addition to iterators.
7062 (EmitContext.EmitCapturedVariableInstance): This emits whatever
7063 code is necessary on the stack to access the instance to a local
7064 variable (the variable will be accessed as a field).
7066 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7067 EmitContext.EmitAddressOfParameter): Routines to support
7068 parameters (not completed at this point).
7070 Removals: Removed RemapLocal and RemapLocalLValue. We probably
7071 will also remove the parameters.
7073 * convert.cs (Convert): Define a `ConstantEC' which points to a
7074 null. This is just to prefity some code that uses
7075 ImplicitStandardConversion code and do not have an EmitContext
7078 The idea is to flag explicitly that at that point in time, it is
7079 known that the conversion will not trigger the delegate checking
7080 code in implicit conversions (which requires a valid
7083 Everywhere: pass new EmitContext parameter since
7084 ImplicitStandardConversionExists now requires it to check for
7085 anonymous method conversions.
7087 (Convert.ImplicitStandardConversionExists): If the type of an
7088 expression is the anonymous_method_type, and the type is a
7089 delegate, we invoke the AnonymousMethod.Compatible method to check
7090 whether an implicit conversion is possible.
7092 (Convert.ImplicitConversionStandard): Only do implicit method
7093 group conversions if the language level is not ISO_1.
7095 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7096 MethodInfo for the Invoke method. used by Delegate and
7099 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7100 method conversions if the target type is a delegate.
7102 Removed extra debugging nops.
7104 (LocalVariableReference): Turn the `local_info' into a public
7107 Add `prepared' field, the same hack used for FieldExprs to cope
7108 with composed assignments, as Local variables do not necessarily
7109 operate purely on the stack as they used to: they can be captured
7112 Add `temp' for a temporary result, like fields.
7114 Refactor DoResolve and DoResolveLValue into DoResolveBase.
7116 It now copes with Local variables that are captured and emits the
7117 proper instance variable to load it from a field in the captured
7120 (ParameterReference.DoResolveBase): During the resolve phase,
7121 capture parameters if we are in an anonymous method.
7123 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7124 anonymous method, use the EmitContext helper routines to emit the
7125 parameter reference.
7127 * iterators.cs: Set RemapToProxy to true/false during the
7130 * parameters.cs (GetParameterByName): New helper method.
7132 * typemanager.cs (anonymous_method_type) a new type that
7133 represents an anonyous method. This is always an internal type,
7134 used as a fencepost to test against the anonymous-methodness of an
7137 2004-10-20 Marek Safar <marek.safar@seznam.cz>
7139 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7141 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7143 2004-11-10 Martin Baulig <martin@ximian.com>
7145 * expression.cs (Invocation.BetterFunction): If two methods have
7146 equal parameter types, but only one of them is generic, the
7147 non-generic one wins.
7148 (New.DoResolve): Don't set `is_struct' to false if we're a generic
7149 instance; just use `Type.IsValueType' to determine whether
7150 something is a struct or not.
7151 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7152 so we can be called multiple times.
7154 2004-11-10 Martin Baulig <martin@ximian.com>
7156 * generic.cs (TypeParameter.DefineConstraints): New public method.
7157 (TypeParameter.CheckAccessLevel): Override this and return true.
7158 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7159 override ResolveType() anymore.
7160 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7162 2004-11-10 Martin Baulig <martin@ximian.com>
7164 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7165 call DeclSpace.ResolveNestedType() on it.
7167 2004-11-10 Martin Baulig <martin@ximian.com>
7169 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7170 non-null, call ParameterModifier() on it.
7172 2004-11-10 Martin Baulig <martin@ximian.com>
7175 (Iterators): Added `current_type' and `this_type' fields.
7176 (Iterators.DefineIterator): Create a new EmitContext and store it
7177 in `ec'; compute `this_type'.
7179 2004-11-10 Martin Baulig <martin@ximian.com>
7182 (TypeManager.IsPrivateAccessible): New public method.
7183 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7185 2004-11-10 Martin Baulig <martin@ximian.com>
7187 * class.cs (TypeContainer.DefineType): Call
7188 TypeBuilder.DefineGenericParameters() before resolving the type
7190 (MethodData.parent_method): New protected field.
7191 (MethodData..ctor): Added `MethodInfo parent_method' argument.
7192 (MethodData.Define): Compute `parent_method'.
7195 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7196 (MemberCore.GetClsCompliantAttributeValue): Likewise.
7197 (DeclSpace.ec): New protected field; store the EmitContext here.
7198 (DeclSpace.EmitContext): New public property.
7199 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7200 (DeclSpace.ResolveNestedType): New public method.
7201 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7202 (DeclSpace.NestedAccessible): Added `Type tb' argument.
7203 (DeclSpace.FamilyAccessible): Likewise.
7204 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7205 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7208 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7211 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7212 (Enum.Emit): Don't create a new EmitContext.
7214 2004-10-18 Martin Baulig <martin@ximian.com>
7216 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7217 `Type' directly, but call ResolveType() on it.
7218 (Catch.Resolve): Likewise.
7219 (Foreach.Resolve): Likewise.
7221 2004-10-18 Martin Baulig <martin@ximian.com>
7223 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7224 `Type' directly, but call ResolveType() on it.
7225 (Probe.DoResolve): Likewise.
7226 (ArrayCreation.LookupType): Likewise.
7227 (TypeOf.DoResolve): Likewise.
7228 (SizeOf.DoResolve): Likewise.
7230 2004-10-18 Raja R Harinath <rharinath@novell.com>
7232 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7235 2004-10-17 John Luke <john.luke@gmail.com>
7237 * class.cs (Operator.GetSignatureForError): use CSharpName
7239 * parameter.cs (Parameter.GetSignatureForError): Returns
7240 correct name even if was not defined.
7242 2004-10-13 Raja R Harinath <rharinath@novell.com>
7245 * class.cs (TypeContainer.EmitContext): New property.
7246 (DefineNestedTypes): Create an emitcontext for each part.
7247 (MethodCore.DoDefineParameters): Use container's emitcontext.
7248 Pass type array to InternalParameters.
7249 (MemberBase.DoDefine): Use container's emitcontext.
7250 (FieldMember.Define): Likewise.
7251 (Event.Define): Likewise.
7252 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7253 Pass type array to InternalParameters.
7254 (SetIndexerMethod.GetParameterInfo): Likewise.
7255 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7256 * delegate.cs (Define): Pass emitcontext to
7257 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7258 array to InternalParameters.
7259 * expression.cs (ParameterReference.DoResolveBase): Pass
7260 emitcontext to GetParameterInfo.
7261 (ComposedCast.DoResolveAsTypeStep): Remove check on
7262 ec.ResolvingTypeTree.
7263 * parameter.cs (Parameter.Resolve): Change argument to
7264 EmitContext. Use ResolveAsTypeTerminal.
7265 (Parameter.GetSignature): Change argument to EmitContext.
7266 (Parameters.ComputeSignature): Likewise.
7267 (Parameters.ComputeParameterTypes): Likewise.
7268 (Parameters.GetParameterInfo): Likewise.
7269 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7270 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7271 * support.cs (InternalParameters..ctor): Remove variant that takes
7273 * typemanager.cs (system_intptr_expr): New.
7274 (InitExpressionTypes): Initialize it.
7276 2004-10-12 Chris Toshok <toshok@ximian.com>
7278 * cs-parser.jay: fix location for try_statement and catch_clause.
7280 2004-10-18 Martin Baulig <martin@ximian.com>
7282 * class.cs (FieldMember.Define): Don't access the TypeExpr's
7283 `Type' directly, but call ResolveType() on it.
7284 (MemberBase.DoDefine): Likewise.
7286 * expression.cs (New.DoResolve): Don't access the TypeExpr's
7287 `Type' directly, but call ResolveType() on it.
7288 (ComposedCast.DoResolveAsTypeStep): Likewise.
7290 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7291 `Type' directly, but call ResolveType() on it.
7293 2004-10-17 John Luke <john.luke@gmail.com>
7295 * class.cs (Operator.GetSignatureForError): use CSharpName
7297 * parameter.cs (Parameter.GetSignatureForError): Returns
7298 correct name even if was not defined.
7300 2004-10-13 Raja R Harinath <rharinath@novell.com>
7303 * class.cs (TypeContainer.EmitContext): New property.
7304 (DefineNestedTypes): Create an emitcontext for each part.
7305 (MethodCore.DoDefineParameters): Use container's emitcontext.
7306 Pass type array to InternalParameters.
7307 (MemberBase.DoDefine): Use container's emitcontext.
7308 (FieldMember.Define): Likewise.
7309 (Event.Define): Likewise.
7310 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7311 Pass type array to InternalParameters.
7312 (SetIndexerMethod.GetParameterInfo): Likewise.
7313 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7314 * delegate.cs (Define): Pass emitcontext to
7315 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7316 array to InternalParameters.
7317 * expression.cs (ParameterReference.DoResolveBase): Pass
7318 emitcontext to GetParameterInfo.
7319 (ComposedCast.DoResolveAsTypeStep): Remove check on
7320 ec.ResolvingTypeTree.
7321 * parameter.cs (Parameter.Resolve): Change argument to
7322 EmitContext. Use ResolveAsTypeTerminal.
7323 (Parameter.GetSignature): Change argument to EmitContext.
7324 (Parameters.ComputeSignature): Likewise.
7325 (Parameters.ComputeParameterTypes): Likewise.
7326 (Parameters.GetParameterInfo): Likewise.
7327 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7328 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7329 * support.cs (InternalParameters..ctor): Remove variant that takes
7331 * typemanager.cs (system_intptr_expr): New.
7332 (InitExpressionTypes): Initialize it.
7334 2004-10-12 Chris Toshok <toshok@ximian.com>
7336 * cs-parser.jay: fix location for try_statement and catch_clause.
7338 2004-10-07 Raja R Harinath <rharinath@novell.com>
7340 More DeclSpace.ResolveType avoidance.
7341 * decl.cs (MemberCore.InUnsafe): New property.
7342 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7343 with newly created EmitContext.
7344 (FieldMember.Define): Likewise.
7345 * delegate.cs (Delegate.Define): Likewise.
7346 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7347 only if normal name-lookup fails.
7348 (TypeExpr.DoResolve): Enable error-checking.
7349 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7350 (SizeOf.DoResolve): Likewise.
7351 (ComposedCast.DoResolveAsTypeStep): Likewise.
7352 (StackAlloc.DoResolve): Likewise.
7353 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7354 (Block.Unsafe): New property.
7355 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7356 (Unsafe): Set 'unsafe' flag of contained block.
7357 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7358 (Fixed.Resolve): Likewise.
7359 (Catch.Resolve): Likewise.
7360 (Using.ResolveLocalVariableDecls): Likewise.
7361 (Foreach.Resolve): Likewise.
7363 2004-10-05 John Luke <john.luke@gmail.com>
7365 * cs-parser.jay: add location to error CS0175
7367 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7369 * ecore.cs (Expression.Constantity): Add support for turning null
7372 * const.cs (Const.Define): Allow constants to be reference types
7373 as long as the value is Null.
7375 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7377 * namespace.cs (NamespaceEntry.Using): No matter which warning
7378 level is set, check if this namespace name has already been added.
7380 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7382 * expression.cs: reftype [!=]= null should always use br[true,false].
7385 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7388 * attribute.cs: Enum conversion moved to
7389 GetAttributeArgumentExpression to be applied to the all
7392 2004-10-01 Raja R Harinath <rharinath@novell.com>
7394 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7395 * class.c (TypeContainer.DefineType): Flag error if
7396 base types aren't accessible due to access permissions.
7397 * decl.cs (DeclSpace.ResolveType): Move logic to
7398 Expression.ResolveAsTypeTerminal.
7399 (DeclSpace.ResolveTypeExpr): Thin layer over
7400 Expression.ResolveAsTypeTerminal.
7401 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7402 Refactor code into NestedAccess. Use it.
7403 (DeclSpace.NestedAccess): New.
7404 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7405 argument to silence errors. Check access permissions.
7406 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7407 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7408 (Cast.DoResolve): Likewise.
7409 (New.DoResolve): Likewise.
7410 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7411 (TypeOf.DoResolve): Likewise.
7413 * expression.cs (Invocation.BetterConversion): Return the Type of
7414 the better conversion. Implement section 14.4.2.3 more faithfully.
7415 (Invocation.BetterFunction): Make boolean. Make correspondence to
7416 section 14.4.2.2 explicit.
7417 (Invocation.OverloadResolve): Update.
7418 (Invocation): Remove is_base field.
7419 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7420 (Invocation.Emit): Likewise.
7422 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7424 * cs-parser.jay: Reverted 642 warning fix.
7426 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7429 * decl.cs (FindMemberWithSameName): Indexer can have more than
7432 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7434 * expression.cs (LocalVariableReference.DoResolveLValue):
7435 Do not report warning 219 for out values.
7436 (EmptyExpression.Null): New member to avoid extra allocations.
7438 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7440 * cs-parser.jay: Fix wrong warning 642 report.
7442 * cs-tokenizer.cs (CheckNextToken): New helper;
7443 Inspect next character if is same as expected.
7445 2004-09-23 Martin Baulig <martin@ximian.com>
7447 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7448 (Convert.ImplicitReferenceConversionExists): Likewise.
7450 2004-11-09 Raja R Harinath <rharinath@novell.com>
7452 * Makefile (DISTFILES): Comment out a few missing files.
7454 2004-10-29 Raja R Harinath <rharinath@novell.com>
7456 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7457 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
7458 (gmcs.exe): Invoke bootstrap-libs.
7459 (clean-local): Clean the net_2_0_bootstrap profile too.
7460 (PROGRAM_INSTALL_DIR): New.
7461 (install-local): Use it.
7463 2004-10-13 Martin Baulig <martin@ximian.com>
7465 * generic.cs (TypeManager.InflatedConstraints): New nested class.
7466 (TypeParameter.DefineType): If we're a method type parameter and
7467 that method is overriding something, "inflate" its constraints.
7469 2004-10-12 Martin Baulig <martin@ximian.com>
7471 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7472 and have type arguments, create and resolve a ConstructedType.
7474 2004-10-12 Martin Baulig <martin@ximian.com>
7476 * decl.cs (MemberCache.FindMemberToOverride): Use
7477 TypeManager.IsEqual() to compare the parameters and Type.Equals()
7478 to compare the invocationType.
7480 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7481 When comparing two type parameters, only do the signature-only
7482 comparision for method type parameters.
7484 2004-10-11 Martin Baulig <martin@ximian.com>
7486 * report.cs: Don't make --fatal abort on warnings, we have
7487 -warnaserror for that.
7489 2004-10-11 Martin Baulig <martin@ximian.com>
7492 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7493 (TypeManager.IsEqual): Call ourself recursively instead of using
7496 2004-10-11 Martin Baulig <martin@ximian.com>
7498 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7499 on our own type parameters, not on the ones we inherit from a containing
7502 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7505 * generic.cs (TypeParameter.Define): We may only be called once.
7507 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7508 instead of TypeManager.IsEqual().
7510 2004-09-28 Martin Baulig <martin@ximian.com>
7513 (GenericConstraints.EffectiveBaseClass): New public property.
7514 (TypeParameter.GenericConstraints): New public property.
7515 (ConstructedType.CheckConstraints): Improved.
7517 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7518 (Convert.TypeParameterConversion): New private method; use this in
7519 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7520 for all conversions related to type parameters.
7522 2004-09-24 Martin Baulig <martin@ximian.com>
7524 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7525 type parameter conversions for type parameters which are known to
7528 2004-09-24 Martin Baulig <martin@ximian.com>
7530 * generic.cs (GenericConstraints): Added `IsReferenceType' and
7531 `IsValueType' properties.
7533 * support.cs (ReflectionConstraints): Use
7534 Type.GetGenericParameterConstraints() instead of the old hack.
7536 2004-09-24 Martin Baulig <martin@ximian.com>
7538 * generic.cs (GenericConstraints): Moved here and made it an
7541 * support.cs (GenericConstraints): Moved to generic.cs.
7543 2004-09-24 Martin Baulig <martin@ximian.com>
7546 (ReflectionConstraints): Un-nested this class and made it public.
7549 (TypeManager.GetTypeParameterConstraints): New public method.
7550 (TypeManager.HasConstructorConstraint): Use the attributes.
7552 2004-09-24 Martin Baulig <martin@ximian.com>
7554 * support.cs (GenericConstraints): Replaced `HasConstructor',
7555 `IsReferenceType' and `IsValueType' with `Attributes'.
7556 (ReflectionParameters.ReflectionConstraints): Removed the Create()
7557 method and made the .ctor public.
7559 * generic.cs (Constraints.Attributes): New public property.
7560 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7561 `IsReferenceType' -> `HasReferenceTypeConstraint' and
7562 `IsValueType' -> `HasValueTypeConstraint'.
7564 2004-09-23 Martin Baulig <martin@ximian.com>
7566 * generic.cs (Constraints): Reflect latest runtime changes.
7568 2004-09-23 Martin Baulig <martin@ximian.com>
7570 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7571 (Convert.ImplicitReferenceConversionExists): Likewise.
7573 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7575 * class.cs (Operator.Define): Add error 448 and 559 report.
7577 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7579 * class.cs (MemberBase.IsTypePermitted): New protected
7580 method for checking error CS0610.
7582 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7584 * class.cs (TypeContainer.HasExplicitLayout): New property
7585 Returns whether container has StructLayout attribute set Explicit.
7586 (FieldMember): New abstract class for consts and fields.
7587 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7588 (Field): Reuse FieldMember.
7590 * const.cs (Const): Reuse FieldMember.
7592 * rootcontext.cs: EmitConstants call moved to class.
7594 2004-09-22 Martin Baulig <martin@ximian.com>
7596 Marek and me just fixed one of our oldest bugs: #28562 :-)
7598 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7600 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7601 we're an EnumConstant, just return that.
7602 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7603 an EnumConstant. In this case, we need to use GetValueAsEnumType()
7604 to get the value which'll actually be written into the attribute.
7605 However, we have to use GetValue() to access the attribute's value
7608 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7610 * constant.cs (Constant.IsNegative): New abstract property
7613 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7614 (StackAlloc.DoResolve): Reused IsNegative.
7616 2004-09-22 Martin Baulig <martin@ximian.com>
7618 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7619 public method; like LookupTypeContainer, but also works for
7622 * report.cs (Report.SymbolRelatedToPreviousError): Use
7623 TypeManager.LookupGenericTypeContainer().
7625 2004-09-22 Martin Baulig <martin@ximian.com>
7627 Thanks to Peter Sestoft for this bug report.
7629 * expression.cs (Conditional): If both the `trueExpr' and the
7630 `falseExpr' is a NullLiteral, return a NullLiteral.
7632 2004-09-22 Martin Baulig <martin@ximian.com>
7634 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7635 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7636 for the "get_Current" call.
7638 2004-09-21 Martin Baulig <martin@ximian.com>
7640 * convert.cs (Convert.ImplicitReferenceConversion): When
7641 converting to an interface type, first check whether we're
7642 converting from a reference type.
7644 2004-09-14 Martin Baulig <martin@ximian.com>
7646 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7648 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7651 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7652 called and is obsolete then this member suppress message
7653 when call is inside next [Obsolete] method or type.
7655 * expression.cs: Use TestObsoleteMethodUsage member.
7657 2004-09-14 Martin Baulig <martin@ximian.com>
7659 * genericparser.cs: Removed.
7661 2004-09-13 Marek Safar <marek.safar@seznam.cz>
7663 * class.cs (MethodCore.CheckBase): Fix bug #65757.
7665 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7667 * attribute.cs (Attribute.Resolve): Add error 653 report.
7669 * class.cs (Class.ApplyAttributeBuilder): Add error 641
7671 (Method.ApplyAttributeBuilder): Add error 685 report.
7672 (Operator.Define): Add error 564 report.
7674 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7676 * expression.cs (Invocation.DoResolve): Add error
7679 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7682 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7684 * class.cs (ConstructorInitializer.Resolve):
7685 Wrong error number (515->516).
7687 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7689 * class.cs (Indexer.Define): Add error 631 report.
7691 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7693 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7695 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7697 * expression.cs (Probe.DoResolve): Add error CS0241 report.
7699 2004-09-10 Marek Safar <marek.safar@seznam.cz>
7701 * cs-parser.jay: Added error CS0241 report.
7703 2004-09-10 Raja R Harinath <rharinath@novell.com>
7705 * cs-parser.jay (fixed_statement): Introduce a scope for the
7706 declaration in the 'fixed' statement.
7708 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7710 * cs-parser.jay: Added CS0230 error report.
7712 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7714 * cs-parser.jay: Added errors CS0231 and CS0257 report.
7716 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7718 * expression.cs (Argument.Resolve): Added error CS0192 and
7721 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7723 C# 2.0 #pragma warning feature
7725 * cs-tokenizer.cs (PreProcessPragma): New method;
7726 Handles #pragma directive.
7728 * report.cs (WarningRegions): New class; Support
7729 class for #pragma warning directive. It tests whether
7730 warning is enabled for a given line.
7732 2004-09-08 Miguel de Icaza <miguel@ximian.com>
7734 * const.cs: Add more descriptive error report, tahnks to
7737 2004-09-08 Marek Safar <marek.safar@seznam.cz>
7739 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7741 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7743 * expression.cs: Apply patch from Ben: Remove dead code from
7744 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7745 as that code just threw an exception anwyays.
7747 * const.cs: Remove the call to the turnintoconstant, for details
7750 * literal.cs: The type of the null-literal is the null type; So
7751 we use a placeholder type (literal.cs:System.Null, defined here)
7754 * expression.cs (Conditional.DoResolve): Remove some old code that
7755 is no longer needed, conversions have been fixed.
7757 (ArrayCreationExpression.DoResolve): Return false if we fail to
7758 resolve the inner expression.
7760 2004-09-07 Raja R Harinath <rharinath@novell.com>
7763 * cs-parser.jay (delegate_declaration): Record a delegate
7764 declaration as a type declaration.
7765 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7767 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7769 * parameter.cs: Do not crash if the type can not be resolved.
7771 * expression.cs: Report errors with unsafe pointers, fixes #64896
7773 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7775 * expression.cs: Pointer arith always needs to do a conv.i
7776 if the operand is a long. fix 65320
7778 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7780 Fixed cs0619-37.cs, cs0619-38.cs
7782 * enum.cs (GetObsoleteAttribute): Removed.
7784 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7785 on Enum member is double staged. The first is tested member
7788 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7790 Fixed #56986, #63631, #65231
7792 * class.cs: (TypeContainer.AddToMemberContainer): New method,
7793 adds member to name container.
7794 (TypeContainer.AddToTypeContainer): New method, adds type to
7796 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7797 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7798 AddOperator): Simplified by reusing AddToMemberContainer.
7799 (TypeContainer.UserDefinedStaticConstructor): Changed to property
7801 (Method.CheckForDuplications): Fixed implementation to test all
7803 (MemberBase): Detection whether member is explicit interface
7804 implementation is now in constructor.
7805 (MemberBase.UpdateMemberName): Handles IndexerName.
7806 (Accessor): Changed to keep also location information.
7807 (AbstractPropertyEventMethod): Is derived from MemberCore.
7808 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7809 will be emited or not.
7810 (PropertyBase.AreAccessorsDuplicateImplementation):
7811 Tests whether accessors are not in collision with some method.
7812 (Operator): Is derived from MethodCore to simplify common
7815 * decl.cs (Flags.TestMethodDuplication): Test for duplication
7817 (DeclSpace.AddToContainer): Adds the member to defined_names
7818 table. It tests for duplications and enclosing name conflicts.
7820 * enum.cs (EnumMember): Clean up to reuse the base structures
7822 2004-09-03 Martin Baulig <martin@ximian.com>
7824 Merged latest changes into gmcs. Please keep this comment in
7825 here, it makes it easier for me to see what changed in MCS since
7826 the last time I merged.
7828 2004-09-03 Martin Baulig <martin@ximian.com>
7830 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7831 into TypeContainer, to make partial classes work again.
7833 2004-09-03 Martin Baulig <martin@ximian.com>
7835 * rootcontext.cs (RootContext.V2): Removed.
7837 2004-03-23 Martin Baulig <martin@ximian.com>
7839 * expression.cs (Invocation.OverloadResolve): Added `bool
7840 may_fail' argument and use it instead of the Location.IsNull() hack.
7842 2004-09-09 Martin Baulig <martin@ximian.com>
7844 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
7846 2004-09-09 Martin Baulig <martin@ximian.com>
7848 * generic.cs (TypeParameter.DefineType): Added support for
7849 explicit interface methods.
7851 2004-09-09 Martin Baulig <martin@ximian.com>
7853 * README.Changes: New document. Started to list important changes
7854 between MCS and GMCS here.
7856 2004-09-08 Martin Baulig <martin@ximian.com>
7859 (TypeContainer.CheckRecursiveDefinition): New protected method.
7860 (TypeContainer.DefineType): Move the CS0146 check into
7861 CheckRecursiveDefinition().
7863 2004-09-06 Martin Baulig <martin@ximian.com>
7865 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
7866 types for the constructor constraint.
7868 2004-09-03 Martin Baulig <martin@ximian.com>
7870 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7871 into TypeContainer, to make partial classes work again.
7873 2004-09-03 Martin Baulig <martin@ximian.com>
7875 * rootcontext.cs (RootContext.V2): Removed.
7877 2004-03-23 Martin Baulig <martin@ximian.com>
7879 * expression.cs (Invocation.OverloadResolve): Added `bool
7880 may_fail' argument and use it instead of the Location.IsNull() hack.
7882 2004-09-03 Martin Baulig <martin@ximian.com>
7884 Merged latest changes into gmcs. Please keep this comment in
7885 here, it makes it easier for me to see what changed in MCS since
7886 the last time I merged.
7888 2004-09-03 Raja R Harinath <rharinath@novell.com>
7891 * expression.cs (BetterConversion): Don't allow either conversion
7892 to be null. Remove redundant implicit conversion test when 'q ==
7893 null' -- when this function is invoked, we already know that the
7894 implicit conversion exists.
7895 (BetterFunction): Assume that 'best' is non-null. Remove
7896 redundant reimplementation of IsApplicable when 'best' is null.
7897 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7898 number of arguments.
7899 (IsAncestralType): Extract from OverloadResolve.
7900 (OverloadResolve): Make robust to the MethodGroupExpr being
7901 unsorted. Implement all the logic of Section 14.5.5.1, and
7902 support overloading of methods from multiple applicable types.
7903 Clean up logic somewhat. Don't pass null methods to BetterFunction.
7905 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7906 (RealError, Warning): Append type of report to related symbol.
7908 2004-09-03 Marek Safar <marek.safar@seznam.cz>
7910 * enum.cs: Fixed CLS-Compliance checks for enum members.
7911 Error tests cs3008-8.cs, cs3014-8.cs
7913 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7915 Fixed bug #62342, #63102
7916 * class.cs: ImplementIndexer uses member.IsExplicitImpl
7917 like ImplementMethod.
7919 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7921 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7924 2004-09-02 Martin Baulig <martin@ximian.com>
7926 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7927 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7930 2004-09-01 Marek Safar <marek.safar@seznam.cz>
7932 C# 2.0 Static classes implemented
7934 * class.cs (TypeContainer): instance_constructors,
7935 initialized_fields, initialized_static_fields,
7936 default_constructor, base_inteface_types are protected to be
7937 accessible from StaticClass.
7938 (TypeContainer.DefineDefaultConstructor): New virtual method
7939 for custom default constructor generating
7940 (StaticClass): New class to handle "Static classes" feature.
7942 * cs-parser.jay: Handle static keyword on class like instance
7945 * driver.cs: Added "/langversion" command line switch with two
7946 options (iso-1, default).
7948 2004-08-31 Marek Safar <marek.safar@seznam.cz>
7950 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7952 2004-08-31 Miguel de Icaza <miguel@ximian.com>
7954 * delegate.cs: Style.
7956 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
7958 * delegate.cs: Add seperate instance expr field for miguel.
7960 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7962 * PointerArithmetic (Resolve): make sure we are not doing
7963 pointer arith on void*. Also, make sure we are resolved
7964 by not setting eclass until resolve.
7966 All callers: Make sure that PointerArithmetic gets resolved.
7968 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7970 * ArrayCreation (LookupType): If the type does not resolve
7971 to an array, give an error.
7973 2004-08-27 Marek Safar <marek.safar@seznam.cz>
7975 * statement.cs (Try.Resolve): Fixed bug #64222
7977 2004-08-27 Martin Baulig <martin@ximian.com>
7980 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7983 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7985 * ecore.cs (Constantify): Get underlying type via
7986 System.Enum.GetUnderlyingType to avoid StackOverflow on the
7987 Windows in special cases.
7989 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7991 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7992 for obtaining also private methods.
7993 (GetRemoveMethod): Used GetRemoveMethod (true)
7994 for obtaining also private methods.
7996 2004-09-02 Martin Baulig <martin@ximian.com>
7998 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7999 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8002 2004-08-27 Martin Baulig <martin@ximian.com>
8005 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8008 2004-08-25 Martin Baulig <martin@ximian.com>
8010 * support.cs (ReflectionParameters..ctor): If this is a generic
8011 method, retrieve and store its type parameters.
8012 (InternalParameters..ctor): Added `TypeParameter[]' argument.
8013 (ReflectionParameters.GenericConstraints): The argument specifies
8014 the type parameter, not the method parameter.
8015 (InternalParameters.GenericConstraints): Likewise.
8017 * generic.cs (TypeParameter.DefineType): Correctly handle
8018 constraints wrt. generic methods in interfaces and their
8021 2004-08-24 Martin Baulig <martin@ximian.com>
8023 * generic.cs (TypeParameter.IsSubclassOf): New public method.
8024 (Constraints.IsSubclassOf): New internal method.
8026 * typemanager.cs (TypeManager.FindMembers): Added special support
8027 for GenericTypeParameterBuilder's.
8028 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8031 2004-08-24 Martin Baulig <martin@ximian.com>
8034 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8035 this for accessibility checks.
8036 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8037 IsNestedFamilyAccessible.
8038 (TypeManager.IsSubclassOf): New method, do what the name actually
8041 2004-08-24 Martin Baulig <martin@ximian.com>
8043 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8044 as a SimpleName, include the generic arity.
8046 2004-08-24 Martin Baulig <martin@ximian.com>
8048 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8049 MethodAttributes.HideBySig for operators.
8051 2004-08-23 Martin Baulig <martin@ximian.com>
8053 Back to the old error reporting system :-)
8055 * report.cs (Message): Removed.
8056 (Report.MessageData, ErrorData, WarningData): Removed.
8057 (Report.Error, Warning): Back to the old system.
8059 2004-08-23 Martin Baulig <martin@ximian.com>
8061 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8063 * class.cs (TypeContainer.ParentContainer): New public virtual
8064 method; replaces the explicit interface implementation.
8065 (ClassPart.ParentContainer): Override.
8067 2004-08-23 Martin Baulig <martin@ximian.com>
8069 * statement.cs (Switch): Added support for constant switches; see
8070 #59428 or test-285.cs.
8072 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8075 * statement.cs (GetEnumeratorFilter): Removed useless
8076 logic because C# specs is strict. GetEnumerator must be
8079 2004-08-22 Martin Baulig <martin@ximian.com>
8081 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8082 a switch and may break, reset the barrier. Fixes #59867.
8084 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8086 CLS-Compliance speed up (~5% for corlib)
8088 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8089 New method. Tests container for CLS-Compliant names
8091 * class.cs (TypeContainer.VerifyClsName): New method.
8092 Checks whether container name is CLS Compliant.
8093 (Constructor): Implements IMethodData.
8095 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8096 low-case table for CLS Compliance test.
8097 (MemberCache.VerifyClsParameterConflict): New method.
8098 Checks method parameters for CS3006 error.
8100 * enum.cs (EnumMember): Is derived from MemberCore.
8101 (Enum.VerifyClsName): Optimized for better performance.
8103 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8105 * report.cs: Renamed Error_T to Error and changed all
8108 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8110 * class.cs (TypeContainer.IndexerArrayList): New inner class
8111 container for indexers.
8112 (TypeContainer.DefaultIndexerName): New constant for default
8113 indexer name. Replaced all "Item" with this constant.
8114 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8116 * typemanager.cs (TypeManager.default_member_ctor): Cache here
8117 DefaultMemberAttribute constructor.
8119 2004-08-05 Martin Baulig <martin@ximian.com>
8121 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8124 2004-08-05 Marek Safar <marek.safar@seznam.cz>
8126 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8127 multi platforms problem.
8129 * compiler.csproj: Included shared files.
8131 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8133 Fix bug 60333, 55971 in the more general way
8134 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8135 Added arg_type argument for constant conversion.
8136 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8138 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8141 * class.cs (TypeContainer ): New inner classes MethodArrayList,
8142 OperatorArrayList, MethodCoreArrayList for typecontainer
8143 containers. Changed class member types to these new types.
8144 (MethodArrayList.DefineMembers): Added test for CS0659.
8146 2004-08-04 Miguel de Icaza <miguel@ximian.com>
8148 * cfold.cs: Synchronize the folding with the code in expression.cs
8149 Binary.DoNumericPromotions for uint operands.
8151 * attribute.cs: Revert patch from Raja, it introduced a regression
8152 while building Blam-1.2.1 (hard to isolate a test case).
8154 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8158 (TypeContainer.Define): Renamed to DefineContainerMembers because of
8160 (MethodCore.parent_method): New member. The method we're overriding
8161 if this is an override method.
8162 (MethodCore.CheckBase): Moved from Method class and made common.
8163 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8165 (MethodCore.CheckForDuplications): New abstract method. For custom
8166 member duplication search in a container
8167 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8168 method and its return type.
8169 (Event.conflict_symbol): New member. Symbol with same name in the
8173 (MemberCache.FindMemberWithSameName): New method. The method
8174 is looking for conflict with inherited symbols.
8176 2004-08-04 Martin Baulig <martin@ximian.com>
8178 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8180 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8182 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8184 * report.cs (Message): New enum for better error, warning reference in
8186 (MessageData): New inner abstract class. It generally handles printing of
8187 error and warning messages.
8188 Removed unused Error, Warning, Message methods.
8190 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8192 Fix for cs0592-8.cs test
8194 (Attributable.ValidAttributeTargets): Made public.
8195 (Attribute.ExplicitTarget): New member for explicit target value.
8196 (Attribute.CheckTargets): Now we translate explicit attribute
8197 target to Target here.
8199 2004-08-03 Ben Maurer <bmaurer@ximian.com>
8201 * ecore.cs (MethodGroupExpr): new IsBase property.
8203 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8205 * delegate.cs (DelegateCreation): store a MethodGroupExpr
8206 rather than an instance expr.
8208 (DelegateCreation.Emit): Use the method group rather than
8209 the instance expression. Also, if you have base.Foo as the
8210 method for a delegate, make sure to emit ldftn, not ldftnvirt.
8212 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
8214 (NewDelegate.DoResolve): Only check for the existance of Invoke
8215 if the method is going to be needed. Use MethodGroupExpr.
8217 (NewDelegate.Emit): Remove, DelegateCreation implements this.
8219 * expression.cs: For pointer arith., make sure to use
8220 the size of the type, not the size of the pointer to
8223 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8226 * class.cs (Class): Added error CS0502 test.
8228 2004-08-03 John Luke <jluke@cfl.rr.com>
8229 Raja R Harinath <rharinath@novell.com>
8232 * attribute.cs (Attribute.complained_before): New flag.
8233 (Attribute.ResolveType, Attribute.Resolve),
8234 (Attribute.DefinePInvokeMethod): Set it.
8235 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8237 2004-08-03 Martin Baulig <martin@ximian.com>
8239 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8240 use a user-defined operator; we still need to do numeric
8241 promotions in case one argument is a builtin type and the other
8242 one has an implicit conversion to that type. Fixes #62322.
8244 2004-08-18 Martin Baulig <martin@ximian.com>
8246 * class.cs (Method.Define): Use the correct method name when
8247 creating the MethodBuilder for a generic method.
8249 2004-08-17 Martin Baulig <martin@ximian.com>
8251 * generic.cs (Constraints): Support type parameter constraints.
8253 2004-08-16 Martin Baulig <martin@ximian.com>
8255 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8256 (Token.GENERIC_DIMENSION): New token; this is returned if we
8257 encounter an unbound generic type in a typeof() expression.
8259 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8260 this token is only generated while parsing a typeof() expression.
8261 (typeof_expression): Removed the old unbound_type hack.
8263 * generic.cs (TypeArguments.IsUnbound): New public property.
8265 * decl.cs (MemberName): Added support for unbound types.
8267 2004-08-14 Martin Baulig <martin@ximian.com>
8270 (TypeManager.IsEqualGenericInstance): New static method.
8271 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8272 just used to check accessibility, so follow the rules of 26.1.6.
8274 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8275 ConstructedType instead of a TypeExpression if we have type arguments.
8277 * cs-parser.jay (typeof_expression): Support unbound generic types.
8279 * ecore.cs (UnboundTypeExpression): New public class.
8281 2004-08-12 Martin Baulig <martin@ximian.com>
8283 * typemanager.cs (TypeManager.IsNestedChildOf): Use
8284 TypeManager.IsEqual() rather than `=='.
8286 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8287 generic instances as well.
8289 2004-08-12 Martin Baulig <martin@ximian.com>
8291 * expression.cs (Invocation.InferType): We can only infer method
8292 type parameters. Fixes #62647.
8294 2004-08-11 Martin Baulig <martin@ximian.com>
8296 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8297 before resolving the base classes.
8299 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8301 * Makefile: install .mdb file too.
8303 2004-08-05 Martin Baulig <martin@ximian.com>
8305 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8306 initializer, the current type is just the TypeBuilder, not the
8307 instantiated generic type.
8308 (FieldExpr.IsFieldInitializer): New public property.
8310 2004-08-04 Martin Baulig <martin@ximian.com>
8312 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8314 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8316 2004-08-03 Martin Baulig <martin@ximian.com>
8318 * class.cs (MethodData.Define): If we're an explicit
8319 implementation, remove the generic arity from the type name.
8321 2004-08-03 Martin Baulig <martin@ximian.com>
8323 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8324 use a user-defined operator; we still need to do numeric
8325 promotions in case one argument is a builtin type and the other
8326 one has an implicit conversion to that type. Fixes #62322.
8328 2004-08-02 Martin Baulig <martin@ximian.com>
8330 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8332 (TypeContainer.GetClassBases): Return the unexpanded list of
8333 interfaces; we expand them later.
8334 (TypeContainer.DefineType): After creating the TypeBuilder, call
8335 TypeManager.ExpandInterfaces() to get an expanded and resolved
8338 * ecore.cs (TypeExpr.GetInterfaces): Removed
8340 * generics.cs (Constraints.InterfaceConstraints): Remove.
8341 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8342 register the interface constraints.
8345 (TypeManager.AddUserType): Removed the `ifaces' argument.
8346 (TypeManager.AddTypeParameter): Likewise.
8347 (TypeManager.AddUserInterface): Removed, was unused.
8348 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8349 `TypeExpr[]' array for the interfaces.
8350 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8351 has been defined, returns a list of the resolved interfaces types.
8352 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8353 (TypeManager.GetExplicitInterfaces): Likewise.
8355 2004-08-02 Martin Baulig <martin@ximian.com>
8357 * expression.cs (Invocation.EmitCall): If we're invoking a method
8358 on a type parameter, use the new `Constrained' prefix opcode.
8360 2004-08-02 Martin Baulig <martin@ximian.com>
8362 * statement.cs (LocalInfo.Flags): Added `IsThis'.
8363 (LocalInfo.IsThis): New public property.
8364 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8366 2004-08-01 Martin Baulig <martin@ximian.com>
8368 * class.cs (TypeContainer.GetClassBases): Don't set the default
8369 here since we may get called from GetPartialBases().
8370 (TypeContainer.DefineType): If GetClassBases() didn't return a
8371 parent, use the default one.
8373 2004-07-30 Martin Baulig <martin@ximian.com>
8375 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8377 * class.cs (SourceMethod): New public class, derive from the
8378 symbol writer's ISourceMethod.
8379 (Method): Use the new symbol writer API.
8381 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8382 as argument and use the new symbol writer.
8385 (SourceFile): Implement the symbol writer's ISourceFile.
8386 (Location.SymbolDocument): Removed.
8387 (Location.SourceFile): New public property.
8389 * symbolwriter.cs: Use the new symbol writer API.
8391 2004-07-30 Raja R Harinath <rharinath@novell.com>
8393 * Makefile (install-local): Remove. Functionality moved to
8396 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8398 * Makefile: Install mcs.exe.config file together with mcs.exe.
8399 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8400 correct runtime version.
8402 2004-07-25 Martin Baulig <martin@ximian.com>
8405 (TypeContainer.RegisterOrder): Removed, this was unused.
8406 (TypeContainer, interface_order): Removed.
8407 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8408 TypeContainer as argument since we can also be called with a
8409 `PartialContainer' for a partial class/struct/interface.
8410 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8411 of checking whether we're an `Interface' - we could be a
8413 (PartialContainer.Register): Override; call
8414 AddClass()/AddStruct()/AddInterface() on our parent.
8416 * cs-parser.jay (interface_member_declaration): Add things to the
8417 `current_container', not the `current_class'.
8419 * rootcontext.cs (RegisterOrder): The overloaded version which
8420 takes an `Interface' was unused, removed.
8422 * typemanager.cs (TypeManager.LookupInterface): Return a
8423 `TypeContainer', not an `Interface'.
8424 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8425 contain a `PartialContainer' for an interface, so check it's
8426 `Kind' to figure out what it is.
8428 2004-07-25 Martin Baulig <martin@ximian.com>
8430 * class.cs (Class.DefaultTypeAttributes): New public constant.
8431 (Struct.DefaultTypeAttributes): Likewise.
8432 (Interface.DefaultTypeAttributes): Likewise.
8433 (PartialContainer.TypeAttr): Override this and add the
8434 DefaultTypeAttributes.
8436 2004-07-25 Martin Baulig <martin@ximian.com>
8438 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8439 we can just use the `Parent' field instead.
8441 2004-07-25 Martin Baulig <martin@ximian.com>
8443 * class.cs (TypeContainer.Emit): Renamed to EmitType().
8445 2004-07-25 Martin Baulig <martin@ximian.com>
8447 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8448 our parts before defining any methods.
8449 (TypeContainer.VerifyImplements): Make this virtual.
8450 (ClassPart.VerifyImplements): Override and call VerifyImplements()
8451 on our PartialContainer.
8453 2004-07-25 Martin Baulig <martin@ximian.com>
8455 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8457 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8458 argument, we can just use the `Parent' field instead.
8461 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
8462 (MemberBase.DoDefine): Likewise.
8464 2004-07-24 Martin Baulig <martin@ximian.com>
8466 * decl.cs (MemberCore.Parent): New public field.
8467 (DeclSpace.Parent): Moved to MemberCore.
8469 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8470 (MemberBase.ctor): Added TypeContainer argument, pass it to our
8472 (FieldBase, Field, Operator): Likewise.
8473 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8474 (EventField, Event): Likewise.
8476 2004-07-23 Martin Baulig <martin@ximian.com>
8478 * class.cs (PartialContainer): New public class.
8479 (ClassPart): New public class.
8480 (TypeContainer): Added support for partial classes.
8481 (TypeContainer.GetClassBases): Splitted some of the functionality
8482 out into GetNormalBases() and GetPartialBases().
8484 * cs-tokenizer.cs (Token.PARTIAL): New token.
8485 (Tokenizer.consume_identifier): Added some hacks to recognize
8486 `partial', but only if it's immediately followed by `class',
8487 `struct' or `interface'.
8489 * cs-parser.jay: Added support for partial clases.
8491 2004-07-23 Martin Baulig <martin@ximian.com>
8493 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8494 a `DeclSpace' and also made it readonly.
8495 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8496 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8497 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8499 * cs-parser.jay: Pass the `current_class', not the
8500 `current_container' (at the moment, this is still the same thing)
8501 to a new Method, Property, Event, Indexer or Constructor.
8503 2004-07-23 Martin Baulig <martin@ximian.com>
8505 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8506 and removed the `current_interface' one.
8507 (struct_declaration, class_declaration, interface_declaration):
8508 Set `current_class' to the newly created class/struct/interface;
8509 set their `Bases' and call Register() before parsing their body.
8511 2004-07-23 Martin Baulig <martin@ximian.com>
8513 * class.cs (Kind): New public enum.
8514 (TypeContainer): Made this class abstract.
8515 (TypeContainer.Kind): New public readonly field.
8516 (TypeContainer.CheckDef): New public method; moved here from
8518 (TypeContainer.Register): New public abstract method.
8519 (TypeContainer.GetPendingImplementations): New public abstract
8521 (TypeContainer.GetClassBases): Removed the `is_class' and
8522 `is_iface' parameters.
8523 (TypeContainer.DefineNestedTypes): Formerly known as
8525 (ClassOrStruct): Made this class abstract.
8527 * tree.cs (RootTypes): New public type.
8529 2004-07-20 Martin Baulig <martin@ximian.com>
8531 * tree.cs (Tree.RecordNamespace): Removed.
8532 (Tree.Namespaces): Removed.
8534 * rootcontext.cs (RootContext.IsNamespace): Removed.
8536 * cs-parser.jay (namespace_declaration): Just create a new
8537 NamespaceEntry here.
8539 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
8541 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8542 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8543 entry to make sure it runs in the correct runtime version.
8545 2004-07-18 Martin Baulig <martin@ximian.com>
8547 * generic.cs (ConstructedType.CheckConstraints): Improved
8548 constraints checking.
8550 2004-07-18 Martin Baulig <martin@ximian.com>
8552 * expression.cs (Invocation.BetterMethod): Call
8553 TypeManager.TypeToCoreType() on all types and removed my previous
8554 hack; we're already doig the right thing here.
8556 2004-07-17 Martin Baulig <martin@ximian.com>
8558 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8560 2004-07-16 Martin Baulig <martin@ximian.com>
8562 * iterators.cs: Added generics support.
8564 2004-07-16 Martin Baulig <martin@ximian.com>
8566 * iterators.cs: Rewrote this. We're now using one single Proxy
8567 class for both the IEnumerable and the IEnumerator interface and
8568 `Iterator' derives from Class so we can use the high-level API.
8570 * class.cs (TypeContainer.AddIterator): New method.
8571 (TypeContainer.DoDefineType): New protected virtual method, which
8572 is called from DefineType().
8573 (TypeContainer.DoDefineMembers): Call DefineType() and
8574 DefineMembers() on all our iterators.
8575 (TypeContainer.Emit): Call Emit() on all our iterators.
8576 (TypeContainer.CloseType): Call CloseType() on all our iterators.
8578 * codegen.cs (EmitContext.CurrentIterator): New public field.
8580 2004-07-15 Martin Baulig <martin@ximian.com>
8583 (TypeManager.not_supported_exception_type): New type.
8585 2004-07-14 Martin Baulig <martin@ximian.com>
8588 (TypeManager.generic_ienumerable_type): New type.
8589 (TypeManager.generic_ienumerator_type): New type.
8592 (RootContext.interfaces_first_stage): Added
8593 "System.Collections.Generic.IEnumerator`1" and
8594 "System.Collections.Generic.IEnumerable`1".
8596 2004-07-14 Martin Baulig <martin@ximian.com>
8598 * iterators.cs: Use real error numbers.
8600 2004-07-14 Martin Baulig <martin@ximian.com>
8602 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8603 requires this to be a System.Collection.IEnumerable and not a
8604 class implementing that interface.
8605 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
8607 2004-07-13 Marek Safar <marek.safar@seznam.cz>
8609 * class.cs: Fixed previous fix, it broke some error tests.
8611 2004-07-12 Martin Baulig <martin@ximian.com>
8613 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8616 2004-07-14 Martin Baulig <martin@ximian.com>
8618 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8619 an exclamation mark (!) for the generic arity to reflect the
8620 latest spec changes; ie. use "System.Collections.Generic.IList`1".
8622 2004-07-13 Martin Baulig <martin@ximian.com>
8624 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8625 specifiers being part of a type argument.
8627 2004-07-13 Martin Baulig <martin@ximian.com>
8629 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8630 name for generic types.
8632 2004-07-13 Martin Baulig <martin@ximian.com>
8634 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8637 2004-07-09 Miguel de Icaza <miguel@ximian.com>
8639 * assign.cs (LocalTemporary): Add new argument: is_address,If
8640 `is_address' is true, then the value that we store is the address
8641 to the real value, and not the value itself.
8643 * ecore.cs (PropertyExpr): use the new local temporary
8644 stuff to allow us to handle X.Y += z (where X is a struct)
8646 2004-07-08 Martin Baulig <martin@ximian.com>
8648 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8649 not always return, just like we're doing in Using.Resolve().
8651 2004-07-07 Miguel de Icaza <miguel@ximian.com>
8653 * cs-parser.jay (fixed_statement): flag this as Pinned.
8655 2004-07-06 Miguel de Icaza <miguel@ximian.com>
8657 * typemanager.cs (TypeManager): Removed MakePinned method, this
8658 mechanism is replaced with the .NET 2.x compatible mechanism of
8659 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8661 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
8662 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8663 `IsFixed' property which has a different meaning.
8665 2004-07-02 Raja R Harinath <rharinath@novell.com>
8667 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8668 visible from inside a nested class, not just the names of the
8669 immediately enclosing class.
8672 2004-06-24 Raja R Harinath <rharinath@novell.com>
8674 * expression.cs (BetterConversion): Remove buggy special-case
8675 handling of "implicit constant expression conversions". At this
8676 point, we already know that the conversion is possible -- we're
8677 only checking to see which is better.
8679 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8681 * cs-parser.jay: Added error CS0210 test.
8683 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8685 * cs-parser.jay: Added error CS0134 test.
8687 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8690 * cs-parser.jay: Added error CS0145 test.
8692 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8694 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8696 2004-06-23 Ben Maurer <bmaurer@ximian.com>
8698 * expression.cs (StackAlloc.Resolve): The argument may not
8699 be a constant; deal with this case.
8701 2004-06-23 Marek Safar <marek.safar@seznam.cz>
8703 * attribute.cs (IndexerName_GetIndexerName): Renamed to
8704 GetIndexerAttributeValue.
8705 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8707 * class.cs (Indexer.Define): Added error tests for CS0415,
8710 2004-06-23 Miguel de Icaza <miguel@ximian.com>
8712 * attribute.cs (Attribute.Resolve): Keep field code in sync with
8715 2004-06-23 Martin Baulig <martin@ximian.com>
8717 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8718 neither return nor throw, reset the barrier as well. Fixes #60457.
8720 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
8722 * class.cs : EventAttributes is now set to None by default.
8723 This fixes bug #60459.
8725 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8728 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8729 Don't throw exception but return null (it's sufficient now).
8731 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8733 * typemanager.cs (GetArgumentTypes): Faster implementation.
8735 2004-06-18 Martin Baulig <martin@ximian.com>
8737 * attribute.cs (Attribute.Resolve): Check whether we're an
8738 EmptyCast which a Constant child. Fixes #60333.
8740 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8742 * statement.cs (EmitCollectionForeach): Account for the fact that
8743 not all valuetypes are in areas which we can take the address of.
8744 For these variables, we store to a temporary variable. Also, make
8745 sure that we dont emit a `callvirt' on a valuetype method.
8747 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8749 * expression.cs (StackAlloc.DoReSolve): Added test for
8750 negative parameter (CS0247).
8752 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8755 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8757 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8760 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8763 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8765 Fix bug #58254 & cs1555.cs, cs1556.cs
8766 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8768 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8770 * cs-parser.jay: Added error CS1669 test for indexers.
8772 2004-06-18 Martin Baulig <martin@ximian.com>
8774 * generics.cs (GenericMethod.ctor): Don't take an Attributes
8775 argument. Fixes #60441.
8777 2004-06-16 Ben Maurer <bmaurer@ximian.com>
8778 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8779 The name needs to have the actual name of the method in order
8780 for other tests (such as the one in OverloadResolve for Invoke
8781 on a delegate) to work. As well, it does not really help
8782 error reporting because the method group had multiple methods.
8783 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8784 Make profiling work.
8786 2004-06-13 Martin Baulig <martin@ximian.com>
8788 * cs-parser.jay: Don't allow generic attributes.
8790 2004-06-13 Martin Baulig <martin@ximian.com>
8792 * class.cs (MemberBase.DoDefineBase): New protected method.
8793 (MemberBase.DoDefine): Compute the `flags' in the new
8794 DoDefineBase() which must be called first.
8795 (Method.Define): Call DoDefineBase() first so we have the flags
8796 when defining the generic method.
8798 * cs-parser.jay (interface_method_declaration): Support generic methods.
8800 2004-06-13 Martin Baulig <martin@ximian.com>
8802 * decl.cs (TypeName): Removed.
8803 (MemberName): Removed TypeName and MemberNow; now we just have
8806 * cs-parser.jay: Don't distinguish between type arguments and type
8807 parameters in the grammar and simplified the rules a bit. The
8808 reduce/reduce conflicts are now gone (except the one we inherited
8811 2004-06-11 Martin Baulig <martin@ximian.com>
8813 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8814 call this twice: for params and varargs methods.
8816 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8819 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8821 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8823 * attribute.cs (Attribute.GetValidTargets): Made public.
8826 (AbstractPropertyEventMethod): New class for better code sharing.
8827 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8829 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8831 2004-06-09 Martin Baulig <martin@ximian.com>
8833 * cs-parser.jay: Removed a reduce/reduce conflict.
8835 2004-06-03 Martin Baulig <martin@ximian.com>
8837 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
8838 GetSimpleName() and return a SimpleName.
8840 * ecore.cs (SimpleName.Arguments): New public field.
8841 (SimpleName): Added overloaded ctor which takes an additional
8842 TypeArguments argument.
8843 (SimpleName.SimpleNameResolve): Added support for generic methods.
8844 (MethodGroupExpr.ResolveGeneric): New public method. The code was
8845 formerly in MemberAccess.DoResolve(), but we also need it in
8846 SimpleNameResolve().
8848 * expression.cs (MemberAccess.DoResolve): Use the new
8849 MethodGroupExpr.ResolveGeneric().
8851 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8853 * decl.cs: If possible, use lookuptypedirect here. We can only do
8854 this if there is no `.' after the namespace. Avoids using
8855 LookupType, which does lots of slow processing.
8856 (FindNestedType) New method, does what it says :-).
8857 * namespace.cs: use LookupTypeDirect.
8858 * rootcontext.cs: use membercache, if possible.
8859 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8861 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8864 According to the spec,
8866 In a member access of the form E.I, if E is a single identifier,
8867 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8868 field, property, localvariable, or parameter with the same type as
8869 the meaning of E as a type-name (§3.8), then both possible
8870 meanings of E are permitted.
8872 We did not check that E as a simple-name had the same type as E as
8875 This trivial check gives us 5-7% on bootstrap time.
8877 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8879 * expression.cs (Invocation.OverloadResolve): Avoid the
8880 use of hashtables and boxing here by allocating on demand.
8882 2004-05-30 Martin Baulig <martin@ximian.com>
8884 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8885 we're doing a silent lookup. Don't try to lookup nested types in
8886 TypeManager.object_type (thanks to Ben Maurer).
8888 2004-05-30 Martin Baulig <martin@ximian.com>
8890 Committing a patch from Ben Maurer.
8892 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8894 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8896 * convert.cs: add a trivial cache for overload operator resolution.
8898 2004-05-31 Marek Safar <marek.safar@seznam.cz>
8901 (AttributeTester.GetObsoleteAttribute): Returns instance of
8902 ObsoleteAttribute when type is obsolete.
8905 (TypeContainer.VerifyObsoleteAttribute): Override.
8906 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8907 (MethodCode.VerifyObsoleteAttribute): Override.
8908 (MemberBase.VerifyObsoleteAttribute): Override.
8911 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8912 and report proper error.
8915 (Delegate.VerifyObsoleteAttribute): Override.
8918 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8919 and report proper error.
8920 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8923 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8927 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8928 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8929 Added test for ObsoleteAttribute.
8932 (Catch): Derived from Statement.
8934 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8936 * decl.cs: If possible, use lookuptypedirect here. We can only do
8937 this if there is no `.' after the namespace. Avoids using
8938 LookupType, which does lots of slow processing.
8939 (FindNestedType) New method, does what it says :-).
8940 * namespace.cs: use LookupTypeDirect.
8941 * rootcontext.cs: use membercache, if possible.
8942 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8944 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8947 According to the spec,
8949 In a member access of the form E.I, if E is a single identifier,
8950 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8951 field, property, localvariable, or parameter with the same type as
8952 the meaning of E as a type-name (§3.8), then both possible
8953 meanings of E are permitted.
8955 We did not check that E as a simple-name had the same type as E as
8958 This trivial check gives us 5-7% on bootstrap time.
8960 2004-05-30 Marek Safar <marek.safar@seznam.cz>
8962 Fixed bug #59071 & cs0160.cs
8963 * statement.cs (Try.Resolve): Check here whether order of catch
8964 clauses matches their dependencies.
8966 2004-05-30 Marek Safar <marek.safar@seznam.cz>
8969 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
8972 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8974 * expression.cs (Invocation.OverloadResolve): Avoid the
8975 use of hashtables and boxing here by allocating on demand.
8977 2004-05-30 Martin Baulig <martin@ximian.com>
8979 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8980 we're doing a silent lookup. Don't try to lookup nested types in
8981 TypeManager.object_type (thanks to Ben Maurer).
8983 2004-05-30 Martin Baulig <martin@ximian.com>
8985 Committing a patch from Ben Maurer.
8987 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8989 2004-05-29 Martin Baulig <martin@ximian.com>
8991 * class.cs (IMethodData.ShouldIgnore): New method.
8993 * typemanager.cs (TypeManager.MethodFlags): Don't take a
8994 `Location' argument, we don't need it anywhere. Use
8995 `IMethodData.ShouldIgnore ()' instead of
8996 `MethodData.GetMethodFlags ()'.
8997 (TypeManager.AddMethod): Removed.
8998 (TypeManager.AddMethod2): Renamed to AddMethod.
9000 2004-05-29 Martin Baulig <martin@ximian.com>
9002 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9004 * convert.cs (Convert.ImplicitReferenceConversion): If we're
9005 converting from a class type S to an interface type and we already
9006 have an object on the stack, don't box it again. Fixes #52578.
9008 2004-05-29 Martin Baulig <martin@ximian.com>
9010 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9011 Added support for `params' parameters. Fixes #59267.
9013 2004-05-29 Martin Baulig <martin@ximian.com>
9015 * literal.cs (NullPointer): Provide a private .ctor which sets
9016 `type' to TypeManager.object_type. Fixes #59048.
9018 2004-05-29 Martin Baulig <martin@ximian.com>
9020 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9021 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
9023 * ecore.cs (EventExpr.instance_expr): Make the field private.
9025 2004-05-26 Marek Safar <marek.safar@seznam.cz>
9027 Fixed bug #50080 & cs0214-2.cs
9028 * expression.cs (Cast.DoResolve): Check unsafe context here.
9030 * statement.cs (Resolve.DoResolve): Likewise.
9032 2004-05-26 Martin Baulig <martin@ximian.com>
9034 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9036 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9037 (RootContext.LookupType): Pass down the `silent' flag.
9039 2004-05-25 Martin Baulig <martin@ximian.com>
9042 (MethodGroupExpr.IdenticalTypeName): New public property.
9043 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9044 expression actually refers to a type.
9046 2004-05-25 Martin Baulig <martin@ximian.com>
9048 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9049 for #56176 and made it actually work.
9051 2004-05-25 Martin Baulig <martin@ximian.com>
9053 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9054 (FieldExpr, PropertyExpr): Override and implement
9055 CacheTemporaries. Fixes #52279.
9057 2004-05-25 Miguel de Icaza <miguel@ximian.com>
9059 * location.cs: In the new compiler listing a file twice is a
9060 warning, not an error.
9062 2004-05-24 Martin Baulig <martin@ximian.com>
9064 * enum.cs (Enum.DefineType): For the `BaseType' to be a
9065 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
9067 2004-05-24 Martin Baulig <martin@ximian.com>
9069 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9070 walking the `using' list. Fixes #53921.
9072 2004-05-24 Martin Baulig <martin@ximian.com>
9074 * const.cs (Const.LookupConstantValue): Added support for
9075 EmptyCast's; fixes #55251.
9077 2004-05-24 Martin Baulig <martin@ximian.com>
9079 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9080 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9081 which does the CS0135 check. The reason is that we first need to
9082 check whether the variable actually exists.
9084 2004-05-24 Martin Baulig <martin@ximian.com>
9086 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9087 than RootContext.LookupType() to find the explicit interface
9090 2004-05-24 Raja R Harinath <rharinath@novell.com>
9092 * Makefile: Simplify. Use executable.make.
9093 * mcs.exe.sources: New file. List of sources of mcs.exe.
9095 2004-05-24 Anders Carlsson <andersca@gnome.org>
9099 Use the invariant culture when doing String.Compare for CLS case
9102 2004-05-23 Martin Baulig <martin@ximian.com>
9104 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9105 don't have any dots. Fixes #52622, added cs0246-8.cs.
9107 * namespace.cs (NamespaceEntry.Lookup): Likewise.
9109 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9111 * class.cs (MemberBase.Define): Reuse MemberType member for
9112 resolved type. Other methods can use it too.
9114 2004-05-23 Martin Baulig <martin@ximian.com>
9116 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9117 the variable also exists in the current block (otherwise, we need
9118 to report a CS0103). Fixes #58670.
9120 2004-05-23 Martin Baulig <martin@ximian.com>
9122 * flowanalysis.cs (Reachability.Reachable): Compute this
9123 on-the-fly rather than storing it as a field.
9125 2004-05-23 Martin Baulig <martin@ximian.com>
9127 * flowanalysis.cs (Reachability.And): Manually compute the
9128 resulting `barrier' from the reachability.
9130 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9133 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9134 instance of ObsoleteAttribute when symbol is obsolete.
9137 (IMethodData): Extended interface for ObsoleteAttribute support.
9139 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9141 * attribute.cs: Fix bug #55970
9143 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9147 (GetObsoleteAttribute): New method. Creates the instance of
9149 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9150 ObsoleteAttribute when member is obsolete.
9151 (AttributeTester.Report_ObsoleteMessage): Common method for
9152 Obsolete error/warning reporting.
9155 (TypeContainer.base_classs_type): New member for storing parent type.
9158 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9159 for this MemberCore.
9161 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9163 * attribute.cs, const.cs: Fix bug #58590
9165 2004-05-21 Martin Baulig <martin@ximian.com>
9167 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9168 out parameters if the end of the method is unreachable. Fixes
9171 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9173 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9174 Hari was right, why extra method.
9176 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9178 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9180 2004-05-20 Martin Baulig <martin@ximian.com>
9182 * delegate.cs: Convert this file to Unix mode - like the original
9185 2004-05-20 Martin Baulig <martin@ximian.com>
9187 * attribute.cs: Convert this file to Unix mode - like the original
9190 2004-05-19 Marek Safar <marek.safar@seznam.cz>
9192 Fix bug #58688 (MCS does not report error when the same attribute
9195 * attribute.cs (Attribute.Emit): Distinction between null and default.
9197 2004-05-19 Raja R Harinath <rharinath@novell.com>
9199 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9200 of a top-level attribute without an attribute target.
9201 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
9203 (Attribute.Conditional_GetConditionName),
9204 (Attribute.Obsolete_GetObsoleteMessage): Update.
9205 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
9206 part of ScanForIndexerName.
9207 (Attribute.CanIgnoreInvalidAttribute): New function.
9208 (Attribute.ScanForIndexerName): Move to ...
9209 (Attributes.ScanForIndexerName): ... here.
9210 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9211 (Attributes.Search): New internal variant that can choose not to
9212 complain if types aren't resolved. The original signature now
9214 (Attributes.GetClsCompliantAttribute): Use internal variant, with
9215 complaints suppressed.
9216 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9217 only if it not useful.
9218 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9219 top-level for attributes that are shared between the assembly
9220 and a top-level class.
9221 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9222 * class.cs: Update to reflect changes.
9223 (DefineIndexers): Fuse loops.
9224 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
9225 a couple more variants of attribute names.
9227 2004-05-18 Marek Safar <marek.safar@seznam.cz>
9229 Fix bug #52585 (Implemented explicit attribute declaration)
9232 (Attributable.ValidAttributeTargets): New abstract method. It gets
9233 list of valid attribute targets for explicit target declaration.
9234 (Attribute.Target): It holds target itself.
9235 (AttributeSection): Removed.
9236 (Attribute.CheckTargets): New method. It checks whether attribute
9237 target is valid for the current element.
9240 (EventProperty): New class. For events that are declared like
9241 property (with add and remove accessors).
9242 (EventField): New class. For events that are declared like field.
9245 * cs-parser.jay: Implemented explicit attribute target declaration.
9247 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
9248 Override ValidAttributeTargets.
9251 (ReturnParameter): Class for applying custom attributes on
9253 (ParameterAtribute): New class. Class for applying custom
9254 attributes on the parameter type.
9256 2004-05-17 Miguel de Icaza <miguel@ximian.com>
9258 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9261 (Method): Allow UNSAFE here.
9263 * modifiers.cs: Support unsafe reporting.
9265 2004-05-17 Marek Safar <marek.safar@seznam.cz>
9267 * decl.cs: Fix bug #58478.
9269 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9271 * statement.cs: When checking for unreachable code on an EmptyStatement,
9272 set the location. Fixes bug #58488.
9274 2004-05-13 Miguel de Icaza <miguel@ximian.com>
9276 * driver.cs: Add -pkg handling.
9278 From Gonzalo: UseShelLExecute=false
9280 2004-05-12 Marek Safar <marek.safar@seznam.cz>
9283 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9285 (Attribute.IsClsCompliaceRequired): Moved to base for better
9287 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9288 when attribute is AttributeUsageAttribute.
9289 (Attribute.GetValidTargets): Simplified.
9290 (Attribute.GetAttributeUsage): New method returns AttributeUsage
9291 attribute for this type.
9292 (Attribute.ApplyAttributes): Method renamed to Emit and make
9294 (GlobalAttributeSection): New class for special handling of global
9295 attributes (assembly, module).
9296 (AttributeSection.Emit): New method.
9298 * class.cs: Implemented Attributable abstract methods.
9299 (MethodCore.LabelParameters): Moved to Parameter class.
9300 (Accessor): Is back simple class.
9301 (PropertyMethod): Implemented Attributable abstract class.
9302 (DelegateMethod): Implemented Attributable abstract class.
9303 (Event): New constructor for disctintion between normal Event
9304 and Event with accessors.
9306 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9308 * codegen.cs, const.cs, decl.cs, delegate.cs:
9309 (CommonAssemblyModulClass): Implemented Attributable abstract class
9312 * enum.cs: Implement IAttributeSupport interface.
9313 (EnumMember): New class for emum members. Implemented Attributable
9317 (ParameterBase): Is abstract.
9318 (ReturnParameter): New class for easier [return:] attribute handling.
9320 * typemanager.cs: Removed builder_to_attr.
9322 2004-05-11 Raja R Harinath <rharinath@novell.com>
9325 * attribute.cs (Attribute.GetPositionalValue): New function.
9326 * class.cs (TypeContainer.VerifyMembers): New function.
9327 (TypeContainer.Emit): Use it.
9328 (ClassOrStruct): New base class for Class and Struct.
9329 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
9330 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9332 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9333 then each non-static field should have a FieldOffset attribute.
9334 Otherwise, none of the fields should have a FieldOffset attribute.
9335 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
9336 and FieldOffset attributes.
9337 * typemanager.cs (TypeManager.struct_layout_attribute_type)
9338 (TypeManager.field_offset_attribute_type): New core types.
9339 (TypeManager.InitCoreTypes): Initialize them.
9341 2004-05-11 Michal Moskal <malekith@pld-linux.org>
9343 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9344 Return correct type.
9347 2004-05-09 Miguel de Icaza <miguel@ximian.com>
9349 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9350 be implicitly converted to ulong.
9352 * expression.cs: The logic for allowing operator &, | and ^ worked
9353 was wrong, it worked before because we did not report an error in
9354 an else branch. Fixes 57895.
9356 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9357 allow volatile fields to be reference types.
9359 2004-05-07 Miguel de Icaza <miguel@ximian.com>
9361 * driver.cs: Add support for /debug-
9363 2004-05-07 Raja R Harinath <rharinath@novell.com>
9365 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
9366 Add a 'complain' parameter to silence errors.
9367 (Attribute.Resolve): Update to changes. Put in sanity check to catch
9368 silently overlooked type-resolutions.
9369 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9371 (Attributes.Search): New function.
9372 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9373 (Attributes.GetAttributeFullName): Remove hack.
9374 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9375 Update to reflect changes.
9376 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9377 Use Attributes.Search instead of nested loops.
9379 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9382 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9383 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9384 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9386 * report.cs: (Report.Warning): Renamed to Warning_T because of
9387 parameter collision.
9389 2004-05-05 Raja R Harinath <rharinath@novell.com>
9391 * expression.cs (MemberAccess.ResolveMemberAccess):
9392 Exit with non-zero status after Report.Error.
9393 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9395 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9397 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9399 * support.cs: Don't hang when the file is empty.
9401 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9403 * support.cs: In SeekableStreamReader, compute the preamble size of the
9404 underlying stream. Position changes should take into account that initial
9407 2004-05-03 Todd Berman <tberman@sevenl.net>
9409 * driver.cs: remove unused GetSysVersion function.
9411 2004-05-03 Todd Berman <tberman@sevenl.net>
9413 * driver.cs: Remove the hack from saturday, as well as the hack
9414 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9415 link_paths to get that bit proper.
9417 2004-05-01 Todd Berman <tberman@sevenl.net>
9419 * driver.cs: Try a LoadFrom before a Load, this checks the current
9420 path. This is currently a bug in mono that is be fixed, however, this
9421 provides a workaround for now. This will be removed when the bug
9424 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9426 * CryptoConvert.cs: Updated to latest version. Fix issue with
9427 incomplete key pairs (#57941).
9429 2004-05-01 Todd Berman <tberman@sevenl.net>
9431 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9434 2004-04-30 Jackson Harper <jackson@ximian.com>
9436 * codegen.cs: Open keys readonly.
9438 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9440 * typemanager.cs: don't report cyclic struct layout when a struct
9441 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9442 which has 2 Pango.Rectangle fields.
9444 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9446 * expression.cs: Handle IntPtr comparisons with IL code
9447 rather than a method call.
9449 2004-04-29 Martin Baulig <martin@ximian.com>
9451 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9452 the list of PropertyInfo's in class hierarchy and find the
9453 accessor. Fixes #56013.
9455 2004-04-29 Martin Baulig <martin@ximian.com>
9457 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9459 2004-04-29 Martin Baulig <martin@ximian.com>
9461 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9463 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9465 2004-04-29 Martin Baulig <martin@ximian.com>
9467 * class.cs (ConstructorInitializer.Resolve): Check whether the
9468 parent .ctor is accessible. Fixes #52146.
9470 2004-04-29 Martin Baulig <martin@ximian.com>
9472 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9474 * statement.cs (Using.EmitLocalVariableDecls): Use
9475 TypeManager.idisposable_type, not typeof (IDisposable).
9476 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9478 2004-04-29 Martin Baulig <martin@ximian.com>
9480 * class.cs (Event.Define): Don't emit the field and don't set
9481 RTSpecialName and SpecialName for events on interfaces. Fixes
9484 2004-04-29 Raja R Harinath <rharinath@novell.com>
9486 Refactor Attribute.ApplyAttributes.
9487 * attribute.cs (Attributable): New base class for objects that can
9488 have Attributes applied on them.
9489 (Attribute): Make AttributeUsage fields public.
9490 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9491 (Attribute.IsInternalCall): New property.
9492 (Attribute.UsageAttr): Convert to a public read-only property.
9493 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9494 (Attribute.ResolveType, Attribute.Resolve)
9495 (Attribute.ScanForIndexerName): Update to reflect changes.
9496 (Attribute.CheckAttributeTarget): Re-format.
9497 (Attribute.ApplyAttributes): Refactor, to various
9498 Attributable.ApplyAttributeBuilder methods.
9499 * decl.cs (MemberCore): Make Attributable.
9500 * class.cs (Accessor): Make Attributable.
9501 (MethodData.ApplyAttributes): Use proper attribute types, not
9503 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9504 (TypeContainer.ApplyAttributeBuilder)
9505 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9506 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9507 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9508 (Operator.ApplyAttributeBuilder): New factored-out methods.
9509 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9510 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9511 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9512 * parameter.cs (ParameterBase): New Attributable base class
9513 that can also represent Return types.
9514 (Parameter): Update to the changes.
9516 2004-04-29 Jackson Harper <jackson@ximian.com>
9518 * driver.cs: Prefer the corlib system version when looking for
9519 assemblies in the GAC. This is still a hack, but its a better hack
9522 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9524 * decl.cs, enum.cs: Improved error 3005 reporting.
9526 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9527 (related_symbols): New private member for list of symbols
9528 related to reported error/warning.
9530 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9532 2004-04-29 Martin Baulig <martin@ximian.com>
9534 * ecore.cs (Expression.Constantify): If we're an enum and
9535 TypeManager.TypeToCoreType() doesn't give us another type, use
9536 t.UnderlyingSystemType. Fixes #56178.
9538 2004-04-29 Martin Baulig <martin@ximian.com>
9540 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9541 interfaces and for each interface, only add members directly
9542 declared in that interface. Fixes #53255.
9544 2004-04-28 Martin Baulig <martin@ximian.com>
9546 * expression.cs (ConditionalLogicalOperator): Use a temporary
9547 variable for `left' to avoid that we evaluate it more than once;
9550 2004-04-28 Martin Baulig <martin@ximian.com>
9552 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9555 2004-04-28 Martin Baulig <martin@ximian.com>
9557 * statement.cs (LocalInfo.Resolve): Check whether the type is not
9560 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9561 whether the type is not void (CS1547).
9563 2004-04-28 Martin Baulig <martin@ximian.com>
9565 * expression.cs (Unary.DoResolveLValue): Override this and report
9566 CS0131 for anything but Operator.Indirection.
9568 2004-04-28 Martin Baulig <martin@ximian.com>
9570 Committing a patch from Ben Maurer; see bug #50820.
9572 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9575 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9578 2004-04-28 Martin Baulig <martin@ximian.com>
9580 Committing a patch from Ben Maurer; see bug #50820.
9582 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9585 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9588 2004-04-28 Martin Baulig <martin@ximian.com>
9590 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9591 (Block.AddLabel): Call DoLookupLabel() to only search in the
9594 2004-04-28 Martin Baulig <martin@ximian.com>
9596 * cfold.cs (ConstantFold.BinaryFold): Added special support for
9597 comparing StringConstants and NullLiterals in Equality and Inequality.
9599 2004-04-28 Jackson Harper <jackson@ximian.com>
9601 * driver.cs: Attempt to load referenced assemblies from the
9602 GAC. This is the quick and dirty version of this method that
9603 doesnt take into account versions and just takes the first
9604 canidate found. Will be good enough for now as we will not have more
9605 then one version installed into the GAC until I update this method.
9607 2004-04-28 Martin Baulig <martin@ximian.com>
9609 * typemanager.cs (TypeManager.CheckStructCycles): New public
9610 static method to check for cycles in the struct layout.
9612 * rootcontext.cs (RootContext.PopulateTypes): Call
9613 TypeManager.CheckStructCycles() for each TypeContainer.
9614 [Note: We only need to visit each type once.]
9616 2004-04-28 Martin Baulig <martin@ximian.com>
9618 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9620 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9621 success and added `out object value'. Use a `bool resolved' field
9622 to check whether we've already been called rather than
9623 `ConstantValue != null' since this breaks for NullLiterals.
9625 2004-04-28 Raja R Harinath <rharinath@novell.com>
9627 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9628 setting of this flag, since the 'set' method may be non-public.
9630 2004-04-28 Raja R Harinath <rharinath@novell.com>
9632 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9633 check on current_vector.Block.
9635 2004-04-27 Martin Baulig <martin@ximian.com>
9637 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9638 a field initializer. Fixes #56459.
9640 2004-04-27 Martin Baulig <martin@ximian.com>
9642 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9643 we're not attempting to use an indexer. Fixes #52154.
9645 2004-04-27 Martin Baulig <martin@ximian.com>
9647 * statement.cs (Return): Don't create a return label if we don't
9648 need it; reverts my change from January 20th. Thanks to Ben
9651 2004-04-27 Martin Baulig <martin@ximian.com>
9653 According to the spec, `goto' can only leave a nested scope, but
9656 * statement.cs (Block.LookupLabel): Only lookup in the current
9657 block, don't recurse into parent or child blocks.
9658 (Block.AddLabel): Check in parent and child blocks, report
9659 CS0140/CS0158 if we find a duplicate.
9660 (Block): Removed this indexer for label lookups.
9661 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9662 this already does the error reporting for us.
9665 (FlowBranching.UsageVector.Block): New public variable; may be null.
9666 (FlowBranching.CreateSibling): Added `Block' argument.
9667 (FlowBranching.LookupLabel): New public virtual method. Lookup a
9668 label for the target of a `goto' and check whether we're not
9669 leaving a `finally'.
9671 2004-04-27 Martin Baulig <martin@ximian.com>
9673 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9674 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9677 2004-04-27 Martin Baulig <martin@ximian.com>
9679 * statement.cs (Block.AddLabel): Also check for implicit blocks
9680 and added a CS0158 check.
9682 2004-04-27 Martin Baulig <martin@ximian.com>
9684 * flowanalysis.cs (FlowBranchingLoop): New class.
9685 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9686 UsageVector's instead of an ArrayList.
9687 (FlowBranching.Label): Likewise.
9688 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9689 (FlowBranching.AddBreakVector): New method.
9691 2004-04-27 Miguel de Icaza <miguel@ximian.com>
9693 * attribute.cs: Small regression fix: only convert the type if we
9694 the type is different, fixes System.Drawing build.
9696 2004-04-27 Martin Baulig <martin@ximian.com>
9698 * attribute.cs (Attribute.Resolve): If we have a constant value
9699 for a named field or property, implicity convert it to the correct
9702 2004-04-27 Raja R Harinath <rharinath@novell.com>
9704 * statement.cs (Block.Block): Implicit blocks share
9705 'child_variable_names' fields with parent blocks.
9706 (Block.AddChildVariableNames): Remove.
9707 (Block.AddVariable): Mark variable as "used by a child block" in
9708 every surrounding block.
9709 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9710 been used in a child block, complain about violation of "Invariant
9711 meaning in blocks" rule.
9712 * cs-parser.jay (declare_local_variables): Don't use
9713 AddChildVariableNames.
9714 (foreach_statement): Don't create an implicit block: 'foreach'
9717 2004-04-23 Miguel de Icaza <miguel@ximian.com>
9719 * convert.cs (ImplicitNumericConversion): 0 is also positive when
9720 converting from 0L to ulong. Fixes 57522.
9722 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9724 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9725 derived class hides via 'new' keyword field from base class (test-242.cs).
9726 TODO: Handle this in the more general way.
9728 * class.cs (CheckBase): Ditto.
9730 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9732 * decl.cs (caching_flags): New member for storing cached values
9734 (MemberCore.Flags): New enum where bit flags for caching_flags
9736 (MemberCore.cls_compliance): Moved to caching_flags.
9737 (DeclSpace.Created): Moved to caching_flags.
9739 * class.cs: Use caching_flags instead of DeclSpace.Created
9741 2004-04-21 Miguel de Icaza <miguel@ximian.com>
9743 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9744 if we are only a derived class, not a nested class.
9746 * typemanager.cs: Same as above, but do this at the MemberLookup
9747 level (used by field and methods, properties are handled in
9748 PropertyExpr). Allow for the qualified access if we are a nested
9751 2004-04-21 Marek Safar <marek.safar@seznam.cz>
9753 * class.cs: Refactoring.
9754 (IMethodData): New inteface; Holds links to parent members
9755 to avoid member duplication (reduced memory allocation).
9756 (Method): Implemented IMethodData interface.
9757 (PropertyBase): New inner classes for get/set methods.
9758 (PropertyBase.PropertyMethod): Implemented IMethodData interface
9759 (Event): New inner classes for add/remove methods.
9760 (Event.DelegateMethod): Implemented IMethodData interface.
9762 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9763 EmitContext (related to class.cs refactoring).
9765 2004-04-21 Raja R Harinath <rharinath@novell.com>
9767 * delegate.cs (Delegate.VerifyApplicability): If the number of
9768 arguments are the same as the number of parameters, first try to
9769 verify applicability ignoring any 'params' modifier on the last
9773 2004-04-08 Martin Baulig <martin@ximian.com>
9775 Merged latest changes into gmcs. Please keep this comment in
9776 here, it makes it easier for me to see what changed in MCS since
9777 the last time I merged.
9779 2004-04-16 Raja R Harinath <rharinath@novell.com>
9781 * class.cs (TypeContainer.AddIndexer): Use
9782 'ExplicitInterfaceName' to determine if interface name was
9783 explicitly specified. 'InterfaceType' is not initialized at this time.
9784 (TypeContainer.DefineIndexers): Remove use of temporary list. The
9785 Indexers array is already in the required order. Initialize
9786 'IndexerName' only if there are normal indexers.
9787 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9788 (TypeContainer.Emit): Emit DefaultMember attribute only if
9789 IndexerName is initialized.
9792 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
9794 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9797 2004-04-15 Raja R Harinath <rharinath@novell.com>
9799 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9803 * attribute.cs (Attribute.Resolve): Check for duplicate named
9807 2004-04-15 Miguel de Icaza <miguel@ximian.com>
9809 * iterators.cs (MarkYield): track whether we are in an exception,
9810 and generate code accordingly. Use a temporary value to store the
9811 result for our state.
9813 I had ignored a bit the interaction of try/catch with iterators
9814 since their behavior was not entirely obvious, but now it is
9815 possible to verify that our behavior is the same as MS .NET 2.0
9819 2004-04-14 Miguel de Icaza <miguel@ximian.com>
9821 * iterators.cs: Avoid creating temporaries if there is no work to
9824 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9825 Enumerations, use TypeManager.EnumToUnderlying and call
9828 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9831 (This.Emit): Use EmitContext.EmitThis to emit our
9834 (This.EmitAssign): Ditto.
9836 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9837 codepaths, we will move all the functionality into
9840 (FieldExpr.EmitAssign): Ditto.
9842 This fixes several hidden bugs that I uncovered while doing a code
9843 review of this today.
9845 * codegen.cs (EmitThis): reworked so the semantics are more clear
9846 and also support value types "this" instances.
9848 * iterators.cs: Changed so that for iterators in value types, we
9849 do not pass the value type as a parameter.
9851 Initialization of the enumerator helpers is now done in the caller
9852 instead of passing the parameters to the constructors and having
9853 the constructor set the fields.
9855 The fields have now `assembly' visibility instead of private.
9857 2004-04-11 Miguel de Icaza <miguel@ximian.com>
9859 * expression.cs (Argument.Resolve): Check if fields passed as ref
9860 or out are contained in a MarshalByRefObject.
9862 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9863 another compiler type.
9865 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
9867 * class.cs (Indexer.Define): use the new name checking method.
9868 Also, return false on an error.
9869 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9870 (is_identifier_[start/part]_character): make static.
9872 2004-04-10 Miguel de Icaza <miguel@ximian.com>
9874 * expression.cs (Binary.ResolveOperator): Do no append strings
9875 twice: since we can be invoked more than once (array evaluation)
9876 on the same concatenation, take care of this here. Based on a fix
9877 from Ben (bug #56454)
9879 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9881 * codegen.cs: Fix another case where CS1548 must be reported (when
9882 delay-sign isn't specified and no private is available #56564). Fix
9883 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9884 error when MCS is used on the MS runtime and we need to delay-sign
9885 (which seems unsupported by AssemblyBuilder - see #56621).
9887 2004-04-08 Marek Safar <marek.safar@seznam.cz>
9889 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9890 (TypeManager.ComputeNamespaces): Faster implementation for
9893 * compiler.csproj: Updated AssemblyName to mcs.
9895 2004-05-11 Jackson Harper <jackson@ximian.com>
9897 * Makefile: Preserve MONO_PATH
9899 2004-05-11 Jackson Harper <jackson@ximian.com>
9901 * Makefile: Use mono and mcs to build gmcs
9903 2004-05-03 Miguel de Icaza <miguel@ximian.com>
9905 * codegen.cs: Add patch from Robert Shade
9906 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
9909 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
9911 * CryptoConvert.cs: Updated to latest version. Fix issue with
9912 incomplete key pairs (#57941).
9914 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9916 * codegen.cs: Fix another case where CS1548 must be reported (when
9917 delay-sign isn't specified and no private is available #56564). Fix
9918 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9919 error when MCS is used on the MS runtime and we need to delay-sign
9920 (which seems unsupported by AssemblyBuilder - see #56621).
9922 2004-04-29 Jackson Harper <jackson@ximian.com>
9924 * Makefile: Set MONO_PATH to use the bootstrap corlib
9925 * driver.cs: Check the GAC for referenced assemblies.
9927 2004-04-29 Martin Baulig <martin@ximian.com>
9929 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
9931 2004-04-07 Martin Baulig <martin@ximian.com>
9933 * expression.cs (Binary.ResolveOperator): Added special case for
9934 Equality/Inequality between a type parameter and a null literal.
9936 2004-04-07 Martin Baulig <martin@ximian.com>
9938 * convert.cs: Check null literal -> type parameter conversions.
9940 2004-04-07 Martin Baulig <martin@ximian.com>
9942 * generic.cs (ConstructedType.CheckConstraints): Enforce the
9943 `class' and `struct' constraints.
9945 2004-04-07 Martin Baulig <martin@ximian.com>
9947 * generic.cs (SpecialConstraint): New public enum.
9948 (Constraints.Resolve): Added support for the `class' and `struct'
9951 * cs-parser.jay (type_parameter_constraint): Added support for the
9952 `class' and `struct' constraints.
9954 2004-04-07 Martin Baulig <martin@ximian.com>
9956 * support.cs (GenericConstraints): Replaced `Types' by
9957 `ClassConstraint' and `InterfaceConstraints'; added
9958 `HasClassConstraint'.
9960 2004-04-07 Martin Baulig <martin@ximian.com>
9963 (Constraints.InterfaceConstraints): New public property.
9964 (Constraints.Types): Make this property public
9965 (TypeParameter): Implement IMemberContainer.
9966 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
9967 instead of a TypeBuilder/MethodBuilder; pass the interface
9968 constraints to TypeManager.AddTypeParameter().
9969 (TypeParameter.DefineType): Just take an EmitContext and no
9970 TypeBuilder/MethodBuilder. Use the new public API.
9972 * typemanager.cs (TypeManager.AddTypeParameter): Added
9973 `TypeExpr[]' argument; add the interfaces to the
9974 `builder_to_ifaces' hash.
9975 (TypeManager.LookupMemberContainer): For
9976 GenericTypeParameterBuilders, get the TypeParameter from the
9977 `builder_to_type_param'.
9978 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
9979 the TypeParameter and call FindMembers on it.
9981 2004-04-07 Martin Baulig <martin@ximian.com>
9984 (MethodCore.GenericMethod): Moved this field here from Method.
9985 (MethodCore.IsDuplicateImplementation): Take the number of type
9986 parameters into account if we're a generic method.
9988 * expression.cs (Invocation.InferTypeArguments): Don't return true
9989 if `arguments' is null; we still need to check whether we actually
9990 don't need to infer anything in this case.
9991 (MemberAccess): Merged the functionality from GenericMemberAccess
9994 * generic.cs (GenericMemberAccess): Removed.
9996 2004-04-05 Martin Baulig <martin@ximian.com>
9998 * decl.cs (MemberCore): For generic classes, interfaces and
9999 structs, `Name' now includes the number of type parameters
10000 ("Stack!1.Node!1").
10001 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10002 encode the number of type arguments in the type name.
10004 * expression.cs (Expression.MemberLookup): Removed the
10005 `num_type_args' argument; we now encode the number of type
10006 arguments in the type name.
10008 * ecore.cs (SimpleName): Encode the number of type arguments in
10009 the type name itself.
10011 * generic.cs (ConstructedType): Likewise.
10013 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10014 `MemberName'; we now include the number of type parameters in the
10017 * typemanager.cs (TypeManager.CheckGeneric): Removed.
10018 (TypeManager.MemberLookup): Removed the
10019 `num_type_args' argument; we now encode the number of type
10020 arguments in the type name.
10022 2004-04-03 Martin Baulig <martin@ximian.com>
10024 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10025 (MemberCore.MemberName): Moved here from MemberBase.
10026 (DeclSpace.SetParameterInfo): Just take the constraints as an
10027 ArrayList; we already have the type parameters in our
10028 `MemberName'; also do the CS0080 reporting here.
10030 * cs-parser.jay (struct_declaration): Use `member_name' instead of
10031 `IDENTIFIER opt_type_parameter_list'; when constructing our
10032 `MemberName', it'll already include our type parameters.
10033 (class_declaration, interface_declaration): Likewise.
10034 (delegate_declaration): Likewise.
10035 (MakeName): Take a MemberName and return a MemberName.
10036 The following two changes are required to avoid shift/reduce conflicts:
10037 (member_name): Don't include a TypeName anymore; ie. this is now
10038 just 'IDENTIFIER opt_type_parameter_list'.
10039 (property_declaration, event_declaration): Use a
10040 `namespace_or_type_name' instead of a `member_name'.
10042 2004-04-03 Martin Baulig <martin@ximian.com>
10044 * decl.cs (MemberName): Renamed to `TypeName' and created a new
10045 `MemberName' class.
10046 (TypeName): Formerly known as MemberName.
10048 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10049 instead of a `MemberName'.
10051 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10052 (member_name): New rule; create a MemberName.
10054 2004-04-02 Martin Baulig <martin@ximian.com>
10056 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10057 (CS0305 and CS0308).
10059 2004-04-02 Martin Baulig <martin@ximian.com>
10061 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10062 support for nested types.
10064 2004-04-02 Martin Baulig <martin@ximian.com>
10066 * ecore.cs (IAlias): New public interface.
10067 (TypeExpr, TypeExpression): Implement IAlias.
10068 (TypeAliasExpression): New public class.
10070 * namespace.cs (Namespace): Implement IAlias.
10071 (Namespace.Lookup): Return an IAlias instead on an object.
10072 (Namespace.DefineName): Take an IAlias instead of an object.
10073 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10075 (NamespaceEntry.UsingAlias): Take a Membername instead of an
10077 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10079 (NamespaceEntry.Lookup): Likewise.
10081 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10084 * decl.cs (DeclSpace): Implement IAlias.
10085 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10087 * generic.cs (ConstructedType): Improved error checking.
10089 2004-04-02 Martin Baulig <martin@ximian.com>
10091 * convert.cs: Added type parameter conversions.
10094 (UnboxCast.Emit): Emit an `unbox.any' for type params.
10095 (ClassCast.Emit): If the source type is a type parameter, box it.
10096 If the target type is a type parameter, emit an `unbox.any'
10097 instead of a `classcast'.1
10099 2004-04-01 Martin Baulig <martin@ximian.com>
10101 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10103 2004-04-01 Martin Baulig <martin@ximian.com>
10105 * generic.cs (ConstructedType.CheckConstraints): Use
10106 Convert.ImplicitStandardConversionExists(); user-defined implicit
10107 conversions are not allowed according to the spec.
10109 2004-03-30 Martin Baulig <martin@ximian.com>
10111 * expression.cs (New): Added support for type parameters.
10114 (TypeManager.activator_type): New public static field.
10115 (TypeManager.activator_create_instance): Likewise.
10117 2004-03-30 Martin Baulig <martin@ximian.com>
10119 * typemanager.cs (TypeManager.HasConstructorConstraint): New
10122 2004-03-30 Martin Baulig <martin@ximian.com>
10124 * generic.cs (ConstructedType.CheckConstraints): Actually follow
10125 the spec here: the argument type must be convertible to the
10128 2004-03-30 Martin Baulig <martin@ximian.com>
10131 (TypeParameter.Define, TypeParameter.DefineMethod): Call
10132 TypeManager.AddTypeParameter().
10133 (ConstructedType.CheckConstraints): Re-enable this and actually
10134 check whether we have a constructor constraint.
10137 (TypeManager.builder_to_type_param): New static field.
10138 (TypeManager.AddTypeParameter): New static method.
10139 (TypeManager.LookupTypeParameter): New public method.
10141 2004-03-30 Martin Baulig <martin@ximian.com>
10143 * generic.cs (TypeParameter.DefineType): Return a boolean and use
10144 the new API to actually define the constructor constraint.
10147 (TypeManager.new_constraint_attr_type): New static field.
10148 (TypeManager.InitCoreTypes): Initialize it.
10150 2004-03-30 Martin Baulig <martin@ximian.com>
10152 * generic.cs (Constraints): Completed error checking, use correct
10155 2004-03-29 Martin Baulig <martin@ximian.com>
10157 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10159 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10160 public version which takes a `ParameterData pd' instead of an
10163 2004-03-29 Martin Baulig <martin@ximian.com>
10165 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10168 2004-03-29 Martin Baulig <martin@ximian.com>
10170 * expression.cs (Argument.ResolveMethodGroup): If we're a
10171 ConstructedType, call GetMemberAccess() on it.
10173 2004-03-29 Martin Baulig <martin@ximian.com>
10175 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10176 (MethodCore.CheckGenericOverride): When overriding a generic
10177 method, check whether the constraints match.
10179 * support.cs (GenericConstraints): New public interface.
10180 (ParameterData.GenericConstraints): New public method.
10182 * parameter.cs (Parameter.Resolve): Check whether we're a generic
10183 method parameter and compute our constraints if appropriate.
10184 (Parameter.GenericConstraints): New public property.
10186 * generic.cs (Constraints): Implement GenericConstraints.
10188 2004-03-29 Martin Baulig <martin@ximian.com>
10190 * decl.cs (MemberCache.FindMemberToOverride): Use
10191 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10193 2004-03-29 Martin Baulig <martin@ximian.com>
10195 * generic.cs (GenericMethod.Define): Resolve our type parameters.
10197 2004-03-29 Martin Baulig <martin@ximian.com>
10199 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10200 not allowed on non-generic declarations").
10202 2004-03-29 Martin Baulig <martin@ximian.com>
10204 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10205 public version of this method.
10207 * class.cs (MethodCore.IsDuplicateImplementation): Use
10208 Invocation.InferTypeArguments() to check this.
10210 2004-03-29 Martin Baulig <martin@ximian.com>
10212 * convert.cs: Use TypeManager.IsDelegateType() instead of
10213 comparing types correctly.
10215 2004-03-29 Martin Baulig <martin@ximian.com>
10217 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10218 types directly to make it work for generic instances.
10220 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10222 2004-03-29 Martin Baulig <martin@ximian.com>
10224 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10225 support for arrays.
10227 2004-03-24 Martin Baulig <martin@ximian.com>
10229 * decl.cs (DeclSpace.FindType): Also use
10230 TypeManager.CheckGeneric() for types from the using clauses.
10232 2004-03-23 Martin Baulig <martin@ximian.com>
10234 * expression.cs (Invocation.OverloadResolve): Added `bool
10235 may_fail' argument and use it instead of the Location.IsNull() hack.
10237 2004-03-23 Martin Baulig <martin@ximian.com>
10239 * expression.cs (Invocation.InferType): Use correct type inference
10242 2004-03-23 Martin Baulig <martin@ximian.com>
10244 * ecore.cs (MethodGroupExpr.Name): Use
10245 TypeManager.CSharpSignature() instead of just the name.
10247 * expression.cs (Invocation.OverloadResolve): Provide better error
10249 (Invocation.DoResolve): OverloadResolve() never returns null
10250 without reporting an error, so removed the error -6 reporting here.
10252 2004-03-23 Martin Baulig <martin@ximian.com>
10254 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10257 * cs-parser.jay (delegate_declaration): Support generic delegates.
10259 * delegate.cs: Support generic delegates.
10261 2004-03-22 Martin Baulig <martin@ximian.com>
10263 * expression.cs (Invocation.InferParamsTypeArguments): New static
10264 method; does type inference for params arguments.
10266 2004-03-21 Martin Baulig <martin@ximian.com>
10268 * typemanager.cs (TypeManager.IsGenericMethod): New public static
10269 method; checks whether a method is a generic method.
10271 * expression.cs (Invocation.InferTypeArguments): New static method;
10272 infer type arguments for generic method invocation.
10274 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10275 property; we set this to true if we're resolving a generic method
10276 invocation and the user specified type arguments, ie. we're not
10277 doing type inference.
10279 2004-03-20 Martin Baulig <martin@ximian.com>
10281 * class.cs (MethodData.DeclaringType): New public property.
10282 (MethodData.Define): Set DeclaringType here.
10283 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10284 instead of OperatorMethodBuilder.DeclaringType.
10286 2004-03-20 Martin Baulig <martin@ximian.com>
10288 * cs-tokenizer.cs (xtoken): Return a special
10289 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10291 * cs-parser.jay (default_value_expression): Switch to the new
10294 2004-03-19 Martin Baulig <martin@ximian.com>
10296 * decl.cs (MemberName): New class. We use this to "construct"
10297 namespace_or_type_name's.
10299 * generics.cs (TypeArguments.GetDeclarations): New public method;
10300 returns the type arguments as a string[] and reports a CS0081 if
10301 one of them is not an identifier.
10303 * class.cs (MemberBase): The .ctor now takes the name as a
10304 MemberName instead of a string.
10305 (MemberBase.ExplicitInterfaceName): Changed type from string to
10307 (MemberBase.DoDefine): If we're an explicit implementation, the
10308 InterfaceType may be a generic instance.
10310 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10311 (namespace_name): Call MemberName.GetName () to transform the
10312 MemberName into a string and ensure we don't have any type
10314 (type_name): Call MemberName.GetTypeExpression() to transfrom the
10315 MemberName into an expression.
10316 (method_header): Use namespace_or_type_name instead of member_name.
10318 2004-04-07 Miguel de Icaza <miguel@ximian.com>
10320 * rootcontext.cs: Add new types to the boot resolution.
10322 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10323 MulticastDelegate is not allowed.
10325 * typemanager.cs: Add new types to lookup: System.TypedReference
10328 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10329 check for TypedReference or ArgIterator, they are not allowed.
10331 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10332 makes us properly catch 1510 in some conditions (see bug 56016 for
10335 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
10337 * CryptoConvert.cs: update from corlib version
10340 2004-04-05 Miguel de Icaza <miguel@ximian.com>
10342 * class.cs (Indexer.Define): Check indexername declaration
10344 2004-04-05 Marek Safar <marek.safar@seznam.cz>
10346 * attribute.cs (IsClsCompliant): Fixed problem with handling
10347 all three states (compliant, not-compliant, undetected).
10349 2004-03-30 Marek Safar <marek.safar@seznam.cz>
10351 * attribute.cs (Attribute): Location is now public.
10352 (Resolve): Store resolved arguments (pos_values) in attribute class.
10353 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10354 (GetClsCompliantAttributeValue): New method that gets
10355 CLSCompliantAttribute value.
10356 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10357 if exists else null.
10358 (AttributeTester): New class for CLS-Compliant verification routines.
10360 * class.cs (Emit): Add CLS-Compliant verification.
10361 (Method.GetSignatureForError): Implemented.
10362 (Constructor.GetSignatureForError): Implemented
10363 (Constructor.HasCompliantArgs): Returns if constructor has
10364 CLS-Compliant arguments.
10365 (Constructor.Emit): Override.
10366 (Construcor.IsIdentifierClsCompliant): New method; For constructors
10367 is needed to test only parameters.
10368 (FieldBase.GetSignatureForError): Implemented.
10369 (TypeContainer): New member for storing base interfaces.
10370 (TypeContainer.FindMembers): Search in base interfaces too.
10372 * codegen.cs (GetClsComplianceAttribute): New method that gets
10373 assembly or module CLSCompliantAttribute value.
10374 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10376 (ModuleClass.Emit): Add error 3012 test.
10378 * const.cs (Emit): Override and call base for CLS-Compliant tests.
10380 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10381 state for all decl types.
10382 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10383 if CLS-Compliant tests are required.
10384 (IsClsCompliaceRequired): New method. Analyze whether code
10385 must be CLS-Compliant.
10386 (IsExposedFromAssembly): New method. Returns true when MemberCore
10387 is exposed from assembly.
10388 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10389 value or gets cached value.
10390 (HasClsCompliantAttribute): New method. Returns true if MemberCore
10391 is explicitly marked with CLSCompliantAttribute.
10392 (IsIdentifierClsCompliant): New abstract method. This method is
10393 used to testing error 3005.
10394 (IsIdentifierAndParamClsCompliant): New method. Common helper method
10395 for identifier and parameters CLS-Compliant testing.
10396 (VerifyClsCompliance): New method. The main virtual method for
10397 CLS-Compliant verifications.
10398 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10399 null. I don't know why is null (too many public members !).
10400 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10401 and get value of first CLSCompliantAttribute that found.
10403 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10404 (VerifyClsCompliance): Override and add extra tests.
10406 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10407 clscheck- disable CLS-Compliant verification event if assembly is has
10408 CLSCompliantAttribute(true).
10410 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10411 ApllyAttribute is now called in emit section as in the other cases.
10412 Possible future Emit integration.
10413 (IsIdentifierClsCompliant): New override.
10414 (VerifyClsCompliance): New override.
10415 (GetEnumeratorName): Returns full enum name.
10417 * parameter.cs (GetSignatureForError): Implemented.
10419 * report.cs (WarningData): New struct for Warning message information.
10420 (LocationOfPreviousError): New method.
10421 (Warning): New method. Reports warning based on the warning table.
10422 (Error_T): New method. Reports error based on the error table.
10424 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10425 verifications are done here.
10427 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10429 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10430 CLSCompliantAttribute.
10431 (all_imported_types): New member holds all imported types from other
10433 (LoadAllImportedTypes): New method fills static table with exported types
10434 from all referenced assemblies.
10435 (Modules): New property returns all assembly modules.
10437 2004-03-30 Miguel de Icaza <miguel@ximian.com>
10439 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10440 throwing a parser error.
10442 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10443 which removes the hardcoded get_/set_ prefixes for properties, as
10444 IL allows for the properties to be named something else.
10448 * expression.cs: Do not override operand before we know if it is
10449 non-null. Fix 56207
10451 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10453 * typemanager.cs: support for pinned variables.
10455 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10457 * decl.cs, typemanager.cs: Avoid using an arraylist
10458 as a buffer if there is only one result set.
10460 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10462 * expression.cs: Make sure you cant call a static method
10463 with an instance expression, bug #56174.
10465 2004-03-29 Miguel de Icaza <miguel@ximian.com>
10467 * class.cs (IsDuplicateImplementation): Improve error reporting to
10468 flag 663 (method only differs in parameter modifier).
10470 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10471 in preprocessor directives.
10473 * location.cs (LookupFile): Allow for the empty path.
10475 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
10476 better approach for some of that patch, but its failing with the
10477 CharSet enumeration. For now try/catch will do.
10479 * typemanager.cs: Do not crash if a struct does not have fields.
10482 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10484 * expression.cs: cs0213, cant fix a fixed expression.
10487 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10489 * cs-parser.jay: detect invalid embeded statements gracefully.
10492 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10494 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10497 the invocation type may not be a subclass of the tye of the item/
10498 The type of the item must be a subclass of the invocation item.
10503 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
10505 * attribute.cs: Added methods to get a string and a bool from an
10506 attribute. Required to information from AssemblyKeyFileAttribute,
10507 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10508 * codegen.cs: Modified AssemblyName creation to include support for
10509 strongnames. Catch additional exceptions to report them as CS1548.
10510 * compiler.csproj: Updated include CryptoConvert.cs.
10511 * compiler.csproj.user: Removed file - user specific configuration.
10512 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
10513 Mono.Security assembly. The original class is maintained and tested in
10514 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10515 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10516 like CSC 8.0 (C# v2) supports.
10517 * Makefile: Added CryptoConvert.cs to mcs sources.
10518 * rootcontext.cs: Added new options for strongnames.
10520 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
10522 * driver.cs: For --expect-error, report error code `2'
10523 if the program compiled with no errors, error code `1' if
10524 it compiled with an error other than the one expected.
10526 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
10528 * compiler.csproj: Updated for Visual Studio .NET 2003.
10529 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10530 * compiler.sln: Updated for Visual Studio .NET 2003.
10532 2004-03-24 Ravi Pratap M <ravi@ximian.com>
10534 * expression.cs: Fix bug #47234. We basically need to apply the
10535 rule that we prefer the conversion of null to a reference type
10536 when faced with a conversion to 'object' (csc behaviour).
10538 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10540 * statement.cs: Shorter form for foreach, eliminates
10541 a local variable. r=Martin.
10543 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10545 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10546 checks if we can use brtrue/brfalse to test for 0.
10547 * expression.cs: use the above in the test for using brtrue/brfalse.
10548 cleanup code a bit.
10550 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10552 * expression.cs: Rewrite string concat stuff. Benefits:
10554 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10555 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10556 rather than a concat chain.
10558 * typemanager.cs: Add lookups for more concat overloads.
10560 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10562 * expression.cs: Emit shorter il code for array init.
10579 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
10581 * statement.cs: Before, two switch blocks would be merged if the
10582 total size of the blocks (end_item - begin_item + 1) was less than
10583 two times the combined sizes of the blocks.
10585 Now, it will only merge if after the merge at least half of the
10590 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
10592 * class.cs : csc build fix for GetMethods(). See bug #52503.
10594 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
10596 * expression.cs: Make sure fp comparisons work with NaN.
10597 This fixes bug #54303. Mig approved this patch a long
10598 time ago, but we were not able to test b/c the runtime
10601 2004-03-19 Miguel de Icaza <miguel@ximian.com>
10603 * ecore.cs (TypExpr.GetHashCode): implement this overload.
10605 2004-03-19 Martin Baulig <martin@ximian.com>
10607 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10608 two overloads may unify for some type parameter substitutions and
10609 report a CS0408 if appropriate.
10611 2004-03-19 Martin Baulig <martin@ximian.com>
10613 * class.cs (MemberCore.IsDuplicateImplementation): Report the
10614 error here and not in our caller.
10616 2004-03-19 Martin Baulig <martin@ximian.com>
10618 * interface.cs: Completely killed this file.
10619 (Interface): We're now a TypeContainer and live in class.cs.
10621 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10622 argument; we're now also called for interfaces.
10623 (TypeContainer.DefineMembers): Allow this method being called
10625 (TypeContainer.GetMethods): New public method; formerly known as
10626 Interface.GetMethod(). This is used by PendingImplementation.
10627 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10628 it's now private and non-static.
10629 (Interface): Moved this here; it's now implemented similar to
10631 (Method, Property, Event, Indexer): Added `bool is_interface'
10632 argument to their .ctor's.
10633 (MemberBase.IsInterface): New public field.
10635 * cs-parser.jay: Create normal Method, Property, Event, Indexer
10636 instances instead of InterfaceMethod, InterfaceProperty, etc.
10637 (opt_interface_base): Removed; we now use `opt_class_base' instead.
10638 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10640 2004-03-19 Martin Baulig <martin@ximian.com>
10642 * class.cs (MethodCore.IsDuplicateImplementation): New private
10643 method which does the CS0111 checking.
10644 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10645 Use IsDuplicateImplementation().
10647 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
10649 * decl.cs (FindMemberToOverride): New method to find the correct
10650 method or property to override in the base class.
10652 - Make Method/Property use the above method to find the
10653 version in the base class.
10654 - Remove the InheritableMemberSignatureCompare as it is now
10657 This patch makes large code bases much faster to compile, as it is
10658 O(n) rather than O(n^2) to do this validation.
10660 Also, it fixes bug 52458 which is that nested classes are not
10661 taken into account when finding the base class member.
10663 Reviewed/Approved by Martin.
10665 2004-03-17 Martin Baulig <martin@ximian.com>
10667 * expression.cs (MemberAccess.DoResolve): Take the parent's number
10668 of type arguments into account; use the `real_num_type_args'
10669 approach like in DoResolveAsTypeStep().
10671 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10674 2004-03-17 Marek Safar <marek.safar@seznam.cz>
10676 * interface.cs: In all interface classes removed redundant
10677 member initialization.
10679 2004-03-16 Martin Baulig <martin@ximian.com>
10681 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10683 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10685 * decl.cs (DefineTypeAndParents): New helper method to define a
10686 type's containers before the type itself is defined; This is a
10687 bug exposed by the recent changes to Windows.Forms when an
10688 implemented interface was defined inside a class that had not been
10691 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10693 (Check): Loop correctly to report errors modifiers
10694 (UNSAFE was not in the loop, since it was the same as TOP).
10696 * interface.cs: Every interface member now takes a ModFlags,
10697 instead of a "is_new" bool, which we set on the base MemberCore.
10699 Every place where we called "UnsafeOk" in the interface, now we
10700 call the proper member (InterfaceMethod.UnsafeOK) instead to get
10701 the unsafe settings from the member declaration instead of the
10702 container interface.
10704 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
10706 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10707 `set_indexer_name' to the pending bits (one per type).
10709 We fixed a bug today that was picking the wrong method to
10710 override, since for properties the existing InterfaceMethod code
10711 basically ignored the method name. Now we make sure that the
10712 method name is one of the valid indexer names.
10714 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
10716 * support.cs (SeekableStreamReader): Keep track of stream byte
10717 positions and don't mix them with character offsets to the buffer.
10719 Patch from Gustavo Giráldez
10721 2004-03-15 Marek Safar <marek.safar@seznam.cz>
10723 * interface.cs (InterfaceSetGetBase): Removed double member
10724 initialization, base class does it as well.
10726 2004-03-13 Martin Baulig <martin@ximian.com>
10728 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10729 when compiling corlib.
10731 2004-03-13 Miguel de Icaza <miguel@ximian.com>
10733 * convert.cs (ExplicitConversion): We were reporting an error on
10734 certain conversions (object_type source to a value type, when the
10735 expression was `null') before we had a chance to pass it through
10736 the user defined conversions.
10738 * driver.cs: Replace / and \ in resource specifications to dots.
10741 * class.cs: Add check for duplicate operators. Fixes 52477
10743 2004-03-11 Miguel de Icaza <miguel@ximian.com>
10745 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10746 that are in the middle of the statements, not only at the end.
10749 * class.cs (TypeContainer.AddField): No longer set the
10750 `HaveStaticConstructor' flag, now we call it
10751 `UserDefineStaticConstructor' to diferentiate the slightly
10752 semantic difference.
10754 The situation is that we were not adding BeforeFieldInit (from
10755 Modifiers.TypeAttr) to classes that could have it.
10756 BeforeFieldInit should be set to classes that have no static
10761 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10763 And most importantly Zoltan's comment:
10765 http://bugzilla.ximian.com/show_bug.cgi?id=44229
10767 "I think beforefieldinit means 'it's ok to initialize the type sometime
10768 before its static fields are used', i.e. initialization does not need
10769 to be triggered by the first access to the type. Setting this flag
10770 helps the JIT to compile better code, since it can run the static
10771 constructor at JIT time, and does not need to generate code to call it
10772 (possibly lots of times) at runtime. Unfortunately, mcs does not set
10773 this flag for lots of classes like String.
10775 csc sets this flag if the type does not have an explicit static
10776 constructor. The reasoning seems to be that if there are only static
10777 initalizers for a type, and no static constructor, then the programmer
10778 does not care when this initialization happens, so beforefieldinit
10781 This bug prevents the AOT compiler from being usable, since it
10782 generates so many calls to mono_runtime_class_init that the AOT code
10783 is much slower than the JITted code. The JITted code is faster,
10784 because it does not generate these calls if the vtable is type is
10785 already initialized, which is true in the majority of cases. But the
10786 AOT compiler can't do this."
10788 2004-03-10 Miguel de Icaza <miguel@ximian.com>
10790 * class.cs (MethodData.Emit): Refactor the code so symbolic
10791 information is generated for destructors; For some reasons we
10792 were taking a code path that did not generate symbolic information
10795 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
10797 * class.cs: Create a Constructor.CheckBase method that
10798 takes care of all validation type code. The method
10799 contains some code that was moved from Define.
10801 It also includes new code that checks for duplicate ctors.
10802 This fixes bug #55148.
10804 2004-03-09 Joshua Tauberer <tauberer@for.net>
10806 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10807 a { ... }-style array creation invokes EmitStaticInitializers
10808 which is not good for reference-type arrays. String, decimal
10809 and now null constants (NullCast) are not counted toward
10810 static initializers.
10812 2004-03-05 Martin Baulig <martin@ximian.com>
10814 * location.cs (SourceFile.HasLineDirective): New public field;
10815 specifies whether the file contains or is referenced by a "#line"
10817 (Location.DefineSymbolDocuments): Ignore source files which
10818 either contain or are referenced by a "#line" directive.
10820 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
10822 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10823 direct access to our parent, so check the method inline there.
10825 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
10827 * expression.cs (Invocation.EmitCall): Miguel's last commit
10828 caused a regression. If you had:
10833 In Foo the implict this would be null.
10835 2004-02-27 Miguel de Icaza <miguel@ximian.com>
10837 * expression.cs (Invocation.EmitCall): If the method is not
10838 virtual, do not emit a CallVirt to it, use Call.
10840 * typemanager.cs (GetFullNameSignature): Improve the method to
10841 cope with ".ctor" and replace it with the type name.
10843 * class.cs (ConstructorInitializer.Resolve): Now the method takes
10844 as an argument the ConstructorBuilder where it is being defined,
10845 to catch the recursive constructor invocations.
10847 2004-03-16 Martin Baulig <martin@ximian.com>
10849 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
10850 ConstructedType, call ResolveType() on it to get the type rather
10851 than just using `expr.Type'.
10853 2004-03-16 Martin Baulig <martin@ximian.com>
10855 * generics.cs (ConstructedType.GetMemberAccess): Take the
10856 EmitContext instead on the TypeExpr and use
10857 ec.TypeContainer.CurrentType/ec.ContainerType.
10859 2004-03-16 Martin Baulig <martin@ximian.com>
10861 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
10862 parameters before aliases.
10864 2004-03-16 Martin Baulig <martin@ximian.com>
10866 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
10867 New oublic function; checks whether two generic instances may become
10868 equal under some instantiations (26.3.1).
10870 * class.cs (TypeContainer.Define): Call
10871 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
10874 2004-03-16 Martin Baulig <martin@ximian.com>
10876 * class.cs (TypeContainer.GetClassBases): Moved
10877 Error_TypeParameterAsBase() here and also check whether the base
10878 class is not an attribute.
10880 2004-03-16 Martin Baulig <martin@ximian.com>
10882 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10884 2004-03-16 Martin Baulig <martin@ximian.com>
10886 * class.cs (Error_TypeParameterAsBase): Use correct error number
10889 2004-03-16 Martin Baulig <martin@ximian.com>
10891 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
10894 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
10897 2004-03-15 Martin Baulig <martin@ximian.com>
10899 * typemanager.cs (TypeManager.GetFullName): New public method.
10900 (TypeManager.MemberLookup): Added `int_num_type_arguments'
10901 argument; only return members with the correct number of type
10903 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
10904 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
10905 whether the number of type arguments matches.
10907 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
10908 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
10910 * expression.cs (MemberAccess): Added public `NumTypeArguments'
10911 field; it's set by the protected .ctor when we're actually a
10912 GenericMemberAccess.
10913 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
10914 arguments and pass it to MemberLookupFinal ().
10916 * ecore.cs (Expression.MemberLookup): Added `int
10917 num_type_arguments' argument; only return members with the correct
10918 number of type arguments.
10919 (Expression.MemberLookupFailed): Check whether the MemberLookup
10920 failed because we did not have the correct number of type
10921 arguments; report CS0305 in this case.
10923 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
10924 `e.ResolveAsTypeTerminal()' already did so.
10926 2004-03-15 Martin Baulig <martin@ximian.com>
10928 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
10929 we're a ConstructedType; in this case, the caller must report an
10930 error (for instance CS0131).
10932 * generic.cs (TypeArguments): Added Location argument to the .ctor.
10933 (TypeArguments.Resolve): Actually report errors here.
10935 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10937 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10938 `set_indexer_name' to the pending bits (one per type).
10940 We fixed a bug today that was picking the wrong method to
10941 override, since for properties the existing InterfaceMethod code
10942 basically ignored the method name. Now we make sure that the
10943 method name is one of the valid indexer names.
10945 2004-03-15 Martin Baulig <martin@ximian.com>
10947 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
10948 for generic instances.
10950 2004-03-13 Martin Baulig <martin@ximian.com>
10952 * class.cs (TypeContainer.DefineType): Call
10953 TypeManager.AddUserType() immediately after creating the
10954 TypeBuilder; pass all type parameters when creating the
10957 * decl.cs (DeclSpace.FindNestedType): New public method.
10958 (DeclSpace.FindType): Added `int num_type_args' argument; only
10959 return types with the correct number of type parameters.
10960 (DeclSpace.CountTypeParams): New public property.
10962 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
10963 the number of type parameters; defaults to zero.
10965 * generic.cs (TypeArguments.Count): New public property.
10966 (ConstructedType.DoResolveAsTypeStep): First call
10967 ds.FindNestedType() to find out whether we're nested in the
10968 current generic type; in this case, we inherit all type parameters
10969 from the current class.
10971 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
10972 num_type_args' argument.
10973 (RootContext.LookupType): Added overloaded version which takes the
10974 number of type arguments; only return types with the correct
10975 number of type arguments.
10977 * typemanager.cs (TypeManager.CheckGeneric): New public function;
10978 checks whether `Type t' has `int num_type_args'.
10980 2004-03-13 Martin Baulig <martin@ximian.com>
10982 * generic.cs (GenericMethod.DefineType): New method; calls
10983 DefineType() on all the type parameters.
10985 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
10986 (MethodData.Define): If we're a generic method, call
10987 GenericMethod.DefineType() to define the type parameters.
10989 2004-03-10 Martin Baulig <martin@ximian.com>
10991 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
10992 instead of IsAssignableFrom.
10994 2004-03-10 Martin Baulig <martin@ximian.com>
10996 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
10998 * support.cs (ParameterData.HasArrayParameter): New property.
10999 (ReflectionParameters.ctor): Take a MethodBase instead of a
11000 ParameterInfo[]. If we have any type parameters, get the generic
11001 method definition and ask it whether we have variable arguments.
11003 2004-02-26 Miguel de Icaza <miguel@ximian.com>
11005 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11006 routines to check if a type is an enumerable/enumerator allow
11007 classes that implement the IEnumerable or IEnumerator interfaces.
11009 * class.cs (Property, Operator): Implement IIteratorContainer, and
11010 implement SetYields.
11012 (Property.Define): Do the block swapping for get_methods in the
11013 context of iterators. We need to check if Properties also
11014 include indexers or not.
11016 (Operator): Assign the Block before invoking the
11017 OperatorMethod.Define, so we can trigger the Iterator code
11020 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
11021 Property and Operator classes are not created when we parse the
11022 declarator but until we have the block completed, so we use a
11023 singleton SimpleIteratorContainer.Simple to flag whether the
11024 SetYields has been invoked.
11026 We propagate this setting then to the Property or the Operator to
11027 allow the `yield' to function.
11029 2004-02-25 Marek Safar <marek.safar@seznam.cz>
11031 * codegen.cs: Implemented attribute support for modules.
11032 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11033 Assembly/Module functionality.
11035 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11036 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11037 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11039 2004-02-16 Marek Safar <marek.safar@seznam.cz>
11041 * interface.cs (FindMembers): The operation is performed on all base
11042 interfaces and not only on the first. It is required for future CLS Compliance patch.
11044 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
11046 * statement.cs, codegen.cs:
11047 This patch deals with patterns such as:
11049 public class List : IEnumerable {
11051 public MyEnumerator GetEnumerator () {
11052 return new MyEnumerator(this);
11055 IEnumerator IEnumerable.GetEnumerator () {
11059 public struct MyEnumerator : IEnumerator {
11064 Before, there were a few things we did wrong:
11065 1) we would emit callvirt on a struct, which is illegal
11066 2) we emited ldarg when we needed to emit ldarga
11067 3) we would mistakenly call the interface methods on an enumerator
11068 type that derived from IEnumerator and was in another assembly. For example:
11070 public class MyEnumerator : IEnumerator
11072 Would have the interface methods called, even if there were public impls of the
11073 method. In a struct, this lead to invalid IL code.
11075 2004-02-11 Marek Safar <marek.safar@seznam.cz>
11077 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11080 * delegate.cs (Define): Fixed crash when delegate type is undefined.
11082 2004-02-11 Miguel de Icaza <miguel@ximian.com>
11084 * cs-parser.jay: Fix small regression: we were not testing V2
11085 compiler features correctly.
11087 * interface.cs: If the emit context is null, then create one
11089 2004-02-09 Marek Safar <marek.safar@seznam.cz>
11091 * decl.cs (GetSignatureForError): New virtual method to get full name
11092 for error messages.
11094 * attribute.cs (IAttributeSupport): New interface for attribute setting.
11095 Now it is possible to rewrite ApplyAttributes method to be less if/else.
11097 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11098 Duplicated members and code in these classes has been removed.
11099 Better encapsulation in these classes.
11101 2004-02-07 Miguel de Icaza <miguel@ximian.com>
11103 * assign.cs (Assign.DoResolve): When dealing with compound
11104 assignments, there is a new rule in ECMA C# 2.4 (might have been
11105 there before, but it is documented here) that states that in:
11109 If b is of type int, and the `op' is a shift-operator, then the
11110 above is evaluated as:
11114 * expression.cs (Binary.ResolveOperator): Instead of testing for
11115 int/uint/long/ulong, try to implicitly convert to any of those
11116 types and use that in pointer arithmetic.
11118 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11119 method to print information for from the type, not from the
11120 null-method we were given.
11122 2004-02-01 Duncan Mak <duncan@ximian.com>
11124 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11125 parsing for cmd, fixes bug #53694.
11127 2004-02-04 Marek Safar <marek.safar@seznam.cz>
11129 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11130 in the member name duplication tests. Property and operator name duplication
11131 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11133 2004-02-03 Marek Safar <marek.safar@seznam.cz>
11135 * interface.cs (PopulateMethod): Fixed crash when interface method
11136 returns not existing type (error test cs0246-3.cs).
11138 2004-02-02 Ravi Pratap M <ravi@ximian.com>
11140 * cs-parser.jay (interface_accessors): Re-write actions to also
11141 store attributes attached to get and set methods. Fix spelling
11144 (inteface_property_declaration): Modify accordingly.
11146 (InterfaceAccessorInfo): New helper class to store information to pass
11147 around between rules that use interface_accessors.
11149 * interface.cs (Emit): Apply attributes on the get and set
11150 accessors of properties and indexers too.
11152 * attribute.cs (ApplyAttributes): Modify accordingly to use the
11153 right MethodBuilder when applying attributes to the get and set accessors.
11155 2004-01-31 Miguel de Icaza <miguel@ximian.com>
11157 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11159 2004-01-26 Miguel de Icaza <miguel@ximian.com>
11161 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11163 2004-01-25 Miguel de Icaza <miguel@ximian.com>
11165 * cs-parser.jay: Remove YIELD token, instead use the new grammar
11166 changes that treat `yield' specially when present before `break'
11167 or `return' tokens.
11169 * cs-tokenizer.cs: yield is no longer a keyword.
11171 2004-01-23 Marek Safar <marek.safar@seznam.cz>
11173 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11174 setting for default constructors.
11175 For default constructors are almost every time set wrong Modifier. The
11176 generated IL code has been alright. But inside mcs this values was
11177 wrong and this was reason why several of my CLS Compliance tests
11180 2004-02-27 Martin Baulig <martin@ximian.com>
11182 * generics.cs (ConstructedType.ResolveType): Make the nested type
11183 stuff actually work.
11185 2004-02-25 Martin Baulig <martin@ximian.com>
11187 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11188 property; returns the type parameters just from the current type,
11189 ie. with the ones from outer classes.
11190 (DeclSpace.LookupGeneric): First search in the current class, then
11192 (DeclSpace.initialize_type_params): When hiding a type parameter
11193 from an outer class, put it into the `type_param_list' anyways.
11195 * expression.cs (MemberAccess.expr): Made this field protected.
11197 * class.cs (TypeContainer.Define): The `CurrentType' just contains
11198 the type parameters from the current class.
11200 * generic.cs (ConstructedType.ResolveType): Support nested generic
11201 types by taking the type parameters which we inherit from outer
11202 classes into account.
11203 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11204 support for nested generic types.
11206 2004-02-23 Martin Baulig <martin@ximian.com>
11208 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11209 field and check whether we're nested inside a generic type.
11210 (DeclSpace.ResolveType): If we're resolving to a generic type
11211 definition, create a ConstructedType and return its resolved type.
11212 (DeclSpace.initialize_type_params): New private method;
11213 initializes the `type_param_list' field from the type parameters
11214 from this and all enclosing classes.
11215 (DeclSpace.TypeParameters): Call initialize_type_params() unless
11216 we're already initialized.
11218 2004-02-23 Martin Baulig <martin@ximian.com>
11220 * class.cs (Method.Define): Create the generic method before
11221 calling DoDefine().
11222 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11223 the TypeContainer one); we use this for generic methods.
11225 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11226 parent's TypeBuilder.
11228 2004-02-18 Martin Baulig <martin@ximian.com>
11230 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11231 to check for equality.
11233 2004-02-05 Martin Baulig <martin@ximian.com>
11235 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11236 `ec.TypeContainer.CurrentType', use it instead of
11237 `ec.ContainerType' to check whether we're in the type's ctor.
11239 2004-01-29 Martin Baulig <martin@ximian.com>
11241 * expression.cs (Invocation.DoResolve): If we're a
11242 `ConstructedType', then we're actually a generic method, so
11243 rewrite the expr as a GenericMemberAccess.
11245 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11246 here; manually parse it into a string.
11248 2004-01-28 Martin Baulig <martin@ximian.com>
11250 * typemanager.cs (TypeManager.IsEqual): New static method.
11251 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11252 check for equality instead of using `=='.
11254 2004-01-26 Martin Baulig <martin@ximian.com>
11256 * decl.cs (DeclSpace.CurrentType): New public field.
11258 * expression.cs (This.ResolveBase): If we have an
11259 `ec.TypeContainer.CurrentType', use it instead of
11260 `ec.ContainerType'.
11262 * class.cs (TypeContainer.DefineType): If we're a generic type,
11263 create the `CurrentType' (unresolved).
11264 (TypeContainer.GenericType): New private field.
11265 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11266 it and store it in `GenericType' before creating the MemberCache.
11267 (TypeContainer.GetMembers): If we have a `GenericType', call
11268 TypeManager.FindMembers() on it.
11270 * interface.cs (Interface.GenericType): New private field.
11271 (Interface.DefineType): If we're a generic type, create the
11272 `CurrentType' (unresolved).
11273 (Interface.DefineMembers): If we have a `CurrentType', resolve it
11274 and store it in `GenericType' before creating the MemberCache.
11275 (Interface.GetMembers): If we have a `GenericType', call
11276 TypeManager.FindMembers() on it.
11278 2004-01-22 Martin Baulig <martin@ximian.com>
11280 * cs-parser.jay (namespace_or_type_name): Return an Expression,
11281 not a QualifiedIdentifier. This is what `type_name_expression'
11282 was previously doing.
11283 (type_name_expression): Removed; the code is now in
11284 `namespace_or_type_name'.
11285 (qualified_identifier): Removed, use `namespace_or_type_name'
11287 (QualifiedIdentifier): Removed this class.
11289 2004-01-22 Martin Baulig <martin@ximian.com>
11291 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11292 not a string as alias name.
11294 2004-01-21 Miguel de Icaza <miguel@ximian.com>
11296 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11297 #52730 bug, and instead compute correctly the need to use a
11298 temporary variable when requesting an address based on the
11299 static/instace modified of the field and the constructor.
11301 2004-01-21 Martin Baulig <martin@ximian.com>
11303 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11304 class and namespace before looking up aliases. Fixes #52517.
11306 2004-01-21 Martin Baulig <martin@ximian.com>
11308 * flowanalysis.cs (UsageVector.Merge): Allow variables being
11309 assinged in a 'try'; fixes exception4.cs.
11311 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11312 * class.cs : Implemented parameter-less constructor for TypeContainer
11314 * decl.cs: Attributes are now stored here. New property OptAttributes
11316 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11318 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11320 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11322 * typemanager.cs (CSharpSignature): Now reports also inner class name.
11323 (CSharpSignature): New method for indexer and property signature.
11325 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11327 * pending.cs (IsVirtualFilter): Faster implementation.
11329 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11331 * typemanager.cs: Avoid inclusion of same assembly more than once.
11333 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11335 * cs-parser.jay: Fixed problem where the last assembly attribute
11336 has been applied also to following declaration (class, struct, etc.)
11338 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11340 * class.cs: Added error CS0538, CS0539 reporting.
11341 Fixed crash on Microsoft runtime when field type is void.
11343 * cs-parser.jay: Added error CS0537 reporting.
11345 * pending.cs: Added error CS0535 reporting.
11346 Improved error report for errors CS0536, CS0534.
11348 2004-01-20 Miguel de Icaza <miguel@ximian.com>
11350 Merge a few bits from the Anonymous Method MCS tree.
11352 * statement.cs (ToplevelBlock): New class for toplevel methods,
11353 will hold anonymous methods, lifted variables.
11355 * cs-parser.jay: Create toplevel blocks for delegates and for
11356 regular blocks of code.
11358 2004-01-20 Martin Baulig <martin@ximian.com>
11360 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11361 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11362 and `NeedExplicitReturn'; added `IsLastStatement'.
11363 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11364 have a `ReturnLabel' or we're not unreachable.
11366 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11367 child's reachability; don't just override ours with it. Fixes
11368 #58058 (lluis's example).
11369 (FlowBranching): Added public InTryOrCatch(), InCatch(),
11370 InFinally(), InLoop(), InSwitch() and
11371 BreakCrossesTryCatchBoundary() methods.
11373 * statement.cs (Return): Do all error checking in Resolve().
11374 Unless we are the last statement in a top-level block, always
11375 create a return label and jump to it.
11376 (Break, Continue): Do all error checking in Resolve(); also make
11377 sure we aren't leaving a `finally'.
11378 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11379 statement in a top-level block.
11380 (Block.Flags): Added `IsDestructor'.
11381 (Block.IsDestructor): New public property.
11383 2004-01-20 Martin Baulig <martin@ximian.com>
11385 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11387 2004-01-20 Martin Baulig <martin@ximian.com>
11389 * statement.cs (Statement.ResolveUnreachable): New public method.
11390 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11391 (Block.Resolve): Resolve unreachable statements.
11393 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11395 * expression.cs: We need to fix the case where we do
11396 not have a temp variable here.
11398 * assign.cs: Only expression compound assignments need
11399 temporary variables.
11401 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11403 * flowanalysis.cs: Reduce memory allocation in a few ways:
11404 - A block with no variables should not allocate a bit
11406 - A method with no out parameters does not need any tracking
11407 for assignment of the parameters, so we need not allocate
11410 public readonly Type[] VariableTypes;
11411 public readonly string[] VariableNames;
11412 Are redundant. The data is already stored in the variable
11413 map, so we need not allocate another array for it.
11414 - We need to add alot of checks for if (params | locals) == null
11415 due to the first two changes.
11417 2004-01-18 Miguel de Icaza <miguel@ximian.com>
11419 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11420 implement IMemoryLocation, we store a copy on a local variable and
11421 take the address of it. Patch from Benjamin Jemlich
11423 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11424 to use a special "type_name_expression" rule which reduces the
11425 number of "QualifiedIdentifier" classes created, and instead
11426 directly creates MemberAccess expressions.
11428 2004-01-17 Miguel de Icaza <miguel@ximian.com>
11430 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11431 that fixes #52853. Null literal assignment to ValueType
11433 * class.cs (MethodData.Emit): Instead of checking the name of the
11434 method to determine if its a destructor, create a new derived
11435 class from Method called Destructor, and test for that.
11437 * cs-parser.jay: Create a Destructor object instead of a Method.
11439 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11443 2004-01-16 Miguel de Icaza <miguel@ximian.com>
11445 * expression.cs (Binary.ResolveOperator): Perform an implicit
11446 conversion from MethodGroups to their delegate types on the
11447 Addition operation.
11449 * delegate.cs: Introduce a new class DelegateCreation that is the
11450 base class for `NewDelegate' and `ImplicitDelegateCreation',
11451 factor some code in here.
11453 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11454 conversion from MethodGroups to compatible delegate types.
11456 * ecore.cs (Expression.Resolve): Do not flag error 654
11457 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11458 we allow conversions from MethodGroups to delegate types now.
11460 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11461 assignments in v2 either.
11463 2004-01-10 Miguel de Icaza <miguel@ximian.com>
11465 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11466 static read-only fields in ctors.
11468 Applied patch from Benjamin Jemlich
11470 * expression.cs (UnaryMutator): Avoid leaking local variables.
11472 2004-01-09 Miguel de Icaza <miguel@ximian.com>
11474 * cs-tokenizer.cs (IsCastToken): Allow the various native types
11475 here to return true, as they can be used like this:
11477 (XXX) int.MEMBER ()
11479 Fixed 49836 and all the other dups
11481 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
11483 * driver.cs: Implement /win32res and /win32icon.
11485 2004-01-08 Miguel de Icaza <miguel@ximian.com>
11487 * cs-parser.jay: Add a rule to improve error handling for the
11488 common mistake of placing modifiers after the type.
11490 2004-01-07 Miguel de Icaza <miguel@ximian.com>
11492 * cs-parser.jay (interface_event_declaration): Catch
11493 initialization of events on interfaces, and report cs0068
11495 * cs-parser.jay (interface_event_declaration): Catch
11496 initialization of events.
11498 * ecore.cs: Better report missing constructors.
11500 * expression.cs (Binary.ResolveOperator): My previous bug fix had
11501 the error reporting done in the wrong place. Fix.
11503 * expression.cs (Binary.ResolveOperator): Catch the
11504 operator + (E x, E y) error earlier, and later allow for implicit
11505 conversions in operator +/- (E e, U x) from U to the underlying
11508 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11509 52596, if the container class is abstract, the default constructor
11510 is protected otherwise its public (before, we were always public).
11512 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11515 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11516 Jemlich that fixes bug #52597, MCS was generating invalid code for
11517 idisposable structs. Thanks to Ben for following up with this
11520 2004-01-06 Miguel de Icaza <miguel@ximian.com>
11522 * driver.cs: Allow assemblies without code to be generated, fixes
11525 2004-01-07 Nick Drochak <ndrochak@gol.com>
11527 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11529 2004-01-05 Miguel de Icaza <miguel@ximian.com>
11531 * cs-parser.jay: Add rules to improve error reporting if fields or
11532 methods are declared at the namespace level (error 116)
11534 * Add rules to catch event add/remove
11536 2004-01-04 David Sheldon <dave-mono@earth.li>
11538 * expression.cs: Added matching ")" to error message for
11541 2004-01-03 Todd Berman <tberman@gentoo.org>
11543 * ecore.cs, attribute.cs:
11544 Applying fix from #52429.
11546 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11548 * ecore.cs, expression.cs, statement.cs:
11549 Total rewrite of how we handle branching. We
11550 now handle complex boolean expressions with fewer
11551 jumps. As well if (x == 0) no longer emits a ceq.
11553 if (x is Foo) is much faster now, because we generate
11556 Overall, we get a pretty big improvement on our benchmark
11557 tests. The code we generate is smaller and more readable.
11559 I did a full two-stage bootstrap. The patch was reviewed
11560 by Martin and Miguel.
11562 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11564 * cs-parser.jay: Make primary_expression not take a QI.
11565 we dont need this because the member_access rule covers
11566 us here. So we replace the rule with just IDENTIFIER.
11568 This has two good effects. First, we remove a s/r conflict.
11569 Second, we allocate many fewer QualifiedIdentifier objects.
11571 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11573 * attribute.cs: Handle MarshalAs attributes as pseudo, and
11574 set the correct information via SRE. This prevents
11575 hanging on the MS runtime. Fixes #29374.
11577 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11579 * convert.cs: correctly handle conversions to value types
11580 from Enum and ValueType as unboxing conversions.
11582 Fixes bug #52569. Patch by Benjamin Jemlich.
11584 2004-01-02 Ravi Pratap <ravi@ximian.com>
11586 * expression.cs (BetterConversion): Prefer int -> uint
11587 over int -> ulong (csc's behaviour). This fixed bug #52046.
11589 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
11591 * decl.cs (MemberCache.FindMembers): now returns a
11594 * typemanager.cs: In general, go with with ^^.
11595 (CopyNewMethods): take an IList.
11596 (RealMemberLookup): Only allocate an arraylist
11597 if we copy from two sets of methods.
11599 This change basically does two things:
11600 1) Fewer array lists allocated due to CopyNewMethods.
11601 2) the explicit cast in MemberList costed ALOT.
11603 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
11605 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11606 a hashtable to avoid needless string allocations when an identifier is
11607 used more than once (the common case).
11609 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11611 * pending.cs: MS's TypeBuilder.GetInterfaces ()
11612 is broken, it will not return anything. So, we
11613 have to use the information we have in mcs to
11616 * typemanager.cs: Add a cache for GetInterfaces,
11617 since this will now be used more often (due to ^^)
11619 (GetExplicitInterfaces) New method that gets the
11620 declared, not effective, interfaces on a type
11621 builder (eg, if you have interface IFoo, interface
11622 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11625 This patch makes MCS able to bootstrap itself on
11628 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11630 * expression.cs: Remove the Nop's that Miguel put
11633 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11635 * report.cs, codegen.cs: Give the real stack trace to
11636 the error when an exception is thrown.
11638 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11640 * decl.cs: only allocate hashtables for ifaces if
11643 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11645 * expression.cs: fix the error from cs0121-2.cs
11646 (a parent interface has two child interfaces that
11647 have a function with the same name and 0 params
11648 and the function is called through the parent).
11650 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
11652 * class.cs, rootcontext.cs, typmanager.cs: do not
11655 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
11657 * codegen.cs: remove stack for the ec flow branching.
11658 It is already a linked list, so no need.
11660 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
11662 * Makefile: Allow custom profiler here.
11664 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11666 * typemanager.cs (LookupType):
11667 - Use a static char [], because split takes
11668 a param array for args, so it was allocating
11670 - Do not store true in a hashtable, it boxes.
11672 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11674 * flowanalysis.cs: bytify common enums.
11676 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11678 * modifiers.cs: Add a new set of flags for the
11679 flags allowed on explicit interface impls.
11680 * cs-parser.jay: catch the use of modifiers in
11681 interfaces correctly.
11682 * class.cs: catch private void IFoo.Blah ().
11684 All related to bug #50572.
11686 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11688 * decl.cs: Rewrite the consistant accessability checking.
11689 Accessability is not linear, it must be implemented in
11690 a tableish way. Fixes #49704.
11692 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11694 * expression.cs: Handle negation in a checked context.
11695 We must use subtraction from zero. Fixes #38674.
11697 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11699 * class.cs: Ignore static void main in DLLs.
11700 * rootcontext.cs: Handle the target type here,
11701 since we are have to access it from class.cs
11702 * driver.cs: account for the above.
11704 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11706 * report.cs: Give line numbers and files if available.
11708 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
11710 * driver.cs: Implement /addmodule.
11712 * typemanager.cs: Change 'modules' field so it now contains Modules not
11715 2003-12-20 Martin Baulig <martin@ximian.com>
11717 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11718 (FieldBase.IsAssigned): Removed this field.
11719 (FieldBase.SetAssigned): New public method.
11720 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11722 2003-12-20 Martin Baulig <martin@ximian.com>
11724 * expression.cs (LocalVariableReference.DoResolve): Don't set
11725 `vi.Used' if we're called from DoResolveLValue().
11727 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11728 returns the usage vector it just merged into the current one -
11729 pass this one to UsageWarning().
11730 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11731 of the `EmitContext', don't call this recursively on our children.
11733 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
11735 * driver.cs: Implement /target:module.
11737 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
11739 * support.cs (CharArrayHashtable): New helper class.
11741 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
11742 char arrays, not strings, so we can avoid creating a string in
11743 consume_identifier if the identifier is a keyword.
11745 2003-12-16 Martin Baulig <martin@ximian.com>
11747 * statement.cs (LocalInfo.Assigned): Removed this property.
11748 (LocalInfo.Flags): Removed `Assigned'.
11749 (LocalInfo.IsAssigned): New public method; takes the EmitContext
11750 and uses flow analysis.
11751 (Block.UsageWarning): Made this method private.
11752 (Block.Resolve): Call UsageWarning() if appropriate.
11754 * expression.cs (LocalVariableReference.DoResolve): Always set
11755 LocalInfo.Used here.
11757 2003-12-13 Martin Baulig <martin@ximian.com>
11759 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11760 any value here; we're now using flow analysis to figure out
11761 whether a statement/block returns a value.
11763 2003-12-13 Martin Baulig <martin@ximian.com>
11765 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11767 (FlowBranching.MergeFinally): Don't call
11768 `branching.CheckOutParameters()' here, this is called in
11770 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11771 when adding the `finally' vector.
11773 2003-12-13 Martin Baulig <martin@ximian.com>
11776 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11777 actually work and also fix #48962.
11779 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
11781 * decl.cs: Do not check System.Object for nested types,
11782 since we know it does not have any. Big bang for buck:
11785 Run 1: 8.35 seconds
11786 Run 2: 8.32 seconds
11787 corlib: 17.99 seconds
11789 Run 1: 8.17 seconds
11790 Run 2: 8.17 seconds
11791 corlib: 17.39 seconds
11793 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
11795 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11796 time we are returning 0 members, so we save alot here.
11798 2003-12-11 Martin Baulig <martin@ximian.com>
11800 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11801 `MergeChild()', also just take the `FlowBranching' as argument;
11802 call Merge() on it and return the result.
11803 (FlowBranching.Merge): We don't need to do anything if we just
11806 2003-12-11 Martin Baulig <martin@ximian.com>
11808 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11809 them in an `ArrayList' to reduce memory usage. Thanks to Ben
11810 Maurer for this idea.
11812 2003-12-11 Martin Baulig <martin@ximian.com>
11814 * flowanalysis.cs (MergeResult): This class is now gone; we now
11815 use the `UsageVector' for this. The reason for this is that if a
11816 branching just has one sibling, we don't need to "merge" them at
11817 all - that's the next step to do.
11818 (FlowBranching.Merge): We now return a `UsageVector' instead of a
11821 2003-12-11 Martin Baulig <martin@ximian.com>
11823 Reworked flow analyis and made it more precise and bug-free. The
11824 most important change is that we're now using a special `Reachability'
11825 class instead of having "magic" meanings of `FlowReturns'. I'll
11826 do some more cleanups and optimizations and also add some more
11827 documentation this week.
11829 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11830 largely reworked this class.
11831 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11832 the new `Reachability' class instead of having "magic" values here.
11833 (FlowBranching): We're now using an instance of `Reachability'
11834 instead of having separate `Returns', `Breaks' etc. fields.
11836 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11837 based on flow analysis; ignore the return value of block.Emit ().
11839 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
11841 * driver.cs typemanager.cs: Find the mono extensions to corlib even
11842 if they are private.
11844 2003-12-09 Martin Baulig <martin@ximian.com>
11846 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11847 call them directly on the UsageVector.
11849 2003-12-09 Martin Baulig <martin@ximian.com>
11851 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11852 Changed return type from `FlowReturns' to `Reachability'.
11854 2003-12-09 Martin Baulig <martin@ximian.com>
11856 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11857 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11858 `Reachable' fields with a single `Reachability' one.
11860 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11862 * class.cs (FindMembers): Remove foreach's.
11867 Run 1: 8.74 seconds
11868 Run 2: 8.71 seconds
11871 Run 1: 8.64 seconds
11872 Run 2: 8.58 seconds
11875 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11880 This patch does a few things:
11881 1. EmptyStatement is now a singleton, so it is never reallocated.
11882 2. All blah is EmptyStatement constructs have been changed to
11883 blah == EmptyStatement.Value, which is much faster and valid
11884 now that EmptyStatement is a singleton.
11885 3. When resolving a block, rather than allocating a new array for
11886 the non-empty statements, empty statements are replaced with
11887 EmptyStatement.Value
11888 4. Some recursive functions have been made non-recursive.
11889 Mainly the performance impact is from (3), however (1) and (2) are needed for
11890 this to work. (4) does not make a big difference in normal situations, however
11891 it makes the profile look saner.
11896 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11897 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11898 Total memory allocated: 56397 KB
11901 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11902 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11903 Total memory allocated: 55666 KB
11905 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11907 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11908 than the hashtable in a hashtable version
11910 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11911 we always end up concating a string. This results in a huge perf
11912 loss, because many strings have to be tracked by the GC. In this
11913 patch, we first use a hashtable that works with two keys, so that
11914 the strings do not need to be concat'ed.
11918 Run 1: 8.74 seconds
11919 Run 2: 8.71 seconds
11922 Run 1: 8.65 seconds
11923 Run 2: 8.56 seconds
11925 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11927 * Makefile: Add a new target `do-time' that does a quick and simple
11928 profile, leaving easy to parse output.
11930 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
11932 * codegen.cs (Init): Create the dynamic assembly with
11933 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11935 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
11937 * support.cs: Make the PtrHashtable use only one
11938 instance of its comparer.
11940 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
11942 * typemanager.cs: Fix lookup of GetNamespaces.
11944 2003-11-29 Miguel de Icaza <miguel@ximian.com>
11946 * expression.cs: Removed redundant line.
11948 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11949 ArrayLists, use for loops with bounds.
11951 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11954 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11955 arraylists, use for loop with bounds.
11957 The above three changes give us a 0.071 second performance
11958 improvement out of 3.294 seconds down to 3.223. On my machine
11959 the above changes reduced the memory usage by 1,387 KB during
11960 compiler bootstrap.
11962 * cs-parser.jay (QualifiedIdentifier): New class used to represent
11963 QualifiedIdentifiers. Before we created a new string through
11964 concatenation, and mostly later on, the result would be
11965 manipulated by DecomposeQI through string manipulation.
11967 This reduced the compiler memory usage for bootstrapping from
11968 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11969 compile times in 0.05 seconds.
11971 2003-11-28 Dick Porter <dick@ximian.com>
11973 * support.cs: Do string compares with the Invariant culture.
11981 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11982 the comparison is done with the Invariant culture.
11984 2003-11-27 Miguel de Icaza <miguel@ximian.com>
11986 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11987 GetEnumerator method.
11989 (ProbeCollectionType): Iterate starting at the most specific type
11990 upwards looking for a GetEnumerator
11992 * expression.cs: Shift count can be up to 31 for int/uint and 63
11995 2003-11-26 Miguel de Icaza <miguel@ximian.com>
11997 * statement.cs (Block.LookupLabel): Also look for the label on the
11998 children blocks. Use a hash table to keep track of visited
12001 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12002 we actually did transform the other operand, otherwise fall back
12003 to the common codepath that casts to long.
12005 * cs-tokenizer.cs: Use the same code pattern as the int case.
12006 Maybe I should do the parsing myself, and avoid depending on the
12007 Parse routines to get this done.
12009 2003-11-25 Miguel de Icaza <miguel@ximian.com>
12011 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12012 which fixes bug 51347. This time test it.
12014 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12015 attributes for example can not tell the difference between these.
12016 The difference was only a syntax feature of the language.
12018 * attribute.cs: Apply attributes to delegates.
12020 * delegate.cs: Call the apply attributes method.
12022 2003-11-24 Miguel de Icaza <miguel@ximian.com>
12024 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12025 comparing 0 vs Byte.MinValue, not the value
12027 (ImplicitConversionRequired): When reporting a conversion error,
12028 use error 31 to print out the constant error instead of the
12031 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12032 which fixes bug 51347.
12034 2003-11-22 Miguel de Icaza <miguel@ximian.com>
12036 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
12037 which fixes the -warnaserror command line option.
12039 2003-11-21 Miguel de Icaza <miguel@ximian.com>
12041 * cfold.cs (DoNumericPromotions): During constant folding of
12042 additions on UIntConstant, special case intconstants with
12043 IntConstants like we do on the expression binary operator.
12045 2003-11-12 Miguel de Icaza <miguel@ximian.com>
12047 * convert.cs (ImplicitReferenceConversion): We were missing a case
12048 (System.Enum are not value types or class types, so we need to
12049 classify them separatedly).
12051 * driver.cs: We do not support error 2007.
12053 2003-11-12 Jackson Harper <jackson@ximian.com>
12055 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12056 system directory. Also use the full file name so users can
12057 libraries names mscorlib-o-tron.dll in a non system dir.
12059 2004-01-04 David Sheldon <dave-mono@earth.li>
12061 * expression.cs: Added matching ")" to error message for CS0077.
12063 2003-12-19 Martin Baulig <martin@ximian.com>
12065 * typemanager.cs (TypeManager.IsEqualGenericType): New public
12066 static method; see documentation in the method.
12067 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12069 * convert.cs (Convert.ImplicitReferenceConversion,
12070 Convert.ImplicitReferenceConversionExists): Add support for
12071 generic type declarations; see gen-36.cs.
12073 2003-12-19 Martin Baulig <martin@ximian.com>
12075 * pending.cs (Pending.InterfaceMethod): Use
12076 `Type.IsAssignableFrom()' instead of `=='.
12078 2003-12-18 Martin Baulig <martin@ximian.com>
12080 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12083 * convert.cs (Convert.ImplicitStandardConversionExists): Use
12084 `expr_type.Equals (target_type)' instead of `=='.
12086 2003-12-08 Martin Baulig <martin@ximian.com>
12088 * generics.cs (Constraints.Types): Removed.
12089 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12091 (Constraints.ResolveTypes): New public method; resolves the
12092 TypeExpr's to Type's.
12093 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12094 longer takes the constraints.
12095 (TypeParameter.DefineMethod): Likewise.
12096 (TypeParameter.DefineType): New public method. Calls
12097 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12100 2003-12-08 Martin Baulig <martin@ximian.com>
12102 * convert.cs (Convert.ImplicitConversionStandard): Use
12103 `expr_type.Equals (target_type)' instead of `=='.
12105 2003-12-08 Martin Baulig <martin@ximian.com>
12107 * typemanager.cs (TypeManager.GetReferenceType): Call
12108 `Type.MakeByRefType ()'.
12110 2003-12-08 Martin Baulig <martin@ximian.com>
12112 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12113 just has some special meaning in some situations. For instance,
12114 it is allowed to use `where' as the name of a variable etc.
12116 2003-12-04 Martin Baulig <martin@ximian.com>
12118 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12119 `Type.MakeArrayType()' for array types.
12121 2003-11-18 Miguel de Icaza <miguel@ximian.com>
12123 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12126 (SizeOf.DoResolve): assign the `type_queried' field. This gets
12129 2003-11-16 Martin Baulig <martin@ximian.com>
12131 * codegen.cs (EmitContext.IsGeneric): Removed.
12133 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12134 ResolveGeneric() on the DeclSpace.
12136 2003-11-16 Martin Baulig <martin@ximian.com>
12138 * generic.cs (TypeArguments.Resolve):
12139 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12140 `ResolveType()' on it to get the Type.
12142 2003-11-15 Martin Baulig <martin@ximian.com>
12144 * generic.cs (ConstructedType.GetInterfaces): Override this.
12146 2003-11-14 Martin Baulig <martin@ximian.com>
12148 * interface.cs (Interface.DefineType): Define all type parameters
12149 before adding the interfaces we inherit.
12151 2003-11-11 Martin Baulig <martin@ximian.com>
12153 * generic.cs (ConstructedType.ResolveType): Always call
12154 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12156 2003-11-10 Martin Baulig <martin@ximian.com>
12158 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12159 (TypeManager.InitCoreTypes): Initialize them here, but instead of
12160 calling `ResolveType()' on them, directly assign their `Type'.
12162 2003-11-08 Martin Baulig <martin@ximian.com>
12164 * generic.cs (ConstructedType): Override `IsClass' etc.
12166 2003-11-08 Martin Baulig <martin@ximian.com>
12168 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12169 return value and the `out parent' parameter.
12170 (TypeContainer.DefineType): Moved the CS0644 check into
12171 GetClassBases(). Don't pass the interface types to the
12172 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12173 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12175 * ecore.cs (TypeExpr.IsAttribute): New property.
12176 (TypeExpr.GetInterfaces): New method.
12178 * interface.cs (Interface.GetInterfaceTypeByName): Return a
12179 TypeExpr instead of a Type.
12180 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12181 (Interface.DefineType): Don't pass the interface types to the
12182 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12183 them later and then call `TypeBulider.AddInterfaceImplementation()'.
12185 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12186 instead of a `Type[]'.
12187 (TypeManager.RegisterBuilder): Likewise.
12188 (TypeManager.AddUserInterface): Likewise.
12189 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12190 `Type[]' and also return a `TypeExpr[]'.
12191 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12193 2003-11-08 Martin Baulig <martin@ximian.com>
12195 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12198 2003-11-08 Martin Baulig <martin@ximian.com>
12200 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12201 TypeManager.ResolveExpressionTypes().
12203 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12204 instead of an Expression.
12205 (TypeExpr): This is now an abstract base class for `TypeExpression'.
12206 (TypeExpression): New public class; formerly known as `TypeExpr'.
12208 * expression.cs (ComposedCast): Derive from TypeExpr.
12210 * typemanager.cs (TypeManager.system_*_expr): These are now
12211 TypExpr's instead of Expression's.
12212 (TypeManager.ResolveExpressionTypes): New public static function;
12213 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12216 2003-11-06 Miguel de Icaza <miguel@ximian.com>
12218 * expression.cs (New.DoResolve): Do not dereference value that
12219 might be a null return.
12221 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12222 sure that the constant value has the right type. Fixes an
12223 unreported bug, similar to 50425.
12225 * const.cs (Const.LookupConstantValue): Call
12226 ImplicitStandardConversionExists before doing a conversion to
12227 avoid havng the TypeManager.ChangeType do conversions.
12229 Reduced the number of casts used
12231 (Const.ChangeType): New routine to enable reuse of the constant
12232 type changing code from statement.
12234 * typemanager.cs (ChangeType): Move common initialization to
12235 static global variables.
12239 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12240 every value type to go through, even if it was void. Fix that.
12242 * cs-tokenizer.cs: Use is_identifier_start_character on the start
12243 character of the define, and the is_identifier_part_character for
12244 the rest of the string.
12246 2003-11-05 Miguel de Icaza <miguel@ximian.com>
12248 * expression.cs (UnaryMutator.EmitCode): When I updated
12249 LocalVariableReference.DoResolve, I overdid it, and dropped an
12250 optimization done on local variable references.
12252 2003-11-04 Miguel de Icaza <miguel@ximian.com>
12254 * ecore.cs: Convert the return from Ldlen into an int.
12256 2003-10-20 Miguel de Icaza <miguel@ximian.com>
12258 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12259 the accessibility, this is a special case for toplevel non-public
12260 classes (internal for instance).
12262 2003-10-20 Nick Drochak <ndrochak@gol.com>
12264 * ecore.cs: Fix typo and build. Needed another right paren.
12266 2003-10-19 Miguel de Icaza <miguel@ximian.com>
12268 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
12269 `internal' case regular and protected, but not allowing protected
12270 to be evaluated later. Bug 49840
12272 2003-10-15 Miguel de Icaza <miguel@ximian.com>
12274 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12275 to kb.Nlast, and not the kb.nFirst to isolate the switch
12278 Extract the underlying type, so enumerations of long/ulong are
12279 treated like long/ulong.
12281 2003-10-14 Miguel de Icaza <miguel@ximian.com>
12283 * expression.cs (New): Overload the meaning of RequestedType to
12284 track the possible creation of the NewDelegate type, since
12285 DoResolve is invoked more than once for new constructors on field
12288 See bugs: #48800 and #37014
12290 * cs-parser.jay (declare_local_constants): Take an arraylist
12291 instead of a single constant.
12293 (local_constant_declaration): It should take a
12294 constant_declarators, not a constant_declarator. Fixes 49487
12296 * convert.cs: Fix error report.
12298 2003-10-13 Jackson Harper <jackson@ximian.com>
12300 * typemanager.cs (TypeToCoreType): Add float and double this fixes
12303 2003-11-03 Martin Baulig <martin@ximian.com>
12305 * expression.cs (ArrayAccess.GetStoreOpcode): Added
12306 `out bool has_type_arg'; if set, we need to pass the type to
12308 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12309 Stelem_Any/Ldelem_Any for generic parameters.
12311 2003-11-02 Martin Baulig <martin@ximian.com>
12313 * expression.cs (Invocation.EmitCall): Use
12314 `TypeManager.IsValueType()' to check whether it's a value type.
12315 Don't set `struct_call' when calling a method on a type parameter.
12317 2003-11-02 Martin Baulig <martin@ximian.com>
12319 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12320 and removed the TypeBuilder argument.
12322 * typemanager.cs (TypeManager.IsValueType): Return
12323 `t.IsGenericParameter || t.IsValueType'.
12325 2003-10-25 Martin Baulig <martin@ximian.com>
12327 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12328 call ConstructedType.Resolve() on it.
12330 * generic.cs (ConstructedType.Resolve): Set `type' on success.
12332 2003-10-25 Martin Baulig <martin@ximian.com>
12334 * class.cs (TypeContainer.GetClassBases): Changed
12335 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
12336 CS8214 reporting here.
12337 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12338 instead of a `Type' for our parent. In case of a recursive
12339 declaration (see tests/gen-23.cs for an example), our parent is a
12340 ConstructedType and it doesn't have its type set. So, first
12341 create our own TypeBuilder, then call constructed.Resolve() to get
12342 the parent's type and finally TypeBuilder.SetParent() it.
12344 * ecore.cs (TypeExpr.Name): New public virtual property.
12347 (ConstructedType): We're now a TypeExpr and not just an Expression.
12348 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12349 arguments here; this is done later.
12350 (ConstructedType.Resolve): New public method to resolve the type
12351 arguments and bind them.
12353 2003-10-21 Martin Baulig <martin@ximian.com>
12355 * convert.cs: Use `TypeManager.IsValueType' instead of
12356 'type.IsValueType' everywhere.
12358 * typemanager.cs (TypeManager.IsValueType): Return true for type
12359 parameters. The reason for this is that we need to box a type
12360 parameter when converting it to a reference type.
12362 * cs-parser.jay: Added support for default value expressions.
12364 * generics.cs (DefaultValueExpression): New public class.
12366 2003-10-17 Martin Baulig <martin@ximian.com>
12368 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12369 TypeContainer so we can also use this for Interfaces.
12370 (TypeParameter.Resolve): Likewise.
12372 * interface.cs (Interface.DefineType): Added support for generic
12375 * cs-parser.jay: Added support for generic structs and interfaces.
12377 2003-10-17 Martin Baulig <martin@ximian.com>
12379 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12380 call generic methods :-)
12382 2003-10-16 Martin Baulig <martin@ximian.com>
12384 * cs-parser.jay (namespace_or_type_name): Only create a
12385 GenericMemberAccess if we actually have type arguments.
12387 2003-10-13 Martin Baulig <martin@ximian.com>
12389 * class.cs (Method.Define): If we're a generic method, call
12390 TypeBuilder.DefineGenericMethod () before resolving
12392 (MethodData): Added .ctor which takes an additional MethodBuilder
12393 argument; this is used for generic methods.
12394 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12395 we already have a MethodBuilder.
12397 2003-10-10 Martin Baulig <martin@ximian.com>
12399 * class.cs (Method): Added .ctor which takes a `GenericMethod'
12400 instead of a `DeclSpace'. This is used for generic methods.
12402 * cs-parser.jay (method_header): Added support for generic
12403 methods; create a `GenericMethod' instance and pass it to the
12404 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12405 parameters and locals.
12407 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12408 since we already have the location. Check whether we're a generic
12409 type declaration or a generic method and create the correct type
12412 * generic.cs (TypeParameter.DefineMethod): New public method.
12413 (GenericMethod): New public class; derives from DeclSpace and is
12414 used for generic methods.
12416 2003-10-09 Martin Baulig <martin@ximian.com>
12418 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12420 (MethodCore.DoDefineParameters): Removed the TypeContainer
12421 argument; use the DeclSpace which was passed to the .ctor instead.
12422 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12423 TypeContainer; we only need a DeclSpace here.
12425 2003-10-09 Martin Baulig <martin@ximian.com>
12427 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12429 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12430 EmitContext's .ctor.
12432 2003-10-09 Martin Baulig <martin@ximian.com>
12434 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12435 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12436 AsAccessible(), moved them as well.
12438 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12440 2003-10-07 Miguel de Icaza <miguel@ximian.com>
12442 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12443 generation for >=, as spotted by Paolo, bug 48679.
12444 Patch from David Waite.
12446 * cs-tokenizer.cs: Add handling for #pragma.
12448 * cs-parser.jay: Allow for both yield and yield return in the
12449 syntax. The anti-cobolization of C# fight will go on!
12451 * class.cs (TypeBuilder.DefineType): Catch error condition here
12452 (Parent.DefineType erroring out and returning null).
12454 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12455 coping with enumerations variables, we were mistakenly processing
12456 them as a regular value type instead of built-in types. Fixes the
12459 * typemanager.cs (IsBuiltinOrEnum): New method.
12461 2003-09-30 Miguel de Icaza <miguel@ximian.com>
12463 * cs-parser.jay: Upgrade: yield now needs the return clause.
12465 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12467 * cs-parser.jay : Renamed yyName to yyNames related to jay.
12469 2003-09-29 Martin Baulig <martin@ximian.com>
12471 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12472 inflated generic methods.
12474 * generics.cs (ConstructedType): Distinguish between open and
12475 closed constructed types; correctly resolve the arguments.
12477 2003-09-22 Martin Baulig <martin@ximian.com>
12479 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12480 all type arguments meet their constraints.
12482 2003-09-19 Martin Baulig <martin@ximian.com>
12484 * decl.cs (MemberCache.SetupCacheForInterface): Take a
12485 `MemberCache parent' argument. Normally, an interface doesn't
12486 have a parent type except System.Object, but we use this in gmcs
12487 for generic type parameters.
12489 2003-09-18 Martin Baulig <martin@ximian.com>
12491 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12492 on `type.IsInterface'; don't check whether the type has a parent
12493 to determine whether it's an interface.
12495 2003-09-17 Martin Baulig <martin@ximian.com>
12497 * generic.cs (ConstructedType.ToString): Always use `name' as the
12500 2003-09-15 Martin Baulig <martin@ximian.com>
12502 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12504 * generic.cs (Constraints.Resolve): New public method; this is
12505 called to resolve the constraint types and to check whether all
12506 the constraints are correct.
12507 (Constraints.Types): New public property.
12508 (TypeParameter.Resolve): New public method; resolves all the
12509 type's constraints.
12511 * class.cs (TypeContainer.DefineType): Call
12512 TypeParameter.Resolve() before actually defining the type.
12514 2003-09-15 Martin Baulig <martin@ximian.com>
12516 * class.cs (TypeContainer.DefineType): Added an error flag to
12517 avoid reporting duplicate CS0146's ("class definition is
12520 * driver.cs (Driver.MainDriver): Abort if
12521 RootContext.ResolveTree() reported any errors.
12523 2003-09-07 Martin Baulig <martin@ximian.com>
12525 * report.cs (Error, Warning): Added overloaded versions which take
12526 a `params object[] args' and call String.Format().
12528 2003-09-07 Martin Baulig <martin@ximian.com>
12530 * decl.cs (DeclSpace..ctor): Don't call
12531 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12532 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
12533 (DeclSpace.RecordDecl): New method.
12535 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12537 2003-09-02 Ravi Pratap <ravi@ximian.com>
12539 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12540 value attributes to be applied to ParameterBuilders.
12542 * class.cs (MethodCore.LabelParameters): Make static and more
12543 generic so that it can be used from other places - like interface
12544 methods, for instance.
12546 * interface.cs (Interface.Emit): Call LabelParameters before
12547 emitting attributes on the InterfaceMethod.
12549 2003-09-07 Martin Baulig <martin@ximian.com>
12551 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12552 if the number of type parameters doesn't match.
12554 2003-09-04 Martin Baulig <martin@ximian.com>
12556 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12557 for arrays of generic type params (ie. `!0[]').
12559 2003-09-04 Martin Baulig <martin@ximian.com>
12561 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12564 2003-09-04 Martin Baulig <martin@ximian.com>
12566 * decl.cs (DeclSpace.LookupGeneric): New method.
12567 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12570 * generic.cs (TypeParameterExpr): Take a TypeParameter as
12571 argument, not just a string.
12572 (TypeParameter.Define): New public method; this is called to
12573 actually define the generic parameter; after this, you can use the
12574 new `Type' property to get the type.
12576 2003-09-04 Martin Baulig <martin@ximian.com>
12578 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12579 is now an ArrayList; initialize the result of the `TypeParameters'
12581 (DeclSpace.GetGenericData): Removed.
12582 (DeclSpace.LookupGeneric): Temporarily removed; we need to
12583 implement this in a different way.
12584 (DeclSpace.GetTypeParameters): Removed; there's now a
12585 `TypeParameters' property.
12586 (DeclSpace.TypeParameters): New public property.
12588 * generic.cs (Constraints): Make this class public.
12589 (TypeParameter): New public class.
12591 2003-09-04 Martin Baulig <martin@ximian.com>
12593 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12594 generic parameters.
12596 * class.cs (TypeContainer.DefineType): Call
12597 TypeBuilder.DefineGenericParameter () on all generic parameters if
12598 this is a generic type.
12600 2003-08-28 Martin Baulig <martin@ximian.com>
12602 * sample-stack.il: Compile this with ilasm: "ilasm /dll
12605 * sample-hello.cs: Compile this with gmcs: "gmcs
12606 /r:sample-stack.dll sample-hello.cs".
12608 2003-08-28 Martin Baulig <martin@ximian.com>
12610 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12611 the parameters to the generic type.
12613 2003-08-28 Martin Baulig <martin@ximian.com>
12615 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12617 2003-08-28 Martin Baulig <martin@ximian.com>
12619 * cs-parser.jay (opt_type_argument_list): Use
12620 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12621 (primary_expression): Replace `qualified_identifier' with `type_name'.
12622 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12624 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12625 parser to check whether it is syntactically a type parameter list;
12626 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12629 2003-08-26 Martin Baulig <martin@ximian.com>
12631 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12632 resolving aliases; fixes #47927.
12634 2003-08-26 Martin Baulig <martin@ximian.com>
12636 * statement.cs (Using.DoResolve): This is internally emitting a
12637 try/finally clause, so we need to set ec.NeedExplicitReturn if we
12638 do not always return. Fixes #47681.
12640 2003-08-26 Martin Baulig <martin@ximian.com>
12642 * decl.cs (MemberCore): Moved WarningNotHiding(),
12643 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12645 (AdditionResult): Make this nested in DeclSpace.
12646 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12647 argument; call NamespaceEntry.Define() unless we're nested in a
12650 * namespace.cs (Namespace.DefineName): New public function. This
12651 is called from DeclSpace's .ctor to add
12652 (Namespace.Lookup): Include DeclSpaces in the lookup.
12654 * class.cs (Operator): Derive from MemberBase, not MemberCore.
12656 * const.cs (Const): Derive from MemberBase, not MemberCore.
12658 2003-08-25 Martin Baulig <martin@ximian.com>
12660 * convert.cs (Convert.ExplicitReferenceConversion): When
12661 converting from an interface type to a class, unbox if the target
12662 type is a struct type. Fixes #47822.
12664 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12666 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12669 2003-08-22 Martin Baulig <martin@ximian.com>
12671 * class.cs (TypeManager.DefineType): When defining a nested type,
12672 call DefineType() on our parent; fixes #47801.
12674 2003-08-22 Martin Baulig <martin@ximian.com>
12676 * class.cs (MethodData.Define): While checking if a method is an
12677 interface implementation, improve the test a bit more to fix #47654.
12679 2003-08-22 Martin Baulig <martin@ximian.com>
12681 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12682 correctly; fixes #47722.
12684 2003-08-22 Martin Baulig <martin@ximian.com>
12686 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12687 LocalVariableReference, ensure it's not read-only. Fixes #47536.
12689 * statement.cs (Fixed.DoResolve): Make all variables read-only.
12691 2003-08-22 Martin Baulig <martin@ximian.com>
12693 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12694 can only be assigned in static constructors. Fixes #47161.
12696 2003-08-22 Martin Baulig <martin@ximian.com>
12698 Rewrote and improved the flow analysis code.
12700 * flowbranching.cs (FlowBranching): Make this class abstract.
12701 (FlowBranching.CreateBranching): New static function to create a
12702 new flow branching.
12703 (FlowBranchingBlock, FlowBranchingException): New classes.
12704 (FlowBranching.UsageVector.Type): New public readonly field.
12705 (FlowBranching.UsageVector.Breaks): Removed the setter.
12706 (FlowBranching.UsageVector.Returns): Removed the setter.
12707 (FlowBranching.UsageVector): Added Break(), Return(),
12708 NeverReachable() and Throw() methods to modify the reachability.
12709 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12710 done by FlowBranching.Merge().
12711 (FlowBranching.UsageVector.MergeChild): New method; merges the
12712 merge result into the current vector.
12713 (FlowBranching.Merge): New abstract method to merge a branching.
12715 2003-08-12 Martin Baulig <martin@ximian.com>
12717 * expression.cs (Indirection.CacheTemporaries): Create the
12718 LocalTemporary with the pointer type, not its element type.
12720 2003-08-10 Miguel de Icaza <miguel@ximian.com>
12722 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12723 token was a keyword or not.
12725 Add `error' options where an IDENTIFIER was expected; Provide
12726 CheckToken and CheckIdentifierToken convenience error reporting
12729 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12731 * decl.cs: Rename `NamespaceEntry Namespace' public field into
12732 NameSpaceEntry NameSpaceEntry.
12734 (LookupInterfaceOrClass): Avoid creating a full qualified name
12735 from namespace and name: avoid doing lookups when we know the
12736 namespace is non-existant. Use new Tree.LookupByNamespace which
12737 looks up DeclSpaces based on their namespace, name pair.
12739 * driver.cs: Provide a new `parser verbose' to display the
12740 exception thrown during parsing. This is turned off by default
12741 now, so the output of a failure from mcs is more graceful.
12743 * namespace.cs: Track all the namespaces defined in a hashtable
12746 (IsNamespace): New method
12748 2003-08-09 Miguel de Icaza <miguel@ximian.com>
12750 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
12751 we know that we need to concatenate (full typename can never be
12756 * statement.cs: Use a bitfield; Do not initialize to null things
12757 which are done by the constructor by default.
12759 * cs-parser.jay: bug fix, parameter was 4, not 3.
12761 * expression.cs: Just use the property;
12763 * statement.cs: No need for GetVariableInfo method.
12765 2003-08-08 Martin Baulig <martin@ximian.com>
12767 * flowanalysis.cs (FlowReturns): This is now nested in the
12768 `FlowBranching' class.
12769 (MyBitVector): Moved this here from statement.cs.
12770 (FlowBranching.SiblingType): New enum type.
12771 (FlowBranching.CreateSibling): Added `SiblingType' argument.
12773 2003-08-07 Martin Baulig <martin@ximian.com>
12775 * flowanalysis.cs (FlowBranchingType): This is now nested in the
12776 `FlowBranching' class and called `BranchingType'.
12778 2003-08-07 Martin Baulig <martin@ximian.com>
12780 * flowanalysis.cs: Moved all the control flow analysis code into
12783 2003-08-07 Martin Baulig <martin@ximian.com>
12785 * assign.cs (Assign.DoResolve): `target' must either be an
12786 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
12789 2003-08-07 Miguel de Icaza <miguel@ximian.com>
12791 * expression.cs (BinaryMethod): This kind of expression is created by the
12792 Binary class if it determines that the operator has to be handled
12795 (BinaryDelegate): This kind of expression is created if we are
12796 dealing with a + or - operator on delegates.
12798 (Binary): remove method, argumetns, and DelegateOperator: when
12799 dealing with methods,
12801 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12803 * statement.cs (Block): use bitfields for the three extra booleans
12804 we had in use. Remove unused topblock parameter.
12806 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12808 * assign.cs: Drop extra unneeded tests.
12810 2003-08-06 Miguel de Icaza <miguel@ximian.com>
12812 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12814 * statement.cs (Foreach): Use VariableStorage instead of
12817 * codegen.cs (VariableStorage): New class used by clients that
12818 require a variable stored: locals or fields for variables that
12819 need to live across yield.
12821 Maybe provide a convenience api for EmitThis+EmitLoad?
12823 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12826 2003-08-05 Miguel de Icaza <miguel@ximian.com>
12828 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12829 RemapParameterLValue): New methods that are used to turn a
12830 precomputed FieldInfo into an expression like this:
12834 The idea is to use this instead of making LocalVariableReference
12835 have more than one meaning.
12837 * cs-parser.jay: Add error production to BASE.
12839 * ecore.cs: Deal with TypeManager.GetField returning null, which
12840 is now a valid return value.
12842 (FieldExprNoAddress): New expression for Fields whose address can
12845 * expression.cs (LocalVariableReference): During the resolve
12846 phases, create new expressions if we are in a remapping context.
12847 Remove code that dealt with remapping here.
12849 (ParameterReference): same.
12851 (ProxyInstance): New expression, like the `This' expression, but
12852 it is born fully resolved. We know what we are doing, so remove
12853 the errors that are targeted to user-provided uses of `this'.
12855 * statement.cs (Foreach): our variable is now stored as an
12856 Expression; During resolution, follow the protocol, dont just
12857 assume it will return this.
12859 2003-08-06 Martin Baulig <martin@ximian.com>
12861 * support.cs (SeekableStreamReader.cs): New public class.
12863 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12864 SeekableStreamReader instead of the normal StreamReader.
12866 2003-08-04 Martin Baulig <martin@ximian.com>
12868 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12869 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12870 deambiguate casts and delegate invocations.
12871 (parenthesized_expression): Use the new tokens to ensure this is
12872 not a cast of method invocation.
12874 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12875 when reading a `)' and Deambiguate_CloseParens () was previously
12878 * expression.cs (ParenthesizedExpression): New class. This is
12879 just used for the CS0075 test.
12880 (Binary.DoResolve): Check for CS0075.
12882 2003-07-29 Ravi Pratap <ravi@ximian.com>
12884 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12885 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12886 reference comparison.
12888 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12889 examine the ReturnType for equality - this is necessary in the
12890 cases of implicit and explicit operators whose signature also
12891 includes the return type.
12893 2003-07-26 Miguel de Icaza <miguel@ximian.com>
12895 * namespace.cs: Cache the result of the namespace computation,
12896 instead of computing it every time.
12898 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12900 * decl.cs: Use a global arraylist that we reuse over invocations
12901 to avoid excesive memory consumption. Reduces memory usage on an
12902 mcs compile by one meg (45 average).
12904 * typemanager.cs (LookupTypeReflection): In .NET pointers are
12905 private, work around that.
12907 2003-07-23 Miguel de Icaza <miguel@ximian.com>
12909 * literal.cs (IntLiteral): Define Zero and One static literals.
12911 * cs-parser.jay (integer_literal): use static literals to reduce
12912 memory usage for the most used literals (0, 1 and -1). 211kb
12913 reduced in memory usage.
12915 Replace all calls to `new ArrayList' with `new
12916 ArrayList(4)' which is a good average number for most allocations,
12917 and also requires only 16 bytes of memory for its buffer by
12920 This reduced MCS memory usage in seven megabytes for the RSS after
12923 2003-07-28 Ravi Pratap <ravi@ximian.com>
12925 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12926 handle params methods the correct way by forming only one
12927 applicable set with params and normal methods in them. Earlier we
12928 were looking at params methods only if we found no normal methods
12929 which was not the correct thing to do.
12931 (Invocation.BetterFunction): Take separate arguments indicating
12932 when candidate and the best method are params methods in their
12935 This fixes bugs #43367 and #46199.
12937 * attribute.cs: Documentation updates.
12939 (CheckAttribute): Rename to CheckAttributeTarget.
12940 (GetValidPlaces): Rename to GetValidTargets.
12942 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12943 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12947 2003-07-28 Miguel de Icaza <miguel@ximian.com>
12949 * codegen.cs: Compute IsGeneric correctly.
12951 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
12954 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
12955 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
12956 regressions, and I was chasing more bugs than I required.
12958 * interface.cs: Use expressions for base type names (like classes
12959 and structs have been doing for a while now), and resolve that.
12960 This patch should probably go into head as well.
12962 This makes it one less user of FindType.
12964 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12966 This compiler can not self host currently. Need to fix that.
12968 * Makefile: compile to `gmcs.exe'
12970 * driver.cs: Turn on v2 by default on gmcs.
12972 * generic.cs (ConstructedType): Does no longer take a container
12973 type argument; That will be taken care of later.
12975 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
12976 Use SimpleName to resolve for now, so we can continue the work on
12977 the parser, until we get Type.GetType that understands generics.
12979 (ConstructedType.ToString): Implement
12981 (TypeArguments.Resolve): Resolve the child expressions as types.
12983 * cs-parser.jay: Rename interface_constraints to
12984 type_parameter_constraints
12986 (namespace_or_type_name): Only use constructed types for the basic
12987 construction, we will deal with identifier<...> later.
12989 (type/type_name): No longer call DecomposeQI, as
12990 namespace_or_type_name is always decoded now.
12992 2003-07-22 Ravi Pratap <ravi@ximian.com>
12994 * expression.cs (Invocation.OverloadResolve): Follow the spec more
12995 closely: we eliminate methods in base types when we have an
12996 applicable method in a top-level type.
12998 Please see section 14.5.5.1 for an exact description of what goes
13001 This fixes bug #45127 and a host of other related to corlib compilation.
13003 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13004 array is the method corresponding to the top-level type (this is
13005 because of the changes made to icall.c) so we change this
13008 (MethodGroupExpr.Name): This too.
13010 * typemanager.cs (GetElementType): New method which does the right
13011 thing when compiling corlib.
13013 * everywhere: Make use of the above in the relevant places.
13015 2003-07-22 Martin Baulig <martin@ximian.com>
13017 * cs-parser.jay (invocation_expression): Moved
13018 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13019 `cast_expression', but create a InvocationOrCast which later
13020 resolves to either an Invocation or a Cast.
13022 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13023 method; call this before EmitStatement() to make sure that this
13024 expression can be used as a statement.
13026 * expression.cs (InvocationOrCast): New class; resolves to either
13027 an Invocation or a Cast.
13029 * statement.cs (StatementExpression): Call ResolveStatement() on
13030 the ExpressionStatement before emitting it.
13032 2003-07-21 Martin Baulig <martin@ximian.com>
13034 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13035 `ref' and `out' attributes match; fixes #46220.
13036 (MemberAccess.ResolveMemberAccess): You can't reference a type
13037 through an expression; fixes #33180.
13038 (Indexers.GetIndexersForType): Don't return the indexers from
13039 interfaces the class implements; fixes #46502.
13041 2003-07-21 Martin Baulig <martin@ximian.com>
13043 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13044 CS0661 checks; fixes bug #30442.
13046 2003-07-21 Martin Baulig <martin@ximian.com>
13048 * decl.cs (AdditionResult): Added `Error'.
13050 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13052 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13053 cs0031.cs actually work.
13055 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13057 * cs-parser.jay (namespace_name): do not use
13058 namespace_or_type_name, use qualified_identifier, because
13059 namespace_or_type_name will soon return a composed expression
13060 instead of a string.
13062 (namespace_or_type_name): Instead of returning a string, now this
13063 production returns an expression.
13065 * codegen.cs (EmitContext): Setup IsGeneric property based on
13066 whether our DeclSpace is generic, our the method is generic.
13068 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13069 the method is generic.
13071 * cs-parser.jay (type_arguments, opt_type_argument_list,
13072 type_parameters, type_parameter_list, opt_type_parameter_list,
13073 type_parameter,, opt_type_parameter_constraints_clauses,
13074 type_parameter_constraints_clauses,
13075 type_parameter_constraint_clause, type_parameter_constraint,
13076 interface_constraints): Add new production
13078 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13079 DeclSpace is generic or not.
13081 (DeclSpace.SetParameterInfo): New routine, used to set the
13082 parameter info for a type.
13084 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13085 returns a GenericTypeExpr
13087 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13088 generic, lookup the generic argument.
13090 * attribute.cs: Do not allow TypeParameterExpressions in
13093 * class.cs: Do not allow the Main method to be defined in a
13096 * expression.cs (SizeOf): Do not allow generic types to be used as
13097 arguments to sizeof.
13099 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13100 it: whether a type is generic or not. Only works for types we are
13101 currently building for now.
13103 2003-07-20 Martin Baulig <martin@ximian.com>
13105 * namespace.cs: Fixed that bug which caused a crash when compiling
13106 the debugger's GUI.
13108 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13110 * typemanager.cs (LookupTypeReflection): Never expose types which
13111 are NotPublic, NestedPrivate, NestedAssembly, or
13112 NestedFamANDAssem. We used to return these, and later do a check
13113 that would report a meaningful error, but the problem is that we
13114 would not get the real match, if there was a name override.
13116 2003-07-18 Miguel de Icaza <miguel@ximian.com>
13118 * namespace.cs (Namespace, Name): Do not compute the namespace
13119 name dynamically, compute it in the constructor. This reduced
13120 memory usage by 1697 KB.
13122 * driver.cs: Use --pause to pause at the end.
13124 2003-07-17 Peter Williams <peter@newton.cx>
13126 * Makefile: Change the name of the test target so that it doesn't
13127 conflict with the recursive test target.
13129 2003-07-17 Miguel de Icaza <miguel@ximian.com>
13131 * expression.cs (LocalVariableReference.Emit, EmitAssign,
13132 AddressOf): Do not use EmitThis, that was wrong, use the actual
13135 2003-07-15 Miguel de Icaza <miguel@ximian.com>
13137 * class.cs (MethodData.Define): While checking if a method is an
13138 interface implementation, improve the test: If we are not public
13139 (use new test here: use the computed MethodAttributes directly,
13140 instead of the parsed modifier flags) check if the `implementing'
13141 method comes from an interface or not.
13143 * pending.cs (VerifyPendingMethods): Slightly better error
13146 * makefile: add test target that does the mcs bootstrap.
13148 2003-07-16 Ravi Pratap <ravi@ximian.com>
13150 * interface.cs (Define): Do nothing here since there are no
13151 members to populate etc. Move the attribute emission out of here
13152 since this was just totally the wrong place to put it. Attribute
13153 application happens during the 'Emit' phase, not in the 'Define'
13156 (Emit): Add this method and move the attribute emission here
13158 * rootcontext.cs (EmitCode): Call the Emit method on interface
13161 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13163 * expression.cs (OverloadResolve): Report error only if Location
13164 is not 'Null' which means that there was a probe going on.
13166 2003-07-14 Martin Baulig <martin@ximian.com>
13168 * expression.cs (ConditionalLogicalOperator): New public class to
13169 implement user defined conditional logical operators.
13170 This is section 14.11.2 in the spec and bug #40505.
13172 2003-07-14 Martin Baulig <martin@ximian.com>
13174 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13176 2003-07-14 Martin Baulig <martin@ximian.com>
13178 * codegen.cs (EmitContext.InFixedInitializer): New public field.
13180 * ecore.cs (IVariable.VerifyFixed): New interface method.
13182 * expression.cs (Unary.ResolveOperator): When resolving the `&'
13183 operator, check whether the variable is actually fixed. Fixes bug
13184 #36055. Set a variable definitely assigned when taking its
13185 address as required by the spec.
13187 * statement.cs (LocalInfo.IsFixed): New field.
13188 (LocalInfo.MakePinned): Set `IsFixed' to true.
13190 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13192 * attribute.cs (Attribute.Resolve): While doing a Member lookup
13193 for .ctors, ensure that we only ask for members declared in the
13194 attribute type (BindingFlags.DeclaredOnly).
13198 * expression.cs (Error_WrongNumArguments): Report error 1501
13199 correctly the way CSC does.
13201 2003-07-13 Martin Baulig <martin@ximian.com>
13203 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13204 lookup on the fully qualified name, to make things like "X.X" work
13205 where "X.X" is a fully qualified type name, but we also have a
13206 namespace "X" in the using list. Fixes #41975.
13208 2003-07-13 Martin Baulig <martin@ximian.com>
13210 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13211 function. If we're a CompoundAssign, we need to create an embedded
13212 CompoundAssign, not an embedded Assign.
13213 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13216 2003-07-13 Martin Baulig <martin@ximian.com>
13218 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13219 work to fix bug #46088.
13221 2003-07-13 Ravi Pratap <ravi@ximian.com>
13223 * class.cs (Operator.Emit): Do not emit attributes here - it is
13224 taken care of by the Method class that we delegate too. This takes
13225 care of bug #45876.
13227 2003-07-10 Martin Baulig <martin@ximian.com>
13229 * expression.cs (TypeOfVoid): New class.
13230 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
13232 2003-07-10 Martin Baulig <martin@ximian.com>
13234 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13237 2003-07-10 Martin Baulig <martin@ximian.com>
13239 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13240 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13242 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13244 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13246 2003-07-10 Martin Baulig <martin@ximian.com>
13248 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13249 of decimal. Fixes #42850.
13251 NOTE: I also fixed the created byte blob, but this doesn't work on
13252 the MS runtime and csc never produces any byte blobs for decimal
13255 2003-07-10 Martin Baulig <martin@ximian.com>
13257 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13258 structs; fixes #32068.
13259 (Block.AddChildVariableNames): Fixed #44302.
13261 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13263 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13265 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13267 * attribute.cs: And this test is onger needed.
13269 2003-07-08 Martin Baulig <martin@ximian.com>
13271 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13272 inaccessible types. Fixes #36313.
13274 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13276 * namespace.cs (NamespaceEntry): Create implicit entries for all
13277 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13278 implicit entries for N1.N2 and N1.
13280 2003-07-08 Martin Baulig <martin@ximian.com>
13282 Rewrote the handling of namespaces to fix a lot of the issues
13283 wrt. `using' aliases etc.
13285 * namespace.cs (Namespace): Splitted this class into a
13286 per-assembly `Namespace' and a per-file `NamespaceEntry'.
13288 * typemanager.cs (TypeManager.IsNamespace): Removed.
13289 (TypeManager.ComputeNamespaces): Only compute namespaces from
13290 loaded assemblies here, not the namespaces from the assembly we're
13291 currently compiling.
13293 2003-07-08 Martin Baulig <martin@ximian.com>
13295 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13297 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13299 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13302 I thought about the memory savings here, but LookupTypeReflection
13303 is used under already very constrained scenarios. Compiling
13304 corlib or mcs only exposes one hit, so it would not really reduce
13305 any memory consumption.
13307 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13309 * typemanager.cs: fixes bug #45889 by only adding public types from
13310 other assemblies to the list of known types.
13312 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13314 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13315 on the type we resolved.
13317 2003-07-05 Martin Baulig <martin@ximian.com>
13319 * pending.cs (PendingImplementation.ParentImplements): Don't
13320 create the proxy if the parent is abstract.
13322 * class.cs (TypeContainer.DefineIndexers): Process explicit
13323 interface implementations first. Fixes #37714.
13325 2003-07-04 Miguel de Icaza <miguel@ximian.com>
13327 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13328 defined recursively; but since we modify the input parameters
13329 (left is set to `this' temporarily), we reset this value if the
13330 left_is_explicit is false, which gives the original semantics to
13333 * literal.cs (NullPointer): new class used to represent a null
13334 literal in a pointer context.
13336 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13337 type is a pointer, use a NullPointer object instead of a
13338 NullLiteral. Closes 43687
13340 (ExplicitConversion): Convert pointer values using
13341 the conv opcode to the proper type.
13343 * ecore.cs (New): change ValueTypeVariable property into a method,
13344 that returns whether the valuetype is suitable for being used.
13346 * expression.cs (Binary.DoNumericPromotions): Only return if we
13347 the int constant was a valid uint, and we can return both left and
13348 right as uints. If not, we continue processing, to trigger the
13349 type conversion. This fixes 39018.
13351 * statement.cs (Block.EmitMeta): During constant resolution, set
13352 the CurrentBlock property on the emitcontext, so that we resolve
13353 constants propertly.
13355 2003-07-02 Martin Baulig <martin@ximian.com>
13357 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13358 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13360 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13361 than emitting it here.
13363 * statement.cs: Fixed some more flow analysis bugs.
13365 2003-07-02 Martin Baulig <martin@ximian.com>
13367 * class.cs (MethodData.Define): When implementing interface
13368 methods, set Final unless we're Virtual.
13370 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13371 check work for interface methods.
13373 2003-07-01 Martin Baulig <martin@ximian.com>
13375 * ecore.cs (EmitContext.This): Replaced this property with a
13376 GetThis() method which takes a Location argument. This ensures
13377 that we get the correct error location for a CS0188.
13379 2003-07-01 Miguel de Icaza <miguel@ximian.com>
13381 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13382 ImplicitStandardConversion.
13384 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13386 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
13388 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13391 2003-06-30 Miguel de Icaza <miguel@ximian.com>
13393 * class.cs (Constructor.Define): Turn off initlocals for unsafe
13396 (MethodData.Define): Turn off initlocals for unsafe methods.
13398 2003-06-29 Miguel de Icaza <miguel@ximian.com>
13400 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13401 complete; Fixes #37521.
13403 * delegate.cs: Use Modifiers.TypeAttr to compute the
13404 TypeAttributes, instead of rolling our own. This makes the flags
13405 correct for the delegates.
13407 2003-06-28 Miguel de Icaza <miguel@ximian.com>
13409 * class.cs (Constructor.Define): Set the private flag for static
13410 constructors as well.
13412 * cs-parser.jay (statement_expression): Set the return value to
13413 null, to avoid a crash when we catch an error.
13415 2003-06-24 Miguel de Icaza <miguel@ximian.com>
13417 * cs-parser.jay: Applied patch from Jackson that adds support for
13418 extern and unsafe modifiers to destructor declarations.
13420 * expression.cs: Report error 21 if the user is trying to index a
13423 * driver.cs: Add an error message, suggested by the bug report.
13425 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13426 if we do not have a ": this ()" constructor initializer. Fixes 45149
13428 2003-06-14 Miguel de Icaza <miguel@ximian.com>
13430 * namespace.cs: Add some information to reduce FAQs.
13432 2003-06-13 Miguel de Icaza <miguel@ximian.com>
13434 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13435 underlying enumeration types. Fixes #43915.
13437 * expression.cs: Treat ushort/short as legal values to be used in
13438 bitwise operations.
13440 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13442 * delegate.cs: transfer custom attributes for paramenters from
13443 the delegate declaration to Invoke and BeginInvoke.
13445 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13447 * attribute.cs: handle custom marshalers and emit marshal info
13450 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
13452 * makefile.gnu: Added anonymous.cs to the compiler sources.
13454 2003-05-28 Miguel de Icaza <miguel@ximian.com>
13456 * iterators.cs: Change the name of the proxy class to include two
13459 * cs-parser.jay: Update grammar to include anonymous methods.
13461 * anonymous.cs: new file.
13463 2003-05-27 Miguel de Icaza <miguel@ximian.com>
13465 * class.cs (Field.Define): Add missing test for pointers and
13468 2003-05-27 Ravi Pratap <ravi@ximian.com>
13470 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13471 we use the stobj opcode.
13473 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13474 since it wasn't the correct fix.
13476 It still is puzzling that we are required to use stobj for IntPtr
13477 which seems to be a ValueType.
13479 2003-05-26 Miguel de Icaza <miguel@ximian.com>
13481 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13482 during regular simple name resolution. Now, the trick is that
13483 instead of returning for processing the simplename, we do a
13484 TypeManager.LookupType (ie, a rooted lookup as opposed to a
13485 contextual lookup type). If a match is found, return that, if
13486 not, return for further composition.
13488 This fixes long-standing 30485.
13490 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13491 using the address to initialize an object, do an Stobj instead of
13492 using the regular Stelem.
13494 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13495 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13496 Because if we are a BaseIndexerAccess that value will be true.
13499 * statement.cs (GotoCase.Resolve): Return after reporting an
13500 error, do not attempt to continue.
13502 * expression.cs (PointerArithmetic.Emit): If our operand is a
13503 long, convert our constants to match the operand before
13504 multiplying. Convert to I type before adding. Fixes 43670.
13506 2003-05-14 Ravi Pratap <ravi@ximian.com>
13508 * enum.cs (ImplicitConversionExists) : Rename to
13509 ImplicitEnumConversionExists to remove ambiguity.
13511 * ecore.cs (NullCast): New type of cast expression class which
13512 basically is very similar to EmptyCast with the difference being
13513 it still is a constant since it is used only to cast a null to
13515 (eg. (string) null)
13517 * convert.cs (ImplicitReferenceConversion): When casting a null
13518 literal, we return a NullCast.
13520 * literal.cs (NullLiteralTyped): Remove - I don't see why this
13521 should be around anymore.
13523 The renaming (reported was slightly wrong). Corrections:
13525 ConvertImplicitStandard -> ImplicitConversionStandard
13526 ConvertExplicitStandard -> ExplicitConversionStandard
13528 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13529 before passing them in !
13531 * convert.cs (ImplicitConversionStandard): When comparing for
13532 equal expr and target types, ensure that expr is not a
13535 In general, we must not be checking (expr_type ==
13536 target_type) in the top level conversion methods
13537 (ImplicitConversion, ExplicitConversion etc). This checking is
13538 done in the methods that they delegate to.
13540 2003-05-20 Miguel de Icaza <miguel@ximian.com>
13542 * convert.cs: Move Error_CannotConvertType,
13543 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13544 ImplicitNumericConversion, ImplicitConversionExists,
13545 ImplicitUserConversionExists, StandardConversionExists,
13546 FindMostEncompassedType, FindMostSpecificSource,
13547 FindMostSpecificTarget, ImplicitUserConversion,
13548 ExplicitUserConversion, GetConversionOperators,
13549 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13550 TryImplicitIntConversion, Error_CannotConvertImplicit,
13551 ConvertImplicitRequired, ConvertNumericExplicit,
13552 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13553 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13556 Perform the following renames:
13558 StandardConversionExists -> ImplicitStandardConversionExists
13559 ConvertImplicit -> ImplicitConversion
13560 ConvertImplicitStandard -> ImplicitStandardConversion
13561 TryImplicitIntConversion -> ImplicitIntConversion
13562 ConvertImplicitRequired -> ImplicitConversionRequired
13563 ConvertNumericExplicit -> ExplicitNumericConversion
13564 ConvertReferenceExplicit -> ExplicitReferenceConversion
13565 ConvertExplicit -> ExplicitConversion
13566 ConvertExplicitStandard -> ExplicitStandardConversion
13568 2003-05-19 Martin Baulig <martin@ximian.com>
13570 * statement.cs (TypeInfo.StructInfo): Made this type protected.
13571 (TypeInfo): Added support for structs having structs as fields.
13573 * ecore.cs (FieldExpr): Implement IVariable.
13574 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13575 VariableInfo for the field.
13577 2003-05-18 Martin Baulig <martin@ximian.com>
13579 * expression.cs (This.DoResolve): Report a CS0027 if we're
13580 emitting a field initializer.
13582 2003-05-18 Martin Baulig <martin@ximian.com>
13584 * expression.cs (This.ResolveBase): New public function.
13585 (This.DoResolve): Check for CS0188.
13587 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13590 * ecore.cs (MethodGroupExpr.DoResolve): Set the
13591 `instance_expression' to null if we don't have any non-static
13594 2003-05-18 Martin Baulig <martin@ximian.com>
13596 Reworked the way how local variables and parameters are handled by
13597 the flow analysis code.
13599 * statement.cs (TypeInfo, VariableMap): New public classes.
13600 (VariableInfo): New public class. This is now responsible for
13601 checking whether a variable has been assigned. It is used for
13602 parameters and local variables.
13603 (Block.EmitMeta): Take the InternalParameters as argument; compute
13604 the layout of the flow vectors here.
13605 (Block.LocalMap, Block.ParameterMap): New public properties.
13606 (FlowBranching): The .ctor doesn't get the InternalParameters
13607 anymore since Block.EmitMeta() now computes the layout of the flow
13609 (MyStructInfo): This class is now known as `StructInfo' and nested
13610 in `TypeInfo'; we don't access this directly anymore.
13612 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13613 property and removed IsAssigned(), IsFieldAssigned(),
13614 SetAssigned() and SetFieldAssigned(); we now call them on the
13615 VariableInfo so we don't need to duplicate this code everywhere.
13617 * expression.cs (ParameterReference): Added `Block block' argument
13619 (LocalVariableReference, ParameterReference, This): The new
13620 VariableInfo class is now responsible for all the definite
13623 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13624 IsParameterAssigned, SetParameterAssigned): Removed.
13626 2003-05-18 Martin Baulig <martin@ximian.com>
13628 * typemanager.cs (InitCoreTypes): Try calling
13629 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13630 the 3-args-version. Corlib now also needs our `void_type'.
13631 (GetMethod): Added overloaded version which takes an optional
13632 `bool report_errors' to allow lookups of optional methods.
13634 2003-05-12 Martin Baulig <martin@ximian.com>
13636 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13637 only used for locals and not for parameters.
13639 2003-05-12 Miguel de Icaza <miguel@ximian.com>
13641 * support.cs (InternalParameters.ParameterType): Return the
13642 ExternalType of the parameter.
13644 * parameter.cs (Parameter.ExternalType): drop the two arguments,
13647 2003-05-11 Miguel de Icaza <miguel@ximian.com>
13649 * class.cs (MethodData.Define): Do not set the `newslot' on
13650 interface members, if they are also flagged as "override".
13652 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13653 better code for ++i and i++. This only works for static fields
13654 and local variables.
13656 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13657 want to pull the DeclSpace out of the builder_to_declspace instead
13658 of the TypeBuilder (like in TypeContainer.FindMembers).
13660 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13661 instead of LookupTypeContainer. Fixes the crash on .NET for
13662 looking up interface members.
13664 * const.cs: Create our own emit context during the Definition
13665 stage, so that constants are evaluated in the proper context, when
13666 a recursive definition happens.
13668 2003-05-11 Martin Baulig <martin@ximian.com>
13670 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
13671 new block for a switch section.
13672 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13673 the adding/lookup in the switch block. Fixes #39828.
13675 2003-05-09 Miguel de Icaza <miguel@ximian.com>
13677 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13678 functionality: I needed to convert the data after I had performed
13679 the add/sub operation into the operands type size.
13681 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13682 pass the type for the box operation, otherwise the resulting
13683 object would have been of type object.
13685 (BoxedCast): Add constructor to specify the type to box as.
13687 2003-05-07 Miguel de Icaza <miguel@ximian.com>
13689 * iterators.cs: I was reusing the `count' variable inadvertently,
13690 take steps to not allow this to happen.
13692 2003-05-06 Miguel de Icaza <miguel@ximian.com>
13694 * attribute.cs (Attribute.Resolve): Params attributes are encoded
13695 by creating an array at the point where the params starts and
13696 putting all those arguments there, then adjusting the size of the
13699 2003-05-05 Miguel de Icaza <miguel@ximian.com>
13701 * expression.cs (New.AddressOf): Implement interface
13702 IMemoryLocation. This is used when the `new' operator is used in
13703 the context of an invocation to a method on a value type.
13705 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13708 * namespace.cs: Also check the using aliases here.
13710 * driver.cs: Move the test for using validity after the types have
13711 been entered, so we do a single pass that also includes the using
13714 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13715 in the regular case. CreateSiblingForFinally is doing extra
13718 * attribute.cs (GetAttributeArgumentExpression): Store the result
13719 on an out value, and use the return value to indicate failure
13720 instead of using null (which is a valid return for Constant.GetValue).
13722 * statement.cs: Perform the analysis flow for the increment
13723 portion after the statement, because this will be the real flow of
13724 execution. Fixes #42385
13726 * codegen.cs (EmitContext.EmitArgument,
13727 EmitContext.EmitStoreArgument): New helper functions when the
13728 RemapToProxy flag is set.
13730 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13733 Add support for remapping parameters.
13735 * iterators.cs: Propagate parameter values; Store parameter
13736 values in the proxy classes.
13738 2003-05-04 Miguel de Icaza <miguel@ximian.com>
13740 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
13741 need a proxy reference; I do not know what I was thinking
13743 * cs-parser.jay (constructor_initializer): catch another error,
13744 and display nice message.
13746 (field_declaration): catch void field declaration
13747 to flag a better error.
13749 * class.cs (MemberBase.CheckBase): Report an error instead of a
13750 warning if a new protected member is declared in a struct.
13751 (Field.Define): catch the error of readonly/volatile.
13753 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13755 (FieldExpr.AddressOf): ditto. Catch error where the address of a
13756 volatile variable is taken
13758 2003-05-02 Miguel de Icaza <miguel@ximian.com>
13760 * statement.cs (Fixed.Resolve): Report an error if we are not in
13763 2003-05-01 Miguel de Icaza <miguel@ximian.com>
13765 * typemanager.cs: reuse the code that handles type clashes for
13766 delegates and enumerations.
13768 * class.cs (Report28): Always report.
13770 * expression.cs (EncodeAsAttribute): Allow nulls here.
13772 2003-04-28 Miguel de Icaza <miguel@ximian.com>
13774 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13775 the functionality for testing whether an expression is valid for
13776 an attribute here. Also handle the case of arrays of elements
13779 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13780 encoding a linear array into an array of objects that are suitable
13781 to be passed to an CustomAttributeBuilder.
13783 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13785 * ecore.cs: (FieldExpr): Handle field remapping here.
13787 * iteratators.cs: Pass the instance variable (if the method is an
13788 instance method) to the constructors, so we can access the field
13789 variables on the class.
13791 TODO: Test this with structs. I think the THIS variable on
13792 structs might have to be a pointer, and not a refenrece
13794 2003-04-27 Miguel de Icaza <miguel@ximian.com>
13796 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13797 local variables to fields in a proxy class.
13799 * iterators.cs (PopulateProxy): Rename our internal fields to
13801 Create a <THIS> field if we are an instance method, so we can
13802 reference our parent container variables.
13803 (MapVariable): Called back from the EmitContext code to enter a
13804 new variable to field mapping into the proxy class (we just create
13808 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13809 for using the remapped locals to fields.
13811 I placed the code here, because that gives the same semantics to
13812 local variables, and only changes the Emit code.
13814 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13815 statements inside iterators.
13816 (VariableInfo): Add a FieldBuilder for the cases when we are
13817 remapping local variables to fields in a proxy class
13819 * ecore.cs (SimpleNameResolve): Avoid testing two times for
13820 current_block != null.
13822 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13823 not cope with strings, as it has been moved to the
13824 TableSwitchEmit. Fixed bug in switch generation.
13826 * expression.cs (New.DoResolve): Provide more context for the user
13827 when reporting an error.
13829 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13832 * expression.cs (MemberAccess.DoResolve): When we get a type back,
13833 check the permissions for it. Note than in a type-resolution
13834 context the check was already present in DeclSpace.ResolveType,
13835 but was missing from the MemberAccess.
13837 (ArrayCreation.CheckIndices): warn if the user has
13838 more nested levels of expressions, but there are no more
13839 dimensions specified. Avoids crash on bug 41906.
13841 2003-04-26 Miguel de Icaza <miguel@ximian.com>
13843 * statement.cs (Block): replace Implicit bool, for a generic
13845 New flag: `Unchecked'. This is used during the EmitMeta phase
13846 (which is out-of-line with the regular Resolve/Emit process for a
13847 statement, as this is done ahead of time, but still gets a chance
13848 to call constant resolve).
13850 (Block.Flags): new enum for adding a new flag.
13852 (Block.EmitMeta): track the state of unchecked.
13854 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13855 to enable constant resolution to work there as well.
13857 2003-04-22 Miguel de Icaza <miguel@ximian.com>
13859 * typemanager.cs (ienumerable_type): Also look up
13860 System.Collections.IEnumerable.
13862 2003-04-21 Miguel de Icaza <miguel@ximian.com>
13864 TODO: Test more than one conditional per method.
13866 * class.cs (Indexer.Define): Report the location where the user is
13867 referencing the unsupported feature.
13869 (MethodData): Overload the use of `conditionals' to
13870 minimize the creation of needless ArrayLists. This saves roughly
13871 212kb on my machine.
13873 (Method): Implement the new IIteratorContainer interface.
13874 (Method.SetYields): Implement the method by setting the ModFlags
13875 to contain METHOD_YIELDS.
13877 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13878 which just got set to null.
13880 * iterators.cs: New file.
13882 (Yield, YieldBreak): New statements.
13884 * statement.cs (Return.Resolve): Flag an error if we are used in
13885 an iterator method.
13887 * codegen.cs (InIterator): New flag set if the code is being
13888 compiled in an iterator method.
13890 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
13891 internal modifier, and we just use it to avoid adding extra
13892 fields, as this is seldom used.
13894 * cs-parser.jay: Add yield_statement (yield and yield break).
13896 * driver.cs: New flag -v2 to turn on version 2 features.
13898 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13899 hashtable when v2 is enabled.
13901 2003-04-20 Miguel de Icaza <miguel@ximian.com>
13903 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13904 there is already a namespace defined with this name.
13906 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13907 people upgraded their corlibs.
13909 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13910 always use fully qualified types, no need to use the compiler
13913 (TypeManager.IsNamespace): Use binarysearch.
13915 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13916 AddDelegate): I did not quite use the new IsValid API properly: I
13917 have to pass the short-name and the fullname. I was passing only
13918 the basename instead of the fullname sometimes.
13920 (TypeContainer.DefineType): call NamespaceClash.
13922 * interface.cs (Interface.DefineType): use NamespaceClash before
13925 * delegate.cs (Delegate.DefineType): use NamespaceClash before
13928 * enum.cs: (Enum.DefineType): use NamespaceClash before
13931 * typemanager.cs (: 3-line patch that gives us some tasty 11%
13932 speed increase. First, use the negative_hits cache when we get a
13933 negative. Second, add the type with its full original name
13934 instead of the new . and + encoded name (reflection uses + to
13935 separate type from a nested type). Use LookupTypeReflection
13936 directly which bypasses the type->name hashtable (that we already
13937 know does not contain the type.
13939 * decl.cs (DeclSpace.ResolveTypeExpr): track the
13940 location/container type.
13942 * driver.cs: When passing utf8, use directly the UTF8Encoding.
13944 2003-04-19 Miguel de Icaza <miguel@ximian.com>
13946 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13948 * delegate.cs (NewDelegate.Resolve): Test whether an instance
13949 method is being referenced in the method group from a static
13950 context, and report error 120 if so.
13952 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13955 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13956 is created, we create the A namespace).
13958 * cs-parser.jay: A namespace also introduces a DeclarationFound.
13961 2003-04-18 Miguel de Icaza <miguel@ximian.com>
13963 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13964 invocation to ModuleBuilder.GetType with the same values will
13965 return a new type instance, so we need to cache its return
13968 * expression.cs (Binary.ResolveOperator): Only allow the compare
13969 operators on enums if they are of the same type.
13971 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13972 types of ValueType on their own case. Before we were giving them
13973 the same treatment as objects.
13975 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13976 fullname. Short name is used to compare against container name.
13977 Fullname is used to check against defined namespace names.
13979 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13980 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13982 (Method.CheckBase): Call parent.
13983 (MemberBase.CheckBase): Check for protected members on sealed
13985 (PropertyBase.CheckBase): Call parent.
13986 (Field.Define): Call parent.
13988 * report.cs: Negative error codes are now mapped to 8000 - code,
13989 so that the display is render more nicely.
13991 * typemanager.cs: Do not use try/catch, instead report a regular
13994 (GetPointerType, GetReferenceType): These methods provide
13995 mechanisms to obtain the T* and T& from a T. We had the code
13996 previously scattered around the code base, and it also used
13997 TypeManager.LookupType that would go through plenty of caches.
13998 This one goes directly to the type source.
14000 In some places we did the Type.GetType followed by
14001 ModuleBuilder.GetType, but not in others, so this unifies the
14002 processing as well.
14004 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14005 statements now that we have namespace information.
14007 * typemanager.cs (IsNamespace): New method, returns whether the
14008 string presented is a namespace or not.
14010 (ComputeNamespaces): New public entry point, computes the list of
14011 available namespaces, using the GetNamespaces API call in Mono, or
14012 the slower version in MS.NET.
14014 Now before we start the semantic analysis phase, we have a
14015 complete list of namespaces including everything that the user has
14018 Deleted old code to cache namespaces in .nsc files.
14020 2003-04-17 Miguel de Icaza <miguel@ximian.com>
14022 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14023 class/struct location definition Location for the implicit
14024 constructor location.
14026 (Operator.Define): Use the location of the operator for the
14027 implicit Method definition.
14029 (Constructor.Emit): use the constructor location for the implicit
14030 base initializer constructor.
14032 * ecore.cs: Remove ITypeExpression. This interface is now gone,
14033 and the Expression class now contains two new methods:
14035 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
14036 isolate type lookup from the rest of the resolution process.
14038 Since we use Expressions to hold type definitions due to the way
14039 we parse the input we have historically overloaded Resolve to
14040 perform the Type lookups if a special flag is passed. Now this is
14041 eliminated and two methods take their place.
14043 The differences in the two methods between xStep and xTerminal is
14044 that xStep is involved in our current lookup system that uses
14045 SimpleNames to compose a name, while xTerminal is used just to
14046 catch the case where the simplename lookup failed.
14048 2003-04-16 Miguel de Icaza <miguel@ximian.com>
14050 * expression.cs (ResolveMemberAccess): Remove redundant code.
14051 TypeExpr expressions are always born fully resolved.
14053 * interface.cs (PopulateMethod): Do not lookup the types twice.
14054 We were doing it once during SemanticAnalysis and once during
14057 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14058 in local variable type definitions, were being returned as a
14059 SimpleName (we decomposed everything into a string), that is
14060 because primary_expression was being used instead of a type in the
14061 grammar (reduce/reduce conflicts).
14063 The part that was wrong is that we converted the expression into a
14064 string (an oversimplification in one hand, compounded with primary
14065 expressions doing string concatenation).
14071 Would return "A.B.C[]" as a SimpleName. This stopped things like
14072 using clauses from working on this particular context. And a type
14073 was being matched directly against "A.B.C[]".
14075 We now use the correct approach, and allow for ComposedCast to be
14076 part of the unary expression. So the "A.B.C []" become a composed
14077 cast of "A.B.C" (as a nested group of MemberAccess with a
14078 SimpleName at the end) plus the rank composition "[]".
14082 2003-04-10 Miguel de Icaza <miguel@ximian.com>
14084 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14085 for the access level checking.
14087 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
14088 `TypeContainer container', because I kept getting confused when I
14089 was debugging this code.
14091 * expression.cs (Indexers): Instead of tracking getters/setters,
14092 we now track them in parallel. We create one arraylist less, but
14093 most importantly it is possible now for the LValue code to find a
14094 matching get for a set.
14096 (IndexerAccess.DoResolveLValue): Update the code.
14097 GetIndexersForType has been modified already to extract all the
14098 indexers from a type. The code assumed it did not.
14100 Also make the code set the correct return type for the indexer.
14101 This was fixed a long time ago for properties, but was missing for
14102 indexers. It used to be void_type.
14104 (Binary.Emit): Test first for doubles instead of
14105 floats, as they are more common.
14107 (Binary.EmitBranchable): Use the .un version of the branch opcodes
14108 when dealing with floats and the <=, >= operators. This fixes bug
14111 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14112 to load the array value by emitting a load on the foreach variable
14113 type. This was incorrect.
14115 We now emit the code to load an element using the the array
14116 variable type, and then we emit the conversion operator.
14120 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
14122 * attribute.cs: Avoid allocation of ArrayLists in the common case.
14124 2003-04-09 Miguel de Icaza <miguel@ximian.com>
14126 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14127 test for protection before we test for signatures.
14129 (MethodSignature.ToString): implement.
14131 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14132 to the case where we reduced into a LongConstant.
14134 * decl.cs (CheckAccessLevel): If the type is an array, we can not
14135 depend on whether the information is acurrate, because the
14136 Microsoft runtime will always claim that the array type is public,
14137 regardless of the real state.
14139 If the type is a pointer, another problem happens: the type is
14140 reported as non-public in Microsoft.
14142 In both cases we have to call CheckAccessLevel recursively with
14143 the underlying type as the argument to be tested.
14145 2003-04-08 Miguel de Icaza <miguel@ximian.com>
14147 * assign.cs (Assign.Emit): If we are dealing with a compound
14148 assignment expression, we should use the code path that stores the
14149 intermediate result in a temporary value. This fixes #40903.
14151 *expression.cs (Indirection.ToString): Provide ToString method for
14154 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
14156 * class.cs: Null out fields holding references to Block objects so
14157 they can be garbage collected.
14159 * expression.cs (OverloadResolve): Remove unused local.
14161 2003-04-07 Martin Baulig <martin@ximian.com>
14163 * codegen.cs (EmitContext.CurrentFile): New public field.
14164 (EmitContext.Mark): Use the CurrentFile to check whether the
14165 location is in the correct file.
14166 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14168 2003-04-07 Martin Baulig <martin@ximian.com>
14170 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14172 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14173 location. [FIXME: The location argument which gets passed to this
14174 method is sometimes wrong!]
14176 2003-04-07 Nick Drochak <ndrochak@gol.com>
14178 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14180 2003-04-07 Miguel de Icaza <miguel@ximian.com>
14182 * expression.cs (Indirection.EmitAssign): We were using the
14183 temporary, but returning immediately instead of continuing the
14186 2003-04-06 Martin Baulig <martin@ximian.com>
14188 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14189 if it's a nested child, but also deriving from the outer class.
14192 * typemanager.cs (IsNestedChildOf): Make this work if it's a
14193 nested child, but also deriving from the outer class. See
14195 (FilterWithClosure): We may access private members of the outer
14196 class if we're a nested child and deriving from the outer class.
14197 (RealMemberLookup): Only set `closure_private_ok' if the
14198 `original_bf' contained BindingFlags.NonPublic.
14200 2003-04-05 Martin Baulig <martin@ximian.com>
14202 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14203 probe if its a type parameter, and if so, flag an error.
14205 * decl.cs: Move here the SetParameterInfo code from class.cs.
14206 Handle IsGeneric here.
14208 Handle a variety of errors in the parameter info definition.
14210 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14211 type parameters here.
14213 * cs-parser.jay (class_declaration): report errors for parameters
14216 2003-01-21 Miguel de Icaza <miguel@ximian.com>
14218 * generic.cs: New file, contains support code for generics.
14220 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14221 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14223 Update parser for the above removals.
14225 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
14226 now taken care of in the parser.
14228 2003-04-02 Miguel de Icaza <miguel@ximian.com>
14230 * class.cs (Event.Define): Do not allow abstract events to have
14233 2003-04-01 Miguel de Icaza <miguel@ximian.com>
14235 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14236 block in event declarations.
14238 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14239 value type, get its address.
14241 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14242 leaving a class on the stack instead of a boolean value (int
14243 0/1). Change the code so we compare against null, and then the
14244 result against zero.
14246 * class.cs (TypeContainer.GetClassBases): We were checking for the
14247 parent class being sealed too late.
14249 * expression.cs (Binary.Emit): For <= and >= when dealing with
14250 floating point values, use cgt.un and clt.un instead of cgt and
14253 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
14255 * statement.cs: Apply the same optimization as MS: skip the
14256 GetEnumerator returning an IEnumerator, and use the one returning a
14257 CharEnumerator instead. This allows us to avoid the try-finally block
14260 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
14262 * cs-parser.jay: Attributes cannot be applied to
14263 namespaces. Fixes #40473
14265 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14268 (Add*): check if the name is valid using the full name for constants,
14269 fields, properties and events.
14271 2003-03-28 Miguel de Icaza <miguel@ximian.com>
14273 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14274 char constants to be part of the enumeration.
14276 * expression.cs (Conditional.DoResolve): Add support for operator
14277 true. Implements the missing functionality from 14.12
14279 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14280 operator true/false as required by the spec.
14282 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14283 implicit conversion to boolean.
14285 * statement.cs (Statement.ResolveBoolean): A boolean expression is
14286 also one where the type implements `operator true'.
14288 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14289 get an expression that will invoke operator true based on an
14292 (GetConversionOperators): Removed the hack that called op_True
14295 (Expression.ResolveBoolean): Move this from Statement.
14297 2003-03-17 Miguel de Icaza <miguel@ximian.com>
14299 * ecore.cs (FieldExpr): do not allow initialization of initonly
14300 fields on derived classes
14302 2003-03-13 Martin Baulig <martin@ximian.com>
14304 * statement.cs (Block.Emit): Call ig.BeginScope() and
14305 ig.EndScope() when compiling with debugging info; call
14306 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14308 2003-03-08 Miguel de Icaza <miguel@ximian.com>
14310 * expression.cs (Indexers): Do not construct immediately, allow
14311 for new members to be appended as we go. Fixes 38143
14313 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14315 * expression.cs: save/restore context when resolving an unchecked
14318 2003-03-05 Miguel de Icaza <miguel@ximian.com>
14320 * cfold.cs: Catch division by zero in modulus operator during
14323 2003-03-03 Miguel de Icaza <miguel@ximian.com>
14325 * interface.cs (Interface.DefineMembers): Avoid defining members
14328 2003-02-27 Miguel de Icaza <miguel@ximian.com>
14330 * driver.cs: handle the +/- options for -noconfig
14332 * statement.cs (Unckeched.Resolve): Also track the state of
14333 unchecked in the Resolve phase.
14335 2003-02-27 Martin Baulig <martin@ximian.com>
14337 * ecore.cs (Expression.MemberLookup): Don't create a
14338 MethodGroupExpr for something which is not a method. Fixes #38291.
14340 2003-02-25 Miguel de Icaza <miguel@ximian.com>
14342 * class.cs (MemberBase.CheckParameters): Also check that the type
14343 is unmanaged if it is a pointer.
14345 * expression.cs (SizeOf.Resolve): Add location information.
14347 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14348 a managed type is declared.
14350 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14351 parameter modifiers as well. Fixes bug 38606
14353 * class.cs: Very sad. Am backing out the speed up changes
14354 introduced by the ArrayList -> Array in the TypeContainer, as they
14355 were not actually that much faster, and introduced a bug (no error
14356 reports on duplicated methods).
14358 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14359 source first, this will guarantee that we have a valid expression
14360 before calling in lower levels functions that will require a
14361 resolved object. Then use this original_source in the
14362 target.ResolveLValue instead of the original source that was
14365 Another change. Use target.Resolve instead of LValueResolve.
14366 Although we are resolving for LValues, we will let the Assign code
14367 take care of that (it will be called again from Resolve). This
14368 basically allows code like this:
14370 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14371 class Y { void A (X x) { x [0] += o; }
14373 The problem was that the indexer was trying to resolve for
14374 set_Item (idx, object o) and never finding one. The real set_Item
14375 was set_Item (idx, X). By delaying the process we get the right
14380 2003-02-23 Martin Baulig <martin@ximian.com>
14382 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14383 while calling DoEmit ().
14385 * codegen.cs (EmitContext.Mark): Don't mark locations in other
14386 source files; if you use the #line directive inside a method, the
14387 compiler stops emitting line numbers for the debugger until it
14388 reaches the end of the method or another #line directive which
14389 restores the original file.
14391 2003-02-23 Martin Baulig <martin@ximian.com>
14393 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14395 2003-02-23 Martin Baulig <martin@ximian.com>
14397 * statement.cs (Block.AddChildVariableNames): We need to call this
14398 recursively, not just for our immediate children.
14400 2003-02-23 Martin Baulig <martin@ximian.com>
14402 * class.cs (Event.Define): Always make the field private, like csc does.
14404 * typemanager.cs (TypeManager.RealMemberLookup): Make events
14405 actually work, fixes bug #37521.
14407 2003-02-23 Miguel de Icaza <miguel@ximian.com>
14409 * delegate.cs: When creating the various temporary "Parameters"
14410 classes, make sure that we call the ComputeAndDefineParameterTypes
14411 on those new parameters (just like we do with the formal ones), to
14412 allow them to be resolved in the context of the DeclSpace.
14414 This fixes the bug that Dick observed in Bugzilla #38530.
14416 2003-02-22 Miguel de Icaza <miguel@ximian.com>
14418 * expression.cs (ResolveMemberAccess): When resolving a constant,
14419 do not attempt to pull a constant if the value was not able to
14420 generate a valid constant.
14422 * const.cs (LookupConstantValue): Do not report more errors than required.
14424 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14426 * expression.cs: fixes bug #38328.
14428 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14430 * class.cs: Changed all the various members that can be part of a
14431 class from being an ArrayList to be an Array of the right type.
14432 During the DefineType type_list, interface_list, delegate_list and
14433 enum_list are turned into types, interfaces, delegates and enums
14436 And during the member population, indexer_list, event_list,
14437 constant_list, field_list, instance_constructor_list, method_list,
14438 operator_list and property_list are turned into their real arrays.
14440 Although we could probably perform this operation earlier, for
14441 good error reporting we need to keep the lists and remove the
14442 lists for longer than required.
14444 This optimization was triggered by Paolo profiling the compiler
14445 speed on the output of `gen-sample-program.pl' perl script.
14447 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14448 not crash in methods like MemberLookupFailed that use this field.
14450 This problem arises when the compiler fails to resolve a type
14451 during interface type definition for example.
14453 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14455 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14456 inherit from System.Object, so we have to stop at null, not only
14457 when reaching System.Object.
14459 2003-02-17 Miguel de Icaza <miguel@ximian.com>
14461 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14462 DeclaredOnly because the parent indexer might have had a different
14463 name, but did not loop until the top of the hierarchy was reached.
14465 The problem this one fixes is 35492: when a class implemented an
14466 indexer from an interface, we were getting the interface method
14467 (which was abstract) and we were flagging an error (can not invoke
14470 This also keeps bug 33089 functioning, and test-148 functioning.
14472 * typemanager.cs (IsSpecialMethod): The correct way of figuring
14473 out if a method is special is to see if it is declared in a
14474 property or event, or whether it is one of the predefined operator
14475 names. This should fix correctly #36804.
14477 2003-02-15 Miguel de Icaza <miguel@ximian.com>
14479 The goal here is to remove the dependency on EmptyCast.Peel ().
14480 Killing it completely.
14482 The problem is that currently in a number of places where
14483 constants are expected, we have to "probe" for an EmptyCast, and
14484 Peel, which is not the correct thing to do, as this will be
14485 repetitive and will likely lead to errors.
14487 The idea is to remove any EmptyCasts that are used in casts that
14488 can be reduced to constants, so we only have to cope with
14491 This bug hunt was triggered by Bug 37363 and the desire to remove
14492 the duplicate pattern where we were "peeling" emptycasts to check
14493 whether they were constants. Now constants will always be
14496 * ecore.cs: Use an enumconstant here instead of wrapping with
14499 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14500 throwing me off. By handling this we can get rid of a few hacks.
14502 * statement.cs (Switch): Removed Peel() code.
14504 2003-02-14 Miguel de Icaza <miguel@ximian.com>
14506 * class.cs: Location information for error 508
14508 * expression.cs (New.DoResolve): Add a guard against double
14509 resolution of an expression.
14511 The New DoResolve might be called twice when initializing field
14512 expressions (see EmitFieldInitializers, the call to
14513 GetInitializerExpression will perform a resolve on the expression,
14514 and later the assign will trigger another resolution
14516 This leads to bugs (#37014)
14518 * delegate.cs: The signature for EndInvoke should contain any ref
14519 or out parameters as well. We were not doing this in the past.
14521 * class.cs (Field.Define): Do not overwrite the type definition
14522 inside the `volatile' group. Turns out that volatile enumerations
14523 were changing the type here to perform a validity test, which
14526 2003-02-12 Miguel de Icaza <miguel@ximian.com>
14528 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14529 and structs, we do not want to load the instance variable
14531 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14532 enum_type has to be handled like an object reference (implicit
14533 conversions exists from this to object), but the regular IsClass
14534 and IsValueType tests will never return true for this one.
14536 Also we use TypeManager.IsValueType instead of type.IsValueType,
14537 just for consistency with the rest of the code (this is only
14538 needed if we ever use the construct exposed by test-180.cs inside
14539 corlib, which we dont today).
14541 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
14543 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14546 2003-02-09 Martin Baulig <martin@ximian.com>
14548 * namespace.cs (Namespace..ctor): Added SourceFile argument.
14549 (Namespace.DefineNamespaces): New static public method; this is
14550 called when we're compiling with debugging to add all namespaces
14551 to the symbol file.
14553 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14554 pass it to the Namespace's .ctor.
14556 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14557 and MethodBase arguments; pass the namespace ID to the symwriter;
14558 pass the MethodBase instead of the token to the symwriter.
14559 (SymbolWriter.DefineNamespace): New method to add a namespace to
14562 2003-02-09 Martin Baulig <martin@ximian.com>
14564 * symbolwriter.cs: New file. This is a wrapper around
14565 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
14566 methods here in near future.
14568 2003-02-09 Martin Baulig <martin@ximian.com>
14570 * codegen.cs (EmitContext.Mark): Just pass the arguments to
14571 ILGenerator.MarkSequencePoint() which are actually used by the
14574 2003-02-09 Martin Baulig <martin@ximian.com>
14576 * location.cs (SourceFile): New public sealed class. This
14577 contains the name and an index which is used in the location's token.
14578 (Location): Reserve an appropriate number of bits in the token for
14579 the source file instead of walking over that list, this gives us a
14580 really huge performance improvement when compiling with debugging.
14582 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14583 `SourceFile' argument instead of a string.
14584 (Driver.ProcessFile): Add all the files via Location.AddFile(),
14585 but don't parse/tokenize here, we need to generate the list of all
14586 source files before we do that.
14587 (Driver.ProcessFiles): New static function. Parses/tokenizes all
14590 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14591 instead of a string.
14593 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14596 2003-02-09 Martin Baulig <martin@ximian.com>
14598 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14599 filename on `#line default'.
14601 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14603 * statement.cs: don't clear the pinned var when the fixed statement
14604 returns from the method (fixes bug#37752).
14606 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14608 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
14611 2003-02-07 Martin Baulig <martin@ximian.com>
14613 * driver.cs: Removed the `--debug-args' command line argument.
14615 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14616 automatically by the AsssemblyBuilder.
14617 (CodeGen.InitializeSymbolWriter): We don't need to call any
14618 initialization function on the symbol writer anymore. This method
14619 doesn't take any arguments.
14621 2003-02-03 Miguel de Icaza <miguel@ximian.com>
14623 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14624 from referenced assemblies as well.
14626 2003-02-02 Martin Baulig <martin@ximian.com>
14628 * class.cs (MethodData.Emit): Generate debugging info for external methods.
14630 2003-02-02 Martin Baulig <martin@ximian.com>
14632 * class.cs (Constructor.Emit): Open the symbol writer before
14633 emitting the constructor initializer.
14634 (ConstructorInitializer.Emit): Call ec.Mark() to allow
14635 single-stepping through constructor initializers.
14637 2003-01-30 Miguel de Icaza <miguel@ximian.com>
14639 * class.cs: Handle error 549: do not allow virtual methods in
14642 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14644 * decl.cs: Check access levels when resolving types
14646 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14648 * statement.cs: Add parameters and locals set in catch blocks that might
14649 return to set vector
14651 2003-01-29 Miguel de Icaza <miguel@ximian.com>
14653 * class.cs (Operator): Set the SpecialName flags for operators.
14655 * expression.cs (Invocation.DoResolve): Only block calls to
14656 accessors and operators on SpecialName methods.
14658 (Cast.TryReduce): Handle conversions from char constants.
14661 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14663 * statement.cs: small memory and time optimization in FlowBranching.
14665 2003-01-28 Pedro Mart <yoros@wanadoo.es>
14667 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14668 problem that the last fix but in the other sid (Set).
14670 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14671 access when there is no indexer in the hierarchy.
14673 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14675 * class.cs: Combine some if statements.
14677 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14679 * driver.cs: fixed bug #37187.
14681 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
14683 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14684 any indexer, it's needed to build a list with all the indexers in the
14685 hierarchy (AllGetters), else we have problems. Fixes #35653.
14687 2003-01-23 Miguel de Icaza <miguel@ximian.com>
14689 * class.cs (MethodData.Define): It is wrong for an interface
14690 implementation to be static in both cases: explicit and implicit.
14691 We were only handling this in one case.
14693 Improve the if situation there to not have negations.
14695 * class.cs (Field.Define): Turns out that we do not need to check
14696 the unsafe bit on field definition, only on usage. Remove the test.
14698 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14700 * driver.cs: use assembly.Location instead of Codebase (the latest
14701 patch made mcs fail when using MS assemblies).
14703 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
14705 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14706 get the path to *corlib.dll.
14708 2003-01-21 Nick Drochak <ndrochak@gol.com>
14712 * typemanager.cs: Remove compiler warnings
14714 2003-01-20 Duncan Mak <duncan@ximian.com>
14716 * AssemblyInfo.cs: Bump the version number to 0.19.
14718 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14720 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14722 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
14724 * class.cs (Constructor::Emit): Emit debugging info for constructors.
14726 2003-01-17 Miguel de Icaza <miguel@ximian.com>
14728 * cs-parser.jay: Small fix: we were not comparing the constructor
14729 name correctly. Thanks to Zoltan for the initial pointer.
14731 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14733 * cs-tokenizer.cs: Set file name when specified with #line
14735 2003-01-15 Miguel de Icaza <miguel@ximian.com>
14737 * cs-parser.jay: Only perform the constructor checks here if we
14738 are named like the class; This will help provider a better
14739 error. The constructor path is taken when a type definition is
14740 not found, but most likely the user forgot to add the type, so
14741 report that rather than the constructor error.
14743 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14745 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14748 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14750 * cs-parser.jay: Add cleanup call.
14752 2003-01-13 Duncan Mak <duncan@ximian.com>
14754 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14755 consistent with other methods.
14757 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14759 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14761 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14763 * attribute.cs: only set GuidAttr to true when we have a
14766 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14770 * typemanager.cs: fixes to allow mcs compile corlib with the new
14771 Type.IsSubclassOf fix.
14773 2003-01-08 Miguel de Icaza <miguel@ximian.com>
14775 * expression.cs (LocalVariableReference.DoResolve): Classify a
14776 constant as a value, not as a variable. Also, set the type for
14779 * cs-parser.jay (fixed_statement): take a type instead of a
14780 pointer_type, so we can produce a better error message later.
14782 * statement.cs (Fixed.Resolve): Flag types that are not pointers
14785 (For.DoEmit): Make inifinite loops have a
14786 non-conditional branch back.
14788 (Fixed.DoEmit): First populate the pinned variables, then emit the
14789 statement, then clear the variables. Before I was emitting the
14790 code once for each fixed piece.
14793 2003-01-08 Martin Baulig <martin@ximian.com>
14795 * statement.cs (FlowBranching.MergeChild): A break in a
14796 SWITCH_SECTION does not leave a loop. Fixes #36155.
14798 2003-01-08 Martin Baulig <martin@ximian.com>
14800 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14801 lives in the same number space than `param_map'. Fixes #36154.
14803 2003-01-07 Miguel de Icaza <miguel@ximian.com>
14805 * cs-parser.jay (constructor_declaration): Set the
14806 Constructor.ModFlags before probing for it. This makes the
14807 compiler report 514, 515 and 132 (the code was there, but got
14810 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14811 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14812 (GotoCase.Resolve): Set `Returns' to ALWAYS.
14814 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14816 * enum.cs: create the enum static fields using the enum type.
14818 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14820 * class.cs: don't try to create the ParamBuilder for the return
14821 type if it's not needed (and handle it breaking for the ms runtime
14824 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14826 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14828 2002-12-29 Miguel de Icaza <miguel@ximian.com>
14830 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14831 the command. This showed up while compiling the JANET source
14832 code, which used \r as its only newline separator.
14834 2002-12-28 Miguel de Icaza <miguel@ximian.com>
14836 * class.cs (Method.Define): If we are an operator (because it
14837 reuses our code), then set the SpecialName and HideBySig. #36128
14839 2002-12-22 Miguel de Icaza <miguel@ximian.com>
14841 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14842 exception, report error 120 `object reference required'.
14844 * driver.cs: Add --pause option, used during to measure the size
14845 of the process as it goes with --timestamp.
14847 * expression.cs (Invocation.DoResolve): Do not allow methods with
14848 SpecialName to be invoked.
14850 2002-12-21 Miguel de Icaza <miguel@ximian.com>
14852 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14853 number before adding it.
14855 2002-12-21 Ravi Pratap <ravi@ximian.com>
14857 * ecore.cs (StandardImplicitConversion): When in an unsafe
14858 context, we allow conversion between void * to any other pointer
14859 type. This fixes bug #35973.
14861 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14863 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14864 is not thrown when extensionless outputs are used
14866 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14868 * rootcontext.cs: fixed compilation of corlib.
14870 2002-12-19 Miguel de Icaza <miguel@ximian.com>
14872 * attribute.cs (Attributes.Contains): Add new method.
14874 * class.cs (MethodCore.LabelParameters): if the parameter is an
14875 `out' parameter, check that no attribute `[In]' has been passed.
14877 * enum.cs: Handle the `value__' name in an enumeration.
14879 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
14881 * decl.cs: Added special case to allow overrides on "protected
14884 2002-12-18 Ravi Pratap <ravi@ximian.com>
14886 * attribute.cs (Attributes.AddAttributeSection): Rename to this
14887 since it makes much more sense.
14889 (Attributes.ctor): Don't require a Location parameter.
14891 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14893 * attribute.cs (ApplyAttributes): Remove extra Location parameters
14894 since we already have that information per attribute.
14896 * everywhere : make appropriate changes.
14898 * class.cs (LabelParameters): Write the code which actually
14899 applies attributes to the return type. We can't do this on the MS
14900 .NET runtime so we flag a warning in the case an exception is
14903 2002-12-18 Miguel de Icaza <miguel@ximian.com>
14905 * const.cs: Handle implicit null conversions here too.
14907 2002-12-17 Ravi Pratap <ravi@ximian.com>
14909 * class.cs (MethodCore.LabelParameters): Remove the extra
14910 Type [] parameter since it is completely unnecessary. Instead
14911 pass in the method's attributes so that we can extract
14912 the "return" attribute.
14914 2002-12-17 Miguel de Icaza <miguel@ximian.com>
14916 * cs-parser.jay (parse): Use Report.Error to flag errors instead
14917 of ignoring it and letting the compile continue.
14919 * typemanager.cs (ChangeType): use an extra argument to return an
14920 error condition instead of throwing an exception.
14922 2002-12-15 Miguel de Icaza <miguel@ximian.com>
14924 * expression.cs (Unary.TryReduce): mimic the code for the regular
14925 code path. Perform an implicit cast in the cases where we can
14926 implicitly convert to one of the integral types, and then reduce
14927 based on that constant. This fixes bug #35483.
14929 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14931 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14933 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14935 * namespace.cs: fixed bug #35489.
14937 2002-12-12 Miguel de Icaza <miguel@ximian.com>
14939 * class.cs: Remove some dead code.
14941 * cs-parser.jay: Estimate the number of methods needed
14942 (RootContext.MethodCount);
14944 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14945 numbers instead of StringBuilders.
14947 * support.cs (PtrHashtable): Add constructor with initial size;
14948 We can now reduce reallocations of the method table.
14950 2002-12-10 Ravi Pratap <ravi@ximian.com>
14952 * attribute.cs (ApplyAttributes): Keep track of the emitted
14953 attributes on a per-target basis. This fixes bug #35413.
14955 2002-12-10 Miguel de Icaza <miguel@ximian.com>
14957 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14958 default to the Windows 1252 encoding.
14960 (UnixParseOption): Support version, thanks to Alp for the missing
14963 * AssemblyInfo.cs: Add nice assembly information.
14965 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14968 * cs-parser.jay: Allow a trailing comma before the close bracked
14969 in the attribute_section production.
14971 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14972 address of the instance was being taken, I will take this out,
14973 because we take the address of the object immediately here.
14975 2002-12-09 Ravi Pratap <ravi@ximian.com>
14977 * typemanager.cs (AreMultipleAllowed): Take care of the most
14978 obvious case where attribute type is not in the current assembly -
14981 2002-12-08 Miguel de Icaza <miguel@ximian.com>
14983 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14984 definitions, instead of doing that afterwards.
14986 Also we use a nice little hack, depending on the constructor, we
14987 know if we are a "composed" name or a simple name. Hence, we
14988 avoid the IndexOf test, and we avoid
14990 * codegen.cs: Add code to assist in a bug reporter to track down
14991 the source of a compiler crash.
14993 2002-12-07 Ravi Pratap <ravi@ximian.com>
14995 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14996 types have been emitted for a given element and flag an error
14997 if something which does not have AllowMultiple set is used more
15000 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15001 attribute types and their corresponding AllowMultiple properties
15003 (AreMultipleAllowed): Check the property for a given type.
15005 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15006 property in the case we have a TypeContainer.
15008 (Attributes.AddAttribute): Detect duplicates and just skip on
15009 adding them. This trivial fix catches a pretty gross error in our
15010 attribute emission - global attributes were being emitted twice!
15012 Bugzilla bug #33187 is now fixed.
15014 2002-12-06 Miguel de Icaza <miguel@ximian.com>
15016 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15017 instead of pp_and).
15019 * expression.cs (Binary.ResolveOperator): I can only use the
15020 Concat (string, string, string) and Concat (string, string,
15021 string, string) if the child is actually a concatenation of
15024 2002-12-04 Miguel de Icaza <miguel@ximian.com>
15026 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15027 context where we need a 2-character lookahead.
15029 * pending.cs (PendingImplementation): Rework so we can keep track
15030 of interface types all the time, and flag those which were
15031 implemented by parents as optional.
15033 2002-12-03 Miguel de Icaza <miguel@ximian.com>
15035 * expression.cs (Binary.ResolveOperator): Use
15036 String.Concat(string,string,string) or
15037 String.Concat(string,string,string,string) when possible.
15039 * typemanager: More helper methods.
15042 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15044 * pending.cs: remove the bogus return from GetMissingInterfaces()
15045 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15047 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15049 * namespace.cs: avoid duplicated 'using xxx' being added to
15050 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15051 when we get more than one 'using' statement for the same namespace.
15052 Report a CS0105 warning for it.
15054 2002-11-30 Miguel de Icaza <miguel@ximian.com>
15056 * cs-tokenizer.cs (consume_identifier): use read directly, instead
15057 of calling getChar/putback, uses internal knowledge of it.
15059 (xtoken): Reorder tokenizer so most common patterns are checked
15060 first. This reduces the compilation time in another 5% (from 8.11s
15061 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15063 The parsing time is 22% of the compilation in mcs, and from that
15064 64% is spent on the tokenization process.
15066 I tried using a binary search for keywords, but this is slower
15067 than the hashtable. Another option would be to do a couple of
15070 * Not use a StringBuilder, instead use an array of chars,
15071 with a set value. Notice that this way we could catch
15072 the 645 error without having to do it *afterwards*.
15074 * We could write a hand-parser to avoid the hashtable
15075 compares altogether.
15077 The identifier consumption process takes 37% of the tokenization
15078 time. Another 15% is spent on is_number. 56% of the time spent
15079 on is_number is spent on Int64.Parse:
15081 * We could probably choose based on the string length to
15082 use Int32.Parse or Int64.Parse and avoid all the 64-bit
15085 Another 3% is spend on wrapping `xtoken' in the `token' function.
15087 Handle 0xa0 as whitespace (#34752)
15089 2002-11-26 Miguel de Icaza <miguel@ximian.com>
15091 * typemanager.cs (IsCLRType): New routine to tell whether a type
15092 is one of the builtin types.
15094 Maybe it needs to use TypeCodes to be faster. Maybe we could use
15095 typecode in more places instead of doing pointer comparissions.
15096 We could leverage some knowledge about the way the typecodes are
15099 New code to cache namespaces in assemblies, it is currently not
15100 invoked, to be used soon.
15102 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15104 * expression.cs (Binary.ResolveOperator): specially handle
15105 strings, and do not perform user-defined operator overloading for
15108 2002-11-24 Miguel de Icaza <miguel@ximian.com>
15110 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15111 internalcall as it is a pretty simple operation; Avoid whenever
15112 possible to call Char.IsLetter.
15114 (consume_identifier): Cut by half the number of
15115 hashtable calls by merging the is_keyword and GetKeyword behavior.
15117 Do not short-circuit, because if we do, we
15118 report errors (ie, #if false && true would produce an invalid
15122 2002-11-24 Martin Baulig <martin@ximian.com>
15124 * expression.cs (Cast.TryReduce): If we're in checked syntax,
15125 check constant ranges and report a CS0221. Fixes #33186.
15127 2002-11-24 Martin Baulig <martin@ximian.com>
15129 * cs-parser.jay: Make this work for uninitialized variable
15130 declarations in the `for' initializer. Fixes #32416.
15132 2002-11-24 Martin Baulig <martin@ximian.com>
15134 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15135 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
15137 2002-11-24 Martin Baulig <martin@ximian.com>
15139 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15140 argument; if true, we also check for user-defined conversions.
15141 This is only needed if both arguments are of a user-defined type.
15142 Fixes #30443, added test-175.cs.
15143 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15145 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15147 2002-11-24 Martin Baulig <martin@ximian.com>
15149 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15150 function to get the store opcode.
15151 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15152 only emit the Ldelema if the store opcode is Stobj. You must run
15153 both test-34 and test-167 to test this. Fixes #34529.
15155 2002-11-23 Martin Baulig <martin@ximian.com>
15157 * ecore.cs (Expression.MemberLookup): Added additional
15158 `qualifier_type' argument which is used when we're being called
15159 from MemberAccess.DoResolve() and null if we're called from a
15161 (Expression.MemberLookupFailed): New method to report errors; this
15162 does the CS1540 check and reports the correct error message.
15164 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15165 argument for the CS1540 check and redone the way how we're dealing
15166 with private members. See the comment in the source code for details.
15167 (FilterWithClosure): Reverted this back to revision 1.197; renamed
15168 `closure_start_type' to `closure_qualifier_type' and check whether
15169 it's not null. It was not this filter being broken, it was just
15170 being called with the wrong arguments.
15172 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15173 and pass it the correct `qualifier_type'; this also does the error
15176 2002-11-22 Miguel de Icaza <miguel@ximian.com>
15178 * expression.cs (Invocation.EmitParams): If the we are dealing
15179 with a non-built-in value type, load its address as well.
15181 (ArrayCreation): Use a a pretty constant instead
15182 of the hardcoded value 2. Use 6 instead of 2 for the number of
15183 static initializers.
15185 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15186 because they are not really value types, just glorified integers.
15188 * driver.cs: Do not append .exe, the CSC compiler does not do it.
15190 * ecore.cs: Remove redundant code for enumerations, make them use
15191 the same code path as everything else, fixes the casting issue
15192 with enumerations in Windows.Forms.
15194 * attribute.cs: Do only cast to string if it is a string, the
15195 validation happens later.
15197 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15198 people upgrade their corlibs.
15200 * ecore.cs: Oops, enumerations were not following the entire code path
15202 2002-11-21 Miguel de Icaza <miguel@ximian.com>
15204 * typemanager.cs (FilterWithClosure): Commented out the test for
15205 1540 in typemanager.cs, as it has problems when accessing
15206 protected methods from a parent class (see test-174.cs).
15208 * attribute.cs (Attribute.ValidateGuid): new method.
15209 (Attribute.Resolve): Use above.
15211 2002-11-19 Miguel de Icaza <miguel@ximian.com>
15213 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15215 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15216 handling for enumerations, as we only needed the TypeContainer
15217 functionality to begin with (this is required for the fix below to
15218 work for enums that reference constants in a container class for
15221 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15223 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15224 a valid TypeBuilder to perform lookups on.o
15226 * class.cs (InheritableMemberSignatureCompare): Use true in the
15227 call to GetGetMethod and GetSetMethod, because we are comparing
15228 the signature, and we need to get the methods *even* if they are
15231 (PropertyBase.CheckBase): ditto.
15233 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15234 GotoCase.Resolve): Use Peel on EmpytCasts.
15236 * ecore.cs (EmptyCast): drop child, add Peel method.
15238 2002-11-17 Martin Baulig <martin@ximian.com>
15240 * ecore.cs (EmptyCast.Child): New public property.
15242 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15243 label resolved to an EmptyCast. Fixes #34162.
15244 (GotoCase.Resolve): Likewise.
15245 (Block.EmitMeta): Likewise.
15247 2002-11-17 Martin Baulig <martin@ximian.com>
15249 * expression.cs (Invocation.BetterConversion): Prefer int over
15250 uint; short over ushort; long over ulong for integer literals.
15251 Use ImplicitConversionExists instead of StandardConversionExists
15252 since we also need to check for user-defined implicit conversions.
15253 Fixes #34165. Added test-173.cs.
15255 2002-11-16 Martin Baulig <martin@ximian.com>
15257 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15258 with the `true' and `false' literals. Fixes #33151.
15260 2002-11-16 Martin Baulig <martin@ximian.com>
15262 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15263 October 22nd; don't do the cs1540 check for static members.
15265 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15266 now using our own filter here and doing the cs1540 check again.
15268 2002-11-16 Martin Baulig <martin@ximian.com>
15270 * support.cs (InternalParameters): Don't crash if we don't have
15271 any fixed parameters. Fixes #33532.
15273 2002-11-16 Martin Baulig <martin@ximian.com>
15275 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15276 when looking up static methods to make this work on Windows.
15279 2002-11-16 Martin Baulig <martin@ximian.com>
15281 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15282 a setter rather than using PropertyInfo.CanWrite.
15284 2002-11-15 Nick Drochak <ndrochak@gol.com>
15286 * class.cs: Allow acces to block member by subclasses. Fixes build
15289 2002-11-14 Martin Baulig <martin@ximian.com>
15291 * class.cs (Constructor.Emit): Added the extern/block check.
15294 2002-11-14 Martin Baulig <martin@ximian.com>
15296 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15297 iteration while looking for indexers, this is needed because the
15298 indexer may have a different name in our base classes. Fixed the
15299 error reporting (no indexers at all, not get accessor, no
15300 overloaded match). Fixes bug #33089.
15301 (IndexerAccess.DoResolveLValue): Likewise.
15303 2002-11-14 Martin Baulig <martin@ximian.com>
15305 * class.cs (PropertyBase.CheckBase): Make this work for multiple
15306 indexers. Fixes the first part of bug #33089.
15307 (MethodSignature.InheritableMemberSignatureCompare): Added support
15310 2002-11-13 Ravi Pratap <ravi@ximian.com>
15312 * attribute.cs (Attribute.Resolve): Catch the
15313 NullReferenceException and report it since it isn't supposed to
15316 2002-11-12 Miguel de Icaza <miguel@ximian.com>
15318 * expression.cs (Binary.EmitBranchable): Also handle the cases for
15319 LogicalOr and LogicalAnd that can benefit from recursively
15320 handling EmitBranchable. The code now should be nice for Paolo.
15322 2002-11-08 Miguel de Icaza <miguel@ximian.com>
15324 * typemanager.cs (LookupType): Added a negative-hit hashtable for
15325 the Type lookups, as we perform quite a number of lookups on
15326 non-Types. This can be removed once we can deterministically tell
15327 whether we have a type or a namespace in advance.
15329 But this might require special hacks from our corlib.
15333 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15334 and double which avoids a conversion from an integer to a double.
15336 * expression.cs: tiny optimization, avoid calling IsConstant,
15337 because it effectively performs the lookup twice.
15339 2002-11-06 Miguel de Icaza <miguel@ximian.com>
15341 But a bogus return here to keep the semantics of the old code
15342 until the Mono runtime is fixed.
15344 * pending.cs (GetMissingInterfaces): New method used to remove all
15345 the interfaces that are already implemented by our parent
15346 classes from the list of pending methods.
15348 * interface.cs: Add checks for calls after ResolveTypeExpr.
15350 2002-11-05 Miguel de Icaza <miguel@ximian.com>
15352 * class.cs (Class.Emit): Report warning 67: event not used if the
15353 warning level is beyond 3.
15355 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15356 being a NullLiteral.
15358 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15361 * class.cs (TypeContainer.GetClassBases): Cover a missing code
15362 path that might fail if a type can not be resolved.
15364 * expression.cs (Binary.Emit): Emit unsigned versions of the
15367 * driver.cs: use error 5.
15369 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15371 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15373 2002-11-01 Miguel de Icaza <miguel@ximian.com>
15375 * cs-parser.jay (switch_section): A beautiful patch from Martin
15376 Baulig that fixed 33094.
15378 2002-10-31 Miguel de Icaza <miguel@ximian.com>
15380 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15381 Check whether the base is abstract and report an error if so.
15383 * expression.cs (IndexerAccess.DoResolveLValue,
15384 IndexerAccess.DoResolve): ditto.
15386 (Invocation.DoResolve): ditto.
15388 (Invocation.FullMethodDesc): Improve the report string.
15390 * statement.cs (Block): Eliminate IsVariableDefined as it is
15391 basically just a wrapper for GetVariableInfo.
15393 * ecore.cs (SimpleName): Use new
15395 * support.cs (ReflectionParamter.ParameterType): We unwrap the
15396 type, as we return the actual parameter ref/unref state on a
15399 2002-10-30 Miguel de Icaza <miguel@ximian.com>
15401 * support.cs: Return proper flags REF/OUT fixing the previous
15404 * expression.cs: Reverted last patch, that was wrong. Is_ref is
15405 not used to mean `ref' but `ref or out' in ParameterReference
15407 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15408 full type signature instead of calling TypeManger.CSharpName
15411 * support.cs (InternalParameters.ParameterDesc): Do not compare
15412 directly to the modflags, because REF/OUT will actually be bitsets
15415 * delegate.cs (VerifyMethod): Check also the modifiers.
15417 * cs-tokenizer.cs: Fix bug where floating point values with an
15418 exponent where a sign was missing was ignored.
15420 * driver.cs: Allow multiple assemblies to be specified in a single
15423 2002-10-28 Miguel de Icaza <miguel@ximian.com>
15425 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
15426 because identifiers after a parenthesis would end up in this kind
15427 of production, and we needed to desamiguate it for having casts
15430 (UserDefinedType *) xxx
15432 2002-10-24 Miguel de Icaza <miguel@ximian.com>
15434 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15435 we should set on the Bindingflags.NonPublic, but not turn on
15436 private_ok. private_ok controls whether a Private member is
15437 returned (this is chekced on the filter routine), while the
15438 BindingFlags.NonPublic just controls whether private/protected
15439 will be allowed. This fixes the problem part of the problem of
15440 private properties being allowed to be used in derived classes.
15442 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15443 so we can call the children DoResolveLValue method (this will
15444 properly signal errors on lvalue assignments to base properties)
15446 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15447 getter are null, and we have a property info, we know that this
15448 happened because the lookup failed, so we report an error 122 for
15449 protection level violation.
15451 We also silently return if setter and getter are null in the
15452 resolve functions, this condition only happens if we have flagged
15453 the error before. This is the other half of the problem.
15455 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15456 not have accessibility information, that is why we were returning
15457 true in the filter function in typemanager.cs.
15459 To properly report 122 (property is inaccessible because of its
15460 protection level) correctly, we report this error in ResolveAccess
15461 by failing if both the setter and the getter are lacking (ie, the
15464 DoResolve and DoLResolve have been modified to check for both
15465 setter/getter being null and returning silently, the reason being
15466 that I did not want to put the knowledge about this error in upper
15469 int old = Report.Errors;
15470 x = new PropertyExpr (...);
15471 if (old != Report.Errors)
15476 So the property expr is returned, but it is invalid, so the error
15477 will be flagged during the resolve process.
15479 * class.cs: Remove InheritablePropertySignatureCompare from the
15480 class, as we no longer depend on the property signature to compute
15481 whether it is possible to implement a method or not.
15483 The reason is that calling PropertyInfo.GetGetMethod will return
15484 null (in .NET, in Mono it works, and we should change this), in
15485 cases where the Get Method does not exist in that particular
15490 class X { public virtual int A { get { return 1; } } }
15492 class Z : Y { public override int A { get { return 2; } } }
15494 Would fail in Z because the parent (Y) would not have the property
15495 defined. So we avoid this completely now (because the alternative
15496 fix was ugly and slow), and we now depend exclusively on the
15499 (PropertyBase.CheckBase): Use a method-base mechanism to find our
15500 reference method, instead of using the property.
15502 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15503 routines are gone now.
15505 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15506 names, they were incorrectly named.
15508 * cs-tokenizer.cs: Return are more gentle token on failure.
15510 * pending.cs (PendingImplementation.InterfaceMethod): This routine
15511 had an out-of-sync index variable, which caused it to remove from
15512 the list of pending methods the wrong method sometimes.
15514 2002-10-22 Miguel de Icaza <miguel@ximian.com>
15516 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15517 CanWrite, because those refer to this particular instance of the
15518 property, and do not take into account the fact that we can
15519 override single members of a property.
15521 Constructor requires an EmitContext. The resolution process does
15522 not happen here, but we need to compute the accessors before,
15523 because the resolution does not always happen for properties.
15525 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15526 subclass, before we did not update this flag, but we did update
15529 (GetAccessors): Drop this routine, as it did not work in the
15530 presence of partially overwritten set/get methods.
15532 Notice that this broke the cs1540 detection, but that will require
15535 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15539 * driver.cs: issue a warning instead of an error if we don't support
15540 debugging for the platform. Also ignore a couple of errors that may
15541 arise when trying to write the symbols. Undo my previous patch.
15543 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15545 * driver.cs: ignore /debug switch except for Unix platforms.
15547 2002-10-23 Nick Drochak <ndrochak@gol.com>
15549 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15551 2002-10-21 Miguel de Icaza <miguel@ximian.com>
15553 * driver.cs: Do not make mcs-debug conditional, so we do not break
15554 builds that use it.
15556 * statement.cs (UsageVector.MergeChildren): I would like Martin to
15557 review this patch. But basically after all the children variables
15558 have been merged, the value of "Breaks" was not being set to
15559 new_breaks for Switch blocks. I think that it should be set after
15560 it has executed. Currently I set this to the value of new_breaks,
15561 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15562 conservative, but I do not understand this code very well.
15564 I did not break anything in the build, so that is good ;-)
15566 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15568 2002-10-20 Mark Crichton <crichton@gimp.org>
15570 * cfold.cs: Fixed compile blocker. Really fixed it this time.
15572 2002-10-20 Nick Drochak <ndrochak@gol.com>
15574 * cfold.cs: Fixed compile blocker.
15576 2002-10-20 Miguel de Icaza <miguel@ximian.com>
15578 * driver.cs: I was chekcing the key, not the file.
15580 2002-10-19 Ravi Pratap <ravi@ximian.com>
15582 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15583 message that we were generating - we just need to silently return
15586 2002-10-19 Miguel de Icaza <miguel@ximian.com>
15588 * class.cs (Event.Define): Change my previous commit, as this
15589 breaks the debugger. This is a temporary hack, as it seems like
15590 the compiler is generating events incorrectly to begin with.
15592 * expression.cs (Binary.ResolveOperator): Added support for
15593 "U operator - (E x, E y)"
15595 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15598 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15599 init-only variables, but this path did not take into account that
15600 there might be also instance readonly variables. Correct this
15603 This fixes bug 32253
15605 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15608 * driver.cs: Change the extension for modules to `netmodule'
15610 * cs-parser.jay: Improved slightly the location tracking for
15611 the debugger symbols.
15613 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15614 modifiers that were specified instead of the hardcoded value
15615 (FamAndAssem). This was basically ignoring the static modifier,
15616 and others. Fixes 32429.
15618 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15619 fixed a bug in the process (32476)
15621 * expression.cs (ArrayAccess.EmitAssign): Patch from
15622 hwang_rob@yahoo.ca that fixes bug 31834.3
15624 2002-10-18 Miguel de Icaza <miguel@ximian.com>
15626 * driver.cs: Make the module extension .netmodule.
15628 2002-10-16 Miguel de Icaza <miguel@ximian.com>
15630 * driver.cs: Report an error if the resource file is not found
15631 instead of crashing.
15633 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15634 false, like Emit does.
15636 2002-10-16 Nick Drochak <ndrochak@gol.com>
15638 * typemanager.cs: Remove unused private member. Also reported mcs
15639 bug to report this as a warning like csc.
15641 2002-10-15 Martin Baulig <martin@gnome.org>
15643 * statement.cs (Statement.Emit): Made this a virtual method; emits
15644 the line number info and calls DoEmit().
15645 (Statement.DoEmit): New protected abstract method, formerly knows
15646 as Statement.Emit().
15648 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15650 2002-10-11 Miguel de Icaza <miguel@ximian.com>
15652 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15653 have fixed a remaining problem: not every AddXXXX was adding a
15654 fully qualified name.
15656 Now everyone registers a fully qualified name in the DeclSpace as
15657 being defined instead of the partial name.
15659 Downsides: we are slower than we need to be due to the excess
15660 copies and the names being registered this way.
15662 The reason for this is that we currently depend (on the corlib
15663 bootstrap for instance) that types are fully qualified, because
15664 we dump all the types in the namespace, and we should really have
15665 types inserted into the proper namespace, so we can only store the
15666 basenames in the defined_names array.
15668 2002-10-10 Martin Baulig <martin@gnome.org>
15670 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15671 from bug #31834, see the bug report for a testcase which is
15674 2002-10-10 Martin Baulig <martin@gnome.org>
15676 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15677 flow analysis code for this.
15679 * statement.cs (Do, While, For): Tell the flow analysis code about
15681 (FlowBranching.UsageVector): Added support for infinite loops.
15682 (Block.Resolve): Moved the dead code elimination here and use flow
15685 2002-10-09 Miguel de Icaza <miguel@ximian.com>
15687 * class.cs (Field.Define): Catch cycles on struct type
15690 * typemanager.cs (IsUnmanagedtype): Do not recursively check
15691 fields if the fields are static. We only need to check instance
15694 * expression.cs (As.DoResolve): Test for reference type.
15696 * statement.cs (Using.ResolveExpression): Use
15697 ConvertImplicitRequired, not ConvertImplicit which reports an
15699 (Using.ResolveLocalVariableDecls): ditto.
15701 * expression.cs (Binary.ResolveOperator): Report errors in a few
15702 places where we had to.
15704 * typemanager.cs (IsUnmanagedtype): Finish implementation.
15706 2002-10-08 Miguel de Icaza <miguel@ximian.com>
15708 * expression.cs: Use StoreFromPtr instead of extracting the type
15709 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
15711 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15712 an enumeration value to a System.Enum, but System.Enum is not a
15713 value type, but an class type, so we need to box.
15715 (Expression.ConvertExplicit): One codepath could return
15716 errors but not flag them. Fix this. Fixes #31853
15718 * parameter.cs (Resolve): Do not allow void as a parameter type.
15720 2002-10-06 Martin Baulig <martin@gnome.org>
15722 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15723 if it's a class type and not a struct. Fixes #31815.
15725 2002-10-06 Martin Baulig <martin@gnome.org>
15727 * statement.cs: Reworked the flow analysis code a bit to make it
15728 usable for dead code elimination.
15730 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15732 * cs-parser.jay: allow empty source files. Fixes bug #31781.
15734 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15736 * expression.cs (ComposedCast.DoResolveType): A quick workaround
15737 to fix the test 165, will investigate deeper.
15739 2002-10-04 Martin Baulig <martin@gnome.org>
15741 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15742 finally blocks actually work.
15743 (Try.Resolve): We don't need to create a sibling for `finally' if
15744 there is no finally block.
15746 2002-10-04 Martin Baulig <martin@gnome.org>
15748 * class.cs (Constructor.Define): The default accessibility for a
15749 non-default constructor is private, not public.
15751 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15753 * class.cs (Constructor): Make AllowedModifiers public, add
15756 * cs-parser.jay: Perform the modifiers test here, as the
15757 constructor for the Constructor class usually receives a zero
15758 because of the way we create it (first we create, later we
15759 customize, and we were never checking the modifiers).
15761 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15762 is a version of LookupTypeReflection that includes the type-name
15763 cache. This can be used as a fast path for functions that know
15764 the fully qualified name and are only calling into *.GetType() to
15765 obtain a composed type.
15767 This is also used by TypeManager.LookupType during its type
15770 (LookupType): We now also track the real type name, as sometimes
15771 we can get a quey for the real type name from things like
15772 ComposedCast. This fixes bug 31422.
15774 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15775 complete type fullname, it does not have to go through the type
15776 resolution system to obtain the composed version of the type (for
15777 obtaining arrays or pointers).
15779 (Conditional.Emit): Use the EmitBoolExpression to
15780 generate nicer code, as requested by Paolo.
15782 (ArrayCreation.CheckIndices): Use the patch from
15783 hwang_rob@yahoo.ca to validate the array initializers.
15785 2002-10-03 Miguel de Icaza <miguel@ximian.com>
15787 * class.cs (ConstructorInitializer.Emit): simplify code by using
15788 Invocation.EmitCall, and at the same time, fix the bugs in calling
15789 parent constructors that took variable arguments.
15791 * ecore.cs (Expression.ConvertNumericExplicit,
15792 Expression.ImplicitNumericConversion): Remove the code that
15793 manually wrapped decimal (InternalTypeConstructor call is now gone
15796 * expression.cs (Cast.TryReduce): Also handle decimal types when
15797 trying to perform a constant fold on the type.
15799 * typemanager.cs (IsUnmanagedtype): Partially implemented.
15801 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15802 that only turned off an error report, and did nothing else.
15804 2002-10-02 Miguel de Icaza <miguel@ximian.com>
15806 * driver.cs: Handle and ignore /fullpaths
15808 2002-10-01 Miguel de Icaza <miguel@ximian.com>
15810 * expression.cs (Binary.ResolveOperator): Catch the case where
15811 DoNumericPromotions returns true,
15813 (Binary.DoNumericPromotions): Simplify the code, and the tests.
15815 2002-09-27 Miguel de Icaza <miguel@ximian.com>
15817 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15820 2002-09-26 Miguel de Icaza <miguel@ximian.com>
15822 * ecore.cs (ConvertNumericExplicit): It is not enough that the
15823 conversion exists, but it is also required that the conversion be
15824 performed. This manifested in "(Type64Enum) 2".
15826 * class.cs (TypeManager.AddMethod): The fix is not to change
15827 AddEnum, because that one was using a fully qualified name (every
15828 DeclSpace derivative does), but to change the AddMethod routine
15829 that was using an un-namespaced name. This now correctly reports
15830 the duplicated name.
15832 Revert patch until I can properly fix it. The issue
15833 is that we have a shared Type space across all namespaces
15834 currently, which is wrong.
15836 Options include making the Namespace a DeclSpace, and merge
15837 current_namespace/current_container in the parser.
15839 2002-09-25 Miguel de Icaza <miguel@ximian.com>
15841 * cs-parser.jay: Improve error reporting when we get a different
15842 kind of expression in local_variable_type and
15843 local_variable_pointer_type.
15845 Propagate this to avoid missleading errors being reported.
15847 * ecore.cs (ImplicitReferenceConversion): treat
15848 TypeManager.value_type as a target just like object_type. As
15853 Is valid, and needs to result in the int 1 being boxed before it
15854 is assigned to the value type v.
15856 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15857 to validate the enumeration name.
15859 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15860 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
15861 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15863 * ecore.cs (TryImplicitIntConversion): When doing an
15864 implicit-enumeration-conversion, check if the type is 64-bits and
15865 perform a conversion before passing to EnumConstant.
15867 2002-09-23 Miguel de Icaza <miguel@ximian.com>
15869 * decl.cs (Error_AmbiguousTypeReference); New routine used to
15870 report ambiguous type references. Unlike the MS version, we
15871 report what the ambiguity is. Innovation at work ;-)
15873 (DeclSpace.FindType): Require a location argument to
15874 display when we display an ambiguous error.
15876 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15878 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15880 * expression.cs (EmitDynamicInitializers): Apply patch from
15881 hwang_rob@yahoo.ca that fixes the order in which we emit our
15884 2002-09-21 Martin Baulig <martin@gnome.org>
15886 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15887 delegate takes no arguments.
15889 2002-09-20 Miguel de Icaza <miguel@ximian.com>
15891 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15894 * expression.cs: Extract the underlying type.
15896 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15898 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15900 2002-09-19 Miguel de Icaza <miguel@ximian.com>
15902 * class.cs (TypeContainer.DefineType): We can not use the nice
15903 PackingSize with the size set to 1 DefineType method, because it
15904 will not allow us to define the interfaces that the struct
15907 This completes the fixing of bug 27287
15909 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15910 means also structs. This fixes part of the problem.
15911 (Expresion.ImplicitReferenceConversionExists): ditto.
15913 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15914 error if there were no errors reported during the type lookup
15915 process, to avoid duplicates or redundant errors. Without this
15916 you would get an ambiguous errors plus a type not found. We have
15917 beaten the user enough with the first error.
15919 (DeclSparce.FindType): Emit a warning if we have an ambiguous
15922 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15923 during the resolution process, stop the lookup, this avoids
15924 repeated error reports (same error twice).
15926 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15928 * typemanager.cs (LookupType): Redo the type lookup code to match
15929 the needs of System.Reflection.
15931 The issue is that System.Reflection requires references to nested
15932 types to begin with a "+" sign instead of a dot. So toplevel
15933 types look like: "NameSpace.TopLevelClass", and nested ones look
15934 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15937 2002-09-19 Martin Baulig <martin@gnome.org>
15939 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15940 says that a method always returns or always throws an exception,
15941 don't report the CS0161.
15943 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15944 set `Returns = new_returns'.
15946 2002-09-19 Martin Baulig <martin@gnome.org>
15948 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15949 to an enum constant, check for a CS0176.
15951 2002-09-18 Miguel de Icaza <miguel@ximian.com>
15953 * class.cs (TypeContainer.CheckPairedOperators): Now we check
15954 for operators that must be in pairs and report errors.
15956 * ecore.cs (SimpleName.DoResolveType): During the initial type
15957 resolution process, when we define types recursively, we must
15958 check first for types in our current scope before we perform
15959 lookups in the enclosing scopes.
15961 * expression.cs (MakeByteBlob): Handle Decimal blobs.
15963 (Invocation.VerifyArgumentsCompat): Call
15964 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15965 I thought we were supposed to always call this, but there are a
15966 few places in the code where we dont do it.
15968 2002-09-17 Miguel de Icaza <miguel@ximian.com>
15970 * driver.cs: Add support in -linkres and -resource to specify the
15971 name of the identifier.
15973 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15975 * ecore.cs (StandardConversionExists): Sync with the conversion
15976 code: allow anything-* to void* conversions.
15978 (FindMostSpecificSource): Use an Expression argument
15979 instead of a Type, because we might be handed over a Literal which
15980 gets a few more implicit conversions that plain types do not. So
15981 this information was being lost.
15983 Also, we drop the temporary type-holder expression when not
15986 2002-09-17 Martin Baulig <martin@gnome.org>
15988 * class.cs (PropertyBase.CheckBase): Don't check the base class if
15989 this is an explicit interface implementation.
15991 2002-09-17 Martin Baulig <martin@gnome.org>
15993 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15994 different `IndexerName' attributes.
15996 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15997 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15998 virtual CommonResolve().
16000 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16002 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16003 and convert that to the UnderlyingType.
16005 * statement.cs (Foreach.Resolve): Indexers are just like variables
16006 or PropertyAccesses.
16008 * cs-tokenizer.cs (consume_string): Track line numbers and columns
16009 inside quoted strings, we were not doing this before.
16011 2002-09-16 Martin Baulig <martin@gnome.org>
16013 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16014 resolve it. This is needed for the definite assignment check of the
16015 instance expression, fixes bug #29846.
16016 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16018 2002-09-16 Nick Drochak <ndrochak@gol.com>
16020 * parameter.cs: Fix compile error. Cannot reference static member
16021 from an instance object. Is this an mcs bug?
16023 2002-09-14 Martin Baulig <martin@gnome.org>
16025 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16026 multiple times. Fixes bug #30295, added test-166.cs.
16028 2002-09-14 Martin Baulig <martin@gnome.org>
16030 * statement.cs (Block.Emit): Don't emit unreachable code.
16031 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16032 `break' statements.
16033 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16035 2002-09-14 Martin Baulig <martin@gnome.org>
16037 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16040 2002-09-14 Martin Baulig <martin@gnome.org>
16042 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16043 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16044 be false on the ms runtime.
16046 2002-09-13 Martin Baulig <martin@gnome.org>
16048 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16049 the CS0038 error message.
16051 2002-09-12 Miguel de Icaza <miguel@ximian.com>
16053 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16054 constant inside, return it.
16056 2002-09-12 Martin Baulig <martin@gnome.org>
16058 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16059 implicit conversion can be done between enum types.
16061 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16062 check whether an implicit conversion to the current enum's UnderlyingType
16063 exists and report an error if not.
16065 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16066 without debugging support.
16068 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16069 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
16071 2002-09-12 Martin Baulig <martin@gnome.org>
16073 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16075 * ecore.cs (IMemberExpr.DeclaringType): New property.
16076 (SimpleName.SimpleNameResolve): Check whether we're accessing a
16077 nonstatic member of an outer type (CS0038).
16079 2002-09-11 Miguel de Icaza <miguel@ximian.com>
16081 * driver.cs: Activate the using-error detector at warning level
16082 4 (at least for MS-compatible APIs).
16084 * namespace.cs (VerifyUsing): Small buglett fix.
16086 * pending.cs (PendingImplementation): pass the container pointer.
16088 * interface.cs (GetMethods): Allow for recursive definition. Long
16089 term, I would like to move every type to support recursive
16090 definitions, not the current ordering mechanism that we have right
16093 The situation is this: Attributes are handled before interfaces,
16094 so we can apply attributes to interfaces. But some attributes
16095 implement interfaces, we will now handle the simple cases
16096 (recursive definitions will just get an error).
16098 * parameter.cs: Only invalidate types at the end if we fail to
16101 2002-09-09 Martin Baulig <martin@gnome.org>
16103 * ecore.cs (PropertyExpr.Emit): Also check for
16104 TypeManager.system_int_array_get_length so this'll also work when
16105 compiling corlib. Fixes #30003.
16107 2002-09-09 Martin Baulig <martin@gnome.org>
16109 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16110 and throw an exception if we can't get the type's size. Fixed #30040,
16113 2002-09-09 Martin Baulig <martin@gnome.org>
16115 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16117 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16118 context. Fixes bug #30027.
16120 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16121 virtual functions. Fixes bug #30043, added test-164.cs.
16123 2002-09-08 Ravi Pratap <ravi@ximian.com>
16125 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16127 2002-09-08 Nick Drochak <ndrochak@gol.com>
16129 * driver.cs: Use an object to get the windows codepage since it's not a
16132 2002-09-08 Miguel de Icaza <miguel@ximian.com>
16134 * statement.cs (For.Emit): for infinite loops (test == null)
16135 return whether there is a break inside, not always "true".
16137 * namespace.cs (UsingEntry): New struct to hold the name of the
16138 using definition, the location where it is defined, and whether it
16139 has been used in a successful type lookup.
16141 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16146 2002-09-06 Ravi Pratap <ravi@ximian.com>
16148 * attribute.cs : Fix incorrect code which relied on catching
16149 a NullReferenceException to detect a null being passed in
16150 where an object was expected.
16152 2002-09-06 Miguel de Icaza <miguel@ximian.com>
16154 * statement.cs (Try): flag the catch variable as assigned
16156 * expression.cs (Cast): Simplified by using ResolveType instead of
16157 manually resolving.
16159 * statement.cs (Catch): Fix bug by using ResolveType.
16161 2002-09-06 Ravi Pratap <ravi@ximian.com>
16163 * expression.cs (BetterConversion): Special case for when we have
16164 a NullLiteral as the argument and we have to choose between string
16165 and object types - we choose string the way csc does.
16167 * attribute.cs (Attribute.Resolve): Catch the
16168 NullReferenceException and report error #182 since the Mono
16169 runtime no more has the bug and having this exception raised means
16170 we tried to select a constructor which takes an object and is
16173 2002-09-05 Ravi Pratap <ravi@ximian.com>
16175 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16176 message (1502, 1503) when we can't locate a method after overload
16177 resolution. This is much more informative and closes the bug
16180 * interface.cs (PopulateMethod): Return if there are no argument
16181 types. Fixes a NullReferenceException bug.
16183 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16184 expressions too. Previously we were checking only in one place for
16185 positional arguments leaving out named arguments.
16187 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16188 type to the enum type is not allowed. Remove code corresponding to
16191 (ConvertNumericExplicit): Allow explicit conversions from
16192 the underlying type to enum type. This precisely follows the spec
16193 and closes a bug filed by Gonzalo.
16195 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16198 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16200 2002-09-03 Miguel de Icaza <miguel@ximian.com>
16202 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16203 it was important that we stored the right value after the
16204 reduction in `converted'.
16206 2002-09-04 Martin Baulig <martin@gnome.org>
16208 * location.cs (Location.SymbolDocument): Use full pathnames for the
16211 2002-08-30 Miguel de Icaza <miguel@ximian.com>
16213 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16214 of the expression resolve mechanism, because that will catch the
16215 SimpleName error failures.
16217 (Conditional): If we can not resolve the
16218 expression, return, do not crash.
16220 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16223 (location): display token name instead of its number.
16225 2002-08-28 Martin Baulig <martin@gnome.org>
16227 * expression.cs (Binary.ResolveOperator): Don't silently return
16228 but return an error if an operator cannot be applied between two
16231 2002-08-28 Martin Baulig <martin@gnome.org>
16233 * class.cs (Constructor.Define): Set the permission attributes
16234 correctly instead of making all constructors public.
16236 2002-08-28 Martin Baulig <martin@gnome.org>
16238 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16239 for private members before reporting a CS0103; if we find anything,
16242 2002-08-28 Martin Baulig <martin@gnome.org>
16244 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16245 to check whether `closure_start_type == closure_invocation_type',
16246 we also need to check whether `m.DeclaringType == closure_invocation_type'
16247 before bypassing the permission checks. We might be accessing
16248 protected/private members from the base class.
16249 (TypeManager.RealMemberLookup): Only set private_ok if private
16250 members were requested via BindingFlags.NonPublic.
16252 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16254 * expression.cs (MemberAccess.ResolveMemberAccess): Set
16255 MethodGroupExpr.IsExplicitImpl if appropriate.
16256 (Invocation.DoResolve): Don't report the CS0120 for explicit
16257 interface implementations.
16259 2002-08-27 Martin Baulig <martin@gnome.org>
16261 * expression.cs (Invocation.DoResolve): If this is a static
16262 method and we don't have an InstanceExpression, we must report
16265 2002-08-25 Martin Baulig <martin@gnome.org>
16267 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16268 `==' between a valuetype and an object.
16270 2002-08-25 Miguel de Icaza <miguel@ximian.com>
16272 * ecore.cs (TypeExpr): Provide a ToString method.
16274 2002-08-24 Martin Baulig <martin@gnome.org>
16276 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16277 now called proggie.dbg and it's a binary file.
16279 2002-08-23 Martin Baulig <martin@gnome.org>
16281 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16283 2002-08-23 Martin Baulig <martin@gnome.org>
16285 * struct.cs (MyStructInfo.ctor): Make this work with empty
16286 structs; it's not allowed to use foreach() on null.
16288 2002-08-23 Martin Baulig <martin@gnome.org>
16290 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16291 writer the full pathname of the generated assembly.
16293 2002-08-23 Martin Baulig <martin@gnome.org>
16295 * statements.cs (FlowBranching.UsageVector.MergeChildren):
16296 A `finally' block never returns or breaks; improved handling of
16299 2002-08-23 Martin Baulig <martin@gnome.org>
16301 * statement.cs (Throw.Resolve): Allow `throw null'.
16303 2002-08-23 Martin Baulig <martin@gnome.org>
16305 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16306 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16307 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
16308 MemberLookup would return a wrong event if this is an explicit
16309 interface implementation and the class has an event with the same
16312 2002-08-23 Martin Baulig <martin@gnome.org>
16314 * statement.cs (Block.AddChildVariableNames): New public method.
16315 (Block.AddChildVariableName): Likewise.
16316 (Block.IsVariableNameUsedInChildBlock): Likewise.
16317 (Block.AddVariable): Check whether a variable name has already
16318 been used in a child block.
16320 * cs-parser.jay (declare_local_variables): Mark all variable names
16321 from the current block as being used in a child block in the
16324 2002-08-23 Martin Baulig <martin@gnome.org>
16326 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16327 find the symbol writer.
16329 * driver.cs: csc also allows the arguments to /define being
16330 separated by commas, not only by semicolons.
16332 2002-08-23 Martin Baulig <martin@gnome.org>
16334 * interface.cs (Interface.GetMembers): Added static check for events.
16336 2002-08-15 Martin Baulig <martin@gnome.org>
16338 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16339 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16341 * ecore.cs (Expression.MemberLookup): Added documentation and explained
16342 why the MethodData.EmitDestructor() change was necessary.
16344 2002-08-20 Martin Baulig <martin@gnome.org>
16346 * class.cs (TypeContainer.FindMembers): Added static check for events.
16348 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16350 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16351 use Type.GetEvents(), not Type.FindMembers().
16353 2002-08-20 Martin Baulig <martin@gnome.org>
16355 * decl.cs (MemberCache): Added a special method cache which will
16356 be used for method-only searched. This ensures that a method
16357 search will return a MethodInfo with the correct ReflectedType for
16360 2002-08-20 Martin Baulig <martin@gnome.org>
16362 * decl.cs (DeclSpace.FindMembers): Made this public.
16364 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16366 * delegate.cs: fixed build on windows.
16367 [FIXME: Filed as bug #29150: MCS must report these errors.]
16369 2002-08-19 Ravi Pratap <ravi@ximian.com>
16371 * ecore.cs (StandardConversionExists): Return a false
16372 if we are trying to convert the void type to anything else
16373 since that is not allowed.
16375 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16376 we flag error 70 in the event an event is trying to be accessed
16377 directly from outside the declaring type.
16379 2002-08-20 Martin Baulig <martin@gnome.org>
16381 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16382 MemberCache from typemanager.cs to decl.cs.
16384 2002-08-19 Martin Baulig <martin@gnome.org>
16386 * class.cs (TypeContainer): Implement IMemberContainer.
16387 (TypeContainer.DefineMembers): Create the MemberCache.
16388 (TypeContainer.FindMembers): Do better BindingFlags checking; only
16389 return public members if BindingFlags.Public was given, check
16390 whether members are static.
16392 2002-08-16 Martin Baulig <martin@gnome.org>
16394 * decl.cs (DeclSpace.Define): Splitted this in Define and
16395 DefineMembers. DefineMembers is called first and initializes the
16398 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
16399 DefineMembers() on all our DeclSpaces.
16401 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16402 but call DefineMembers() on all nested interfaces. We call their
16403 Define() in our new Define() function.
16405 * interface.cs (Interface): Implement IMemberContainer.
16406 (Interface.Define): Moved all code except the attribute stuf to
16408 (Interface.DefineMembers): Initialize the member cache.
16410 * typemanager.cs (IMemberFinder): Removed this interface, we don't
16411 need this anymore since we can use MemberCache.FindMembers directly.
16413 2002-08-19 Martin Baulig <martin@gnome.org>
16415 * typemanager.cs (MemberCache): When creating the cache for an
16416 interface type, add all inherited members.
16417 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16418 to `out bool used_cache' and documented it.
16419 (TypeManager.MemberLookup): If we already used the cache in the first
16420 iteration, we don't need to do the interfaces check.
16422 2002-08-19 Martin Baulig <martin@gnome.org>
16424 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
16425 here from IMemberFinder and don't implement this interface anymore.
16426 (DeclSpace.MemberCache): Moved here from IMemberFinder.
16428 * typemanager.cs (IMemberFinder): This interface is now only used by
16429 classes which actually support the member cache.
16430 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16431 since we only put DeclSpaces into this Hashtable.
16432 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16433 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16435 2002-08-16 Martin Baulig <martin@gnome.org>
16437 * typemanager.cs (ICachingMemberFinder): Removed.
16438 (IMemberFinder.MemberCache): New property.
16439 (TypeManager.FindMembers): Merged this with RealFindMembers().
16440 This function will never be called from TypeManager.MemberLookup()
16441 so we can't use the cache here, just the IMemberFinder.
16442 (TypeManager.MemberLookup_FindMembers): Check whether the
16443 IMemberFinder has a MemberCache and call the cache's FindMembers
16445 (MemberCache): Rewrote larger parts of this yet another time and
16446 cleaned it up a bit.
16448 2002-08-15 Miguel de Icaza <miguel@ximian.com>
16450 * driver.cs (LoadArgs): Support quoting.
16452 (Usage): Show the CSC-like command line arguments.
16454 Improved a few error messages.
16456 2002-08-15 Martin Baulig <martin@gnome.org>
16458 * typemanager.cs (IMemberContainer.Type): New property.
16459 (IMemberContainer.IsInterface): New property.
16461 The following changes are conditional to BROKEN_RUNTIME, which is
16462 defined at the top of the file.
16464 * typemanager.cs (MemberCache.MemberCache): Don't add the base
16465 class'es members, but add all members from TypeHandle.ObjectType
16466 if we're an interface.
16467 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16468 is the current type.
16469 (MemberCache.CacheEntry.Container): Removed this field.
16470 (TypeHandle.GetMembers): Include inherited members.
16472 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16474 * typemanager.cs: fixed compilation and added a comment on a field that
16477 2002-08-15 Martin Baulig <martin@gnome.org>
16479 * class.cs (ConstructorInitializer.Resolve): In the
16480 Expression.MemberLookup call, use the queried_type as
16483 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16484 declared' attribute, it's always true.
16485 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16486 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16487 temporary wrapper for FindMembers which tells MemberLookup whether
16488 members from the base classes are included in the return value.
16489 This will go away soon.
16490 (TypeManager.MemberLookup): Use this temporary hack here; once the
16491 new MemberCache is completed, we don't need to do the DeclaredOnly
16492 looping here anymore since the MemberCache will take care of this.
16493 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16494 (MemberCache): When creating the MemberCache for a class, get
16495 members from the current class and all its base classes.
16496 (MemberCache.CacheEntry.Container): New field. This is a
16497 temporary hack until the Mono runtime is fixed to distinguish
16498 between ReflectedType and DeclaringType. It allows us to use MCS
16499 with both the MS runtime and the unfixed Mono runtime without
16500 problems and without accecting performance.
16501 (MemberCache.SearchMembers): The DeclaredOnly looping from
16502 TypeManager.MemberLookup is now done here.
16504 2002-08-14 Martin Baulig <martin@gnome.org>
16506 * statement.cs (MyStructInfo.MyStructInfo): Don't call
16507 Type.GetFields on dynamic types but get the fields from the
16508 corresponding TypeContainer.
16509 (MyStructInfo.GetStructInfo): Added check for enum types.
16511 * typemanager.cs (MemberList.IsSynchronized): Implemented.
16512 (MemberList.SyncRoot): Implemented.
16513 (TypeManager.FilterWithClosure): No need to check permissions if
16514 closure_start_type == closure_invocation_type, don't crash if
16515 closure_invocation_type is null.
16517 2002-08-13 Martin Baulig <martin@gnome.org>
16519 Rewrote TypeContainer.FindMembers to use a member cache. This
16520 gives us a speed increase of about 35% for the self-hosting MCS
16521 build and of about 15-20% for the class libs (both on GNU/Linux).
16523 * report.cs (Timer): New class to get enhanced profiling. This
16524 whole class is "TIMER" conditional since it remarkably slows down
16527 * class.cs (MemberList): New class. This is an IList wrapper
16528 which we're now using instead of passing MemberInfo[]'s around to
16529 avoid copying this array unnecessarily.
16530 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16531 (ICachingMemberFinder, IMemberContainer): New interface.
16532 (TypeManager.FilterWithClosure): If `criteria' is null, the name
16533 has already been checked, otherwise use it for the name comparision.
16534 (TypeManager.FindMembers): Renamed to RealMemberFinder and
16535 provided wrapper which tries to use ICachingMemberFinder.FindMembers
16536 if possible. Returns a MemberList, not a MemberInfo [].
16537 (TypeHandle): New class, implements IMemberContainer. We create
16538 one instance of this class per type, it contains a MemberCache
16539 which is used to do the member lookups.
16540 (MemberCache): New class. Each instance of this class contains
16541 all members of a type and a name-based hash table.
16542 (MemberCache.FindMembers): This is our new member lookup
16543 function. First, it looks up all members of the requested name in
16544 the hash table. Then, it walks this list and sorts out all
16545 applicable members and returns them.
16547 2002-08-13 Martin Baulig <martin@gnome.org>
16549 In addition to a nice code cleanup, this gives us a performance
16550 increase of about 1.4% on GNU/Linux - not much, but it's already
16551 half a second for the self-hosting MCS compilation.
16553 * typemanager.cs (IMemberFinder): New interface. It is used by
16554 TypeManager.FindMembers to call FindMembers on a TypeContainer,
16555 Enum, Delegate or Interface.
16556 (TypeManager.finder_to_member_finder): New PtrHashtable.
16557 (TypeManager.finder_to_container): Removed.
16558 (TypeManager.finder_to_delegate): Removed.
16559 (TypeManager.finder_to_interface): Removed.
16560 (TypeManager.finder_to_enum): Removed.
16562 * interface.cs (Interface): Implement IMemberFinder.
16564 * delegate.cs (Delegate): Implement IMemberFinder.
16566 * enum.cs (Enum): Implement IMemberFinder.
16568 * class.cs (TypeContainer): Implement IMemberFinder.
16570 2002-08-12 Martin Baulig <martin@gnome.org>
16572 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16574 2002-08-12 Martin Baulig <martin@gnome.org>
16576 * ecore.cs (ITypeExpression): New interface for expressions which
16578 (TypeExpression): Renamed to TypeLookupExpression.
16579 (Expression.DoResolve): If we're doing a types-only lookup, the
16580 expression must implement the ITypeExpression interface and we
16581 call DoResolveType() on it.
16582 (SimpleName): Implement the new ITypeExpression interface.
16583 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16584 hack, the situation that we're only looking up types can't happen
16585 anymore when this method is called. Moved the type lookup code to
16586 DoResolveType() and call it.
16587 (SimpleName.DoResolveType): This ITypeExpression interface method
16588 is now doing the types-only lookup.
16589 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16590 (ResolveFlags): Added MaskExprClass.
16592 * expression.cs (MemberAccess): Implement the ITypeExpression
16594 (MemberAccess.DoResolve): Added support for a types-only lookup
16595 when we're called via ITypeExpression.DoResolveType().
16596 (ComposedCast): Implement the ITypeExpression interface.
16598 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
16599 Expression.Resolve() with ResolveFlags.Type instead.
16601 2002-08-12 Martin Baulig <martin@gnome.org>
16603 * interface.cs (Interface.Define): Apply attributes.
16605 * attribute.cs (Attribute.ApplyAttributes): Added support for
16606 interface attributes.
16608 2002-08-11 Martin Baulig <martin@gnome.org>
16610 * statement.cs (Block.Emit): Only check the "this" variable if we
16611 do not always throw an exception.
16613 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16614 whether the property has a set accessor.
16616 2002-08-11 Martin Baulig <martin@gnome.org>
16618 Added control flow analysis support for structs.
16620 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16621 with control flow analysis turned off.
16622 (IVariable): New interface.
16623 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16624 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16625 (FieldExpr.DoResolve): Resolve the instance expression with flow
16626 analysis turned off and do the definite assignment check after the
16627 resolving when we know what the expression will resolve to.
16629 * expression.cs (LocalVariableReference, ParameterReference):
16630 Implement the new IVariable interface, only call the flow analysis
16631 code if ec.DoFlowAnalysis is true.
16632 (This): Added constructor which takes a Block argument. Implement
16633 the new IVariable interface.
16634 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16635 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16636 This does the definite assignment checks for struct members.
16638 * class.cs (Constructor.Emit): If this is a non-static `struct'
16639 constructor which doesn't have any initializer, call
16640 Block.AddThisVariable() to tell the flow analysis code that all
16641 struct elements must be initialized before control returns from
16644 * statement.cs (MyStructInfo): New public class.
16645 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16646 argument to this indexer. If non-zero, check an individual struct
16647 member, not the whole struct.
16648 (FlowBranching.CheckOutParameters): Check struct members.
16649 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16650 overloaded versions of these methods which take an additional
16651 `int field_idx' argument to check struct members.
16652 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16653 overloaded versions of these methods which take an additional
16654 `string field_name' argument to check struct member.s
16655 (VariableInfo): Implement the IVariable interface.
16656 (VariableInfo.StructInfo): New public property. Returns the
16657 MyStructInfo instance of the variable if it's a struct or null.
16658 (Block.AddThisVariable): New public method. This is called from
16659 Constructor.Emit() for non-static `struct' constructor which do
16660 not have any initializer. It creates a special variable for the
16661 "this" instance variable which will be checked by the flow
16662 analysis code to ensure that all of the struct's fields are
16663 initialized before control returns from the constructor.
16664 (UsageVector): Added support for struct members. If a
16665 variable/parameter is a struct with N members, we reserve a slot
16666 in the usage vector for each member. A struct is considered fully
16667 initialized if either the struct itself (slot 0) or all its
16668 members are initialized.
16670 2002-08-08 Martin Baulig <martin@gnome.org>
16672 * driver.cs (Driver.MainDriver): Only report an error CS5001
16673 if there were no compilation errors.
16675 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16676 `UnsafeContext' property to determine whether the parent is in
16677 unsafe context rather than checking the parent's ModFlags:
16678 classes nested in an unsafe class are unsafe as well.
16680 2002-08-08 Martin Baulig <martin@gnome.org>
16682 * statement.cs (UsageVector.MergeChildren): Distinguish between
16683 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16684 we return. Added test17() and test18() to test-154.cs.
16686 2002-08-08 Martin Baulig <martin@gnome.org>
16688 * typemanager.cs (TypeManager.FilterWithClosure): If we have
16689 Family access, make sure the invoking type isn't a subclass of the
16690 queried type (that'd be a CS1540).
16692 * ecore.cs (Expression.MemberLookup): Added overloaded version of
16693 this method which takes an additional `Type invocation_type'.
16695 * expression.cs (BaseAccess.DoResolve): Use the base type as
16696 invocation and query type.
16697 (MemberAccess.DoResolve): If the lookup failed and we're about to
16698 report a CS0122, try a lookup with the ec.ContainerType - if this
16699 succeeds, we must report a CS1540.
16701 2002-08-08 Martin Baulig <martin@gnome.org>
16703 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16704 (MethodGroupExpr): Implement the IMemberExpr interface.
16706 * expression (MemberAccess.ResolveMemberAccess): No need to have
16707 any special code for MethodGroupExprs anymore, they're now
16710 2002-08-08 Martin Baulig <martin@gnome.org>
16712 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16713 Family, FamANDAssem and FamORAssem permissions.
16714 (TypeManager.IsSubclassOrNestedChildOf): New public method.
16716 2002-08-08 Martin Baulig <martin@gnome.org>
16718 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16719 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16722 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16724 * driver.cs: implemented /resource option to embed managed resources.
16726 2002-08-07 Martin Baulig <martin@gnome.org>
16728 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16729 (FieldBase.HasFieldInitializer): New public property.
16730 (FieldBase.GetInitializerExpression): New public method. Resolves and
16731 returns the field initializer and makes sure it is only resolved once.
16732 (TypeContainer.EmitFieldInitializers): Call
16733 FieldBase.GetInitializerExpression to get the initializer, this ensures
16734 that it isn't resolved multiple times.
16736 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
16737 the resolving process (SimpleName/MemberLookup) that we're currently
16738 emitting a field initializer (which must not access any instance members,
16739 this is an error CS0236).
16741 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16742 argument, if the `IsFieldInitializer' flag is set, we must report and
16743 error CS0236 and not an error CS0120.
16745 2002-08-07 Martin Baulig <martin@gnome.org>
16747 * ecore.cs (IMemberExpr): New public interface.
16748 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16749 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16750 if the expression is an IMemberExpr.
16752 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16753 to be null, implicitly default to `this' if we're non-static in
16754 this case. Simplified the code a lot by using the new IMemberExpr
16755 interface. Also fixed bug #28176 here.
16757 2002-08-06 Martin Baulig <martin@gnome.org>
16759 * cs-parser.jay (SimpleLookup): Removed. We need to create
16760 ParameterReferences during semantic analysis so that we can do a
16761 type-only search when resolving Cast, TypeOf and SizeOf.
16762 (block): Pass the `current_local_parameters' to the Block's
16765 * class.cs (ConstructorInitializer): Added `Parameters parameters'
16766 argument to the constructor.
16767 (ConstructorInitializer.Resolve): Create a temporary implicit
16768 block with the parameters.
16770 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16771 references here if we aren't doing a type-only search.
16773 * statement.cs (Block): Added constructor which takes a
16774 `Parameters parameters' argument.
16775 (Block.Parameters): New public property.
16777 * support.cs (InternalParameters.Parameters): Renamed `parameters'
16778 to `Parameters' and made it public readonly.
16780 2002-08-06 Martin Baulig <martin@gnome.org>
16782 * ecore.cs (Expression.Warning): Made this public as well.
16784 * report.cs (Report.Debug): Print the contents of collections.
16786 2002-08-06 Martin Baulig <martin@gnome.org>
16788 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
16789 used to tell Resolve() which kinds of expressions it may return.
16790 (Expression.Resolve): Added overloaded version of this method which
16791 takes a `ResolveFlags flags' argument. This can be used to tell
16792 Resolve() which kinds of expressions it may return. Reports a
16794 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16795 ResolveFlags.SimpleName.
16796 (Expression.Error118): Added overloaded version of this method which
16797 takes a `ResolveFlags flags' argument. It uses the flags to determine
16798 which kinds of expressions are allowed.
16800 * expression.cs (Argument.ResolveMethodGroup): New public method.
16801 Resolves an argument, but allows a MethodGroup to be returned.
16802 This is used when invoking a delegate.
16804 * TODO: Updated a bit.
16806 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16808 Fixed compilation with csc.
16810 * ecore.cs: Expression.Error made public. Is this correct? Should
16811 Warning be made public too?
16813 * expression.cs: use ea.Location instead of ea.loc.
16814 [FIXME: Filed as bug #28607: MCS must report these errors.]
16816 2002-08-06 Martin Baulig <martin@gnome.org>
16818 * ecore.cs (Expression.loc): Moved the location here instead of
16819 duplicating it in all derived classes.
16820 (Expression.Location): New public property.
16821 (Expression.Error, Expression.Warning): Made them non-static and
16822 removed the location argument.
16823 (Expression.Warning): Added overloaded version which takes an
16824 `int level' argument.
16825 (Expression.Error118): Make this non-static and removed the
16826 expression and location arguments.
16827 (TypeExpr): Added location argument to the constructor.
16829 * expression.cs (StaticCallExpr): Added location argument to
16831 (Indirection, PointerArithmetic): Likewise.
16832 (CheckedExpr, UnCheckedExpr): Likewise.
16833 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16834 (StringPtr): Likewise.
16837 2002-08-05 Martin Baulig <martin@gnome.org>
16839 * expression.cs (BaseAccess.DoResolve): Actually report errors.
16841 * assign.cs (Assign.DoResolve): Check whether the source
16842 expression is a value or variable.
16844 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16845 while resolving the corresponding blocks.
16847 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16848 an error, don't silently return null.
16850 * statement.cs (Block.AddVariable): Do the error reporting here
16851 and distinguish between CS0128 and CS0136.
16852 (Block.DoResolve): Report all unused labels (warning CS0164).
16853 (LabeledStatement): Pass the location to the constructor.
16854 (LabeledStatement.HasBeenReferenced): New property.
16855 (LabeledStatement.Resolve): Set it to true here.
16857 * statement.cs (Return.Emit): Return success even after reporting
16858 a type mismatch error (CS0126 or CS0127), this is what csc does and
16859 it avoids confusing the users with any consecutive errors.
16861 2002-08-05 Martin Baulig <martin@gnome.org>
16863 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16865 * const.cs (Const.LookupConstantValue): Catch circular definitions.
16867 * expression.cs (MemberAccess.DoResolve): Silently return if an
16868 error has already been reported.
16870 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16871 error has already been reported.
16873 2002-08-05 Martin Baulig <martin@gnome.org>
16875 * statement.cs (UsageVector): Only initialize the `parameters'
16876 vector if we actually have any "out" parameters.
16878 2002-08-05 Martin Baulig <martin@gnome.org>
16880 * expression.cs (Binary.ResolveOperator): When combining delegates,
16881 they must have the same type.
16883 2002-08-05 Martin Baulig <martin@gnome.org>
16885 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16886 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16887 work with the ms runtime and we also don't need it: if we're a
16888 PropertyBuilder and not in the `indexer_arguments' hash, then we
16889 are a property and not an indexer.
16891 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16892 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16893 since the latter one doesn't work with the ms runtime.
16895 2002-08-03 Martin Baulig <martin@gnome.org>
16897 Fixed bugs #27998 and #22735.
16899 * class.cs (Method.IsOperator): New public field.
16900 (Method.CheckBase): Report CS0111 if there's already a method
16901 with the same parameters in the current class. Report CS0508 when
16902 attempting to change the return type of an inherited method.
16903 (MethodData.Emit): Report CS0179 if a method doesn't have a body
16904 and it's not marked abstract or extern.
16905 (PropertyBase): New abstract base class for Property and Indexer.
16906 (PropertyBase.CheckBase): Moved here from Property and made it work
16908 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16909 the same so we can reuse it there.
16910 (Property, Indexer): Derive from PropertyBase.
16911 (MethodSignature.inheritable_property_signature_filter): New delegate
16912 to find properties and indexers.
16914 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16915 argument and improved error reporting.
16917 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16918 EmptyReadOnlyParameters and made it a property.
16920 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16921 version of this method which takes a `PropertyInfo indexer'.
16922 (TypeManager.RegisterIndexer): New method.
16924 * class.cs: Added myself as author of this file :-)
16926 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16928 * class.cs: fixed compilation on windoze.
16930 2002-08-03 Martin Baulig <martin@gnome.org>
16932 * interface.cs (Interface.GetInterfaceBases): Check whether all
16933 base interfaces are at least as accessible than the current one.
16935 * class.cs (TypeContainer.GetClassBases): Check whether base types
16936 are at least as accessible than the current type.
16937 (TypeContainer.AsAccessible): Implemented and made non-static.
16938 (MemberBase.CheckParameters): Report errors if the accessibility
16941 * delegate.cs (Delegate.Delegate): The default visibility is
16942 internal for top-level types and private for nested types.
16943 (Delegate.Define): Report errors if the accessibility checks fail.
16945 * enum.cs (Enum.Enum): The default visibility is internal for
16946 top-level types and private for nested types.
16947 (Enum.DefineType): Compute the correct visibility.
16949 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16950 function which takes a `bool is_toplevel' instead of a TypeContainer.
16952 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16955 2002-08-02 Martin Baulig <martin@gnome.org>
16957 * expression.cs (LocalVariableReferenc): Added constructor which
16958 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16959 (LocalVariableReference.IsReadOnly): New property.
16960 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16961 variable is readonly, use our own readonly flag to do this; you can
16962 use the new constructor to get a writable reference to a read-only
16965 * cs-parser.jay (foreach_statement, using_statement): Get a writable
16966 reference to the local variable.
16968 2002-08-01 Miguel de Icaza <miguel@ximian.com>
16970 * rootcontext.cs (ResolveCore): Also include System.Exception
16972 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16973 we reach an EmptyStatement.
16975 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16978 * expression.cs (Binary.ResolveOperator): Check error result in
16981 use brtrue/brfalse directly and avoid compares to null.
16983 2002-08-02 Martin Baulig <martin@gnome.org>
16985 * class.cs (TypeContainer.Define): Define all nested interfaces here.
16986 Fixes bug #28407, added test-155.cs.
16988 2002-08-01 Martin Baulig <martin@gnome.org>
16990 * class.cs (Event.EmitDefaultMethod): Make this work with static
16991 events. Fixes #28311, added verify-3.cs.
16993 2002-08-01 Martin Baulig <martin@gnome.org>
16995 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16996 `is_disposable' fields.
16997 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16998 `hm.is_disposable' if we're using the collection pattern.
16999 (Foreach.EmitCollectionForeach): Use the correct type for the
17000 enumerator's local variable, only emit the try/finally block if
17001 necessary (fixes #27713).
17003 2002-08-01 Martin Baulig <martin@gnome.org>
17005 * ecore.cs (Expression.report118): Renamed to Error118 and made
17008 * statement.cs (Throw.Resolve): Check whether the expression is of
17009 the correct type (CS0118) and whether the type derives from
17010 System.Exception (CS0155).
17011 (Catch.Resolve): New method. Do the type lookup here and check
17012 whether it derives from System.Exception (CS0155).
17013 (Catch.CatchType, Catch.IsGeneral): New public properties.
17015 * typemanager.cs (TypeManager.exception_type): Added.
17017 2002-07-31 Miguel de Icaza <miguel@ximian.com>
17019 * driver.cs: Updated About function.
17021 2002-07-31 Martin Baulig <martin@gnome.org>
17023 Implemented Control Flow Analysis.
17025 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17026 (EmitContext.CurrentBranching): Added.
17027 (EmitContext.StartFlowBranching): Added.
17028 (EmitContext.EndFlowBranching): Added.
17029 (EmitContext.KillFlowBranching): Added.
17030 (EmitContext.IsVariableAssigned): Added.
17031 (EmitContext.SetVariableAssigned): Added.
17032 (EmitContext.IsParameterAssigned): Added.
17033 (EmitContext.SetParameterAssigned): Added.
17034 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17035 Added control flow analysis stuff here.
17037 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17038 resolve the expression as lvalue.
17039 (LocalVariableReference.DoResolve): Check whether the variable has
17040 already been assigned.
17041 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17042 the parameter as assigned here.
17043 (ParameterReference.DoResolve): Check whether the parameter has already
17045 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17046 expression as lvalue.
17048 * statement.cs (FlowBranching): New class for the flow analysis code.
17049 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17050 (LabeledStatement.IsDefined): New public property.
17051 (LabeledStatement.AddUsageVector): New public method to tell flow
17052 analyis that the label may be reached via a forward jump.
17053 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17055 (VariableInfo.Number): New public field. This is used by flow analysis
17056 to number all locals of a block.
17057 (Block.CountVariables): New public property. This is the number of
17058 local variables in this block (including the locals from all parent
17060 (Block.EmitMeta): Number all the variables.
17062 * statement.cs: Added flow analysis support to all classes.
17064 2002-07-31 Martin Baulig <martin@gnome.org>
17066 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17067 To get debugging messages, compile mcs with /define:MCS_DEBUG and
17068 then use this argument.
17070 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17072 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17073 use this to specify /define options.
17075 2002-07-29 Martin Baulig <martin@gnome.org>
17077 * statement.cs (Fixed): Moved all code that does variable lookups
17078 and resolvings from Emit to Resolve.
17080 * statement.cs (For): Moved all code that does variable lookups
17081 and resolvings from Emit to Resolve.
17083 * statement.cs (Using): Moved all code that does variable lookups
17084 and resolvings from Emit to Resolve.
17086 2002-07-29 Martin Baulig <martin@gnome.org>
17088 * attribute.cs (Attribute.Resolve): Explicitly catch a
17089 System.NullReferenceException when creating the
17090 CustromAttributeBuilder and report a different warning message.
17092 2002-07-29 Martin Baulig <martin@gnome.org>
17094 * support.cs (ParameterData.ParameterName): Added method to
17095 get the name of a parameter.
17097 * typemanager.cs (TypeManager.IsValueType): New public method.
17099 2002-07-29 Martin Baulig <martin@gnome.org>
17101 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
17102 is a flag which specifies that it's either ref or out.
17103 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17104 the out parameter to `out Parameter.Modifier mod', also set the
17105 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17107 * support.cs (InternalParameters.ParameterModifier): Distinguish
17108 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17109 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17111 * expression.cs (Argument.GetParameterModifier): Distinguish
17112 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17113 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17115 2002-07-29 Martin Baulig <martin@gnome.org>
17117 * expression.cs (ParameterReference.ParameterReference): Added
17118 `Location loc' argument to the constructor.
17120 * cs-parser.jay: Pass location to ParameterReference.
17122 2002-07-28 Miguel de Icaza <miguel@ximian.com>
17124 * statement.cs (Try): Initialize the location.
17126 * cs-parser.jay: pass location to Try.
17128 * expression.cs (Unary.Reduce): Change the prototype to return
17129 whether a constant fold could be performed or not. The result is
17130 returned in an out parameters. In the case of Indirection and
17131 AddressOf, we want to perform the full tests.
17133 2002-07-26 Miguel de Icaza <miguel@ximian.com>
17135 * statement.cs (Statement.Emit): Flag dead code.
17137 2002-07-27 Andrew Birkett <andy@nobugs.org>
17139 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17141 2002-07-27 Martin Baulig <martin@gnome.org>
17143 * class.cs (MethodData.Define): Put back call to
17144 TypeManager.AddMethod(), accidentally commented this out.
17146 * report.cs (Debug): New public method to print debugging information,
17147 this is `[Conditional ("DEBUG")]'.
17149 2002-07-26 Martin Baulig <martin@gnome.org>
17151 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17152 (switch_statement): Push the current_block to the switch_stack and
17153 pop it again when we're done with the switch.
17154 (switch_section): The new block is a child of the current_block.
17155 Fixes bug #24007, added test-152.cs.
17157 2002-07-27 Martin Baulig <martin@gnome.org>
17159 * expression.cs (Invocation.EmitArguments): When calling a varargs
17160 function with only its fixed arguments, we need to pass an empty
17163 2002-07-27 Martin Baulig <martin@gnome.org>
17165 Mono 0.13 has been released.
17167 2002-07-25 Miguel de Icaza <miguel@ximian.com>
17169 * driver.cs: Rename --resource to --linkres, because that is what
17170 we do currently, we dont support --resource yet.
17172 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17174 2002-07-25 Martin Baulig <martin@gnome.org>
17176 * class.cs (MethodData): New public class. This is a `method builder'
17177 class for a method or one accessor of a Property/Indexer/Event.
17178 (MethodData.GetMethodFlags): Moved here from MemberBase.
17179 (MethodData.ApplyAttributes): Likewise.
17180 (MethodData.ApplyObsoleteAttribute): Likewise.
17181 (MethodData.ApplyConditionalAttribute): Likewise.
17182 (MethodData.ApplyDllImportAttribute): Likewise.
17183 (MethodData.CheckAbstractAndExternal): Likewise.
17184 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17185 (MethodData.Emit): Formerly known as Method.Emit().
17186 (MemberBase): Moved everything which was specific to a single
17187 accessor/method to MethodData.
17188 (Method): Create a new MethodData and call Define() and Emit() on it.
17189 (Property, Indexer, Event): Create a new MethodData objects for each
17190 accessor and call Define() and Emit() on them.
17192 2002-07-25 Martin Baulig <martin@gnome.org>
17194 Made MethodCore derive from MemberBase to reuse the code from there.
17195 MemberBase now also checks for attributes.
17197 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17198 (MemberBase.GetMethodFlags): Moved here from class Method and marked
17200 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17201 `CallingConventions cc' and `Attributes opt_attrs' arguments.
17202 (MemberBase.ApplyAttributes): New virtual method; applies the
17203 attributes to a method or accessor.
17204 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17205 (MemberBase.ApplyConditionalAttribute): Likewise.
17206 (MemberBase.ApplyDllImportAttribute): Likewise.
17207 (MemberBase.CheckAbstractAndExternal): Likewise.
17208 (MethodCore.ParameterTypes): This is now a property instead of a
17209 method, it's initialized from DoDefineParameters().
17210 (MethodCore.ParameterInfo): Removed the set accessor.
17211 (MethodCore.DoDefineParameters): New protected virtual method to
17212 initialize ParameterTypes and ParameterInfo.
17213 (Method.GetReturnType): We can now simply return the MemberType.
17214 (Method.GetMethodFlags): Override the MemberBase version and add
17215 the conditional flags.
17216 (Method.CheckBase): Moved some code from Define() here, call
17217 DoDefineParameters() here.
17218 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17219 here to avoid some larger code duplication.
17220 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17221 ensure that abstract and external accessors don't declare a body.
17223 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17224 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17225 lookup in the attribute's parent classes, so we need to abort as soon
17226 as we found the first match.
17227 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17228 the attribute has no arguments.
17230 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17233 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17235 * cs-parser.jay: reverted previous patch.
17237 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17239 * cs-parser.jay: fixed bug #22119.
17241 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17243 * attribute.cs: fixed compilation. The error was:
17244 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
17245 be assigned to before control leaves the current method."
17246 [FIXME: Filed as bug #28186: MCS must report this error.]
17248 2002-07-25 Martin Baulig <martin@gnome.org>
17250 * attribute.cs (Attribute.Conditional_GetConditionName): New static
17251 method to pull the condition name ouf of a Conditional attribute.
17252 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17253 the obsolete message and error flag out of an Obsolete attribute.
17255 * class.cs (Method.GetMethodFlags): New public method to get the
17256 TypeManager.MethodFlags for this method.
17257 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17259 (Method.Define): Get and apply the Obsolete and Conditional attributes;
17260 if we're overriding a virtual function, set the new private variable
17261 `parent_method'; call the new TypeManager.AddMethod().
17263 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
17264 the MethodBuilder and the Method in a PtrHashtable.
17265 (TypeManager.builder_to_method): Added for this purpose.
17266 (TypeManager.MethodFlags): Added IsObsoleteError.
17267 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
17268 Obsolete and Conditional arguments in MethodBuilders. If we discover
17269 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17270 the message from the attribute.
17272 2002-07-24 Martin Baulig <martin@gnome.org>
17274 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17275 preprocessor directives, ensure that the argument to #define/#undef is
17276 exactly one identifier and that it's actually an identifier.
17278 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17281 2002-07-24 Martin Baulig <martin@gnome.org>
17283 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17284 initialize it to TypeManager.object_type in the constructor.
17285 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17286 of the `hm.get_current' method if we're using the collection pattern.
17287 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17288 for the explicit conversion to make it work when we're using the collection
17289 pattern and the `Current' property has a different return type than `object'.
17292 2002-07-24 Martin Baulig <martin@gnome.org>
17294 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17295 does not match, but don't report any errors. This method is called in
17296 order for all methods in a MethodGroupExpr until a matching method is
17297 found, so we don't want to bail out if the first method doesn't match.
17298 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17299 matches, report the 123. Fixes #28070.
17301 2002-07-24 Martin Baulig <martin@gnome.org>
17303 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17304 TypeManager.TypeToCoreType() to the top of the method so the
17305 following equality checks will work. Fixes #28107.
17307 2002-07-24 Martin Baulig <martin@gnome.org>
17309 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17310 operand is of type uint, and the other operand is of type sbyte,
17311 short or int, the operands are converted to type long." -
17312 Actually do what this comment already told us. Fixes bug #28106,
17315 2002-07-24 Martin Baulig <martin@gnome.org>
17317 * class.cs (MethodBase): New abstract class. This is now a base
17318 class for Property, Indexer and Event to avoid some code duplication
17319 in their Define() and DefineMethods() methods.
17320 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17321 generic methods for Define() and DefineMethods().
17322 (FieldBase): Derive from MemberBase, not MemberCore.
17323 (Property): Derive from MemberBase, not MemberCore.
17324 (Property.DefineMethod): Moved all the code from this method to the
17325 new MethodBase.DefineAccessor(), just call it with appropriate
17327 (Property.Define): Call the new Property.DoDefine(), this does some
17328 sanity checks and we don't need to duplicate the code everywhere.
17329 (Event): Derive from MemberBase, not MemberCore.
17330 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17331 accessors, this will also make them work with interface events.
17332 (Indexer): Derive from MemberBase, not MemberCore.
17333 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17334 (Indexer.Define): Use the new MethodBase functions.
17336 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17337 argument to the constructor.
17338 (Interface.FindMembers): Added support for interface events.
17339 (Interface.PopluateEvent): Implemented.
17341 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
17343 2002-07-22 Miguel de Icaza <miguel@ximian.com>
17345 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17346 but this is required to check for a method name being the same as
17347 the containing class.
17351 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17353 * interface.cs: initialize variable.
17355 2002-07-23 Martin Baulig <martin@gnome.org>
17357 Implemented the IndexerName attribute in interfaces.
17359 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17360 name if this is an explicit interface implementation.
17361 (Indexer.InterfaceIndexerName): New public variable. If we're
17362 implementing an interface indexer, this is the IndexerName in that
17363 interface. Otherwise, it's the IndexerName.
17364 (Indexer.DefineMethod): If we're implementing interface indexer,
17365 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
17366 and Pending.ImplementIndexer methods.
17367 (Indexer.Define): Also define the PropertyBuilder if we're
17368 implementing an interface indexer and this is neither an explicit
17369 interface implementation nor do the IndexerName match the one in
17372 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17373 If a method is defined here, then we always need to create a proxy
17374 for it. This is used when implementing interface indexers.
17375 (Pending.IsInterfaceIndexer): New public method.
17376 (Pending.ImplementIndexer): New public method.
17377 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17378 This is used when implementing interface indexers to define a proxy
17380 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17381 define a proxy if necessary.
17383 * interface.cs (Interface.IndexerName): New public variable.
17384 (Interface.PopulateIndexer): Set the IndexerName.
17385 (Interface.DefineIndexers): New private method. Populate all the
17386 indexers and make sure their IndexerNames match.
17388 * typemanager.cs (IndexerPropertyName): Added support for interface
17391 2002-07-22 Martin Baulig <martin@gnome.org>
17393 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17394 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17395 ret if HasReturnLabel.
17396 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17399 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17400 and set the ec.LoopBeginTryCatchLevel.
17401 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17402 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17403 the current ec.TryCatchLevel, the branch goes out of an exception
17404 block. In this case, we need to use Leave and not Br.
17406 2002-07-22 Martin Baulig <martin@gnome.org>
17408 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17409 block unless the block does not always return or it is contained in
17410 another try { ... } catch { ... } block. Fixes bug #26506.
17411 Added verify-1.cs to the test suite.
17413 2002-07-22 Martin Baulig <martin@gnome.org>
17415 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17416 then we do not always return. Fixes bug #24985.
17418 2002-07-22 Martin Baulig <martin@gnome.org>
17420 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17421 lookup on a per-class level; ie. walk up the class hierarchy until we
17422 found at least one applicable method, then choose the best among them.
17423 Fixes bug #24463 and test-29.cs.
17425 2002-07-22 Martin Baulig <martin@gnome.org>
17427 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17428 return types of the methods. The return type is not part of the
17429 signature and we must not check it to make the `new' modifier work.
17430 Fixes bug #27999, also added test-147.cs.
17431 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17433 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17434 on the method's return type.
17436 2002-07-21 Martin Baulig <martin@gnome.org>
17438 * assign.cs: Make this work if the rightmost source is a constant and
17439 we need to do an implicit type conversion. Also adding a few more tests
17440 to test-38.cs which should have caught this.
17442 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17443 target in the makefile for this. The makefile.gnu is primarily intended
17444 for end-users who don't want to debug the compiler.
17446 2002-07-21 Martin Baulig <martin@gnome.org>
17448 * assign.cs: Improved the Assign class so it can now handle embedded
17449 assignments (X = Y = Z = something). As a side-effect this'll now also
17450 consume less local variables. test-38.cs now passes with MCS, added
17451 a few new test cases to that test.
17453 2002-07-20 Martin Baulig <martin@gnome.org>
17455 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17456 instructions. Fixes bug #27977, also added test-146.cs.
17458 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17460 * cs-tokenizer.cs: fixed getHex ().
17462 2002-07-19 Martin Baulig <martin@gnome.org>
17464 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17465 not Type.GetType() to lookup the array type. This is needed when
17466 we're constructing an array of a user-defined type.
17467 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17468 single-dimensional arrays, but also for single-dimensial arrays of
17471 2002-07-19 Martin Baulig <martin@gnome.org>
17473 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17474 this function is called, it's not allowed to share LocalBuilders
17475 among ILGenerators.
17477 2002-07-19 Martin Baulig <martin@gnome.org>
17479 * expression.cs (Argument.Resolve): Report an error 118 when trying
17480 to pass a type as argument.
17482 2002-07-18 Martin Baulig <martin@gnome.org>
17484 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17485 Conv_R_Un for the signed `long' type.
17487 2002-07-15 Miguel de Icaza <miguel@ximian.com>
17489 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17490 `expr' for the temporary result, as that will fail if we do
17491 multiple resolves on the same expression.
17493 2002-07-05 Miguel de Icaza <miguel@ximian.com>
17495 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17496 ec.TypeContainer for looking up aliases.
17498 * class.cs (TypeContainer): Remove LookupAlias from here.
17500 * decl.cs (DeclSpace); Move here.
17502 2002-07-01 Miguel de Icaza <miguel@ximian.com>
17504 * class.cs (FindMembers): Only call filter if the constructor
17505 bulider is not null.
17507 Also handle delegates in `NestedTypes' now. Now we will perform
17508 type lookups using the standard resolution process. This also
17511 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17512 This uses Expressions (the limited kind that can be parsed by the
17513 tree) instead of strings.
17515 * expression.cs (ComposedCast.ToString): Implement, used to flag
17516 errors since now we have to render expressions.
17518 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
17521 * ecore.cs (SimpleName.ToString): ditto.
17523 * cs-parser.jay: Instead of using strings to assemble types, use
17524 Expressions to assemble the type (using SimpleName, ComposedCast,
17525 MemberAccess). This should fix the type lookups in declarations,
17526 because we were using a different code path for this.
17528 * statement.cs (Block.Resolve): Continue processing statements
17529 even when there is an error.
17531 2002-07-17 Miguel de Icaza <miguel@ximian.com>
17533 * class.cs (Event.Define): Also remove the `remove' method from
17534 the list of pending items.
17536 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17537 generate more compact code.
17539 2002-07-17 Martin Baulig <martin@gnome.org>
17541 * const.cs (Const.LookupConstantValue): Add support for constant
17542 `unchecked' and `checked' expressions.
17543 Also adding test case test-140.cs for this.
17545 2002-07-17 Martin Baulig <martin@gnome.org>
17547 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17548 check whether mi.ReturnType implements the IEnumerator interface; the
17549 `==' and the IsAssignableFrom() will fail in this situation.
17551 2002-07-16 Ravi Pratap <ravi@ximian.com>
17553 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
17556 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17558 * expression.cs: fixed bug #27811.
17560 2002-07-14 Miguel de Icaza <miguel@ximian.com>
17562 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17563 Molaro: when we are a ref, the value already contains a pointer
17564 value, do not take the address of it.
17566 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17567 * removed mb-parser.jay and mb-tokenizer.cs
17569 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17571 * expression.cs: check against the building corlib void type.
17573 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17575 * ecore.cs: fix for valuetype static readonly fields: when
17576 initializing them, we need their address, not the address of a copy.
17578 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17580 * typemanager.cs: register also enum_type in corlib.
17582 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17584 * class.cs: allow calling this (but not base) initializers in structs.
17586 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17588 * ecore.cs: make sure we compare against the building base types
17591 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17593 * typemanager.cs: fix TypeToCoreType() to handle void and object
17594 (corlib gets no more typerefs after this change).
17596 2002-07-12 Miguel de Icaza <miguel@ximian.com>
17598 * expression.cs (ArrayCreation.EmitArrayArguments): use
17599 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17601 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17602 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
17603 array indexes, the runtime actually forbids them.
17605 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17606 for array arguments here.
17608 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17609 instead of the default for ValueTypes.
17611 (New.DoEmit): Use IsValueType instead of
17612 IsSubclassOf (value_type)
17613 (New.DoResolve): ditto.
17614 (Invocation.EmitCall): ditto.
17616 * assign.cs (Assign): ditto.
17618 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17619 Statements *are* currently doing part of their resolution during
17622 Expressions do always resolve during resolve, but statements are
17623 only required to propagate resolution to their children.
17625 2002-07-11 Miguel de Icaza <miguel@ximian.com>
17627 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17629 (LoadAssembly): Do not add the dll if it is already specified
17631 (MainDriver): Add the System directory to the link path at the end,
17632 after all the other -L arguments.
17634 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17635 wrong opcode for loading bytes and bools (ldelem.i1 instead of
17636 ldelem.u1) and using the opposite for sbytes.
17638 This fixes Digger, and we can finally run it.
17640 * driver.cs (UnixParseOption): Move the option parsing here.
17641 (CSCParseOption): Implement CSC-like parsing of options.
17643 We now support both modes of operation, the old Unix way, and the
17644 new CSC-like way. This should help those who wanted to make cross
17645 platform makefiles.
17647 The only thing broken is that /r:, /reference: and /lib: are not
17648 implemented, because I want to make those have the same semantics
17649 as the CSC compiler has, and kill once and for all the confussion
17650 around this. Will be doing this tomorrow.
17652 * statement.cs (Unsafe.Resolve): The state is checked during
17653 resolve, not emit, so we have to set the flags for IsUnsfe here.
17655 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17657 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17658 not catch the Error_ObjectRefRequired in SimpleName (as it is
17659 possible to have a class/instance variable name that later gets
17660 deambiguated), we have to check this here.
17662 2002-07-10 Ravi Pratap <ravi@ximian.com>
17664 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17665 make static and put into Expression.
17667 (Event.Define): Register the private field of the event with the
17668 TypeManager so that GetFieldFromEvent can get at it.
17670 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17671 keep track of the private field associated with an event which
17674 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17677 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17679 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17681 * expression.cs (Binary.EmitBranchable): this routine emits the
17682 Binary expression in a branchable context. This basically means:
17683 we need to branch somewhere, not just get the value on the stack.
17685 This works together with Statement.EmitBoolExpression.
17687 * statement.cs (Statement.EmitBoolExpression): Use
17690 2002-07-09 Miguel de Icaza <miguel@ximian.com>
17692 * statement.cs (For): Reduce the number of jumps in loops.
17694 (For): Implement loop inversion for the For statement.
17696 (Break): We can be breaking out of a Try/Catch controlled section
17697 (foreach might have an implicit try/catch clause), so we need to
17698 use Leave instead of Br.
17700 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17701 now). If the instace expression supports IMemoryLocation, we use
17702 the AddressOf method from the IMemoryLocation to extract the
17703 address instead of emitting the instance.
17705 This showed up with `This', as we were emitting the instance
17706 always (Emit) instead of the Address of This. Particularly
17707 interesting when This is a value type, as we dont want the Emit
17708 effect (which was to load the object).
17710 2002-07-08 Miguel de Icaza <miguel@ximian.com>
17712 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17714 * statement.cs (Checked): Set the CheckedState during the resolve
17715 process too, as the ConvCast operations track the checked state on
17716 the resolve process, and not emit.
17718 * cs-parser.jay (namespace_member_declaration): Flag that we have
17719 found a declaration when we do. This is used to flag error 1529
17721 * driver.cs: Report ok when we display the help only.
17723 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
17725 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17727 2002-07-04 Miguel de Icaza <miguel@ximian.com>
17729 * cs-tokenizer.cs (define): We also have to track locally the
17730 defines. AllDefines is just used for the Conditional Attribute,
17731 but we also need the local defines for the current source code.
17733 2002-07-03 Miguel de Icaza <miguel@ximian.com>
17735 * statement.cs (While, For, Do): These loops can exit through a
17736 Break statement, use this information to tell whether the
17737 statement is the last piece of code.
17739 (Break): Flag that we break.
17741 * codegen.cs (EmitContexts): New `Breaks' state variable.
17743 2002-07-03 Martin Baulig <martin@gnome.org>
17745 * class.cs (TypeContainer.MethodModifiersValid): Allow override
17746 modifiers in method declarations in structs. Otherwise, you won't
17747 be able to override things like Object.Equals().
17749 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17751 * class.cs (Method, Property, Indexer): Do not allow the public
17752 modifier to be used in explicit interface implementations.
17754 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17755 override modifiers in method declarations in structs
17757 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
17759 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17760 integer or real overflow, report an error
17762 2002-07-02 Martin Baulig <martin@gnome.org>
17764 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17765 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17766 to tell the runtime about our newly created System.Object and
17767 System.ValueType types.
17769 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17771 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17772 struct instead of Ldarg/Starg.
17774 2002-07-02 Martin Baulig <martin@gnome.org>
17776 * expression.cs (Indirection.Indirection): Call
17777 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17779 2002-07-02 Martin Baulig <martin@gnome.org>
17781 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17782 ValueType, call TypeManager.TypeToCoreType() on it.
17783 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17784 the OpCodes.Newarr argument.
17786 2002-07-02 Martin Baulig <martin@gnome.org>
17788 * expression.cs (Invocation.EmitCall): When compiling corlib,
17789 replace all calls to the system's System.Array type to calls to
17790 the newly created one.
17792 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17793 System.Array methods.
17794 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17795 from the system's System.Array type which must be replaced.
17797 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17799 * typemanager.cs: load unverifiable_code_ctor so we can build
17800 corlib using the correct type. Avoid using GetTypeCode() with
17802 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17803 TypeManager.object_type to allow building corlib.
17805 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17807 * ecore.cs: handle System.Enum separately in LoadFromPtr().
17809 2002-07-01 Martin Baulig <martin@gnome.org>
17811 * class.cs: Make the last change actually work, we need to check
17812 whether `ifaces != null' to avoid a crash.
17814 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17816 * class.cs: when we build structs without fields that implement
17817 interfaces, we need to add the interfaces separately, since there is
17818 no API to both set the size and add the interfaces at type creation
17821 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17823 * expression.cs: the dimension arguments to the array constructors
17824 need to be converted if they are a long.
17826 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17828 * class.cs: don't emit ldarg.0 if there is no parent constructor
17829 (fixes showstopper for corlib).
17831 2002-06-29 Martin Baulig <martin@gnome.org>
17833 MCS now compiles corlib on GNU/Linux :-)
17835 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17836 ie. check for MethodImplOptions.InternalCall.
17838 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17839 and TypeManager.attribute_type are null, so we must explicitly check
17840 whether parent is not null to find out whether it's an attribute type.
17841 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17842 and SetBuilder, not only if the property is neither abstract nor external.
17843 This is necessary to set the MethodImplOptions on the accessor methods.
17844 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17845 SetBuilder, see Property.Emit().
17847 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17848 populate "System.Object", "System.ValueType" and "System.Attribute" since
17849 they've already been populated from BootCorlib_PopulateCoreTypes().
17851 2002-06-29 Martin Baulig <martin@gnome.org>
17853 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17854 is the NullLiteral, we also need to make sure that target_type is not
17857 2002-06-29 Martin Baulig <martin@gnome.org>
17859 * rootcontext.cs (RootContext.ResolveCore): We must initialize
17860 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17861 before calling BootstrapCorlib_ResolveDelegate ().
17863 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17865 * statement.cs: fixed build-breaker. All tests passed ok.
17867 2002-06-27 Martin Baulig <martin@gnome.org>
17869 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17870 for System.Decimal when compiling corlib.
17872 2002-06-27 Martin Baulig <martin@gnome.org>
17874 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17875 switch blocks which contain nothing but a default clause.
17877 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
17879 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17881 2002-06-27 Martin Baulig <martin@gnome.org>
17883 * ecore.cs (PropertyExpr.PropertyExpr): Call
17884 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17886 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17887 is already a TypeBuilder.
17889 2002-06-27 Martin Baulig <martin@gnome.org>
17891 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17892 `target_type == TypeManager.array_type', not IsAssignableFrom() in
17893 the "from an array-type to System.Array" case. This makes it work
17894 when compiling corlib.
17896 2002-06-27 Martin Baulig <martin@gnome.org>
17898 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17899 non-static PropertyExpr, set its InstanceExpression. This makes
17900 the `ICollection.Count' property work in System/Array.cs.
17902 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
17904 * driver.cs: Made error handling more consistent. Errors now
17905 tracked by Report class, so many methods which used to return int
17906 now return void. Main() now prints success/failure and
17907 errors/warnings message.
17909 Renamed '--probe' compiler argument to '--expect-error'. Removed
17910 the magic number return values (123 and 124). Now, if the
17911 expected error occurs, the compiler exits with success (exit value
17912 0). If the compilation completes without seeing that particular
17913 error, the compiler exits with failure (exit value 1). The
17914 makefile in mcs/errors has been changed to handle the new behaviour.
17916 * report.cs: Made 'expected error' number a property and renamed
17917 it from 'Probe' to 'ExpectedError'.
17919 * genericparser.cs: Removed error handling support, since it is
17920 now all done by Report class.
17922 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17923 class, so parse() no longer returns an int.
17925 * namespace.cs: Use Report.Error instead of GenericParser.error
17927 2002-06-22 Miguel de Icaza <miguel@ximian.com>
17929 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17930 TypeContainer.AddOperator): At the front of the list put the
17931 explicit implementations, so they get resolved/defined first.
17933 2002-06-21 Miguel de Icaza <miguel@ximian.com>
17935 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17936 interface type is implemented by this TypeContainer. Used during
17937 explicit interface implementation.
17939 (Property.Define, Indexer.Define, Method.Define): Validate that
17940 the given interface in the explicit implementation is one of the
17941 base classes for the containing type.
17943 Also if we are explicitly implementing an interface, but there is
17944 no match in the pending implementation table, report an error.
17946 (Property.Define): Only define the property if we are
17947 not explicitly implementing a property from an interface. Use the
17948 correct name also for those properties (the same CSC uses,
17949 although that is really not needed).
17951 (Property.Emit): Do not emit attributes for explicitly implemented
17952 properties, as there is no TypeBuilder.
17954 (Indexer.Emit): ditto.
17956 Hiding then means that we do not really *implement* a pending
17957 implementation, which makes code fail.
17959 2002-06-22 Martin Baulig <martin@gnome.org>
17961 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17962 the return value of Object.GetType(). [FIXME: we need to do this whenever
17963 we get a type back from the reflection library].
17965 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17967 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17969 2002-06-20 Miguel de Icaza <miguel@ximian.com>
17971 * attribute.cs: Return null if we can not look up the type.
17973 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17974 the interface types found.
17976 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17977 interface types found.
17979 * typemanager.cs (GetInterfaces): Make this routine returns alll
17980 the interfaces and work around the lame differences between
17981 System.Type and System.Reflection.Emit.TypeBuilder in the results
17982 result for GetInterfaces.
17984 (ExpandInterfaces): Given an array of interface types, expand and
17985 eliminate repeated ocurrences of an interface. This expands in
17986 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17989 2002-06-21 Martin Baulig <martin@gnome.org>
17991 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17994 2002-06-21 Martin Baulig <martin@gnome.org>
17996 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
17997 and called with one of the core types, return the corresponding typebuilder for
18000 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18003 2002-06-21 Martin Baulig <martin@gnome.org>
18005 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18006 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18007 (Expression.ConvertReferenceExplicit): Likewise.
18009 * expression.cs (ElementAccess.DoResolve): Likewise.
18010 (ElementAccess.DoResolveLValue): Likewise.
18012 2002-06-10 Martin Baulig <martin@gnome.org>
18014 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18015 add the "value" parameter to the parameter list.
18017 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18020 2002-06-19 Miguel de Icaza <miguel@ximian.com>
18022 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18023 the argument to an int, uint, long or ulong, per the spec. Also
18024 catch negative constants in array creation.
18026 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18028 * class.cs: do not allow the same interface to appear twice in
18029 the definition list.
18031 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18033 * ecore.cs: don't use ldlen with System.Array.
18035 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18037 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18039 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18041 * modifiers.cs: produce correct field attributes for protected
18042 internal. Easy fix so miguel can work on ther harder stuff:-)
18044 2002-06-18 Miguel de Icaza <miguel@ximian.com>
18046 * pending.cs: New file. Move the code from class.cs here.
18047 Support clearning the pending flag for all methods (when not doing
18048 explicit interface implementation).
18050 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18052 * rootcontext.cs: added a couple more types needed to bootstrap.
18054 2002-06-17 Miguel de Icaza <miguel@ximian.com>
18056 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18057 constructor in the type, instead of any constructor in the type
18058 hierarchy. Thanks to Paolo for finding this bug (it showed up as
18059 a bug in the Mono runtime when applying the params attribute).
18061 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18062 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18064 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
18066 * expression.cs (Unary.ResolveOperator): Use TypeManager
18067 to resolve the type.
18069 2002-06-13 Ravi Pratap <ravi@ximian.com>
18071 * cs-parser.jay (enum_member_declaration): Pass in the attributes
18074 * enum.cs (AddEnumMember): Add support to store the attributes associated
18075 with each member too.
18077 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18078 field builders too - this takes care of the enum member case.
18080 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
18082 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18083 address-of operator on both value types and pointers.
18085 2002-06-10 Martin Baulig <martin@gnome.org>
18087 * interface.cs (Interface.PopulateIndexer): Add the indexer's
18088 PropertyBuilder to the `property_builders' list.
18090 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18091 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18092 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
18093 find any indexers which are inherited from an interface.
18095 2002-06-09 Martin Baulig <martin@gnome.org>
18097 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18098 the same type as the constant if necessary. There's also a test-130.cs
18101 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18103 * typemanager.cs (TypeManager.ChangeType): Previously known as
18104 Enum.ChangeEnumType().
18106 2002-06-09 Martin Baulig <martin@gnome.org>
18108 * expression.cs (Cast.TryReduce): Added support for consts.
18110 2002-06-08 Ravi Pratap <ravi@ximian.com>
18112 * class.cs (Accessor): Hold attributes information so we can pass
18115 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18116 Modify to pass in attributes attached to the methods.
18118 (add_accessor_declaration, remove_accessor_declaration): Ditto.
18120 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18121 to handle the Accessor kind :-)
18123 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18125 2002-06-08 Martin Baulig <martin@gnome.org>
18127 * expression.cs (Unary.TryReduceNegative): Added support for
18130 2002-06-08 Martin Baulig <martin@gnome.org>
18132 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18133 name can't be found in the `defined_names' - the caller will do a
18134 MemberLookup in this case and thus find methods in System.Enum
18135 such as Enum.IsDefined().
18137 2002-06-08 Martin Baulig <martin@gnome.org>
18139 * enum.cs (Enum.ChangeEnumType): This is a custom version of
18140 Convert.ChangeType() which works with TypeBuilder created types.
18141 (Enum.LookupEnumValue, Enum.Define): Use it here.
18143 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18144 `TypeBuilder.BaseType != null' check.
18145 (TypeContainer.FindMembers): Only lookup parent members if we
18146 actually have a parent.
18147 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18148 (ConstructorInitializer.Resolve): Likewise.
18150 * interface.cs (Interface.FindMembers): Added
18151 `TypeBuilder.BaseType != null' check.
18153 * rootcontext.cs (RootContext.ResolveCore): Added
18154 "System.Runtime.CompilerServices.IndexerNameAttribute" to
18155 classes_second_stage.
18157 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18158 debug_type and trace_type when compiling with --nostdlib.
18160 2002-06-07 Martin Baulig <martin@gnome.org>
18162 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18163 (AddField): Set it to true when adding a non-static field.
18164 (DefineType): Use `have_nonstatic_fields' to find out whether we
18165 have non-static fields, not `Fields != null'.
18167 2002-06-02 Miguel de Icaza <miguel@ximian.com>
18169 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18170 dereferencing a null on the static-field code path)
18172 2002-05-30 Martin Baulig <martin@gnome.org>
18174 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18175 to take command line arguments. Use reflection to call the new
18176 custom `Initialize' function on the symbol writer and pass it the
18177 command line arguments.
18179 * driver.cs (--debug-args): New command line argument to pass command
18180 line arguments to the symbol writer.
18182 2002-05-28 Miguel de Icaza <miguel@ximian.com>
18184 * assign.cs (DoResolve): Forgot to do the implicit conversion to
18185 the target type for indexers and properties. Thanks to Joe for
18188 2002-05-27 Miguel de Icaza <miguel@ximian.com>
18190 * typemanager.cs (MethodFlags): returns the method flags
18191 (Obsolete/ShouldIgnore) that control warning emission and whether
18192 the invocation should be made, or ignored.
18194 * expression.cs (Invocation.Emit): Remove previous hack, we should
18195 not do this on matching a base type, we should do this based on an attribute
18197 Only emit calls to System.Diagnostics.Debug and
18198 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18199 on the command line.
18201 * rootcontext.cs: Global settings for tracing and debugging.
18203 * cs-tokenizer.cs (define): New utility function to track
18204 defines. Set the global settings for TRACE and DEBUG if found.
18206 2002-05-25 Ravi Pratap <ravi@ximian.com>
18208 * interface.cs (Populate*): Pass in the TypeContainer as well as
18209 the DeclSpace as parameters so that we can create EmitContexts and
18210 then use that to apply attributes etc.
18212 (PopulateMethod, PopulateEvent, PopulateProperty)
18213 (PopulateIndexer): Apply attributes everywhere.
18215 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18218 (ApplyAttributes): Update accordingly.
18220 We now apply interface attributes for all members too.
18222 2002-05-26 Miguel de Icaza <miguel@ximian.com>
18224 * class.cs (Indexer.Define); Correctly check if we are explicit
18225 implementation (instead of checking the Name for a ".", we
18226 directly look up if the InterfaceType was specified).
18228 Delay the creation of the PropertyBuilder.
18230 Only create the PropertyBuilder if we are not an explicit
18231 interface implementation. This means that explicit interface
18232 implementation members do not participate in regular function
18233 lookups, and hence fixes another major ambiguity problem in
18234 overload resolution (that was the visible effect).
18236 (DefineMethod): Return whether we are doing an interface
18239 * typemanager.cs: Temporary hack until we get attributes in
18240 interfaces (Ravi is working on that) and we get IndexerName
18241 support in interfaces.
18243 * interface.cs: Register the indexers as properties.
18245 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18246 warning, I have verified that this is a bug in the .NET runtime
18247 (JavaScript suffers of the same problem).
18249 * typemanager.cs (MemberLookup): When looking up members for
18250 interfaces, the parent of an interface is the implicit
18251 System.Object (so we succeed in searches of Object methods in an
18252 interface method invocation. Example: IEnumerable x; x.ToString
18255 2002-05-25 Miguel de Icaza <miguel@ximian.com>
18257 * class.cs (Event): Events should also register if they do
18258 implement the methods that an interface requires.
18260 * typemanager.cs (MemberLookup); use the new GetInterfaces
18263 (GetInterfaces): The code used to lookup interfaces for a type is
18264 used in more than one place, factor it here.
18266 * driver.cs: Track the errors at the bottom of the file, we kept
18269 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18270 instance if the method we are calling is static!
18272 2002-05-24 Miguel de Icaza <miguel@ximian.com>
18274 * attribute.cs (ApplyAttributes): Make this function filter out
18275 the IndexerName attribute (as that attribute in reality is never
18276 applied) and return the string constant for the IndexerName
18279 * class.cs (TypeContainer.Emit): Validate that all the indexers
18280 have the same IndexerName attribute, and if so, set the
18281 DefaultName attribute on the class.
18283 * typemanager.cs: The return value might contain other stuff (not
18284 only methods). For instance, consider a method with an "Item"
18285 property and an Item method.
18287 * class.cs: If there is a problem with the parameter types,
18290 2002-05-24 Ravi Pratap <ravi@ximian.com>
18292 * ecore.cs (ImplicitConversionExists): Wrapper function which also
18293 looks at user defined conversion after making a call to
18294 StandardConversionExists - we need this for overload resolution.
18296 * expression.cs : Update accordingly the various method calls.
18298 This fixes 2 bugs filed against implicit user defined conversions
18300 2002-05-22 Miguel de Icaza <miguel@ximian.com>
18302 * statement.cs: Track the result of the assignment.
18304 2002-05-21 Miguel de Icaza <miguel@ximian.com>
18306 * expression.cs (MemberAccess): Improved error reporting for
18307 inaccessible members.
18309 2002-05-22 Martin Baulig <martin@gnome.org>
18311 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
18312 itself with debugging support.
18314 2002-05-22 Martin Baulig <martin@gnome.org>
18316 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18317 Removed, this isn't needed anymore.
18319 2002-05-20 Martin Baulig <martin@gnome.org>
18321 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18322 be underlying type for an enum.
18324 2002-05-20 Miguel de Icaza <miguel@ximian.com>
18326 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18327 that splits out the loading of just the core types.
18329 * rootcontext.cs (ResolveCore): Split the struct resolution in
18330 two, so we can load the enumeration underlying types before any
18333 * expression.cs (Is): Bandaid until we fix properly Switch (see
18334 bug #24985 for details).
18336 * typemanager.cs (ImplementsInterface): The hashtable will contain
18337 a null if there are no interfaces implemented.
18339 2002-05-18 Miguel de Icaza <miguel@ximian.com>
18341 * cs-parser.jay (indexer_declarator): It is fine to have array
18344 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18346 * typemanager.cs: (RegisterBuilder): New function used to register
18347 TypeBuilders that implement interfaces. Since
18348 TypeBuilder.GetInterfaces (as usual) does not work with lame
18350 (AddUserType): register interfaces.
18352 (ImplementsInterface): Use the builder_to_ifaces hash if we are
18353 dealing with TypeBuilder. Also, arrays are showing up as
18354 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18355 methods can not be invoked on them!
18357 * ecore.cs (ExplicitReferenceConversionExists): Made public.
18358 (ImplicitReferenceConversionExists): Split out from
18359 StandardConversionExists.
18361 * expression.cs (As): We were only implementing one of the three
18362 cases for the as operator. We now implement them all.
18363 (Is): Implement the various other cases for Is as well.
18365 * typemanager.cs (CACHE): New define used to control if we want or
18366 not the FindMembers cache. Seems to have a negative impact on
18367 performance currently
18369 (MemberLookup): Nested types have full acess to
18370 enclosing type members
18372 Remove code that coped with instance/static returns for events, we
18373 now catch this in RealFindMembers.
18375 (RealFindMembers): only perform static lookup if the instance
18376 lookup did not return a type or an event.
18378 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18380 * assign.cs (CompoundAssign): We pass more semantic information
18381 now to Compound Assignments than we did before: now we have all
18382 the information at hand, and now we resolve the target *before* we
18383 do the expression expansion, which allows the "CacheValue" method
18384 to have the effect we intended (before, a [x] += 1 would generate
18385 two differen ArrayAccess expressions from the ElementAccess,
18386 during the resolution process).
18388 (CompoundAssign.DoResolve): Resolve target and original_source here.
18390 2002-05-16 Miguel de Icaza <miguel@ximian.com>
18392 * expression.cs (ArrayAccess): dropped debugging information.
18394 * typemanager.cs: Small bug fix: I was always returning i_members,
18395 instead of one of i_members or s_members (depending on which had
18398 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
18399 method is invoked before any code generation takes place, and it
18400 is a mechanism to inform that the expression will be invoked more
18401 than once, and that the method should use temporary values to
18402 avoid having side effects
18404 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18406 * ecore.cs (Expression.CacheTemporaries): Provide empty default
18409 * expression.cs (Indirection, ArrayAccess): Add support for
18410 CacheTemporaries in these two bad boys.
18412 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18413 ldobj or ldind_ref.
18414 (StoreFromPtr): Handle stobj as well.
18416 * expression.cs (UnaryMutator): Share more code.
18418 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18419 down: I was not tracking the Filter function as well, which
18420 was affecting the results of the cache.
18422 2002-05-15 Miguel de Icaza <miguel@ximian.com>
18424 * attribute.cs: Remove the hack to handle the CharSet property on
18427 2002-05-14 Miguel de Icaza <miguel@ximian.com>
18429 * attribute.cs (DoResolve): More uglyness, we now only try to
18430 resolve the attribute partially, to extract the CharSet
18431 information (only if we are a StructLayout attribute). Otherwise
18433 (GetExtraTypeInfo): Add some code to conditionally kill in the
18434 future this. I am more and more convinced that the .NET
18435 framework has special code to handle the attribute setting on
18438 * expression.cs (IsParamsMethodApplicable): Revert my previous
18439 foreach change here, it was wrong.
18441 2002-05-13 Miguel de Icaza <miguel@ximian.com>
18443 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18444 (pp_expr): do not abort on unknown input, just return.
18445 (eval): abort if there are pending chars.
18447 * attribute.cs (Attribute.Resolve): Positional parameters are
18448 optional. Deal with that case.
18450 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18451 the Ansi/Unicode/Auto information for the type.
18453 (TypeContainer.DefineType): instantiate the EmitContext here, as
18454 we will be using it during the type definition (to resolve
18455 attributes) and during the emit phase.
18457 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18458 to pull type information out of the attributes
18460 (Attribute.Resolve): track the constructor builder, and allow for
18461 multiple invocations (structs and classes will use this).
18463 * ecore.cs (MemberLookupFinal): new version with all the
18464 parameters customizable.
18466 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18467 constructors. Return if the result value is null (as the error
18468 would have been flagged already by MemberLookupFinal)
18470 Do not allow instances of abstract classes or interfaces to be
18473 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18474 We have to compare the assembly property here when dealing with
18475 FamANDAssem and Assembly access modifiers, because we might be
18476 creating an assembly from *modules* (that means that we are not
18477 getting TypeBuilders for types defined in other modules that are
18478 part of this assembly).
18480 (Method.Emit): If the method is marked abstract and has a body,
18483 (TypeContainer.DefineMembers): If both the defined member and the
18484 parent name match are methods, then do not emit any warnings: let
18485 the Method.Define routine take care of flagging warnings. But if
18486 there is a mismatch (method overrides something else, or method is
18487 overriwritten by something, then emit warning).
18489 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18490 set to null, this means `do not check for the return type on the
18493 (Method.Define): set the return type for the method signature to
18494 null, so that we get methods with the same name and parameters and
18495 different return types. This is used to flag warning 114 (you are
18496 hiding a method, and you probably want to use the new/override
18499 * typemanager.cs (MemberLookup): Implemented proper access
18500 control, closing a long standing set of bug reports. The problem
18501 was that the Framework only has two bits: Public and NonPublic,
18502 and NonPublic includes private and protected methods, but we need
18503 to enforce the FamANDAssem, FamOrAssem and Family.
18505 2002-05-11 Miguel de Icaza <miguel@ximian.com>
18507 * statement.cs (GotoCase): Return true: Ammounts to giving up
18508 knowledge on whether we return or not, and letting the other case
18509 be responsible for it.
18511 2002-05-10 Miguel de Icaza <miguel@ximian.com>
18513 * driver.cs: Do not load directories for each file processed, only
18514 do it if there is a pattern.
18516 * ecore.cs: Report readonly assigns here as well, as we might have
18517 been resolved only by MemberAccess.
18519 (SimpleName.SimpleNameResolve): Also be useful for LValue
18520 resolution. We need this to propagate assign to local readonly variables
18522 * typemanager.cs: Use a ptrhashtable for the criteria, because we
18523 do not want to reuse potential criteria memory.
18525 * class.cs (MyEventBuilder): Set reflected_type;
18527 * ecore.cs (Constantify): Added support for constifying bools.
18529 (RootContext.LookupType): Added a cache for values looked up in
18530 the declaration space.
18532 * typemanager.cs (FindMembers): Now is a front-end to
18533 RealFindMembers, and provides a two-level hashtable-based cache to
18536 15% performance improvement: from 22.5 to 19.2 seconds.
18538 * expression.cs (IsParamsMethodApplicable): use foreach.
18539 (Invocation.DoResolve): ditto.
18540 (New.DoResolve): ditto.
18541 (ArrayCreation.DoResolve): ditto.
18543 * ecore.cs (FindMostEncompassingType): use foreach.
18545 * delegate.cs (NewDelegate.DoResolve): Use foreach
18547 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18548 (RemoveMethods): use foreach.
18550 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18551 nested foreach statements instead of for, and also break out of
18552 the inner loop once a match is found.
18554 (Invocation.OverloadResolve): Use foreach, simplify the code.
18556 2002-05-08 Miguel de Icaza <miguel@ximian.com>
18558 * cfold.cs (BinaryFold): During an enumeration evaluation context,
18559 we actually unwrap the expression to allow for extra information
18562 * expression.cs: Use Shr_Un on unsigned operations.
18564 2002-05-08 Ravi Pratap <ravi@ximian.com>
18566 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
18567 applicable operators was not being considered correctly. This closes
18568 the bug Miguel reported.
18570 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18572 * attribute.cs: check that the type derives from System.Attribute
18573 and report the correct error in that case (moved the duplicate code to
18574 its own method, too).
18576 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18578 * attribute.cs: lookup attribute type name as the spec says: first the
18579 bare attribute name and then name + "Attribute" (nant compiles with
18580 mcs after this fix).
18582 2002-05-07 Miguel de Icaza <miguel@ximian.com>
18584 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
18585 Because of the way we parse things, we should try to see if a
18586 UIntConstant can fit in an integer.
18588 2002-05-07 Ravi Pratap <ravi@ximian.com>
18590 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18591 when we are in an explicit context.
18593 (ConvertReferenceExplicit): When converting from Iface type S to Class
18594 T make sure the rules are implemented as an OR.
18596 * parameter.cs (ParameterType): Make it a property for now although the
18597 purpose really isn't anything immediate.
18599 * expression.cs (Is*Applicable): Do better checking on the parameter type
18600 of a ref/out parameter. The ones from the system assemblies are already
18601 marked with the correct type so we don't need to do any correction.
18603 * ecore.cs (StandardConversionExists): Conversion from Interface types to
18604 the object type is standard too so include that.
18606 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18608 * ecore.cs (StandardConversionExists): Augment with missing code:
18609 deal with IntConstant, LongConstants and Enumerations.
18611 * assign.cs: Report the error, instead of failing silently
18613 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18614 typecontainer that they are declared, because the
18615 typecontainer/namespace will have the list of using clauses that
18616 need to be applied.
18618 Assembly Attributes were escaping the normal registration
18621 (EmitCode): Apply attributes within an EmitContext that represents
18622 the container they were declared on.
18624 * cs-parser.jay: Track bases for structs. How did I get this wrong?
18626 2002-05-06 Ravi Pratap <ravi@ximian.com>
18628 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18629 Revamp completely - make much cleaner as we now operate only
18632 (FindMostSpecificSource, FindMostSpecificTarget): New methods
18633 to implement the logic detailed in the spec more correctly.
18635 (UserDefinedConversion): Update accordingly.
18637 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18639 * statement.cs: Return flow analysis information up.
18641 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18644 (token): Do not consume an extra character before calling
18647 2002-05-06 Piers Haken <piersh@friskit.com>
18649 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18651 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18653 * class.cs (Constructor.Emit): Set the IsStatic flag in the
18654 EmitContext during the instance constructor initializer
18655 resolution, to stop access to instance variables.
18657 This is mandated by the spec, last paragraph of the `constructor
18658 initializers' section.
18660 2002-05-05 Miguel de Icaza <miguel@ximian.com>
18662 * cs-parser.jay, class.cs (Accessor): new class used to represent
18663 an accessor (get or set). In the past we used `null' to represent
18664 a missing accessor. But this is ambiguous because there was no
18665 way to tell in abstract indexers/properties if one of them was
18668 Now there is a way of addressing that.
18670 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18671 instead of FindMembers.
18673 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18674 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18676 * attribute.cs: Treat indexers and properties as the same in terms
18677 of applying attributes
18679 * ecore.cs (FindMostEncompassedType): Use statically initialized
18680 EmptyExpressions()s like we do elsewhere to avoid creating useless
18681 objects (and we take this out of the tight loop).
18683 (GetConversionOperators): Move the code to extract the actual
18684 operators to a separate routine to clean things up.
18686 2002-05-04 Miguel de Icaza <miguel@ximian.com>
18688 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18689 events are always registered FieldBuilders.
18691 * class.cs (FieldBase): New class shared by Fields
18693 * delegate.cs: If we are a toplevel delegate, use our full name.
18694 If we are a nested delegate, then only use our tail name.
18696 2002-05-02 Ravi Pratap <ravi@ximian.com>
18698 * expression.cs (IsApplicable): Ensure that we add the "&" to
18699 ref/out types before comparing it with the type of the argument.
18701 (IsParamsMethodApplicable): Ditto.
18703 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
18706 * delegate.cs : Handle the case when we have more than one applicable
18707 method. Flag an error only when we finish checking all.
18709 2002-05-02 Miguel de Icaza <miguel@ximian.com>
18711 * expression.cs: Add support for boolean static initializers.
18713 2002-05-01 Miguel de Icaza <miguel@ximian.com>
18715 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18717 * parameter.cs (ComputeParameterTypes,
18718 ComputeAndDefineParameterTypes): Better error handling: now we
18719 clear the `types' cache if we fail during any of the type lookups.
18720 We also return the status code correctly to our caller
18722 * delegate.cs: If we fail to define a delegate, abort the extra
18725 * expression.cs (Binary.ResolveOperator): for
18726 operator==(object,object) and operator !=(object, object) we also
18727 have to verify that there is an implicit conversion from one to
18730 (ArrayAccess.DoResolve): Array Access can operate on
18733 2002-04-30 Miguel de Icaza <miguel@ximian.com>
18735 * assign.cs (CompoundAssign): A new class used as a "flag" that
18736 the assignment actually is happening as part of a compound
18737 assignment operator.
18739 During compound assignment, a few new rules exist to enable things
18746 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18747 to the type of x) if y is implicitly convertible to the type of x,
18748 and the operator is a builtin operator and the return type of the
18749 operator is explicitly convertible to the type of x.
18751 * rootcontext.cs: Reset warning level to 2. 4 catches various
18752 "interesting" features in mcs, we must clean this up at some
18753 point, but currently am trying to kill other bugs ;-)
18755 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18756 in container classes as well.
18758 * expression.cs (Binary.ResolveOperator): Handle string case
18759 before anything else (as operator overloading does emit an error
18760 before doing anything else).
18762 This code could go away when we move to a table driven model, but
18763 i could not come up with a good plan last night.
18765 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
18767 * typemanager.cs (CSharpName): reimplementation using regex.
18768 * class.cs: added null check for fields in Emit
18769 * rootcontext.cs: set warninglevel to 4
18771 2002-04-29 Miguel de Icaza <miguel@ximian.com>
18773 * typemanager.cs (CSharpName): reimplemented with Lupus
18776 2002-04-28 Miguel de Icaza <miguel@ximian.com>
18778 * statement.cs (If): correclty implement Resolve, because we were
18779 not catching sem errors in there. The same process is needed
18781 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18784 (Statement.Warning_DeadCodeFound): Factorize code.
18785 (While): Report dead code here too.
18787 (Statement): Added Resolve virtual method to allow
18788 for resolution split from the emit code.
18790 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18792 * statement.cs (EmitBoolExpression): No longer try to resolve the
18794 (MakeBoolean): New utility function that resolve, implicitly
18795 converts to boolean and tags the expression.
18798 (If, Do): Implement dead code elimination.
18799 (While): Implement loop inversion
18801 (Do, While, For, If): Resolve the expression prior to calling our
18804 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
18807 - added method Report28 (warning: program has more than one entry point)
18808 - added method IsEntryPoint, implements paragraph 10.1 of the spec
18809 - modified method Method.Define, the part at the end of the method
18811 * rootcontext.cs: added static public Location EntryPointLocation;
18813 * ../errors/cs0028.cs : Add test case for the above warning.
18816 - modified method CSharpName to allow arrays of primitive type to
18817 be printed nicely (e.g. instead of System.Int32[][] it now prints
18819 - added method CSharpSignature: returns the signature of a method
18820 in string format to be used in reporting errors, warnings, etc.
18822 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18825 2002-04-26 Ravi Pratap <ravi@ximian.com>
18827 * delegate.cs (Define): Fix extremely silly bug where I was
18828 setting the type of the 'object' parameter of the BeginInvoke
18829 method to System.IAsyncResult instead of System.Object ;-)
18831 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18833 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18836 (Constructor.Emit): return if we fail to initialize the
18837 constructor. Another door closed!
18839 * expression.cs (New.DoResolve): Improve error message (from -6 to
18840 1501). Use DeclaredOnly lookup to find the exact constructor.
18842 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18843 loop. This is useful.
18845 * cs-parser.jay: Adjust the default parameters so that destructors
18846 have the proper signature.
18848 2002-04-26 Martin Baulig <martin@gnome.org>
18850 * driver.cs (LoadAssembly): If `assembly' contains any characters
18851 which are only valid in path names and not in assembly names
18852 (currently slash, backslash and point), use Assembly.LoadFrom ()
18853 instead of Assembly.Load () on the `assembly' (before iteration
18854 over the link_paths).
18856 2002-04-26 Martin Baulig <martin@gnome.org>
18858 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18860 2002-04-25 Miguel de Icaza <miguel@ximian.com>
18862 * class.cs (Property): use the new typemanager.MemberLookup
18864 (TypeContainer.MemberLookup): Implement using the
18865 TypeManager.MemberLookup now.
18867 * typemanager.cs: Make MemberLookup a function of the TypeManager,
18868 and return MemberInfos, so that these can be used without an
18869 EmitContext (what we had before).
18871 2002-04-24 Miguel de Icaza <miguel@ximian.com>
18873 * expression.cs: Fix the case where the argument to params if the
18874 type of the params. I omitted handling this before. Fixed
18876 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18878 * driver.cs: Call BootCorlib_PopulateCoreType
18880 * class.cs (Property.CheckBase): Check for properties only, not
18883 * interface.cs: Temporary hack: try/catch around the
18884 CustomAttributeBuilder, because I am getting an exception that I
18887 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18888 types whose definitions are required to be there (attributes are
18889 defined before standard types).
18891 Compute definitions as we boot the various types, as they are used
18892 immediately (value_type class will need object_type, but if we do
18893 not initialize object_type, we will pass a null, which will let
18894 the runtime pick the System.Object from the existing corlib, which
18895 is not what we want).
18897 2002-04-22 Patrik Torstensson <totte@labs2.com>
18899 * cs-tokenizer.cs: fixed a number of trim() issues.
18901 2002-04-22 Ravi Pratap <ravi@ximian.com>
18903 * expression.cs (Argument.Type): Ensure that we return the correct
18904 type when we have out or ref parameters [in which case we
18907 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18909 * class.cs (Property, Indexer): Allow extern modifier in there.
18911 * typemanager.cs (InitBaseTypes): Initializes object_type and
18912 value_type, since those will be used early on during the bootstrap
18913 process to compile corlib.
18915 (InitCoreTypes): Move code from here to InitBaseTypes.
18917 2002-04-21 Miguel de Icaza <miguel@ximian.com>
18919 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18920 single-dimension arrays as using the ldlen opcode.
18922 Daniel Lewis discovered this optimization.
18924 * typemanager.cs: Add signature for System.Array::get_Length
18926 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18928 * statement.cs: report the error when the foreach does not apply to an
18929 array nor a collection.
18931 2002-04-19 Miguel de Icaza <miguel@ximian.com>
18933 * expression.cs: Add implicit conversions to the operator ~.
18935 * constant.cs (DecimalConstant.Emit): Emit decimal value.
18937 * typemanager.cs: Locate the decimal constructor.
18939 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18941 * attribute.cs: use the new property of TypeOf.
18942 * expression.cs: added 'get' property around typearg.
18944 These changes fix a build breaker reported by NickD. Is this the
18945 correct way to fix? If not, please, revert my changes and make it
18948 2002-04-17 Miguel de Icaza <miguel@ximian.com>
18950 * attribute.cs: Add support for typeof in attribute invocations.
18951 I am not sure that this is right though.
18953 2002-04-14 Duncan Mak <duncan@ximian.com>
18955 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18956 Binary.Operator.Division case.
18958 2002-04-13 Ravi Pratap <ravi@ximian.com>
18960 * class.cs (DefineType): Ensure that we do a proper check on
18961 attribute types and also register it with the TypeManager.
18963 (TypeContainer.Targets): The default for attribute types is
18964 AttributeTargets.All.
18966 * attribute.cs (ApplyAttributes): Registering the attribute type
18967 is done elsewhere, not when we discover we have a Usage attribute.
18969 2002-04-12 Ravi Pratap <ravi@ximian.com>
18971 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18972 and get rid of is_delegate parameter.
18974 * everywhere : update.
18976 2002-04-12 Ravi Pratap <ravi@ximian.com>
18978 * cs-parser.jay (compilation_unit): Revamp completely to use
18979 some new ideas that I got from Rhys' grammar to solve the problems
18980 with assembly level attributes.
18982 (outer_declaration): New grammar production.
18984 (attribute_sections): Add.
18986 (opt_attributes): Base on attribute_sections
18988 (namespace_declaration): Allow opt_attributes to tackle the case
18989 when we have assembly level attributes - we are clever in this
18992 * attribute.cs (ApplyAttributes): Do not worry about assembly
18993 attributes in the non-global context.
18995 * rootcontext.cs (AddGlobalAttributes): Go back to using this
18996 instead of SetGlobalAttributes.
18998 * class.cs, rootcontext.cs : Ensure we define and generate
18999 attribute types before anything else.
19001 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19002 and flag the new error -20 for the case when the attribute type
19003 does not have valid targets specified. csc does not catch this.
19005 * ../errors/errors.txt : update for error # -20
19007 2002-04-11 Ravi Pratap <ravi@ximian.com>
19009 * support.cs (InternalParameters.ParameterModifier): Do some null
19010 checking and return sane values.
19012 * class.cs (Method.Define): If we are a PInvoke method, ensure
19013 that we are static and extern. Report error # 601
19015 * ../errors/cs0601.cs : Add test case for the above error.
19017 2002-04-07 Ravi Pratap <ravi@ximian.com>
19019 * rootcontext.cs (attribute_types): We need to keep type of
19020 all attribute types separately and emit code for them first.
19022 (RegisterAttribute) : Implement.
19024 * class.cs (DefineType): Check if the current Type is a custom
19025 attribute type and register it accordingly.
19027 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19028 adding the first attribute twice and rename to
19030 (SetGlobalAttributes): this.
19032 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19035 * attribute.cs (ApplyAttributes): Take an additional argument telling us
19036 if we are processing global arguments. Hmm, I am unsure of this.
19038 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19040 * expression.cs: added static array of strings to avoid calling
19041 Enum.ToString () for Operator in Binary. Significant recover of
19044 2002-04-10 Miguel de Icaza <miguel@ximian.com>
19046 * class.cs (FindMembers): Allow the Builders of the various
19047 members to be null. If they are skip them. This only happens
19048 during the PInvoke declaration.
19050 2002-04-09 Miguel de Icaza <miguel@ximian.com>
19052 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19053 failure, so we do not keep going afterwards.
19055 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19056 wanted to pass `false' as the `is_delegate' argument. If this is
19057 the case, why not use delegate_type == null to mean `is_delegate =
19058 false' and anything else as is_delegate = true.
19060 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
19062 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19063 code for the section, not the beginning of the tests.
19065 2002-04-08 Miguel de Icaza <miguel@ximian.com>
19067 * cfold.cs: Handle operator + (Enum x, Underlying x)
19069 * expression.cs (Binary): same. Warn about errors where we have
19070 Enum/Enum in operator + as well.
19072 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
19075 - added support for switch(bool)
19076 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19077 - add TableSwitchEmit() to handle table-based switch statements
19079 2002-04-05 Ravi Pratap <ravi@ximian.com>
19081 * expression.cs (Invocation.OverloadResolve): Factor out code which
19082 does parameter compatibility checking with arguments so that we can
19083 re-use the code even from Delegate.VerifyApplicability
19085 (VerifyArgumentsCompat): Move above code here.
19087 * delegate.cs (VerifyApplicability): Get rid of duplicate code
19088 and instead make a call to the above method.
19090 2002-03-31 Ravi Pratap <ravi@ximian.com>
19092 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19093 We use it to keep track of classes which are attribute types.
19095 2002-04-02 Miguel de Icaza <miguel@ximian.com>
19097 * delegate.cs (Delegate.Define): Correctly define the types in the
19098 presence of fixed and array parameters.
19100 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19103 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19104 include NonPublic after the first iteration.
19106 * class.cs (Indexer.CheckBase): Only check if both parents are
19109 * cs-parser.jay (accessor_body): If empty, set to null.
19111 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19112 same code path here to resolve constants names that we did have in
19113 MemberAccess.DoResolve. There is too much code duplicated here.
19115 2002-04-01 Miguel de Icaza <miguel@ximian.com>
19117 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19119 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19122 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19123 tokens, numbers and strings.
19125 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19128 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19129 asyncronous parameters and the regular parameters.
19131 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19132 specify the target directory.
19134 * expression.cs: (This.DoResolve): Simplify
19135 (As.Emit): Optimize, do not generate IsInst if the expression is
19136 always of the given type.
19138 (Is.DoResolve): Bug fix, we were reporting both always/never for
19141 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19142 creating too many unnecessary arrays.
19144 2002-03-31 Miguel de Icaza <miguel@ximian.com>
19146 * class.cs (EmitFieldInitializer): Use Assign expression to assign
19147 fields instead of rolling our own initializer. Takes care of all
19148 implicit conversions, and drops unnecessary static checks/argument.
19150 2002-03-31 Dick Porter <dick@ximian.com>
19152 * driver.cs: use the GetDirectories() return values properly, and
19153 use "/" as path separator.
19155 2002-03-30 Miguel de Icaza <miguel@ximian.com>
19157 * expression.cs (Unary): Optimize - - expr into expr.
19158 (Binary): Optimize a + (-b) into a -b.
19160 * codegen.cs (CodeGen): Made all methods static.
19162 2002-03-29 Miguel de Icaza <miguel@ximian.com>
19166 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19167 TypeBuilder property.
19169 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19172 * tree.cs: Removed the various RecordXXXX, and replaced with a
19173 single RecordDecl. Removed all the accessor methods, and just
19174 left a single access point Type
19176 * enum.cs: Rename DefineEnum to DefineType.
19178 * decl.cs: New abstract method `DefineType' used to unify the
19179 Defines for Enumerations, Interfaces, TypeContainers and
19182 (FindType): Moved LookupInterfaceOrClass here. Moved the
19183 LookupBaseClasses method that used to live in class.cs and
19184 interface.cs here, and renamed to FindType.
19186 * delegate.cs: Implement DefineType. Take advantage of the
19187 refactored pattern for locating the parent builder without taking
19188 the parent_builder argument (which we know does not work if we are
19189 nested, and triggering a toplevel definition).
19191 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19193 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19194 accessibility of a member has changed during override and report
19197 * class.cs (Method.Define, Property.Define): Only complain on
19198 overrides if the method is private, any other accessibility is
19199 fine (and since we just checked the permission is the same, we are
19202 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19203 and elif are processed always. The other pre-processing
19204 directives are only processed if we are "taking" the path
19206 2002-03-29 Martin Baulig <martin@gnome.org>
19208 * class.cs (Method.Emit): Only emit symbolic debugging info if the
19209 current location is not Null.
19211 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19212 a separate method so we can profile it.
19214 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19215 `span.Seconds' are just seconds, but no minutes or hours.
19216 (MainDriver): Profile the CodeGen.SaveSymbols calls.
19218 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19220 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19221 Remove the gratuitous set of Final:
19223 // If an interface implementation, then we can set Final.
19224 if (((flags & MethodAttributes.Abstract) == 0) &&
19225 implementing.DeclaringType.IsInterface)
19226 flags |= MethodAttributes.Final;
19228 I do not know what I was smoking when I used that.
19231 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19232 step into fixing the name resolution issues for delegates and
19233 unifying the toplevel name resolution.
19235 2002-03-28 Martin Baulig <martin@gnome.org>
19237 * class.cs (Method.Emit): If we have a symbol writer, call its
19238 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19239 tell it about the current method.
19241 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19242 writer that we're going to emit the first byte of IL code for a new
19243 statement (a new source line).
19244 (EmitContext.EmitTopBlock): If we have a symbol writer, call
19245 EmitContext.Mark() before emitting any code.
19247 * location.cs (SymbolDocument): Return null when we're Null.
19249 * statement.cs (Statement): Moved the `Location loc' variable here.
19250 (Statement.EmitBoolExpression): If we have a symbol writer, call
19251 ec.Mark() before emitting any code to tell it that we're at the
19252 beginning of a new statement.
19253 (StatementExpression): Added `Location' argument to the constructor.
19254 (Block): Added public readonly variable `StartLocation' and public
19255 variable `EndLocation'. The latter is to be set using SetEndLocation().
19256 (Block): Added constructor which takes a start and end location.
19257 (Block.SetEndLocation): New method. This sets the end location.
19258 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19259 local variables we create.
19260 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19261 each statement and do also mark the begin and end of the block.
19263 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19264 tell it the current lexer.Location, use Location.Null for the end of the
19266 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19267 current block, set its end location using SetEndLocation().
19268 (statement_expression): StatementExpression constructor now takes the
19269 lexer.Location as additional argument.
19270 (for_statement, declare_local_variables): Likewise.
19271 (declare_local_variables): When creating a new implicit block, use the
19272 new Block constructor and pass it the lexer.Location.
19274 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19276 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19277 members also on the parent interfaces recursively.
19279 2002-03-27 Miguel de Icaza <miguel@ximian.com>
19281 * report.cs: Use new formats, since Gonzalo finished the missing
19284 * expression.cs (Binary.ResolveOperator): added missing operator|
19285 operator& and operator^ for bool/bool.
19287 * cs-parser.jay: CheckDef now takes a Location argument that is
19288 used to report errors more precisly (instead of reporting the end
19289 of a definition, we try to track something which is a lot closer
19290 to the source of the problem).
19292 * cs-tokenizer.cs: Track global token use, so we can properly flag
19293 the use of #define/#undef after the first token has been seen.
19295 Also, rename the reportXXXX to Error_DescriptiveName
19297 * decl.cs (DeclSpace.IsTopLevel): Move property here from
19298 TypeContainer, so that Enum and Interface can use this too.
19300 * class.cs (TypeContainer.LookupInterfaceOrClass,
19301 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19302 `builder' argument. Typically this was used to pass the parent
19303 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19306 The problem is that a nested class could trigger the definition of
19307 a toplevel class, and the builder would be obviously wrong in that
19310 So we drop this argument, and we compute dynamically the
19311 TypeBuilder/ModuleBuilder (the correct information was available
19312 to us anyways from DeclSpace.Parent)
19314 * interface.cs (Interface.DefineInterface): Drop builder
19315 parameter cleanup like class.cs
19317 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
19320 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19323 (Try.Emit): Propagate the returns value from the statement.
19325 (Return.Emit): Even if we are leavning
19327 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19329 * modifiers.cs: Fix the computation of MethodAttributes flags.
19331 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19333 * driver.cs: allow compilation of files that start with '/'.
19334 Add a default case when checking the argument of --target.
19336 2002-03-25 Miguel de Icaza <miguel@ximian.com>
19338 * interface.cs: Implement the same search algorithm for types in
19339 the interface code.
19341 * delegate.cs: Do not allow multiple definition.
19343 * Recovered ChangeLog that got accidentally amputated
19345 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19347 * rootcontext.cs: Load manually enum to allow core classes to
19348 contain enumerations.
19350 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19351 Update to new static methods in TypeManager.
19353 * typemanager.cs (GetMethod, GetConstructor): Use our
19354 implementation of FindMembers to find the members, since during
19355 corlib compilation, the types are TypeBuilders and GetMethod and
19356 GetConstructor do not work.
19358 Make all methods in TypeManager static.
19360 (InitCodeHelpers): Split the functionality from
19361 the InitCodeTypes function.
19363 * driver.cs: Call InitCodeHelpers after we have populated the
19366 * cs-parser.jay (delegate_declaration): we did not used to compute
19367 the delegate name correctly for void delegates.
19369 2002-03-24 Miguel de Icaza <miguel@ximian.com>
19371 * rootcontext.cs (RootContext): Init the interface_resolve_order
19372 and type_container_resolve_order always.
19374 (ResolveCore, BootstrapCorlib_ResolveClass,
19375 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19376 compiler when compiling with --nostdlib
19378 * class.cs (TypeContainer.DefineType): Check that our parent is
19379 not null. This test is most important when we are bootstraping
19382 * codegen.cs: Split out the symbol writing code.
19384 2002-03-25 Martin Baulig <martin@gnome.org>
19386 * driver.cs (-g): Made -g an alias for --debug.
19388 2002-03-24 Martin Baulig <martin@gnome.org>
19390 * codegen.cs (SymbolWriter): New public variable. Returns the
19391 current symbol writer.
19392 (CodeGen): Added `bool want_debugging_support' argument to the
19393 constructor. If true, tell the ModuleBuild that we want debugging
19394 support and ask it for the ISymbolWriter.
19395 (Save): If we have a symbol writer, call it's Close() method after
19396 saving the assembly.
19398 * driver.c (--debug): New command line argument to create a
19399 debugger information file.
19401 * location.cs (SymbolDocument): New public property. Returns an
19402 ISymbolDocumentWriter object for the current source file or null
19403 if we don't have a symbol writer.
19405 2002-03-21 Miguel de Icaza <miguel@ximian.com>
19407 * driver.cs (LoadAssembly): Correctly return when all the paths
19408 have been tried and not before.
19410 * statement.cs (Switch.Emit): return the actual coverage for this
19411 statement (returns/not-returns)
19413 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19414 switch of the statement if we are the last switch section. That
19415 kills two problems: try/catch problems (we used to emit an empty
19416 nop at the end) and switch statements where all branches would
19419 2002-03-19 Miguel de Icaza <miguel@ximian.com>
19421 * driver.cs: Add default assemblies (the equivalent to the
19422 Microsoft CSC.RSP file)
19424 * cs-tokenizer.cs: When updating `cols and setting it to zero,
19425 also update tokens_seen and set it to false.
19427 * driver.cs: Implement --recurse for Mike.
19429 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19430 correctly splitting out the paths.
19432 2002-03-18 Miguel de Icaza <miguel@ximian.com>
19434 * interface.cs (Interface.PopulateProperty): Instead of using
19435 `parent' as the declaration space for the set parameters, use
19438 * support.cs (InternalParameters): InternalParameters constructor
19439 takes a DeclSpace instead of a TypeContainer.
19441 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19442 types are being initialized, load the address of it before calling
19445 (New): Provide a mechanism to disable the generation of local
19446 value type temporaries when the caller will be providing us with
19447 an address to store it.
19449 (ArrayCreation.EmitDynamicInitializers): Use it.
19451 2002-03-17 Miguel de Icaza <miguel@ximian.com>
19453 * expression.cs (Invocation.EmitArguments): Only probe for array
19454 property if there is more than one argument. Sorry about that.
19456 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19457 empty param arrays.
19459 * class.cs (Method.LabelParameters): Fix incorrect code path that
19460 prevented the `ParamArrayAttribute' from being applied to the
19463 2002-03-16 Miguel de Icaza <miguel@ximian.com>
19465 * support.cs (ReflectionParameters): Correctly compute whether the
19466 last argument is a params array. Fixes the problem with
19469 * typemanager.cs: Make the assemblies array always be non-null
19470 (empty, but non-null)
19472 * tree.cs (RecordDecl): New function that abstracts the recording
19473 of names. This reports error 101, and provides a pointer to the
19474 previous declaration. Fixes a crash in the compiler.
19476 * cs-parser.jay (constructor_declaration): Update to new grammar,
19477 and provide a constructor_body that can be empty.
19479 2002-03-15 Miguel de Icaza <miguel@ximian.com>
19481 * driver.cs: Add support for --resources.
19483 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19484 Make all types for the various array helper methods be integer.
19486 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19487 CheckState to ConvCast.
19489 (ConvCast): Now it takes a `checked' state argument, to avoid
19490 depending on the emit context for the conversion, and just using
19491 the resolve time setting.
19493 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19494 instead of Invocation.EmitArguments. We do not emit the original
19495 arguments, instead we emit those which have been converted to
19496 unsigned int expressions.
19498 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19500 * codegen.cs: ditto.
19502 * expression.cs (LocalVariableReference): Drop the use of the
19503 Store function that depended on the variable index.
19505 * statement.cs (VariableInfo): Drop the `Idx' property from this
19506 class, as this is not taking into account the indexes for
19507 temporaries tat we generate during the execution, getting the
19510 * class.cs: First emit class initializers, then call the parent
19513 * expression.cs (Binary): Fix opcode emision.
19514 (UnaryMutator.EmitCode): Support checked code generation
19516 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19517 matches for events for both the Static and Instance scans,
19518 pointing to the same element. Fix that.
19520 2002-03-14 Miguel de Icaza <miguel@ximian.com>
19522 * rootcontext.cs (ResolveTree): Always set the
19523 interface_resolve_order, because nested interfaces will be calling
19526 * class.cs (GetInterfaceOrClass): Track the same resolution
19527 process used by TypeManager.LookupType. This fixes the nested
19528 type lookups in class declarations (separate path from
19531 (TypeContainer.DefineType): Also define nested interfaces.
19532 (TypeContainer.RegisterOrder): New public function used to
19533 register the order in which child interfaces need to be closed.
19535 Nested interfaces need to be closed after their parents have been
19538 * interface.cs (InterfaceAttr): Put all the logic for computing
19539 the interface attribute here.
19541 (DefineInterface): Register our interface order with the
19542 RootContext or with the TypeContainer depending on the case.
19544 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19546 * cs-parser.jay: rework foreach statement to work with the new
19547 changes to the policy on SimpleNames.
19549 * report.cs: support Stacktrace on warnings as well.
19551 * makefile: drop --unsafe and /unsafe from the compile.
19553 2002-03-13 Ravi Pratap <ravi@ximian.com>
19555 * ecore.cs (StandardConversionExists): Modify to take an Expression
19556 as the first parameter. Ensure we do null -> reference type conversion
19559 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19560 temporary Expression objects.
19562 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19564 * interface.cs: workaround bug in method overloading resolution
19565 (there is already a bugzilla bug for it).
19567 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19569 We could also solve this problem by having a separate path for
19570 performing type lookups, instead of DoResolve, we could have a
19571 ResolveType entry point, and only participating pieces of the
19572 production (simplename, deref, array) would implement this.
19574 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19575 signal SimpleName to only resolve type names and not attempt to
19576 resolve anything else.
19578 * expression.cs (Cast): Set the flag.
19580 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19582 * class.cs: Only report 108 if there is no `new' modifier.
19584 * cs-parser.jay: rework foreach statement to work with the new
19585 changes to the policy on SimpleNames.
19587 * report.cs: support Stacktrace on warnings as well.
19589 * makefile: drop --unsafe and /unsafe from the compile.
19591 2002-03-11 Miguel de Icaza <miguel@ximian.com>
19593 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19594 lookups here, instead of doing that at parse time. This means
19595 that our grammar will not introduce `LocalVariableReferences' as
19596 expressions at this point. That solves the problem of code like
19600 static void Main ()
19604 This is only half the fix. The full fix requires parameters to
19605 also be handled in this way.
19607 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19608 makes the use more obvious of the DeclSpace. The
19609 ec.TypeContainer.TypeBuilder is now only used to pull the
19610 TypeBuilder for it.
19612 My theory is that I can get rid of the TypeBuilder completely from
19613 the EmitContext, and have typecasts where it is used (from
19614 DeclSpace to where it matters).
19616 The only pending problem is that the code that implements Aliases
19617 is on TypeContainer, and probably should go in DeclSpace.
19619 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19620 lookups here, instead of doing that at parse time. This means
19621 that our grammar will not introduce `LocalVariableReferences' as
19622 expressions at this point. That solves the problem of code like
19626 static void Main ()
19630 This is only half the fix. The full fix requires parameters to
19631 also be handled in this way.
19633 * class.cs (Property.DefineMethod): When implementing an interface
19634 method, set newslot, when implementing an abstract method, do not
19635 set the flag (before we tried never setting it, or always setting
19636 it, which is the difference).
19637 (Indexer.DefineMethod): same.
19638 (Method.DefineMethod): same.
19640 * ecore.cs: Only set the status used flag if we get back a Field.
19642 * attribute.cs: Temporary hack, so Paolo can keep working.
19644 2002-03-08 Ravi Pratap <ravi@ximian.com>
19646 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19647 the unmanaged type in the case we have a MarshalAs attribute.
19649 (Resolve): Handle the case when we are parsing the special MarshalAs
19650 attribute [we need to store the unmanaged type to use later]
19652 * typemanager.cs (marshal_as_attr_type): Built in type for the
19653 MarshalAs Attribute.
19655 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
19656 on parameters and accordingly set the marshalling info.
19658 2002-03-09 Miguel de Icaza <miguel@ximian.com>
19660 * class.cs: Optimizing slightly by removing redundant code after
19661 we switched to the `NoTypes' return value.
19662 (Property.DefineMethod): use NoTypes here too.
19664 This fixes the bug I introduced in my last batch of changes.
19666 2002-03-05 Ravi Pratap <ravi@ximian.com>
19668 * tree.cs (RecordEnum): Add. We now keep track of enums too.
19670 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19671 Enums since those are types too.
19673 * cs-parser.jay (enum_declaration): Record enums as we parse them.
19675 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
19676 thanks to a call during the lookup process.
19678 2002-03-07 Miguel de Icaza <miguel@ximian.com>
19680 * statement.cs (Foreach): Lots of work to accomodate a particular
19681 kind of foreach statement that I had not kept in mind. It is
19682 possible to have foreachs on classes that provide a GetEnumerator
19683 method that return objects that implement the "pattern" for using
19684 a foreach, there is no need to support GetEnumerator
19687 This is needed to compile nant.
19689 * decl.cs: Only report 114 if the member is not `Finalize' and if
19690 the warning level is at least 2.
19692 * class.cs: Moved the compare function from Method to
19695 (MethodSignature.InheritableMemberSignatureCompare): Add new
19696 filter function that is used to extract inheritable methods from a
19699 (Method.Define): Use the new `inheritable_method_signature_filter'
19702 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19705 2002-03-06 Miguel de Icaza <miguel@ximian.com>
19707 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19709 * cs-parser.jay: Add opt_semicolon to the interface declaration.
19711 * expression.cs: Pass location information to
19712 ConvertImplicitStandard.
19714 * class.cs: Added debugging code to track return values from
19717 2002-03-05 Miguel de Icaza <miguel@ximian.com>
19719 * expression.cs (Is.DoResolve): If either side of the `is' is an
19720 interface, do not flag the warning.
19722 * ecore.cs (ImplicitReferenceConversion): We need a separate test
19725 * report.cs: Allow for --fatal to be used with --probe.
19727 * typemanager.cs (NoTypes): Move the definition for the empty Type
19730 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19732 (TypeContainer.DefineProxy): New function used to proxy to parent
19733 implementations when implementing interfaces.
19734 (TypeContainer.ParentImplements): used to lookup if our parent
19735 implements a public function that is required by an interface.
19736 (TypeContainer.VerifyPendingMethods): Hook this up.
19738 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19739 `modules' and `assemblies' arraylists into arrays. We only grow
19740 these are the very early start up of the program, so this improves
19741 the speedof LookupType (nicely measured).
19743 * expression.cs (MakeByteBlob): Replaced unsafe code with
19744 BitConverter, as suggested by Paolo.
19746 * cfold.cs (ConstantFold.Binary): Special case: perform constant
19747 folding of string concatenation, but if either side is a string,
19748 and the other is not, then return null, and let the runtime use
19749 the concatenation on the string plus the object (using
19750 `Object.ToString').
19752 2002-03-04 Miguel de Icaza <miguel@ximian.com>
19754 Constant Folding has been implemented now.
19756 * expression.cs (Unary.Reduce): Do not throw an exception, catch
19757 the error instead on types that are not supported in one's
19760 * constant.cs (Constant and all children): New set of functions to
19761 perform implict and explicit conversions.
19763 * ecore.cs (EnumConstant): Implement the new functions to perform
19764 conversion by proxying to the child expression.
19766 * codegen.cs: (ConstantCheckState): Constant evaluation has its
19767 own separate setting that can not be turned off from the command
19768 line using --unchecked or --checked and is only controlled using
19769 the checked/unchecked statements and expressions. This setting is
19770 used by the constant folder to flag errors.
19772 * expression.cs (CheckedExpr, UncheckedExpr): Set the
19773 ConstantCheckState as well.
19775 During Resolve, they also have to flag the state, because the
19776 constant folder runs completely in the Resolve phase.
19778 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19781 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19783 * cfold.cs: New file, this file contains the constant folder.
19785 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19786 argument to track whether we are using the resulting address to
19787 load or store a value and provide better error messages.
19789 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19790 new AddressOf arguments.
19792 * statement.cs (Foreach.EmitCollectionForeach): Update
19794 * expression.cs (Argument.Emit): Call AddressOf with proper
19795 arguments to track usage.
19797 (New.DoEmit): Call AddressOf with new arguments.
19799 (Unary.Emit): Adjust AddressOf call.
19801 2002-03-01 Ravi Pratap <ravi@ximian.com>
19803 * cs-parser.jay (member_access): Change the case for pre-defined types
19804 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
19807 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19810 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19811 essentially like methods and apply attributes like MethodImplOptions to them too.
19813 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19816 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19817 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19820 * Update code everywhere accordingly.
19822 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19824 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19826 2002-02-28 Ravi Pratap <ravi@ximian.com>
19828 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19829 try performing lookups against those instead of jumping straight into using
19830 the 'using' clauses.
19832 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19834 (LookupType): Perform lookups in implicit parents too.
19836 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19837 sequence as RootContext.LookupType.
19839 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
19840 the various cases of namespace lookups into this method.
19842 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19844 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19845 in positional arguments)
19847 * class.cs (Operator): Update the AllowedModifiers to contain
19850 * cs-parser.jay: Update operator declaration to allow for the
19851 operator body to be empty.
19853 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19856 2002-02-27 Miguel de Icaza <miguel@ximian.com>
19858 * class.cs (Method.Emit): Label parameters.
19860 * driver.cs: Return 1 or 0 as the program exit code.
19862 2002-02-26 Miguel de Icaza <miguel@ximian.com>
19864 * expression.cs: Special case the `null' object when trying to
19865 auto-compute the type, as anything can be explicitly converted to
19868 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19869 spotting this Paolo.
19871 (Expression.ImplicitNumericConversion): Perform comparissions of
19872 the type using the underlying type in the case of an enumeration
19873 rather than using the enumeration type for the compare.
19875 Cope with the underlying == type case, which is not possible to
19878 (Expression.ConvertNumericExplicit): Perform comparissions of
19879 the type using the underlying type in the case of an enumeration
19880 rather than using the enumeration type for the compare.
19882 * driver.cs: If the user does not supply an extension, assume .exe
19884 * cs-parser.jay (if_statement): Rewrote so that we can track the
19885 location for the if statement.
19887 * expression.cs (Binary.ConstantFold): Only concat strings when
19888 the operation is "+", not everything ;-)
19890 * statement.cs (Statement.EmitBoolExpression): Take a location
19892 (If, While, Do): Track location.
19894 * expression.cs (Binary.ResolveOperator): In the object + string
19895 case, I was missing a call to ConvertImplicit
19897 2002-02-25 Ravi Pratap <ravi@ximian.com>
19899 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19900 Location arguments. Ensure we use RootContext.LookupType to do our work
19901 and not try to do a direct Type.GetType and ModuleBuilder.GetType
19903 * interface.cs (PopulateMethod): Handle the type of the parameter being
19906 * expression.cs (Invocation.BetterFunction): Handle the case when we
19907 have a params method with no fixed arguments and a call is made with no
19910 2002-02-25 Miguel de Icaza <miguel@ximian.com>
19912 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19913 the verbatim-string-literal
19915 * support.cs (InternalParameters.ParameterModifier): handle null
19917 (InternalParameters.ParameterType): ditto.
19919 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19920 duplicating the name of the variable parameter.
19921 (GetParameterByName): Fix bug where we were not looking up array
19922 paramters if they were the only present (thanks Paolo!).
19923 (GetParameterInfo): We only have an empty set of types if both
19924 fixed and array are set to null.
19925 (GetParameterInfo-idx): Handle FixedParameter == null
19927 * cs-parser.jay: Handle the case where there is no catch
19928 statements (missing null test).
19930 2002-02-22 Miguel de Icaza <miguel@ximian.com>
19932 * driver.cs (MainDriver): Be conservative on our command line
19935 Catch DirectoryNotFoundException when calling GetFiles.
19937 (SplitPathAndPattern): Used to split the input specification into
19938 a path and a pattern that we can feed to Directory.GetFiles.
19940 2002-02-21 Miguel de Icaza <miguel@ximian.com>
19942 * statement.cs (Fixed): Implement the last case of the Fixed
19943 statement (string handling).
19945 * expression.cs (StringPtr): New class used to return a char * to
19946 a string; Used by the Fixed statement.
19948 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
19950 * expression.cs (Binary.ResolveOperator): Remove redundant
19951 MemberLookup pn parent type.
19952 Optimize union call, we do not need a union if the types are the same.
19953 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19956 Specialize the use of MemberLookup everywhere, instead of using
19957 the default settings.
19959 (StackAlloc): Implement stackalloc keyword.
19961 * cs-parser.jay: Add rule to parse stackalloc.
19963 * driver.cs: Handle /h, /help, /?
19965 * expression.cs (MakeByteBlob): Removed the hacks we had in place
19966 before we supported unsafe code.
19968 * makefile: add --unsafe to the self compilation of mcs.
19970 2002-02-20 Miguel de Icaza <miguel@ximian.com>
19972 * expression.cs (PointerArithmetic): New class that is used to
19973 perform pointer arithmetic.
19974 (Binary.Resolve): Handle pointer arithmetic
19975 Handle pointer comparission.
19976 (ArrayPtr): Utility expression class that is used to take the
19977 address of an array.
19979 (ElementAccess): Implement array access for pointers
19981 * statement.cs (Fixed): Implement fixed statement for arrays, we
19982 are missing one more case before we are done.
19984 * expression.cs (Indirection): Implement EmitAssign and set the
19985 ExprClass to Variable. This allows pointer dereferences to be
19986 treated as variables, and to have values assigned to them.
19988 * ecore.cs (Expression.StoreFromPtr): New utility function to
19989 store values dereferencing.
19991 2002-02-20 Ravi Pratap <ravi@ximian.com>
19993 * expression.cs (Binary.ResolveOperator): Ensure that we are
19994 not trying to operate on a void type - this fixes the reported
19997 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19998 the parent implementation is sealed.
20000 * ../errors/cs0239.cs : Add.
20002 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20004 * typemanager.cs (unverifiable_code_type): Corresponds to
20005 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20006 which have unsafe code in them.
20008 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
20011 2002-02-19 Miguel de Icaza <miguel@ximian.com>
20013 * cs-tokenizer.cs: Add support for @"litreal strings"
20015 Make tokenizer accept pre-processor directives
20016 on any column (remove the old C-like limitation).
20018 * rootcontext.cs (EmitCode): Emit any global attributes.
20019 (AddGlobalAttributes): Used to keep track of assembly attributes.
20021 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20023 * cs-parser.jay: Add support for global attributes.
20025 2002-02-17 Miguel de Icaza <miguel@ximian.com>
20027 * expression.cs (Indirection): New helper class. Unary will
20028 create Indirection classes to be able to implement the
20029 IMemoryLocation interface on it.
20031 2002-02-16 Miguel de Icaza <miguel@ximian.com>
20033 * cs-parser.jay (fixed_statement): reference the right statement.
20035 * statement.cs (Fixed.Emit): Finish implementing the fixed
20036 statement for the &x case.
20038 2002-02-14 Miguel de Icaza <miguel@ximian.com>
20040 * class.cs (Property.Define, Method.Define): Remove newslot when
20043 * modifiers.cs: My use of NewSlot when `Abstract' was set was
20044 wrong. NewSlot should only be used if the `new' keyword is present.
20046 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20047 locating our system dir. Sorry about this.
20049 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20051 * driver.cs (GetSystemDir): Compute correctly the location of our
20052 system assemblies. I was using the compiler directory instead of
20053 the library directory.
20055 2002-02-13 Ravi Pratap <ravi@ximian.com>
20057 * expression.cs (BetterFunction): Put back in what Miguel commented out
20058 since it is the correct fix. The problem is elsewhere ;-)
20060 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20061 parameters of the parms method are themselves compatible or not !
20063 (StandardConversionExists): Fix very dangerous bug where we were forgetting
20064 to check that a class implements an interface before saying that an implicit
20065 conversion was allowed. Use ImplementsInterface to do the checking.
20067 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20069 * class.cs (Method.Define): Track whether we are an explicit
20070 implementation or not. And only call DefineMethodOverride if we
20071 are an explicit implementation.
20073 (Property.DefineMethod): Ditto.
20075 2002-02-11 Ravi Pratap <ravi@ximian.com>
20077 * expression.cs (BetterFunction): Catch hideous bug which was
20078 preventing us from detecting ambiguous calls due to implicit casts i.e
20081 2002-01-29 Miguel de Icaza <miguel@ximian.com>
20083 * support.cs (Pair): Remove un-needed method. I figured why I was
20084 getting the error in cs-parser.jay, the variable in a foreach loop
20085 is readonly, and the compiler does not really treat this as a variable.
20087 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
20088 instead of EQUALS in grammar.
20090 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20092 * expression.cs (Unary.DoResolve): Check whether the argument is
20095 2002-01-28 Miguel de Icaza <miguel@ximian.com>
20097 * support.cs: Api for Pair to set a value. Despite the fact that
20098 the variables are public the MS C# compiler refuses to compile
20099 code that accesses the field if the variable is part of a foreach
20102 * statement.cs (Fixed): Begin implementation of the fixed
20105 (Block.AddVariable): Return the VariableInfo on success and null
20106 on failure instead of true/false.
20108 * cs-parser.jay (foreach): Catch errors on variables already
20109 defined (we were ignoring this value before) and properly unwind
20110 the block hierarchy
20112 (fixed_statement): grammar for the fixed statement.
20114 2002-01-25 Miguel de Icaza <miguel@ximian.com>
20116 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20117 pointer types to be incretemented.
20119 (SizeOf): Implement.
20121 * cs-parser.jay (pointer_member_access): Implement
20122 expr->IDENTIFIER production.
20124 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20125 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20128 (Unary): Implement indirection.
20130 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20131 use in non-unsafe context).
20133 (SimpleName.DoResolve): Check for pointers in field access on safe
20136 (Expression.LoadFromPtr): Factor the load-indirect code in this
20137 function. This was duplicated in UnboxCast and ParameterReference
20139 2002-01-24 Miguel de Icaza <miguel@ximian.com>
20141 * expression.cs (ComposedCast): report an error if a pointer cast
20142 is used in a safe region.
20144 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20145 pointer type casts in unsafe context.
20147 * codegen.cs (EmitContext): Set up IsUnsafe.
20149 * cs-parser.jay (non_expression_type): Add productions for pointer
20152 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20153 code. We should not use force into static mode if the method is
20154 not virtual. Fixes bug in MIS
20156 * statement.cs (Do.Emit, While.Emit, For.Emit,
20157 Statement.EmitBoolExpression): Add support to Do and While to
20158 propagate infinite loop as `I do return' semantics.
20160 Improve the For case to also test for boolean constants.
20162 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20163 to the list of attributes we can add.
20165 Remove `EmitContext' argument.
20167 * class.cs (Method.Define): Apply parameter attributes.
20168 (Constructor.Define): Apply parameter attributes.
20169 (MethodCore.LabelParameters): Move here the core of labeling
20172 * support.cs (ReflectionParameters.ParameterModifier,
20173 InternalParameters.ParameterModifier): Use IsByRef on the type and
20174 only return the OUT bit for these parameters instead of in/out/ref
20177 This is because I miss-understood things. The ParameterInfo.IsIn
20178 and IsOut represent whether the parameter has the [In] and [Out]
20181 2002-01-22 Miguel de Icaza <miguel@ximian.com>
20183 * ecore.cs (FieldExpr.Emit): Release temporaries.
20185 * assign.cs (LocalTemporary.Release): new function.
20187 * codegen.cs (EmitContext.GetTemporaryStorage,
20188 EmitContext.FreeTemporaryStorage): Rework the way we deal with
20189 temporary storage. Now we can "put back" localbuilders when we
20192 2002-01-21 Miguel de Icaza <miguel@ximian.com>
20194 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20195 need to make a copy of the variable to generate verifiable code.
20197 2002-01-19 Miguel de Icaza <miguel@ximian.com>
20199 * driver.cs: Compute dynamically the system directory.
20201 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20202 Slower, but more generally useful. Used by the abstract
20203 registering implementation.
20205 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20206 the rules for the special rule on Type/instances. First check if
20207 we have the same name, and if so, try that special static path
20208 rather than the instance path.
20210 2002-01-18 Miguel de Icaza <miguel@ximian.com>
20212 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20215 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20216 Enum, ValueType, Delegate or Array for non-corlib compiles.
20218 * cs-tokenizer.cs: Catch long identifiers (645)
20220 * typemanager.cs (IndexerPropetyName): Ravi never tested this
20223 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20224 fix, we were returning too early, so we were not registering
20225 pending methods from abstract classes.
20227 Do not register pending methods if the class is abstract.
20229 * expression.cs (Conditional.DoResolve): Report circular implicit
20230 conversions when we neecd to compute it for conditional
20233 (Is.DoResolve): If the expression is always of the provided type,
20234 flag warning 183. If the expression can not ever be of the
20235 provided type flag warning 184.
20237 * class.cs: Catch 169 as well.
20239 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20242 2002-01-18 Nick Drochak <ndrochak@gol.com>
20244 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
20246 2002-01-17 Miguel de Icaza <miguel@ximian.com>
20248 * interface.cs: (PopulateMethod): Check for pointers being defined
20249 only if the unsafe context is active.
20250 (PopulateProperty): ditto.
20251 (PopulateIndexer): ditto.
20253 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20254 specified. If pointers are present, make sure that they are
20255 present in an unsafe context.
20256 (Constructor, Constructor.Define): ditto.
20257 (Field, Field.Define): ditto.
20258 (Property, Property.Define): ditto.
20259 (Event, Event.Define): ditto.
20261 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20262 hashtable if there are classes or structs defined.
20264 * expression.cs (LocalVariableReference.DoResolve): Simplify this
20265 code, as the constant resolution moved.
20267 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20268 the metadata, so we can flag error 133.
20270 * decl.cs (MemberCore.UnsafeOK): New function to test that a
20271 pointer is being declared in an unsafe context.
20273 2002-01-16 Miguel de Icaza <miguel@ximian.com>
20275 * modifiers.cs (Modifiers.Check): Require a Location argument.
20276 Report error 227 for Unsafe use.
20278 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20280 * statement.cs (For.Emit): If the test is null, then report that
20281 we do `return', as we wont reach anything afterwards.
20283 (Switch.SwitchGoverningType): Track the expression that matched
20286 * driver.cs: Allow negative numbers as an error code to flag.
20288 * cs-parser.jay: Handle 1551.
20290 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20292 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20294 * cs-parser.jay: Report 1518 (type declaration can only contain
20295 class, struct, interface, enum or delegate)
20297 (switch_label): Report 1523 (keywords `case' or `default' must
20300 (opt_switch_sections): Report 1522 (empty switch)
20302 * driver.cs: Report 1515 (response file specified multiple times)
20303 Report 1516 (Source file specified multiple times).
20305 * expression.cs (Argument.Resolve): Signal 1510
20307 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20308 access not allowed in static code)
20310 2002-01-11 Ravi Pratap <ravi@ximian.com>
20312 * typemanager.cs (IsPointerType): Utility method which we are going
20315 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20316 the object type, so we take care of that.
20318 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20320 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20321 added to non-params parameters :-)
20323 * typemanager.cs (CSharpName): Include 'void' type too.
20325 (void_ptr_type): Include in the set of core types.
20327 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
20330 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
20333 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
20334 completely forgotten about it.
20336 2002-01-10 Ravi Pratap <ravi@ximian.com>
20338 * cs-parser.jay (pointer_type): Add. This begins our implementation
20339 of parsing rules for unsafe code.
20341 (unsafe_statement): Implement.
20343 (embedded_statement): Modify to include the above.
20345 * statement.cs (Unsafe): Implement new class for unsafe blocks.
20347 * codegen.cs (EmitContext.InUnsafe): Add. This determines
20348 if the current context is an unsafe one.
20350 * cs-parser.jay (local_variable_pointer_type): Since local variable types
20351 are handled differently, we need separate rules for them.
20353 (local_variable_declaration): Update to use local_variable_pointer_type
20354 to allow variable declarations of unmanaged pointer types.
20356 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20357 in unsafe contexts.
20359 * ../errors/cs0214.cs : Add.
20361 2002-01-16 Nick Drochak <ndrochak@gol.com>
20363 * makefile: remove 'response' file when cleaning.
20365 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20367 * cs-parser.jay: Report 1524.
20369 2002-01-14 Miguel de Icaza <miguel@ximian.com>
20371 * typemanager.cs (RegisterMethod): drop checking if we have
20372 registered this from here
20374 2002-01-12 Miguel de Icaza <miguel@ximian.com>
20376 * class.cs (Method.EmitDestructor): Implement calling our base
20379 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20380 value of InFinally.
20382 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20383 this routine and will wrap the call in a try/catch block. Deal
20386 2002-01-11 Miguel de Icaza <miguel@ximian.com>
20388 * ecore.cs (Expression.MemberLookup): instead of taking a
20389 parameter `same_type' that was used to tell whether we could
20390 access private members we compute our containing type from the
20393 (FieldExpr): Added partial support for volatile fields. This does
20394 not work for volatile fields exposed from assemblies, as I can not
20395 figure out how to extract the modreq from it.
20397 Updated all the source files to use this.
20399 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20400 because it is referenced by MemberLookup very often.
20402 2002-01-09 Ravi Pratap <ravi@ximian.com>
20404 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20405 TypeBuilder.GetCustomAttributes to retrieve what we need.
20407 Get rid of redundant default_member_attr_type as this is the same as
20408 default_member_type which already exists.
20410 * interface.cs, attribute.cs : Update accordingly.
20412 2002-01-08 Miguel de Icaza <miguel@ximian.com>
20414 * typemanager.cs: Enable IndexerPropertyName again. It does not
20415 work for TYpeBuilders though. Ravi, can you please fix this?
20417 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20419 * expression.cs (Argument.Emit): Handle the case of ref objects
20420 being passed to ref functions;
20422 (ParameterReference.EmitLoad): Loads the content of the pointer
20423 without dereferencing.
20425 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20427 * cs-tokenizer.cs: Implemented the pre-processing expressions.
20429 2002-01-08 Ravi Pratap <ravi@ximian.com>
20431 * class.cs (Indexer.DefineMethod): Incorporate the interface
20432 type in the name of the method if we are doing explicit interface
20435 * expression.cs (ConversionExists): Remove as it is completely obsolete.
20437 (BetterConversion): Fix extremely trivial bug where we were referring to
20438 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20441 * ../errors/bug16.cs : Add although we have fixed it.
20443 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20445 * expression.cs (BaseIndexer): Begin implementation.
20447 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20449 * cs-parser.jay (indexer_declarator): Use qualified_identifier
20450 production directly to remove a shift/reduce, and implement
20451 explicit interface implementation.
20453 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20454 after a floating point suffix.
20456 * expression.cs (DoNumericPromotions): Improved the conversion for
20457 uint/uint. If we have a constant, we avoid doing a typecast to a
20460 * class.cs (Indexer): Implement explicit interface implementation
20463 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20465 * class.cs: make the default instance constructor public and hidebysig.
20467 2001-01-03 Ravi Pratap <ravi@ximian.com>
20469 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20470 so we can call it from elsewhere.
20472 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20473 we emit it internally if the class has a defined indexer; otherwise the user
20474 emits it by decorating the class definition with the DefaultMemberAttribute.
20476 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20477 attribute is not used on a type which defines an indexer.
20479 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20480 character when we skip whitespace.
20482 * ../errors/cs0646.cs : Add.
20484 2002-01-03 Miguel de Icaza <miguel@ximian.com>
20486 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20489 * makefile: Add practical target `mcs3.exe' which builds the third
20490 generation compiler.
20492 * expression.cs (New): Fix structures constructor calling.
20494 * class.cs (Property, Method, Indexer): Emit Final flag on the
20495 method if we are an interface implementation and we are not
20498 * ecore.cs (PropertyExpr): New public field `IsBase', tells
20499 whether this property is referencing a `base' method.
20501 * expression.cs (Invocation.EmitCall): take an extra argument:
20502 is_base, this is used to determine whether the `call' or
20503 `callvirt' opcode should be used.
20506 * delegate.cs: update EmitCall.
20508 * class.cs (Method.Define): Set NewSlot for the cases where we are
20509 not implementing an interface method.
20511 (Property.Define): ditto.
20513 2002-01-02 Miguel de Icaza <miguel@ximian.com>
20515 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20516 'r'. Allows mcs to parse itself fully.
20518 2002-01-02 Ravi Pratap <ravi@ximian.com>
20520 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20521 of the number of initializers that require the InitializeArray method.
20523 (CheckIndices): Store the Expression in all cases - not the plain value. Also
20524 update the above field where necessary.
20526 (MakeByteBlob): Update accordingly.
20528 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
20531 (EmitDynamicInitializers): Update in accordance with the new optimization.
20533 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20534 same OpCode applies.
20536 * cs-parser.jay : Fix some glaring errors I introduced.
20538 2002-01-01 Ravi Pratap <ravi@ximian.com>
20540 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20541 so that we can check for name clashes there too.
20543 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20544 for interface indexers.
20546 * interfaces.cs (Define): Emit the default member attribute.
20548 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20549 variable was being referred to while setting the value ;-)
20551 2002-01-01 Miguel de Icaza <miguel@ximian.com>
20553 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20554 byte-by-byte information when we know the data is zero.
20556 Make the block always a multiple of 4, because
20557 DefineInitializedData has a bug.
20559 * assign.cs: Fix, we should assign from the temporary, not from
20562 * expression.cs (MakeByteBlob): Fix my incorrect code.
20564 2001-12-31 Miguel de Icaza <miguel@ximian.com>
20566 * typemanager.cs (EnumToUnderlying): This function is used to get
20567 the underlying type from an enumeration, because it does not
20570 * constant.cs: Use the I4_S form for values between -128 and 127.
20572 * statement.cs (Block.LookupLabel): Looks up a label.
20573 (Block): Drop support for labeled blocks.
20575 (LabeledStatement): New kind of statement that represents a label
20578 (Goto): Finally implement this bad boy.
20580 * cs-parser.jay: Update to reflect new mechanism to implement
20583 2001-12-30 Miguel de Icaza <miguel@ximian.com>
20585 * codegen.cs (EmitContext.This): a codegen property that keeps the
20586 a single instance of this instead of creating many different this
20589 * delegate.cs (Delegate.DoResolve): Update to use the property;
20591 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20593 * expression.cs (BaseAccess.DoResolve): Ditto.
20595 2001-12-29 Ravi Pratap <ravi@ximian.com>
20597 * typemanager.cs (methodimpl_attr_type): Add to hold the type
20598 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20600 (InitCoreTypes): Update accordingly.
20602 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20603 so we can quickly store the state.
20605 (ApplyAttributes): Set the correct implementation flags
20606 for InternalCall methods.
20608 2001-12-29 Miguel de Icaza <miguel@ximian.com>
20610 * expression.cs (EmitCall): if a method is not virtual, then do
20611 not use callvirt on it.
20613 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20614 user defined stuff) requires the use of stobj, which takes an
20615 address on the stack instead of an array and an index. So emit
20616 the Ldelema operation for it.
20618 (EmitStoreOpcode): Use stobj for valuetypes.
20620 (UnaryMutator.EmitCode): Use the right 1 value depending on
20621 whether we are dealing with int64/uint64, float or doubles.
20623 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20624 constructors that I implemented last night.
20626 (Constructor.IsDefault): Fix to work properly for static
20629 * cs-parser.jay (CheckDef): report method signature errors.
20630 Update error number 103 to be 132.
20632 * decl.cs: New AdditionResult enumeration value: MethodExists.
20633 Although we do this check for methods later on in the semantic
20634 analysis, catching repeated default constructors is so easy that
20635 we catch these here.
20637 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20640 (ParameterReference.EmitAssign, Emit): handle
20643 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20644 (ArrayAccess.EmitStoreOpcode): ditto.
20646 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20648 * expression.cs (MakeByteBlob): Complete all the missing types
20649 (uint, short, ushort, byte, sbyte)
20651 * class.cs: Only init instance field initializers on instance
20654 Rename `constructors' to instance_constructors.
20656 (TypeContainer.AddConstructor): Only add constructors to the list
20657 if it is not static.
20659 Make sure that we handle default_static_constructor independently
20660 everywhere where we handle instance_constructors
20662 2001-12-28 Miguel de Icaza <miguel@ximian.com>
20664 * class.cs: Do not lookup or create a base initializer for a
20665 static constructor.
20667 (ConstructorInitializer.Resolve): use the proper type to lookup
20670 * cs-parser.jay: Report error 1585 (modifiers between type and name).
20672 * enum.cs, interface.cs: Remove CloseType, this is taken care by
20675 * decl.cs: CloseType is now an virtual method, the default
20676 implementation just closes this type.
20678 2001-12-28 Ravi Pratap <ravi@ximian.com>
20680 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20681 to PreserveSig by default. Also emit HideBySig on such methods.
20683 Basically, set the defaults to standard values.
20685 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20686 argument, if candidate is better, it can't be worse than the best !
20688 (Invocation): Re-write bits to differentiate between methods being
20689 applicable in their expanded form and their normal form - for params
20692 Get rid of use_standard everywhere as only standard conversions are allowed
20693 in overload resolution.
20695 More spec conformance.
20697 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20699 * driver.cs: Add --timestamp, to see where the compiler spends
20702 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20703 `this' in static code.
20705 (SimpleName.DoResolve): Implement in terms of a helper function
20706 that allows static-references to be passed upstream to
20709 (Expression.ResolveWithSimpleName): Resolve specially simple
20710 names when called by MemberAccess to implement the special
20713 (Expression.ImplicitReferenceConversion): Handle conversions from
20714 Null to reference types before others, as Null's type is
20717 * expression.cs (Invocation.EmitCall): Handle the special case of
20718 calling methods declared on a reference type from a ValueType
20719 (Base classes System.Object and System.Enum)
20721 (MemberAccess.Resolve): Only perform lookups on Enumerations if
20722 the left hand side is a TypeExpr, not on every enumeration.
20724 (Binary.Resolve): If types are reference types, then do a cast to
20725 object on operators != and == of both arguments.
20727 * typemanager.cs (FindMembers): Extract instance and static
20728 members if requested.
20730 * interface.cs (PopulateProperty): Use void_type instead of null
20731 as the return type for the setter method.
20733 (PopulateIndexer): ditto.
20735 2001-12-27 Ravi Pratap <ravi@ximian.com>
20737 * support.cs (ReflectionParameters): Fix minor bug where we
20738 were examining the wrong parameter for the ParamArray attribute.
20740 Cope with requests for the type of the parameter at position
20741 greater than the params parameter's. We now return the element
20742 type of the params array as that makes more sense.
20744 * expression.cs (Invocation.IsParamsMethodApplicable): Update
20745 accordingly as we no longer have to extract the element type
20748 (Invocation.OverloadResolve): Update.
20750 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20752 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20753 against IEnumerator, test whether the return value is a descendant
20754 of the IEnumerator interface.
20756 * class.cs (Indexer.Define): Use an auxiliary method to implement
20757 the other bits of the method definition. Begin support for
20758 explicit interface implementation.
20760 (Property.DefineMethod): Use TypeManager.void_type instead of null
20761 for an empty return value.
20763 2001-12-26 Miguel de Icaza <miguel@ximian.com>
20765 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20766 dealing with a FieldExpr which is composed of a FieldBuilder, in
20767 the code path we did extract the constant, but we should have
20768 obtained the underlying value to be able to cast it (otherwise we
20769 end up in an infinite loop, this is what Ravi was running into).
20771 (ArrayCreation.UpdateIndices): Arrays might be empty.
20773 (MemberAccess.ResolveMemberAccess): Add support for section
20774 14.5.4.1 that deals with the special case of E.I when E is a type
20775 and something else, that I can be a reference to a static member.
20777 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20778 handle a particular array type to create byte blobs, it is just
20779 something we dont generate byteblobs for.
20781 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20784 * location.cs (Push): remove the key from the hashtable that we
20785 are about to add. This happens for empty files.
20787 * driver.cs: Dispose files after we have parsed them.
20789 (tokenize): new function that only runs the tokenizer on its
20790 input, for speed testing.
20792 2001-12-26 Ravi Pratap <ravi@ximian.com>
20794 * class.cs (Event.Define): Define the private field only if there
20795 are no accessors defined.
20797 * expression.cs (ResolveMemberAccess): If there is no associated
20798 field with the event, that means we have an event defined with its
20799 own accessors and we should flag error cs0070 since transforming
20800 ourselves into a field is not valid in that case.
20802 * ecore.cs (SimpleName.DoResolve): Same as above.
20804 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20805 and charset to sane values.
20807 2001-12-25 Ravi Pratap <ravi@ximian.com>
20809 * assign.cs (DoResolve): Perform check on events only if they
20810 are being accessed outside the declaring type.
20812 * cs-parser.jay (event_declarations): Update rules to correctly
20813 set the type of the implicit parameter etc.
20815 (add_accessor, remove_accessor): Set current local parameters.
20817 * expression.cs (Binary): For delegate addition and subtraction,
20818 cast the return value from the method into the appropriate delegate
20821 2001-12-24 Ravi Pratap <ravi@ximian.com>
20823 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20824 of these as the workaround is unnecessary.
20826 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20827 delegate data - none of that is needed at all.
20829 Re-write bits to extract the instance expression and the delegate method
20832 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
20835 * attribute.cs (ApplyAttributes): New method to take care of common tasks
20836 of attaching attributes instead of duplicating code everywhere.
20838 * everywhere : Update code to do attribute emission using the above method.
20840 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20842 * expression.cs (IsParamsMethodApplicable): if there are not
20843 parameters, return immediately.
20845 * ecore.cs: The 0 literal can be implicity converted to an enum
20848 (SimpleName.DoResolve): First lookup the type, then lookup the
20851 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20852 want to get its address. If the InstanceExpression is not
20853 addressable, store the result in a temporary variable, then get
20856 * codegen.cs: Only display 219 errors on warning level or above.
20858 * expression.cs (ArrayAccess): Make it implement the
20859 IMemoryLocation interface.
20861 (Binary.DoResolve): handle the operator == (object a, object b)
20862 and operator != (object a, object b) without incurring into a
20863 BoxedCast (because 5 != o should never be performed).
20865 Handle binary enumerator operators.
20867 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20868 value type, otherwise use Ldelem_ref.
20870 Use precomputed names;
20872 (AddressOf): Implement address of
20874 * cs-parser.jay (labeled_statement): Fix recursive block
20875 addition by reworking the production.
20877 * expression.cs (New.DoEmit): New has a special case:
20879 If we are dealing with a ValueType, we have a few
20880 situations to deal with:
20882 * The target of New is a ValueType variable, that is
20883 easy, we just pass this as the variable reference
20885 * The target of New is being passed as an argument,
20886 to a boxing operation or a function that takes a
20889 In this case, we need to create a temporary variable
20890 that is the argument of New.
20893 2001-12-23 Ravi Pratap <ravi@ximian.com>
20895 * rootcontext.cs (LookupType): Check that current_type is not null before
20896 going about looking at nested types.
20898 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20899 not implement the IAssignMethod interface any more.
20901 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20902 where we tranform them into FieldExprs if they are being resolved from within
20903 the declaring type.
20905 * ecore.cs (SimpleName.DoResolve): Do the same here.
20907 * assign.cs (DoResolve, Emit): Clean up code considerably.
20909 * ../errors/bug10.cs : Add.
20911 * ../errors/cs0070.cs : Add.
20913 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20915 * assign.cs : Get rid of EventIsLocal everywhere.
20917 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20919 * ecore.cs (ConvertIntLiteral): finished the implementation.
20921 * statement.cs (SwitchLabel): Convert the value we are using as a
20922 key before looking up the table.
20924 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20926 * codegen.cs (EmitTopBlock): Require a Location argument now.
20928 * cs-parser.jay (constructor_declarator): We need to setup
20929 current_local_parameters before we parse the
20930 opt_constructor_initializer, to allow the variables to be bound
20931 to the constructor arguments.
20933 * rootcontext.cs (LookupType): First lookup nested classes in our
20934 class and our parents before we go looking outside our class.
20936 * expression.cs (ConstantFold): Extract/debox the values at the
20939 * rootcontext.cs (EmitCode): Resolve the constants first before we
20940 resolve the types. This is not really needed, but it helps debugging.
20942 * statement.cs: report location.
20944 * cs-parser.jay: pass location to throw statement.
20946 * driver.cs: Small bug fix.
20948 * report.cs: Updated format to be 4-zero filled digits.
20950 2001-12-22 Ravi Pratap <ravi@ximian.com>
20952 * expression.cs (CheckIndices): Fix minor bug where the wrong
20953 variable was being referred to ;-)
20955 (DoEmit): Do not call EmitStaticInitializers when the
20956 underlying type is System.Object.
20958 2001-12-21 Ravi Pratap <ravi@ximian.com>
20960 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20961 and do the usual workaround for SRE.
20963 * class.cs (MyEventBuilder.EventType): New member to get at the type
20964 of the event, quickly.
20966 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20968 * assign.cs (Assign.DoResolve): Handle the case when the target
20969 is an EventExpr and perform the necessary checks.
20971 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20974 (SimpleName.MemberStaticCheck): Include check for EventExpr.
20976 (EventExpr): Set the type in the constructor itself since we
20977 are meant to be born fully resolved.
20979 (EventExpr.Define): Revert code I wrote earlier.
20981 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20982 instance expression is null. The instance expression is a This in that case
20983 or a null, depending on whether it is a static method or not.
20985 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20986 refers to more than one method.
20988 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20989 and accordingly flag errors.
20991 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20993 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20995 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20997 * location.cs (ToString): Provide useful rutine.
20999 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21001 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21002 objects, return the actual integral boxed.
21004 * statement.cs (SwitchLabel): define an ILLabel for each
21007 (Switch.CheckSwitch): If the value is a Literal, extract
21008 the underlying literal.
21010 Also in the unused hashtable we had, add the SwitchLabel so we can
21011 quickly look this value up.
21013 * constant.cs: Implement a bunch of new constants. Rewrite
21014 Literal based on this. Made changes everywhere to adapt to this.
21016 * expression.cs (Expression.MakeByteBlob): Optimize routine by
21017 dereferencing array only once, and also copes with enumrations.
21019 bytes are two bytes wide, not one.
21021 (Cast): Perform constant conversions.
21023 * ecore.cs (TryImplicitIntConversion): Return literals instead of
21024 wrappers to the literals here.
21026 * expression.cs (DoNumericPromotions): long literals can converted
21027 to ulong implicity (this is taken care of elsewhere, but I was
21028 missing this spot).
21030 * ecore.cs (Expression.Literalize): Make the return type Literal,
21031 to improve type checking.
21033 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21035 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21037 * literal.cs: Revert code from ravi that checked the bounds. The
21038 bounds are sane by the definition of the type itself.
21040 * typemanager.cs: Fix implementation of ImplementsInterface. We
21041 need to actually look up in our parent hierarchy for interfaces
21044 * const.cs: Use the underlying type for enumerations
21046 * delegate.cs: Compute the basename for the delegate creation,
21047 that should fix the delegate test case, and restore the correct
21048 Type Lookup semantics in rootcontext
21050 * rootcontext.cs: Revert Ravi's last patch. The correct way of
21051 referencing a nested type with the Reflection API is using the "+"
21054 * cs-parser.jay: Do not require EOF token at the end.
21056 2001-12-20 Ravi Pratap <ravi@ximian.com>
21058 * rootcontext.cs (LookupType): Concatenate type names with
21059 a '.' instead of a '+' The test suite passes again.
21061 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21062 field of the enumeration.
21064 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21065 the case when the member is an EventExpr.
21067 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21068 static has an associated instance expression.
21070 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21072 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21074 * class.cs (Event.Define): Register event and perform appropriate checks
21077 We define the Add and Remove methods even if the use provides none because
21078 in that case, we provide default implementations ourselves.
21080 Define a private field of the type of the event. This is done by the CSC compiler
21081 and we should be doing it too ;-)
21083 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21084 More methods we use in code we generate.
21086 (multicast_delegate_type, delegate_type): Two separate types since the distinction
21089 (InitCoreTypes): Update accordingly for the above.
21091 * class.cs (Event.Emit): Generate code for default accessors that we provide
21093 (EmitDefaultMethod): Do the job in the above.
21095 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
21098 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21100 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21101 builders even if we were missing one.
21103 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21104 pass the Basename as our class name instead of the Name. The
21105 basename will be correctly composed for us.
21107 * parameter.cs (Paramters): Now takes a Location argument.
21109 * decl.cs (DeclSpace.LookupType): Removed convenience function and
21110 make all the code call directly LookupType in RootContext and take
21111 this chance to pass the Location information everywhere.
21113 * Everywhere: pass Location information.
21115 2001-12-19 Miguel de Icaza <miguel@ximian.com>
21117 * class.cs (Constructor.Define): Updated way of detecting the
21118 length of the parameters.
21120 (TypeContainer.DefineType): Use basename as the type name for
21123 (TypeContainer.Define): Do not recursively define types here, as
21124 definition is taken care in order by the RootContext.
21126 * tree.cs: Keep track of namespaces in a per-file basis.
21128 * parameter.cs (Parameter.ComputeSignature): Update to use
21131 (Parameters.GetSignature): ditto.
21133 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21134 instead of a TypeContainer.
21136 (Interface.SemanticAnalysis): Use `this' instead of our parent to
21137 resolve names. Because we need to be resolve in our context, not
21140 * driver.cs: Implement response files.
21142 * class.cs (TypeContainer.DefineType): If we are defined, do not
21143 redefine ourselves.
21145 (Event.Emit): Emit the code for add/remove handlers.
21146 (Event.Define): Save the MethodBuilders for add/remove.
21148 * typemanager.cs: Use pair here too.
21150 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21151 DictionaryEntry requires the first argument to be non-null.
21153 (enum_declaration): Compute full name for registering the
21156 (delegate_declaration): Instead of using
21157 formal_parameter_list, use opt_formal_parameter_list as the list
21160 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21161 (EventParsing): New property that controls whether `add' and
21162 `remove' are returned as tokens or identifiers (for events);
21164 2001-12-19 Ravi Pratap <ravi@ximian.com>
21166 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21167 use MyEventBuilder only and let it wrap the real builder for us.
21169 (MyEventBuilder): Revamp constructor etc.
21171 Implement all operations that we perform on EventBuilder in precisely the same
21174 (FindMembers): Update to use the EventBuilder member.
21176 (Event.Emit): Update accordingly.
21178 2001-12-18 Ravi Pratap <ravi@ximian.com>
21180 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21181 by calling the appropriate methods.
21183 (GetCustomAttributes): Make stubs as they cannot possibly do anything
21186 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21188 2001-12-17 Ravi Pratap <ravi@ximian.com>
21190 * delegate.cs (Delegate.Populate): Check that the return type
21191 and various parameters types are indeed accessible.
21193 * class.cs (Constructor.Define): Same here.
21195 (Field.Define): Ditto.
21197 (Event.Define): Ditto.
21199 (Operator.Define): Check that the underlying Method defined itself
21200 correctly - so it's MethodBuilder should not be null.
21202 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21203 expression happens to be null.
21205 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21206 members but as of now we don't seem to be able to do anything really useful with it.
21208 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21209 not the EventBuilder.
21211 2001-12-18 Miguel de Icaza <miguel@ximian.com>
21213 * cs-tokenizer.cs: Add support for defines.
21214 Add support for #if, #elif, #else, #endif
21216 (eval_var): evaluates a variable.
21217 (eval): stubbed for evaluating functions.
21219 * cs-parser.jay: Pass the defines information
21221 * driver.cs: Add --define command line option.
21223 * decl.cs: Move MemberCore here.
21225 Make it the base class for DeclSpace. This allows us to catch and
21226 report 108 and 109 for everything now.
21228 * class.cs (TypeContainer.Define): Extract all the members
21229 before populating and emit the warning 108 (new keyword required
21230 to override) instead of having each member implement this.
21232 (MemberCore.Define): New abstract method, we will be using this in
21233 the warning reporting engine in Populate.
21235 (Operator.Define): Adjust to new MemberCore protocol.
21237 * const.cs (Const): This does not derive from Expression, it is a
21238 temporary object we use to create fields, it is a MemberCore.
21240 * class.cs (Method.Define): Allow the entry point to be in a
21243 * driver.cs: Rewrite the argument handler to clean it up a bit.
21245 * rootcontext.cs: Made it just an auxiliary namespace feature by
21246 making everything static.
21248 * driver.cs: Adapt code to use RootContext type name instead of
21251 * delegate.cs: Remove RootContext argument.
21253 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21256 * class.cs (Event.Define): The lookup can fail.
21258 * cs-tokenizer.cs: Begin implementation of pre-procesor.
21260 * expression.cs: Resolve the this instance before invoking the code.
21262 2001-12-17 Miguel de Icaza <miguel@ximian.com>
21264 * cs-parser.jay: Add a production in element_access that allows
21265 the thing to become a "type" reference. This way we can parse
21266 things like "(string [])" as a type.
21268 Note that this still does not handle the more complex rules of
21272 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
21274 * ecore.cs: (CopyNewMethods): new utility function used to
21275 assemble the list of methods from running FindMembers.
21277 (MemberLookup): Rework FindMembers so that
21279 2001-12-16 Miguel de Icaza <miguel@ximian.com>
21281 * class.cs (TypeContainer): Remove Delegates who fail to be
21284 * delegate.cs (Populate): Verify that we dont get null return
21285 values. TODO: Check for AsAccessible.
21287 * cs-parser.jay: Use basename to emit error 574 (destructor should
21288 have the same name as container class), not the full name.
21290 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21291 possible representation.
21293 Also implements integer type suffixes U and L.
21295 2001-12-15 Miguel de Icaza <miguel@ximian.com>
21297 * expression.cs (ArrayCreation.DoResolve): We need to do the
21298 argument resolution *always*.
21300 * decl.cs: Make this hold the namespace. Hold the root context as
21302 (LookupType): Move here.
21304 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21306 * location.cs (Row, Name): Fixed the code, it was always returning
21307 references to the first file.
21309 * interface.cs: Register properties defined through interfaces.
21311 * driver.cs: Add support for globbing on the command line
21313 * class.cs (Field): Make it derive from MemberCore as well.
21316 2001-12-15 Ravi Pratap <ravi@ximian.com>
21318 * class.cs (Event::Define): Check that the type of the event is a delegate
21319 type else flag error #66.
21321 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21324 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21325 values of EntryPoint, CharSet etc etc.
21327 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21329 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21330 be null and we should ignore this. I am not sure if this is really clean. Apparently,
21331 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21332 which needs this to do its work.
21334 * ../errors/cs0066.cs : Add.
21336 2001-12-14 Miguel de Icaza <miguel@ximian.com>
21338 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21341 * class.cs: (MethodSignature.MethodSignature): Removed hack that
21342 clears out the parameters field.
21343 (MemberSignatureCompare): Cleanup
21345 (MemberCore): New base class used to share code between MethodCore
21348 (RegisterRequiredImplementations) BindingFlags.Public requires
21349 either BindingFlags.Instace or Static. Use instance here.
21351 (Property): Refactored code to cope better with the full spec.
21353 * parameter.cs (GetParameterInfo): Return an empty array instead
21356 * class.cs (Property): Abstract or extern properties have no bodies.
21358 * parameter.cs (GetParameterInfo): return a zero-sized array.
21360 * class.cs (TypeContainer.MethodModifiersValid): Move all the
21361 method modifier validation to the typecontainer so we can reuse
21362 this on properties.
21364 (MethodCore.ParameterTypes): return an empty sized array of types.
21366 (Property.Define): Test property modifier validity.
21368 Add tests for sealed/override too.
21370 (Method.Emit): abstract or extern methods have no bodies.
21372 2001-12-14 Ravi Pratap <ravi@ximian.com>
21374 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21377 (Method::Define, ::Emit): Modify accordingly.
21379 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21381 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21383 * makefile: Pass in /unsafe.
21385 2001-12-13 Miguel de Icaza <miguel@ximian.com>
21387 * class.cs (MakeKey): Kill routine.
21389 * class.cs (TypeContainer.Define): Correctly define explicit
21390 method implementations (they require the full interface name plus
21393 * typemanager.cs: Deply the PtrHashtable here and stop using the
21394 lame keys. Things work so much better.
21396 This of course broke everyone who depended on `RegisterMethod' to
21397 do the `test for existance' test. This has to be done elsewhere.
21399 * support.cs (PtrHashtable): A hashtable that avoid comparing with
21400 the object stupid Equals method (because, that like fails all over
21401 the place). We still do not use it.
21403 * class.cs (TypeContainer.SetRequiredInterface,
21404 TypeContainer.RequireMethods): Killed these two routines and moved
21405 all the functionality to RegisterRequiredImplementations.
21407 (TypeContainer.RegisterRequiredImplementations): This routine now
21408 registers all the implementations required in an array for the
21409 interfaces and abstract methods. We use an array of structures
21410 which can be computed ahead of time to reduce memory usage and we
21411 also assume that lookups are cheap as most classes will not
21412 implement too many interfaces.
21414 We also avoid creating too many MethodSignatures.
21416 (TypeContainer.IsInterfaceMethod): Update and optionally does not
21417 clear the "pending" bit if we find that there are problems with
21420 (TypeContainer.VerifyPendingMethods): Update to report errors of
21421 methods that look like implementations but are not.
21423 (TypeContainer.Define): Add support for explicit interface method
21426 2001-12-12 Miguel de Icaza <miguel@ximian.com>
21428 * typemanager.cs: Keep track of the parameters here instead of
21429 being a feature of the TypeContainer.
21431 * class.cs: Drop the registration of parameters here, as
21432 InterfaceMethods are also interface declarations.
21434 * delegate.cs: Register methods with the TypeManager not only with
21435 the TypeContainer. This code was buggy.
21437 * interface.cs: Full registation here.
21439 2001-12-11 Miguel de Icaza <miguel@ximian.com>
21441 * expression.cs: Remove reducer for binary expressions, it can not
21444 * const.cs: Put here the code that used to go into constant.cs
21446 * constant.cs: Put here the code for constants, this is a new base
21447 class for Literals.
21449 * literal.cs: Make Literal derive from Constant.
21451 2001-12-09 Miguel de Icaza <miguel@ximian.com>
21453 * statement.cs (Return.Emit): Report error 157 if the user
21454 attempts to return from a finally block.
21456 (Return.Emit): Instead of emitting a return, jump to the end of
21459 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21460 LocalBuilder to store the result of the function. ReturnLabel is
21461 the target where we jump.
21464 2001-12-09 Radek Doulik <rodo@ximian.com>
21466 * cs-parser.jay: remember alias in current namespace
21468 * ecore.cs (SimpleName::DoResolve): use aliases for types or
21471 * class.cs (LookupAlias): lookup alias in my_namespace
21473 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21475 (LookupAlias): lookup alias in this and if needed in parent
21478 2001-12-08 Miguel de Icaza <miguel@ximian.com>
21482 * rootcontext.cs: (ModuleBuilder) Made static, first step into
21483 making things static. I need this to avoid passing the
21484 TypeContainer when calling ParameterType.
21486 * support.cs (InternalParameters.ParameterType): Remove ugly hack
21487 that did string manipulation to compute the type and then call
21488 GetType. Use Parameter.ParameterType instead.
21490 * cs-tokenizer.cs: Consume the suffix for floating values.
21492 * expression.cs (ParameterReference): figure out whether this is a
21493 reference parameter or not. Kill an extra variable by computing
21494 the arg_idx during emission.
21496 * parameter.cs (Parameters.GetParameterInfo): New overloaded
21497 function that returns whether a parameter is an out/ref value or not.
21499 (Parameter.ParameterType): The type of the parameter (base,
21500 without ref/out applied).
21502 (Parameter.Resolve): Perform resolution here.
21503 (Parameter.ExternalType): The full type (with ref/out applied).
21505 * statement.cs (Using.Emit, Using.EmitExpression): Implement
21506 support for expressions on the using statement.
21508 2001-12-07 Miguel de Icaza <miguel@ximian.com>
21510 * statement.cs (Using.EmitLocalVariableDecls): Split the
21511 localvariable handling of the using statement.
21513 (Block.EmitMeta): Keep track of variable count across blocks. We
21514 were reusing slots on separate branches of blocks.
21516 (Try.Emit): Emit the general code block, we were not emitting it.
21518 Check the type of the declaration to be an IDisposable or
21519 something that can be implicity converted to it.
21521 Emit conversions if required.
21523 * ecore.cs (EmptyExpression): New utility class.
21524 (Expression.ImplicitConversionExists): New utility function.
21526 2001-12-06 Miguel de Icaza <miguel@ximian.com>
21528 * statement.cs (Using): Implement.
21530 * expression.cs (LocalVariableReference): Support read only variables.
21532 * statement.cs: Remove the explicit emit for the Leave opcode.
21533 (VariableInfo): Add a readonly field.
21535 2001-12-05 Miguel de Icaza <miguel@ximian.com>
21537 * ecore.cs (ConvCast): new class used to encapsulate the various
21538 explicit integer conversions that works in both checked and
21539 unchecked contexts.
21541 (Expression.ConvertNumericExplicit): Use new ConvCast class to
21542 properly generate the overflow opcodes.
21544 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21546 * statement.cs: The correct type for the EmptyExpression is the
21547 element_type, not the variable type. Ravi pointed this out.
21549 2001-12-04 Ravi Pratap <ravi@ximian.com>
21551 * class.cs (Method::Define): Handle PInvoke methods specially
21552 by using DefinePInvokeMethod instead of the usual one.
21554 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21555 above to do the task of extracting information and defining the method.
21557 2001-12-04 Ravi Pratap <ravi@ximian.com>
21559 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21560 of the condition for string type.
21562 (Emit): Move that here.
21564 (ArrayCreation::CheckIndices): Keep string literals in their expression
21567 (EmitDynamicInitializers): Handle strings appropriately.
21569 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21571 * codegen.cs (EmitContext): Replace multiple variables with a
21572 single pointer to the current Switch statement.
21574 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21577 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21581 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21584 (Foreach.Emit): Foreach on arrays was not setting
21585 up the loop variables (for break/continue).
21587 (GotoCase): Semi-implented.
21589 2001-12-03 Ravi Pratap <ravi@ximian.com>
21591 * attribute.cs (CheckAttribute): Handle system attributes by using
21592 Attribute.GetAttributes to examine information we need.
21594 (GetValidPlaces): Same here.
21596 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21598 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21600 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21602 (Method::Define): Set appropriate flags if we have a DllImport attribute.
21604 (Method::Emit): Handle the case when we are a PInvoke method.
21606 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21608 * expression.cs: Use ResolveWithSimpleName on compound names.
21610 2001-12-02 Ravi Pratap <ravi@ximian.com>
21612 * constant.cs (EmitConstant): Make sure we resolve the associated expression
21613 before trying to reduce it.
21615 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21617 * constant.cs (LookupConstantValue): Implement.
21619 (EmitConstant): Use the above in emitting the constant.
21621 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21622 that are user-defined by doing a LookupConstantValue on them.
21624 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21627 2001-11-29 Miguel de Icaza <miguel@ximian.com>
21629 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21631 (BaseAccess.DoResolve): Implement.
21633 (MemberAccess.DoResolve): Split this routine into a
21634 ResolveMemberAccess routine that can be used independently
21636 2001-11-28 Miguel de Icaza <miguel@ximian.com>
21638 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21639 As that share bits of the implementation. Is returns a boolean,
21640 while As returns the Type that is being probed.
21642 2001-12-01 Ravi Pratap <ravi@ximian.com>
21644 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21645 instead of a Literal - much easier.
21647 (EnumInTransit): Remove - utterly useless :-)
21649 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21651 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21653 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21654 chain when we have no associated expression.
21656 2001-11-30 Ravi Pratap <ravi@ximian.com>
21658 * constant.cs (Define): Use Location while reporting the errror.
21660 Also emit a warning when 'new' is used and there is no inherited
21663 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
21666 (LookupEnumValue): Implement to lookup an enum member's value and define it
21669 (Populate): Re-write accordingly to use the above routine.
21671 2001-11-27 Miguel de Icaza <miguel@ximian.com>
21673 * expression.cs (This): Fix prototype for DoResolveLValue to
21674 override the base class DoResolveLValue.
21676 * cs-parser.cs: Report errors cs574 and cs575 (destructor
21679 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21680 (we need to load the address of the field here). This fixes
21683 (FieldExpr.DoResolveLValue): Call the DoResolve
21684 function to initialize the Instance expression.
21686 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21687 correctly the GetEnumerator operation on a value type.
21689 * cs-parser.jay: Add more simple parsing error catches.
21691 * statement.cs (Switch): Add support for string switches.
21692 Handle null specially.
21694 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
21696 2001-11-28 Ravi Pratap <ravi@ximian.com>
21698 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21700 (declare_local_constant): New helper function.
21702 * statement.cs (AddConstant): Keep a separate record of constants
21704 (IsConstant): Implement to determine if a variable is a constant.
21706 (GetConstantExpression): Implement.
21708 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21710 * statement.cs (IsVariableDefined): Re-write.
21712 2001-11-27 Ravi Pratap <ravi@ximian.com>
21714 * class.cs (TypeContainer::FindMembers): Look for constants
21715 in the case when we are looking for MemberTypes.Field
21717 * expression.cs (MemberAccess::DoResolve): Check that in the
21718 case we are a FieldExpr and a Literal, we are not being accessed
21719 by an instance reference.
21721 * cs-parser.jay (local_constant_declaration): Implement.
21723 (declaration_statement): Implement for constant declarations.
21725 2001-11-26 Miguel de Icaza <miguel@ximian.com>
21727 * statement.cs (Switch): Catch double defaults.
21729 (Switch): More work on the switch() statement
21730 implementation. It works for integral values now, need to finish
21734 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21736 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21737 integer literals into other integer literals. To be used by
21740 2001-11-24 Ravi Pratap <ravi@ximian.com>
21742 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21745 (EmitDynamicInitializers): Cope with the above since we extract data
21746 directly from ArrayData now.
21748 (ExpectInitializers): Keep track of whether initializers are mandatory
21751 (Bounds): Make it a hashtable to prevent the same dimension being
21752 recorded for every element in that dimension.
21754 (EmitDynamicInitializers): Fix bug which prevented the Set array method
21757 Also fix bug which was causing the indices to be emitted in the reverse
21760 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21762 * expression.cs (ArrayCreation): Implement the bits that Ravi left
21763 unfinished. They do not work, because the underlying code is
21766 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21768 * cs-parser.jay: Remove bogus fixme.
21770 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21771 on Switch statement.
21773 2001-11-23 Ravi Pratap <ravi@ximian.com>
21775 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21778 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21779 parameter. Apparently, any expression is allowed.
21781 (ValidateInitializers): Update accordingly.
21783 (CheckIndices): Fix some tricky bugs thanks to recursion.
21785 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
21786 I was being completely brain-dead.
21788 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21789 and re-write acordingly.
21791 (DelegateInvocation): Re-write accordingly.
21793 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21795 (MakeByteBlob): Handle types more correctly.
21797 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21798 initialization from expressions but it is incomplete because I am a complete
21801 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21803 * statement.cs (If.Emit): Fix a bug that generated incorrect code
21804 on If. Basically, we have to return `true' (ie, we do return to
21805 our caller) only if both branches of the if return.
21807 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21808 short-circuit operators, handle them as short circuit operators.
21810 (Cast.DoResolve): Resolve type.
21811 (Cast.Cast): Take an expression as the target type.
21813 * cs-parser.jay (cast_expression): Remove old hack that only
21814 allowed a limited set of types to be handled. Now we take a
21815 unary_expression and we resolve to a type during semantic
21818 Use the grammar productions from Rhys to handle casts (this is
21819 not complete like Rhys syntax yet, we fail to handle that corner
21820 case that C# has regarding (-x), but we will get there.
21822 2001-11-22 Ravi Pratap <ravi@ximian.com>
21824 * class.cs (EmitFieldInitializer): Take care of the case when we have a
21825 field which is an array type.
21827 * cs-parser.jay (declare_local_variables): Support array initialization too.
21829 * typemanager.cs (MakeKey): Implement.
21831 (everywhere): Use the above appropriately.
21833 * cs-parser.jay (for_statement): Update for array initialization while
21834 declaring variables.
21836 * ecore.cs : The error message was correct, it's the variable's names that
21837 were misleading ;-) Make the code more readable.
21839 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21840 the correct type etc.
21842 (ConvertExplicit): Handle Enum types by examining the underlying type.
21844 2001-11-21 Ravi Pratap <ravi@ximian.com>
21846 * parameter.cs (GetCallingConvention): Always return
21847 CallingConventions.Standard for now.
21849 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21851 * expression.cs (Binary.ResolveOperator): Update the values of `l'
21852 and `r' after calling DoNumericPromotions.
21854 * ecore.cs: Fix error message (the types were in the wrong order).
21856 * statement.cs (Foreach.ProbeCollectionType): Need to pass
21857 BindingFlags.Instance as well
21859 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21860 implicit int literal conversion in an empty cast so that we
21861 propagate the right type upstream.
21863 (UnboxCast): new class used to unbox value types.
21864 (Expression.ConvertExplicit): Add explicit type conversions done
21867 (Expression.ImplicitNumericConversion): Oops, forgot to test for
21868 the target type before applying the implicit LongLiterals to ULong
21871 2001-11-21 Miguel de Icaza <miguel@ximian.com>
21873 * cs-parser.jay (for_statement): Reworked the way For works: now
21874 we declare manually any variables that are introduced in
21875 for_initializer to solve the problem of having out-of-band code
21876 emition (that is what got for broken).
21878 (declaration_statement): Perform the actual variable declaration
21879 that used to be done in local_variable_declaration here.
21881 (local_variable_declaration): Do not declare anything, just pass
21882 the information on a DictionaryEntry
21884 2001-11-20 Ravi Pratap <ravi@ximian.com>
21886 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21887 re-write of the logic to now make it recursive.
21889 (UpdateIndices): Re-write accordingly.
21891 Store element data in a separate ArrayData list in the above methods.
21893 (MakeByteBlob): Implement to dump the array data into a byte array.
21895 2001-11-19 Ravi Pratap <ravi@ximian.com>
21897 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21900 * constant.cs (Define): Implement.
21902 (EmitConstant): Re-write fully.
21904 Pass in location info.
21906 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21909 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21910 DictionaryEntry since we need location info too.
21912 (constant_declaration): Update accordingly.
21914 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21915 code into another method : UpdateIndices.
21917 2001-11-18 Ravi Pratap <ravi@ximian.com>
21919 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21920 some type checking etc.
21922 2001-11-17 Ravi Pratap <ravi@ximian.com>
21924 * expression.cs (ArrayCreation::ValidateInitializers): Implement
21925 bits to provide dimension info if the user skips doing that.
21927 Update second constructor to store the rank correctly.
21929 2001-11-16 Ravi Pratap <ravi@ximian.com>
21931 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21932 and try to implement.
21934 * ../errors/cs0150.cs : Add.
21936 * ../errors/cs0178.cs : Add.
21938 2001-11-16 Miguel de Icaza <miguel@ximian.com>
21940 * statement.cs: Implement foreach on multi-dimensional arrays.
21942 * parameter.cs (Parameters.GetParameterByName): Also lookup the
21943 name of the params argument.
21945 * expression.cs: Use EmitStoreOpcode to get the right opcode while
21946 initializing the array.
21948 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21949 we can use this elsewhere.
21951 * statement.cs: Finish implementation of foreach for single
21954 * cs-parser.jay: Use an out-of-band stack to pass information
21955 around, I wonder why I need this.
21957 foreach_block: Make the new foreach_block the current_block.
21959 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21960 function used to return a static Parameters structure. Used for
21961 empty parameters, as those are created very frequently.
21963 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21965 2001-11-15 Ravi Pratap <ravi@ximian.com>
21967 * interface.cs : Default modifier is private, not public. The
21968 make verify test passes again.
21970 2001-11-15 Ravi Pratap <ravi@ximian.com>
21972 * support.cs (ReflectionParameters): Fix logic to determine
21973 whether the last parameter is a params one. Test 9 passes again.
21975 * delegate.cs (Populate): Register the builders we define with
21976 RegisterParameterForBuilder. Test 19 passes again.
21978 * cs-parser.jay (property_declaration): Reference $6 instead
21979 of $$ to get at the location.
21981 (indexer_declaration): Similar stuff.
21983 (attribute): Ditto.
21985 * class.cs (Property): Register parameters for the Get and Set methods
21986 if they exist. Test 23 passes again.
21988 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21989 call to EmitArguments as we are sure there aren't any params arguments.
21990 Test 32 passes again.
21992 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21993 IndexOutOfRangeException.
21995 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21996 Test 33 now passes again.
21998 2001-11-15 Miguel de Icaza <miguel@ximian.com>
22000 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22001 broke a bunch of things. Will have to come up with a better way
22002 of tracking locations.
22004 * statement.cs: Implemented foreach for single dimension arrays.
22006 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22008 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22009 an error. This removes the lookup from the critical path.
22011 * cs-parser.jay: Removed use of temporary_loc, which is completely
22014 2001-11-14 Miguel de Icaza <miguel@ximian.com>
22016 * support.cs (ReflectionParameters.ParameterModifier): Report
22017 whether the argument is a PARAMS argument or not.
22019 * class.cs: Set the attribute `ParamArrayAttribute' on the
22020 parameter argument.
22022 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22023 and cons_param_array_attribute (ConstructorInfo for
22024 ParamArrayAttribute).,
22026 * codegen.cs: Emit the return using the `Return' statement, that
22027 way we can report the error correctly for missing return values.
22029 * class.cs (Method.Emit): Clean up.
22031 * expression.cs (Argument.Resolve): Take another argument: the
22032 location where this argument is used. Notice that this is not
22033 part of the "Argument" class as to reduce the size of the
22034 structure (we know the approximate location anyways).
22036 Test if the argument is a variable-reference, if not, then
22037 complain with a 206.
22039 (Argument.Emit): Emit addresses of variables.
22041 (Argument.FullDesc): Simplify.
22043 (Invocation.DoResolve): Update for Argument.Resolve.
22045 (ElementAccess.DoResolve): ditto.
22047 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22048 method should be virtual, as this method is always virtual.
22050 (NewDelegate.DoResolve): Update for Argument.Resolve.
22052 * class.cs (ConstructorInitializer.DoResolve): ditto.
22054 * attribute.cs (Attribute.Resolve): ditto.
22056 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22058 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22060 * expression.cs (ParameterReference): Drop IStackStorage and implement
22061 IAssignMethod instead.
22063 (LocalVariableReference): ditto.
22065 * ecore.cs (FieldExpr): Drop IStackStorage and implement
22066 IAssignMethod instead.
22068 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22070 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22071 enumerations that are used in heavily used structures derive from
22072 byte in a laughable and pathetic attempt to reduce memory usage.
22073 This is the kind of pre-optimzations that you should not do at
22074 home without adult supervision.
22076 * expression.cs (UnaryMutator): New class, used to handle ++ and
22077 -- separatedly from the other unary operators. Cleans up the
22078 code, and kills the ExpressionStatement dependency in Unary.
22080 (Unary): Removed `method' and `Arguments' from this class, making
22081 it smaller, and moving it all to SimpleCall, so I can reuse this
22082 code in other locations and avoid creating a lot of transient data
22083 strucutres when not required.
22085 * cs-parser.jay: Adjust for new changes.
22087 2001-11-11 Miguel de Icaza <miguel@ximian.com>
22089 * enum.cs (Enum.Populate): If there is a failure during
22092 * cs-parser.jay (opt_enum_base): we used to catch type errors
22093 here, but this is really incorrect. The type error should be
22094 catched during semantic analysis.
22096 2001-12-11 Ravi Pratap <ravi@ximian.com>
22098 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22099 current_local_parameters as expected since I, in my stupidity, had forgotten
22102 * attribute.cs (GetValidPlaces): Fix stupid bug.
22104 * class.cs (Method::Emit): Perform check on applicability of attributes.
22106 (Constructor::Emit): Ditto.
22108 (Field::Emit): Ditto.
22110 (Field.Location): Store location information.
22112 (Property, Event, Indexer, Operator): Ditto.
22114 * cs-parser.jay (field_declaration): Pass in location for each field.
22116 * ../errors/cs0592.cs : Add.
22118 2001-11-12 Ravi Pratap <ravi@ximian.com>
22120 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22122 (InitCoreTypes): Update accordingly.
22124 (RegisterAttrType, LookupAttr): Implement.
22126 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22127 info about the same.
22129 (Resolve): Update to populate the above as necessary.
22131 (Error592): Helper.
22133 (GetValidPlaces): Helper to the above.
22135 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22137 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22139 2001-11-12 Ravi Pratap <ravi@ximian.com>
22141 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22143 * ../errors/cs0617.cs : Add.
22145 2001-11-11 Ravi Pratap <ravi@ximian.com>
22147 * enum.cs (Emit): Rename to Populate to be more consistent with what
22148 we expect it to do and when exactly it is called.
22150 * class.cs, rootcontext.cs : Update accordingly.
22152 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22153 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22155 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22157 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22158 of a fieldinfo using the above, when dealing with a FieldBuilder.
22160 2001-11-10 Ravi Pratap <ravi@ximian.com>
22162 * ../errors/cs0031.cs : Add.
22164 * ../errors/cs1008.cs : Add.
22166 * ../errrors/cs0543.cs : Add.
22168 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22171 (FindMembers): Implement.
22173 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22174 enums and delegates too.
22176 (enum_types): Rename to builder_to_enum.
22178 (delegate_types): Rename to builder_to_delegate.
22180 * delegate.cs (FindMembers): Implement.
22182 2001-11-09 Ravi Pratap <ravi@ximian.com>
22184 * typemanager.cs (IsEnumType): Implement.
22186 * enum.cs (Emit): Re-write parts to account for the underlying type
22187 better and perform checking etc.
22189 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22190 of the underlying type.
22192 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22195 * enum.cs (error31): Helper to report error #31.
22197 * cs-parser.jay (enum_declaration): Store location of each member too.
22199 * enum.cs (member_to_location): New hashtable.
22201 (AddEnumMember): Update location hashtable.
22203 (Emit): Use the location of each member while reporting errors.
22205 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22207 * cs-parser.jay: A for_initializer if is a
22208 local_variable_declaration really ammount to have an implicit
22209 block with the variable declaration and no initializer for for.
22211 * statement.cs (For.Emit): Cope with null initializers.
22213 This fixes the infinite loop on for initializers.
22215 2001-11-08 Miguel de Icaza <miguel@ximian.com>
22217 * enum.cs: More cleanup.
22219 * ecore.cs: Remove dead code.
22221 * class.cs (Property.Emit): More simplification.
22222 (Event.Emit): ditto.
22224 Reworked to have less levels of indentation.
22226 2001-11-08 Ravi Pratap <ravi@ximian.com>
22228 * class.cs (Property): Emit attributes.
22238 * enum.cs (Emit): Ditto.
22240 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22243 * class.cs (Field, Event, etc.): Move attribute generation into the
22244 Emit method everywhere.
22246 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22247 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22248 as we had no way of defining nested enums !
22250 * rootcontext.cs : Adjust code accordingly.
22252 * typemanager.cs (AddEnumType): To keep track of enum types separately.
22254 2001-11-07 Ravi Pratap <ravi@ximian.com>
22256 * expression.cs (EvalConstantExpression): Move into ecore.cs
22258 * enum.cs (Enum): Rename some members and make them public and readonly
22259 according to our convention.
22261 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22264 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22266 (Enum::Emit): Write a simple version for now which doesn't try to compute
22267 expressions. I shall modify this to be more robust in just a while.
22269 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22271 (TypeContainer::CloseType): Create the Enum types too.
22273 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22275 * expression.cs (EvalConstantExpression): Get rid of completely.
22277 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22278 user-defined values and other cases.
22280 (IsValidEnumLiteral): Helper function.
22282 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
22283 out there in the case we had a literal FieldExpr.
22285 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22287 (Literalize): Revamp a bit to take two arguments.
22289 (EnumLiteral): New class which derives from Literal to wrap enum literals.
22291 2001-11-06 Ravi Pratap <ravi@ximian.com>
22293 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22295 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22297 (Resolve): Use the above to ensure we have proper initializers.
22299 2001-11-05 Ravi Pratap <ravi@ximian.com>
22301 * expression.cs (Expression::EvalConstantExpression): New method to
22302 evaluate constant expressions.
22304 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22306 2001-11-07 Miguel de Icaza <miguel@ximian.com>
22308 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22311 (Binary.ResolveOperator): Handle operator != (object a, object b)
22312 and operator == (object a, object b);
22314 (Binary.DoNumericPromotions): Indicate whether the numeric
22315 promotion was possible.
22317 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22320 Made the ArrayAccess implement interface IAssignMethod instead of
22321 IStackStore as the order in which arguments are passed reflects
22324 * assign.cs: Instead of using expr.ExprClass to select the way of
22325 assinging, probe for the IStackStore/IAssignMethod interfaces.
22327 * typemanager.cs: Load InitializeArray definition.
22329 * rootcontext.cs (RootContext.MakeStaticData): Used to define
22330 static data that can be used to initialize arrays.
22332 2001-11-05 Miguel de Icaza <miguel@ximian.com>
22334 * expression.cs: Handle operator== and operator!= for booleans.
22336 (Conditioal.Reduce): Implement reducer for the ?: operator.
22338 (Conditional.Resolve): Implement dead code elimination.
22340 (Binary.Resolve): Catch string literals and return a new
22341 concatenated string.
22343 (Unary.Reduce): Implement reduction of unary expressions.
22345 * ecore.cs: Split out the expression core handling here.
22347 (Expression.Reduce): New method used to perform constant folding
22348 and CSE. This is needed to support constant-expressions.
22350 * statement.cs (Statement.EmitBoolExpression): Pass true and false
22351 targets, and optimize for !x.
22353 2001-11-04 Ravi Pratap <ravi@ximian.com>
22355 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22356 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22357 set custom atttributes.
22359 * literal.cs (Literal::GetValue): New abstract method to return the actual
22360 value of the literal, cast as an object.
22362 (*Literal): Implement GetValue method.
22364 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22365 expressions to the arraylist but objects of type Argument.
22367 * class.cs (TypeContainer::Emit): Emit our attributes too.
22369 (Method::Emit, Constructor::Emit): Ditto.
22371 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22372 to be ignoring earlier.
22374 2001-11-03 Ravi Pratap <ravi@ximian.com>
22376 * attribute.cs (AttributeSection::Define): Implement to do the business
22377 of constructing a CustomAttributeBuilder.
22379 (Attribute): New trivial class. Increases readability of code.
22381 * cs-parser.jay : Update accordingly.
22383 (positional_argument_list, named_argument_list, named_argument): New rules
22385 (attribute_arguments): Use the above so that we are more correct.
22387 2001-11-02 Ravi Pratap <ravi@ximian.com>
22389 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22390 to perform all checks for a method with a params parameter.
22392 (Invocation::OverloadResolve): Update to use the above method and therefore
22393 cope correctly with params method invocations.
22395 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
22398 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22399 constructors in our parent too because we can't afford to miss out on
22402 * attribute.cs (AttributeSection): New name for the class Attribute
22404 Other trivial changes to improve readability.
22406 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22407 use the new class names.
22409 2001-11-01 Ravi Pratap <ravi@ximian.com>
22411 * class.cs (Method::Define): Complete definition for params types too
22413 (Indexer::Define): Ditto.
22415 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22416 Cope everywhere with a request for info about the array parameter.
22418 2001-11-01 Ravi Pratap <ravi@ximian.com>
22420 * tree.cs (RecordNamespace): Fix up to check for the correct key.
22422 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
22423 local_variable_type to extract the string corresponding to the type.
22425 (local_variable_type): Fixup the action to use the new helper method.
22427 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
22430 * expression.cs : Clean out code which uses the above.
22432 2001-10-31 Ravi Pratap <ravi@ximian.com>
22434 * typemanager.cs (RegisterMethod): Check if we already have an existing key
22435 and bale out if necessary by returning a false.
22437 (RegisterProperty): Ditto.
22439 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22440 and print out appropriate error messages.
22442 * interface.cs (everywhere): Ditto.
22444 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22445 location to constructor.
22447 * class.cs (Property, Event, Indexer): Update accordingly.
22449 * ../errors/cs111.cs : Added.
22451 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22452 of a method, as laid down by the spec.
22454 (Invocation::OverloadResolve): Use the above method.
22456 2001-10-31 Ravi Pratap <ravi@ximian.com>
22458 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22459 now take a TypeContainer and a Parameters object.
22461 (ParameterData): Modify return type of ParameterModifier method to be
22462 Parameter.Modifier and not a string.
22464 (ReflectionParameters, InternalParameters): Update accordingly.
22466 * expression.cs (Argument::GetParameterModifier): Same here.
22468 * support.cs (InternalParameters::ParameterType): Find a better way of determining
22469 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22470 symbol in it at all so maybe this is only for now.
22472 2001-10-30 Ravi Pratap <ravi@ximian.com>
22474 * support.cs (InternalParameters): Constructor now takes an extra argument
22475 which is the actual Parameters class.
22477 (ParameterDesc): Update to provide info on ref/out modifiers.
22479 * class.cs (everywhere): Update call to InternalParameters to pass in
22480 the second argument too.
22482 * support.cs (ParameterData): Add ParameterModifier, which is a method
22483 to return the modifier info [ref/out etc]
22485 (InternalParameters, ReflectionParameters): Implement the above.
22487 * expression.cs (Argument::ParameterModifier): Similar function to return
22488 info about the argument's modifiers.
22490 (Invocation::OverloadResolve): Update to take into account matching modifiers
22493 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22494 a new SetFormalParameters object which we pass to InternalParameters.
22496 2001-10-30 Ravi Pratap <ravi@ximian.com>
22498 * expression.cs (NewArray): Merge into the ArrayCreation class.
22500 2001-10-29 Ravi Pratap <ravi@ximian.com>
22502 * expression.cs (NewArray): Merge classes NewBuiltinArray and
22503 NewUserdefinedArray into one as there wasn't much of a use in having
22506 * expression.cs (Argument): Change field's name to ArgType from Type.
22508 (Type): New readonly property which returns the proper type, taking into
22509 account ref/out modifiers.
22511 (everywhere): Adjust code accordingly for the above.
22513 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22514 whether we are emitting for a ref or out parameter.
22516 * expression.cs (Argument::Emit): Use the above field to set the state.
22518 (LocalVariableReference::Emit): Update to honour the flag and emit the
22521 * parameter.cs (Attributes): Set the correct flags for ref parameters.
22523 * expression.cs (Argument::FullDesc): New function to provide a full desc.
22525 * support.cs (ParameterData): Add method ParameterDesc to the interface.
22527 (ReflectionParameters, InternalParameters): Implement the above method.
22529 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22532 (Invocation::FullMethodDesc): Ditto.
22534 2001-10-29 Miguel de Icaza <miguel@ximian.com>
22536 * cs-parser.jay: Add extra production for the second form of array
22539 * expression.cs (ArrayCreation): Update to reflect the above
22542 * Small changes to prepare for Array initialization.
22544 2001-10-28 Miguel de Icaza <miguel@ximian.com>
22546 * typemanager.cs (ImplementsInterface): interface might be null;
22547 Deal with this problem;
22549 Also, we do store negative hits on the cache (null values), so use
22550 this instead of calling t.GetInterfaces on the type everytime.
22552 2001-10-28 Ravi Pratap <ravi@ximian.com>
22554 * typemanager.cs (IsBuiltinType): New method to help determine the same.
22556 * expression.cs (New::DoResolve): Get rid of array creation code and instead
22557 split functionality out into different classes.
22559 (New::FormArrayType): Move into NewBuiltinArray.
22561 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22564 (NewBuiltinArray): New class to handle creation of built-in arrays.
22566 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22567 account creation of one-dimensional arrays.
22569 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22571 (NewUserdefinedArray::DoResolve): Implement.
22573 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22575 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22576 we maintain inside the TypeManager. This is necessary to perform lookups on the
22579 (LookupType): Update to perform GetType on the module builders too.
22581 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22583 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22585 2001-10-23 Ravi Pratap <ravi@ximian.com>
22587 * expression.cs (New::DoResolve): Implement guts of array creation.
22589 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22591 2001-10-27 Miguel de Icaza <miguel@ximian.com>
22593 * expression.cs: Fix bug I introduced lsat night that broke
22596 (Expression.Resolve): Report a 246 error (can not resolve name)
22597 if we find a SimpleName in the stream.
22599 (Expression.ResolveLValue): Ditto.
22601 (Expression.ResolveWithSimpleName): This function is a variant of
22602 ResolveName, this one allows SimpleNames to be returned without a
22603 warning. The only consumer of SimpleNames is MemberAccess
22605 2001-10-26 Miguel de Icaza <miguel@ximian.com>
22607 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22608 might arrive here. I have my doubts that this is correct.
22610 * statement.cs (Lock): Implement lock statement.
22612 * cs-parser.jay: Small fixes to support `lock' and `using'
22614 * cs-tokenizer.cs: Remove extra space
22616 * driver.cs: New flag --checked, allows to turn on integer math
22619 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22620 Threading.Monitor.Exit
22622 2001-10-23 Miguel de Icaza <miguel@ximian.com>
22624 * expression.cs (IndexerAccess::DoResolveLValue): Set the
22625 Expression Class to be IndexerAccess.
22627 Notice that Indexer::DoResolve sets the eclass to Value.
22629 2001-10-22 Miguel de Icaza <miguel@ximian.com>
22631 * class.cs (TypeContainer::Emit): Emit code for indexers.
22633 * assign.cs (IAssignMethod): New interface implemented by Indexers
22634 and Properties for handling assignment.
22636 (Assign::Emit): Simplify and reuse code.
22638 * expression.cs (IndexerAccess, PropertyExpr): Implement
22639 IAssignMethod, clean up old code.
22641 2001-10-22 Ravi Pratap <ravi@ximian.com>
22643 * typemanager.cs (ImplementsInterface): New method to determine if a type
22644 implements a given interface. Provides a nice cache too.
22646 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22649 (ConvertReferenceExplicit): Ditto.
22651 * delegate.cs (Delegate::Populate): Update to define the parameters on the
22652 various methods, with correct names etc.
22654 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
22655 Operator.UnaryNegation.
22657 * cs-parser.jay (operator_declarator): Be a little clever in the case where
22658 we have a unary plus or minus operator.
22660 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
22663 * everywhere : update accordingly.
22665 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22668 * class.cs (Method::Define): For the case where we are implementing a method
22669 inherited from an interface, we need to set the MethodAttributes.Final flag too.
22670 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22672 2001-10-21 Ravi Pratap <ravi@ximian.com>
22674 * interface.cs (FindMembers): Implement to work around S.R.E
22677 * typemanager.cs (IsInterfaceType): Implement.
22679 (FindMembers): Update to handle interface types too.
22681 * expression.cs (ImplicitReferenceConversion): Re-write bits which
22682 use IsAssignableFrom as that is not correct - it doesn't work.
22684 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22685 and accordingly override EmitStatement.
22687 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22688 using the correct logic :-)
22690 2001-10-19 Ravi Pratap <ravi@ximian.com>
22692 * ../errors/cs-11.cs : Add to demonstrate error -11
22694 2001-10-17 Miguel de Icaza <miguel@ximian.com>
22696 * assign.cs (Assign::Resolve): Resolve right hand side first, and
22697 then pass this as a hint to ResolveLValue.
22699 * expression.cs (FieldExpr): Add Location information
22701 (FieldExpr::LValueResolve): Report assignment to readonly
22704 (Expression::ExprClassFromMemberInfo): Pass location information.
22706 (Expression::ResolveLValue): Add new method that resolves an
22709 (Expression::DoResolveLValue): Default invocation calls
22712 (Indexers): New class used to keep track of indexers in a given
22715 (IStackStore): Renamed from LValue, as it did not really describe
22716 what this did. Also ResolveLValue is gone from this interface and
22717 now is part of Expression.
22719 (ElementAccess): Depending on the element access type
22721 * typemanager.cs: Add `indexer_name_type' as a Core type
22722 (System.Runtime.CompilerServices.IndexerNameAttribute)
22724 * statement.cs (Goto): Take a location.
22726 2001-10-18 Ravi Pratap <ravi@ximian.com>
22728 * delegate.cs (Delegate::VerifyDelegate): New method to verify
22729 if two delegates are compatible.
22731 (NewDelegate::DoResolve): Update to take care of the case when
22732 we instantiate a delegate from another delegate.
22734 * typemanager.cs (FindMembers): Don't even try to look up members
22735 of Delegate types for now.
22737 2001-10-18 Ravi Pratap <ravi@ximian.com>
22739 * delegate.cs (NewDelegate): New class to take care of delegate
22742 * expression.cs (New): Split the delegate related code out into
22743 the NewDelegate class.
22745 * delegate.cs (DelegateInvocation): New class to handle delegate
22748 * expression.cs (Invocation): Split out delegate related code into
22749 the DelegateInvocation class.
22751 2001-10-17 Ravi Pratap <ravi@ximian.com>
22753 * expression.cs (New::DoResolve): Implement delegate creation fully
22754 and according to the spec.
22756 (New::DoEmit): Update to handle delegates differently.
22758 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22759 because of which we were printing out arguments in reverse order !
22761 * delegate.cs (VerifyMethod): Implement to check if the given method
22762 matches the delegate.
22764 (FullDelegateDesc): Implement.
22766 (VerifyApplicability): Implement.
22768 * expression.cs (Invocation::DoResolve): Update to accordingly handle
22769 delegate invocations too.
22771 (Invocation::Emit): Ditto.
22773 * ../errors/cs1593.cs : Added.
22775 * ../errors/cs1594.cs : Added.
22777 * delegate.cs (InstanceExpression, TargetMethod): New properties.
22779 2001-10-16 Ravi Pratap <ravi@ximian.com>
22781 * typemanager.cs (intptr_type): Core type for System.IntPtr
22783 (InitCoreTypes): Update for the same.
22785 (iasyncresult_type, asynccallback_type): Ditto.
22787 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22790 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22793 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22794 the builders for the 4 members of a delegate type :-)
22796 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22799 * expression.cs (New::DoResolve): Implement guts for delegate creation.
22801 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22803 2001-10-15 Miguel de Icaza <miguel@ximian.com>
22805 * statement.cs (Break::Emit): Implement.
22806 (Continue::Emit): Implement.
22808 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
22809 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
22810 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
22811 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
22814 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22815 properties that track the label for the current loop (begin of the
22816 loop and end of the loop).
22818 2001-10-15 Ravi Pratap <ravi@ximian.com>
22820 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22821 use of emitting anything at all.
22823 * class.cs, rootcontext.cs : Get rid of calls to the same.
22825 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22827 (Populate): Define the constructor correctly and set the implementation
22830 * typemanager.cs (delegate_types): New hashtable to hold delegates that
22833 (AddDelegateType): Implement.
22835 (IsDelegateType): Implement helper method.
22837 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22839 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22840 and accordingly handle it.
22842 * delegate.cs (Populate): Take TypeContainer argument.
22843 Implement bits to define the Invoke method. However, I still haven't figured out
22844 how to take care of the native int bit :-(
22846 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
22847 Qualify the name of the delegate, not its return type !
22849 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22852 (StandardConversionExists): Checking for array types turns out to be recursive.
22854 (ConvertReferenceExplicit): Implement array conversion.
22856 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22858 2001-10-12 Ravi Pratap <ravi@ximian.com>
22860 * cs-parser.jay (delegate_declaration): Store the fully qualified
22861 name as it is a type declaration.
22863 * delegate.cs (ReturnType, Name): Rename members to these. Make them
22866 (DefineDelegate): Renamed from Define. Does the same thing essentially,
22867 as TypeContainer::DefineType.
22869 (Populate): Method in which all the definition of the various methods (Invoke)
22872 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22875 (CloseDelegate): Finally creates the delegate.
22877 * class.cs (TypeContainer::DefineType): Update to define delegates.
22878 (Populate, Emit and CloseType): Do the same thing here too.
22880 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22881 delegates in all these operations.
22883 2001-10-14 Miguel de Icaza <miguel@ximian.com>
22885 * expression.cs: LocalTemporary: a new expression used to
22886 reference a temporary that has been created.
22888 * assign.cs: Handle PropertyAccess back here, so that we can
22889 provide the proper semantic access to properties.
22891 * expression.cs (Expression::ConvertReferenceExplicit): Implement
22892 a few more explicit conversions.
22894 * modifiers.cs: `NEW' modifier maps to HideBySig.
22896 * expression.cs (PropertyExpr): Make this into an
22897 ExpressionStatement, and support the EmitStatement code path.
22899 Perform get/set error checking, clean up the interface.
22901 * assign.cs: recognize PropertyExprs as targets, and if so, turn
22902 them into toplevel access objects.
22904 2001-10-12 Miguel de Icaza <miguel@ximian.com>
22906 * expression.cs: PropertyExpr::PropertyExpr: use work around the
22909 * typemanager.cs: Keep track here of our PropertyBuilders again to
22910 work around lameness in SRE.
22912 2001-10-11 Miguel de Icaza <miguel@ximian.com>
22914 * expression.cs (LValue::LValueResolve): New method in the
22915 interface, used to perform a second resolution pass for LValues.
22917 (This::DoResolve): Catch the use of this in static methods.
22919 (This::LValueResolve): Implement.
22921 (This::Store): Remove warning, assigning to `this' in structures
22924 (Invocation::Emit): Deal with invocation of
22925 methods on value types. We need to pass the address to structure
22926 methods rather than the object itself. (The equivalent code to
22927 emit "this" for structures leaves the entire structure on the
22928 stack instead of a pointer to it).
22930 (ParameterReference::DoResolve): Compute the real index for the
22931 argument based on whether the method takes or not a `this' pointer
22932 (ie, the method is static).
22934 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22935 value types returned from functions when we need to invoke a
22936 method on the sturcture.
22939 2001-10-11 Ravi Pratap <ravi@ximian.com>
22941 * class.cs (TypeContainer::DefineType): Method to actually do the business of
22942 defining the type in the Modulebuilder or Typebuilder. This is to take
22943 care of nested types which need to be defined on the TypeBuilder using
22944 DefineNestedMethod.
22946 (TypeContainer::GetClassBases): Implement. Essentially the code from the
22947 methods in RootContext, only ported to be part of TypeContainer.
22949 (TypeContainer::GetInterfaceOrClass): Ditto.
22951 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22953 * interface.cs (Interface::DefineInterface): New method. Does exactly
22954 what RootContext.CreateInterface did earlier, only it takes care of nested types
22957 (Interface::GetInterfaces): Move from RootContext here and port.
22959 (Interface::GetInterfaceByName): Same here.
22961 * rootcontext.cs (ResolveTree): Re-write.
22963 (PopulateTypes): Re-write.
22965 * class.cs (TypeContainer::Populate): Populate nested types too.
22966 (TypeContainer::Emit): Emit nested members too.
22968 * typemanager.cs (AddUserType): Do not make use of the FullName property,
22969 instead just use the name argument passed in as it is already fully
22972 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22973 to TypeContainer mapping to see if a type is user-defined.
22975 * class.cs (TypeContainer::CloseType): Implement.
22977 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22978 the default constructor.
22980 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22983 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22985 * interface.cs (CloseType): Create the type here.
22987 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22990 Remove all the methods which are now in TypeContainer.
22992 2001-10-10 Ravi Pratap <ravi@ximian.com>
22994 * delegate.cs (Define): Re-write bits to define the delegate
22997 2001-10-10 Miguel de Icaza <miguel@ximian.com>
22999 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23001 * expression.cs (ImplicitReferenceConversion): handle null as well
23002 as a source to convert to any reference type.
23004 * statement.cs (Return): Perform any implicit conversions to
23005 expected return type.
23007 Validate use of return statement.
23009 * codegen.cs (EmitContext): Pass the expected return type here.
23011 * class.cs (Method, Constructor, Property): Pass expected return
23012 type to EmitContext.
23014 2001-10-09 Miguel de Icaza <miguel@ximian.com>
23016 * expression.cs: Make DoResolve take an EmitContext instead of a
23019 Replaced `l' and `location' for `loc', for consistency.
23021 (Error, Warning): Remove unneeded Tc argument.
23023 * assign.cs, literal.cs, constant.cs: Update to new calling
23026 * codegen.cs: EmitContext now contains a flag indicating whether
23027 code is being generated in a static method or not.
23029 * cs-parser.jay: DecomposeQI, new function that replaces the old
23030 QualifiedIdentifier. Now we always decompose the assembled
23031 strings from qualified_identifier productions into a group of
23034 2001-10-08 Miguel de Icaza <miguel@ximian.com>
23036 * rootcontext.cs: Deal with field-less struct types correctly now
23037 by passing the size option to Define Type.
23039 * class.cs: Removed hack that created one static field.
23041 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23043 * statement.cs: Moved most of the code generation here.
23045 2001-10-09 Ravi Pratap <ravi@ximian.com>
23047 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23050 (ElementAccess): Remove useless bits for now - keep checks as the spec
23053 2001-10-08 Ravi Pratap <ravi@ximian.com>
23055 * expression.cs (ElementAccess::DoResolve): Remove my crap code
23056 and start performing checks according to the spec.
23058 2001-10-07 Ravi Pratap <ravi@ximian.com>
23060 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23061 rank_specifiers instead.
23063 (rank_specifiers): Change the order in which the rank specifiers are stored
23065 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23067 * expression.cs (ElementAccess): Implement the LValue interface too.
23069 2001-10-06 Ravi Pratap <ravi@ximian.com>
23071 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23072 except that user defined conversions are not included.
23074 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
23075 perform the conversion of the return type, if necessary.
23077 (New::DoResolve): Check whether we are creating an array or an object
23078 and accordingly do the needful.
23080 (New::Emit): Same here.
23082 (New::DoResolve): Implement guts of array creation.
23084 (New::FormLookupType): Helper function.
23086 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23088 * codegen.cs: Removed most of the code generation here, and move the
23089 corresponding code generation bits to the statement classes.
23091 Added support for try/catch/finalize and throw.
23093 * cs-parser.jay: Added support for try/catch/finalize.
23095 * class.cs: Catch static methods having the flags override,
23096 virtual or abstract.
23098 * expression.cs (UserCast): This user cast was not really doing
23099 what it was supposed to do. Which is to be born in fully resolved
23100 state. Parts of the resolution were being performed at Emit time!
23104 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23106 * expression.cs: Implicity convert the result from UserCast.
23108 2001-10-05 Ravi Pratap <ravi@ximian.com>
23110 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23111 prevented it from working correctly.
23113 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23114 merely ConvertImplicit.
23116 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23118 * typemanager.cs: Make the LookupTypeContainer function static,
23119 and not per-instance.
23121 * class.cs: Make static FindMembers (the one that takes a Type
23124 * codegen.cs: Add EmitForeach here.
23126 * cs-parser.jay: Make foreach a toplevel object instead of the
23127 inline expansion, as we need to perform semantic analysis on it.
23129 2001-10-05 Ravi Pratap <ravi@ximian.com>
23131 * expression.cs (Expression::ImplicitUserConversion): Rename to
23132 UserDefinedConversion.
23134 (Expression::UserDefinedConversion): Take an extra argument specifying
23135 whether we look for explicit user conversions too.
23137 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23139 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23141 (ExplicitUserConversion): Make it a call to UserDefinedConversion
23142 with the appropriate arguments.
23144 * cs-parser.jay (cast_expression): Record location too.
23146 * expression.cs (Cast): Record location info.
23148 (Expression::ConvertExplicit): Take location argument.
23150 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23151 to determine if we are doing explicit conversions.
23153 (UserCast::Emit): Update accordingly.
23155 (Expression::ConvertExplicit): Report an error if everything fails.
23157 * ../errors/cs0030.cs : Add.
23159 2001-10-04 Miguel de Icaza <miguel@ximian.com>
23161 * modifiers.cs: If the ABSTRACT keyword is present, also set the
23162 virtual and newslot bits.
23164 * class.cs (TypeContainer::RegisterRequiredImplementations):
23165 Record methods we need.
23167 (TypeContainer::MakeKey): Helper function to make keys for
23168 MethodBases, since the Methodbase key is useless.
23170 (TypeContainer::Populate): Call RegisterRequiredImplementations
23171 before defining the methods.
23173 Create a mapping for method_builders_to_methods ahead of time
23174 instead of inside a tight loop.
23176 (::RequireMethods): Accept an object as the data to set into the
23177 hashtable so we can report interface vs abstract method mismatch.
23179 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23181 * report.cs: Make all of it static.
23183 * rootcontext.cs: Drop object_type and value_type computations, as
23184 we have those in the TypeManager anyways.
23186 Drop report instance variable too, now it is a global.
23188 * driver.cs: Use try/catch on command line handling.
23190 Add --probe option to debug the error reporting system with a test
23193 * report.cs: Add support for exiting program when a probe
23194 condition is reached.
23196 2001-10-03 Ravi Pratap <ravi@ximian.com>
23198 * expression.cs (Binary::DoNumericPromotions): Fix the case when
23199 we do a forcible conversion regardless of type, to check if
23200 ForceConversion returns a null.
23202 (Binary::error19): Use location to report error.
23204 (Unary::error23): Use location here too.
23206 * ../errors/cs0019.cs : Check in.
23208 * ../errors/cs0023.cs : Check in.
23210 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23211 case of a non-null MethodInfo object with a length of 0 !
23213 (Binary::ResolveOperator): Flag error if overload resolution fails to find
23214 an applicable member - according to the spec :-)
23215 Also fix logic to find members in base types.
23217 (Unary::ResolveOperator): Same here.
23219 (Unary::report23): Change name to error23 and make first argument a TypeContainer
23220 as I was getting thoroughly confused between this and error19 :-)
23222 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23223 (::FindMostEncompassedType): Implement.
23224 (::FindMostEncompassingType): Implement.
23225 (::StandardConversionExists): Implement.
23227 (UserImplicitCast): Re-vamp. We now need info about most specific
23228 source and target types so that we can do the necessary conversions.
23230 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23231 mathematical union with no duplicates.
23233 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23235 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23236 in order from base classes to child classes, so that we can in
23237 child classes look up in our parent for method names and
23238 attributes (required for handling abstract, virtual, new, override
23239 constructs: we need to instrospect our base class, and if we dont
23240 populate the classes in order, the introspection might be
23241 incorrect. For example, a method could query its parent before
23242 the parent has any methods and would determine that the parent has
23243 no abstract methods (while it could have had them)).
23245 (RootContext::CreateType): Record the order in which we define the
23248 2001-10-02 Miguel de Icaza <miguel@ximian.com>
23250 * class.cs (TypeContainer::Populate): Also method definitions can
23251 fail now, keep track of this.
23253 (TypeContainer::FindMembers): Implement support for
23254 DeclaredOnly/noDeclaredOnly flag.
23256 (Constructor::Emit) Return the ConstructorBuilder.
23258 (Method::Emit) Return the MethodBuilder.
23259 Check for abstract or virtual methods to be public.
23261 * rootcontext.cs (RootContext::CreateType): Register all the
23262 abstract methods required for the class to be complete and the
23263 interface methods that must be implemented.
23265 * cs-parser.jay: Report error 501 (method requires body if it is
23266 not marked abstract or extern).
23268 * expression.cs (TypeOf::Emit): Implement.
23270 * typemanager.cs: runtime_handle_type, new global type.
23272 * class.cs (Property::Emit): Generate code for properties.
23274 2001-10-02 Ravi Pratap <ravi@ximian.com>
23276 * expression.cs (Unary::ResolveOperator): Find operators on base type
23277 too - we now conform exactly to the spec.
23279 (Binary::ResolveOperator): Same here.
23281 * class.cs (Operator::Define): Fix minor quirk in the tests.
23283 * ../errors/cs0215.cs : Added.
23285 * ../errors/cs0556.cs : Added.
23287 * ../errors/cs0555.cs : Added.
23289 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23291 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23292 single integer which is really efficient
23294 2001-10-01 Ravi Pratap <ravi@ximian.com>
23296 * expression.cs (Expression::ImplicitUserConversion): Use location
23297 even in the case when we are examining True operators.
23299 * class.cs (Operator::Define): Perform extensive checks to conform
23300 with the rules for operator overloading in the spec.
23302 * expression.cs (Expression::ImplicitReferenceConversion): Implement
23303 some of the other conversions mentioned in the spec.
23305 * typemanager.cs (array_type): New static member for the System.Array built-in
23308 (cloneable_interface): For System.ICloneable interface.
23310 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23311 we start resolving the tree and populating types.
23313 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23315 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23317 * expression.cs (Expression::ExprClassFromMemberInfo,
23318 Expression::Literalize): Create literal expressions from
23319 FieldInfos which are literals.
23321 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23322 type casts, because they were wrong. The test suite in tests
23325 (ImplicitNumericConversion): ushort to ulong requires a widening
23328 Int32 constant to long requires widening cast as well.
23330 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23331 for integers because the type on the stack is not i4.
23333 2001-09-30 Miguel de Icaza <miguel@ximian.com>
23335 * expression.cs (report118): require location argument.
23337 * parameter.cs: Do not dereference potential null value.
23339 * class.cs: Catch methods that lack the `new' keyword when
23340 overriding a name. Report warnings when `new' is used without
23341 anything being there to override.
23343 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23345 * class.cs: Only add constructor to hashtable if it is non-null
23346 (as now constructors can fail on define).
23348 (TypeManager, Class, Struct): Take location arguments.
23350 Catch field instance initialization in structs as errors.
23352 accepting_filter: a new filter for FindMembers that is static so
23353 that we dont create an instance per invocation.
23355 (Constructor::Define): Catch errors where a struct constructor is
23358 * cs-parser.jay: Pass location information for various new
23361 * delegate.cs (Delegate): take a location argument.
23363 * driver.cs: Do not call EmitCode if there were problesm in the
23364 Definition of the types, as many Builders wont be there.
23366 * decl.cs (Decl::Decl): Require a location argument.
23368 * cs-tokenizer.cs: Handle properly hex constants that can not fit
23369 into integers, and find the most appropiate integer for it.
23371 * literal.cs: Implement ULongLiteral.
23373 * rootcontext.cs: Provide better information about the location of
23374 failure when CreateType fails.
23376 2001-09-29 Miguel de Icaza <miguel@ximian.com>
23378 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23381 * expression.cs (Binary::CheckShiftArguments): Add missing type
23383 (Binary::ResolveOperator): Add type to the logical and and logical
23384 or, Bitwise And/Or and Exclusive Or code paths, it was missing
23387 (Binary::DoNumericPromotions): In the case where either argument
23388 is ulong (and most signed types combined with ulong cause an
23389 error) perform implicit integer constant conversions as well.
23391 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23393 * expression.cs (UserImplicitCast): Method should always be
23395 (Invocation::BetterConversion): Simplified test for IntLiteral.
23397 (Expression::ImplicitNumericConversion): Split this routine out.
23398 Put the code that performs implicit constant integer conversions
23401 (Expression::Resolve): Become a wrapper around DoResolve so we can
23402 check eclass and type being set after resolve.
23404 (Invocation::Badness): Remove this dead function
23406 (Binary::ResolveOperator): Do not compute the expensive argumnets
23407 unless we have a union for it.
23409 (Probe::Emit): Is needs to do an isinst and then
23410 compare against null.
23412 (::CanConvert): Added Location argument. If the Location argument
23413 is null (Location.Null), then we do not report errors. This is
23414 used by the `probe' mechanism of the Explicit conversion. We do
23415 not want to generate an error for something that the user
23416 explicitly requested to be casted. But the pipeline for an
23417 explicit cast first tests for potential implicit casts.
23419 So for now, if the Location is null, it means `Probe only' to
23420 avoid adding another argument. Might have to revise this
23423 (ClassCast): New class used to type cast objects into arbitrary
23424 classes (used in Explicit Reference Conversions).
23426 Implement `as' as well.
23428 Reverted all the patches from Ravi below: they were broken:
23430 * The use of `level' as a mechanism to stop recursive
23431 invocations is wrong. That was there just to catch the
23432 bug with a strack trace but not as a way of addressing
23435 To fix the problem we have to *understand* what is going
23436 on and the interactions and come up with a plan, not
23437 just get things going.
23439 * The use of the type conversion cache that I proposed
23440 last night had an open topic: How does this work across
23441 protection domains. A user defined conversion might not
23442 be public in the location where we are applying the
23443 conversion, a different conversion might be selected
23444 (ie, private A->B (better) but public B->A (worse),
23445 inside A, A->B applies, but outside it, B->A will
23448 * On top of that (ie, even if the above is solved),
23449 conversions in a cache need to be abstract. Ie, `To
23450 convert from an Int to a Short use an OpcodeCast', not
23451 `To convert from an Int to a Short use the OpcodeCast on
23452 the variable 5' (which is what this patch was doing).
23454 2001-09-28 Ravi Pratap <ravi@ximian.com>
23456 * expression.cs (Invocation::ConversionExists): Re-write to use
23457 the conversion cache
23459 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23460 cache all conversions done, not just user-defined ones.
23462 (Invocation::BetterConversion): The real culprit. Use ConversionExists
23463 to determine if a conversion exists instead of acutually trying to
23464 perform the conversion. It's faster too.
23466 (Expression::ConvertExplicit): Modify to use ConversionExists to check
23467 and only then attempt the implicit conversion.
23469 2001-09-28 Ravi Pratap <ravi@ximian.com>
23471 * expression.cs (ConvertImplicit): Use a cache for conversions
23472 already found. Check level of recursion and bail out if necessary.
23474 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23476 * typemanager.cs (string_concat_string_string, string_concat_object_object):
23477 Export standard methods that we expect for string operations.
23479 * statement.cs (Block::UsageWarning): Track usage of variables and
23480 report the errors for not used variables.
23482 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23485 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23487 * codegen.cs: remove unnneded code
23489 * expression.cs: Removed BuiltinTypeAccess class
23491 Fix the order in which implicit conversions are
23494 The previous fixed dropped support for boxed conversions (adding a
23495 test to the test suite now)
23497 (UserImplicitCast::CanConvert): Remove test for source being null,
23498 that code is broken. We should not feed a null to begin with, if
23499 we do, then we should track the bug where the problem originates
23500 and not try to cover it up here.
23502 Return a resolved expression of type UserImplicitCast on success
23503 rather than true/false. Ravi: this is what I was talking about,
23504 the pattern is to use a static method as a "constructor" for
23507 Also, do not create arguments until the very last minute,
23508 otherwise we always create the arguments even for lookups that
23509 will never be performed.
23511 (UserImplicitCast::Resolve): Eliminate, objects of type
23512 UserImplicitCast are born in a fully resolved state.
23514 * typemanager.cs (InitCoreTypes): Init also value_type
23515 (System.ValueType).
23517 * expression.cs (Cast::Resolve): First resolve the child expression.
23519 (LValue): Add new method AddressOf to be used by
23522 Change the argument of Store to take an EmitContext instead of an
23523 ILGenerator, because things like FieldExpr need to be able to call
23524 their children expression to generate the instance code.
23526 (Expression::Error, Expression::Warning): Sugar functions for
23529 (Expression::MemberLookup): Accept a TypeContainer instead of a
23530 Report as the first argument.
23532 (Expression::ResolvePrimary): Killed. I still want to improve
23533 this as currently the code is just not right.
23535 (Expression::ResolveMemberAccess): Simplify, but it is still
23538 (Unary::Resolve): Catch errors in AddressOf operators.
23540 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23541 index to a byte for the short-version, or the compiler will choose
23542 the wrong Emit call, which generates the wrong data.
23544 (ParameterReference::Emit, ::Store): same.
23546 (FieldExpr::AddressOf): Implement.
23548 * typemanager.cs: TypeManager: made public variable instead of
23551 * driver.cs: document --fatal.
23553 * report.cs (ErrorMessage, WarningMessage): new names for the old
23554 Error and Warning classes.
23556 * cs-parser.jay (member_access): Turn built-in access to types
23557 into a normal simplename
23559 2001-09-27 Ravi Pratap <ravi@ximian.com>
23561 * expression.cs (Invocation::BetterConversion): Fix to cope
23562 with q being null, since this was introducing a bug.
23564 * expression.cs (ConvertImplicit): Do built-in conversions first.
23566 2001-09-27 Ravi Pratap <ravi@ximian.com>
23568 * expression.cs (UserImplicitCast::Resolve): Fix bug.
23570 2001-09-27 Ravi Pratap <ravi@ximian.com>
23572 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23573 I had introduced long ago (what's new ?).
23575 * expression.cs (UserImplicitCast::CanConvert): Static method to do
23576 the work of all the checking.
23577 (ConvertImplicit): Call CanConvert and only then create object if necessary.
23578 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23580 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23581 that is the right way.
23583 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
23584 overloading resolution. Use everywhere instead of cutting and pasting code.
23586 (Binary::ResolveOperator): Use MakeUnionSet.
23588 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
23589 we have to convert to bool types. Not complete yet.
23591 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23593 * typemanager.cs (TypeManager::CSharpName): support ushort.
23595 * expression.cs (Expression::TryImplicitIntConversion): Attempts
23596 to provide an expression that performsn an implicit constant int
23597 conversion (section 6.1.6).
23598 (Expression::ConvertImplicitRequired): Reworked to include
23599 implicit constant expression conversions.
23601 (Expression::ConvertNumericExplicit): Finished.
23603 (Invocation::Emit): If InstanceExpression is null, then it means
23604 that we perform a call on this.
23606 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23608 * expression.cs (Unary::Emit): Remove some dead code.
23609 (Probe): Implement Resolve and Emit for `is'.
23610 (Expression::ConvertImplicitRequired): Attempt to do constant
23611 expression conversions here. Maybe should be moved to
23612 ConvertImplicit, but I am not sure.
23613 (Expression::ImplicitLongConstantConversionPossible,
23614 Expression::ImplicitIntConstantConversionPossible): New functions
23615 that tell whether is it possible to apply an implicit constant
23616 expression conversion.
23618 (ConvertNumericExplicit): Started work on explicit numeric
23621 * cs-parser.jay: Update operator constants.
23623 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23624 (Parameters::GetSignature): Hook up VerifyArgs here.
23625 (Parameters::VerifyArgs): Verifies that no two arguments have the
23628 * class.cs (Operator): Update the operator names to reflect the
23629 ones that the spec expects (as we are just stringizing the
23632 * expression.cs (Unary::ResolveOperator): Fix bug: Use
23633 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23634 previous usage did only work for our methods.
23635 (Expression::ConvertImplicit): Handle decimal implicit numeric
23636 conversions as well.
23637 (Expression::InternalTypeConstructor): Used to invoke constructors
23638 on internal types for default promotions.
23640 (Unary::Emit): Implement special handling for the pre/post
23641 increment/decrement for overloaded operators, as they need to have
23642 the same semantics as the other operators.
23644 (Binary::ResolveOperator): ditto.
23645 (Invocation::ConversionExists): ditto.
23646 (UserImplicitCast::Resolve): ditto.
23648 2001-09-26 Ravi Pratap <ravi@ximian.com>
23650 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23651 operator, return after emitting body. Regression tests pass again !
23653 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23654 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23655 (Invocation::OverloadResolve): Ditto.
23656 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23658 * everywhere : update calls to the above methods accordingly.
23660 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23662 * assign.cs (Assign): Make it inherit from ExpressionStatement.
23664 * expression.cs (ExpressionStatement): New base class used for
23665 expressions that can appear in statements, so that we can provide
23666 an alternate path to generate expression that do not leave a value
23669 (Expression::Emit, and all the derivatives): We no longer return
23670 whether a value is left on the stack or not. Every expression
23671 after being emitted leaves a single value on the stack.
23673 * codegen.cs (EmitContext::EmitStatementExpression): Use the
23674 facilties of ExpressionStatement if possible.
23676 * cs-parser.jay: Update statement_expression.
23678 2001-09-25 Miguel de Icaza <miguel@ximian.com>
23680 * driver.cs: Change the wording of message
23682 2001-09-25 Ravi Pratap <ravi@ximian.com>
23684 * expression.cs (Binary::ResolveOperator): Had forgottten to set
23685 the type of the expression to the return type of the method if
23686 we have an overloaded operator match ! The regression tests pass again !
23687 (Unary::ResolveOperator): Ditto.
23689 * expression.cs (Invocation::ConversionExists): Correct the member lookup
23690 to find "op_Implicit", not "implicit" ;-)
23691 (UserImplicitCast): New class to take care of user-defined implicit conversions.
23692 (ConvertImplicit, ForceConversion): Take TypeContainer argument
23694 * everywhere : Correct calls to the above accordingly.
23696 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23697 (ConvertImplicit): Do user-defined conversion if it exists.
23699 2001-09-24 Miguel de Icaza <miguel@ximian.com>
23701 * assign.cs: track location.
23702 (Resolve): Use implicit conversions on assignment.
23704 * literal.cs: Oops. Not good, Emit of short access values should
23705 pass (Bytes) or the wrong argument will be selected.
23707 * expression.cs (Unary::Emit): Emit code for -expr.
23709 (Unary::ResolveOperator): Handle `Substract' for non-constants
23710 (substract from zero from the non-constants).
23711 Deal with Doubles as well.
23713 (Expression::ConvertImplicitRequired): New routine that reports an
23714 error if no implicit conversion exists.
23716 (Invocation::OverloadResolve): Store the converted implicit
23717 expressions if we make them
23719 2001-09-24 Ravi Pratap <ravi@ximian.com>
23721 * class.cs (ConstructorInitializer): Take a Location argument.
23722 (ConstructorBaseInitializer): Same here.
23723 (ConstructorThisInitializer): Same here.
23725 * cs-parser.jay : Update all calls accordingly.
23727 * expression.cs (Unary, Binary, New): Take location argument.
23728 Update accordingly everywhere.
23730 * cs-parser.jay : Update all calls to the above to take a location
23733 * class.cs : Ditto.
23735 2001-09-24 Ravi Pratap <ravi@ximian.com>
23737 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23738 (Invocation::BetterConversion): Same here
23739 (Invocation::ConversionExists): Ditto.
23741 (Invocation::ConversionExists): Implement.
23743 2001-09-22 Ravi Pratap <ravi@ximian.com>
23745 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23746 Also take an additional TypeContainer argument.
23748 * All over : Pass in TypeContainer as argument to OverloadResolve.
23750 * typemanager.cs (CSharpName): Update to check for the string type and return
23753 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23756 2001-09-21 Ravi Pratap <ravi@ximian.com>
23758 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23759 (Invocation::BetterFunction): Implement.
23760 (Invocation::BetterConversion): Implement.
23761 (Invocation::ConversionExists): Skeleton, no implementation yet.
23763 Okay, things work fine !
23765 2001-09-21 Miguel de Icaza <miguel@ximian.com>
23767 * typemanager.cs: declare and load enum_type, delegate_type and
23770 * expression.cs (Expression::Emit): Now emit returns a value that
23771 tells whether a value is left on the stack or not. This strategy
23772 might be reveted tomorrow with a mechanism that would address
23773 multiple assignments.
23774 (Expression::report118): Utility routine to report mismatches on
23777 (Unary::Report23): Report impossible type/operator combination
23780 (Unary::IsIncrementableNumber): Whether the type can be
23781 incremented or decremented with add.
23782 (Unary::ResolveOperator): Also allow enumerations to be bitwise
23784 (Unary::ResolveOperator): Implement ++, !, ~,
23786 (Invocation::Emit): Deal with new Emit convetion.
23788 * All Expression derivatives: Updated their Emit method to return
23789 whether they leave values on the stack or not.
23791 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23792 stack for expressions that are statements.
23794 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23796 * expression.cs (LValue): New interface. Must be implemented by
23798 (LocalVariableReference, ParameterReference, FieldExpr): Implement
23801 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23802 interface for generating code, simplifies the code.
23804 2001-09-20 Ravi Pratap <ravi@ximian.com>
23806 * expression.cs (everywhere): Comment out return statements in ::Resolve
23807 methods to avoid the warnings.
23809 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23811 * driver.cs (parse): Report error 2001 if we can not open the
23814 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23817 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23820 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23821 otherwise nested blocks end up with the same index.
23823 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23825 * expression.cs: Instead of having FIXMEs in the Resolve
23826 functions, throw exceptions so it is obvious that we are facing a
23829 * cs-parser.jay (invocation_expression): Pass Location information.
23831 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23832 Use a basename for those routines because .NET does not like paths
23835 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23838 2001-09-19 Miguel de Icaza <miguel@ximian.com>
23840 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23841 are loading the correct data types (throws an exception if not).
23842 (TypeManager::InitCoreTypes): Use CoreLookupType
23844 * expression.cs (Unary::ResolveOperator): return the child
23845 expression for expressions which are just +expr.
23846 (Unary::ResolveOperator): Return negative literals for -LITERAL
23847 expressions (otherwise they are Unary {Literal}).
23848 (Invocation::Badness): Take into account `Implicit constant
23849 expression conversions'.
23851 * literal.cs (LongLiteral): Implement long literal class.
23852 (IntLiteral): export the `Value' of the intliteral.
23854 2001-09-19 Ravi Pratap <ravi@ximian.com>
23856 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23858 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
23859 instead of 'Operator'
23861 * expression.cs (Binary::ResolveOperator): Update accordingly.
23862 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23865 * cs-parser.jay (unary_expression): Update to use the new names.
23867 * gen-treedump.cs (GetUnary): Same here.
23869 * expression.cs (Unary::Resolve): Implement.
23870 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
23871 operators are found instead of making noise ;-)
23872 (Unary::ResolveOperator): New method to do precisely the same thing which
23873 Binary::ResolveOperator does for Binary expressions.
23874 (Unary.method, .Arguments): Add.
23875 (Unary::OperName): Implement.
23876 (Unary::ForceConversion): Copy and Paste !
23878 * class.cs (Operator::Define): Fix a small bug for the case when we have
23881 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23882 for the inbuilt operators. Only overloading works for now ;-)
23884 2001-09-18 Miguel de Icaza <miguel@ximian.com>
23886 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23887 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23889 * expression.cs (This::Emit): Implement.
23890 (This::Resolve): Implement.
23891 (TypeOf:Resolve): Implement.
23892 (Expression::ResolveSimpleName): Add an implicit this to instance
23894 (MemberAccess::Resolve): Deal with Parameters and Fields.
23895 Bind instance variable to Field expressions.
23896 (FieldExpr::Instance): New field used to track the expression that
23897 represents the object instance.
23898 (FieldExpr::Resolve): Track potential errors from MemberLookup not
23900 (FieldExpr::Emit): Implement.
23902 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23903 the last instruction contains a return opcode to avoid generating
23904 the last `ret' instruction (this generates correct code, and it is
23905 nice to pass the peverify output).
23907 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23908 initializer for static and instance variables.
23909 (Constructor::Emit): Allow initializer to be null in the case of
23910 static constructors. Only emit initializer for instance
23913 (TypeContainer::FindMembers): Return a null array if there are no
23916 Also fix the code for the MemberTypes.Method branch, as it was not
23917 scanning that for operators (or tried to access null variables before).
23919 * assign.cs (Assign::Emit): Handle instance and static fields.
23923 * driver.cs: Stop compilation if there are parse errors.
23925 * cs-parser.jay (constructor_declaration): Provide default base
23926 initializer for non-static constructors.
23927 (constructor_declarator): Do not provide a default base
23928 initializers if none was specified.
23929 Catch the fact that constructors should not have parameters.
23931 * class.cs: Do not emit parent class initializers for static
23932 constructors, that should be flagged as an error.
23934 2001-09-18 Ravi Pratap <ravi@ximian.com>
23936 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23937 Move back code into TypeContainer::Populate.
23939 2001-09-18 Ravi Pratap <ravi@ximian.com>
23941 * class.cs (TypeContainer::AddConstructor): Fix the check to
23942 compare against Name, not Basename.
23943 (Operator::OpType): Change Plus and Minus to Add and Subtract.
23945 * cs-parser.jay : Update accordingly.
23947 * class.cs (TypeContainer::FindMembers): For the case where we are searching
23948 for methods, don't forget to look into the operators too.
23949 (RegisterMethodBuilder): Helper method to take care of this for
23950 methods, constructors and operators.
23951 (Operator::Define): Completely revamp.
23952 (Operator.OperatorMethod, MethodName): New fields.
23953 (TypeContainer::Populate): Move the registering of builders into
23954 RegisterMethodBuilder.
23955 (Operator::Emit): Re-write.
23957 * expression.cs (Binary::Emit): Comment out code path to emit method
23958 invocation stuff for the case when we have a user defined operator. I am
23959 just not able to get it right !
23961 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23963 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23966 (Expression::MemberLookup): Provide a version that allows to
23967 specify the MemberTypes and BindingFlags.
23969 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23970 so it was not fetching variable information from outer blocks.
23972 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23973 Beforefieldinit as it was buggy.
23975 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23976 that Ravi put here.
23978 * class.cs (Constructor::Emit): Only emit if block is not null.
23979 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23980 deal with this by semantically definining it as if the user had
23983 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23984 constructors as we now "emit" them at a higher level.
23986 (TypeContainer::DefineDefaultConstructor): Used to define the
23987 default constructors if none was provided.
23989 (ConstructorInitializer): Add methods Resolve and Emit.
23991 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23993 2001-09-17 Ravi Pratap <ravi@ximian.com>
23995 * class.cs (TypeContainer::EmitDefaultConstructor): Register
23996 the default constructor builder with our hashtable for methodbuilders
23999 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24000 and argument_count is 0 in which case we have a match.
24001 (Binary::ResolveOperator): More null checking and miscellaneous coding
24004 2001-09-17 Ravi Pratap <ravi@ximian.com>
24006 * rootcontext.cs (IsNameSpace): Compare against null.
24008 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24010 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24011 and Unary::Operator.
24013 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24016 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24017 we have overloaded operators.
24018 (Binary::ResolveOperator): Implement the part which does the operator overload
24021 * class.cs (Operator::Emit): Implement.
24022 (TypeContainer::Emit): Emit the operators we have too.
24024 * expression.cs (Binary::Emit): Update to emit the appropriate code for
24025 the case when we have a user-defined operator.
24027 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24029 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24031 2001-09-16 Ravi Pratap <ravi@ximian.com>
24033 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24034 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24035 (Constructor::Emit): Implement.
24036 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24037 if we have no work to do.
24038 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
24041 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24042 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24044 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24047 2001-09-15 Ravi Pratap <ravi@ximian.com>
24049 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24051 (Tree::RecordNamespace): Method to do what the name says ;-)
24052 (Tree::Namespaces): Property to get at the namespaces hashtable.
24054 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
24057 * rootcontext.cs (IsNamespace): Fixed it :-)
24059 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24061 * class.cs (TypeContainer::FindMembers): Add support for
24063 (MethodCore): New class that encapsulates both the shared aspects
24064 of a Constructor and a Method.
24065 (Method, Constructor): Factored pieces into MethodCore.
24067 * driver.cs: Added --fatal which makes errors throw exceptions.
24068 Load System assembly as well as part of the standard library.
24070 * report.cs: Allow throwing exceptions on errors for debugging.
24072 * modifiers.cs: Do not use `parent', instead use the real type
24073 container to evaluate permission settings.
24075 * class.cs: Put Ravi's patch back in. He is right, and we will
24076 have to cope with the
24078 2001-09-14 Ravi Pratap <ravi@ximian.com>
24080 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24081 FamORAssem, not FamANDAssem.
24083 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24085 * driver.cs: Added --parse option that only parses its input files
24088 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
24089 incorrect. IsTopLevel is not used to tell whether an object is
24090 root_types or not (that can be achieved by testing this ==
24091 root_types). But to see if this is a top-level *class* (not
24092 necessarly our "toplevel" container).
24094 2001-09-14 Ravi Pratap <ravi@ximian.com>
24096 * enum.cs (Enum::Define): Modify to call the Lookup method on the
24097 parent instead of a direct call to GetType.
24099 2001-09-14 Ravi Pratap <ravi@ximian.com>
24101 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24102 Modifiers.TypeAttr. This should just be a call to that method.
24104 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24105 object so that we can determine if we are top-level or not.
24107 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
24110 * enum.cs (Enum::Define): Ditto.
24112 * modifiers.cs (FieldAttr): Re-write.
24114 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24115 (TypeContainer::HaveStaticConstructor): New property to provide access
24116 to precisely that info.
24118 * modifiers.cs (MethodAttr): Re-write.
24119 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24121 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24122 of top-level types as claimed.
24124 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24126 * expression.cs (MemberLookup): Fruitless attempt to lookup
24127 constructors. Maybe I need to emit default constructors? That
24128 might be it (currently .NET emits this for me automatically).
24129 (Invocation::OverloadResolve): Cope with Arguments == null.
24130 (Invocation::EmitArguments): new function, shared by the new
24131 constructor and us.
24132 (Invocation::Emit): Handle static and instance methods. Emit
24133 proper call instruction for virtual or non-virtual invocations.
24134 (New::Emit): Implement.
24135 (New::Resolve): Implement.
24136 (MemberAccess:Resolve): Implement.
24137 (MethodGroupExpr::InstanceExpression): used conforming to the spec
24138 to track instances.
24139 (FieldExpr::Resolve): Set type.
24141 * support.cs: Handle empty arguments.
24143 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24144 SimpleLookup): Auxiliary routines to help parse a qualifier
24147 Update qualifier_identifier rule.
24149 * codegen.cs: Removed debugging messages.
24151 * class.cs: Make this a global thing, this acts just as a "key" to
24152 objects that we might have around.
24154 (Populate): Only initialize method_builders_to_methods once.
24156 * expression.cs (PropertyExpr): Initialize type from the
24159 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24160 Resolve pattern. Attempt to implicitly convert value to boolean.
24163 * expression.cs: Set the type for the int32/int32 argument case.
24164 (Binary::ResolveOperator): Set the return type to boolean for
24165 comparission operators
24167 * typemanager.cs: Remove debugging print code.
24169 (Invocation::Resolve): resolve type.
24171 * class.cs: Allocate a MemberInfo of the correct size, as the code
24172 elsewhere depends on the test to reflect the correct contents.
24174 (Method::) Keep track of parameters, due to System.Reflection holes
24176 (TypeContainer::Populate): Keep track of MethodBuilders to Method
24179 (TypeContainer::FindMembers): Use ArrayList and then copy an array
24180 of the exact size and return that.
24182 (Class::LookupMethodByBuilder): New function that maps
24183 MethodBuilders to its methods. Required to locate the information
24184 on methods because System.Reflection bit us again.
24186 * support.cs: New file, contains an interface ParameterData and
24187 two implementations: ReflectionParameters and InternalParameters
24188 used to access Parameter information. We will need to grow this
24191 * expression.cs (Invocation::GetParameterData): implement a cache
24192 and a wrapper around the ParameterData creation for methods.
24193 (Invocation::OverloadResolve): Use new code.
24195 2001-09-13 Ravi Pratap <ravi@ximian.com>
24197 * class.cs (TypeContainer::EmitField): Remove and move into
24198 (Field::Define): here and modify accordingly.
24199 (Field.FieldBuilder): New member.
24200 (TypeContainer::Populate): Update accordingly.
24201 (TypeContainer::FindMembers): Implement.
24203 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24205 * statement.cs: (VariableInfo::VariableType): New field to be
24206 initialized with the full type once it is resolved.
24208 2001-09-12 Miguel de Icaza <miguel@ximian.com>
24210 * parameter.cs (GetParameterInfo): Use a type cache to compute
24211 things only once, and to reuse this information
24213 * expression.cs (LocalVariableReference::Emit): Implement.
24214 (OpcodeCast::Emit): fix.
24216 (ParameterReference::Resolve): Implement.
24217 (ParameterReference::Emit): Implement.
24219 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24220 that are expressions need to stay as Expressions.
24222 * typemanager.cs (CSharpName): Returns the C# name of a type if
24225 * expression.cs (Expression::ConvertImplicit): New function that
24226 implements implicit type conversions.
24228 (Expression::ImplicitReferenceConversion): Implements implicit
24229 reference conversions.
24231 (EmptyCast): New type for transparent casts.
24233 (OpcodeCast): New type for casts of types that are performed with
24234 a sequence of bytecodes.
24236 (BoxedCast): New type used for casting value types into reference
24237 types. Emits a box opcode.
24239 (Binary::DoNumericPromotions): Implements numeric promotions of
24240 and computation of the Binary::Type.
24242 (Binary::EmitBranchable): Optimization.
24244 (Binary::Emit): Implement code emission for expressions.
24246 * typemanager.cs (TypeManager): Added two new core types: sbyte
24249 2001-09-12 Ravi Pratap <ravi@ximian.com>
24251 * class.cs (TypeContainer::FindMembers): Method which does exactly
24252 what Type.FindMembers does, only we don't have to use reflection. No
24253 implementation yet.
24255 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24256 typecontainer objects as we need to get at them.
24257 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24259 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24260 typecontainer object.
24262 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24263 of just a Report object.
24265 2001-09-11 Ravi Pratap <ravi@ximian.com>
24267 * class.cs (Event::Define): Go back to using the prefixes "add_" and
24269 (TypeContainer::Populate): Now define the delegates of the type too.
24270 (TypeContainer.Delegates): Property to access the list of delegates defined
24273 * delegates.cs (Delegate::Define): Implement partially.
24275 * modifiers.cs (TypeAttr): Handle more flags.
24277 2001-09-11 Ravi Pratap <ravi@ximian.com>
24279 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24281 (Operator::Define): Re-write logic to get types by using the LookupType method
24282 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24283 (Indexer::Define): Ditto.
24284 (Event::Define): Ditto.
24285 (Property::Define): Ditto.
24287 2001-09-10 Ravi Pratap <ravi@ximian.com>
24289 * class.cs (TypeContainer::Populate): Now define operators too.
24290 (TypeContainer.Operators): New property to access the list of operators
24292 (Operator.OperatorMethodBuilder): New member to hold the method builder
24293 for the operator we are defining.
24294 (Operator::Define): Implement.
24296 2001-09-10 Ravi Pratap <ravi@ximian.com>
24298 * class.cs (Event::Define): Make the prefixes of the accessor methods
24299 addOn_ and removeOn_
24301 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24302 of the location being passed in too. Ideally, this should go later since all
24303 error reporting should be done through the Report object.
24305 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24306 (Populate): Iterate thru the indexers we have and define them too.
24307 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24308 for the get and set accessors.
24309 (Indexer::Define): Implement.
24311 2001-09-09 Miguel de Icaza <miguel@ximian.com>
24313 * expression.cs (Binary::Resolve): Beginning of it. I scratched
24314 my previous implementation, did not work.
24316 * typemanager.cs: Add a couple of missing types (the longs).
24318 * literal.cs: Use TypeManager.bool_type instead of getting it.
24320 * expression.cs (EventExpr): New kind of expressions.
24321 (Expressio::ExprClassFromMemberInfo): finish
24323 2001-09-08 Miguel de Icaza <miguel@ximian.com>
24325 * assign.cs: Emit stores to static fields differently.
24327 2001-09-08 Ravi Pratap <ravi@ximian.com>
24329 * Merge in changes and adjust code to tackle conflicts. Backed out my
24330 code in Assign::Resolve ;-)
24332 2001-09-08 Ravi Pratap <ravi@ximian.com>
24334 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24335 instead Report.Error and also pass in the location.
24336 (CSharpParser::Lexer): New readonly property to return the reference
24337 to the Tokenizer object.
24338 (declare_local_variables): Use Report.Error with location instead of plain
24342 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24343 (Operator.CheckBinaryOperator): Ditto.
24345 * cs-parser.jay (operator_declarator): Update accordingly.
24347 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24348 (CheckBinaryOperator): Same here.
24350 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24351 on the name without any prefixes of namespace names etc. This is because we
24352 already might have something already fully qualified like
24353 'System.Console.WriteLine'
24355 * assign.cs (Resolve): Begin implementation. Stuck ;-)
24357 2001-09-07 Ravi Pratap <ravi@ximian.com>
24359 * cs-tokenizer.cs (location): Return a string which also contains
24362 * expression.cs (ElementAccess): New class for expressions of the
24363 type 'element access.'
24364 (BaseAccess): New class for expressions of the type 'base access.'
24365 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24368 * cs-parser.jay (element_access): Implement action.
24369 (base_access): Implement actions.
24370 (checked_expression, unchecked_expression): Implement.
24372 * cs-parser.jay (local_variable_type): Correct and implement.
24373 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24375 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24377 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24378 name and the specifiers.
24380 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24382 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
24383 making them all public ;-)
24385 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24388 2001-09-07 Miguel de Icaza <miguel@ximian.com>
24390 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24392 (FieldExpr, PropertyExprs): New resolved expressions.
24393 (SimpleName::MemberStaticCheck): Perform static checks for access
24394 to non-static fields on static methods. Maybe this should be
24395 generalized for MemberAccesses.
24396 (SimpleName::ResolveSimpleName): More work on simple name
24399 * cs-parser.jay (primary_expression/qualified_identifier): track
24400 the parameter index.
24402 * codegen.cs (CodeGen::Save): Catch save exception, report error.
24403 (EmitContext::EmitBoolExpression): Chain to expression generation
24404 instead of temporary hack.
24405 (::EmitStatementExpression): Put generic expression code generation.
24407 * assign.cs (Assign::Emit): Implement variable assignments to
24408 local variables, parameters and fields.
24410 2001-09-06 Miguel de Icaza <miguel@ximian.com>
24412 * statement.cs (Block::GetVariableInfo): New method, returns the
24413 VariableInfo for a variable name in a block.
24414 (Block::GetVariableType): Implement in terms of GetVariableInfo
24416 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24417 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24419 2001-09-06 Ravi Pratap <ravi@ximian.com>
24421 * cs-parser.jay (operator_declaration): Continue on my quest : update
24422 to take attributes argument.
24423 (event_declaration): Ditto.
24424 (enum_declaration): Ditto.
24425 (indexer_declaration): Ditto.
24427 * class.cs (Operator::Operator): Update constructor accordingly.
24428 (Event::Event): Ditto.
24430 * delegate.cs (Delegate::Delegate): Same here.
24432 * enum.cs (Enum::Enum): Same here.
24434 2001-09-05 Ravi Pratap <ravi@ximian.com>
24436 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24438 * ../tests/cs0658.cs : New file to demonstrate error 0658.
24440 * attribute.cs (Attributes): New class to encapsulate all attributes which were
24441 being passed around as an arraylist.
24442 (Attributes::AddAttribute): Method to add attribute sections.
24444 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24445 (struct_declaration): Update accordingly.
24446 (constant_declaration): Update.
24447 (field_declaration): Update.
24448 (method_header): Update.
24449 (fixed_parameter): Update.
24450 (parameter_array): Ditto.
24451 (property_declaration): Ditto.
24452 (destructor_declaration): Ditto.
24454 * class.cs (Struct::Struct): Update constructors accordingly.
24455 (Class::Class): Ditto.
24456 (Field::Field): Ditto.
24457 (Method::Method): Ditto.
24458 (Property::Property): Ditto.
24459 (TypeContainer::OptAttribute): update property's return type.
24461 * interface.cs (Interface.opt_attributes): New member.
24462 (Interface::Interface): Update to take the extra Attributes argument.
24464 * parameter.cs (Parameter::Parameter): Ditto.
24466 * constant.cs (Constant::Constant): Ditto.
24468 * interface.cs (InterfaceMemberBase): New OptAttributes field.
24469 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
24470 the attributes as a parameter.
24471 (InterfaceProperty): Update constructor call.
24472 (InterfaceEvent): Ditto.
24473 (InterfaceMethod): Ditto.
24474 (InterfaceIndexer): Ditto.
24476 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
24477 pass the attributes too.
24478 (interface_event_declaration): Ditto.
24479 (interface_property_declaration): Ditto.
24480 (interface_method_declaration): Ditto.
24481 (interface_declaration): Ditto.
24483 2001-09-05 Miguel de Icaza <miguel@ximian.com>
24485 * class.cs (Method::Define): Track the "static Main" definition to
24486 create an entry point.
24488 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24489 EntryPoint if we find it.
24491 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24492 (EmitContext::ig): Make this variable public.
24494 * driver.cs: Make the default output file be the first file name
24495 with the .exe extension.
24497 Detect empty compilations
24499 Handle various kinds of output targets. Handle --target and
24500 rename -t to --dumper.
24502 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24503 methods inherited from Expression return now an Expression. This
24504 will is used during the tree rewriting as we resolve them during
24507 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24508 the spec. Missing entirely is the information about
24509 accessability of elements of it.
24511 (Expression::ExprClassFromMemberInfo): New constructor for
24512 Expressions that creates a fully initialized Expression based on
24513 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24516 (Invocation::Resolve): Begin implementing resolution of invocations.
24518 * literal.cs (StringLiteral): Implement Emit.
24520 2001-09-05 Ravi Pratap <ravi@ximian.com>
24522 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24525 2001-09-04 Ravi Pratap <ravi@ximian.com>
24527 * cs-parser.jay (attribute_arguments): Implement actions.
24528 (attribute): Fix bug in production. Implement action.
24529 (attribute_list): Implement.
24530 (attribute_target): Implement.
24531 (attribute_target_specifier, opt_target_specifier): Implement
24532 (CheckAttributeTarget): New method to check if the attribute target
24534 (attribute_section): Implement.
24535 (opt_attributes): Implement.
24537 * attribute.cs : New file to handle attributes.
24538 (Attribute): Class to hold attribute info.
24540 * cs-parser.jay (opt_attribute_target_specifier): Remove production
24541 (attribute_section): Modify production to use 2 different rules to
24542 achieve the same thing. 1 s/r conflict down !
24543 Clean out commented, useless, non-reducing dimension_separator rules.
24545 * class.cs (TypeContainer.attributes): New member to hold list
24546 of attributes for a type.
24547 (Struct::Struct): Modify to take one more argument, the attribute list.
24548 (Class::Class): Ditto.
24549 (Field::Field): Ditto.
24550 (Method::Method): Ditto.
24551 (Property::Property): Ditto.
24553 * cs-parser.jay (struct_declaration): Update constructor call to
24554 pass in the attributes too.
24555 (class_declaration): Ditto.
24556 (constant_declaration): Ditto.
24557 (field_declaration): Ditto.
24558 (method_header): Ditto.
24559 (fixed_parameter): Ditto.
24560 (parameter_array): Ditto.
24561 (property_declaration): Ditto.
24563 * constant.cs (Constant::Constant): Update constructor similarly.
24564 Use System.Collections.
24566 * parameter.cs (Parameter::Parameter): Update as above.
24568 2001-09-02 Ravi Pratap <ravi@ximian.com>
24570 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24571 (TypeContainer.delegates): New member to hold list of delegates.
24573 * cs-parser.jay (delegate_declaration): Implement the action correctly
24574 this time as I seem to be on crack ;-)
24576 2001-09-02 Miguel de Icaza <miguel@ximian.com>
24578 * rootcontext.cs (RootContext::IsNamespace): new function, used to
24579 tell whether an identifier represents a namespace.
24581 * expression.cs (NamespaceExpr): A namespace expression, used only
24582 temporarly during expression resolution.
24583 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24584 utility functions to resolve names on expressions.
24586 2001-09-01 Miguel de Icaza <miguel@ximian.com>
24588 * codegen.cs: Add hook for StatementExpressions.
24590 * class.cs: Fix inverted test for static flag in methods.
24592 2001-09-02 Ravi Pratap <ravi@ximian.com>
24594 * class.cs (Operator::CheckUnaryOperator): Correct error number used
24595 to make it coincide with MS' number.
24596 (Operator::CheckBinaryOperator): Ditto.
24598 * ../errors/errors.txt : Remove error numbers added earlier.
24600 * ../errors/cs1019.cs : Test case for error # 1019
24602 * ../errros/cs1020.cs : Test case for error # 1020
24604 * cs-parser.jay : Clean out commented cruft.
24605 (dimension_separators, dimension_separator): Comment out. Ostensibly not
24606 used anywhere - non-reducing rule.
24607 (namespace_declarations): Non-reducing rule - comment out.
24609 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24610 with TypeContainer::AddEnum.
24612 * delegate.cs : New file for delegate handling classes.
24613 (Delegate): Class for declaring delegates.
24615 * makefile : Update.
24617 * cs-parser.jay (delegate_declaration): Implement.
24619 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
24621 * class.cs (Event::Define): Implement.
24622 (Event.EventBuilder): New member.
24624 * class.cs (TypeContainer::Populate): Update to define all enums and events
24626 (Events): New property for the events arraylist we hold. Shouldn't we move to using
24627 readonly fields for all these cases ?
24629 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24631 * class.cs (Property): Revamp to use the convention of making fields readonly.
24632 Accordingly modify code elsewhere.
24634 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24635 the Define method of the Property class.
24637 * class.cs : Clean up applied patch and update references to variables etc. Fix
24639 (TypeContainer::Populate): Update to define all the properties we have. Also
24640 define all enumerations.
24642 * enum.cs (Define): Implement.
24644 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24646 * cs-parser.jay (overloadable_operator): The semantic value is an
24647 enum of the Operator class.
24648 (operator_declarator): Implement actions.
24649 (operator_declaration): Implement.
24651 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24652 validity of definitions.
24653 (Operator::CheckBinaryOperator): Static method to check for binary operators
24654 (TypeContainer::AddOperator): New method to add an operator to a type.
24656 * cs-parser.jay (indexer_declaration): Added line to actually call the
24657 AddIndexer method so it gets added ;-)
24659 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
24660 already taken care of by the MS compiler ?
24662 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24664 * class.cs (Operator): New class for operator declarations.
24665 (Operator::OpType): Enum for the various operators.
24667 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24669 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24670 ostensibly handle this in semantic analysis.
24672 * cs-parser.jay (general_catch_clause): Comment out
24673 (specific_catch_clauses, specific_catch_clause): Ditto.
24674 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24675 (catch_args, opt_catch_args): New productions.
24676 (catch_clause): Rewrite to use the new productions above
24677 (catch_clauses): Modify accordingly.
24678 (opt_catch_clauses): New production to use in try_statement
24679 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24680 and re-write the code in the actions to extract the specific and
24681 general catch clauses by being a little smart ;-)
24683 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24684 Hooray, try and catch statements parse fine !
24686 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24688 * statement.cs (Block::GetVariableType): Fix logic to extract the type
24689 string from the hashtable of variables.
24691 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24692 I end up making that mistake ;-)
24693 (catch_clauses): Fixed gross error which made Key and Value of the
24694 DictionaryEntry the same : $1 !!
24696 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24698 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24700 * cs-parser.jay (event_declaration): Correct to remove the semicolon
24701 when the add and remove accessors are specified.
24703 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24705 * cs-parser.jay (IndexerDeclaration): New helper class to hold
24706 information about indexer_declarator.
24707 (indexer_declarator): Implement actions.
24708 (parsing_indexer): New local boolean used to keep track of whether
24709 we are parsing indexers or properties. This is necessary because
24710 implicit_parameters come into picture even for the get accessor in the
24711 case of an indexer.
24712 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24714 * class.cs (Indexer): New class for indexer declarations.
24715 (TypeContainer::AddIndexer): New method to add an indexer to a type.
24716 (TypeContainer::indexers): New member to hold list of indexers for the
24719 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24721 * cs-parser.jay (add_accessor_declaration): Implement action.
24722 (remove_accessor_declaration): Implement action.
24723 (event_accessors_declaration): Implement
24724 (variable_declarators): swap statements for first rule - trivial.
24726 * class.cs (Event): New class to hold information about event
24728 (TypeContainer::AddEvent): New method to add an event to a type
24729 (TypeContainer::events): New member to hold list of events.
24731 * cs-parser.jay (event_declaration): Implement actions.
24733 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24735 * cs-parser.jay (dim_separators): Implement. Make it a string
24736 concatenating all the commas together, just as they appear.
24737 (opt_dim_separators): Modify accordingly
24738 (rank_specifiers): Update accordingly. Basically do the same
24739 thing - instead, collect the brackets here.
24740 (opt_rank_sepcifiers): Modify accordingly.
24741 (array_type): Modify to actually return the complete type string
24742 instead of ignoring the rank_specifiers.
24743 (expression_list): Implement to collect the expressions
24744 (variable_initializer): Implement. We make it a list of expressions
24745 essentially so that we can handle the array_initializer case neatly too.
24746 (variable_initializer_list): Implement.
24747 (array_initializer): Make it a list of variable_initializers
24748 (opt_array_initializer): Modify accordingly.
24750 * expression.cs (New::NType): Add enumeration to help us
24751 keep track of whether we have an object/delegate creation
24752 or an array creation.
24753 (New:NewType, New::Rank, New::Indices, New::Initializers): New
24754 members to hold data about array creation.
24755 (New:New): Modify to update NewType
24756 (New:New): New Overloaded contructor for the array creation
24759 * cs-parser.jay (array_creation_expression): Implement to call
24760 the overloaded New constructor.
24762 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
24764 * class.cs (TypeContainer::Constructors): Return member
24765 constructors instead of returning null.
24767 2001-08-26 Miguel de Icaza <miguel@ximian.com>
24769 * typemanager.cs (InitCoreTypes): Initialize the various core
24770 types after we have populated the type manager with the user
24771 defined types (this distinction will be important later while
24772 compiling corlib.dll)
24774 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24775 on Expression Classification. Now all expressions have a method
24776 `Resolve' and a method `Emit'.
24778 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24779 generation from working. Also add some temporary debugging
24782 2001-08-24 Miguel de Icaza <miguel@ximian.com>
24784 * codegen.cs: Lots of code generation pieces. This is only the
24785 beginning, will continue tomorrow with more touches of polish. We
24786 handle the fundamentals of if, while, do, for, return. Others are
24787 trickier and I need to start working on invocations soon.
24789 * gen-treedump.cs: Bug fix, use s.Increment here instead of
24792 * codegen.cs (EmitContext): New struct, used during code
24793 emission to keep a context. Most of the code generation will be
24796 * cs-parser.jay: Add embedded blocks to the list of statements of
24797 this block. So code generation proceeds in a top down fashion.
24799 2001-08-23 Miguel de Icaza <miguel@ximian.com>
24801 * statement.cs: Add support for multiple child blocks.
24803 2001-08-22 Miguel de Icaza <miguel@ximian.com>
24805 * codegen.cs (EmitCode): New function, will emit the code for a
24806 Block of code given a TypeContainer and its ILGenerator.
24808 * statement.cs (Block): Standard public readonly optimization.
24809 (Block::Block constructors): Link children.
24810 (Block::Child): Child Linker.
24811 (Block::EmitVariables): Emits IL variable declarations.
24813 * class.cs: Drop support for MethodGroups here, delay until
24815 (Method::): Applied the same simplification that I did before, and
24816 move from Properties to public readonly fields.
24817 (Method::ParameterTypes): Returns the parameter types for the
24818 function, and implements a cache that will be useful later when I
24819 do error checking and the semantic analysis on the methods is
24821 (Constructor::GetCallingConvention): Renamed from CallingConvetion
24822 and made a method, optional argument tells whether this is a class
24823 or a structure to apply the `has-this' bit.
24824 (Method::GetCallingConvention): Implement, returns the calling
24826 (Method::Define): Defines the type, a second pass is performed
24827 later to populate the methods.
24829 (Constructor::ParameterTypes): implement a cache similar to the
24830 one on Method::ParameterTypes, useful later when we do semantic
24833 (TypeContainer::EmitMethod): New method. Emits methods.
24835 * expression.cs: Removed MethodGroup class from here.
24837 * parameter.cs (Parameters::GetCallingConvention): new method.
24839 2001-08-21 Miguel de Icaza <miguel@ximian.com>
24841 * class.cs (TypeContainer::Populate): Drop RootContext from the
24844 (Constructor::CallingConvention): Returns the calling convention.
24845 (Constructor::ParameterTypes): Returns the constructor parameter
24848 (TypeContainer::AddConstructor): Keep track of default constructor
24849 and the default static constructor.
24851 (Constructor::) Another class that starts using `public readonly'
24852 instead of properties.
24854 (Constructor::IsDefault): Whether this is a default constructor.
24856 (Field::) use readonly public fields instead of properties also.
24858 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24859 track of static constructors; If none is used, turn on
24860 BeforeFieldInit in the TypeAttributes.
24862 * cs-parser.jay (opt_argument_list): now the return can be null
24863 for the cases where there are no arguments.
24865 (constructor_declarator): If there is no implicit `base' or
24866 `this', then invoke the default parent constructor.
24868 * modifiers.cs (MethodAttr): New static function maps a set of
24869 modifiers flags into a MethodAttributes enum
24870 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
24871 MethodAttr, TypeAttr to represent the various mappings where the
24872 modifiers are used.
24873 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
24875 2001-08-19 Miguel de Icaza <miguel@ximian.com>
24877 * parameter.cs (GetParameterInfo): Fix bug where there would be no
24880 * interface.cs (PopulateIndexer): Implemented the code generator
24881 for interface indexers.
24883 2001-08-17 Miguel de Icaza <miguel@ximian.com>
24885 * interface.cs (InterfaceMemberBase): Now we track the new status
24888 (PopulateProperty): Implement property population. Woohoo! Got
24889 Methods and Properties going today.
24891 Removed all the properties for interfaces, and replaced them with
24892 `public readonly' fields.
24894 2001-08-16 Miguel de Icaza <miguel@ximian.com>
24896 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24897 initialize their hashtables/arraylists only when they are needed
24898 instead of doing this always.
24900 * parameter.cs: Handle refs and out parameters.
24902 * cs-parser.jay: Use an ArrayList to construct the arguments
24903 instead of the ParameterCollection, and then cast that to a
24906 * parameter.cs: Drop the use of ParameterCollection and use
24907 instead arrays of Parameters.
24909 (GetParameterInfo): Use the Type, not the Name when resolving
24912 2001-08-13 Miguel de Icaza <miguel@ximian.com>
24914 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24915 and instead use public readonly fields.
24917 * class.cs: Put back walking code for type containers.
24919 2001-08-11 Miguel de Icaza <miguel@ximian.com>
24921 * class.cs (MakeConstant): Code to define constants.
24923 * rootcontext.cs (LookupType): New function. Used to locate types
24926 2001-08-08 Miguel de Icaza <miguel@ximian.com>
24928 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
24929 this System.Reflection code is. Kudos to Microsoft
24931 * typemanager.cs: Implement a type cache and avoid loading all
24932 types at boot time. Wrap in LookupType the internals. This made
24933 the compiler so much faster. Wow. I rule!
24935 * driver.cs: Make sure we always load mscorlib first (for
24936 debugging purposes, nothing really important).
24938 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
24939 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
24941 * rootcontext.cs: Lookup types on their namespace; Lookup types
24942 on namespaces that have been imported using the `using' keyword.
24944 * class.cs (TypeContainer::TypeAttr): Virtualize.
24945 (Class::TypeAttr): Return attributes suitable for this bad boy.
24946 (Struct::TypeAttr): ditto.
24947 Handle nested classes.
24948 (TypeContainer::) Remove all the type visiting code, it is now
24949 replaced with the rootcontext.cs code
24951 * rootcontext.cs (GetClassBases): Added support for structs.
24953 2001-08-06 Miguel de Icaza <miguel@ximian.com>
24955 * interface.cs, statement.cs, class.cs, parameter.cs,
24956 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24957 Drop use of TypeRefs, and use strings instead.
24959 2001-08-04 Miguel de Icaza <miguel@ximian.com>
24963 * class.cs (Struct::Struct): set the SEALED flags after
24964 checking the modifiers.
24965 (TypeContainer::TypeAttr): new property, returns the
24966 TypeAttributes for a class.
24968 * cs-parser.jay (type_list): Oops, list production was creating a
24969 new list of base types.
24971 * rootcontext.cs (StdLib): New property.
24972 (GetInterfaceTypeByName): returns an interface by type name, and
24973 encapsulates error handling here.
24974 (GetInterfaces): simplified.
24975 (ResolveTree): Encapsulated all the tree resolution here.
24976 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24979 * driver.cs: Add support for --nostdlib, to avoid loading the
24980 default assemblies.
24981 (Main): Do not put tree resolution here.
24983 * rootcontext.cs: Beginning of the class resolution.
24985 2001-08-03 Miguel de Icaza <miguel@ximian.com>
24987 * rootcontext.cs: Provide better error reporting.
24989 * cs-parser.jay (interface_base): set our $$ to be interfaces.
24991 * rootcontext.cs (CreateInterface): Handle the case where there
24992 are no parent interfaces.
24994 (CloseTypes): Routine to flush types at the end.
24995 (CreateInterface): Track types.
24996 (GetInterfaces): Returns an array of Types from the list of
24997 defined interfaces.
24999 * typemanager.c (AddUserType): Mechanism to track user types (puts
25000 the type on the global type hash, and allows us to close it at the
25003 2001-08-02 Miguel de Icaza <miguel@ximian.com>
25005 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25006 RecordInterface instead.
25008 * cs-parser.jay: Updated to reflect changes above.
25010 * decl.cs (Definition): Keep track of the TypeBuilder type that
25011 represents this type here. Not sure we will use it in the long
25012 run, but wont hurt for now.
25014 * driver.cs: Smaller changes to accomodate the new code.
25016 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25019 * rootcontext.cs (CreateInterface): New method, used to create
25020 the System.TypeBuilder type for interfaces.
25021 (ResolveInterfaces): new entry point to resolve the interface
25023 (CodeGen): Property, used to keep track of the code generator.
25025 2001-07-26 Miguel de Icaza <miguel@ximian.com>
25027 * cs-parser.jay: Add a second production for delegate_declaration
25030 (enum_body): Put an opt_comma here instead of putting it on
25031 enum_body or enum_member_declarations so we can handle trailing
25032 commas on enumeration members. Gets rid of a shift/reduce.
25034 (type_list): Need a COMMA in the middle.
25036 (indexer_declaration): Tell tokenizer to recognize get/set
25038 * Remove old targets.
25040 * Re-add the parser target.
25042 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25044 * cs-parser.jay: Add precendence rules for a number of operators
25045 ot reduce the number of shift/reduce conflicts in the grammar.
25047 2001-07-17 Miguel de Icaza <miguel@ximian.com>
25049 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25052 Get rid of old crufty code.
25054 * rootcontext.cs: Use this to keep track of the parsed
25055 representation and the defined types available to the program.
25057 * gen-treedump.cs: adjust for new convention.
25059 * type.cs: Split out the type manager, and the assembly builder
25062 * typemanager.cs: the type manager will live here now.
25064 * cil-codegen.cs: And the code generator here.
25066 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
25068 * makefile: Fixed up for easy making.
25070 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25072 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25075 (unary_expression): Expand pre_increment_expression and
25076 post_decrement_expression to reduce a shift/reduce.
25078 2001-07-11 Simon Cozens
25080 * cs-tokenizer.cs: Hex numbers should begin with a 0.
25082 Improve allow_keyword_as_indent name.
25084 2001-06-19 Miguel de Icaza <miguel@ximian.com>
25086 * Adjustments for Beta2.
25088 2001-06-13 Miguel de Icaza <miguel@ximian.com>
25090 * decl.cs: Added `Define' abstract method.
25091 (InTransit): new property, used to catch recursive definitions.
25093 * interface.cs: Implement `Define'.
25095 * modifiers.cs: Map Modifiers.constants to
25096 System.Reflection.TypeAttribute flags.
25098 * class.cs: Keep track of types and user-defined types.
25099 (BuilderInit): New method for creating an assembly
25100 (ResolveType): New function to launch the resolution process, only
25101 used by interfaces for now.
25103 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25104 that are inserted into the name space.
25106 2001-06-08 Miguel de Icaza <miguel@ximian.com>
25108 * ARGH. I have screwed up my tree so many times due to the use of
25109 rsync rather than using CVS. Going to fix this at once.
25111 * driver.cs: Objetify driver. Load assemblies, use assemblies to
25114 2001-06-07 Miguel de Icaza <miguel@ximian.com>
25116 * Experiment successful: Use System.Type rather that our own
25119 2001-05-25 Miguel de Icaza <miguel@ximian.com>
25121 * cs-parser.jay: Removed nsAliases from here.
25123 Use new namespaces, handle `using XXX;'
25125 * namespace.cs: Reimplemented namespace handling, use a recursive
25126 definition of the class. Now we can keep track of using clauses
25127 and catch invalid using clauses.
25129 2001-05-24 Miguel de Icaza <miguel@ximian.com>
25131 * gen-treedump.cs: Adapted for all the renaming.
25133 * expression.cs (Expression): this class now has a Type property
25134 which returns an expression Type.
25136 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25137 `Type', as this has a different meaning now in the base
25139 2001-05-22 Miguel de Icaza <miguel@ximian.com>
25141 * interface.cs, class.cs: Removed from all the sources the
25142 references to signature computation, as we can not do method
25143 signature computation during the parsing time, as we are not
25144 trying to solve at that point distinguishing:
25148 void a (NS.Blah x) {}
25151 Which depending on the context might be valid or not, as we do not
25152 know if Blah is the same thing as NS.Blah at that point.
25154 * Redid everything so the code uses TypeRefs now instead of
25155 Types. TypeRefs are just temporary type placeholders, that need
25156 to be resolved. They initially have a pointer to a string and the
25157 current scope in which they are used. This is used later by the
25158 compiler to resolve the reference to an actual Type.
25160 * DeclSpace is no longer a CIR.Type, and neither are
25161 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
25162 are all DeclSpaces, but no Types.
25164 * type.cs (TypeRefManager): This implements the TypeRef manager,
25165 which keeps track of all the types that need to be resolved after
25166 the parsing has finished.
25168 2001-05-13 Miguel de Icaza <miguel@ximian.com>
25170 * ARGH. We are going to have to store `foreach' as a class rather
25171 than resolving it, as we need to verify error 1579 after name
25172 resolution. *OR* we could keep a flag that says `This request to
25173 IEnumerator comes from a foreach statement' which we can then use
25174 to generate the error.
25176 2001-05-10 Miguel de Icaza <miguel@ximian.com>
25178 * class.cs (TypeContainer.AddMethod): we now add methods to the
25179 MethodGroup instead of the method hashtable.
25181 * expression.cs: Add MethodGroup abstraction, which gets us one
25182 step closer to the specification in the way we handle method
25185 * cs-parser.jay (primary_expression): qualified_identifier now
25186 tried to match up an identifier to a local variable reference or
25187 to a parameter reference.
25189 current_local_parameters is now a parser global variable that
25190 points to the current parameters for the block, used during name
25193 (property_declaration): Now creates an implicit `value' argument to
25196 2001-05-09 Miguel de Icaza <miguel@ximian.com>
25198 * parameter.cs: Do not use `param' arguments as part of the
25199 signature, per the spec.
25201 2001-05-08 Miguel de Icaza <miguel@ximian.com>
25203 * decl.cs: Base class for classes, structs and interfaces. This
25204 is the "Declaration Space"
25206 * cs-parser.jay: Use CheckDef for checking declaration errors
25207 instead of having one on each function.
25209 * class.cs: Factor out some code for handling error handling in
25210 accordance to the "Declarations" section in the "Basic Concepts"
25211 chapter in the ECMA C# spec.
25213 * interface.cs: Make all interface member classes derive from
25214 InterfaceMemberBase.
25216 2001-05-07 Miguel de Icaza <miguel@ximian.com>
25218 * Many things: all interfaces are parsed and generated in
25219 gen-treedump. Support for member variables, constructors,
25220 destructors, properties, constants is there.
25222 Beginning of the IL backend, but very little done, just there for
25225 2001-04-29 Miguel de Icaza <miguel@ximian.com>
25227 * cs-parser.jay: Fix labeled statement.
25229 * cs-tokenizer.cs (escape): Escape " and ' always.
25230 ref_line, ref_name: keep track of the line/filename as instructed
25231 by #line by the compiler.
25234 2001-04-27 Miguel de Icaza <miguel@ximian.com>
25236 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25237 to match the values in System.CodeDOM.
25239 Divid renamed to Divide.
25241 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25243 (Statements.set): remove.
25245 * System.CodeDOM/CodeCatchClause.cs: always have a valid
25248 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25249 falseStatements always have valid values.
25251 * cs-parser.jay: Use System.CodeDOM now.