1 2006-03-04 Marek Safar <marek.safar@seznam.cz>
5 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
7 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
9 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
10 Removed redundant code and set NewSlot for Invoke method too.
12 * parameter.cs (Parameters.ctor): Add custom, type ctor.
13 (Parameters.MergeGenerated): New method. Use this method when you merge
14 compiler generated argument with user arguments.
16 2006-03-03 Marek Safar <marek.safar@seznam.cz>
18 * attribute.cs (ResolveAsTypeTerminal): Removed.
20 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
21 specialization for predefined types; 30% speed up.
22 Finally placed obsolete check to right place.
23 (Expression.ResolveType): Removed.
25 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
26 Updated after ResolveType was removed.
28 * expression.cs (Cast.ctor): Check void cast.
29 (Binary.ResolveAsTypeTerminal): Is never type.
30 (Conditional.ResolveAsTypeTerminal): Is never type.
32 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
34 2006-03-26 Marek Safar <marek.safar@seznam.cz>
36 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
38 2006-03-23 Martin Baulig <martin@ximian.com>
40 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
41 type check if either of the types is an open generic type.
43 2006-03-23 Martin Baulig <martin@ximian.com>
46 (Convert.ExplicitTypeParameterConversion): New method; implement
47 explicit type parameter conversions.
49 2006-03-23 Martin Baulig <martin@ximian.com>
51 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
52 blindly allow all conversions if we do not have any constraints.
54 2006-02-27 Marek Safar <marek.safar@seznam.cz>
56 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
57 these two separated members to simplify the code.
58 (Attribute.Resolve): Refactored to use new fields and methods.
59 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
60 implemented obsolete attribute checking.
61 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
62 implemented obsolete checking again. It look line never ending quest ;-)
63 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
65 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
67 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
69 *class.cs (Property.Define): Add RegisterProperty call.
71 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
72 argument groups (only 2).
74 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
75 encoding expression to arguments.
76 (Expression.ExprClassToResolveFlags): Just turned to property.
78 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
79 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
80 optimized as well as implemented support for zero-length attributes.
82 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
83 Add caching of PropertyInfo's.
85 2006-02-25 Marek Safar <marek.safar@seznam.cz>
87 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
90 2006-02-25 Marek Safar <marek.safar@seznam.cz>
92 New partial class implementation.
93 A fix for #77027, #77029, #77403
95 * attribute.cs (Attributable): Made attributes protected.
97 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
98 the replacements of ClassPart and PartialContainer.
99 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
100 (TypeContainer.AddInterface): Ditto.
101 (TypeContainer.AddPartial): The main method for partial classes. It checks
102 for errors and merges ModFlags and attributes. At the end class is added to
104 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
106 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
107 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
108 from the rest of partial classes.
109 (TypeContainer.GetClassBases): Simplified.
110 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
112 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
113 (TypeContainer.HasExplicitLayout): Uses Flags now.
114 (PartialContainer): Removed.
115 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
116 (StaticClass): Was merged with Class.
117 (Class.GetClassBases): class and static class bases are verified here.
118 (Class.TypeAttr): Added static attributes when class is static.
119 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
120 (MemberBase): In some cases we need to call parent container for partial
121 class. It should be eliminated but it's not easy now.
123 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
125 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
126 partial classed to accumulate class comments.
127 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
129 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
131 * driver.cs (MainDriver): Tree.GetDecl was removed.
133 * modifiers.cs (Modifiers): Add partial modifier.
135 * tree.cs (Tree.decl): Removed.
136 (RootTypes): Started to use this class more often for root types
139 2006-03-23 Raja R Harinath <rharinath@novell.com>
141 * generic.cs (TypeParameter.UpdateConstraints): Update
142 'constraints' if null.
144 2006-02-22 Marek Safar <marek.safar@seznam.cz>
148 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
149 external interface does not have an attribute.
151 2006-02-22 Marek Safar <marek.safar@seznam.cz>
153 Another prerequisites for new partial classs implementation.
155 * attribute.cs (Attribute.Equal): Implemented.
156 (Attribute.Emit): Changed as attributes can be applied more than twice.
157 (Attributes.Emit): Check for duplicate attributes here.
159 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
160 as a parameter, clean-up.
162 2006-02-11 Marek Safar <marek.safar@seznam.cz>
166 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
167 contains obsolete attribute check which can in some cases look for base
168 type of current class which is not initialized yet.
169 (TypeContainer.BaseType): Replacement of ptype.
171 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
173 2006-02-11 Marek Safar <marek.safar@seznam.cz>
175 First of prerequisites for new partial classs implemention.
177 * attribute.cs (Attributable): Extended by ResolveContext;
178 Attributes finally have correct context for resolving in all cases.
179 (AttachTo): Attribute owner is assigned here.
181 * codegen.cs (IResolveContext): Introduce new interface to hold
182 all information needed in resolving phase.
183 (EmitContext): Implements IResolveContext; more clean-up needed here.
185 * decl.cs (MemberCore): Implemented IResolveContext.
187 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
188 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
189 parameter.cs, statement.cs, tree.cs, typemanager.cs:
190 Refactored to use new IResolveContext instead of EmitContext; cleanup
192 2006-03-22 Raja R Harinath <rharinath@novell.com>
194 Support ParameterDefaultValueAttribute in gmcs. Also applied to
195 mcs to keep code differences small.
196 * attribute.cs (Attribute.GetParameterDefaultValue): New.
197 * typemanager.cs (parameter_default_value_attribute_type): New.
198 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
201 2006-03-22 Martin Baulig <martin@ximian.com>
204 (Nullable.NullableLiteral): Derive from `NullLiteral'.
207 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
208 instead of the normal `NullLiteral'.
210 2006-03-21 Martin Baulig <martin@ximian.com>
213 * generic.cs (TypeManager.InferType): If `pt' is a generic
214 parameter, don't check whether `pt == at'.
216 2006-03-20 Raja R Harinath <rharinath@novell.com>
219 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
220 (TypeParameter.Resolve): Update to change.
221 (ConstraintChecker.CheckConstraints): Resolve type-argument
222 constraints before use.
224 2006-03-16 Martin Baulig <martin@ximian.com>
227 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
228 and don't have any instance constructors, also lookup in the base class.
229 (TypeManager.IsNullableValueType): New public method.
231 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
232 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
233 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
235 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
236 instead of just TypeManager.IsNullableType() to determine whether
237 a lifted operator exists.
238 (UnaryMutator.DoResolve): Likewise.
239 (Conditional.DoResolve): Likewise.
240 (Binary.DoResolve): A lifted operator only exists if both operands
241 are valuetypes and at least one of them is a nullable type.
243 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
245 * iterator.cs : yield break is allowed in try statement which has
246 catch clauses. Fixed bug #77767.
248 2006-03-12 Martin Baulig <martin@ximian.com>
250 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
251 private IsSignatureEqual() to compare types; see the comment in
252 that method; fixes #77674.
254 2006-03-10 Raja R Harinath <rharinath@novell.com>
256 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
257 (Expression.ResolveAsTypeTerminal): Likewise.
258 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
259 * expression.cs, generic.cs, iterators.cs: Likewise.
260 * parameter.cs, statement.cs, typemanager.cs: Likewise.
262 2006-03-09 Martin Baulig <martin@ximian.com>
264 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
265 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
267 2006-03-09 Martin Baulig <martin@ximian.com>
269 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
270 `prepared' flag is set.
272 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
273 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
274 issues; see gtest-254.cs.
276 2006-03-07 Martin Baulig <martin@ximian.com>
278 * generic.cs (TypeManager.InferType): Allow infering
279 `IEnumerable<T>' with an array of T; see gtest-251.cs.
281 2006-03-06 Martin Baulig <martin@ximian.com>
284 (TypeManager.InferType): Fix gtest-250.cs.
287 (TypeManager.IsSubclassOf): Also check the base class.
290 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
293 2006-03-01 Raja R Harinath <rharinath@novell.com>
296 * expression.cs (ParameterReference.DoResolveBase): Change return
298 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
302 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
305 * typemanager.cs (GetFullNameSignature): Don't nullref on
308 2006-02-16 Martin Baulig <martin@ximian.com>
311 (TypeManager.GetGenericFieldDefinition): New public method; use it
312 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
314 2006-02-14 Martin Baulig <martin@ximian.com>
316 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
318 2006-02-14 Martin Baulig <martin@ximian.com>
321 (TypeManager.DropGenericMethodArguments): New public method; don't
322 use GetGenericMethodDefinition() on something which is not a
325 2006-02-14 Martin Baulig <martin@ximian.com>
328 (ConstraintChecker.CheckConstraints): If a type parameter has the
329 `struct' constraint, the type must be a non-nullable valuetype.
331 2006-02-10 Martin Baulig <martin@ximian.com>
334 (TypeManager.IsOverride): Make this work for instantiated methods
335 in a generic class; fixes #77509.
336 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
337 rather than calling it directly; fixes #77488.
339 2006-02-08 Martin Baulig <martin@ximian.com>
341 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
342 reporting into CheckConstraint() so we can use the correctly
345 2006-02-08 Martin Baulig <martin@ximian.com>
347 * expression.cs (BaseAccess): Add support for generic methods.
349 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
350 the new MethodGroupExpr.
352 2006-02-07 Martin Baulig <martin@ximian.com>
354 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
355 also reference types; fixes #77483.
357 2006-02-07 Martin Baulig <martin@ximian.com>
360 (TypeManager.IsGenericMethod): We now return whether something is
361 an instantiated generic method (and not a generic method def).
362 (TypeManager.IsGenericMethodDefinition): New public method.
365 (TypeManager.CSharpSignature): Only include type arguments for
366 "real" generic methods, not for any instantiated method.
367 (TypeManager.GetMethodName): Likewise, but also allow generic
368 method definitions here.
370 2006-02-06 Miguel de Icaza <miguel@novell.com>
372 * codegen.cs (EmitScopeInitFromBlock): check here the
373 capture_context, there is no need to make two calls to the
376 * anonymous.cs: Add some debugging messages that might help me
377 track other instances of this problem in the future (the
378 regression of test 467).
380 * cs-parser.jay: track the variable block, as we need to initalize
381 any captured variables declared in this block for the "catch"
382 portion of the "Try" statement.
384 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
385 scope initialization for captured variables.
387 Also, move the emit for the variables after the block location has
390 2006-02-06 Marek Safar <marek.safar@seznam.cz>
392 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
394 2006-02-06 Martin Baulig <martin@ximian.com>
396 * class.cs (TypeContainer.DefineType): If we're a struct, pass
397 `TypeManager.value_type' as parent type to
398 ModuleBuilder.DefineType(). Fixes #77358.
400 2006-02-02 Miguel de Icaza <miguel@novell.com>
402 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
403 commit yesterday, the initialization for the roots is necessary.
404 What is not necessary is the scope activation.
406 2006-02-02 Raja R Harinath <rharinath@novell.com>
408 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
409 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
411 (Argument.Resolve): Remove CS0206 checks.
413 2006-02-01 Miguel de Icaza <miguel@novell.com>
415 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
416 scopes for all the roots, the scopes will now be emitted when the
417 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
419 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
420 code. This reduces a lot of existing cruft.
422 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
423 that the ScopeInfo is generated as we enter the scope, not at the
424 time of use, which is what we used to do before.
426 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
427 every time a Block is about to be emitted if we have a
430 2006-02-01 Raja R Harinath <rharinath@novell.com>
432 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
433 attribute for mscorlib too.
435 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
437 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
439 * typemanager.cs (cons_param_array_attribute): Make private.
440 (Reset): Set it to null.
441 (InitCoreHelpers): Don't initialize it.
442 (ConsParamArrayAttribute): New. Initialize it as needed.
443 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
445 2006-01-31 Miguel de Icaza <miguel@novell.com>
447 * expression.cs: There might be errors reported during the
448 selection of applicable methods. If there are errors, do not
449 continue execution as it will lead the compiler to crash.
451 2006-01-30 Miguel de Icaza <miguel@novell.com>
453 * expression.cs: Member access is not allowed on anonymous
454 methods. Fixes #77402.
456 2006-01-30 Raja R Harinath <rharinath@novell.com>
459 * cs-parser.jay (VariableDeclaration): Don't set
460 current_array_type to null.
461 (field_declaration, event_declaration, declaration_statement):
464 2006-01-29 Raja R Harinath <harinath@gmail.com>
467 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
469 2006-01-28 Raja R Harinath <harinath@gmail.com>
471 * typemanager.cs (GenericParameterPosition): New.
474 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
476 * doc.cs : To process "include" elements, first we should create
477 another list than XmlNodeList, because it could result in node
478 removal, which could result in that the XmlNodeList gives up
481 2006-01-25 Miguel de Icaza <miguel@novell.com>
483 * expression.cs: Introduce an error report that we were not
484 catching before. Gonzalo ran into it.
486 2006-01-23 Miguel de Icaza <miguel@novell.com>
488 A fix for bug: #76957
490 * iterators.cs (MoveNextMethod.CreateMethodHost): call
491 ComputeMethodHost before creating the method, this is a new
494 * anonymous.cs (AnonymousContainer): Now we track all the scopes
495 that this method references (RegisterScope). The actual scope
496 where the method is hosted is computed with the ComputeMethodHost
497 before we create the method.
499 Moved the Deepest routine here.
501 (AnonymousContainer.ComputeMethodHost): New routine used to
502 compute the proper ScopeInfo that will host the anonymous method.
504 (ScopeInfo): Deal with multiple roots. The problem was that we
505 did not have a unique root where all ScopeInfos could be hanged
506 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
509 Remove AdjustMethodScope which is now computed at the end. Remove
510 LinkScope which did a partial link, instead link all ScopeInfos
511 before code generation from the new "LinkScopes" routine.
513 Simplify all the Add* routines as they no longer need to maintain
514 the tree, they just need to record that they are using variables
517 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
518 routines to produce the forest of ScopeInfo trees.
520 * class.cs (TypeContainer.AppendMethod): This is just like
521 AddMethod, but ensures that an interface implementation method
522 (IEnumerable.XXX) is not inserted at the beginning of the queue of
523 methods, but at the end.
525 We use this functionality to ensure that the generated MoveNext
526 method in the iterator class is resolved/emitted before the
527 enumerator methods created.
529 This is required because the MoveNext method computes the right
530 ScopeInfo for the method. And the other methods will eventually
531 need to resolve and fetch information computed from the anonymous
535 2006-01-23 Raja R Harinath <rharinath@novell.com>
537 Improve implementation of section 14.4.2.2 (Better function member).
538 * expression.cs (Invocation.MoreSpecific): Compare all type
539 arguments before deciding if one type is more specific than
540 another. Handle array types too. Return the more specific type.
541 (Invocation.BetterFunction): Add more tie-breaking rules from
542 section 14.4.2.2. Perform "more specific" check after
543 other tie-breaking rules. Compare all parameter types before
544 choosing the "more specific" method.
546 2006-01-21 Raja R Harinath <harinath@gmail.com>
547 Carlos Alberto Cortez <calberto.cortez@gmail.com>
550 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
552 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
553 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
555 2006-01-18 Martin Baulig <martin@ximian.com>
557 * class.cs (TypeContainer.AddToMemberContainer): Use
558 `symbol.MemberName.MethodName' instead of just `symbol.Name';
561 2006-01-18 Martin Baulig <martin@ximian.com>
563 Fix #76417: a generic class may now have methods which may unify
564 for some type parameter substitutions.
566 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
567 for methods which may unify anymore.
569 * expression.cs (Invocation.MoreSpecific): New private static
570 method; checks whether one method is more specific than another
571 according to 14.4.2.2 of the spec.
572 (Invocation.BetterFunction): Implement the tie-breaking rules from
573 14.4.2.2 of the spec: if two methods unify for some type parameter
574 substitution, we need to pick the more specific one.
576 2006-01-18 Raja R Harinath <rharinath@novell.com>
578 Fix #76656, cs0231-2.cs.
579 * cs-parser.jay (formal_parameter_list): Make error case catch
581 (parenthesized_expression_0): Add CS1026 check.
582 (invocation_expression): Remove unused { $$ = lexer.Location }.
584 2006-01-17 Raja R Harinath <rharinath@novell.com>
587 * cs-parser.jay (statement_expression): Don't list out the
588 individual statement-expressions. Convert syntax error into
591 2006-01-16 Raja R Harinath <rharinath@novell.com>
594 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
595 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
596 CheckIntermediateModification.
597 (FieldExpr.DoResolve): Add new two-argument version that
598 allows us to resolve the InstanceExpression as an lvalue.
599 The one-argument variant is now just a wrapper.
600 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
601 Resolve the lhs as an lvalue if the it has a value type.
602 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
603 from Assign.DoResolve.
604 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
605 resolved as an lvalue.
606 (PropertyExpr.DoResolve): Update.
607 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
608 has a value type. Move CS1612 check here from
609 CheckIntermediateModification.
610 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
611 * expression.cs (EmptyExpression.OutAccess): New. Used as the
612 'right_side' of a ResolveLValue on an 'out' argument.
613 (EmptyExpression.LValueMemberAccess): New. Used as the
614 'right_side' of a propagated ResolveLValue on a value type.
615 (LocalVariableReference.DoResolveBase): Recognize
616 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
618 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
619 EmptyExpression.Null.
621 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
623 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
624 Type.IsGenericParameter(). Fixed bug #77183.
625 * doc.cs : it is now identical to doc.cs in mcs.
627 2006-01-16 Martin Baulig <martin@ximian.com>
629 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
631 2006-01-16 Martin Baulig <martin@ximian.com>
633 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
636 2006-01-12 Miguel de Icaza <miguel@novell.com>
638 This fixes the problem where we used ldfld instead of ldflda to
639 load the "THIS" pointer on captured parameters, when THIS is a
640 value type. See bug #77205.
642 * iterators.cs (CapturedThisReference.Emit): Pass false to
643 EmitThis (we do not need the address).
645 * codegen.cs (EmitThis): it needs to know whether we need the
646 address of `this' or not. This is used by value types.
648 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
649 every other call passes false.
651 2006-01-12 Raja R Harinath <rharinath@novell.com>
654 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
656 * expression.cs (Invocation.OverloadResolve): Update.
657 (Invocation.DoResolve): Avoid double resolution of invocation.
659 2006-01-11 Raja R Harinath <rharinath@novell.com>
662 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
663 unary negation of floating point types as 0-expr; negation cannot
664 overflow in floating point types.
667 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
668 on operands of 'void' type.
671 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
672 and ExclusiveOr for boolean constants too.
674 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
676 * expression.cs: Fix Console.WriteLine ((this = x).foo);
678 2006-01-12 Miguel de Icaza <miguel@novell.com>
680 * cs-tokenizer.cs (Position): New class used to save and restore
681 the position state in the tokenizer. Before this patch the save
682 and restore was not complete enough so the line and columns would
683 start to drift and the debugger and stack traces will get the
686 2006-01-10 Martin Baulig <martin@ximian.com>
689 (TypeParameter.InflateConstraints): New public method.
691 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
692 constraints; fixes #77042.
694 2006-01-10 Martin Baulig <martin@ximian.com>
696 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
697 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
700 2006-01-09 Raja R Harinath <rharinath@novell.com>
703 * expression.cs (Invocation.OverloadResolve): Replace reflected
704 override methods with their base virtual methods, rather than
706 * typemanager.cs (TypeManager.GetOverride): New.
708 2005-12-21 Miguel de Icaza <miguel@novell.com>
710 * driver.cs: Report the case of no source files and no -out:
713 2005-12-20 Raja R Harinath <rharinath@novell.com>
716 * expression.cs (ComposedCast.GetSignatureForError): Define.
718 2006-01-05 Jb Evain <jbevain@gmail.com>
720 * class.cs (Property.Define, Indexer.Define): do not tag the
721 properties as SpecialName | RTSpecialName.
723 2006-01-04 Miguel de Icaza <miguel@novell.com>
725 * class.cs (MethodCore.IsDuplicateImplementation): This method was
726 doing a low-level comparission of parameter types. It was lacking
727 a check for __argslist.
729 2005-12-30 Miguel de Icaza <miguel@novell.com>
731 * expression.cs (ParameterReference.DoResolveBase): Allow
732 reference parameters if they are local to this block.
734 This allows the ref and out parameters of a delegate to be used in
735 an anonymous method, for example:
737 delegate void set (out int x);
739 set s = delegate (out int x){
743 This is used by functionality introduced late in the C# language.
745 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
746 method that take ref and out parameters.
748 Fixes #77119 which was a late change in the spec.
750 2005-12-23 Miguel de Icaza <miguel@novell.com>
752 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
753 parent if its the same scope. Fixes #77060.
755 2005-12-22 Marek Safar <marek.safar@seznam.cz>
757 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
759 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
761 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
762 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
763 that doesn't contain the full public key. This is a update of the
764 friend assemblies in .Net 2.0 release.
766 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
770 * namespace.cs (NamespaceEntry): Add extern_aliases as a
771 ListDictionary, to contain the ExternAliasEntry entries (in
772 addition to the NamespaceEntry.aliases hashtable). This field is
773 shared between the original entry and its doppelganger (bodyless
775 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
776 extern_aliases field.
777 (NamespaceEntry.Lookup): Move the IsImplicit check after the
778 lookup in extern_aliases.
780 2005-12-16 Raja R Harinath <rharinath@novell.com>
783 * class.cs (TypeContainer.Mark_HasEquals): New.
784 (TypeContainer.Mark_HasGetHashCode): New.
785 (ClassPart): Override them.
786 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
788 * generic.cs (GenericMethod.DefineMembers): Update to changes.
789 (TypeParameter.TypeParameter): Change type of 'parent' argument to
793 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
794 'parent' argument to the base constructor.
796 Remove all mention of TypeContainer from decl.cs.
797 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
798 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
799 (DeclSpace.DeclSpace): Likewise.
800 (DeclSpace.DefineMembers): Remove unused argument.
801 * cs-parser.jay (pop_current_class): Update to changes. Simplify
802 debugging check -- we don't care if the debug code throws an
803 InvalidCastException instead of an InternalErrorException.
804 * class.cs (TypeContainer.DefineMembers): Update to changes.
805 (TypeContainer.DoDefineMembers): Likewise.
806 (TypeContainer.GetMethods): Likewise.
807 (PropertyMember.Define): Likewise.
808 (MemberBase.Parent): New property that forwards to
809 MemberCore.Parent, but ensures that we get a TypeContainer.
810 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
811 (RootContext.PopulateTypes): Likewise. Remove special case code
812 for !RootContext.StdLib: DefineMembers is idempotent.
814 2005-12-13 Marek Safar <marek.safar@seznam.cz>
816 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
818 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
820 * doc.cs : The search for referenced namespace was insufficient to
821 get global one as it used to do. Fixed bug #76965.
823 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
825 * doc.cs : check name in cref in the last phase that whether it is
828 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
830 * cs-tokenizer.cs : reverted the latest change: it somehow broke
833 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
835 * doc.cs : so it turned out that we cannot skip override check for
836 interface members. Fixed bug #76954.
838 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
840 * cs-tokenizer.cs : fixed bug #75984:
841 - #warning and #error should not be handled when the source line
843 - #line is not checked strictly when the source line is disabled.
844 - #define and #undef is on the other hand checked strictly at any
847 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
849 * cs-tokenizer.cs : missing Location (actually, filename) in one of
852 2005-12-15 Raja R Harinath <rharinath@novell.com>
854 * generic.cs (TypeManager.IsGeneric): Remove unused method.
856 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
859 2005-12-14 Martin Baulig <martin@ximian.com>
861 * typemanager.cs (TypeManager.GetFullName): Make this public;
862 `Type.Fullname' now never returns null.
864 * class.cs (Method.Define): Use TypeManager.GetFullName() for
865 explicit interface implementations; we're now using the same
866 naming convention than csc does.
868 2005-12-14 Miguel de Icaza <miguel@novell.com>
870 * convert.cs (ExplicitConversionCore): Check the return value from
871 ExplicitConversionCore which can return null on failure. Fixes #76914
873 2005-12-09 Raja R Harinath <rharinath@novell.com>
875 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
876 instead of IsGenericInstance.
877 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
878 code that's now covered by the more general test.
879 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
881 * generic.cs (DropGenericTypeArguments): New. Captures the common
882 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
883 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
884 * generic.cs, report.cs, typemanager.cs: Likewise.
886 2005-12-08 Martin Baulig <martin@ximian.com>
888 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
890 * typemanager.cs (TypeManager.CSharpSignature): Include type
891 arguments in the signature of a generic method.
893 2005-12-07 Martin Baulig <martin@ximian.com>
895 Add support for custom attributes on type parameters.
897 * cs-parser.jay (type_arguments): Added `opt_attributes'.
899 * generic.cs (TypeParameterName): New public class; we use this
900 instead of a `string' to store the name of a type parameter, so we
901 can also have `Attributes'.
902 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
903 array instead of a `string[]' array.
904 (TypeParameter.ctor): We now also take an `Attributes' argument.
905 (TypeParameter.EmitAttributes): New public method; emit our
906 `OptAttributes' here.
907 (GenericMethod.EmitAttributes): New public method; emit the custom
908 attributes on all our type parameters.
910 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
912 (MethodData.Define): If we're a generic method, call
913 EmitAttributes() on it.
915 2005-12-07 Martin Baulig <martin@ximian.com>
918 (ConstraintChecker): New public abstract class; move the
919 constraint checking here from `ConstructedType' and also do
920 constraint checking for generic methods here.
922 * expression.cs (Invocation.OverloadResolve): Use
923 ConstraintChecker.CheckConstraints() if we resolved to a generic
926 2005-12-05 Marek Safar <marek.safar@seznam.cz>
928 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
930 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
932 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
933 (FieldBase.Initializer): Initializer is now optional.
934 (EventField.Define): Only event field can have initializer.
936 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
938 * const.cs (Const): Reuse initializer.
940 * cs-parser.jay: Updated after FieldBase changes.
941 Added current_array_type to simplify array initializers.
943 * ecore.cs (NullCast.IsDefaultValue): Implemented.
945 * expression.cs, iterators.cs: Updated.
947 * namespace.cs (NamespaceEntry): Made UsingFound private.
949 2005-12-05 Marek Safar <marek.safar@seznam.cz>
951 * parameterCollection.cs: Obsolete, removed.
952 * parser.cs: Obsolete, removed.
954 2005-12-05 Marek Safar <marek.safar@seznam.cz>
957 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
959 * enum.cs (Enum.Define): Set obsolete context here.
961 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
964 - FindDocumentedMember() now expects 1) paramList as null
965 when "we don't have to check the number of parameters" and
966 2) Type.EmptyTypes when "there is no arguments".
967 - Introduced FoundMember struct to hold the exact type which was
968 used to find the documented member (the above change broke
969 test-xml-044; it might be better just to use DeclaringType than
970 what MS does, like this change does, but it depends on usage.)
972 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
974 * doc.cs : documented member might be from DeclaringType for nested
975 types. Fixed bug #76782.
977 2005-12-03 Ben Maurer <bmaurer@ximian.com>
979 * anonymous.cs: Have the param code handle leaving copies on the
980 stack etc. Allows anonymous params to take part in the assignment
981 code (++, +=, etc). Fixes bug #76550
983 * expression.cs: Handle the prepare_for_load/leave_copy by passing
984 it down to the anon code.
986 * iterators.cs: Use dummy var here
988 * codegen.cs: Handle new vars
990 2005-12-01 Marek Safar <marek.safar@seznam.cz>
993 * class.cs (MethodData.Define): Set proper Obsolete context.
995 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
997 (FieldExpr.DoResolve): Ditto.
999 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1002 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1003 parent is not obsolete.
1005 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
1007 * doc.cs : (FindDocumentedMember) find parameterless members first
1008 and get CS0419 in the early stage. Fixed first case of bug #76727.
1010 2005-11-30 Marek Safar <marek.safar@seznam.cz>
1013 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1014 no error was reported.
1016 *expression.cs (Binary.DoResolve): left can be null.
1018 2005-12-06 Raja R Harinath <rharinath@novell.com>
1020 * class.cs (MethodCore.CheckGenericOverride): Delete unused
1021 abstract method and all overrides.
1022 * support.cs (ParameterData.GenericConstraints): Delete.
1023 (ReflectionParameters.type_params): Delete.
1024 (ReflectionParameters.ReflectionParameters): Make private.
1025 (ReflectionParameters.GetConstaints): New factory method.
1026 * generic.cs (TypeParameterDefineType): Use it.
1027 (TypeManager.GetTypeParameterConstraints): Likewise.
1029 2005-11-22 Marek Safar <marek.safar@seznam.cz>
1032 * class.cs (MethodData.Emit): Parameters should be labeled first.
1034 2005-11-21 Marek Safar <marek.safar@seznam.cz>
1037 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1039 2005-11-18 Marek Safar <marek.safar@seznam.cz>
1041 * attribute.cs (AreParametersCompliant): Moved to Parameter.
1043 * class.cs (MethodCore): Parameter clean up.
1044 (IMethodData): Added ParameterInfo.
1045 (MethodData): Parameter clean up.
1046 (Indexer.Define): Parameter clean up.
1058 * typemanager.cs: Parameter clean up.
1060 * delegate.cs (Define): Get rid of duplicated code.
1062 * expression.cs (ParameterReference): Removed useless parameters
1064 (Invocation): Ditto.
1066 * parameter.cs (ParamsParameter): New class, params specialization.
1067 (ArglistParameter): Attemp to separate arglist.
1068 (Parameter): Refactored to be reusable and faster.
1069 (Parameter.Modifier): Made understandable.
1070 (Parameters): Changed to be used as a class for `this' assembly
1071 parameters. Refactored to use new specialized classes.
1073 * support.cs (ParameterData): Added Types property.
1074 (InternalParameters): Deleted.
1076 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1078 * doc.cs : the previous patch does not actually fix the bug.
1079 PropertyInfo override check is now implemented and really fixed it.
1080 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1082 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1084 * doc.cs : apply "override filter" also to properties.
1087 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1089 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1090 no need to check overrides. For classes, omit those results from
1091 interfaces since they must exist in the class. Fixed bug #76726.
1093 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1095 * typemanager.cs : (GetFullNameSignature) differentiate indexers
1096 with different parameters. Fixed the second problem in #76685.
1098 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1100 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1101 get expected 'protected' access in CheckValidFamilyAccess()).
1104 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1106 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1107 Fixed bug #76705. CS1569 was incorrectly commented out.
1109 2005-11-23 Martin Baulig <martin@ximian.com>
1111 * generic.cs (Constraints.Define): Removed.
1112 (TypeParameter.DefineConstraints): Removed.
1113 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1114 on the GenericTypeParameterBuilder here.
1116 2005-11-23 Martin Baulig <martin@ximian.com>
1118 * typemanager.cs (TypeManager.GetProperty): Make this public.
1120 * generic.cs (Nullable.NullableInfo.ctor): Use
1121 TypeManager.GetProperty() rather than using reflection directly.
1123 2005-11-17 Martin Baulig <martin@ximian.com>
1125 * expression.cs (Indexers.GetIndexersForType): Added support for
1126 generic parameters; fixes #76587.
1128 2005-11-17 Martin Baulig <martin@ximian.com>
1131 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1132 inherit the scope from our parent. Fixes #76653.
1134 2005-11-15 Martin Baulig <martin@ximian.com>
1136 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1137 instead of `ScopeTypeBuilder' to refer to the "current" type.
1138 (AnonymousMethod.CreateScopeType): Correctly create the helper
1139 class if we're inside a generic type definition.
1141 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1143 * doc.cs : use Invocation.IsOverride() to do real override check.
1144 * expression.cs : made Invocation.IsOverride() internal.
1146 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1148 * doc.cs : use TypeManager.FindMembers() instead of (possible)
1149 TypeBuilder.FindMembers() and filter overriden base members out.
1152 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1154 * doc.cs : ref/out parameters are represented as '@' (instead of
1155 '&' in type FullName). Fixed bug #76630 (additionally crefs).
1157 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1159 * doc.cs : when there was no '.' in cref to methods in doc comment,
1160 then parameters were missing in the output. Fixed bug #76691.
1162 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1164 * driver.cs : don't output docs when there is an error.
1167 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1170 Now it should detect indexers. Fixed primary concern in bug #76685.
1171 Fixed CS0419 message to not show the identical member signature in
1174 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1176 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1177 instead of Type.FindMembers() since it does not handle events.
1180 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
1182 * codegen.cs: Fixed typo (speficied -> specified).
1184 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1187 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1189 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1191 * attribute.cs: Changed error message.
1193 * cs-tokenizer.cs: One more check.
1195 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1197 * statement.cs (Block.Resolve): Ignore empty statement.
1199 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1201 * report.cs: Made error/warning methods more strict to avoid
1204 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1205 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1206 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1207 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1209 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1211 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
1212 Use the more explicit AssemblyName.FullName instead of
1213 AssemblyName.Name to report errors.
1215 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1217 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1220 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1230 * report.cs: Fixed error reporting and typos.
1232 * generic.cs (TypeParameter.GetSignatureForError): New method.
1233 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1235 * typemanager.cs (GetFullName): Refactored.
1237 2005-11-08 Marek Safar <marek.safar@seznam.cz>
1239 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1240 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1242 * class.cs (TypeContainer.IsComImport): New property.
1243 (Constructor.Define): Create proper ctor for ComImport types.
1245 * expression.cs (New.CheckComImport): Fixed.
1247 2005-11-07 Miguel de Icaza <miguel@novell.com>
1249 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1250 that a parameter has been captured does not mean that we do not
1251 have to do the rest of the processing. This fixes the second part
1252 of #76592. If there was another anonymous method capturing
1253 values in the past, the Scope would never be set for the second
1254 method that captured the same parameter.
1256 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1257 properly manipulate the stack. Second part of fix for #76592.
1259 * expression.cs (New): Add support for invoking "new" on
1260 interfaces that have been flagged with the ComImport attribute and
1261 the CoClass. Fixes #76637
1263 * statement.cs (Try.DoEmit): When a variable is captured, do not
1264 try to emit the vi.LocalBuilder variable as it has been captured.
1265 Create a temporary variable and store the results on the
1266 FieldBuilder. Fixes #76642
1268 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1270 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1272 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1274 * expression.cs (Binary.DoResolve): Added && optimalization.
1276 * typemanager.cs (AddUserType): Removed useless argument.
1278 2005-11-04 Marek Safar <marek.safar@seznam.cz>
1280 * statement.cs (Block.variables): Uses ListDictionary.
1282 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1285 * class.cs (PartialContainer.EmitType): Customized to emit
1286 security attributes.
1287 (ClassPart.ApplyAttributeBuilder): Transform security attribute
1288 for partial classes.
1290 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1293 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1294 access has to be fixed.
1296 * typemanager.cs (IsUnmanagedType): Wrong common field type.
1298 2005-11-01 Marek Safar <marek.safar@seznam.cz>
1301 * ecore.cs (NullCast.Reduce): Implemented.
1303 * expression.cs (ArrayCreation.CheckIndices): Correcly check
1306 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1308 (Foreach.Resolve): Catch null properly.
1310 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1312 * cs-tokenizer.cs: Warning text fix.
1314 * driver.cs: AllWarningNumbers exposed on public interface.
1316 * report.cs (): Reviewed warning numbers.
1317 (IsValidWarning): Use binary search.
1319 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1321 * driver.cs: Implemeted resource visibility.
1322 (Resources): New class for code sharing between /res: and
1325 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1327 decl.cs (CurrentTypeParameters): Fixed to be public.
1329 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1331 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1333 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1335 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1337 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
1339 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1341 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1343 Add friend assembly access support.
1344 * typemanager.cs: assembly_internals_vis_attrs
1345 cache for friend assembly access.
1346 (TypeManager.IsFriendAssembly): New method for
1347 checking friend assembly access.
1348 (TypeManager.Error_FriendAccessNameNotMatching): New
1350 (TypeManager.CompareKeyTokens): Likewise.
1351 (TypeManager.Filter): Handle friend accessible
1354 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1355 friend accessible types.
1357 * ecore.cs (Expression.IsAccessorAccessible): Handle
1358 friend accessible properties.
1360 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1363 2005-10-28 Marek Safar <marek.safar@seznam.cz>
1366 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1369 * convert (Convert.ImplicitReferenceConversion): NullCast holds
1372 * ecore.cs (NullCast): Child is contant only.
1374 * literal.cs (NullLiteral.Reduce): null can be converted to any
1377 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
1379 * driver.cs: Use Encoding.Default as default code page instead
1382 2005-10-27 Raja R Harinath <rharinath@novell.com>
1385 * expression.cs (Invocation.Error_InvalidArguments): Handle
1386 __arglist parameters.
1387 (Invocation.VerifyArgumentsCompat): Likewise.
1388 * support.cs (ReflectionParameters.GetSignatureForError): Print
1389 __arglist parameters.
1390 (InternalParamters.GetSignatureForError): Likewise.
1391 * parameter.cs (Parameters.GetSignatureForError): Likewise.
1393 2005-10-26 Marek Safar <marek.safar@seznam.cz>
1395 * attribute.cs (GetPropertyValue): Made public.
1397 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1399 Add new property WrapNonExceptionThrows to handle 2.0 assembly
1401 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1404 * driver.cs: Reflect method name change.
1406 * statement.cs (Try.Resolve): Warn when try has both general
1409 * typemanager.cs: runtime_compatibility_attr_type new predefined
1412 2005-10-26 Raja R Harinath <harinath@gmail.com>
1415 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1416 treat it as an empty parameter list.
1418 2005-10-26 Raja R Harinath <rharinath@novell.com>
1421 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
1422 ResolveAsTypeStep silent.
1423 * statement.cs (Block.AddConstant): Mark block as used.
1424 (Block.ResolveMeta): Avoid piling on error messages
1425 if a constant initializer resolution fails.
1427 2005-10-25 Raja R Harinath <rharinath@novell.com>
1429 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1431 (NamespaceEntry.VerifyAllUsing): New.
1432 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
1433 behaviour. Delegates actual resolution of alias to ...
1434 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
1435 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1437 * driver.cs (Driver.MainDriver): Update.
1439 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1440 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1442 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1444 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1445 RootNamespace.DefineNamespacesForAll.
1447 2005-10-24 Raja R Harinath <harinath@gmail.com>
1449 * typemanager.cs (assemblies, external_aliases, modules)
1450 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1451 (ComputeNamespaces, GetRootNamespace): Remove extra staging
1452 overhead. Move resposibility ...
1453 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
1454 * driver.cs, attribute.cs, codegen.cs: Update to changes.
1456 2005-10-23 Raja R Harinath <harinath@gmail.com>
1458 * namespace.cs (RootNamespace.all_namespaces): Renamed from
1459 cached_namespaces. Improve usage.
1460 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1461 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1462 Move from GlobalRootNamespace and simplify.
1463 (RootNamespace.Global): Make instance variable.
1464 (RootNamespace.RootNamespace): Add "alias name" parameter.
1465 (GlobalRootNamespace): Simplify drastically.
1466 (Namespace.Lookup): Don't use GetNamespace.
1467 * typemanager.cs (GetRootNamespace): Rename from
1468 ComputeNamespaceForAlias.
1469 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1471 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1473 * anonymous.cs (AnonymousContainer): Don't crash when container
1476 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1478 * expression.cs (Binary.DoResolve): Warn when comparing same
1481 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1484 * expression.cs (Binary.DoResolve): It looks like there are no
1485 convetsion rules in enum context.
1487 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1489 Add support for extern alias qualifiers.
1490 * typemanager.cs: Move some LookupTypeReflection code
1491 to namespace.cs, to have cleaner code. Added some methods
1492 to help us keep track of the extern aliased references.
1493 * driver.cs: Add suport for extern alias assemblies on command
1494 line and check for their warnings/errors. Also keep track of the
1495 extern aliased assemblies.
1496 * namespace.cs: Move the global functionality of Namespace
1497 to GlobalRootNamespace/RootNamespace. Now the global namespace
1498 is GlobalRootNamespace.Globa. Also the code moved from
1499 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
1500 Finally added LocalAliasEntry (AliasEntry before) and
1501 ExternAliasEntry, to handle alias statements.
1502 * cs-parser.jay: Add support in the grammar for extern alias
1504 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
1505 Update callings to Namespace (now in GlobalRootNamespace).
1507 2005-10-25 Martin Baulig <martin@ximian.com>
1509 * convert.cs (ImplicitTypeParameterConversion): Make base
1510 interfaces actually work; fixes #76557.
1512 2005-10-25 Martin Baulig <martin@ximian.com>
1515 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1516 all the type parameters; fixes #76551.
1518 2005-10-25 Martin Baulig <martin@ximian.com>
1523 (GenericMethod.ctor): Added `Expression return_type' and
1524 `Parameters parameters' arguments.
1525 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1526 parameter and return types to check their constraints if they're
1529 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1532 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1533 constraints of a generic type if `ec.ResolvingGenericMethod'.
1535 * class.cs (MethodCore.DoDefineParameters): Set
1536 `ec.ResolvingGenericMethod' if we're a generic method.
1537 (MemberBase.MemberType): Likewise.
1539 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1541 * typemanager.cs (TypeManager): Added
1542 TypeManager.internals_visible_attr_type to cache
1543 S.R.CompilerServices.InternalsVisibleToAttribute.
1545 * codegen.cs (AssemblyClass): Added checks for
1546 InternalsVisibleToAttribute in new method
1547 CheckInternalsVisibleAttribute () and also cache the
1548 AssemblyName in AssemblyClass.Name.
1550 2005-10-24 Martin Baulig <martin@ximian.com>
1553 (TypeManager.ExpandInterfaces): Added overloaded version which
1554 just takes a `Type[]' array.
1557 (Constraints.Resolve): Don't expand the interfaces here; ie. we
1558 just use the interfaces which were explicitly specified and not
1559 the interfaces they inherit. Fixes #76482.
1560 (TypeParameter.FindMembers): Expand the interfaces here.
1562 2005-10-21 Martin Baulig <martin@ximian.com>
1565 (Constraints.Resolve): Also resolve the actual types here.
1566 (Constraints.ResolveTypes): Just check the constraints here.
1567 Fixes #76363; see gtest-218.cs.
1569 2005-10-21 Martin Baulig <martin@ximian.com>
1572 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1573 instead of a `BoxedCast'; fixes gtest-217.cs.
1575 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
1577 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1578 1) "new()" is specified as generic parameter constraint and 2) the
1579 type is TypeBuilder and 3) the type is abstract even if it has a
1580 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1582 2005-10-20 Martin Baulig <martin@ximian.com>
1585 (GenericConstraints.TypeParameter): New public property.
1586 (TypeParameter.ctor): Also take a `DeclSpace' argument.
1587 (TypeParameter.DeclSpace): New public property.
1588 (TypeParameter.DefineType): Inflate the constraints if our
1589 `DeclSpace' is an `Iterator'.
1591 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
1593 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
1594 GenericMethod argument to compare methods' generic type arguments.
1597 2005-10-19 Martin Baulig <martin@ximian.com>
1599 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1600 not ResolveType() when resolving the base type, so we're not
1601 checking the constraints here.
1602 (TypeContainer.ResolveType): Call ResolveType() on our base_type
1605 2005-10-19 Martin Baulig <martin@ximian.com>
1607 * generic.cs (ConstructedType.CheckConstraints): Committing
1608 untested fix for #76441.
1610 2005-10-18 Raja R Harinath <rharinath@novell.com>
1613 * class.cs (TypeContainer.DefineType): Move updating of
1614 topological sort earlier in the code.
1615 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1617 2005-10-18 Marek Safar <marek.safar@seznam.cz>
1620 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1622 * constant.cs (Constant.TryReduce): Moved from Cast class.
1623 (Reduce): Made little bit more OO and fixed missing conversions.
1625 * ecore.cs (Reduce): Implemented.
1626 (Binary.EnumLiftUp): New method to upgrade values to enum values.
1628 * literal.cs (Reduce): Implemented.
1630 * class.cs: Reverted Miguel's wrong commit.
1632 2005-10-14 Miguel de Icaza <miguel@novell.com>
1634 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1636 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
1638 * cs-parser.jay, expression.cs : CS0214 was missing error location
1639 for constants. Fixed bug #76404.
1641 2005-10-10 Raja R Harinath <rharinath@novell.com>
1643 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1645 (PropertyExpr.EmitCall): Likewise.
1646 * expression.cs (Invocation.EmitArguments): Handle case where
1648 (Invocation.EmitCall): Avoid allocating temporary variable if
1649 there are no arguments.
1651 2005-10-11 Marek Safar <marek.safar@seznam.cz>
1654 * convert.cs (ExplicitConversionCore): Fixed object->enum
1657 2005-10-07 Raja R Harinath <rharinath@novell.com>
1660 * convert.cs (ImplicitConversionStandard): Move conversion of
1661 void* to arbitrary pointer types ...
1662 (ExplicitConversionStandard): .. here.
1663 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1664 error to always print typenames.
1666 2005-10-07 Raja R Harinath <rharinath@novell.com>
1668 * convert.cs (GetConversionOperator): Rename from
1669 GetConversionOperators. Move operator selection code from ...
1670 (UserDefinedConversion): ... here.
1672 2005-10-06 Marek Safar <marek.safar@seznam.cz>
1674 * convert.cs (ExplicitConversionCore): Removed duplicate enum
1677 2005-10-05 Marek Safar <marek.safar@seznam.cz>
1679 * assign.cs (Assign.DoResolve): Error method changed.
1681 * cfold.cs (DoConstantNumericPromotions): Error method changed.
1683 * const.cs (ResolveValue): Reset in_transit immediately.
1685 * constant.cs: Error method changed.
1687 * convert.cs: Removed useless location parameter.
1688 (ExplicitNumericConversion): Don't do double enum check.
1689 (ExplicitConversionCore): Renamed from ExplicitConversion.
1690 (ExplicitUnsafe): Extracted from ExplicitConversion.
1691 (ExplicitConversion): Uses for error reporting.
1693 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
1695 (ResolveBoolean): Uses common error method.
1696 (CastToDecimal): Get rid of ec.
1697 (CastFromDecimal): Optimized.
1698 (ConvCast): Get rid of ec.
1700 * enum.cs (ResolveValue): Reset in_transit immediately.
1701 (Emit): Return after first error.
1703 * expression.cs: Convert changes.
1705 * literal.cs: Error method changed.
1707 * statement.cs: Error method changed.
1709 2005-10-06 Raja R Harinath <rharinath@novell.com>
1711 Fix gtest-131.cs and gtest-211.cs.
1712 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
1713 Only emit code for a label if it is used. Unreachable code can
1714 violate ECMA evaluation stack invariants.
1716 2005-09-27 Marek Safar <marek.safar@seznam.cz>
1718 * anonymous.cs: Implemented ExprClassName.
1720 * assign.cs (Assign.DoResolve): Don't chrash when type is not
1723 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
1726 * class.cs (StaticClass.DefineContainerMembers): Report protected
1729 * codegen.cs: if(ed) PRODUCTION.
1731 * convert.cs (Error_CannotImplicitConversion): Better error
1734 * cs-parser.jay: More error checks.
1736 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
1738 * driver.cs (CSCParseOption): Enabled wrong option check.
1740 * ecore.cs (Expression.ExprClassName): Turned to property.
1741 (MemberExpr.CheckIntermediateModification): For checking boxed
1742 value types modification.
1744 * statement.cs (Fixed.Resolve): Expression type must be
1745 convertible to fixed type.
1746 (CollectionForeach.GetEnumeratorFilter,TryType):
1747 Small refactoring for easier error checking.
1749 2005-09-26 Marek Safar <marek.safar@seznam.cz>
1751 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
1754 * class.cs (GeneratedBaseInitializer): New class for customization
1755 compiler generated initializers.
1756 (MemberBase.DoDefine): Check Obsolete attribute here.
1757 (FieldMember.DoDefine): Ditto.
1759 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1762 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1763 (MemberCore.GetObsoleteAttribute): Removed argument.
1764 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1765 (MemberCore.CheckObsoleteType): New helper.
1769 * statement.cs: Updates after MemberCore changes.
1771 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1772 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1774 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1775 obsolete attribute for compiler construct.
1776 (As.DoResolve): Cache result.
1778 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1780 2005-10-01 Miguel de Icaza <miguel@novell.com>
1782 * expression.cs (Probe): instead of having a "Type probe_type"
1783 keep the extra information as a TypeExpr probe_type_expr since the
1784 "As" operator needs to perform some type checks.
1786 * (As.DoResolve): If the type is a type parameter, ensure that it
1787 is constrained by a class.
1789 2005-09-22 Miguel de Icaza <miguel@novell.com>
1791 * statement.cs (Lock): Use the TemporaryVariable class instead of
1792 manually using local variables as those do not work when variables
1795 * ecore.cs: Moved the TemporaryVariable class from being a nested
1796 class inside Foreach to be a public class that can be employed in
1799 2005-09-19 Marek Safar <marek.safar@seznam.cz>
1801 * cs-parser.jay: interface_accessors replaced by
1802 accessor_declarations.
1804 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1807 * statement.cs (GotoCase.Resolve): Convert null constant to
1809 (SwitchLabel.ResolveAndReduce): Ditto.
1810 (SwitchLabel.NullStringCase): Custom null stamp.
1811 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1813 typemanager.cs (CSharpSignature): Don't skip first argument
1816 2005-09-16 Marek Safar <marek.safar@seznam.cz>
1818 * cfold.cs, constant.cs, convert.cs, ecore.cs,
1819 expression.cs, iterators.cs, literal.cs: Store constants and
1822 * class.cs (MemberBase.ShortName): Pass location.
1824 * cs-parser.jay: Some location fixes.
1826 * ecore.cs (Expression.Location): Made virtual.
1828 2005-09-27 Marek Safar <marek.safar@seznam.cz>
1831 * const.cs (Const.ResolveValue): Check for assigning non-null
1832 value to reference type.
1834 2005-09-26 Raja R Harinath <rharinath@novell.com>
1837 * expression.cs (This.VerifyFixed): In a value type T, the type of
1838 'this' is T&, iow, 'this' is either an out or ref parameter. In a
1839 value type R, 'this' is treated as a value parameter.
1841 2005-09-05 Miguel de Icaza <miguel@novell.com>
1843 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1844 if the underlying types are the same, otherwise we need to produce
1845 code that will do the proper cast.
1847 This was exposed by Marek's constant rewrite which produced
1848 invalid code for the call site:
1851 void Method (X v) {}
1855 This fixes test-49.cs
1857 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1859 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1860 Type/Object should be allowed as well. Fixed bug #75968.
1862 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1864 * expression.cs : (Binary.DoResolve): when one is enum constant and
1865 another is constant 0, then return enum one *as enum type*.
1868 2005-10-04 Martin Baulig <martin@ximian.com>
1870 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
1871 `SetMemberIsUsed()' work for generics, too.
1873 2005-10-04 Martin Baulig <martin@ximian.com>
1875 * expression.cs (DelegateInvocation.EmitStatement): Make this work
1876 for corlib. Fixes #75691.
1878 2005-09-28 Marek Safar <marek.safar@seznam.cz>
1881 * driver.cs: Fix compilation files with full root path.
1883 2005-09-25 Miguel de Icaza <miguel@novell.com>
1885 * report.cs (SymbolRelatedToPreviousError): Format the output so
1886 it does not use an open parenthesis that is never closed.
1888 * driver.cs: Follow coding guidelines
1890 2005-09-18 Miguel de Icaza <miguel@novell.com>
1892 * driver.cs: Set InEmacs based on the environment variable EMACS.
1894 * location.cs (InEmacs): in this mode, do not report column
1895 location as it confuses Emacs.
1897 2005-10-03 Raja R Harinath <rharinath@novell.com>
1899 * support.cs (SeekableStreamReader.Position): Don't error out when
1900 the requested position is just beyond the end of the current
1903 2005-09-28 Raja R Harinath <rharinath@novell.com>
1905 * support.cs (SeekableStreamReader): Simplify drastically. Don't
1906 try to keep in sync with the byte count of the underlying Stream.
1907 However, this limits us to a window size of 2048 characters: i.e.,
1908 the maximum lookahead of our lexer/parser can be 2048 characters.
1910 2005-09-22 Martin Baulig <martin@ximian.com>
1912 * driver.cs: Removed a debugging FIXME.
1914 2005-09-21 Raja R Harinath <rharinath@novell.com>
1916 * cs-parser.jay (type_arguments): Add CS1644 check.
1917 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
1919 2005-09-15 Raja R Harinath <rharinath@novell.com>
1921 * Makefile (PROGRAM): Make profile specific.
1922 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
1923 the current directory.
1926 * expression.cs (Invocation.EmitCall): Remove optimization on
1927 this_call since it doesn't handle 'this' being a value type.
1929 2005-09-05 Geoff Norton <gnorton@customerdna.com>
1931 * driver.cs: Ensure file handles are closed after parsing
1933 2005-09-05 Miguel de Icaza <miguel@novell.com>
1935 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1936 if the underlying types are the same, otherwise we need to produce
1937 code that will do the proper cast.
1939 This was exposed by Marek's constant rewrite which produced
1940 invalid code for the call site:
1943 void Method (X v) {}
1947 This fixes test-49.cs
1949 2005-09-05 Martin Baulig <martin@ximian.com>
1951 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
1952 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
1954 * cs-parser.jay (delegate_declaration): Small fix for #75852.
1956 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1958 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
1959 to be a pointer type due to the spec 25.2, so check if declaring
1960 type is generic type definition. Fixed bug #75772.
1962 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1965 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
1966 both types are not defined by methods.
1967 * expression.cs : (Invocation.IsApplicable): it should work when
1968 the argument type is equal to the parameter type, not only when
1969 ImplicitConversionExists() returns true.
1971 2005-09-02 Raja R Harinath <rharinath@novell.com>
1973 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
1977 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
1978 flow-branching for LocalVariableReferences in case we were invoked
1979 from a MemberAccess.
1980 * expression.cs (LocalVariableReference.VerifyAssigned): New.
1982 (LocalVariableReference.DoResolveBase): ... this.
1983 (MemberAccess.Resolve): Do the check that was disabled during
1986 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
1989 (PartialContainer.Create): check abstract/sealed/static strictly
1990 but abstract/sealed can exist only at one side. Fixed bug #75883.
1992 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
1995 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
1996 specified, don't default to UnmanagedType.I4.
1998 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2000 * expression.cs : conditional operator should check possibly
2001 incorrect assign expression. Fixed bug #75946.
2003 2005-08-30 Raja R Harinath <rharinath@novell.com>
2006 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2007 (ScopeInfo.EmitScopeType): Use it to construct field names from
2008 names of captured locals.
2011 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2012 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2013 Pass 'target_type' to BoxedCast. Don't default to 'object'.
2014 (ExplicitConversion): Remove enum cases already handled by
2015 implicit conversion. Move implicit conversion check to the beginning.
2016 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2017 * expression.cs (ArrayCreation.EmitDynamicInitializers):
2018 Don't treat System.Enum as a struct.
2020 2005-08-30 Jb Evain <jbevain@gmail.com>
2022 * attribute.cs: handles as expression in parameters.
2024 2005-08-30 Raja R Harinath <rharinath@novell.com>
2027 * class.cs (TypeContainer.VerifyClsName): Don't use a
2028 PartialContainer when verifying CLS compliance.
2029 (AbstractPropertyEventMethod): Set Parent here, ...
2030 (PropertyMethod): ... not here.
2032 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
2034 * attribute.cs : escaped attribute name should not be allowed to be
2035 resolved (e.g. @class as classAttribute). Fixed bug #75930.
2037 2005-08-29 Raja R Harinath <rharinath@novell.com>
2040 * convert.cs (ImplicitStandardConversionExists): Allow zero also
2041 when converting a long constant to unsigned long.
2042 * expression.cs (Invocation.OverloadResolve): Add sanity check to
2043 detect where IsApplicable and VerifyArgumentsCompat disagree.
2045 2005-08-29 Raja R Harinath <rharinath@novell.com>
2046 and Carlos Alberto Cortez <carlos@unixmexico.org>
2049 * class.cs (TypeContainer.CanElideInitializer): New helper.
2050 (TypeContainer.EmitFieldInitializers): Use it to determine if we
2051 can safely emitting the initializer of a field.
2053 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2055 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2056 allowed inside a switch (without loop). Fixed bug #75433.
2058 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2060 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2061 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2063 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2065 * driver.cs : kinda reverting the default encoding changes (not exact
2066 revert since I noticed that "codepage:reset" might not work fine).
2068 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2070 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2071 Location. Now getter and setter store location correctly.
2072 (errors/cs0111-12.cs now reports the expected location.)
2074 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2076 * driver.cs : Use default encoding on the environment.
2077 Removed (now that) extra parameter for SeekableStreamReader.
2078 * support.cs : (SeekableStreamReader) third .ctor() argument for
2079 StreamReader is not required (always true). preamble size could
2080 be acquired in simpler and safe way.
2082 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
2084 * cs-parser.jay: report CS0642 at warning level 3
2085 and report CS0642 for an if else statement also
2086 fixes bug #74745. Patch by John Luke (and a bit
2088 Removed extra CS0642 warning check for "while",
2090 * statement.cs: In Block.Resolve(), CS0642 check
2091 is reimplemented to check a sequence of an empty
2092 statement and a block.
2094 Both fix bug #66777.
2096 2005-08-24 Marek Safar <marek.safar@seznam.cz>
2098 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2099 detection until I fix it.
2101 * cs-tokenizer.cs: Changed error message.
2103 * cs-parser.jay: Fixed 2 error locations.
2105 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2106 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2109 * enum.cs (GetSignatureForError): Fixed.
2111 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2115 * typemanager.cs (RegisterProperty): Removed.
2117 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2119 2005-08-24 Raja R Harinath <rharinath@novell.com>
2122 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2123 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2125 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2127 * expression.cs : tiny fix is required for not warning positive ulong.
2130 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2132 * expression.cs : add CS0652 check for constant and integral
2133 expression. Fixed bug #53974.
2135 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2137 * expression.cs : in DoNumericPromotions(), check if there is implicit
2138 conversion overload for string (to check CS0034). Fixed bug #52492.
2140 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2142 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2144 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2146 * ecore.cs : report location when it is *not* Null.
2148 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2154 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2155 correctly. Fixed bug #75721.
2157 2005-08-23 Raja R Harinath <rharinath@novell.com>
2159 * support.cs (SeekableStreamReader.Position): Avoid an expensive
2160 loop that performs 'min (pos, char_count)'.
2163 * expression.cs (Unary.ResolveOperator): Don't discard implicit
2164 converted value in Operator.OnesComplement.
2166 2005-08-22 Ben Maurer <bmaurer@ximian.com>
2168 * anonymous.cs: If the anon method is pulled into a helper class,
2169 it needs to be `internal' not `private'. Fixes runtime behavior on
2172 2005-08-17 Marek Safar <marek.safar@seznam.cz>
2175 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2178 2005-08-16 Marek Safar <marek.safar@seznam.cz>
2180 The big constants rewrite
2181 Fix #75746, #75685 and more
2182 As a side effect saved 1MB for MWF ;-)
2184 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2185 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2186 enum based for corlib compilation.
2188 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2191 * class.cs (FixedField.Define): Use ResolveAsConstant.
2193 * const.cs (IConstant): Interface constants and enums.
2194 (Const.ResolveValue): New method for constant resolvning.
2195 (ExternalConstant): Constants from imported assemblies.
2197 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2198 conversion; like enums.
2199 (Constant.ToType): Converts this constant to different type.
2200 (Constant.Increment): Adds 1.
2202 * convert.cs (ImplicitConversionRequired): Simplified.
2204 * cs-parser.jay: Create EnumMember directly.
2206 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2208 * doc.cs (GenerateEnumDocComment): Removed.
2210 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2211 (ConvertIntLiteral): Removed.
2212 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2214 * enum.cs (EnumMember): Implement IConstant.
2215 (Enum.IsValidEnumConstant): Removed.
2216 (Enum.GetNextDefaultValue): Removed.
2217 (Enum.FindMembers): Updated.
2218 (Enum.GenerateDocComment): Iterate enum members.
2220 * expression.cs (Cast.TryReduce): Handle enums correctly.
2221 (New.Constantify): Made public.
2222 (MemberAccess.DoResolve): Removed contant specific if(s).
2224 * literal.cs (NullLiteral): Implement new abstract methods.
2226 * statement.cs (GotoCase.Resolve): Use new constant methods.
2227 (SwitchLabel.ResolveAndReduce): Use new constant methods.
2229 * typemanager.cs (LookupEnum): Removed.
2230 (IsEnumType): Fixed to work with corlib.
2231 (RegisterConstant): Removed.
2232 (LookupConstant): Removed.
2233 (GetConstant): Changed to work with IConstant.
2235 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
2237 * location.cs : Fixed overflown (>255) column number.
2239 2005-08-03 Raja R Harinath <rharinath@novell.com>
2241 First cut of the qualified-alias-member feature.
2242 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2244 * cs-parser.jay (DOUBLE_COLON): New token.
2245 (namespace_or_type_name): Add rule for recognizing
2246 qualified-alias-members.
2247 (primary_expression): Likewise.
2248 (element_access): Allow QualifiedAliasMember as a possible
2249 type-bearing expression.
2250 (local_variable_type, local_variable_pointer_type): Likewise.
2251 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
2252 aliases in the current and enclosing namespace declarations.
2253 (NamespaceEntry.UsingAlias): Add CS0440 warning.
2254 * decl.cs (MemberName.is_double_colon): New.
2255 (MemberName.MemberName): Add new constructor for alias-member.
2256 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2257 * expression.cs (QualifiedAliasMember): New expression type.
2259 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2261 * location.cs : it borked when no argument was specified.
2263 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2265 * location.cs : tiny ToString() format fix.
2267 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2269 * statement.cs : oops, it was missing.
2271 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2273 A set of fixes for precise line/column location.
2276 "token" field now holds a file/line "delta", a line number offset
2277 from the segment, and a column number. See also:
2278 http://lists.ximian.com/pipermail/mono-devel-list/2004-
2279 December/009508.html
2280 Removed static IsNull. Use instance IsNull property instead.
2282 For some tokens it stores Location. For Identifier it stores
2283 LocatedToken which is a pair of string name and location.
2284 Column numbers are adjusted only at getChar().
2286 Use Location.ToString() for reporting (it now contains column).
2288 Largely modified to use LocatedToken instead of
2289 string (IDENTIFIER), and to acquire Location from some tokens.
2290 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2291 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2293 Now MemberName holds Location. DeclSpace.ctor() receives Location
2294 as a parameter. Removed extra parameters to all derived classes.
2295 Replaced Location.IsNull() with instance property.
2296 * assign.cs, expression.cs :
2297 Added .ctor() overload that omits Location.
2299 Added "nameEscaped" flag that indicates the identifier was escaped
2300 in the source file. This fixes bug #57047.
2302 2005-09-02 Martin Baulig <martin@ximian.com>
2304 * class.cs: Make CS3005 a warning, not an error.
2306 2005-08-02 Marek Safar <marek.safar@seznam.cz>
2308 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2309 New method, looking for lo-case imported cls type.
2311 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2314 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2316 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2318 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2320 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2322 Optimized to save 3.5 MB for SWF compilation.
2324 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2326 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2327 (PartialContainer.Create): Moved logic AddToContainer.
2328 (PartialContainer.MarkForDuplicationCheck): Shares name.
2330 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2333 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2335 (Namespace.GetSignatureForError): New method.
2337 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2338 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2340 2005-08-01 Raja R Harinath <rharinath@novell.com>
2343 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2344 member lookup rather than qualifier_type, since qualifier_type can
2347 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2349 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2352 2005-07-31 Miguel de Icaza <miguel@novell.com>
2354 * statement.cs: Copy the local exception into the exception
2355 captured local. Fixes 75674
2357 2005-07-31 Raja R Harinath <harinath@gmail.com>
2360 * expression.cs (Invocation.OverloadResolve): Don't report error
2361 CS1501 if error CS1502 has been reported.
2362 (New.DoResolve): Delegate CS1501 reporting to
2363 Invocation.OverloadResolve.
2366 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2367 invariant-meaning-in-block property in an enclosing block if
2370 2005-07-29 Marek Safar <marek.safar@seznam.cz>
2372 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2373 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2374 (Switch.CheckSwitch): Just save 50kb for SWF.
2376 2005-07-27 Martin Baulig <martin@ximian.com>
2378 * anonymous.cs (CaptureContext.AddField): Added
2379 `AnonymousContainer am' argument; compute its toplevel scope if
2380 it's not already computed. Fixes #75649.
2382 2005-07-26 Raja R Harinath <rharinath@novell.com>
2385 * class.cs (Constructor.Emit): Reset block to null if the block
2388 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2390 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2392 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2394 * class.cs (MethodData.Define): Check whether accessor implementing
2395 interface is public.
2397 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2399 2005-07-22 Marek Safar <marek.safar@seznam.cz>
2402 * namespace.cs (LookupType): Moved same type check to...
2404 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2407 2005-07-21 Raja R Harinath <rharinath@novell.com>
2409 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2410 already found a typebuilder.
2411 * class.cs (MethodCore.IsDuplicateImplementation): Compare
2412 MemberNames, not strings.
2414 * const.cs (Error_ExpressionMustBeConst):
2415 Rename from Error_EpressionMustBeConst.
2416 * const.cs, class.cs, statement.cd: Update.
2418 2005-07-21 Marek Safar <marek.safar@seznam.cz>
2422 * const.cs (Const.LookupConstantValue): Report missing contant expression
2424 (Error_EpressionMustBeConstant): Only one error method.
2426 * class.cs, statement.c: Updated.
2428 2005-07-20 Raja R Harinath <rharinath@novell.com>
2430 * statement.cs (Block.Flags): Add back HasVarargs.
2431 (Block.flags): Make protected.
2432 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2434 * typemanager.cs (types, typecontainers, user_types): Remove.
2435 (UserTypes, TypeContainers): Likewise.
2436 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2437 (CleanUp, Reset): Update.
2438 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
2439 (GetNestedType): Use Type.GetNestedType.
2440 (CoreLookupType): Take two arguments, the namespace and the
2441 basename of the type. Update to use the Namespace.Lookup
2443 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2444 (RealMemberLookup): Use IsNestedChildOf instead of playing with
2445 string concatenation and substring matches.
2446 * class.cs, enum.cs, delegate.cs: Update to changes.
2448 2005-07-20 Marek Safar <marek.safar@seznam.cz>
2450 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2451 Expression and made virtual.
2453 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2454 (ImplicitStandardConversionExists): Fixed `byte' typo ?
2456 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2458 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2461 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2464 2005-07-18 Marek Safar <marek.safar@seznam.cz>
2467 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2468 AssemblyCultureAttribute is not used on executable.
2471 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2473 2005-07-16 Raja R Harinath <rharinath@novell.com>
2476 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2477 New. Reports CS0252/CS0253.
2478 Mostly taken from preliminary patch by Duncak Mak.
2479 (Binary.DoResolveOperator): Store results of operator lookup.
2480 Use them to detect if we need to warn about unintended reference
2483 2005-07-15 Raja R Harinath <rharinath@novell.com>
2486 * namespace.cs (Namespace.Lookup): Add back location parameter.
2487 (Namespace.LookupType): Add CS0436 report. Add location parameter.
2488 * delegate.cs, ecore.cs, expression.cs: Update to changes.
2490 * codegen.cs (EmitContext.DeclSpace): Make readonly.
2491 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2492 (Namespace.LookupType): ... this.
2493 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2495 * typemanager.cs (LookupTypeReflection): Remove buggy code that
2496 purported to handle pointers.
2497 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2500 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2502 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2505 2005-07-15 Raja R Harinath <rharinath@novell.com>
2507 * namespace.cs (Namespace.Lookup): Drop location parameter.
2508 (NamespaceEntry.LookupAlias): Remove. Merge into ...
2509 (NamespaceEntry.Lookup): ... this.
2510 (NamespaceEntry.Error_AmbiguousTypeReference):
2511 Move here from DeclSpace.
2512 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2514 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2515 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2516 Move to NamespaceEntry.
2517 * delegate.cs, expression.cs: Update to changes.
2519 2005-08-31 Martin Baulig <martin@ximian.com>
2521 Committing a patch from Atsushi Enomoto for #75850.
2523 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2524 Prefer a generic enumerator over a non-generic one.
2526 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2528 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2529 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2531 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2533 * driver.cs : reverting default encoding change as well as mcs.
2535 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2537 * driver.cs, support.cs : merged r48826.
2539 > could you integrate your mcs changes to gmcs otherwise
2540 > gmcs cannot compile some files.
2542 2005-08-20 Martin Baulig <martin@ximian.com>
2544 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2545 scope if we don't already have it.
2547 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2548 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2551 2005-07-31 Miguel de Icaza <miguel@novell.com>
2553 * statement.cs: Copy the local exception into the exception
2554 captured local. Fixes 75674
2556 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2558 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2561 2005-08-12 Martin Baulig <martin@ximian.com>
2563 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2564 for nested types here to avoid hitting the cache too early.
2566 2005-08-09 Miguel de Icaza <miguel@novell.com>
2568 * enum.cs: On the new compiler CLS error 3005 is now a warning not
2571 2005-08-03 Martin Baulig <martin@ximian.com>
2573 Make iterators in generic methods work; see gtest-191.cs.
2576 (Constraints.Resolve): Protect against being called twice.
2579 (TypeContainer.GetClassBases): Make this `protected virtual'.
2581 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2582 (Iterator.GetClassBases): Override this and compute the base
2584 (Iterator.DefineNestedTypes): If we're a generic method, all our
2585 method type parameters become class type parameters on the proxy
2589 (ToplevelBlock.Parameters): Make this a property, not a field.
2590 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2592 2005-08-03 Martin Baulig <martin@ximian.com>
2594 * typemanager.cs (TypeManager.IsSubclassOf): Use
2595 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2596 (TypeManager.GetFullName_recursed): Improved.
2598 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2601 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2602 Private accessor case, using TypeManager.IsPrivateAccessible instead of
2603 invocation_type == mi.DeclaringType, since the first one also checks
2604 other condition used by generic instances.
2606 2005-07-27 Martin Baulig <martin@ximian.com>
2608 * anonymous.cs (CaptureContext.AddField): Added
2609 `AnonymousContainer am' argument; compute its toplevel scope if
2610 it's not already computed. Fixes #75649.
2612 2005-07-14 Marek Safar <marek.safar@seznam.cz>
2614 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2615 CheckAttributeType and refactored.
2616 (Attribute.ResolvePossibleAttributeType): Changed to reuse
2617 ResolveAsTypeTerminal error handling.
2618 (ResolveAsTypeTerminal): Introduced because of global attributes extra
2620 (GetSignatureForError): Print errors in same way.
2623 * codegen.cs: Reflect attribute GetSignatureForError change.
2626 * expression.cs: Add silent parameter to ResolveAsTypeStep.
2628 * namespace.cs (UsingEntry): Refactored to make fields private.
2631 statement.cs: Error_UnexpectedKind has extra parameter.
2633 2005-07-14 Raja R Harinath <rharinath@novell.com>
2635 * ecore.cs (IAlias): Remove.
2636 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
2637 that implement the interface.
2638 * namespace.cs (Namespace): Likewise.
2639 (Namespace.declspaces): Renamed from 'defined_names'.
2640 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
2641 DeclSpace instead of an IAlias.
2642 * tree.cs (Tree.AddDecl): Update.
2644 2005-07-12 Raja R Harinath <rharinath@novell.com>
2646 * statement.cs (Block.Flags); Remove HasVarargs.
2647 (Block.HasVarargs): Move to ToplevelBlock.
2648 (Block.ThisVariable, Block.AddThisVariable): Likewise.
2649 (Block.Variables): Make protected. Initialize variable hashtable
2651 (Block.AddVariable): Update.
2652 (Block.Resolve): Update to changes.
2653 (ToplevelBlock.HasVarargs): New boolean.
2654 (ToplevelBlock.ThisVariable): Move here from Block.
2655 (ToplevelBlock.AddThisVariable): Likewise.
2656 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
2657 * expression.cs (This.ResolveBase): Update to changes.
2658 (ArglistAccess.DoResolve): Likewise.
2660 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2663 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2665 * class.cs (TypeContainer.VerifyMembers): Distinguish between
2666 not used and not used & assigned.
2667 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2669 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2672 * expression.cs (Is.DoResolve): null is never provided type.
2674 2005-07-08 Marek Safar <marek.safar@seznam.cz>
2677 * cs-parser.jay: Less strict event error rule to catch more errors.
2679 2005-07-11 Martin Baulig <martin@ximian.com>
2681 * generic.cs (ConstructedType.CheckConstraints): Improve the check
2682 for the constructor constraint: we do not only have to check
2683 whether the class has a public constructor, but also ensure that
2684 it's parameterless. Fixes #75492.
2686 2005-07-11 Martin Baulig <martin@ximian.com>
2688 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
2689 between type parameters if they either have the reference type
2690 constraint or the class constraint.
2692 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
2694 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
2696 2005-07-07 Marek Safar <marek.safar@seznam.cz>
2699 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2700 (ExtractSecurityPermissionSet): Cope with self referencing security
2701 attributes properly.
2703 * driver.cs (SetOutputFile): Made public property OutputFile.
2705 2005-07-07 Raja R Harinath <rharinath@novell.com>
2708 * class.cs (TypeContainer.first_nonstatic_field): Rename from
2709 has_nonstatic_fields. Make into a FieldBase pointer.
2710 (TypeContainer.AddField): Add CS0282 check.
2711 (TypeContainer.EmitType): Update.
2713 2005-07-06 Miguel de Icaza <miguel@novell.com>
2715 * cs-tokenizer.cs (consume_identifier): Do not create strings to
2716 compare if they start with __.
2718 2005-07-06 Raja R Harinath <rharinath@novell.com>
2720 * statement.cs (Switch.SwitchGoverningType): Only look at
2721 UserCasts that don't need implicit standard conversions to one of
2722 the allowed switch types (Fixes test-322.cs).
2723 (LocalInfo.Resolve): Re-enable sanity-test.
2725 2005-07-06 Marek Safar <marek.safar@seznam.cz>
2727 * cs-tokenizer.cs (consume_identifier): Detect double undescores
2729 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2731 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2733 2005-07-06 Raja R Harinath <rharinath@novell.com>
2736 * ecore.cs (SimpleName.GetSignatureForError): Add.
2737 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2738 (MemberAccess.GetSignatureForError): Add.
2740 2005-07-05 Marek Safar <marek.safar@seznam.cz>
2742 The big error and warning messages review.
2772 * typemanager.cs: Updated.
2774 * class.cs: (MethodCore.SetYields): Moved here to share.
2775 (PropertyMethod.Define): Moved iterator setup here.
2777 * iterators.cs: Add orig_method to have full access to parent
2780 2005-07-05 Raja R Harinath <rharinath@novell.com>
2782 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2783 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2784 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2785 variable of struct type.
2786 * expression.cs (Unary.ResolveOperator): Update to change.
2787 (Indirection.VerifyFixed): Likewise.
2788 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2789 (ParameterReference.VerifyFixed): Value parameters are fixed.
2790 (This.VerifyFixed): Treat 'this' as a value parameter.
2791 * statement.cs (LocalInfo.IsFixed): Remove.
2793 2005-07-01 Martin Baulig <martin@ximian.com>
2795 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2796 `ec.EmitThis ()' to get the correct scope.
2798 2005-07-01 Martin Baulig <martin@ximian.com>
2800 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2801 instance is a ParameterReference; fixes #75299.
2803 2005-06-30 Raja R Harinath <rharinath@novell.com>
2806 * expression.cs (Indexers.map): Remove.
2807 (Indexers.Append): Filter out inaccessible setters and getters.
2808 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2811 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
2813 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2814 (FieldExpr.Emit, PropertyExpr.Emit): Update.
2815 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2816 * expression.cs (Invocation.EmitCall): Add CS0120 check.
2818 2005-06-30 Marek Safar <marek.safar@seznam.cz>
2821 * class.cs (FieldBase.GetInitializerExpression): One more field
2824 2005-06-28 Miguel de Icaza <miguel@novell.com>
2826 * pending.cs: Do not define a proxy if the base method is virtual,
2827 it will be picked up by the runtime (bug 75270).
2829 2005-07-08 Martin Baulig <martin@ximian.com>
2831 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2832 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2834 2005-07-07 Martin Baulig <martin@ximian.com>
2836 * generic.cs (ConstructedType.CheckConstraint): Use
2837 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
2838 called recursively; fixes #75329.
2840 2005-07-06 Martin Baulig <martin@ximian.com>
2842 * generic.cs (TypeManager.InferTypeArguments): Added support for
2843 anonymous methods; fixes #75461.
2845 2005-07-01 Martin Baulig <martin@ximian.com>
2847 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2848 `ec.EmitThis ()' to get the correct scope.
2850 2005-07-01 Martin Baulig <martin@ximian.com>
2852 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
2853 instance is `This'; fixes #75299.
2855 2005-06-30 Martin Baulig <martin@ximian.com>
2857 * class.cs (Indexer): Implement IIteratorContainer; added support
2858 for iterators in indexers.
2861 (EmitContext.CurrentIterator): Make this a property, not a field.
2863 * anonymous.cs (AnonymousContainer.Iterator): New public property.
2865 2005-06-28 Miguel de Icaza <miguel@novell.com>
2867 * pending.cs: Do not define a proxy if the base method is virtual,
2868 it will be picked up by the runtime (bug 75270).
2870 2005-06-28 Martin Baulig <martin@ximian.com>
2872 * cs-parser.jay (interface_method_declaration): Avoid a
2873 reduce/reduce conflict by moving some of the code into a separate
2874 `interface_method_declaration_body' rule; fixes #75368.
2876 2005-06-28 Martin Baulig <martin@ximian.com>
2878 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
2879 array check after the check for TypeBuilder's.
2881 2005-06-21 Raja R Harinath <rharinath@novell.com>
2883 * convert.cs (FindMostEncompassedType): Add two trivial special
2884 cases (number_of_types == 0 || number_of_types == 1).
2885 (FindMostEncompasingType): Likewise.
2887 2005-06-17 Raja R Harinath <rharinath@novell.com>
2889 Some cleanups preparing for the fix of #75283.
2890 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2892 (EventExpr.InstanceResolve): Likewise.
2893 (EventExpr.DoResolve): Remove redundant checks.
2895 2005-06-08 Miguel de Icaza <miguel@novell.com>
2897 * class.cs: Small fix.
2899 2005-06-08 Raja R Harinath <rharinath@novell.com>
2902 * class.cs (GetPartialBases): Fix return value check of
2905 2005-06-07 Raja R Harinath <rharinath@novell.com>
2907 Ensure that partial classes are registered in their enclosing
2908 namespace. Initial part of fix of #75160.
2909 * tree.cs (Tree.RecordDecl): Add new namespace argument.
2910 Register declspace with namespace here, not in
2911 DeclSpace.RecordDecl.
2912 * cs-parser.jay: Pass namespace to RecordDecl.
2913 * class.cs (PartialContainer.Create): Likewise.
2914 (ClassPart.DefineType): New sanity-check. Throws an exception if
2916 * decl.cs (Declspace.RecordDecl): Remove.
2917 * namespace.cs (NamespaceEntry.DefineName): Remove.
2919 2005-06-06 Marek Safar <marek.safar@seznam.cz>
2921 * rootcontext.cs: Reset TargetExt as well.
2923 2005-06-03 Raja R Harinath <rharinath@novell.com>
2925 * ecore.cs (Expression.Resolve): Emit CS0654 error when
2928 2005-06-02 Raja R Harinath <rharinath@novell.com>
2930 Fix #75080, cs0119.cs.
2931 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
2933 (Expression.Resolve): ... this. Use it. Remove bogus code
2934 allowing ExprClass.Type and ExprClass.Namespace for
2935 ResolveFlags.VariableOrValue.
2936 (Expression.Resolve) [1-argument variant]: Change default resolve
2937 flags based on language version.
2938 (Expression.Error_UnexpectedKind): Use a simple string array
2939 rather than an ArrayList.
2940 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
2942 (TypeOfVoid.DoResolve): Likewise.
2943 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
2944 flags argument -- it always has the same value.
2946 2005-05-31 Raja R Harinath <rharinath@novell.com>
2949 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
2950 Use it in the error message.
2951 * assign.cs, expression.cs, statement.cs: Update.
2953 2005-05-30 Raja R Harinath <rharinath@novell.com>
2956 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
2957 the "almostMatchedMember" case too.
2958 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
2959 that failed the accessibility checks to 'almost_match'.
2961 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
2963 * attribute.cs: Use internal MethodBuilder methods to set
2964 ExactSpelling and SetLastError on PInvoke methods, instead
2965 of passing them via charset. Fixes #75060.
2967 2005-05-27 Raja R Harinath <rharinath@novell.com>
2969 * parameter.cs (Parameter): Remove TODO comment.
2970 (Parameter.DefineParameter): Remove Location parameter.
2971 (Parameters.LabelParameters): Likewise.
2972 * class.cs (Constructor.Emit): Update to change.
2973 (MethodData.Emit): Likewise.
2974 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
2975 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
2977 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
2980 Removed Parameters.Location and added Parameter.Location instead.
2981 Removed Location parameter from Emit() and GetSignature().
2988 Modified all related calls.
2990 2005-06-21 Martin Baulig <martin@ximian.com>
2992 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
2993 left-hand side is not a nullable type; fixes #75328.
2995 2005-06-21 Martin Baulig <martin@ximian.com>
2998 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
2999 (TypeManager.GetFullNameSignature): Likewise.
3001 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3002 `source.FullName' and `target.FullName' to check whether there are
3003 two conflicting definitions.
3005 2005-06-21 Martin Baulig <martin@ximian.com>
3007 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3008 a BoxedCast - also for reference types - to be compatible with csc.
3010 2005-06-21 Martin Baulig <martin@ximian.com>
3012 * expression.cs (MemberAccess.DoResolve): Add support for nested
3013 types in a generic instance; fixes #75320.
3015 2005-06-20 Martin Baulig <martin@ximian.com>
3017 * generic.cs (TypeManager.InferType): Also walk the class
3018 hierarchy for generic instances; fixes #75261.
3020 2005-06-17 Martin Baulig <martin@ximian.com>
3022 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3023 to make things work for corlib.
3025 2005-06-15 Martin Baulig <martin@ximian.com>
3027 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3028 obsolete `SecurityAction' values.
3030 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3032 * rootcontext.cs: Reset TargetExt as well.
3034 2005-06-09 Martin Baulig <martin@ximian.com>
3036 * delegate.cs (Delegate.VerifyMethod): Added
3037 `MethodGroupExpr old_mg' argument; inherit its
3038 `HasTypeParameters'; fix #75085.
3040 2005-06-09 Martin Baulig <martin@ximian.com>
3042 * expression.cs (Invocation.OverloadResolve): Correctly handle
3043 generic methods for the SetMemberIsUsed(); fix #75064.
3045 2005-06-09 Martin Baulig <martin@ximian.com>
3047 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3050 2005-06-08 Martin Baulig <martin@ximian.com>
3052 * cs-parser.jay (nullable_type_or_conditional): If we put the
3053 nullable back and our `type' is a `ComposedCast', remove the
3054 nullable from it. Fixes #75156.
3056 * expression.cs (ComposedCast.RemoveNullable): New public method.
3058 2005-06-08 Martin Baulig <martin@ximian.com>
3060 The big Iterators rewrite :-)
3062 * iterators.cs: Rewrite this to use the anonymous methods framework.
3064 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3065 before the TypeContainers; see 2test-21.cs.
3068 (TypeContainer.DefineType): Don't create a new EmitContext if we
3069 already have one (this only happens if we're an Iterator).
3070 (TypeContainer.Define): Also call Define() on all our iterators.
3071 (Method.CreateEmitContext): Added support for iterators.
3074 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3075 (AnonymousContainer.CreateMethodHost): Moved here from
3076 AnonymousMethod and made abstract.
3077 (AnonymousContainer.CreateScopeType): New abstract method.
3078 (AnonymousContainer.IsIterator): New public property.
3079 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3080 get the ScopeTypeBuilder rather than manually defining it here.
3081 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3084 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3085 before RootContext.DefineTypes().
3087 * codegen.cs (EmitContext.RemapToProxy): Removed.
3088 (EmitContext.CurrentAnonymousMethod): Changed type from
3089 AnonymousMethod -> AnonymousContainer.
3090 (EmitContext.ResolveTopBlock): Protect from being called twice.
3091 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3092 (EmitContext.EmitThis): Removed the iterators hacks; use the
3093 anonymous methods framework for that.
3096 (ToplevelBlock.Container): Make this a property, not a field.
3097 (ToplevelBlock.ReParent): New public method; move the
3098 ToplevelBlock into a new container.
3099 (Foreach.TemporaryVariable): Simplify.
3101 2005-06-05 Martin Baulig <martin@ximian.com>
3103 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3104 (Block.AddTemporaryVariable): New public method; creates a new
3105 `LocalInfo' for a temporary variable.
3106 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3108 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3109 non-iterator variables.
3111 2005-06-05 Martin Baulig <martin@ximian.com>
3113 * statement.cs (Foreach.TemporaryVariable): Create the
3114 LocalBuilder in the Emit phase and not in Resolve since in some
3115 situations, we don't have an ILGenerator during Resolve; see
3116 2test-19.cs for an example.
3118 2005-06-04 Martin Baulig <martin@ximian.com>
3120 The big Foreach rewrite - Part II.
3122 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3123 with `PropertyInfo ienumerator_getcurrent'.
3125 * codegen.cs (VariableStorage): Removed.
3128 (Foreach): Derive from Statement, not ExceptionStatement.
3129 (Foreach.CollectionForeach): New nested class. Moved all the code
3130 dealing with collection foreach here.
3131 (Foreach.ForeachHelperMethods): Removed.
3132 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3134 2005-05-23 Martin Baulig <martin@ximian.com>
3136 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3137 don't need to. Fix #75014.
3139 2005-05-26 Raja R Harinath <rharinath@novell.com>
3141 Improve user-defined conversion handling.
3142 * convert.cs (GetConversionOperators): Rewrite. Return only the
3143 applicable operators.
3144 (AddConversionOperators): New. Helper for GetConversionOperators.
3145 (FindMostEncompassedType, FindMostEncompassingType): Verify that
3146 there is only one most encompassed/encompassing type.
3147 (FindMostSpecificSource, FindMostSpecificTarget): Remove
3148 "applicable operator" handling.
3149 (UserConversion): Move cache here from GetConversionOperators.
3150 Directly cache the chosen operator, rather than the whole
3152 (ExplicitNumericConversion): Fix buggy implementation of Decimal
3153 case. Allow conversion of decimal to sbyte and byte too.
3154 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3155 New static methods. Used to avoid allocating EmptyExpressions in
3158 2005-05-24 Duncan Mak <duncan@novell.com>
3160 * ecore.cs (CastFromDecimal): New class for casting a decimal to
3161 another class, used in Convert.ExplicitNumericConversion.
3162 (CastToDecimal): New class, similar to above, but casts to
3163 System.Decimal, used in Convert.ImplicitNumericConversion and also
3164 in explicit convesion from double/float to decimal.
3166 * convert.cs (ImplicitNumericConversion): Handle implicit
3167 conversions to System.Decimal.
3168 (ExplicitNumericConversion): handle explicit conversions to
3173 2005-05-20 Miguel de Icaza <miguel@novell.com>
3175 * typemanager.cs: Do not throw an exception in the TypeBuilder
3176 case, we take care of it on the TypeCode.
3178 2005-05-17 Marek Safar <marek.safar@seznam.cz>
3180 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3183 * cs-parser.jay: Catch more lexical errors.
3185 * report.cs: Add one more Error method.
3188 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3190 2005-05-20 Martin Baulig <martin@ximian.com>
3192 * class.cs (TypeContainer.CircularDepException): Removed.
3193 (TypeContainer.DefineType): Removed the `InTransit' stuff.
3194 (TypeContainer.CheckRecursiveDefinition): Check for circular class
3195 (CS0146) and interface (CS0529) dependencies here.
3197 2005-05-20 Martin Baulig <martin@ximian.com>
3199 * expression.cs (New.DoResolve): Move the CS0712 check above the
3200 CS0144 check; otherwise it can never be reached.
3202 2005-05-20 Martin Baulig <martin@ximian.com>
3204 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3206 2005-05-20 Martin Baulig <martin@ximian.com>
3208 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3210 * typemanager.cs (TypeManager.IsAttributeType): New public method.
3212 2005-05-19 Martin Baulig <martin@ximian.com>
3215 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3216 to disable error reporting.
3218 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3219 here since we don't want to report an error; see the new test-336.cs.
3221 2005-05-19 Raja R Harinath <rharinath@novell.com>
3223 * statement.cs (ToplevelBlock.GetParameterReference)
3224 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3225 Move here from class Block.
3226 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3227 * expression.cs (ParameterReference.DoResolveBase): Likewise.
3229 2005-05-18 Martin Baulig <martin@ximian.com>
3234 (FlowBranching.Reachability): Add non-static public And() and Or()
3236 (FlowBranchingSwitch): New class; do the `break_origins' thing
3237 like in FlowBranchingLoop.
3238 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3239 reachability, not just locals and parameters.
3240 (FlowBranching.MergeChild): Remove some of the hacks for loop and
3241 switch; MergeBreakOrigins() now takes care of that.
3243 2005-05-18 Martin Baulig <martin@ximian.com>
3245 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3246 a loop and may leave it, reset the barrier; fixes #74974.
3248 2005-05-16 Raja R Harinath <rharinath@novell.com>
3250 Fix test-382.cs. Emit values of decimal constants.
3251 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3253 (TypeContainer.AddField): ... this.
3254 (TypeContainer.EmitFieldInitializers): Allow the list of fields
3255 with initializers to include 'Const's.
3256 (ClassPart.RegisterFieldForInitialization): Forward to
3258 * const.cs (Const.Const): Pass initializer to base class.
3259 (Const.Define): In case of decimal constants, register them for
3260 initialization in a static constructor.
3262 2005-05-14 Martin Baulig <martin@ximian.com>
3264 * statement.cs (Block.Resolve): Correctly handle unreachable code;
3265 do not call ResolveUnreachable() on unreachable statements in
3266 here, see the comment in the source code.
3268 2005-05-13 Raja R Harinath <rharinath@novell.com>
3271 * expression.cs (BinaryResolveOperator): If one of the operands of
3272 an equality comparison is 'null' and the other is a pointer type,
3273 convert the null to a NullPointer.
3274 * convert.cs (ImplicitReferenceConversion): If the expression is a
3275 NullLiteral and the target type is a pointer type, return a
3276 NullPointer instead.
3277 (ImplicitConversionStandard): Likewise.
3279 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3281 * cs-parser.jay: Set readonly context based on special constructs.
3283 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3284 readonly variable error handling.
3286 * rootcontext.cs (EmitCode): Don't verify members when error
3289 * statement.cs (LocalInfo): Add reaodnly context information.
3290 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3292 2005-05-17 Martin Baulig <martin@ximian.com>
3294 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3297 2005-05-13 Martin Baulig <martin@ximian.com>
3299 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3300 handle unreachable blocks.
3302 2005-05-13 Martin Baulig <martin@ximian.com>
3305 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3306 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3309 2005-05-13 Martin Baulig <martin@ximian.com>
3311 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3312 instance variable, not a local. Fix #74873.
3313 (Block.ResolveUnreachable): Set it to true here.
3315 2005-05-12 Martin Baulig <martin@ximian.com>
3317 * cs-parser.jay (property_declaration): Pass the `current_class',
3318 not the `current_container' to Property's .ctor. Fixes #74912.
3320 2005-05-11 Martin Baulig <martin@ximian.com>
3322 * typemanager.cs (Closure): Copy this from MCS and merge all the
3323 GMCS-specific changes into it.
3325 2005-05-12 Raja R Harinath <harinath@gmail.com>
3328 * typemanager.cs (unmanaged_enclosing_types): New.
3329 (IsUnmanagedType): Avoid infloops by using
3330 'unmanaged_enclosing_types' to talk with recursive invocations.
3332 2005-05-11 Duncan Mak <duncan@novell.com>
3334 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3335 continuing to process for 'arg'.
3336 (handle_preprocessing_directive): Check the argument of the #endif
3337 directive and report error CS1025 if there are any trailing
3340 According to the C# spec, having even whitespace after the #endif
3341 directive is illegal; however, because we call arg.TrimEnd ()
3342 beforehand, we have the same behavior as csc, allowing whitespace
3343 after the directive.
3347 2005-05-11 Marek Safar <marek.safar@seznam.cz>
3351 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3352 (Constructor.GetObsoleteAttribute): Implemented correctly.
3354 2005-05-10 Martin Baulig <martin@ximian.com>
3356 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3357 resolve the type; fixes #74864.
3358 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3359 in DoResolve(); fixes #74862.
3361 2005-05-10 Martin Baulig <martin@ximian.com>
3363 * support.cs (ReflectionParameters.ParameterModifier): Use
3364 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3365 and `ParameterAttributes.In'. Fixes #74884.
3367 2005-05-10 Martin Baulig <martin@ximian.com>
3369 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3370 the cache if we're just looking for `MemberTypes.NestedType' in a
3373 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3374 constraints if we're still resolving the type tree.
3375 (Expression.MemberLookup): If we're resolving the type tree, only
3376 look for `MemberTypes.NestedType' since we're only interested in
3379 * class.cs (TypeContainer.DefineType): Don't resolve the type
3380 parameters here; do this later in ResolveType() after the type
3381 tree has been resolved.
3382 (TypeContainer.ResolveType): New public method; this is called
3383 after the type tree is resolved and before the types are being
3384 populated. We resolve the generic constraints here.
3385 (TypeContainer.DoDefineMember): Check the constraints on our base
3386 class and interfaces.
3388 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3389 set the `ResolvingTypeTree' flag on the EmitContext.
3391 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3393 2005-05-10 Marek Safar <marek.safar@seznam.cz>
3395 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3397 * expression.cs (Argument.GetParameterModifier): Turned to property.
3398 (Invocation.Error_InvalidArguments): Add more descriptive errors.
3400 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3403 2005-05-09 Raja R Harinath <rharinath@novell.com>
3406 * decl.cs (MemberCache.AddMethods): Register override methods,
3407 rather than non-override methods.
3408 * typemanager.cs (RegisterOverride): New.
3409 (IsOverride): Update.
3411 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3413 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3415 2005-05-06 Martin Baulig <martin@ximian.com>
3418 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3419 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3421 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3425 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3426 recursive declaration.
3428 * statement.cs (Block.ResolveMeta): Report any error in resolving.
3430 2005-05-06 Marek Safar <marek.safar@seznam.cz>
3432 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3434 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3436 2005-05-05 Raja R Harinath <rharinath@novell.com>
3439 * decl.cs (DeclSpace.FamilyAccessible):
3440 Use TypeManager.IsNestedFamilyAccessible.
3442 Fix reopened #64812.
3443 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3446 2005-05-04 Raja R Harinath <rharinath@novell.com>
3447 Abin Thomas <projectmonokochi@rediffmail.com>
3448 Anoob V E <projectmonokochi@rediffmail.com>
3449 Harilal P R <projectmonokochi@rediffmail.com>
3452 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3453 allow access to all static members.
3455 2005-05-04 Martin Baulig <martin@ximian.com>
3457 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3459 2005-05-04 Martin Baulig <martin@ximian.com>
3463 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3464 section at the end; make things work if `default' is not the last
3467 2005-05-04 Martin Baulig <martin@ximian.com>
3471 * statement.cs (Switch): Replaced the `got_default' field with a
3472 `default_section' one.
3473 (Switch.CheckSwitch): Set `default_section' here.
3474 (Switch.Resolve): If we're a constant switch and the constant is
3475 not found, use the default section.
3477 2005-05-03 Martin Baulig <martin@ximian.com>
3479 * expression.cs (ArrayAccess.EmitGetLength): New public method.
3481 * statement.cs (Foreach.ArrayForeach): New nested class.
3482 (Foreach.TemporaryVariable): New nested class.
3483 (Foreach.EmitArrayForeach): Removed; this is now in the new
3486 2005-05-03 Raja R Harinath <rharinath@novell.com>
3488 * pending.cs (BaseImplements): Move the #74773 fix here. This is
3490 (VerifyPendingMethods): Revert change below.
3492 * typemanager.cs (IsOverride, RegisterNonOverride): New.
3493 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3494 that used to trigger warning -28. Remove warning -28.
3495 * expression.cs (Invocation.OverloadResolve): Use
3496 TypeManager.IsOverride to distinguish override methods.
3499 * pending.cs (VerifyPendingMethods): If a base type implements the
3500 requested interface, don't bother checking individual methods of
3501 the base type. As a side-effect, this prevents the creation of
3502 unnecessary proxies.
3504 2005-05-02 Martin Baulig <martin@ximian.com>
3508 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3509 Also `And' the locals if the old vector is null.
3510 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3511 null; in this case we basically reset all the variables.
3513 2005-05-02 Martin Baulig <martin@ximian.com>
3517 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3518 Added `FlowBranching branching' argument; always `and' the
3519 variables instead of `or'ing them unless we're an infinite loop.
3521 * statement.cs (While.Resolve): Create a new sibling unless we're
3524 2005-05-02 Martin Baulig <martin@ximian.com>
3528 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3529 arguments; use it instead of creating a new TopLevelBlock.
3530 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3531 our ConstructorInitializer.
3534 (TopLevelBlock.TopLevelBranching): New public property.
3535 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3536 and create our `TopLevelBranching'.
3538 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3539 anonymous method host, use `block.TopLevelBranching' rather than
3540 creating a new branching.
3542 2005-04-20 Miguel de Icaza <miguel@novell.com>
3544 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3545 a ScopeInfo, if any of the current children is a child of the new
3546 entry, move those children there.
3548 2005-04-30 Martin Baulig <martin@ximian.com>
3550 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3551 at the beginning of a SwitchSection. Fix #73335.
3553 2005-04-27 Marek Safar <marek.safar@seznam.cz>
3556 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3558 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3559 (FieldExpr.DoResolve): Obsolete members are ignored for field
3562 2005-04-26 Marek Safar <marek.safar@seznam.cz>
3564 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3565 of arrays detection.
3567 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3569 (Field.VerifyClsCompliance): Volatile fields are not compliant.
3571 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3574 2005-04-25 Ben Maurer <bmaurer@ximian.com>
3576 * cs-parser.jay: Use the prefered version of -unsafe in error
3579 2005-04-22 Marek Safar <marek.safar@seznam.cz>
3581 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3584 2005-04-20 John Luke <john.luke@gmail.com>
3586 * driver.cs: fix typo in error message, --outout to --output
3588 2005-04-30 Martin Baulig <martin@ximian.com>
3590 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3591 handle the .NET 2.x security attributes.
3593 2005-04-30 Martin Baulig <martin@ximian.com>
3596 (TypeManager.ExpandInterfaces): Don't add things twice.
3599 (TypeContainer.VerifyClsCompliance): Allow generic instances.
3601 2005-04-29 Martin Baulig <martin@ximian.com>
3603 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3605 * anonymous.cs: Added support for anonymous generic methods.
3607 2005-04-29 Martin Baulig <martin@ximian.com>
3609 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3612 2005-04-29 Martin Baulig <martin@ximian.com>
3614 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3616 * expression.cs (New.DoResolve): Fix the CS0304 check.
3618 2005-04-29 Martin Baulig <martin@ximian.com>
3620 * typemanager.cs (TypeManager.GetFullName): Updated to the new
3623 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3624 explicit interface implementation, compare the interface types.
3625 (MethodData.Define): Use the new naming scheme from the latest
3627 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3629 * decl.cs (MemberName.GetMemberName): Removed.
3630 (MemberName.MethodName, FullName): New properties.
3632 2005-04-25 Raja R Harinath <rharinath@novell.com>
3634 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3636 2005-04-22 Martin Baulig <martin@ximian.com>
3638 * generic.cs (GenericMethod): Create the EmitContext in the
3639 `Define()'; in `Define(MethodBuilder)', create the type parameters
3640 before calling `Define()'. Fixes #73933.
3642 2005-04-22 Martin Baulig <martin@ximian.com>
3645 (Constraints.Resolve): Make things work wrt. the new type lookup system.
3646 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3648 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3649 ConstructedType, check its constraints.
3651 2005-04-20 Marek Safar <marek.safar@seznam.cz>
3653 * codegen.cs (InRefOutArgumentResolving): New field.
3655 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3656 fields outside contructor.
3658 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3660 2005-04-19 Miguel de Icaza <miguel@novell.com>
3662 * anonymous.cs (CaptureContext.EmitParameterInstance): The
3663 parameter code was not completed ever, so it was not as up-to-date
3664 as local variables. Must finish it.
3666 The bug fix was to compare the Toplevel of the block, not the
3667 current block. Thanks for Ben for pointing this out.
3669 2005-04-19 Raja R Harinath <rharinath@novell.com>
3671 * decl.cs (AddMethods): Use the declaring type of the problem
3672 method to determine if we want to squash a warning.
3674 2005-04-19 Marek Safar <marek.safar@seznam.cz>
3676 * attribute.cs: Removed debug output.
3678 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3680 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3683 2005-04-18 Raja R Harinath <rharinath@novell.com>
3686 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3687 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3688 all null comparisons against reference types.
3690 2005-04-18 Marek Safar <marek.safar@seznam.cz>
3693 * class.cs (TypeContainer.CircularDepException) New nested
3695 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3696 (TypeContainer.DefineType): Removed error, reset InTransit before
3698 (Class.DefineType): Throw exception when is in Transit.
3699 Catch exception and report error.
3700 (Struct.DefineType): Throw exception when is in Transit.
3701 Catch exception and report error.
3702 (Interface.DefineType): Throw exception when is in Transit.
3703 Catch exception and report error.
3705 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3706 handle nested exception handlers.
3708 * flowanalysis.cs (InTryWithCatch): New method, search for try with
3711 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3712 InFinally and InCatch storage.
3714 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3715 (Catch.Resolve): Set and Restore ec.InCatch.
3716 (Try.Resolve): Set and Restore ec.InFinally.
3717 (Try.HasCatch): True when try has catch.
3719 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
3721 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3722 for the same event member, so exclude such cases from warning 419.
3725 2005-04-16 Miguel de Icaza <miguel@novell.com>
3727 * expression.cs (Binary.ResolveOperator): Apply patch from John
3728 Luke to fix bug 59864: operators &, | and ^ on enumerations
3729 require that the same enum type on both sides.
3731 * driver.cs: Add warnings to old flag usage, this is to assist
3732 people who produce Makefiles and hope that the Makefiles will be
3735 * class.cs (TypeContainer.EmitType): Moved the definition of the
3736 special $PRIVATE$ field from the resolve phase to the Emit phase.
3737 During resolve we do not know if we are a struct with
3738 HasExplicitLayout, we know this only after the attributes for the
3741 Set the FieldOffset to zero on the dummy field that we create for
3742 the class. Fixes 74590.
3744 2005-04-16 Raja R Harinath <rharinath@novell.com>
3747 * ecore.cs (PropertyExpr.resolved): New.
3748 (DoResolve): Use it to handle a case of double resolution here.
3749 Handle a case of identical-name-and-type-name.
3750 * expression.cs (ArrayCreation.CheckIndices): Avoid double
3751 resolution by storing the results of expression resolution back
3752 into the "probes" array.
3754 2005-04-15 Raja R Harinath <rharinath@novell.com>
3756 Fix cs0208-7.cs and cs0208-8.cs.
3757 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3758 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
3759 error reporting to point out the reason a struct is not unmanaged.
3761 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3763 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
3764 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3766 2005-04-13 Raja R Harinath <rharinath@novell.com>
3769 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3770 IdenticalNameAndTypeName here.
3771 (EventExpr.InstanceResolve): Likewise.
3773 2005-04-13 Marek Safar <marek.safar@seznam.cz>
3775 C# 2.0 DefaultCharSetAttribute implementation
3777 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3778 which allows us to set GlobalNamespace for every resolve.
3779 (Attribute.ResolveArguments): Cut from Resolve.
3780 (Attribute.GetCharSetValue): Returns CharSet named argument.
3781 (Attribute.DefinePInvokeMethod): Gets default charset from
3783 (GlobalAttribute.ResolveAsTypeStep): Override.
3784 (GlobalAttribute.ResolveArguments): Override.
3786 * class.cs (TypeAttr): Is protected.
3788 * codegen.cs (ModuleClass.DefaultCharSet): New member.
3789 (ModuleClass.DefaultCharSetType): New memeber.
3790 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3792 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3793 charset from module.
3795 * delegate.cs (TypeAttr): Override.
3796 (Delegate.DefineType): Use this TypeAttr.
3798 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3799 at very early stage (before types are defined) to resolve model
3800 module attributes. It will probably not work with corlib but it
3803 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3804 charset from module.
3806 * typemanager.cs (default_charset_type): New type.
3808 2005-04-13 Raja R Harinath <rharinath@novell.com>
3810 * decl.cs (MemberCache.AddMethods): Don't warn if
3811 System.Object.Finalize has buggy MethodAttributes.
3813 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3816 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3818 * doc.cs : detect ambiguous reference to overloaded members.
3819 Fixed bug #71603. MS 1.1 csc does not detect it.
3821 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3823 * doc.cs : delegates must not be referenced with parameters.
3826 2005-04-12 Miguel de Icaza <miguel@novell.com>
3828 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3830 2005-04-10 Miguel de Icaza <miguel@novell.com>
3832 * driver.cs (MainDriver): Stop processing if the CLS stage found
3835 (CompilerCallableEntryPoint.InvokeCompiler): Always
3836 reset after execution; Take a TextWriter argument for the
3839 * report.cs: Use the error stream instead of hardcoding stderr.
3841 2005-04-09 Miguel de Icaza <miguel@novell.com>
3843 * class.cs: Reduce code paths to test, too small of an
3844 optimization to make it worth the extra testing. Always perform
3847 2005-04-08 Raja R Harinath <rharinath@novell.com>
3850 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3851 operators that had errors reported on them.
3853 2005-04-08 Marek Safar <marek.safar@seznam.cz>
3855 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3857 (Attribute.Resolve): Add named argument type checking.
3859 * class.cs (FixedField.Define): Use IsPrimitiveType
3861 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3863 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3864 unsafe parameter types.
3866 * statement.cs (Using.ResolveExpression): Add better error description.
3868 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3870 2005-04-08 Raja R Harinath <rharinath@novell.com>
3873 * attribute.cs (Attribute.GetAttributeUsage): Resolve
3874 AttributeUsageAttribute in the emitcontext of the attribute class,
3875 not in the emitcontext of the attributable entity it was attached to.
3876 * cs-parser.jay: Use 'current_class', not 'current_container',
3877 when creating a GlobalAttribute.
3879 2005-04-08 Alp Toker <alp@atoker.com>
3881 * pending.cs: The fix to #58413 failed to compile methods implementing
3882 interfaces with/without params modifiers and vice versa, even though
3883 params modifiers aren't part of the signature. Make the modifier check
3884 less strict as in csc.
3886 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
3887 Anoob V E <projectmonokochi@rediffmail.com>
3888 Harilal P R <projectmonokochi@rediffmail.com>
3891 * pending.cs (TypeAndMethods.mods): New. Store the parameter
3892 modifiers of pending methods.
3893 (PendingImplementation.PendingImplementation): Initialize it.
3894 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3895 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3896 with ParameterData. Add check for modifiers.
3897 * class.cs (MethodData.Define): Update to changes.
3899 2005-04-07 Raja R Harinath <rharinath@novell.com>
3901 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3903 2005-04-07 Marek Safar <marek.safar@seznam.cz>
3905 * class.cs (PropertyMethod.Define): Check private accessor in abstract
3908 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3911 * typemanager.cs: Registered RequiredAttributeAttribute.
3913 2005-04-06 Marek Safar <marek.safar@seznam.cz>
3915 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3916 Warning CS0169 is back at level 3.
3917 (IMethodData.SetMemberIsUsed): New method.
3919 * decl.cs (IsUsed): New value; moved from FieldBase.Status
3920 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3922 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3924 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3926 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3929 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3932 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3933 to avoid the problems with nested types.
3935 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
3936 Anoob V.E <projectmonokochi@rediffmail.com>
3937 Harilal P.R <projectmonokochi@rediffmail.com>
3938 Raja R Harinath <rharinath@novell.com>
3941 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3943 * typemanager (GetConstructor): Make public.
3945 2005-04-05 John Luke <john.luke@gmail.com>
3946 Raja R Harinath <rharinath@novell.com>
3949 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3950 struct too. Return false quicker in a few cases.
3951 (VerifyUnManaged): Use it.
3953 2005-04-05 Raja R Harinath <rharinath@novell.com>
3956 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
3957 not 'unreachable_seen'.
3959 2005-04-04 Marek Safar <marek.safar@seznam.cz>
3961 * attribute.cs (Attribute.GetValue): Removed unused.
3963 * codegen.cs (CodeGen.TrimExt): Removed unused.
3965 * cs-parser.jay (output): Removed unused.
3967 * cs-tokenizer.cs (hex_digits): Removed unused.
3969 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
3971 * expression.cs (Indirection.LoadExprValue): Removed unused.
3972 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
3974 * iterators.cs (Iterator.param_types): Removed unused.
3976 * statement.cs (Goto.block): Removed unused.
3977 (ToplevelBlock.did): Removed unused.
3978 (Switch.ResolveConstantSwitch): Removed unused.
3980 2005-04-01 Ben Maurer <bmaurer@ximian.com>
3982 * rootcontext.cs: Allow mcs to bootstrap with the compilation
3985 2005-04-19 Martin Baulig <martin@ximian.com>
3987 Merged r42462 from MCS and made it work for GMCS.
3989 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
3991 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
3993 2005-04-01 Raja R Harinath <rharinath@novell.com>
3995 Fix #74232 and cs0208-3.cs.
3996 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
3997 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
3998 unmanaged type. Don't use FieldBuilders when 't' is a
3999 TypeBuilder. Use ModFlags and MemberType fields.
4000 * class.cs (MemberBase.member_type): Rename from MemberType.
4001 (MemberBase.MemberType): New property. Determines member_type on
4003 (MemberBase.DoDefine): Don't initialize MemberType here.
4004 (FieldMember.Define): Likewise.
4006 2005-04-01 Marek Safar <marek.safar@seznam.cz>
4009 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4010 Attributes are emitted there.
4012 2005-04-01 Raja R Harinath <rharinath@novell.com>
4014 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4015 keyword in 'partial enum' too.
4016 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4018 Report from Kamil Skalski <nazgul@omega.pl>.
4021 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4022 have partial containers too.
4024 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4025 in block' checks to Block.CheckInvariantMeaningInBlock.
4026 * statement.cs (Block.GetKnownVariableInfo): Make private.
4027 (Block.IsVariableUsedInChildBlock): Remove.
4028 (Block.IsVariableUsedInBlock): Likewise.
4029 (Block.CheckInvariantMeaningInBlock): New. Show location of
4030 conflicting declaration.
4031 (Block.AddVariable): Make error messages less long-winded and more
4032 specific. Show location of conflicting declaration.
4033 * parameter.cs (Parameters.Location): New readonly property.
4035 2005-03-31 Raja R Harinath <rharinath@novell.com>
4037 Clean up semantics of invoking ResolveMemberAccess.
4038 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4039 can have an instance, ensure that we pass in a non-TypeExpression
4040 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
4041 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4042 argument. Update to changes and simplify.
4043 (FieldExpr.Emitinstance): Remove CS0120 check.
4044 (PropertyExpr.EmitInstance): Likewise.
4045 * expression.cs (Argument.Resolve): Likewise.
4046 (Invocation.DoResolve): Update to changes in semantics of
4049 2005-03-31 Marek Safar <marek.safar@seznam.cz>
4052 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4055 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4057 2005-03-31 Raja R Harinath <rharinath@novell.com>
4059 Fix difference in behaviour with commandline invocation.
4060 * driver.cs (Driver.Reset): New.
4061 (CompilerCallableEntryPoint): Call it.
4063 * statement.cs (If.Resolve): Avoid spurious "uninitialized
4064 variable" warnings if the boolean expression failed to resolve.
4066 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
4068 * attribute.cs: Fix the union of several permissions when some of them
4069 are unrestricted (so the result isn't an unrestricted permission set).
4072 2005-03-30 Raja R Harinath <rharinath@novell.com>
4074 * ecore.cs (MemberExpr): New class. Convert from interface
4076 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4077 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4079 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4080 (MethodGroupExpr.IsExplicitImpl): Remove.
4081 (Expression.GetFieldFromEvent): Remove.
4082 (SimpleName.MemberStaticCheck): Remove.
4083 (SimpleName.DoSimpleNameResolve): Update to changes.
4084 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4085 (MemberAccess.IdenticalNameAndTypeName): Remove.
4086 (MemberAccess.error176): Move to MemberExpr.
4087 (MemberAccess.DoResolve): Update to changes.
4088 (BaseAccess.DoResolve): Likewise.
4090 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4092 C# 2.0 Conditional attribute class implementation
4094 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4095 Analyzes class whether it has attribute which has ConditionalAttribute
4096 and its condition is not defined.
4098 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4099 (Class.IsExcluded): New method. Search for at least one defined
4100 condition in ConditionalAttribute of attribute class.
4102 2005-03-30 Raja R Harinath <rharinath@novell.com>
4104 * ecore.cs (PropertyExpr): Derive from Expression, not
4105 ExpressionStatement.
4106 (PropertyExpr.EmitStatement): Remove.
4108 2005-03-29 Raja R Harinath <rharinath@novell.com>
4111 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4112 internal field "value__" of an enum be private. The examples for
4113 "value__" that I found on MSDN all used FieldAttributes.Private.
4115 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4116 Don't mention IL method attribute names.
4118 Fix #47991. Remove a TODO.
4119 * statement.cs (Block.Toplevel): Make into a field.
4120 (Block.Parameters): Move into ToplevelBlock.
4121 (Block.known_variables): Rename from child_variable_names.
4122 (Block.Block): Remove variants that take Parameters. Initialize
4123 'Toplevel' with the immediately surrounding toplevel block.
4124 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4125 LocalInfo parameter.
4126 (Block.GetKnownVariableInfo): New.
4127 (Block.IsVariableNameUsedInChildBlock): Update.
4128 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4129 the block, even though it may not be in scope.
4130 (Block.AddVariable): Remove Parameters parameter. Use
4131 Toplevel.Parameters instead.
4132 (Block.AddConstant): Remove Parameters parameter.
4133 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4134 (Block.IsParamaterReference): Likewise.
4135 (Block.IsLocalParameter): Likewise. Simplify a lot.
4136 (ToplevelBlock.Parameters): New. Moved from Block.
4137 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4138 initialize Parameters to a non-null value.
4139 * cs-parser.jay: Update to changes.
4140 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4141 simple names that mean different things in the same block. Use
4142 Block.IsVariableNameUsedInBlock.
4144 2005-03-28 Raja R Harinath <rharinath@novell.com>
4146 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4148 2005-03-26 Raja R Harinath <harinath@acm.org>
4151 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4152 fails to resolve, ensure that the LHS is still resolved as an
4155 2005-03-25 Raja R Harinath <harinath@acm.org>
4157 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4159 (Enum.current_ec): Remove.
4160 (Enum.LookupEnumValue): Remove EmitContext argument.
4161 Just uses the one created during DefineType.
4162 (Enum.FindMembers): Update.
4163 * expression.cs (MemberAccess.DoResolve): Update.
4165 2005-03-22 Marek Safar <marek.safar@seznam.cz>
4167 * assign.cs (Assign.DoResolve): Check for CS1717 when
4168 source and target are same (uses Equals).
4170 * expression.cs (LocalVariableReference, ParameterReference,
4171 This): Implemented Equals, GetHashCode.
4173 * statement.cs (Block.GetParameterReference): Removed useless
4176 2005-03-22 Raja R Harinath <rharinath@novell.com>
4179 * statement.cs (Block.AddVariable): Ensure that we skip implicit
4180 blocks before deciding whether the error is cs0136 or cs0128.
4182 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4183 (using_alias_directive, using_namespace_directive): Pass
4184 MemberName, not an expression to Namespace.UsingAlias and
4186 (MakeName): Use the MemberName of the namespace.
4187 * namespace.cs (Namespace.MemberName): New.
4188 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4189 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4191 * decl.cs (MemberName.Name): Make readonly.
4192 (MemberName.FromDotted): New "constructor".
4193 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4194 (MemberCore.Name): Compute from MemberName on demand.
4195 (MemberCore.SetMemberName): Provide a way to change the
4197 (MemberCore.AddToContainer): Don't take a fullname parameter.
4198 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4199 fully qualified name of the container to the member name.
4200 (TypeContainer.AddToTypeContainer): Use a fully qualified name
4201 only if the type is a member of the root container.
4202 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4203 MemberName.Left rather than searching for an embedded ".".
4204 (PartialContainer.CreatePart): Update to changes in RootContext.
4205 (MemberBase.ShortName): Turn into a property. Use
4206 MemberCore.SetMemberName.
4207 (MemberBase.ExplicitInterfaceName): Remove.
4208 (MemberBase.UpdateMemberName): Remove.
4209 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4210 (PropertyBase.SetMemberName): New override.
4211 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4212 (Tree.GetDecl): New.
4213 (Tree.AllDecls): Rename from Decls.
4214 * attribute.cs, enum.cs, report.cs: Update to changes.
4215 * driver.cs (MainDriver): Use MemberName.FromDotted on
4216 RootContext.MainClass.
4218 2005-03-21 Marek Safar <marek.safar@seznam.cz>
4220 * class.cs (FixedField.Define): Check for CS1664 and more sanity
4223 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4225 2005-03-18 Marek Safar <marek.safar@seznam.cz>
4227 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4228 property accessor modifiers.
4230 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4231 fixed buffer attribute (CS1716).
4232 (PropertyMethod.HasCustomAccessModifier): When property accessor
4233 has custom modifier.
4235 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4237 (PropertyExpr.DoResolveLValue): Add CS0272.
4239 2005-03-17 Miguel de Icaza <miguel@novell.com>
4241 * convert.cs: When converting to a pointer, use the proper Conv.U
4242 or Conv.I depending on the source data type.
4244 * cs-tokenizer.cs: Make the size for large decimal constants,
4247 2005-03-17 Martin Baulig <martin@ximian.com>
4249 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4250 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4252 2005-03-17 Martin Baulig <martin@ximian.com>
4254 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4255 to bool so we can return an error condition.
4256 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4259 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
4261 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4264 2005-03-16 Raja R Harinath <rharinath@novell.com>
4266 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4267 Refactor to avoid traversing the list of assemblies, and to avoid
4268 string concatenation.
4269 * typemanager.cs (guid_attr_type): Remove.
4270 (negative_hits, pointers, references): Remove hashes.
4272 (GetConstructedType): New. Uses type_hash to handle constructed
4273 types (arrays, references, pointers).
4274 (GetReferenceType, GetPointerType): Use it.
4275 (GetNestedType): New. Uses type_hash to handle nested types of
4277 (LookupType, LookupTypeDirect): Remove.
4278 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4279 'types' hash and LookupTypeReflection directly.
4280 (params_string, params_object): Use GetConstructedType.
4281 * namespace.cs (Namespace.cached_types): New. Cache of reflected
4283 (Namespace.Lookup): Use cached_types.
4284 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4285 provided by old TypeManager.LookupType.
4286 * rootcontext.cs (MakeFQN): Remove.
4287 * decl.cs (DeclSpace.MakeFQN): Likewise.
4288 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4289 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4290 TypeManager.GetConstructedType.
4291 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4293 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
4295 * cs-parser.jay: Fix build.
4297 2005-03-15 Marek Safar <marek.safar@seznam.cz>
4299 * class.cs (TypeContainer.CircularDepException) New nested
4300 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4302 * cs-parser.jay: Reports CS1527 for any namespace element.
4304 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4307 * expression.cs (ParameterReference.IsAssigned): Changed error to
4309 (Error_WrongNumArguments): Moved CS0245 detection here.
4311 * statement.cs (Return.Resolve): Add CS1622 report.
4313 2005-03-11 Marek Safar <marek.safar@seznam.cz>
4315 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4317 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
4319 * attribute.cs expression.cs: Get rid of some allocations.
4321 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
4323 * doc.cs : just eliminate the latest change.
4325 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4327 * doc.cs : commented out the latest change. It breaks xml-030.cs
4329 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4331 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4332 fail. So invoke CreateType() in FindDocumentedType().
4334 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4336 * cs-tokenizer.cs : added IsKeyword().
4337 * doc.cs : Detect keyword incorrectly used as identifier.
4338 Allow identifiers prefixed by @.
4340 2005-03-10 Marek Safar <marek.safar@seznam.cz>
4342 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4343 It caused exception in namespace resolving (again!).
4345 * class.cs (Class.ctor): Removed exit.
4346 (PropertyMethod.ctor): ditto.
4348 * codegen.cs (Codegen.Reset): Reset static data.
4349 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4351 * cs-tokenizer.cs (Cleanup): Removed.
4353 * driver.cs (GetSystemDir): Rewrote to one line command.
4354 It caused problem with unloaded dynamic modules.
4355 (UnixParseOption): Removed Exit.
4356 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4357 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4358 Now can be mcs used as library.
4360 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4363 * location.cs (Reset): Reset static data.
4365 * namespace.cs (Reset): Reset static data.
4367 * report.cs (Report.Reset): Reset static data.
4369 * rootcontext.cs (RootContext.Reset): Reset static data.
4371 * tree.cs (RootTypes.ctor): Use Location.Null
4373 * typemanager.cs (TypeManager.Reset): Reset static data.
4374 (CoreLookupType): Removed Exit.
4375 (TypeHandle.Reset): Reset static data.
4377 2005-03-10 Raja R Harinath <rharinath@novell.com>
4380 * typemanager.cs (ComputeNamespaces): Import namespaces from
4381 referenced modules too.
4383 2005-03-09 Raja R Harinath <rharinath@novell.com>
4385 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4388 2005-03-09 Raja R Harinath <rharinath@novell.com>
4390 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4391 enclosing DeclSpace. This ensures that a name-lookup populates
4392 more caches and there are fewer 'TypeExpression's. Carve out
4393 nested type lookup into ...
4394 (LookupNestedTypeInHierarchy): ... this.
4396 2005-04-15 Martin Baulig <martin@ximian.com>
4398 Merged r41590 from MCS and make it work in the generics land.
4400 * generic.cs (TypeParameter.UpdateConstraints): Removed the
4403 * class.cs (PartialContainer.UpdateConstraints): Removed.
4404 (PartialContainer.CheckConstraints): Removed.
4405 (PartialContainer.SetParameterInfo): Store the constraints here.
4406 (PartialContainer.DefineTypeParameters): New public method;
4407 resolve the type parameter's constraints here. Note that the
4408 PartialContainer doesn't have an EmitContext anymore, so we must
4409 do this in the ClassPart.
4411 2005-03-09 Raja R Harinath <rharinath@novell.com>
4413 Clean up a few partial-class semantics.
4414 Fixes test-357.cs and cs1618-2.cs.
4415 * cs-parser.jay (struct_declaration): Use 'current_class' as
4416 parent of newly-created struct. Remove call to Register ().
4417 Use 'pop_current_class' to complete handing the current struct.
4418 (interface_declaration): Likewise.
4419 (class_declaration): Likewise.
4420 (enum_declaration): Use 'current_class' as parent of newly created
4422 (delegate_declaration): Likewise.
4423 (pop_current_class): New function. This is used to handle closing
4424 up the 'current_class' and 'current_container', and pointing them
4425 to the enclosing class/container.
4426 (CSharpParser): Initialize 'current_class' too.
4427 * decl.cs (MemberCore): Add check for invariant: a partial
4428 container is not a parsed entity, and thus does not enclose any
4430 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4431 (DeclSpace.BaseTypeExpr): Use it.
4432 (DeclSpace.LookupType): Add check for invariant.
4433 * class.cs (TypeContainer): Add check for invariant: a nested
4434 class should have the same NamespaceEntry as its enclosing class.
4435 (TypeContainer.EmitFieldInitializers): Make virtual.
4436 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4438 (TypeContainer.Register): Remove.
4439 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4440 null. Use TypeResolveEmitContext for resolving base types and
4441 interfaces. Move initialization of Parts.TypeBuilder here from
4443 (TypeContainer.DefineNestedTypes): ... here.
4444 (PartialContainer): Take a Namespace not a NamespaceEntry.
4445 (PartialContainer.Create): Don't use Register. Call the
4446 appropriate Add... function directly.
4447 (ClassPart): Take both the PartialContainer and the enclosing
4448 class as constructor arguments.
4449 (ClassPart.EmitFieldInitializers): Override.
4450 (ClassPart.PartFindNestedTypes): Remove.
4451 (FieldBase.GetInitializerExpression): Resolve the initializer
4452 expression in the emit context of the enclosing class.
4453 * tree.cs (RootTypes): Remove Register ().
4455 2005-03-08 Marek Safar <marek.safar@seznam.cz>
4457 * cs-parser.jay: Removed CS0134.
4459 * driver.cs: Removed CS1901.
4461 * expression.cs (SizeOf.DoResolve): Don't report CS0233
4462 for predefined types.
4464 2005-03-07 Duncan Mak <duncan@novell.com>
4466 * codegen.cs (Save): Catch UnauthorizedAccessException as
4467 well. Fixes bug #73454.
4469 2005-03-07 Marek Safar <marek.safar@seznam.cz>
4471 * cs-tokenizer.cs (xtoken): Add CS1035.
4473 * class.cs (MethodData.Define): Add CS0683.
4474 (FieldMember.ctor): Add CS0681.
4476 2005-03-07 Raja R Harinath <rharinath@novell.com>
4478 * ecore.cs (SimpleName.DoResolve): Rename from
4479 SimpleName.DoResolveAllowStatic.
4480 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4481 Pass 'intermediate' flag to MemberStaticCheck.
4482 (SimpleName.MemberStaticCheck): Skip "static check" only in case
4483 of "intermediate" lookups via MemberAccess.
4484 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
4485 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4487 2005-03-07 Raja R Harinath <rharinath@novell.com>
4490 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4491 slipped in because of variable names that are identical to a
4492 builtin type's BCL equivalent ('string String;', 'int Int32;').
4493 (PropertyExpr.EmitInstance): Likewise.
4495 2005-03-04 Marek Safar <marek.safar@seznam.cz>
4497 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4499 * report.cs (warning_ignore_table): Made public.
4501 2005-03-04 Raja R Harinath <rharinath@novell.com>
4504 * class.cs (MethodData.Emit): Pass 'container' to
4505 container.GetObsoleteAttribute instead of 'container.Parent'.
4507 2005-03-03 Marek Safar <marek.safar@seznam.cz>
4509 * cs-parser.jay: Add 1534 error test.
4511 * iterators.cs (Yield.CheckContext): Add error 1629.
4512 (Iterator.ctor): Save unsafe modifier.
4513 (MoveNextMethod.DoEmit): Restore unsafe context.
4515 * namespace.cs (UsingAlias): Better error message.
4517 2005-03-03 Dan Winship <danw@novell.com>
4519 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4520 the warning message [#73219]
4522 2005-03-03 Raja R Harinath <rharinath@novell.com>
4524 Fix compile with MCS 1.0.0.0.
4525 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4526 w_restore to not depend on string constant folding.
4528 2005-03-03 Raja R Harinath <rharinath@novell.com>
4530 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
4531 CS0246 check to users who passed 'silent = false'.
4532 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4534 (SimpleName.SimpleNameResolve): Update.
4535 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4536 (MemberAccess.IdenticalNameAndTypeName): Update.
4537 * doc.cs (FindDocumentedTypeNonArray): Update.
4539 2005-03-03 Raja R Harinath <rharinath@novell.com>
4541 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4542 * parameters.cs (ComputeAndDefineParameters): Remove.
4543 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4544 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4545 Use GetParameterInfo.
4547 2005-03-02 Marek Safar <marek.safar@seznam.cz>
4549 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4551 2005-03-02 Raja R Harinath <rharinath@novell.com>
4553 Unify DeclSpace.LookupType and DeclSpace.FindType.
4554 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
4555 is in charge of defining nested types on demand.
4556 (DeclSpace.LookupType): Use it when the current_type is a
4557 TypeBuilder. Use LookupTypeDirect for reflected types.
4558 (DeclSpace.FindType): Remove.
4559 (DeclSpace.LookupInterfaceOrClass): Likewise.
4560 (DeclSpace.DefineTypeAndParents): Likewise.
4561 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4562 DeclSpace.LookupType.
4563 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4564 * typemanager.cs (LookupType): Simplify.
4565 (AddUserType): Remove type from negative_hits.
4566 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4567 * class.cs (TypeContainer.FindMembers): Move handling of nested
4569 (TypeContainer.FindMembers_NestedTypes): ... here.
4570 (TypeContainer.FindNestedType): Implement override.
4571 (ClassPart.FindNestedType): Delegate to PartialContainer.
4572 (ClassPart.PartFindNestedType): Looks up the nested types of the
4575 2005-04-14 Martin Baulig <martin@ximian.com>
4577 * generic.cs (ConstructedType): Moved all the type lookup and
4578 nested class logic into SimpleName.
4579 (ConstructedType.ResolveConstructedType): Our underlying type is
4580 already fully resolved; all the type lookup stuff is in
4583 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4584 constructed types here instead of in ConstructedType.
4586 * decl.cs (MemberName.GetTypeExpression): Always create a
4587 SimpleName, not a ConstructedType.
4588 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4590 2005-03-02 Martin Baulig <martin@ximian.com>
4592 * class.cs (TypeContainer.DoDefineMembers): We also need a default
4593 static constructor in static classes.
4595 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
4597 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4598 sizeParamIndex is not specified.
4600 2005-03-01 Marek Safar <marek.safar@seznam.cz>
4603 * report.cs (WarningMessage.IsEnabled): Missing null check.
4605 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4607 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4608 in the fields and not in the properties.
4610 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
4612 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
4615 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4617 * attribute.cs: Small refactoring (improved robustness).
4618 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4619 (ValidateGuid): Removed.
4620 (Resolve): Removed referenced to above mentioned.
4621 (GetAttributeUsage): Made private and changed to work without
4623 (GetIndexerAttributeValue): Don't crash.
4624 (GetConditionalAttributeValue): Ditto.
4625 (GetClsCompliantAttributeValue): Ditto.
4626 (ExtractSecurityPermissionSet): All attributes exceptions are
4628 (GetPropertyValue): New helper.
4629 (GetMethodImplOptions): New method.
4630 (DefinePInvokeMethod): Reuse common code. Implemented handling of
4631 some missing properties.
4633 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4634 (Method.ApplyAttributeBuilder): Updated.
4636 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4639 2005-02-28 Raja R Harinath <rharinath@novell.com>
4642 * report.cs (Report.SymbolRelatedToPreviousError): Handle
4643 non-simple types (array, pointer, reference).
4645 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4647 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4649 * class.cs (MethodCore.IsDuplicateImplementation): Special error
4651 (Method.CheckBase): Catch wrong destructor here.
4652 (MethodData.Define): Add errors 550, 668.
4654 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4656 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4658 * pending.cs (VerifyPendingMethods): Add error 551.
4660 * typemanager.cs (CSharpName): Next error report helper.
4662 2005-02-25 Marek Safar <marek.safar@seznam.cz>
4664 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4665 attributes. Removed useless attribute double check.
4666 It saves almost 2MBs for corlib.
4668 2005-02-25 Raja R Harinath <rharinath@novell.com>
4671 * statement.cs (ExpressionStatement.Resolve): Make robust to being
4672 called twice in case of error.
4674 2005-02-23 Chris Toshok <toshok@ximian.com>
4676 Fix compiler portions of #72827.
4677 * statement.cs (Block.Emit): call Begin/EndScope on the
4678 EmitContext instead of the ILGenerator.
4680 * codegen.cs (EmitContext.BeginScope): new method, call
4681 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4683 (EmitContext.BeginScope): same, but EndScope and CloseScope
4685 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4686 offset and call the superclass's OpenScope(int) with it.
4687 (SymbolWriter.CloseScope): get the current il
4688 offset and call superclass's CloseScope(int) with it.
4690 2005-02-23 Marek Safar <marek.safar@seznam.cz>
4692 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4693 CS1677 for out and ref as well.
4695 * class.cs (Method.Define): Add error CS1599 detection.
4697 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4699 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4701 * delegate.cs (Delegate.Define): Add error CS1599 detection.
4703 * support.cs.cs (ModifierDesc): New helper method.
4705 2005-02-23 Raja R Harinath <rharinath@novell.com>
4706 Abin Thomas <projectmonokochi@rediffmail.com>
4707 Anoob V E <projectmonokochi@rediffmail.com>
4708 Harilal P R <projectmonokochi@rediffmail.com>
4711 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4712 MemberLookup (used for error reporting) actually returns a result.
4713 Fix error report number (122, not 112).
4715 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
4716 Anoob V E <projectmonokochi@rediffmail.com>
4717 Harilal P R <projectmonokochi@rediffmail.com>
4720 * pending.cs (PendingImplementation.GetAbstractMethods):
4721 Find NonPublic members too.
4723 2005-02-22 Marek Safar <marek.safar@seznam.cz>
4725 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4728 * class.cs (MethodCore.CheckMethodAgainstBase):
4729 Add error 239 report.
4731 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4733 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4735 * class.cs (Operator.Define): Add error 217 report.
4737 2005-02-21 Raja R Harinath <rharinath@novell.com>
4740 * expression.cs (Invocation.IsApplicable): Make public.
4741 (Invocation.IsParamsMethodApplicable): Likewise.
4742 * delegate.cs (Delegate.VerifyApplicability): Don't use
4743 Invocation.VerifyArgumentCompat for parameter applicability
4744 testing. Use Invocation.IsApplicable and
4745 Invocation.IsParamsMethodApplicable.
4747 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4749 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4751 * class.cs (Operator.Define): Add error 217 report.
4753 2005-02-21 Raja R Harinath <rharinath@novell.com>
4755 * namespace.cs (UsingEntry.Resolve): Undo change below.
4757 2005-02-21 Raja R Harinath <rharinath@novell.com>
4760 * ecore.cs (Expression.MemberLookupFailed): Add argument to
4761 disable the error message when the extended MemberLookup also
4763 (Expression.MemberLookupFinal): Update.
4764 (SimpleName.DoSimpleNameResolve): Update.
4765 * expression.cs (MemberAccess.ResolveNamespaceOrType):
4766 Don't use MemberLookupFinal.
4767 (New.DoResolve): Update.
4768 (BaseAccess.CommonResolve): Update.
4770 2005-02-21 Raja R Harinath <rharinath@novell.com>
4773 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4774 occured previously, don't resolve again.
4776 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4779 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4780 argument. Call ResolveAttributeUsage for unresolved.
4781 when types doesn't match ctor arguments.
4783 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4784 for nested attribute classes.
4785 (Class.attribute_usage): Removed.
4786 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4787 for attribute class.
4789 * ecore.cs (IsAttribute): Removed.
4791 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4793 * rootcontext.cs (RegisterAttribute): Removed, attributes are
4795 (attribute_types): Removed.
4796 (EmitCode): Global attributes are emited as the latest.
4798 2005-02-18 Marek Safar <marek.safar@seznam.cz>
4800 * class.cs (EmitFieldInitializers): Don't emit field initializer
4801 for default values when optimilization is on.
4803 * constant.cs (Constant.IsDefaultValue): New property.
4805 * driver.cs: Add /optimize handling.
4809 * literal.cs: Implement new IsDefaultValue property.
4811 * rootcontext.cs (Optimize): New field, holds /optimize option.
4813 2005-02-18 Raja R Harinath <rharinath@novell.com>
4815 Fix crasher in re-opened #72347.
4816 * namespace.cs (Namespace.Lookup): Return null if
4817 DeclSpace.DefineType returns null.
4820 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4822 2005-02-18 Raja R Harinath <rharinath@novell.com>
4824 Fix remainder of #63202. Change semantics of DoResolveLValue: it
4825 now returns null if it cannot resolve to an lvalue.
4826 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4827 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4828 returned null. Remove check for SimpleName.
4829 (EventExpr.DoResolveLValue): New.
4830 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4831 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
4833 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
4835 (Unary.ResolveOperator): Move CS0211 check ...
4836 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
4838 (Unary.DoResolveLValue): Simplify.
4839 (AddressOf.DoResolveLValue): New.
4840 (ArrayAccess.DoResolveLValue): New.
4842 2005-02-16 Marek Safar <marek.safar@seznam.cz>
4844 * attribute.cs (Attribute.Resolve): Add arguments casting for
4845 when types doesn't match ctor arguments.
4847 2005-02-16 Raja R Harinath <rharinath@novell.com>
4849 Fix parts of #63202.
4850 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4851 lookup of operator in base type. Ensure that all checks happen
4852 when the operator resolves to an "op_..." method.
4854 2005-02-15 Raja R Harinath <rharinath@novell.com>
4857 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4858 'ignore_cs0104' parameter. Pass it to ...
4859 (NamespaceEntry.Lookup): ... this.
4860 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4861 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4862 (TypeLookupExpression.DoResolveAsTypeStep): Update.
4863 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4864 Update. Request that cs0104 errors be ignored.
4865 (ComposedCast.ResolveAsTypeStep): Update.
4867 2005-02-14 Raja R Harinath <rharinath@novell.com>
4870 * expression.cs (Invocation.BetterFunction): Remove support for
4871 comparing virtual functions and their overrides.
4872 (Invocation.IsOverride): New.
4873 (Invocation.OverloadResolve): Don't consider 'override' functions
4874 during candidate selection. Store them in a lookaside list.
4875 If the selected method is a 'virtual' function, use the list to
4876 find any overrides that are closer to the LHS type.
4878 2005-02-14 Marek Safar <marek.safar@seznam.cz>
4880 * expression.cs (New.DoResolve): Add complex core type reduction.
4881 (New.Constantify): Converts complex core type syntax like 'new int ()'
4884 2005-02-14 Raja R Harinath <rharinath@novell.com>
4886 * decl.cs (EntryType.EntryType): New constructor to create an
4887 updated copy of a cache entry.
4888 (MemberCache.AddMethods): Use it.
4889 (MemberCache.ClearDeclaredOnly): Remove.
4890 (MemberCache.MemberCache): Update.
4892 2005-02-11 Miguel de Icaza <miguel@novell.com>
4894 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4895 variable. This one is represents the actual low-level declaration
4896 of the method, as opposed to the semantic level `IsStatic'.
4898 An anonymous method which is hosted into a static method might be
4899 actually an instance method. IsStatic would reflect the
4900 container, while MethodIsStatic represents the actual code
4903 * expression.cs (ParameterReference): Use the new MethodIsStatic
4904 instead of IsStatic.
4906 * anonymous.cs (AnonymousMethod.Compatible): Pass the
4907 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4908 set on the current EmitContext.
4910 * expression.cs (Cast): Overload DoResolveLValue so we can pass
4911 resolve our casted expression as an LValue. This triggers the
4912 proper LValue processing that is later required by Assign.
4916 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4918 2005-02-11 Marek Safar <marek.safar@seznam.cz>
4920 C# 2.0 Fixed buffer implementation
4922 * anonymous.cs: Update after RegisterHelperClass renaming.
4924 * attribute.cs (AttributeTester.fixed_buffer_cache):
4925 Cache of external fixed buffers.
4926 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4927 implementation if field is fixed buffer else null.
4930 (TypeContainer.AddField): Accept FieldMember instead of Field.
4931 (FieldBase.IsFieldClsCompliant): Extracted code from
4932 VerifyClsCompliance descendant customization.
4933 (FixedField): New class handles fixed buffer fields.
4934 (FixedFieldExternal): Keeps information about imported fixed
4936 (IFixedField): Make access to internal or external fixed buffer
4939 * cs-parser.jay: Add fixed buffer parsing.
4941 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4944 * expression.cs (Indirection): Extended implementation to accept
4946 (PointerArithmetic.Emit): Get element from fixed buffer as well.
4947 (ElementAccess.MakePointerAccess): Get type as parameter.
4948 (DoResolve): Add fixed buffer field expression conversion.
4949 (DoResolveLValue): Ditto.
4950 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4951 (ArrayPtr): Derives from FixedBufferPtr.
4952 (ArrayPtr.Emit): Add extra emit for array elements.
4954 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4956 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4957 for compiler generated types.
4958 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4960 * statement.cs (Fixed): Refactored to be easier add fixed buffer
4961 and consume less memory.
4962 (Fixed.Resolve): Add fixed buffer case.
4964 * typemanager.cs (compiler_generated_attr_ctor,
4965 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
4966 (HasElementType): Add our own implementation to work on every
4969 2005-02-11 Miguel de Icaza <miguel@novell.com>
4971 * anonymous.cs (CaptureContext): Track whether `this' has been
4974 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
4975 only captured `this' if it was implicitly done (instance
4976 methods/variables were used).
4978 * codegen.cs (EmitContext.CaptureThis): New method to flag that
4979 `this' must be captured.
4981 2005-01-30 Miguel de Icaza <miguel@novell.com>
4983 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
4984 is null it means that there has been no need to capture anything,
4985 so we just create a sibling.
4987 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
4989 Just a partial fix. The other half is fairly elusive.
4991 2005-02-10 Raja R Harinath <rharinath@novell.com>
4993 Fix #52586, cs0121-4.cs.
4994 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
4995 and return a hashtable.
4996 (MemberCache.ClearDeclaredOnly): New.
4997 (MemberCache.MemberCache): Update to change. Make a deep copy of
4998 the method_hash of a base type too.
4999 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5000 type methods. Overwrite entries with the same MethodHandle so
5001 that the ReflectedType is correct. The process leaves in base
5002 virtual functions and their overrides as distinct entries.
5003 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5004 matters since it was boxed in a ArrayList before.
5005 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5007 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5008 case of a virtual function and its override (choose the overload
5010 (Invocation.OverloadResolve): Avoid 'override' members during
5011 'applicable_type' calculation.
5013 2005-03-28 Raja R Harinath <rharinath@novell.com>
5015 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5016 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5017 GetTypeHandle. It is possible for a reflected type to derive from
5018 a TypeBuilder (e.g., int[] derives from the TypeBuilder
5019 System.Array during mscorlib compilation).
5020 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5021 contain a method_hash, don't create one either. Don't create a
5022 deep copy of the base cache's method_hash.
5023 (MemberCache.SetupCache): Rename back from DeepCopy.
5024 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5025 already initialized. If we see an override function, add its
5026 underlying base virtual function to the member_hash too.
5028 2005-02-09 Raja R Harinath <rharinath@novell.com>
5030 Combine two near-redundant caches.
5031 * typemanager.cs (method_params): Rename from method_internal_params.
5032 (TypeManager.GetParameterData): New. Replace
5033 Invocation.GetParameterData.
5034 (TypeManager.LookupParametersByBuilder): Remove.
5035 * expression.cs (Invocation.method_parameter_cache): Remove.
5036 (Invocation.GetParameterData): Remove.
5038 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5041 2005-02-08 Raja R Harinath <rharinath@novell.com>
5044 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5045 TypeManager.multicast_delegate_type is null, resolve it by looking
5046 up "System.MulticastDelegate".
5047 * rootcontext.cs (RootContext.ResolveCore): Simplify.
5049 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
5050 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
5051 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
5054 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5055 (LabeledStatement.AddReference): New. Set 'referenced'.
5056 (Goto.Resolve): Use it.
5058 2005-02-05 John Luke <john.luke@gmail.com>
5060 * driver.cs: remove duplicate -doc line in Usage ()
5062 2005-02-04 Raja R Harinath <rharinath@novell.com>
5064 * location.cs (Location.AddFile): Fix CS2002 error report.
5066 2005-02-02 Martin Baulig <martin@ximian.com>
5068 * delegate.cs (Delegate.DefineType): Report an internal error if
5069 TypeManager.multicast_delegate_type is null. See bug #72015 for
5072 2005-02-02 Raja R Harinath <rharinath@novell.com>
5074 Fix a crasher in a variant of #31984.
5075 * const.cs (Constant.CheckBase): New override that defers the
5076 new-or-override check in case the base type hasn't been populated
5078 (Constant.Define): Ensure the new-or-override check is performed.
5080 2005-02-01 Duncan Mak <duncan@ximian.com>
5082 * const.cs (LookupConstantValue): Check that `ce' is not null
5083 before calling GetValue ().
5085 2005-02-01 Raja R Harinath <rharinath@novell.com>
5087 Fix test-334.cs (#69519).
5088 * cs-parser.jay (using_alias_directive): Pass in an expression to
5089 NamespaceEntry.UsingAlias.
5090 (using_namespace_directive): Pass in an expression to
5091 NamespaceEntry.Using.
5092 (namespace_name): Don't flatten to a string.
5093 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5094 (NamespaceEntry.AliasEntry.Resolve): Lookup using
5096 (NamespaceEntry.UsingEntry): Likewise.
5097 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5099 (NamespaceEntry.LookupForUsing): Remove.
5100 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5102 (NamespaceEntry.Lookup): Remove support for dotted names.
5104 2005-02-01 Raja R Harinath <rharinath@novell.com>
5106 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5108 (NamespaceEntry.ImplicitParent): Compute on demand.
5109 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5110 parallels the current.
5111 (NamespaceEntry.LookupForUsing): Use it.
5112 (NamespaceEntry.Lookup): If the current namespace-entry is
5113 implicit, don't search aliases and using tables.
5115 2005-02-01 Raja R Harinath <rharinath@novell.com>
5118 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5120 (TypeContainer.BaseCache): Compute on demand.
5121 (TypeContainer.FindMembers): Define constants and types if they're
5122 not already created.
5123 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5125 * const.cs (Constant.Define): Make idempotent.
5127 2005-01-29 Miguel de Icaza <miguel@novell.com>
5129 * pending.cs: Produce better code (no nops produced by using Ldarg
5132 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5133 i - 1' it should be arg + 1.
5137 2005-01-28 Raja R Harinath <rharinath@novell.com>
5139 * attribute.cs (Attribute.CheckAttributeType): Make private
5141 (Attribute.ResolveType): Make virtual.
5142 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5143 handling of RootContext.Tree.Types.
5145 2005-01-27 Raja R Harinath <rharinath@novell.com>
5147 Update attribute-handling to use the SimpleName/MemberAccess
5149 * cs-parser.jay (attribute): Pass in an expression to the
5150 constructors of Attribute and GlobalAttribute.
5151 * attribute.cs (Attribute): Take an expression for the name.
5152 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5153 passed in attribute name expression.
5154 (Attribute.CheckAttributeType): Use it.
5155 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5156 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5157 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
5158 argument to prevent error messages if the lookup fails.
5160 2005-01-27 Marek Safar <marek.safar@seznam.cz>
5162 * expression.cs (Indirection): Implemented IVariable interface
5163 to support indirection in AddressOf operator.
5164 (PointerArithmetic.Emit): Add optimalization for case where
5165 result can be precomputed.
5167 2005-01-26 Martin Baulig <martin@ximian.com>
5169 * class.cs (TypeContainer.AttributeTargets): Return the correct
5170 AttributeTargets depending on our `Kind' instead of throwing an
5171 exception; fixes #71632.
5173 2005-01-26 Marek Safar <marek.safar@seznam.cz>
5176 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5179 2005-03-17 Martin Baulig <martin@ximian.com>
5181 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5182 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5184 2005-03-17 Martin Baulig <martin@ximian.com>
5186 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5187 to bool so we can return an error condition.
5188 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5191 2005-03-17 Martin Baulig <martin@ximian.com>
5193 * generic.cs (TypeMananager.IsIEnumerable): New public method.
5195 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5196 converting from an array-type of T to `IEnumerable<T>'.
5198 2005-03-16 Martin Baulig <martin@ximian.com>
5200 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5201 (Nullable.LiftedUnaryMutator): New public class.
5203 * expression.cs (UnaryMutator.DoResolve): Added support for
5206 2005-03-14 Martin Baulig <martin@ximian.com>
5208 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5210 2005-03-14 Martin Baulig <martin@ximian.com>
5212 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5213 the comparision operators `<', `>', `<=' and `>='.
5215 2005-03-13 Martin Baulig <martin@ximian.com>
5218 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5219 avoid confusion with the `NullLiteral'.
5220 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5222 2005-03-13 Martin Baulig <martin@ximian.com>
5224 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5225 comparing arbitrary types with the null literal.
5227 2005-03-13 Martin Baulig <martin@ximian.com>
5229 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5230 boolean operators '&&', '||', '&' and '|'.
5231 (Nullable.OperatorTrueOrFalse): New public class.
5233 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5234 instead of a `StaticCallExpr'; added support for nullables.
5236 2005-03-10 Martin Baulig <martin@ximian.com>
5239 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5240 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
5242 2005-03-07 Martin Baulig <martin@ximian.com>
5244 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5245 it work if `expr' is not an IMemoryLocation.
5246 (Nullable.Lifted): Implement IMemoryLocation.
5247 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5250 2005-03-05 Martin Baulig <martin@ximian.com>
5252 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5253 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5254 (Nullable): Added support for lifted unary and binary operators.
5256 * expression.cs (Unary.DoResolve): Added support for nullable types.
5257 (Binary.DoResolve): Likewise.
5258 (Conditional.DoResolve): Likewise.
5260 2005-03-02 Martin Baulig <martin@ximian.com>
5262 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5264 * class.cs (ClassPart.SetParameterInfo): Override this.
5265 (PartialContainer.SetParameterInfo): Override this.
5266 (TypeContainer.CheckConstraints): New protected method.
5267 (PartialContainer.CheckConstraints): Override this and check
5268 whether the same contraints were specified in all parts of a
5269 partial generic type definition.
5270 (PartialContainer.UpdateConstraints): New public method.
5272 * generic.cs (TypeParameter.UpdateConstraints): New public method.
5274 2005-03-02 Martin Baulig <martin@ximian.com>
5276 Committing a patch from Carlos Alberto Cortez to fix #72887.
5278 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5279 casts from `T []' to `int []'.
5281 2005-03-02 Martin Baulig <martin@ximian.com>
5283 * generic.cs (TypeManager.IsEqual): Make this symmetric.
5285 * expression.cs (Binary.ResolveOperator): When resolving a
5286 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5287 `=='. Fixes #71866. See gen-127.cs.
5289 2005-03-02 Martin Baulig <martin@ximian.com>
5291 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5292 static constructor in static classes.
5294 2005-03-02 Martin Baulig <martin@ximian.com>
5297 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5298 (Nullable.LiftedConversion): Added support for user-defined
5301 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5303 * cs-parser.jay: Use ComposedCast everywhere instead of
5304 NullableType, so we don't need to check for NullableType
5306 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5307 case where we'll be resolved into a `parenthesized_expression_0'
5311 (Convert.UserDefinedConversion): Added nullable conversions.
5313 2005-02-28 Martin Baulig <martin@ximian.com>
5315 * generic.cs (TypeManager.IsNullableType): New static method.
5316 (Nullable): New abstract class.
5317 (Nullable.NullLiteral): New public class.
5318 (Nullable.LiftedConversion): New public class.
5320 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5321 `builtin_types opt_nullable'.
5324 (Convert.ImplicitConversionStandard): Added nullable conversions.
5325 (Convert.ExplicitConversionStandard): Likewise.
5326 (Convert.ExplicitConversion): Likewise.
5328 2005-02-26 Martin Baulig <martin@ximian.com>
5330 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5331 begin with a "?", for instance "?[]". Don't do a type lookup if
5334 2005-02-25 Martin Baulig <martin@ximian.com>
5336 The first part of Nullable Types :-)
5338 * generic.cs (NullableType): New public class.
5339 (NullCoalescingOperator): New public class.
5340 (TypeArguments.Resolve): Add a CS0306 check.
5342 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5343 (opt_nullable): New rule.
5344 (type): Added `opt_nullable' to `namespace_or_type_name',
5345 `builtin_types' and `pointer_type'.
5346 (array_type): Added `opt_nullable'.
5347 (opt_rank_specifier_or_nullable): New rule; this is the
5348 combination of `opt_rank_specifier' and `opt_nullable'.
5349 (opt_error): New rule; catch errors here.
5350 (nullable_type_or_conditional): New rule; we use this to check for
5351 nullable and still detect the conditional operator.
5352 (local_variable_type): Use `opt_rank_specifier_or_nullable'
5353 instead `opt_rank_specifier'.
5355 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5358 2005-02-24 Martin Baulig <martin@ximian.com>
5360 * README, README.Changes: Removed; they're old and obsolete.
5362 2005-02-22 Martin Baulig <martin@ximian.com>
5364 * generic.cs (TypeParameter.Resolve): If resolving the constraints
5365 returned an error, set `constraints' to null to avoid a crash
5367 (TypeParameter.ResolveType): Likewise.
5369 2005-02-22 Martin Baulig <martin@ximian.com>
5372 (Constraints.ResolveTypes): Protect against being called twice.
5373 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5374 (TypeParameter.ResolveType): New public method; calls
5375 constraints.ResolveTypes().
5376 (TypeParameter.DefineType): Moved constraints.ResolveType() out
5377 into the new ResolveType().
5378 (GenericMethod.Define): Call ResolveType() on all our
5381 2005-02-21 Martin Baulig <martin@ximian.com>
5384 (TypeManager.generic_nullable_type): New static public field.
5385 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5388 (RootContext.ResolveCore): Resolve "System.Nullable`1".
5390 2005-02-15 Martin Baulig <martin@ximian.com>
5392 * generic.cs (ConstructedType.Constraints): Correctly check
5393 constraints if the argument type is a type parameter; fixes
5396 2005-02-02 Martin Baulig <martin@ximian.com>
5398 * delegate.cs (Delegate.DefineType): Report an internal error if
5399 TypeManager.multicast_delegate_type is null. See bug #72015 for
5402 2005-01-29 Miguel de Icaza <miguel@novell.com>
5404 * pending.cs: Produce better code (no nops produced by using Ldarg
5407 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5408 i - 1' it should be arg + 1.
5412 2005-01-26 Martin Baulig <martin@ximian.com>
5414 * cs-parser.jay (indexer_declarator): Don't report an error if we
5415 have type parameters since we can be an explicit interface
5416 implementation; fixes #71449.
5418 2005-01-26 Martin Baulig <martin@ximian.com>
5420 * class.cs (TypeContainer.AttributeTargets): Return the correct
5421 AttributeTargets depending on our `Kind' instead of throwing an
5422 exception; fixes #71632.
5424 2005-01-26 Martin Baulig <martin@ximian.com>
5426 * delegate.cs (Delegate.DefineType): Correctly define our type
5427 parameters. Fixes #71483.
5429 2005-01-25 Raja R Harinath <rharinath@novell.com>
5432 * expression.cs (MemberAccess.DoResolve): Don't complain with
5433 cs0572 when the LHS of a member access has identical name and type
5436 2005-01-25 Marek Safar <marek.safar@seznam.cz>
5439 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5441 Create custom PermissionSet only for PermissionSetAttribute.
5443 2005-01-24 Marek Safar <marek.safar@seznam.cz>
5446 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5447 delegates in static class.
5449 2005-01-24 Martin Baulig <martin@ximian.com>
5451 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5452 merging an implicit block, just use its reachability.
5454 * statement.cs (Block.Resolve): Make the unreachable code check
5455 work wrt. implicit blocks; see test-337 from #63842.
5457 2005-01-21 Alp Toker <alp@atoker.com>
5459 * cs-parser.jay: destructor_declaration's container is PartialContainer
5460 not Class when partial types are used, so use Kind prop instead of
5463 2005-01-22 Miguel de Icaza <miguel@ximian.com>
5465 * cs-parser.jay: Improve error reporting when an interface
5468 2005-01-20 Dick Porter <dick@ximian.com>
5470 * support.cs: SeekableStreamReader fix from Sandor Dobos
5471 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5472 chars are read. Fixes bug 70369.
5474 2005-01-20 Raja R Harinath <rharinath@novell.com>
5476 * cs-parser.jay (catch_clause): Simplify current_block handling
5479 2005-01-17 Miguel de Icaza <miguel@ximian.com>
5481 * convert.cs (ImplicitStandardConversionExists): Synchronize the
5482 code with ImplicitStandardConversion to handle the implicit
5483 conversion of method groups into valid delegate invocations.
5485 The problem is that in parameter handling we were using this code
5486 path. Fixes bug #64698
5488 2005-01-19 Raja R Harinath <rharinath@novell.com>
5490 * cs-parser.jay: Fix several infelicities.
5491 - Avoid assigning to the parser value stack. Code like
5492 '$3 = null' is unclean. Synthesize a value for the code block
5494 - Avoid using oob_stack for storing location information. Use ...
5495 (_mark_): ... this. New (empty) rule. Saves the current location
5497 (foreach_statement): Avoid using oob_stack for current_block
5498 handling. Use technique used in for_statement and
5499 using_statement. Synthesize a value for the code block to store
5500 additional intermediate information.
5502 2005-01-13 Miguel de Icaza <miguel@ximian.com>
5504 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5505 of a different type is only allowed to private fields of a
5506 containing type, not on fields of a base class.
5508 See test-174.cs and error cs0122-9.cs
5510 2005-01-13 Raja R Harinath <rharinath@novell.com>
5512 Fix test-335.cs (bug #58126).
5513 * cs-parser.jay (argument): Split out non-expression parts of the
5514 rule into 'non_simple_argument'.
5515 (invocation_expression): Support parenthesized invocations with
5516 multiple arguments, and with single non-simple arguments.
5518 2005-01-13 Raja R Harinath <rharinath@novell.com>
5520 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5523 2005-01-12 Raja R Harinath <rharinath@novell.com>
5525 Fix cs0038-1.cs, cs1640-6.cs.
5526 * ecore.cs (Expression.Resolve): Remove special-case for
5527 SimpleName in error-handling.
5528 (Expression.almostMatchedMembers): Relax access permission to
5530 (Expression.MemberLookupFailed): Handle duplicates in
5531 almostMatchedMembers list.
5532 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5533 * expression.cs (New.DoResolve): Report CS1540 for more cases.
5534 * typemanager.cs (GetFullNameSignature): Use the MethodBase
5535 overload if the passed in MemberInfo is a MethodBase.
5537 2005-01-25 Martin Baulig <martin@ximian.com>
5540 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5542 2005-01-12 Marek Safar <marek.safar@seznam.cz>
5545 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5546 for non-CAS & merge permission sets properly.
5548 2005-01-11 Raja R Harinath <rharinath@novell.com>
5550 Improve standard-compliance of simple name and member access
5551 resolution. Fixes bugs #52697, #57200, #67520, #69519.
5552 * ecore.cs (FullNamedExpression): New abstract base class
5553 for Namespaces and TypeExpressions.
5554 (ResolveFlags.SimpleName): Remove.
5555 (SimpleName): Remove support for dotted names.
5556 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
5557 DeclSpace.FindType and DeclSpace.LookupType.
5558 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5559 (Expression.ExprClassName): Make member function.
5560 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5561 a namespace. Remove creation of dotted "SimpleName"s.
5562 (MemberAccess.DoResolve): Likewise.
5563 * decl.cs (DeclSpace.Cache): Make private.
5564 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5565 (DeclSpace.FindType): Update.
5566 (DeclSpace.LookupType): Move here from RootContext. Return a
5567 FullNamedExpression.
5568 * namespace.cs (Namespace): Derive from FullNamedExpression
5569 so that it can be part of expression resolution.
5570 (Namespace.Lookup): Return an FullNamedExpression.
5571 (NamespaceEntry.LookupAlias): Lookup aliases only in current
5573 * rootcontext.cs (NamespaceLookup): Remove.
5574 (LookupType): Move to DeclSpace.
5575 * attribute.cs (CheckAttributeType): Update.
5576 * doc.cs (FindDocumentedType): Remove allowAlias argument.
5577 (FindDocumentedTypeNonArray): Likewise.
5579 2005-01-11 Raja R Harinath <rharinath@novell.com>
5581 Fix cs0509.cs, cs1632.cs.
5582 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5583 is the same as IsInterface.
5584 (TypeContainer.GetClassBases): Likewise.
5585 * statement.cs (LabeledStatement.ig): New field.
5586 (LabeledStatement.LabelTarget): Save ILGenerator which created the
5588 (LabeledStatement.DoEmit): Check that the label was created with
5589 the same ILGenerator.
5591 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5594 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5595 accessors to its properties.
5597 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5598 from accessors to property.
5600 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5603 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5606 2005-01-08 Miguel de Icaza <miguel@ximian.com>
5608 * attribute.cs: Check for null and empty strings.
5610 I have lost another battle to Paolo.
5612 2005-01-07 Marek Safar <marek.safar@seznam.cz>
5615 * class.cs (PropertyMethod): Set Parent field in ctors.
5616 (SetMethod.InternalParameters): Add unsafe switch hack.
5617 Override MarkForDuplicationCheck where it is appropriate.
5619 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5620 It says whether container allows members with the same name.
5622 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5623 Removed is_method parameter.
5625 2005-01-06 Duncan Mak <duncan@ximian.com>
5627 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5628 because the previous change led to incorrect reporting of CS1032
5629 ("Cannot define/undefine preprocessor symbols after first token in
5630 file"). Instead of using `tokens_seen' as the only flag that
5631 triggers CS1040, introduce `comments_seen'. This new flag is used
5632 to signify having seen comments on the current line, so it is
5633 unset after a newline.
5635 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5637 * doc.cs : When searching for a type, find nested type too.
5638 This fixes bug #71040.
5640 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5643 - Warn missing member comment on those classes which also does not
5644 have doc comments. Fixed bug #71041.
5645 - Don't warn missing doc comment on default constructor.
5648 2005-01-06 Duncan Mak <duncan@ximian.com>
5650 * cs-tokenizer.cs (xtoken): After handling traditional C-style
5651 comments, set `tokens_seen' to true. This allows us to detect
5652 misplaced preprocessor directives (i.e. not at the beginning of
5653 the a line, nor after whitespaces). In that case, report error
5654 CS1040. This fixes bug #56460.
5656 * cs-parser.jay (interface_member_declaration): Add checks for
5657 IsExplicitImpl, and report CS0541 error if an interface member is
5658 defined as an explicit interface declaration.
5660 2005-01-06 Marek Safar <marek.safar@seznam.cz>
5663 * class.cs (PropertyMethod): Set Parent field in ctors.
5664 (SetMethod.InternalParameters): Add unsafe switch hack.
5666 * decl.cs (MemberCore.Parent): Cannot be readonly.
5668 2005-01-06 Raja R Harinath <rharinath@novell.com>
5670 * decl.cs (DeclSpace.ResolveType): Remove.
5671 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5672 Merge in code from ...
5673 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
5674 * class.cs, enum.cs: Update to changes.
5676 2005-01-06 Miguel de Icaza <miguel@ximian.com>
5678 * anonymous.cs: Ensure that we init the scope of our parent if it
5679 has not been initialized yet.
5681 2004-12-30 Duncan Mak <duncan@ximian.com>
5683 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5684 if field.FieldBuilder is null. Fixes #70758.
5686 * convert.cs: Fixed some typos and updated some of the comments.
5687 (ImplicitStandardConversionExists):
5688 (TryImplicitIntConversion): If `target_type' is an interface and
5689 the type of `ic' implements this interface, return true or a new
5690 BoxedCast instead of null. This fixes #70468.
5692 2004-12-29 Duncan Mak <duncan@ximian.com>
5694 * expression.cs (Argument.Emit): Check that Expr is
5695 IMemoryLocation before casting to it, and report CS1510 otherwise.
5699 2004-12-21 Ben Maurer <bmaurer@ximian.com>
5701 * statement.cs (Block.ThisVariable): remove the recursion here, to
5702 make the --profile more sane.
5704 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
5706 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5707 assembly, by JB Evain.
5709 2004-12-17 Raja R Harinath <rharinath@novell.com>
5711 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
5712 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5713 "parent" refers to enclosing type/class. "base" refers to superclass.
5715 2004-12-17 Raja R Harinath <rharinath@novell.com>
5717 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5718 Ensure that we only have GlobalAttributes.
5719 * attribute.cs (Attribute.Emit): Make non-virtual.
5720 (GlobalAttribute.Emit): Remove.
5721 (Attribute.Resolve): Make virtual.
5722 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
5723 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5724 the argument. Don't create one.
5725 (Attribute.GetObsoleteAttribute): Likewise.
5726 (Attribute.GetClsCompliantAttributeValue): Likewise.
5727 * class.cs, decl.cs: Update to changes.
5729 2004-12-17 Marek Safar <marek.safar@seznam.cz>
5731 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5733 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5735 * statement.cs (Foreach.Resolve): Add error 186 report.
5737 2004-12-16 Marek Safar <marek.safar@seznam.cz>
5739 * expression.cs (Conditional.DoResolve): Add warning 429.
5741 * statement.cs (If.Resolve): Add warning 665.
5743 2004-12-16 Raja R Harinath <rharinath@novell.com>
5745 New invariant: RootContext.Tree.Types.NamespaceEntry == null
5746 except when in the parser, and in GlobalAttribute.
5747 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5748 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5749 RootContext.Tree.Types.NamespaceEntry once work is done.
5750 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
5751 and resets RootContext.Tree.Types.NamespaceEntry.
5753 2004-12-15 Marek Safar <marek.safar@seznam.cz>
5755 * cs-parser.jay: Don't create a block for every variable.
5757 2004-12-14 Miguel de Icaza <miguel@ximian.com>
5759 * location.cs: Provide extra information.
5761 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5762 variables from the captured environment, it is the ldarg_0.
5764 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5766 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5769 * class.cs: Changed warning level for 169 to avoid developer
5770 displeasure from warning flooding. It will be changed back when they
5771 fix most of current BCL warnings.
5773 * RootContext.cs: Pushed default WarningLevel to 3.
5775 * statement.cs: Removed unused variable.
5777 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5779 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5780 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5781 Add error 502 report.
5782 (StaticClass.DefineType): Add error 441 report.
5783 (Class.AllowedModifiersProp): New virtual property as temporary
5784 extension to AllowedModifiers.
5785 (Class.DefineType): Add error 418 report. Moved ModFlags check here
5786 to share implementation with StaticClass and don't call virtual
5789 * driver.cs (MainDriver): Add error 1558 test.
5791 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5792 report. Moved error 36 test here.
5794 * statement.cs (Throw.Resolve): Add error 724 report.
5796 * typemanager.cs: Add out_attribute_type core type.
5798 2004-12-13 Marek Safar <marek.safar@seznam.cz>
5800 * class.cs (TypeContainer.VerifyClsCompliance): Add error
5802 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5804 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5807 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5809 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
5810 Add error 3023 report.
5811 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5813 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5816 2004-12-12 John Luke <john.luke@gmail.com>
5818 * driver.cs (AddArgs): take -- into account when
5819 adding arguments, fixes bug 65710
5821 2004-12-12 Martin Baulig <martin@ximian.com>
5823 * expression.cs (Unary.TryReduceNegative): Added support for
5824 SByteConstant and ByteConstant.
5825 (Unary.Reduce): Check error values from TryReduceNegative().
5827 2004-12-10 Marek Safar <marek.safar@seznam.cz>
5829 * attributes.cs (Attribute.Resolve): Avoid multiple error report
5830 and report exception as error 182.
5832 2004-12-10 Raja R Harinath <rharinath@novell.com>
5834 * driver.cs (Main): Fix message when there are warnings.
5836 2004-12-09 Miguel de Icaza <miguel@ximian.com>
5838 * delegate.cs: Fixed my fix from yesterday, sorry about that.
5840 2004-12-09 Marek Safar <marek.safar@seznam.cz>
5842 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
5843 Reduced number of warnings.
5845 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5847 2004-12-08 Miguel de Icaza <miguel@ximian.com>
5849 * driver.cs: Removed message.
5851 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5853 2004-12-08 <vargaz@freemail.hu>
5855 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5857 2004-12-08 Martin Baulig <martin@ximian.com>
5859 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5860 instead of a CS3002 for properties and indexer.
5862 2004-12-08 Martin Baulig <martin@ximian.com>
5864 * decl.cs (MemberName.ToString): Make this work again.
5866 2004-12-08 Marek Safar <marek.safar@seznam.cz>
5868 * attribute.cs (Resolve): Add error 591 detection.
5870 * class.cs (FieldMember.Define): Add error 1547 detection.
5871 (Indexer.Define): Add error 620 detection.
5872 (Operator.Define): Add error 590 detection.
5874 * ecore.cs: Missing argument for error 79.
5876 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5879 2004-12-07 Marek Safar <marek.safar@seznam.cz>
5882 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5885 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
5887 * cs-parser.jay : handle doc comments on implicit/explicit operators.
5888 Some operator comments were suppressed.
5889 * doc.cs : Implicit/explicit operator name in doc comments are like
5890 "op_Explicit(type)~returnType", so added suffix handling.
5892 2005-01-21 Alp Toker <alp@atoker.com>
5894 * cs-parser.jay: destructor_declaration's container is PartialContainer
5895 not Class when partial types are used, so use Kind prop instead of 'is'.
5897 2004-12-12 Martin Baulig <martin@ximian.com>
5899 * expression.cs (Unary.TryReduceNegative): Added support for
5900 SByteConstant and ByteConstant.
5901 (Unary.Reduce): Check error values from TryReduceNegative().
5903 2004-12-11 Martin Baulig <martin@ximian.com>
5905 * support.cs (ReflectionParameters.ParameterName): If we have a
5906 `gpd', call `ParameterName' on it.
5908 * parameter.cs (Parameter.GetParameterAttributes): New static method.
5910 * pending.cs (PendingImplementation.DefineProxy): Call
5911 DefineParameter() for all of the MethodBuilder's arguments.
5913 2004-12-09 Martin Baulig <martin@ximian.com>
5915 * doc.cs (DocUtil): Make this a static class.
5917 2004-12-09 Martin Baulig <martin@ximian.com>
5919 * expression.cs (Invocation.InferType): Moved the type inference
5920 implementation into TypeManager.
5922 * generics.cs (TypeManager): Moved the type inference
5923 implementation here.
5925 2004-12-09 Martin Baulig <martin@ximian.com>
5927 * typemanager.cs (TypeManager): Make this a partial class.
5930 (TypeManager): Move the generics part of `TypeManager' here.
5932 2004-12-08 Martin Baulig <martin@ximian.com>
5934 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5935 instead of a CS3002 for properties and indexer. Added CS3024
5936 check for generic interfaces.
5938 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
5939 instances are not CLS-compliant.
5941 2004-12-08 Martin Baulig <martin@ximian.com>
5944 (void_pointer_expression): New rule for `void*', `void**' etc.
5945 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
5947 2004-12-08 Martin Baulig <martin@ximian.com>
5949 * expression.cs (Invocation.InferType): Removed the hack for
5950 MethodCore.MayUnify().
5952 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
5955 * class.cs (MethodCore.MayUnify): Use
5956 TypeManager.MayBecomeEqualGenericTypes().
5958 2004-12-08 Martin Baulig <martin@ximian.com>
5960 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
5961 parameter, box it. Fixes #69233.
5963 2004-12-08 Martin Baulig <martin@ximian.com>
5965 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
5966 have the ctor constraint. Fixes #68326.
5968 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
5970 * cs-parser.jay : interface comment was not consumed because of
5971 extra opt_semicolon before doc handling.
5973 2004-12-03 Raja R Harinath <rharinath@novell.com>
5975 Fix test-327.cs, test-328.cs, and put in early infrastructure
5976 for eventually fixing #52697.
5977 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
5978 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
5980 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
5981 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
5982 (VerifyUsing, error246): Update.
5983 * rootcontext.cs (RootContext.NamespaceLookup): Just use
5984 'NamespaceEntry.LookupNamespaceOrType'.
5986 2004-12-07 Martin Baulig <martin@ximian.com>
5988 * driver.cs: Call it "BETA SOFTWARE" :-)
5990 2004-12-06 Raja R Harinath <rharinath@novell.com>
5992 Fix crash on cs0657-17.cs.
5993 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5994 Use RootContext.Tree.Types, not 'new RootTypes ()'.
5995 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5996 the case where the NamespaceEntry gets overwritten.
5998 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6000 Fixed #69195, #56821
6001 * ecore.cs (ResolveBoolean): Tiny refactoring.
6003 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6004 of right expression resolving when left is false constant and
6005 operator is LogicalAnd OR true constant and operator is LogicalOr.
6007 * statement.cs (ResolveUnreachable): Always reports warning.
6009 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6011 * class.cs: Distinguish between 1721 and 1722 (just a little help
6012 for the programmer).
6014 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6016 * delegate.cs: Only allow this on new versions of the language.
6018 2004-12-02 Duncan Mak <duncan@ximian.com>
6020 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6022 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6023 here as a static method. Take an additional bool out parameter
6024 `must_do_cs1540_check' for signaling to InstanceResolve.
6025 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6026 member field from PropertyExpr class and made it an argument of
6028 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6029 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6030 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6031 and `remove_accessor' as well as InstanceResolve: report CS0122
6036 2004-12-07 Martin Baulig <martin@ximian.com>
6038 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6039 and CS0692 where appropriate.
6041 2004-12-06 Martin Baulig <martin@ximian.com>
6043 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6044 IsDuplicateImplementation() and improved it.
6046 * expression.cs (Invocation.InferTypeArguments): Added
6047 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6048 and removed the "ref" modifier from `infered_types'.
6050 * decl.cs (MemberName.ToString): Removed the exception.
6052 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6054 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6055 comments are allowed.
6057 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6059 * delegate.cs: Add checks for subtypes in paramaters and return values
6060 in VerifyMethod () to add support for Covariance/Contravariance
6063 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6065 * report.cs: Remove extra closing parenthesis.
6067 * convert.cs (Error_CannotImplicitConversion): If the name of the
6068 types are the same, provide some extra information.
6070 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6073 * attribute.cs (Resolve): Improved implementation of params
6074 attribute arguments.
6076 * support.cs (ParameterData): Add HasParams to be faster.
6078 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6080 all things are for /doc support:
6082 * doc.cs: new file that supports XML documentation generation.
6083 * mcs.exe.sources: added doc.cs.
6085 Handle /doc command line option.
6086 Report error 2006 instead of 5 for missing file name for /doc.
6087 Generate XML documentation when required, after type resolution.
6089 Added support for picking up documentation (/// and /** ... */),
6090 including a new XmlCommentState enumeration.
6092 Added lines to fill Documentation element for field, constant,
6093 property, indexer, method, constructor, destructor, operator, event
6094 and class, struct, interface, delegate, enum.
6095 Added lines to warn incorrect comment.
6097 Added Documentation field (passed only when /doc was specified).
6099 Added DocComment, DocCommentHeader, GenerateDocComment() and
6100 OnGenerateDocComment() and some supporting private members for
6101 /doc feature to MemberCore.
6103 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6105 Added overriden DocCommentHeader.
6107 Added overriden DocCommentHeader and GenerateDocComment().
6109 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6111 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6112 unwrapping the enumeration values, chain to
6113 DoConstantNumericPromotions again, so we can promote things to the
6114 fundamental types (takes care of enums that are bytes, sbytes).
6118 2004-12-01 Raja R Harinath <rharinath@novell.com>
6120 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6121 Fix long-standing bug in type-lookup. Use FindType instead of
6122 LookupType when ec.ResolvingTypeTree.
6123 (Attribute.ResolveType, Attribute.Resolve)
6124 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6126 (Attributes.Search): Remove internal version. Update.
6127 (Attributes.SearchMulti): Update.
6128 (Attributes.GetClsCompliantAttribute): Remove.
6129 (Attributes.GetIndexerNameAttribute): Remove.
6130 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6131 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6132 * class.cs (Indexer.Define): Likewise.
6134 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6137 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6138 MarshallByReference members access.
6140 * expression.cs: Use CheckMarshallByRefAccess;
6141 Better error CS0197 message.
6143 * report.cs: Print whole related error message.
6145 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6147 * class (GetClassBases): Better error 60 report.
6148 (EventProperty): Disabled warning 67 detection.
6150 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6153 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6155 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6158 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6161 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6163 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6165 2004-11-26 Miguel de Icaza <miguel@ximian.com>
6167 * attribute.cs (Attribute.Resolve): Refine error reporting and
6168 report a cs0117 if the identifier does not exist, to distinguish
6169 from 0617 which is a miss-use of the actual identifier.
6171 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6172 between cs0070 and cs0079.
6174 * class.cs (MemberBase.DoDefine): When reporting a wrong
6175 accessibility level, we use MethodCore to compare instead of
6176 Method (this was a regression in some refactoring effort).
6178 So now we correctly report cs0056 again.
6180 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6181 testing the target_type (which was known to be object_type) and
6182 not the source type (which is anonymous_method).
6184 Fixed reporting of error cs1660.
6186 * expression.cs (UserCast.Source): Expose the underlying cast.
6188 * statement.cs (Switch.SwitchGoverningType): Sort the list of
6189 allowed types to find a match to int32 first (most common).
6191 In addition, it ignores any ImplicitUserConversions that did an
6192 internal implicit conversion (as the switch statement allows only
6193 one integral conversion to exist).
6195 * class.cs (PartialContainer.Create): rename `name' to
6196 `member_name' for clarity. Then replace the string calls with a
6197 call to MemberName.GetPartialName, as now using
6198 MemberName.ToString is an error (this is due to the side effects
6199 it had, that were fixed in the past).
6201 This will restore the error reporting on a number of partial class
6202 errors that were missusing this (and getting an exception as a
6203 results, which is now just a plain textual warning, because
6204 yyparse debug output would crash otherwise).
6206 2004-11-26 Raja R Harinath <rharinath@novell.com>
6208 * Makefile (PROGRAM_INSTALL_DIR): Remove.
6210 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6212 * rootcontext.cs (LookupType): Make sure to cache lookups that
6213 don't give us a negative result. This saves about 5% of corlib
6216 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6218 * report.cs (AbstractMessage.Print): messages are sent to stderr
6220 * class.cs (TypeContainer.GetClassBases): It is an error to have a
6221 non-interface in the list of interfaces (at this point, either
6222 parent was properly set, or a base class is being listed in the
6223 interfaces section).
6225 This flags error 1722, and resolves the crash from bug 69259.
6227 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6229 * statement.cs (Using.EmitExpressionFinally): make this work right
6230 for valuetypes. Fixes 69926.
6232 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6234 * const.cs (Const.ChangeType): Cope with the "0 literal can be
6235 converted to an enum" here, before we try to change the underlying
6236 type. This code exists, but it is a different code path than the
6237 one used while encoding constants.
6239 (ImplicitReferenceConversionExists): In addition, resynchronized
6240 the code here, so it matches the same code in
6241 ImplicitReferenceConversionExists for the `from any class-type S
6242 to any interface-type T'.
6244 2004-11-25 Marek Safar <marek.safar@seznam.cz>
6246 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6248 2004-11-24 Miguel de Icaza <miguel@ximian.com>
6250 * cs-parser.jay: Use verbosity accordingly.
6252 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6254 * expression.cs (Unary.ResolveOperator): Do not report warning;
6255 AddressOf reads from variable.
6257 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6259 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6263 * attribute.cs (Attributable): Removed CheckTargets.
6264 (Attributes.Emit): Explicit attribute targets are tested here.
6266 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6267 not enabled for interfaces.
6269 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6270 (GetAssemblyName): Ouch next bug there.
6272 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6274 * expression.cs: Error 275 added.
6276 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6278 Fix bug #69177 (Implemented decimal constant support)
6280 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6281 (BinaryFold): Add DecimalConstant.
6283 * const.cs (Define): Decimal constant
6285 (ChangeType): Add decimal type handling.
6286 (LookupConstantValue): Don't set value for decimal type but
6287 emit DecimalConstantAttribute. Needed for constant optimization.
6289 * constant.cs (ToDecimal): New method.
6290 (ConvertToDecimal): New method.
6291 (IntConstant): Implemented ConvertToDecimal.
6292 (DecimalConstant.Emit): Emit optimized version for decimals in
6295 * expression.cs (ResolveOperator): Changed order of constant
6296 reduction to work correctly with native types which have
6297 overloaded operators.
6298 (ResolveMemberAccess): Extract constant value from attribute
6301 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6303 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6304 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6305 (ChangeType): Decimal is special.
6306 (TypeToCoreType): Add decimal type.
6308 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6310 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6313 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6315 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6318 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6320 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6322 * pending.cs (PendingImplementation): Grab only interfaces.
6324 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6326 * statement.cs (ForeachHelperMethods): Add location member and
6327 error 202 detection.
6329 2004-11-18 Marek Safar <marek.safar@seznam.cz>
6331 * expression.cs (DoResolveBase): Fixed wrong warning for out
6334 2004-12-04 Martin Baulig <martin@ximian.com>
6336 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6337 to check whether the conversion is ok.
6339 * typemanager.cs (TypeManager.GetTypeArguments): Just return
6340 `Type.EmptyTypes' if we're not a generic TypeContainer.
6342 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6344 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6345 old bug: when converting from the null literal to a pointer,
6346 return an EmptyCast, not the NullLiteral.
6348 This fixes #69921, the recent null_type changes probably made this
6351 2004-12-03 Martin Baulig <martin@ximian.com>
6353 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6354 method as our child, call AnonymousMethod.Compatible() on it.
6356 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6358 * class.cs (FieldBase): Use an unused bit field from the field to
6359 encode the `has_offset' property from the FieldMember. This saves
6360 a couple of Ks on bootstrap compilation.
6362 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6363 method as our child, return the AnonymousMethod resolved
6366 * expression.cs (New.DoResolve): Allow return values from
6367 NewDelegate to also include AnonymousMethods.
6371 2004-11-29 Raja R Harinath <rharinath@novell.com>
6373 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6375 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6376 System.Runtime.InteropServices._Exception, since it's a base
6377 interface of the core type System.Exception in the net_2_0 profile.
6379 2004-11-27 Martin Baulig <martin@ximian.com>
6381 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6383 2004-11-26 Raja R Harinath <rharinath@novell.com>
6385 * Makefile: Convert to use executable.make.
6386 * gmcs.exe.sources: New.
6388 2004-11-25 Martin Baulig <martin@ximian.com>
6390 * expression.cs (Invocation.InferType): Added support for byref types.
6392 2004-11-25 Martin Baulig <martin@ximian.com>
6394 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6395 in TypeManager.TypeToCoreType().
6397 2004-11-25 Martin Baulig <martin@ximian.com>
6399 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6400 "Dispose" method from the `current_type'.
6401 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6402 DoDefineMembers() instead of using the MethodBuilder; this is
6403 required for generic iterators.
6405 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6407 2004-11-24 Martin Baulig <martin@ximian.com>
6409 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6411 2004-11-20 Martin Baulig <martin@ximian.com>
6413 * expression.cs (Invocation.InferType): Correctly infer generic
6414 instances; see gen-103.cs.
6415 (Invocation.InferTypeArguments): If a generic method doesn't have
6416 any unbound type parameters, we don't need to infer anything.
6418 2004-11-19 Raja R Harinath <rharinath@novell.com>
6420 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6422 2004-11-17 Raja R Harinath <rharinath@novell.com>
6424 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6425 (TypeHandle.GetMemberCache): New.
6426 (TypeHandle.TypeHandle): Update.
6427 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6428 (TypeManager.LookupParentInterfacesCache):
6429 Rename from LookupInterfaceCache. Optimize slightly.
6430 (TypeManager.MemberLookup_FindMembers): Update.
6431 * decl.cs (MemberCache.MemberCache): Set Container to null in the
6433 (AddCacheContents): Rename from AddHashtable.
6434 * class.cs (TypeContainer.parent_container): Remove.
6435 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6436 (TypeContainer.DoDefineMembers): Don't initialize it.
6437 Update to name changes.
6439 2004-11-17 Miguel de Icaza <miguel@ximian.com>
6441 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6442 that factors the code to check access modifiers on override.
6444 (PropertyBase): Use the code here.
6446 Patch from Lluis S'anchez, fixes bug #69361.
6448 2004-11-15 Miguel de Icaza <miguel@ximian.com>
6450 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6451 routine that is used to report the use of a captured variable
6452 whose address has been taken.
6454 There are two checks: one when variables are being captured and
6455 the other check is when the address of a variable is taken.
6457 (because an anonymous methods might be resolved before *or* after
6458 the address has been taken) and
6460 * expression.cs (Conditional.DoResolve): Remove the special
6461 casing that Martin added to trueExpr and falseExpr being both
6462 NullLiteral. We get the right behavior now just by introducing
6463 the null_type into the compiler.
6465 * convert.cs (ExplicitConversion): Change the code to use
6466 null_type instead of testing `expr is NullLiteral'.
6467 (ImplicitConversionStandard): use null_type too.
6468 (ImplicitReferenceConversionExists): use null_type too.
6469 (ImplicitReferenceConversion): use null_type too.
6471 * literal.cs: The type of `NullLiteral' is now null_type instead
6473 (Resolve): Set the type here.
6475 * typemanager.cs: Introduce null_type.
6477 2004-11-18 Martin Baulig <martin@ximian.com>
6480 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6482 2004-11-18 Martin Baulig <martin@ximian.com>
6484 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6486 2004-11-18 Martin Baulig <martin@ximian.com>
6488 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6489 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
6490 call ResolveConstructedType() on it to resolve it without checking
6492 (Constraints.ResolveTypes): Check them here.
6493 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6494 but don't check constraints.
6495 (ConstructedType.ResolveAsTypeTerminal): Override this and also
6496 check constraints here.
6497 (ConstructedType.ResolveConstructedType): New public method. This
6498 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6499 resolve ourselves without checking constraints.
6501 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6503 2004-11-18 Martin Baulig <martin@ximian.com>
6506 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6508 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6510 2004-11-18 Martin Baulig <martin@ximian.com>
6512 * ecore.cs (TypeExpr.ResolveType): Removed.
6513 (Expression.ResolveAsTypeTerminal): We always return a fully
6514 resolved `TypeExpr', so we can just access its `Type'.
6516 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6518 2004-11-17 Martin Baulig <martin@ximian.com>
6520 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6521 sure we don't return any unresolved TypeExpr's.
6522 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6524 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6526 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6527 unresolved `ConstructedType's.
6529 2004-11-17 Martin Baulig <martin@ximian.com>
6531 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6533 2004-11-17 Martin Baulig <martin@ximian.com>
6536 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6538 * decl.cs (DeclSpace.ResolveType): Removed.
6539 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6541 2004-11-17 Martin Baulig <martin@ximian.com>
6543 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6544 direction, like FindMembers() does. Fixes #69546, testcase is in
6547 2004-11-16 Martin Baulig <martin@ximian.com>
6549 This is based on a patch from Marek Safar, see bug #69082.
6550 Fixes bugs #63705 and #67130.
6552 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6553 method; create a MemberCache for an interface type and cache the
6556 * decl.cs (IMemberContainer.ParentContainer): Removed.
6557 (IMemberContainer.ParentCache): New property.
6558 (MemberCache.SetupCacheForInterface): Removed.
6559 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6560 to create a cache for an interface's "parent".
6562 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6565 2004-11-14 Ben Maurer <bmaurer@ximian.com>
6567 * statement.cs: Avoid adding bools to a hashtable.
6569 2004-11-15 Martin Baulig <martin@ximian.com>
6571 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6573 2004-11-11 Martin Baulig <martin@ximian.com>
6575 * typemanager.cs (TypeManager.GetMethodName): New method.
6577 * class.cs (MethodData.Define): Include the generic arity in the
6578 name of an explicit interface; also add it to the method name.
6580 * pending.cs (PendingImplementation.InterfaceMethod): The method
6581 name now includes the generic arity.
6583 2004-11-07 Miguel de Icaza <miguel@ximian.com>
6585 * expression.cs (Invocation.OverloadResolve): Flag error if we are
6586 calling an unsafe method from a safe location.
6588 2004-11-06 Marek Safar <marek.safar@seznam.cz>
6591 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6593 2004-11-06 Miguel de Icaza <miguel@ximian.com>
6595 * namespace.cs (VerifyUsing): use GetPartialName instead of
6598 2004-11-05 Miguel de Icaza <miguel@ximian.com>
6600 * statement.cs (Return.Resolve): Fix regression in typo: if
6601 `in_exc', we have to request a NeedReturnLabel, this was a typo
6602 introduced in the anonymous method check-in. Fixes #69131.
6604 * Indexers were using the ShortName when defining themselves,
6605 causing a regression in the compiler bootstrap when applying the
6606 patch from 2004-11-02 (first part), now they use their full name
6607 and the bug is gone.
6609 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
6611 * driver.cs: Strip the path from the names of embedded resources. Fixes
6614 2004-11-04 Raja R Harinath <rharinath@novell.com>
6616 Fix error message regression: cs0104-2.cs.
6617 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6618 (AliasEntry.Resolve): Update.
6619 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
6621 (RootContext.LookupType): Update.
6623 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
6625 * cs-parser.jay: Add support for handling accessor modifiers
6626 * class: Add support port accessor modifiers and error checking,
6627 define PropertyMethod.Define as virtual (not abstract anymore)
6628 * ecore.cs: Add checking for proeprties access with access modifiers
6629 * iterators.cs: Modify Accessor constructor call based in the modified
6631 2004-11-02 Ben Maurer <bmaurer@ximian.com>
6633 * expression.cs (StringConcat): Handle being called twice,
6634 as when we have a concat in a field init with more than two
6637 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6639 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6640 special case explicit implementations, we should always produce
6641 the .property or .event declaration.
6643 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6644 since it will not return correct data if people use this
6645 unresolved in the presence of using statements (see test-313).
6647 * class.cs (MethodData.Define): If we are an explicit interface
6648 implementation, set the method name to the full name of the
6649 interface plus the name of the method.
6651 Notice that using the method.MethodName.GetFullName() does not
6652 work, as it will only contain the name as declared on the source
6653 file (it can be a shorthand in the presence of using statements)
6654 and not the fully qualifed type name, for example:
6658 class D : ICloneable {
6659 object ICloneable.Clone () {
6663 Would produce a method called `ICloneable.Clone' instead of
6664 `System.ICloneable.Clone'.
6666 * namespace.cs (Alias.Resolve): Use GetPartialName.
6668 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6670 * cs-parser.jay: Add error 1055 report.
6672 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6674 * assign.cs (Assign.DoResolve): Only do the transform of
6675 assignment into a New if the types are compatible, if not, fall
6676 through and let the implicit code deal with the errors and with
6677 the necessary conversions.
6679 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6681 * cs-parser.jay: Add error 1031 report.
6683 * cs-tokenizer.cs: Add location for error 1038.
6685 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6687 * cs-parser.jay: Add error 1016 report.
6689 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6691 * cs-parser.jay: Add errors 1575,1611 report.
6693 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6695 * cs-parser.jay: Add error 1001 report.
6697 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6700 * attribute.cs (GetMarshal): Add method argument for
6701 caller identification.
6703 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6704 agument for GetMarshal and RuntimeMissingSupport.
6706 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6708 * attribute.cs (ExtractSecurityPermissionSet): Removed
6709 TypeManager.code_access_permission_type.
6711 * typemanager.cs: Removed TypeManager.code_access_permission_type.
6713 2004-10-27 Miguel de Icaza <miguel@ximian.com>
6715 * expression.cs (LocalVariableReference.DoResolveLValue): Check
6716 for obsolete use of a variable here. Fixes regression on errors
6717 cs0619-25 and cs0619-26.
6719 2004-10-27 Marek Safar <marek.safar@seznam.cz>
6721 Fix #62358, implemented security attribute encoding.
6723 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6724 Tests permitted SecurityAction for assembly or other types.
6725 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6726 data from SecurityPermissionAttribute to PermisionSet class.
6728 * class.cs (ApplyAttributeBuilder): Added special handling
6729 for System.Security.Permissions.SecurityAttribute based types.
6731 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6732 special handling for System.Security.Permissions.SecurityAttribute
6735 * enum.cs (ApplyAttributeBuilder): Added special handling
6736 for System.Security.Permissions.SecurityAttribute based types.
6738 * parameter.cs (ApplyAttributeBuilder): Added special handling
6739 for System.Security.Permissions.SecurityAttribute based types.
6741 * rootcontext.cs: Next 2 core types.
6743 * typemanager.cs (TypeManager.security_permission_attr_type):
6744 Built in type for the SecurityPermission Attribute.
6745 (code_access_permission_type): Build in type.
6747 2004-10-17 Miguel de Icaza <miguel@ximian.com>
6749 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6750 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6751 all of this information into
6752 EmitContext.EmitCapturedVariableInstance.
6754 * codegen.cs (EmitCapturedVariableInstance): move here the
6755 funcionality of emitting an ldarg.0 in the presence of a
6756 remapping. This centralizes the instance emit code.
6758 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6759 then emit a load of this: it means that we have reached the
6760 topmost ScopeInfo: the one that contains the pointer to the
6761 instance of the class hosting the anonymous method.
6763 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6764 captures to the topmost CaptureContext.
6766 2004-10-12 Miguel de Icaza <miguel@ximian.com>
6768 * expression.cs (LocalVariableReference): Move the knowledge about
6769 the iterators into codegen's EmitCapturedVariableInstance.
6771 2004-10-11 Miguel de Icaza <miguel@ximian.com>
6773 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6774 all code paths return a value from an anonymous method (it is the
6775 same as the 161 error, but for anonymous methods).
6777 2004-10-08 Miguel de Icaza <miguel@ximian.com>
6779 The introduction of anonymous methods in the compiler changed
6780 various ways of doing things in the compiler. The most
6781 significant one is the hard split between the resolution phase
6782 and the emission phases of the compiler.
6784 For instance, routines that referenced local variables no
6785 longer can safely create temporary variables during the
6786 resolution phase: they must do so from the emission phase,
6787 since the variable might have been "captured", hence access to
6788 it can not be done with the local-variable operations from the runtime.
6792 (Block.Flags): New flag `IsTopLevel' to indicate that this block
6793 is a toplevel block.
6795 (ToplevelBlock): A new kind of Block, these are the blocks that
6796 are created by the parser for all toplevel method bodies. These
6797 include methods, accessors and anonymous methods.
6799 These contain some extra information not found in regular blocks:
6800 A pointer to an optional CaptureContext (for tracking captured
6801 local variables and parameters). A pointer to the parent
6804 (Return.Resolve): Catch missmatches when returning a value from an
6805 anonymous method (error 1662).
6806 Invoke NeedReturnLabel from the Resolve phase instead of the emit
6809 (Break.Resolve): ditto.
6811 (SwitchLabel): instead of defining the labels during the
6812 resolution phase, we now turned the public ILLabel and ILLabelCode
6813 labels into methods called GetILLabelCode() and GetILLabel() that
6814 only define the label during the Emit phase.
6816 (GotoCase): Track the SwitchLabel instead of the computed label
6817 (its contained therein). Emit the code by using
6818 SwitchLabel.GetILLabelCode ().
6820 (LocalInfo.Flags.Captured): A new flag has been introduce to track
6821 whether the Local has been captured or not.
6823 (LocalInfo.IsCaptured): New property, used to tell whether the
6824 local has been captured.
6826 * anonymous.cs: Vastly updated to contain the anonymous method
6829 The main classes here are: CaptureContext which tracks any
6830 captured information for a toplevel block and ScopeInfo used to
6831 track the activation frames for various local variables.
6833 Each toplevel block has an optional capture context associated
6834 with it. When a method contains an anonymous method both the
6835 toplevel method and the anonymous method will create a capture
6836 context. When variables or parameters are captured, they are
6837 recorded on the CaptureContext that owns them, for example:
6841 MyDelegate d = delegate {
6846 Here `a' will be recorded as captured on the toplevel
6847 CapturedContext, the inner captured context will not have anything
6848 (it will only have data if local variables or parameters from it
6849 are captured in a nested anonymous method.
6851 The ScopeInfo is used to track the activation frames for local
6852 variables, for example:
6854 for (int i = 0; i < 10; i++)
6855 for (int j = 0; j < 10; j++){
6856 MyDelegate d = delegate {
6861 At runtime this captures a single captured variable `i', but it
6862 captures 10 different versions of the variable `j'. The variable
6863 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6864 recorded on a child.
6866 The toplevel ScopeInfo will also track information like the `this'
6867 pointer if instance variables were referenced (this is necessary
6868 as the anonymous method lives inside a nested class in the host
6869 type of the method).
6871 (AnonymousMethod): Expanded to track the Toplevel, implement
6872 `AnonymousMethod.Compatible' to tell whether an anonymous method
6873 can be converted to a target delegate type.
6875 The routine now also produces the anonymous method content
6877 (AnonymousDelegate): A helper class that derives from
6878 DelegateCreation, this is used to generate the code necessary to
6879 produce the delegate for the anonymous method that was created.
6881 * assign.cs: API adjustments for new changes in
6882 Convert.ImplicitStandardConversionExists.
6884 * class.cs: Adjustments to cope with the fact that now toplevel
6885 blocks are of type `ToplevelBlock'.
6887 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6888 insteda of standard blocks.
6890 Flag errors if params arguments are passed to anonymous methods.
6892 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6893 `CurrentAnonymousMethod' which points to the current Anonymous
6894 Method. The variable points to the AnonymousMethod class that
6895 holds the code being compiled. It is set in the new EmitContext
6896 created for the anonymous method.
6898 (EmitContext.Phase): Introduce a variable and an enumeration to
6899 assist in enforcing some rules about when and where we are allowed
6900 to invoke certain methods (EmitContext.NeedsReturnLabel is the
6901 only one that enfonces this right now).
6903 (EmitContext.HaveCaptureInfo): new helper method that returns
6904 whether we have a CapturedContext initialized.
6906 (EmitContext.CaptureVariable): New method used to register that a
6907 LocalInfo must be flagged for capturing.
6909 (EmitContext.CapturedParameter): New method used to register that a
6910 parameters must be flagged for capturing.
6912 (EmitContext.CapturedField): New method used to register that a
6913 field must be flagged for capturing.
6915 (EmitContext.HaveCapturedVariables,
6916 EmitContext.HaveCapturedFields): Return whether there are captured
6917 variables or fields.
6919 (EmitContext.EmitMethodHostInstance): This is used to emit the
6920 instance for the anonymous method. The instance might be null
6921 (static methods), this (for anonymous methods that capture nothing
6922 and happen to live side-by-side with the current method body) or a
6923 more complicated expression if the method has a CaptureContext.
6925 (EmitContext.EmitTopBlock): Routine that drives the emission of
6926 code: it will first resolve the top block, then emit any metadata
6927 and then emit the code. The split is done so that we can extract
6928 any anonymous methods and flag any captured variables/parameters.
6930 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6931 during this phase, the ILGenerator should not be used as labels
6932 and local variables declared here might not be accessible to any
6933 code that is part of an anonymous method.
6935 Exceptions to this include the temporary variables that are
6936 created by some statements internally for holding temporary
6939 (EmitContext.EmitMeta): New routine, in charge of emitting all the
6942 (EmitContext.TemporaryReturn): This method is typically called
6943 from the Emit phase, and its the only place where we allow the
6944 ReturnLabel to be defined other than the EmitMeta. The reason is
6945 that otherwise we would have to duplicate a lot of logic in the
6946 Resolve phases of various methods that today is on the Emit
6949 (EmitContext.NeedReturnLabel): This no longer creates the label,
6950 as the ILGenerator is not valid during the resolve phase.
6952 (EmitContext.EmitThis): Extended the knowledge in this class to
6953 work in anonymous methods in addition to iterators.
6955 (EmitContext.EmitCapturedVariableInstance): This emits whatever
6956 code is necessary on the stack to access the instance to a local
6957 variable (the variable will be accessed as a field).
6959 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6960 EmitContext.EmitAddressOfParameter): Routines to support
6961 parameters (not completed at this point).
6963 Removals: Removed RemapLocal and RemapLocalLValue. We probably
6964 will also remove the parameters.
6966 * convert.cs (Convert): Define a `ConstantEC' which points to a
6967 null. This is just to prefity some code that uses
6968 ImplicitStandardConversion code and do not have an EmitContext
6971 The idea is to flag explicitly that at that point in time, it is
6972 known that the conversion will not trigger the delegate checking
6973 code in implicit conversions (which requires a valid
6976 Everywhere: pass new EmitContext parameter since
6977 ImplicitStandardConversionExists now requires it to check for
6978 anonymous method conversions.
6980 (Convert.ImplicitStandardConversionExists): If the type of an
6981 expression is the anonymous_method_type, and the type is a
6982 delegate, we invoke the AnonymousMethod.Compatible method to check
6983 whether an implicit conversion is possible.
6985 (Convert.ImplicitConversionStandard): Only do implicit method
6986 group conversions if the language level is not ISO_1.
6988 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6989 MethodInfo for the Invoke method. used by Delegate and
6992 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6993 method conversions if the target type is a delegate.
6995 Removed extra debugging nops.
6997 (LocalVariableReference): Turn the `local_info' into a public
7000 Add `prepared' field, the same hack used for FieldExprs to cope
7001 with composed assignments, as Local variables do not necessarily
7002 operate purely on the stack as they used to: they can be captured
7005 Add `temp' for a temporary result, like fields.
7007 Refactor DoResolve and DoResolveLValue into DoResolveBase.
7009 It now copes with Local variables that are captured and emits the
7010 proper instance variable to load it from a field in the captured
7013 (ParameterReference.DoResolveBase): During the resolve phase,
7014 capture parameters if we are in an anonymous method.
7016 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7017 anonymous method, use the EmitContext helper routines to emit the
7018 parameter reference.
7020 * iterators.cs: Set RemapToProxy to true/false during the
7023 * parameters.cs (GetParameterByName): New helper method.
7025 * typemanager.cs (anonymous_method_type) a new type that
7026 represents an anonyous method. This is always an internal type,
7027 used as a fencepost to test against the anonymous-methodness of an
7030 2004-10-20 Marek Safar <marek.safar@seznam.cz>
7032 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7034 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7036 2004-11-10 Martin Baulig <martin@ximian.com>
7038 * expression.cs (Invocation.BetterFunction): If two methods have
7039 equal parameter types, but only one of them is generic, the
7040 non-generic one wins.
7041 (New.DoResolve): Don't set `is_struct' to false if we're a generic
7042 instance; just use `Type.IsValueType' to determine whether
7043 something is a struct or not.
7044 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7045 so we can be called multiple times.
7047 2004-11-10 Martin Baulig <martin@ximian.com>
7049 * generic.cs (TypeParameter.DefineConstraints): New public method.
7050 (TypeParameter.CheckAccessLevel): Override this and return true.
7051 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7052 override ResolveType() anymore.
7053 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7055 2004-11-10 Martin Baulig <martin@ximian.com>
7057 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7058 call DeclSpace.ResolveNestedType() on it.
7060 2004-11-10 Martin Baulig <martin@ximian.com>
7062 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7063 non-null, call ParameterModifier() on it.
7065 2004-11-10 Martin Baulig <martin@ximian.com>
7068 (Iterators): Added `current_type' and `this_type' fields.
7069 (Iterators.DefineIterator): Create a new EmitContext and store it
7070 in `ec'; compute `this_type'.
7072 2004-11-10 Martin Baulig <martin@ximian.com>
7075 (TypeManager.IsPrivateAccessible): New public method.
7076 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7078 2004-11-10 Martin Baulig <martin@ximian.com>
7080 * class.cs (TypeContainer.DefineType): Call
7081 TypeBuilder.DefineGenericParameters() before resolving the type
7083 (MethodData.parent_method): New protected field.
7084 (MethodData..ctor): Added `MethodInfo parent_method' argument.
7085 (MethodData.Define): Compute `parent_method'.
7088 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7089 (MemberCore.GetClsCompliantAttributeValue): Likewise.
7090 (DeclSpace.ec): New protected field; store the EmitContext here.
7091 (DeclSpace.EmitContext): New public property.
7092 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7093 (DeclSpace.ResolveNestedType): New public method.
7094 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7095 (DeclSpace.NestedAccessible): Added `Type tb' argument.
7096 (DeclSpace.FamilyAccessible): Likewise.
7097 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7098 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7101 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7104 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7105 (Enum.Emit): Don't create a new EmitContext.
7107 2004-10-18 Martin Baulig <martin@ximian.com>
7109 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7110 `Type' directly, but call ResolveType() on it.
7111 (Catch.Resolve): Likewise.
7112 (Foreach.Resolve): Likewise.
7114 2004-10-18 Martin Baulig <martin@ximian.com>
7116 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7117 `Type' directly, but call ResolveType() on it.
7118 (Probe.DoResolve): Likewise.
7119 (ArrayCreation.LookupType): Likewise.
7120 (TypeOf.DoResolve): Likewise.
7121 (SizeOf.DoResolve): Likewise.
7123 2004-10-18 Raja R Harinath <rharinath@novell.com>
7125 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7128 2004-10-17 John Luke <john.luke@gmail.com>
7130 * class.cs (Operator.GetSignatureForError): use CSharpName
7132 * parameter.cs (Parameter.GetSignatureForError): Returns
7133 correct name even if was not defined.
7135 2004-10-13 Raja R Harinath <rharinath@novell.com>
7138 * class.cs (TypeContainer.EmitContext): New property.
7139 (DefineNestedTypes): Create an emitcontext for each part.
7140 (MethodCore.DoDefineParameters): Use container's emitcontext.
7141 Pass type array to InternalParameters.
7142 (MemberBase.DoDefine): Use container's emitcontext.
7143 (FieldMember.Define): Likewise.
7144 (Event.Define): Likewise.
7145 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7146 Pass type array to InternalParameters.
7147 (SetIndexerMethod.GetParameterInfo): Likewise.
7148 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7149 * delegate.cs (Define): Pass emitcontext to
7150 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7151 array to InternalParameters.
7152 * expression.cs (ParameterReference.DoResolveBase): Pass
7153 emitcontext to GetParameterInfo.
7154 (ComposedCast.DoResolveAsTypeStep): Remove check on
7155 ec.ResolvingTypeTree.
7156 * parameter.cs (Parameter.Resolve): Change argument to
7157 EmitContext. Use ResolveAsTypeTerminal.
7158 (Parameter.GetSignature): Change argument to EmitContext.
7159 (Parameters.ComputeSignature): Likewise.
7160 (Parameters.ComputeParameterTypes): Likewise.
7161 (Parameters.GetParameterInfo): Likewise.
7162 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7163 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7164 * support.cs (InternalParameters..ctor): Remove variant that takes
7166 * typemanager.cs (system_intptr_expr): New.
7167 (InitExpressionTypes): Initialize it.
7169 2004-10-12 Chris Toshok <toshok@ximian.com>
7171 * cs-parser.jay: fix location for try_statement and catch_clause.
7173 2004-10-18 Martin Baulig <martin@ximian.com>
7175 * class.cs (FieldMember.Define): Don't access the TypeExpr's
7176 `Type' directly, but call ResolveType() on it.
7177 (MemberBase.DoDefine): Likewise.
7179 * expression.cs (New.DoResolve): Don't access the TypeExpr's
7180 `Type' directly, but call ResolveType() on it.
7181 (ComposedCast.DoResolveAsTypeStep): Likewise.
7183 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7184 `Type' directly, but call ResolveType() on it.
7186 2004-10-17 John Luke <john.luke@gmail.com>
7188 * class.cs (Operator.GetSignatureForError): use CSharpName
7190 * parameter.cs (Parameter.GetSignatureForError): Returns
7191 correct name even if was not defined.
7193 2004-10-13 Raja R Harinath <rharinath@novell.com>
7196 * class.cs (TypeContainer.EmitContext): New property.
7197 (DefineNestedTypes): Create an emitcontext for each part.
7198 (MethodCore.DoDefineParameters): Use container's emitcontext.
7199 Pass type array to InternalParameters.
7200 (MemberBase.DoDefine): Use container's emitcontext.
7201 (FieldMember.Define): Likewise.
7202 (Event.Define): Likewise.
7203 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7204 Pass type array to InternalParameters.
7205 (SetIndexerMethod.GetParameterInfo): Likewise.
7206 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7207 * delegate.cs (Define): Pass emitcontext to
7208 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7209 array to InternalParameters.
7210 * expression.cs (ParameterReference.DoResolveBase): Pass
7211 emitcontext to GetParameterInfo.
7212 (ComposedCast.DoResolveAsTypeStep): Remove check on
7213 ec.ResolvingTypeTree.
7214 * parameter.cs (Parameter.Resolve): Change argument to
7215 EmitContext. Use ResolveAsTypeTerminal.
7216 (Parameter.GetSignature): Change argument to EmitContext.
7217 (Parameters.ComputeSignature): Likewise.
7218 (Parameters.ComputeParameterTypes): Likewise.
7219 (Parameters.GetParameterInfo): Likewise.
7220 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7221 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7222 * support.cs (InternalParameters..ctor): Remove variant that takes
7224 * typemanager.cs (system_intptr_expr): New.
7225 (InitExpressionTypes): Initialize it.
7227 2004-10-12 Chris Toshok <toshok@ximian.com>
7229 * cs-parser.jay: fix location for try_statement and catch_clause.
7231 2004-10-07 Raja R Harinath <rharinath@novell.com>
7233 More DeclSpace.ResolveType avoidance.
7234 * decl.cs (MemberCore.InUnsafe): New property.
7235 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7236 with newly created EmitContext.
7237 (FieldMember.Define): Likewise.
7238 * delegate.cs (Delegate.Define): Likewise.
7239 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7240 only if normal name-lookup fails.
7241 (TypeExpr.DoResolve): Enable error-checking.
7242 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7243 (SizeOf.DoResolve): Likewise.
7244 (ComposedCast.DoResolveAsTypeStep): Likewise.
7245 (StackAlloc.DoResolve): Likewise.
7246 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7247 (Block.Unsafe): New property.
7248 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7249 (Unsafe): Set 'unsafe' flag of contained block.
7250 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7251 (Fixed.Resolve): Likewise.
7252 (Catch.Resolve): Likewise.
7253 (Using.ResolveLocalVariableDecls): Likewise.
7254 (Foreach.Resolve): Likewise.
7256 2004-10-05 John Luke <john.luke@gmail.com>
7258 * cs-parser.jay: add location to error CS0175
7260 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7262 * ecore.cs (Expression.Constantity): Add support for turning null
7265 * const.cs (Const.Define): Allow constants to be reference types
7266 as long as the value is Null.
7268 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7270 * namespace.cs (NamespaceEntry.Using): No matter which warning
7271 level is set, check if this namespace name has already been added.
7273 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7275 * expression.cs: reftype [!=]= null should always use br[true,false].
7278 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7281 * attribute.cs: Enum conversion moved to
7282 GetAttributeArgumentExpression to be applied to the all
7285 2004-10-01 Raja R Harinath <rharinath@novell.com>
7287 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7288 * class.c (TypeContainer.DefineType): Flag error if
7289 base types aren't accessible due to access permissions.
7290 * decl.cs (DeclSpace.ResolveType): Move logic to
7291 Expression.ResolveAsTypeTerminal.
7292 (DeclSpace.ResolveTypeExpr): Thin layer over
7293 Expression.ResolveAsTypeTerminal.
7294 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7295 Refactor code into NestedAccess. Use it.
7296 (DeclSpace.NestedAccess): New.
7297 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7298 argument to silence errors. Check access permissions.
7299 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7300 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7301 (Cast.DoResolve): Likewise.
7302 (New.DoResolve): Likewise.
7303 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7304 (TypeOf.DoResolve): Likewise.
7306 * expression.cs (Invocation.BetterConversion): Return the Type of
7307 the better conversion. Implement section 14.4.2.3 more faithfully.
7308 (Invocation.BetterFunction): Make boolean. Make correspondence to
7309 section 14.4.2.2 explicit.
7310 (Invocation.OverloadResolve): Update.
7311 (Invocation): Remove is_base field.
7312 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7313 (Invocation.Emit): Likewise.
7315 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7317 * cs-parser.jay: Reverted 642 warning fix.
7319 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7322 * decl.cs (FindMemberWithSameName): Indexer can have more than
7325 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7327 * expression.cs (LocalVariableReference.DoResolveLValue):
7328 Do not report warning 219 for out values.
7329 (EmptyExpression.Null): New member to avoid extra allocations.
7331 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7333 * cs-parser.jay: Fix wrong warning 642 report.
7335 * cs-tokenizer.cs (CheckNextToken): New helper;
7336 Inspect next character if is same as expected.
7338 2004-09-23 Martin Baulig <martin@ximian.com>
7340 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7341 (Convert.ImplicitReferenceConversionExists): Likewise.
7343 2004-11-09 Raja R Harinath <rharinath@novell.com>
7345 * Makefile (DISTFILES): Comment out a few missing files.
7347 2004-10-29 Raja R Harinath <rharinath@novell.com>
7349 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7350 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
7351 (gmcs.exe): Invoke bootstrap-libs.
7352 (clean-local): Clean the net_2_0_bootstrap profile too.
7353 (PROGRAM_INSTALL_DIR): New.
7354 (install-local): Use it.
7356 2004-10-13 Martin Baulig <martin@ximian.com>
7358 * generic.cs (TypeManager.InflatedConstraints): New nested class.
7359 (TypeParameter.DefineType): If we're a method type parameter and
7360 that method is overriding something, "inflate" its constraints.
7362 2004-10-12 Martin Baulig <martin@ximian.com>
7364 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7365 and have type arguments, create and resolve a ConstructedType.
7367 2004-10-12 Martin Baulig <martin@ximian.com>
7369 * decl.cs (MemberCache.FindMemberToOverride): Use
7370 TypeManager.IsEqual() to compare the parameters and Type.Equals()
7371 to compare the invocationType.
7373 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7374 When comparing two type parameters, only do the signature-only
7375 comparision for method type parameters.
7377 2004-10-11 Martin Baulig <martin@ximian.com>
7379 * report.cs: Don't make --fatal abort on warnings, we have
7380 -warnaserror for that.
7382 2004-10-11 Martin Baulig <martin@ximian.com>
7385 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7386 (TypeManager.IsEqual): Call ourself recursively instead of using
7389 2004-10-11 Martin Baulig <martin@ximian.com>
7391 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7392 on our own type parameters, not on the ones we inherit from a containing
7395 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7398 * generic.cs (TypeParameter.Define): We may only be called once.
7400 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7401 instead of TypeManager.IsEqual().
7403 2004-09-28 Martin Baulig <martin@ximian.com>
7406 (GenericConstraints.EffectiveBaseClass): New public property.
7407 (TypeParameter.GenericConstraints): New public property.
7408 (ConstructedType.CheckConstraints): Improved.
7410 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7411 (Convert.TypeParameterConversion): New private method; use this in
7412 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7413 for all conversions related to type parameters.
7415 2004-09-24 Martin Baulig <martin@ximian.com>
7417 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7418 type parameter conversions for type parameters which are known to
7421 2004-09-24 Martin Baulig <martin@ximian.com>
7423 * generic.cs (GenericConstraints): Added `IsReferenceType' and
7424 `IsValueType' properties.
7426 * support.cs (ReflectionConstraints): Use
7427 Type.GetGenericParameterConstraints() instead of the old hack.
7429 2004-09-24 Martin Baulig <martin@ximian.com>
7431 * generic.cs (GenericConstraints): Moved here and made it an
7434 * support.cs (GenericConstraints): Moved to generic.cs.
7436 2004-09-24 Martin Baulig <martin@ximian.com>
7439 (ReflectionConstraints): Un-nested this class and made it public.
7442 (TypeManager.GetTypeParameterConstraints): New public method.
7443 (TypeManager.HasConstructorConstraint): Use the attributes.
7445 2004-09-24 Martin Baulig <martin@ximian.com>
7447 * support.cs (GenericConstraints): Replaced `HasConstructor',
7448 `IsReferenceType' and `IsValueType' with `Attributes'.
7449 (ReflectionParameters.ReflectionConstraints): Removed the Create()
7450 method and made the .ctor public.
7452 * generic.cs (Constraints.Attributes): New public property.
7453 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7454 `IsReferenceType' -> `HasReferenceTypeConstraint' and
7455 `IsValueType' -> `HasValueTypeConstraint'.
7457 2004-09-23 Martin Baulig <martin@ximian.com>
7459 * generic.cs (Constraints): Reflect latest runtime changes.
7461 2004-09-23 Martin Baulig <martin@ximian.com>
7463 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7464 (Convert.ImplicitReferenceConversionExists): Likewise.
7466 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7468 * class.cs (Operator.Define): Add error 448 and 559 report.
7470 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7472 * class.cs (MemberBase.IsTypePermitted): New protected
7473 method for checking error CS0610.
7475 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7477 * class.cs (TypeContainer.HasExplicitLayout): New property
7478 Returns whether container has StructLayout attribute set Explicit.
7479 (FieldMember): New abstract class for consts and fields.
7480 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7481 (Field): Reuse FieldMember.
7483 * const.cs (Const): Reuse FieldMember.
7485 * rootcontext.cs: EmitConstants call moved to class.
7487 2004-09-22 Martin Baulig <martin@ximian.com>
7489 Marek and me just fixed one of our oldest bugs: #28562 :-)
7491 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7493 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7494 we're an EnumConstant, just return that.
7495 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7496 an EnumConstant. In this case, we need to use GetValueAsEnumType()
7497 to get the value which'll actually be written into the attribute.
7498 However, we have to use GetValue() to access the attribute's value
7501 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7503 * constant.cs (Constant.IsNegative): New abstract property
7506 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7507 (StackAlloc.DoResolve): Reused IsNegative.
7509 2004-09-22 Martin Baulig <martin@ximian.com>
7511 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7512 public method; like LookupTypeContainer, but also works for
7515 * report.cs (Report.SymbolRelatedToPreviousError): Use
7516 TypeManager.LookupGenericTypeContainer().
7518 2004-09-22 Martin Baulig <martin@ximian.com>
7520 Thanks to Peter Sestoft for this bug report.
7522 * expression.cs (Conditional): If both the `trueExpr' and the
7523 `falseExpr' is a NullLiteral, return a NullLiteral.
7525 2004-09-22 Martin Baulig <martin@ximian.com>
7527 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7528 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7529 for the "get_Current" call.
7531 2004-09-21 Martin Baulig <martin@ximian.com>
7533 * convert.cs (Convert.ImplicitReferenceConversion): When
7534 converting to an interface type, first check whether we're
7535 converting from a reference type.
7537 2004-09-14 Martin Baulig <martin@ximian.com>
7539 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7541 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7544 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7545 called and is obsolete then this member suppress message
7546 when call is inside next [Obsolete] method or type.
7548 * expression.cs: Use TestObsoleteMethodUsage member.
7550 2004-09-14 Martin Baulig <martin@ximian.com>
7552 * genericparser.cs: Removed.
7554 2004-09-13 Marek Safar <marek.safar@seznam.cz>
7556 * class.cs (MethodCore.CheckBase): Fix bug #65757.
7558 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7560 * attribute.cs (Attribute.Resolve): Add error 653 report.
7562 * class.cs (Class.ApplyAttributeBuilder): Add error 641
7564 (Method.ApplyAttributeBuilder): Add error 685 report.
7565 (Operator.Define): Add error 564 report.
7567 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7569 * expression.cs (Invocation.DoResolve): Add error
7572 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7575 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7577 * class.cs (ConstructorInitializer.Resolve):
7578 Wrong error number (515->516).
7580 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7582 * class.cs (Indexer.Define): Add error 631 report.
7584 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7586 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7588 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7590 * expression.cs (Probe.DoResolve): Add error CS0241 report.
7592 2004-09-10 Marek Safar <marek.safar@seznam.cz>
7594 * cs-parser.jay: Added error CS0241 report.
7596 2004-09-10 Raja R Harinath <rharinath@novell.com>
7598 * cs-parser.jay (fixed_statement): Introduce a scope for the
7599 declaration in the 'fixed' statement.
7601 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7603 * cs-parser.jay: Added CS0230 error report.
7605 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7607 * cs-parser.jay: Added errors CS0231 and CS0257 report.
7609 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7611 * expression.cs (Argument.Resolve): Added error CS0192 and
7614 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7616 C# 2.0 #pragma warning feature
7618 * cs-tokenizer.cs (PreProcessPragma): New method;
7619 Handles #pragma directive.
7621 * report.cs (WarningRegions): New class; Support
7622 class for #pragma warning directive. It tests whether
7623 warning is enabled for a given line.
7625 2004-09-08 Miguel de Icaza <miguel@ximian.com>
7627 * const.cs: Add more descriptive error report, tahnks to
7630 2004-09-08 Marek Safar <marek.safar@seznam.cz>
7632 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7634 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7636 * expression.cs: Apply patch from Ben: Remove dead code from
7637 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7638 as that code just threw an exception anwyays.
7640 * const.cs: Remove the call to the turnintoconstant, for details
7643 * literal.cs: The type of the null-literal is the null type; So
7644 we use a placeholder type (literal.cs:System.Null, defined here)
7647 * expression.cs (Conditional.DoResolve): Remove some old code that
7648 is no longer needed, conversions have been fixed.
7650 (ArrayCreationExpression.DoResolve): Return false if we fail to
7651 resolve the inner expression.
7653 2004-09-07 Raja R Harinath <rharinath@novell.com>
7656 * cs-parser.jay (delegate_declaration): Record a delegate
7657 declaration as a type declaration.
7658 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7660 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7662 * parameter.cs: Do not crash if the type can not be resolved.
7664 * expression.cs: Report errors with unsafe pointers, fixes #64896
7666 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7668 * expression.cs: Pointer arith always needs to do a conv.i
7669 if the operand is a long. fix 65320
7671 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7673 Fixed cs0619-37.cs, cs0619-38.cs
7675 * enum.cs (GetObsoleteAttribute): Removed.
7677 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7678 on Enum member is double staged. The first is tested member
7681 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7683 Fixed #56986, #63631, #65231
7685 * class.cs: (TypeContainer.AddToMemberContainer): New method,
7686 adds member to name container.
7687 (TypeContainer.AddToTypeContainer): New method, adds type to
7689 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7690 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7691 AddOperator): Simplified by reusing AddToMemberContainer.
7692 (TypeContainer.UserDefinedStaticConstructor): Changed to property
7694 (Method.CheckForDuplications): Fixed implementation to test all
7696 (MemberBase): Detection whether member is explicit interface
7697 implementation is now in constructor.
7698 (MemberBase.UpdateMemberName): Handles IndexerName.
7699 (Accessor): Changed to keep also location information.
7700 (AbstractPropertyEventMethod): Is derived from MemberCore.
7701 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7702 will be emited or not.
7703 (PropertyBase.AreAccessorsDuplicateImplementation):
7704 Tests whether accessors are not in collision with some method.
7705 (Operator): Is derived from MethodCore to simplify common
7708 * decl.cs (Flags.TestMethodDuplication): Test for duplication
7710 (DeclSpace.AddToContainer): Adds the member to defined_names
7711 table. It tests for duplications and enclosing name conflicts.
7713 * enum.cs (EnumMember): Clean up to reuse the base structures
7715 2004-09-03 Martin Baulig <martin@ximian.com>
7717 Merged latest changes into gmcs. Please keep this comment in
7718 here, it makes it easier for me to see what changed in MCS since
7719 the last time I merged.
7721 2004-09-03 Martin Baulig <martin@ximian.com>
7723 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7724 into TypeContainer, to make partial classes work again.
7726 2004-09-03 Martin Baulig <martin@ximian.com>
7728 * rootcontext.cs (RootContext.V2): Removed.
7730 2004-03-23 Martin Baulig <martin@ximian.com>
7732 * expression.cs (Invocation.OverloadResolve): Added `bool
7733 may_fail' argument and use it instead of the Location.IsNull() hack.
7735 2004-09-09 Martin Baulig <martin@ximian.com>
7737 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
7739 2004-09-09 Martin Baulig <martin@ximian.com>
7741 * generic.cs (TypeParameter.DefineType): Added support for
7742 explicit interface methods.
7744 2004-09-09 Martin Baulig <martin@ximian.com>
7746 * README.Changes: New document. Started to list important changes
7747 between MCS and GMCS here.
7749 2004-09-08 Martin Baulig <martin@ximian.com>
7752 (TypeContainer.CheckRecursiveDefinition): New protected method.
7753 (TypeContainer.DefineType): Move the CS0146 check into
7754 CheckRecursiveDefinition().
7756 2004-09-06 Martin Baulig <martin@ximian.com>
7758 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
7759 types for the constructor constraint.
7761 2004-09-03 Martin Baulig <martin@ximian.com>
7763 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7764 into TypeContainer, to make partial classes work again.
7766 2004-09-03 Martin Baulig <martin@ximian.com>
7768 * rootcontext.cs (RootContext.V2): Removed.
7770 2004-03-23 Martin Baulig <martin@ximian.com>
7772 * expression.cs (Invocation.OverloadResolve): Added `bool
7773 may_fail' argument and use it instead of the Location.IsNull() hack.
7775 2004-09-03 Martin Baulig <martin@ximian.com>
7777 Merged latest changes into gmcs. Please keep this comment in
7778 here, it makes it easier for me to see what changed in MCS since
7779 the last time I merged.
7781 2004-09-03 Raja R Harinath <rharinath@novell.com>
7784 * expression.cs (BetterConversion): Don't allow either conversion
7785 to be null. Remove redundant implicit conversion test when 'q ==
7786 null' -- when this function is invoked, we already know that the
7787 implicit conversion exists.
7788 (BetterFunction): Assume that 'best' is non-null. Remove
7789 redundant reimplementation of IsApplicable when 'best' is null.
7790 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7791 number of arguments.
7792 (IsAncestralType): Extract from OverloadResolve.
7793 (OverloadResolve): Make robust to the MethodGroupExpr being
7794 unsorted. Implement all the logic of Section 14.5.5.1, and
7795 support overloading of methods from multiple applicable types.
7796 Clean up logic somewhat. Don't pass null methods to BetterFunction.
7798 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7799 (RealError, Warning): Append type of report to related symbol.
7801 2004-09-03 Marek Safar <marek.safar@seznam.cz>
7803 * enum.cs: Fixed CLS-Compliance checks for enum members.
7804 Error tests cs3008-8.cs, cs3014-8.cs
7806 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7808 Fixed bug #62342, #63102
7809 * class.cs: ImplementIndexer uses member.IsExplicitImpl
7810 like ImplementMethod.
7812 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7814 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7817 2004-09-02 Martin Baulig <martin@ximian.com>
7819 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7820 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7823 2004-09-01 Marek Safar <marek.safar@seznam.cz>
7825 C# 2.0 Static classes implemented
7827 * class.cs (TypeContainer): instance_constructors,
7828 initialized_fields, initialized_static_fields,
7829 default_constructor, base_inteface_types are protected to be
7830 accessible from StaticClass.
7831 (TypeContainer.DefineDefaultConstructor): New virtual method
7832 for custom default constructor generating
7833 (StaticClass): New class to handle "Static classes" feature.
7835 * cs-parser.jay: Handle static keyword on class like instance
7838 * driver.cs: Added "/langversion" command line switch with two
7839 options (iso-1, default).
7841 2004-08-31 Marek Safar <marek.safar@seznam.cz>
7843 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7845 2004-08-31 Miguel de Icaza <miguel@ximian.com>
7847 * delegate.cs: Style.
7849 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
7851 * delegate.cs: Add seperate instance expr field for miguel.
7853 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7855 * PointerArithmetic (Resolve): make sure we are not doing
7856 pointer arith on void*. Also, make sure we are resolved
7857 by not setting eclass until resolve.
7859 All callers: Make sure that PointerArithmetic gets resolved.
7861 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7863 * ArrayCreation (LookupType): If the type does not resolve
7864 to an array, give an error.
7866 2004-08-27 Marek Safar <marek.safar@seznam.cz>
7868 * statement.cs (Try.Resolve): Fixed bug #64222
7870 2004-08-27 Martin Baulig <martin@ximian.com>
7873 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7876 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7878 * ecore.cs (Constantify): Get underlying type via
7879 System.Enum.GetUnderlyingType to avoid StackOverflow on the
7880 Windows in special cases.
7882 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7884 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7885 for obtaining also private methods.
7886 (GetRemoveMethod): Used GetRemoveMethod (true)
7887 for obtaining also private methods.
7889 2004-09-02 Martin Baulig <martin@ximian.com>
7891 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7892 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7895 2004-08-27 Martin Baulig <martin@ximian.com>
7898 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7901 2004-08-25 Martin Baulig <martin@ximian.com>
7903 * support.cs (ReflectionParameters..ctor): If this is a generic
7904 method, retrieve and store its type parameters.
7905 (InternalParameters..ctor): Added `TypeParameter[]' argument.
7906 (ReflectionParameters.GenericConstraints): The argument specifies
7907 the type parameter, not the method parameter.
7908 (InternalParameters.GenericConstraints): Likewise.
7910 * generic.cs (TypeParameter.DefineType): Correctly handle
7911 constraints wrt. generic methods in interfaces and their
7914 2004-08-24 Martin Baulig <martin@ximian.com>
7916 * generic.cs (TypeParameter.IsSubclassOf): New public method.
7917 (Constraints.IsSubclassOf): New internal method.
7919 * typemanager.cs (TypeManager.FindMembers): Added special support
7920 for GenericTypeParameterBuilder's.
7921 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
7924 2004-08-24 Martin Baulig <martin@ximian.com>
7927 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7928 this for accessibility checks.
7929 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7930 IsNestedFamilyAccessible.
7931 (TypeManager.IsSubclassOf): New method, do what the name actually
7934 2004-08-24 Martin Baulig <martin@ximian.com>
7936 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
7937 as a SimpleName, include the generic arity.
7939 2004-08-24 Martin Baulig <martin@ximian.com>
7941 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7942 MethodAttributes.HideBySig for operators.
7944 2004-08-23 Martin Baulig <martin@ximian.com>
7946 Back to the old error reporting system :-)
7948 * report.cs (Message): Removed.
7949 (Report.MessageData, ErrorData, WarningData): Removed.
7950 (Report.Error, Warning): Back to the old system.
7952 2004-08-23 Martin Baulig <martin@ximian.com>
7954 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7956 * class.cs (TypeContainer.ParentContainer): New public virtual
7957 method; replaces the explicit interface implementation.
7958 (ClassPart.ParentContainer): Override.
7960 2004-08-23 Martin Baulig <martin@ximian.com>
7962 * statement.cs (Switch): Added support for constant switches; see
7963 #59428 or test-285.cs.
7965 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7968 * statement.cs (GetEnumeratorFilter): Removed useless
7969 logic because C# specs is strict. GetEnumerator must be
7972 2004-08-22 Martin Baulig <martin@ximian.com>
7974 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7975 a switch and may break, reset the barrier. Fixes #59867.
7977 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7979 CLS-Compliance speed up (~5% for corlib)
7981 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7982 New method. Tests container for CLS-Compliant names
7984 * class.cs (TypeContainer.VerifyClsName): New method.
7985 Checks whether container name is CLS Compliant.
7986 (Constructor): Implements IMethodData.
7988 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7989 low-case table for CLS Compliance test.
7990 (MemberCache.VerifyClsParameterConflict): New method.
7991 Checks method parameters for CS3006 error.
7993 * enum.cs (EnumMember): Is derived from MemberCore.
7994 (Enum.VerifyClsName): Optimized for better performance.
7996 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7998 * report.cs: Renamed Error_T to Error and changed all
8001 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8003 * class.cs (TypeContainer.IndexerArrayList): New inner class
8004 container for indexers.
8005 (TypeContainer.DefaultIndexerName): New constant for default
8006 indexer name. Replaced all "Item" with this constant.
8007 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8009 * typemanager.cs (TypeManager.default_member_ctor): Cache here
8010 DefaultMemberAttribute constructor.
8012 2004-08-05 Martin Baulig <martin@ximian.com>
8014 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8017 2004-08-05 Marek Safar <marek.safar@seznam.cz>
8019 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8020 multi platforms problem.
8022 * compiler.csproj: Included shared files.
8024 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8026 Fix bug 60333, 55971 in the more general way
8027 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8028 Added arg_type argument for constant conversion.
8029 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8031 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8034 * class.cs (TypeContainer ): New inner classes MethodArrayList,
8035 OperatorArrayList, MethodCoreArrayList for typecontainer
8036 containers. Changed class member types to these new types.
8037 (MethodArrayList.DefineMembers): Added test for CS0659.
8039 2004-08-04 Miguel de Icaza <miguel@ximian.com>
8041 * cfold.cs: Synchronize the folding with the code in expression.cs
8042 Binary.DoNumericPromotions for uint operands.
8044 * attribute.cs: Revert patch from Raja, it introduced a regression
8045 while building Blam-1.2.1 (hard to isolate a test case).
8047 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8051 (TypeContainer.Define): Renamed to DefineContainerMembers because of
8053 (MethodCore.parent_method): New member. The method we're overriding
8054 if this is an override method.
8055 (MethodCore.CheckBase): Moved from Method class and made common.
8056 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8058 (MethodCore.CheckForDuplications): New abstract method. For custom
8059 member duplication search in a container
8060 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8061 method and its return type.
8062 (Event.conflict_symbol): New member. Symbol with same name in the
8066 (MemberCache.FindMemberWithSameName): New method. The method
8067 is looking for conflict with inherited symbols.
8069 2004-08-04 Martin Baulig <martin@ximian.com>
8071 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8073 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8075 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8077 * report.cs (Message): New enum for better error, warning reference in
8079 (MessageData): New inner abstract class. It generally handles printing of
8080 error and warning messages.
8081 Removed unused Error, Warning, Message methods.
8083 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8085 Fix for cs0592-8.cs test
8087 (Attributable.ValidAttributeTargets): Made public.
8088 (Attribute.ExplicitTarget): New member for explicit target value.
8089 (Attribute.CheckTargets): Now we translate explicit attribute
8090 target to Target here.
8092 2004-08-03 Ben Maurer <bmaurer@ximian.com>
8094 * ecore.cs (MethodGroupExpr): new IsBase property.
8096 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8098 * delegate.cs (DelegateCreation): store a MethodGroupExpr
8099 rather than an instance expr.
8101 (DelegateCreation.Emit): Use the method group rather than
8102 the instance expression. Also, if you have base.Foo as the
8103 method for a delegate, make sure to emit ldftn, not ldftnvirt.
8105 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
8107 (NewDelegate.DoResolve): Only check for the existance of Invoke
8108 if the method is going to be needed. Use MethodGroupExpr.
8110 (NewDelegate.Emit): Remove, DelegateCreation implements this.
8112 * expression.cs: For pointer arith., make sure to use
8113 the size of the type, not the size of the pointer to
8116 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8119 * class.cs (Class): Added error CS0502 test.
8121 2004-08-03 John Luke <jluke@cfl.rr.com>
8122 Raja R Harinath <rharinath@novell.com>
8125 * attribute.cs (Attribute.complained_before): New flag.
8126 (Attribute.ResolveType, Attribute.Resolve),
8127 (Attribute.DefinePInvokeMethod): Set it.
8128 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8130 2004-08-03 Martin Baulig <martin@ximian.com>
8132 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8133 use a user-defined operator; we still need to do numeric
8134 promotions in case one argument is a builtin type and the other
8135 one has an implicit conversion to that type. Fixes #62322.
8137 2004-08-18 Martin Baulig <martin@ximian.com>
8139 * class.cs (Method.Define): Use the correct method name when
8140 creating the MethodBuilder for a generic method.
8142 2004-08-17 Martin Baulig <martin@ximian.com>
8144 * generic.cs (Constraints): Support type parameter constraints.
8146 2004-08-16 Martin Baulig <martin@ximian.com>
8148 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8149 (Token.GENERIC_DIMENSION): New token; this is returned if we
8150 encounter an unbound generic type in a typeof() expression.
8152 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8153 this token is only generated while parsing a typeof() expression.
8154 (typeof_expression): Removed the old unbound_type hack.
8156 * generic.cs (TypeArguments.IsUnbound): New public property.
8158 * decl.cs (MemberName): Added support for unbound types.
8160 2004-08-14 Martin Baulig <martin@ximian.com>
8163 (TypeManager.IsEqualGenericInstance): New static method.
8164 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8165 just used to check accessibility, so follow the rules of 26.1.6.
8167 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8168 ConstructedType instead of a TypeExpression if we have type arguments.
8170 * cs-parser.jay (typeof_expression): Support unbound generic types.
8172 * ecore.cs (UnboundTypeExpression): New public class.
8174 2004-08-12 Martin Baulig <martin@ximian.com>
8176 * typemanager.cs (TypeManager.IsNestedChildOf): Use
8177 TypeManager.IsEqual() rather than `=='.
8179 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8180 generic instances as well.
8182 2004-08-12 Martin Baulig <martin@ximian.com>
8184 * expression.cs (Invocation.InferType): We can only infer method
8185 type parameters. Fixes #62647.
8187 2004-08-11 Martin Baulig <martin@ximian.com>
8189 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8190 before resolving the base classes.
8192 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8194 * Makefile: install .mdb file too.
8196 2004-08-05 Martin Baulig <martin@ximian.com>
8198 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8199 initializer, the current type is just the TypeBuilder, not the
8200 instantiated generic type.
8201 (FieldExpr.IsFieldInitializer): New public property.
8203 2004-08-04 Martin Baulig <martin@ximian.com>
8205 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8207 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8209 2004-08-03 Martin Baulig <martin@ximian.com>
8211 * class.cs (MethodData.Define): If we're an explicit
8212 implementation, remove the generic arity from the type name.
8214 2004-08-03 Martin Baulig <martin@ximian.com>
8216 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8217 use a user-defined operator; we still need to do numeric
8218 promotions in case one argument is a builtin type and the other
8219 one has an implicit conversion to that type. Fixes #62322.
8221 2004-08-02 Martin Baulig <martin@ximian.com>
8223 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8225 (TypeContainer.GetClassBases): Return the unexpanded list of
8226 interfaces; we expand them later.
8227 (TypeContainer.DefineType): After creating the TypeBuilder, call
8228 TypeManager.ExpandInterfaces() to get an expanded and resolved
8231 * ecore.cs (TypeExpr.GetInterfaces): Removed
8233 * generics.cs (Constraints.InterfaceConstraints): Remove.
8234 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8235 register the interface constraints.
8238 (TypeManager.AddUserType): Removed the `ifaces' argument.
8239 (TypeManager.AddTypeParameter): Likewise.
8240 (TypeManager.AddUserInterface): Removed, was unused.
8241 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8242 `TypeExpr[]' array for the interfaces.
8243 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8244 has been defined, returns a list of the resolved interfaces types.
8245 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8246 (TypeManager.GetExplicitInterfaces): Likewise.
8248 2004-08-02 Martin Baulig <martin@ximian.com>
8250 * expression.cs (Invocation.EmitCall): If we're invoking a method
8251 on a type parameter, use the new `Constrained' prefix opcode.
8253 2004-08-02 Martin Baulig <martin@ximian.com>
8255 * statement.cs (LocalInfo.Flags): Added `IsThis'.
8256 (LocalInfo.IsThis): New public property.
8257 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8259 2004-08-01 Martin Baulig <martin@ximian.com>
8261 * class.cs (TypeContainer.GetClassBases): Don't set the default
8262 here since we may get called from GetPartialBases().
8263 (TypeContainer.DefineType): If GetClassBases() didn't return a
8264 parent, use the default one.
8266 2004-07-30 Martin Baulig <martin@ximian.com>
8268 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8270 * class.cs (SourceMethod): New public class, derive from the
8271 symbol writer's ISourceMethod.
8272 (Method): Use the new symbol writer API.
8274 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8275 as argument and use the new symbol writer.
8278 (SourceFile): Implement the symbol writer's ISourceFile.
8279 (Location.SymbolDocument): Removed.
8280 (Location.SourceFile): New public property.
8282 * symbolwriter.cs: Use the new symbol writer API.
8284 2004-07-30 Raja R Harinath <rharinath@novell.com>
8286 * Makefile (install-local): Remove. Functionality moved to
8289 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8291 * Makefile: Install mcs.exe.config file together with mcs.exe.
8292 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8293 correct runtime version.
8295 2004-07-25 Martin Baulig <martin@ximian.com>
8298 (TypeContainer.RegisterOrder): Removed, this was unused.
8299 (TypeContainer, interface_order): Removed.
8300 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8301 TypeContainer as argument since we can also be called with a
8302 `PartialContainer' for a partial class/struct/interface.
8303 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8304 of checking whether we're an `Interface' - we could be a
8306 (PartialContainer.Register): Override; call
8307 AddClass()/AddStruct()/AddInterface() on our parent.
8309 * cs-parser.jay (interface_member_declaration): Add things to the
8310 `current_container', not the `current_class'.
8312 * rootcontext.cs (RegisterOrder): The overloaded version which
8313 takes an `Interface' was unused, removed.
8315 * typemanager.cs (TypeManager.LookupInterface): Return a
8316 `TypeContainer', not an `Interface'.
8317 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8318 contain a `PartialContainer' for an interface, so check it's
8319 `Kind' to figure out what it is.
8321 2004-07-25 Martin Baulig <martin@ximian.com>
8323 * class.cs (Class.DefaultTypeAttributes): New public constant.
8324 (Struct.DefaultTypeAttributes): Likewise.
8325 (Interface.DefaultTypeAttributes): Likewise.
8326 (PartialContainer.TypeAttr): Override this and add the
8327 DefaultTypeAttributes.
8329 2004-07-25 Martin Baulig <martin@ximian.com>
8331 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8332 we can just use the `Parent' field instead.
8334 2004-07-25 Martin Baulig <martin@ximian.com>
8336 * class.cs (TypeContainer.Emit): Renamed to EmitType().
8338 2004-07-25 Martin Baulig <martin@ximian.com>
8340 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8341 our parts before defining any methods.
8342 (TypeContainer.VerifyImplements): Make this virtual.
8343 (ClassPart.VerifyImplements): Override and call VerifyImplements()
8344 on our PartialContainer.
8346 2004-07-25 Martin Baulig <martin@ximian.com>
8348 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8350 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8351 argument, we can just use the `Parent' field instead.
8354 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
8355 (MemberBase.DoDefine): Likewise.
8357 2004-07-24 Martin Baulig <martin@ximian.com>
8359 * decl.cs (MemberCore.Parent): New public field.
8360 (DeclSpace.Parent): Moved to MemberCore.
8362 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8363 (MemberBase.ctor): Added TypeContainer argument, pass it to our
8365 (FieldBase, Field, Operator): Likewise.
8366 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8367 (EventField, Event): Likewise.
8369 2004-07-23 Martin Baulig <martin@ximian.com>
8371 * class.cs (PartialContainer): New public class.
8372 (ClassPart): New public class.
8373 (TypeContainer): Added support for partial classes.
8374 (TypeContainer.GetClassBases): Splitted some of the functionality
8375 out into GetNormalBases() and GetPartialBases().
8377 * cs-tokenizer.cs (Token.PARTIAL): New token.
8378 (Tokenizer.consume_identifier): Added some hacks to recognize
8379 `partial', but only if it's immediately followed by `class',
8380 `struct' or `interface'.
8382 * cs-parser.jay: Added support for partial clases.
8384 2004-07-23 Martin Baulig <martin@ximian.com>
8386 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8387 a `DeclSpace' and also made it readonly.
8388 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8389 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8390 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8392 * cs-parser.jay: Pass the `current_class', not the
8393 `current_container' (at the moment, this is still the same thing)
8394 to a new Method, Property, Event, Indexer or Constructor.
8396 2004-07-23 Martin Baulig <martin@ximian.com>
8398 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8399 and removed the `current_interface' one.
8400 (struct_declaration, class_declaration, interface_declaration):
8401 Set `current_class' to the newly created class/struct/interface;
8402 set their `Bases' and call Register() before parsing their body.
8404 2004-07-23 Martin Baulig <martin@ximian.com>
8406 * class.cs (Kind): New public enum.
8407 (TypeContainer): Made this class abstract.
8408 (TypeContainer.Kind): New public readonly field.
8409 (TypeContainer.CheckDef): New public method; moved here from
8411 (TypeContainer.Register): New public abstract method.
8412 (TypeContainer.GetPendingImplementations): New public abstract
8414 (TypeContainer.GetClassBases): Removed the `is_class' and
8415 `is_iface' parameters.
8416 (TypeContainer.DefineNestedTypes): Formerly known as
8418 (ClassOrStruct): Made this class abstract.
8420 * tree.cs (RootTypes): New public type.
8422 2004-07-20 Martin Baulig <martin@ximian.com>
8424 * tree.cs (Tree.RecordNamespace): Removed.
8425 (Tree.Namespaces): Removed.
8427 * rootcontext.cs (RootContext.IsNamespace): Removed.
8429 * cs-parser.jay (namespace_declaration): Just create a new
8430 NamespaceEntry here.
8432 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
8434 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8435 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8436 entry to make sure it runs in the correct runtime version.
8438 2004-07-18 Martin Baulig <martin@ximian.com>
8440 * generic.cs (ConstructedType.CheckConstraints): Improved
8441 constraints checking.
8443 2004-07-18 Martin Baulig <martin@ximian.com>
8445 * expression.cs (Invocation.BetterMethod): Call
8446 TypeManager.TypeToCoreType() on all types and removed my previous
8447 hack; we're already doig the right thing here.
8449 2004-07-17 Martin Baulig <martin@ximian.com>
8451 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8453 2004-07-16 Martin Baulig <martin@ximian.com>
8455 * iterators.cs: Added generics support.
8457 2004-07-16 Martin Baulig <martin@ximian.com>
8459 * iterators.cs: Rewrote this. We're now using one single Proxy
8460 class for both the IEnumerable and the IEnumerator interface and
8461 `Iterator' derives from Class so we can use the high-level API.
8463 * class.cs (TypeContainer.AddIterator): New method.
8464 (TypeContainer.DoDefineType): New protected virtual method, which
8465 is called from DefineType().
8466 (TypeContainer.DoDefineMembers): Call DefineType() and
8467 DefineMembers() on all our iterators.
8468 (TypeContainer.Emit): Call Emit() on all our iterators.
8469 (TypeContainer.CloseType): Call CloseType() on all our iterators.
8471 * codegen.cs (EmitContext.CurrentIterator): New public field.
8473 2004-07-15 Martin Baulig <martin@ximian.com>
8476 (TypeManager.not_supported_exception_type): New type.
8478 2004-07-14 Martin Baulig <martin@ximian.com>
8481 (TypeManager.generic_ienumerable_type): New type.
8482 (TypeManager.generic_ienumerator_type): New type.
8485 (RootContext.interfaces_first_stage): Added
8486 "System.Collections.Generic.IEnumerator`1" and
8487 "System.Collections.Generic.IEnumerable`1".
8489 2004-07-14 Martin Baulig <martin@ximian.com>
8491 * iterators.cs: Use real error numbers.
8493 2004-07-14 Martin Baulig <martin@ximian.com>
8495 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8496 requires this to be a System.Collection.IEnumerable and not a
8497 class implementing that interface.
8498 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
8500 2004-07-13 Marek Safar <marek.safar@seznam.cz>
8502 * class.cs: Fixed previous fix, it broke some error tests.
8504 2004-07-12 Martin Baulig <martin@ximian.com>
8506 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8509 2004-07-14 Martin Baulig <martin@ximian.com>
8511 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8512 an exclamation mark (!) for the generic arity to reflect the
8513 latest spec changes; ie. use "System.Collections.Generic.IList`1".
8515 2004-07-13 Martin Baulig <martin@ximian.com>
8517 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8518 specifiers being part of a type argument.
8520 2004-07-13 Martin Baulig <martin@ximian.com>
8522 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8523 name for generic types.
8525 2004-07-13 Martin Baulig <martin@ximian.com>
8527 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8530 2004-07-09 Miguel de Icaza <miguel@ximian.com>
8532 * assign.cs (LocalTemporary): Add new argument: is_address,If
8533 `is_address' is true, then the value that we store is the address
8534 to the real value, and not the value itself.
8536 * ecore.cs (PropertyExpr): use the new local temporary
8537 stuff to allow us to handle X.Y += z (where X is a struct)
8539 2004-07-08 Martin Baulig <martin@ximian.com>
8541 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8542 not always return, just like we're doing in Using.Resolve().
8544 2004-07-07 Miguel de Icaza <miguel@ximian.com>
8546 * cs-parser.jay (fixed_statement): flag this as Pinned.
8548 2004-07-06 Miguel de Icaza <miguel@ximian.com>
8550 * typemanager.cs (TypeManager): Removed MakePinned method, this
8551 mechanism is replaced with the .NET 2.x compatible mechanism of
8552 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8554 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
8555 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8556 `IsFixed' property which has a different meaning.
8558 2004-07-02 Raja R Harinath <rharinath@novell.com>
8560 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8561 visible from inside a nested class, not just the names of the
8562 immediately enclosing class.
8565 2004-06-24 Raja R Harinath <rharinath@novell.com>
8567 * expression.cs (BetterConversion): Remove buggy special-case
8568 handling of "implicit constant expression conversions". At this
8569 point, we already know that the conversion is possible -- we're
8570 only checking to see which is better.
8572 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8574 * cs-parser.jay: Added error CS0210 test.
8576 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8578 * cs-parser.jay: Added error CS0134 test.
8580 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8583 * cs-parser.jay: Added error CS0145 test.
8585 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8587 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8589 2004-06-23 Ben Maurer <bmaurer@ximian.com>
8591 * expression.cs (StackAlloc.Resolve): The argument may not
8592 be a constant; deal with this case.
8594 2004-06-23 Marek Safar <marek.safar@seznam.cz>
8596 * attribute.cs (IndexerName_GetIndexerName): Renamed to
8597 GetIndexerAttributeValue.
8598 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8600 * class.cs (Indexer.Define): Added error tests for CS0415,
8603 2004-06-23 Miguel de Icaza <miguel@ximian.com>
8605 * attribute.cs (Attribute.Resolve): Keep field code in sync with
8608 2004-06-23 Martin Baulig <martin@ximian.com>
8610 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8611 neither return nor throw, reset the barrier as well. Fixes #60457.
8613 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
8615 * class.cs : EventAttributes is now set to None by default.
8616 This fixes bug #60459.
8618 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8621 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8622 Don't throw exception but return null (it's sufficient now).
8624 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8626 * typemanager.cs (GetArgumentTypes): Faster implementation.
8628 2004-06-18 Martin Baulig <martin@ximian.com>
8630 * attribute.cs (Attribute.Resolve): Check whether we're an
8631 EmptyCast which a Constant child. Fixes #60333.
8633 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8635 * statement.cs (EmitCollectionForeach): Account for the fact that
8636 not all valuetypes are in areas which we can take the address of.
8637 For these variables, we store to a temporary variable. Also, make
8638 sure that we dont emit a `callvirt' on a valuetype method.
8640 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8642 * expression.cs (StackAlloc.DoReSolve): Added test for
8643 negative parameter (CS0247).
8645 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8648 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8650 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8653 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8656 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8658 Fix bug #58254 & cs1555.cs, cs1556.cs
8659 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8661 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8663 * cs-parser.jay: Added error CS1669 test for indexers.
8665 2004-06-18 Martin Baulig <martin@ximian.com>
8667 * generics.cs (GenericMethod.ctor): Don't take an Attributes
8668 argument. Fixes #60441.
8670 2004-06-16 Ben Maurer <bmaurer@ximian.com>
8671 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8672 The name needs to have the actual name of the method in order
8673 for other tests (such as the one in OverloadResolve for Invoke
8674 on a delegate) to work. As well, it does not really help
8675 error reporting because the method group had multiple methods.
8676 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8677 Make profiling work.
8679 2004-06-13 Martin Baulig <martin@ximian.com>
8681 * cs-parser.jay: Don't allow generic attributes.
8683 2004-06-13 Martin Baulig <martin@ximian.com>
8685 * class.cs (MemberBase.DoDefineBase): New protected method.
8686 (MemberBase.DoDefine): Compute the `flags' in the new
8687 DoDefineBase() which must be called first.
8688 (Method.Define): Call DoDefineBase() first so we have the flags
8689 when defining the generic method.
8691 * cs-parser.jay (interface_method_declaration): Support generic methods.
8693 2004-06-13 Martin Baulig <martin@ximian.com>
8695 * decl.cs (TypeName): Removed.
8696 (MemberName): Removed TypeName and MemberNow; now we just have
8699 * cs-parser.jay: Don't distinguish between type arguments and type
8700 parameters in the grammar and simplified the rules a bit. The
8701 reduce/reduce conflicts are now gone (except the one we inherited
8704 2004-06-11 Martin Baulig <martin@ximian.com>
8706 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8707 call this twice: for params and varargs methods.
8709 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8712 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8714 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8716 * attribute.cs (Attribute.GetValidTargets): Made public.
8719 (AbstractPropertyEventMethod): New class for better code sharing.
8720 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8722 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8724 2004-06-09 Martin Baulig <martin@ximian.com>
8726 * cs-parser.jay: Removed a reduce/reduce conflict.
8728 2004-06-03 Martin Baulig <martin@ximian.com>
8730 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
8731 GetSimpleName() and return a SimpleName.
8733 * ecore.cs (SimpleName.Arguments): New public field.
8734 (SimpleName): Added overloaded ctor which takes an additional
8735 TypeArguments argument.
8736 (SimpleName.SimpleNameResolve): Added support for generic methods.
8737 (MethodGroupExpr.ResolveGeneric): New public method. The code was
8738 formerly in MemberAccess.DoResolve(), but we also need it in
8739 SimpleNameResolve().
8741 * expression.cs (MemberAccess.DoResolve): Use the new
8742 MethodGroupExpr.ResolveGeneric().
8744 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8746 * decl.cs: If possible, use lookuptypedirect here. We can only do
8747 this if there is no `.' after the namespace. Avoids using
8748 LookupType, which does lots of slow processing.
8749 (FindNestedType) New method, does what it says :-).
8750 * namespace.cs: use LookupTypeDirect.
8751 * rootcontext.cs: use membercache, if possible.
8752 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8754 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8757 According to the spec,
8759 In a member access of the form E.I, if E is a single identifier,
8760 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8761 field, property, localvariable, or parameter with the same type as
8762 the meaning of E as a type-name (§3.8), then both possible
8763 meanings of E are permitted.
8765 We did not check that E as a simple-name had the same type as E as
8768 This trivial check gives us 5-7% on bootstrap time.
8770 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8772 * expression.cs (Invocation.OverloadResolve): Avoid the
8773 use of hashtables and boxing here by allocating on demand.
8775 2004-05-30 Martin Baulig <martin@ximian.com>
8777 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8778 we're doing a silent lookup. Don't try to lookup nested types in
8779 TypeManager.object_type (thanks to Ben Maurer).
8781 2004-05-30 Martin Baulig <martin@ximian.com>
8783 Committing a patch from Ben Maurer.
8785 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8787 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8789 * convert.cs: add a trivial cache for overload operator resolution.
8791 2004-05-31 Marek Safar <marek.safar@seznam.cz>
8794 (AttributeTester.GetObsoleteAttribute): Returns instance of
8795 ObsoleteAttribute when type is obsolete.
8798 (TypeContainer.VerifyObsoleteAttribute): Override.
8799 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8800 (MethodCode.VerifyObsoleteAttribute): Override.
8801 (MemberBase.VerifyObsoleteAttribute): Override.
8804 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8805 and report proper error.
8808 (Delegate.VerifyObsoleteAttribute): Override.
8811 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8812 and report proper error.
8813 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8816 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8820 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8821 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8822 Added test for ObsoleteAttribute.
8825 (Catch): Derived from Statement.
8827 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8829 * decl.cs: If possible, use lookuptypedirect here. We can only do
8830 this if there is no `.' after the namespace. Avoids using
8831 LookupType, which does lots of slow processing.
8832 (FindNestedType) New method, does what it says :-).
8833 * namespace.cs: use LookupTypeDirect.
8834 * rootcontext.cs: use membercache, if possible.
8835 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8837 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8840 According to the spec,
8842 In a member access of the form E.I, if E is a single identifier,
8843 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8844 field, property, localvariable, or parameter with the same type as
8845 the meaning of E as a type-name (§3.8), then both possible
8846 meanings of E are permitted.
8848 We did not check that E as a simple-name had the same type as E as
8851 This trivial check gives us 5-7% on bootstrap time.
8853 2004-05-30 Marek Safar <marek.safar@seznam.cz>
8855 Fixed bug #59071 & cs0160.cs
8856 * statement.cs (Try.Resolve): Check here whether order of catch
8857 clauses matches their dependencies.
8859 2004-05-30 Marek Safar <marek.safar@seznam.cz>
8862 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
8865 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8867 * expression.cs (Invocation.OverloadResolve): Avoid the
8868 use of hashtables and boxing here by allocating on demand.
8870 2004-05-30 Martin Baulig <martin@ximian.com>
8872 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8873 we're doing a silent lookup. Don't try to lookup nested types in
8874 TypeManager.object_type (thanks to Ben Maurer).
8876 2004-05-30 Martin Baulig <martin@ximian.com>
8878 Committing a patch from Ben Maurer.
8880 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8882 2004-05-29 Martin Baulig <martin@ximian.com>
8884 * class.cs (IMethodData.ShouldIgnore): New method.
8886 * typemanager.cs (TypeManager.MethodFlags): Don't take a
8887 `Location' argument, we don't need it anywhere. Use
8888 `IMethodData.ShouldIgnore ()' instead of
8889 `MethodData.GetMethodFlags ()'.
8890 (TypeManager.AddMethod): Removed.
8891 (TypeManager.AddMethod2): Renamed to AddMethod.
8893 2004-05-29 Martin Baulig <martin@ximian.com>
8895 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8897 * convert.cs (Convert.ImplicitReferenceConversion): If we're
8898 converting from a class type S to an interface type and we already
8899 have an object on the stack, don't box it again. Fixes #52578.
8901 2004-05-29 Martin Baulig <martin@ximian.com>
8903 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8904 Added support for `params' parameters. Fixes #59267.
8906 2004-05-29 Martin Baulig <martin@ximian.com>
8908 * literal.cs (NullPointer): Provide a private .ctor which sets
8909 `type' to TypeManager.object_type. Fixes #59048.
8911 2004-05-29 Martin Baulig <martin@ximian.com>
8913 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8914 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
8916 * ecore.cs (EventExpr.instance_expr): Make the field private.
8918 2004-05-26 Marek Safar <marek.safar@seznam.cz>
8920 Fixed bug #50080 & cs0214-2.cs
8921 * expression.cs (Cast.DoResolve): Check unsafe context here.
8923 * statement.cs (Resolve.DoResolve): Likewise.
8925 2004-05-26 Martin Baulig <martin@ximian.com>
8927 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8929 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8930 (RootContext.LookupType): Pass down the `silent' flag.
8932 2004-05-25 Martin Baulig <martin@ximian.com>
8935 (MethodGroupExpr.IdenticalTypeName): New public property.
8936 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8937 expression actually refers to a type.
8939 2004-05-25 Martin Baulig <martin@ximian.com>
8941 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8942 for #56176 and made it actually work.
8944 2004-05-25 Martin Baulig <martin@ximian.com>
8946 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8947 (FieldExpr, PropertyExpr): Override and implement
8948 CacheTemporaries. Fixes #52279.
8950 2004-05-25 Miguel de Icaza <miguel@ximian.com>
8952 * location.cs: In the new compiler listing a file twice is a
8953 warning, not an error.
8955 2004-05-24 Martin Baulig <martin@ximian.com>
8957 * enum.cs (Enum.DefineType): For the `BaseType' to be a
8958 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
8960 2004-05-24 Martin Baulig <martin@ximian.com>
8962 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8963 walking the `using' list. Fixes #53921.
8965 2004-05-24 Martin Baulig <martin@ximian.com>
8967 * const.cs (Const.LookupConstantValue): Added support for
8968 EmptyCast's; fixes #55251.
8970 2004-05-24 Martin Baulig <martin@ximian.com>
8972 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8973 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8974 which does the CS0135 check. The reason is that we first need to
8975 check whether the variable actually exists.
8977 2004-05-24 Martin Baulig <martin@ximian.com>
8979 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8980 than RootContext.LookupType() to find the explicit interface
8983 2004-05-24 Raja R Harinath <rharinath@novell.com>
8985 * Makefile: Simplify. Use executable.make.
8986 * mcs.exe.sources: New file. List of sources of mcs.exe.
8988 2004-05-24 Anders Carlsson <andersca@gnome.org>
8992 Use the invariant culture when doing String.Compare for CLS case
8995 2004-05-23 Martin Baulig <martin@ximian.com>
8997 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8998 don't have any dots. Fixes #52622, added cs0246-8.cs.
9000 * namespace.cs (NamespaceEntry.Lookup): Likewise.
9002 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9004 * class.cs (MemberBase.Define): Reuse MemberType member for
9005 resolved type. Other methods can use it too.
9007 2004-05-23 Martin Baulig <martin@ximian.com>
9009 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9010 the variable also exists in the current block (otherwise, we need
9011 to report a CS0103). Fixes #58670.
9013 2004-05-23 Martin Baulig <martin@ximian.com>
9015 * flowanalysis.cs (Reachability.Reachable): Compute this
9016 on-the-fly rather than storing it as a field.
9018 2004-05-23 Martin Baulig <martin@ximian.com>
9020 * flowanalysis.cs (Reachability.And): Manually compute the
9021 resulting `barrier' from the reachability.
9023 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9026 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9027 instance of ObsoleteAttribute when symbol is obsolete.
9030 (IMethodData): Extended interface for ObsoleteAttribute support.
9032 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9034 * attribute.cs: Fix bug #55970
9036 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9040 (GetObsoleteAttribute): New method. Creates the instance of
9042 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9043 ObsoleteAttribute when member is obsolete.
9044 (AttributeTester.Report_ObsoleteMessage): Common method for
9045 Obsolete error/warning reporting.
9048 (TypeContainer.base_classs_type): New member for storing parent type.
9051 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9052 for this MemberCore.
9054 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9056 * attribute.cs, const.cs: Fix bug #58590
9058 2004-05-21 Martin Baulig <martin@ximian.com>
9060 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9061 out parameters if the end of the method is unreachable. Fixes
9064 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9066 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9067 Hari was right, why extra method.
9069 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9071 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9073 2004-05-20 Martin Baulig <martin@ximian.com>
9075 * delegate.cs: Convert this file to Unix mode - like the original
9078 2004-05-20 Martin Baulig <martin@ximian.com>
9080 * attribute.cs: Convert this file to Unix mode - like the original
9083 2004-05-19 Marek Safar <marek.safar@seznam.cz>
9085 Fix bug #58688 (MCS does not report error when the same attribute
9088 * attribute.cs (Attribute.Emit): Distinction between null and default.
9090 2004-05-19 Raja R Harinath <rharinath@novell.com>
9092 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9093 of a top-level attribute without an attribute target.
9094 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
9096 (Attribute.Conditional_GetConditionName),
9097 (Attribute.Obsolete_GetObsoleteMessage): Update.
9098 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
9099 part of ScanForIndexerName.
9100 (Attribute.CanIgnoreInvalidAttribute): New function.
9101 (Attribute.ScanForIndexerName): Move to ...
9102 (Attributes.ScanForIndexerName): ... here.
9103 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9104 (Attributes.Search): New internal variant that can choose not to
9105 complain if types aren't resolved. The original signature now
9107 (Attributes.GetClsCompliantAttribute): Use internal variant, with
9108 complaints suppressed.
9109 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9110 only if it not useful.
9111 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9112 top-level for attributes that are shared between the assembly
9113 and a top-level class.
9114 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9115 * class.cs: Update to reflect changes.
9116 (DefineIndexers): Fuse loops.
9117 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
9118 a couple more variants of attribute names.
9120 2004-05-18 Marek Safar <marek.safar@seznam.cz>
9122 Fix bug #52585 (Implemented explicit attribute declaration)
9125 (Attributable.ValidAttributeTargets): New abstract method. It gets
9126 list of valid attribute targets for explicit target declaration.
9127 (Attribute.Target): It holds target itself.
9128 (AttributeSection): Removed.
9129 (Attribute.CheckTargets): New method. It checks whether attribute
9130 target is valid for the current element.
9133 (EventProperty): New class. For events that are declared like
9134 property (with add and remove accessors).
9135 (EventField): New class. For events that are declared like field.
9138 * cs-parser.jay: Implemented explicit attribute target declaration.
9140 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
9141 Override ValidAttributeTargets.
9144 (ReturnParameter): Class for applying custom attributes on
9146 (ParameterAtribute): New class. Class for applying custom
9147 attributes on the parameter type.
9149 2004-05-17 Miguel de Icaza <miguel@ximian.com>
9151 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9154 (Method): Allow UNSAFE here.
9156 * modifiers.cs: Support unsafe reporting.
9158 2004-05-17 Marek Safar <marek.safar@seznam.cz>
9160 * decl.cs: Fix bug #58478.
9162 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9164 * statement.cs: When checking for unreachable code on an EmptyStatement,
9165 set the location. Fixes bug #58488.
9167 2004-05-13 Miguel de Icaza <miguel@ximian.com>
9169 * driver.cs: Add -pkg handling.
9171 From Gonzalo: UseShelLExecute=false
9173 2004-05-12 Marek Safar <marek.safar@seznam.cz>
9176 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9178 (Attribute.IsClsCompliaceRequired): Moved to base for better
9180 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9181 when attribute is AttributeUsageAttribute.
9182 (Attribute.GetValidTargets): Simplified.
9183 (Attribute.GetAttributeUsage): New method returns AttributeUsage
9184 attribute for this type.
9185 (Attribute.ApplyAttributes): Method renamed to Emit and make
9187 (GlobalAttributeSection): New class for special handling of global
9188 attributes (assembly, module).
9189 (AttributeSection.Emit): New method.
9191 * class.cs: Implemented Attributable abstract methods.
9192 (MethodCore.LabelParameters): Moved to Parameter class.
9193 (Accessor): Is back simple class.
9194 (PropertyMethod): Implemented Attributable abstract class.
9195 (DelegateMethod): Implemented Attributable abstract class.
9196 (Event): New constructor for disctintion between normal Event
9197 and Event with accessors.
9199 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9201 * codegen.cs, const.cs, decl.cs, delegate.cs:
9202 (CommonAssemblyModulClass): Implemented Attributable abstract class
9205 * enum.cs: Implement IAttributeSupport interface.
9206 (EnumMember): New class for emum members. Implemented Attributable
9210 (ParameterBase): Is abstract.
9211 (ReturnParameter): New class for easier [return:] attribute handling.
9213 * typemanager.cs: Removed builder_to_attr.
9215 2004-05-11 Raja R Harinath <rharinath@novell.com>
9218 * attribute.cs (Attribute.GetPositionalValue): New function.
9219 * class.cs (TypeContainer.VerifyMembers): New function.
9220 (TypeContainer.Emit): Use it.
9221 (ClassOrStruct): New base class for Class and Struct.
9222 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
9223 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9225 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9226 then each non-static field should have a FieldOffset attribute.
9227 Otherwise, none of the fields should have a FieldOffset attribute.
9228 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
9229 and FieldOffset attributes.
9230 * typemanager.cs (TypeManager.struct_layout_attribute_type)
9231 (TypeManager.field_offset_attribute_type): New core types.
9232 (TypeManager.InitCoreTypes): Initialize them.
9234 2004-05-11 Michal Moskal <malekith@pld-linux.org>
9236 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9237 Return correct type.
9240 2004-05-09 Miguel de Icaza <miguel@ximian.com>
9242 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9243 be implicitly converted to ulong.
9245 * expression.cs: The logic for allowing operator &, | and ^ worked
9246 was wrong, it worked before because we did not report an error in
9247 an else branch. Fixes 57895.
9249 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9250 allow volatile fields to be reference types.
9252 2004-05-07 Miguel de Icaza <miguel@ximian.com>
9254 * driver.cs: Add support for /debug-
9256 2004-05-07 Raja R Harinath <rharinath@novell.com>
9258 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
9259 Add a 'complain' parameter to silence errors.
9260 (Attribute.Resolve): Update to changes. Put in sanity check to catch
9261 silently overlooked type-resolutions.
9262 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9264 (Attributes.Search): New function.
9265 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9266 (Attributes.GetAttributeFullName): Remove hack.
9267 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9268 Update to reflect changes.
9269 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9270 Use Attributes.Search instead of nested loops.
9272 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9275 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9276 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9277 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9279 * report.cs: (Report.Warning): Renamed to Warning_T because of
9280 parameter collision.
9282 2004-05-05 Raja R Harinath <rharinath@novell.com>
9284 * expression.cs (MemberAccess.ResolveMemberAccess):
9285 Exit with non-zero status after Report.Error.
9286 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9288 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9290 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9292 * support.cs: Don't hang when the file is empty.
9294 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9296 * support.cs: In SeekableStreamReader, compute the preamble size of the
9297 underlying stream. Position changes should take into account that initial
9300 2004-05-03 Todd Berman <tberman@sevenl.net>
9302 * driver.cs: remove unused GetSysVersion function.
9304 2004-05-03 Todd Berman <tberman@sevenl.net>
9306 * driver.cs: Remove the hack from saturday, as well as the hack
9307 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9308 link_paths to get that bit proper.
9310 2004-05-01 Todd Berman <tberman@sevenl.net>
9312 * driver.cs: Try a LoadFrom before a Load, this checks the current
9313 path. This is currently a bug in mono that is be fixed, however, this
9314 provides a workaround for now. This will be removed when the bug
9317 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9319 * CryptoConvert.cs: Updated to latest version. Fix issue with
9320 incomplete key pairs (#57941).
9322 2004-05-01 Todd Berman <tberman@sevenl.net>
9324 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9327 2004-04-30 Jackson Harper <jackson@ximian.com>
9329 * codegen.cs: Open keys readonly.
9331 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9333 * typemanager.cs: don't report cyclic struct layout when a struct
9334 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9335 which has 2 Pango.Rectangle fields.
9337 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9339 * expression.cs: Handle IntPtr comparisons with IL code
9340 rather than a method call.
9342 2004-04-29 Martin Baulig <martin@ximian.com>
9344 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9345 the list of PropertyInfo's in class hierarchy and find the
9346 accessor. Fixes #56013.
9348 2004-04-29 Martin Baulig <martin@ximian.com>
9350 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9352 2004-04-29 Martin Baulig <martin@ximian.com>
9354 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9356 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9358 2004-04-29 Martin Baulig <martin@ximian.com>
9360 * class.cs (ConstructorInitializer.Resolve): Check whether the
9361 parent .ctor is accessible. Fixes #52146.
9363 2004-04-29 Martin Baulig <martin@ximian.com>
9365 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9367 * statement.cs (Using.EmitLocalVariableDecls): Use
9368 TypeManager.idisposable_type, not typeof (IDisposable).
9369 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9371 2004-04-29 Martin Baulig <martin@ximian.com>
9373 * class.cs (Event.Define): Don't emit the field and don't set
9374 RTSpecialName and SpecialName for events on interfaces. Fixes
9377 2004-04-29 Raja R Harinath <rharinath@novell.com>
9379 Refactor Attribute.ApplyAttributes.
9380 * attribute.cs (Attributable): New base class for objects that can
9381 have Attributes applied on them.
9382 (Attribute): Make AttributeUsage fields public.
9383 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9384 (Attribute.IsInternalCall): New property.
9385 (Attribute.UsageAttr): Convert to a public read-only property.
9386 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9387 (Attribute.ResolveType, Attribute.Resolve)
9388 (Attribute.ScanForIndexerName): Update to reflect changes.
9389 (Attribute.CheckAttributeTarget): Re-format.
9390 (Attribute.ApplyAttributes): Refactor, to various
9391 Attributable.ApplyAttributeBuilder methods.
9392 * decl.cs (MemberCore): Make Attributable.
9393 * class.cs (Accessor): Make Attributable.
9394 (MethodData.ApplyAttributes): Use proper attribute types, not
9396 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9397 (TypeContainer.ApplyAttributeBuilder)
9398 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9399 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9400 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9401 (Operator.ApplyAttributeBuilder): New factored-out methods.
9402 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9403 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9404 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9405 * parameter.cs (ParameterBase): New Attributable base class
9406 that can also represent Return types.
9407 (Parameter): Update to the changes.
9409 2004-04-29 Jackson Harper <jackson@ximian.com>
9411 * driver.cs: Prefer the corlib system version when looking for
9412 assemblies in the GAC. This is still a hack, but its a better hack
9415 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9417 * decl.cs, enum.cs: Improved error 3005 reporting.
9419 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9420 (related_symbols): New private member for list of symbols
9421 related to reported error/warning.
9423 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9425 2004-04-29 Martin Baulig <martin@ximian.com>
9427 * ecore.cs (Expression.Constantify): If we're an enum and
9428 TypeManager.TypeToCoreType() doesn't give us another type, use
9429 t.UnderlyingSystemType. Fixes #56178.
9431 2004-04-29 Martin Baulig <martin@ximian.com>
9433 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9434 interfaces and for each interface, only add members directly
9435 declared in that interface. Fixes #53255.
9437 2004-04-28 Martin Baulig <martin@ximian.com>
9439 * expression.cs (ConditionalLogicalOperator): Use a temporary
9440 variable for `left' to avoid that we evaluate it more than once;
9443 2004-04-28 Martin Baulig <martin@ximian.com>
9445 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9448 2004-04-28 Martin Baulig <martin@ximian.com>
9450 * statement.cs (LocalInfo.Resolve): Check whether the type is not
9453 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9454 whether the type is not void (CS1547).
9456 2004-04-28 Martin Baulig <martin@ximian.com>
9458 * expression.cs (Unary.DoResolveLValue): Override this and report
9459 CS0131 for anything but Operator.Indirection.
9461 2004-04-28 Martin Baulig <martin@ximian.com>
9463 Committing a patch from Ben Maurer; see bug #50820.
9465 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9468 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9471 2004-04-28 Martin Baulig <martin@ximian.com>
9473 Committing a patch from Ben Maurer; see bug #50820.
9475 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9478 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9481 2004-04-28 Martin Baulig <martin@ximian.com>
9483 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9484 (Block.AddLabel): Call DoLookupLabel() to only search in the
9487 2004-04-28 Martin Baulig <martin@ximian.com>
9489 * cfold.cs (ConstantFold.BinaryFold): Added special support for
9490 comparing StringConstants and NullLiterals in Equality and Inequality.
9492 2004-04-28 Jackson Harper <jackson@ximian.com>
9494 * driver.cs: Attempt to load referenced assemblies from the
9495 GAC. This is the quick and dirty version of this method that
9496 doesnt take into account versions and just takes the first
9497 canidate found. Will be good enough for now as we will not have more
9498 then one version installed into the GAC until I update this method.
9500 2004-04-28 Martin Baulig <martin@ximian.com>
9502 * typemanager.cs (TypeManager.CheckStructCycles): New public
9503 static method to check for cycles in the struct layout.
9505 * rootcontext.cs (RootContext.PopulateTypes): Call
9506 TypeManager.CheckStructCycles() for each TypeContainer.
9507 [Note: We only need to visit each type once.]
9509 2004-04-28 Martin Baulig <martin@ximian.com>
9511 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9513 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9514 success and added `out object value'. Use a `bool resolved' field
9515 to check whether we've already been called rather than
9516 `ConstantValue != null' since this breaks for NullLiterals.
9518 2004-04-28 Raja R Harinath <rharinath@novell.com>
9520 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9521 setting of this flag, since the 'set' method may be non-public.
9523 2004-04-28 Raja R Harinath <rharinath@novell.com>
9525 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9526 check on current_vector.Block.
9528 2004-04-27 Martin Baulig <martin@ximian.com>
9530 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9531 a field initializer. Fixes #56459.
9533 2004-04-27 Martin Baulig <martin@ximian.com>
9535 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9536 we're not attempting to use an indexer. Fixes #52154.
9538 2004-04-27 Martin Baulig <martin@ximian.com>
9540 * statement.cs (Return): Don't create a return label if we don't
9541 need it; reverts my change from January 20th. Thanks to Ben
9544 2004-04-27 Martin Baulig <martin@ximian.com>
9546 According to the spec, `goto' can only leave a nested scope, but
9549 * statement.cs (Block.LookupLabel): Only lookup in the current
9550 block, don't recurse into parent or child blocks.
9551 (Block.AddLabel): Check in parent and child blocks, report
9552 CS0140/CS0158 if we find a duplicate.
9553 (Block): Removed this indexer for label lookups.
9554 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9555 this already does the error reporting for us.
9558 (FlowBranching.UsageVector.Block): New public variable; may be null.
9559 (FlowBranching.CreateSibling): Added `Block' argument.
9560 (FlowBranching.LookupLabel): New public virtual method. Lookup a
9561 label for the target of a `goto' and check whether we're not
9562 leaving a `finally'.
9564 2004-04-27 Martin Baulig <martin@ximian.com>
9566 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9567 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9570 2004-04-27 Martin Baulig <martin@ximian.com>
9572 * statement.cs (Block.AddLabel): Also check for implicit blocks
9573 and added a CS0158 check.
9575 2004-04-27 Martin Baulig <martin@ximian.com>
9577 * flowanalysis.cs (FlowBranchingLoop): New class.
9578 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9579 UsageVector's instead of an ArrayList.
9580 (FlowBranching.Label): Likewise.
9581 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9582 (FlowBranching.AddBreakVector): New method.
9584 2004-04-27 Miguel de Icaza <miguel@ximian.com>
9586 * attribute.cs: Small regression fix: only convert the type if we
9587 the type is different, fixes System.Drawing build.
9589 2004-04-27 Martin Baulig <martin@ximian.com>
9591 * attribute.cs (Attribute.Resolve): If we have a constant value
9592 for a named field or property, implicity convert it to the correct
9595 2004-04-27 Raja R Harinath <rharinath@novell.com>
9597 * statement.cs (Block.Block): Implicit blocks share
9598 'child_variable_names' fields with parent blocks.
9599 (Block.AddChildVariableNames): Remove.
9600 (Block.AddVariable): Mark variable as "used by a child block" in
9601 every surrounding block.
9602 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9603 been used in a child block, complain about violation of "Invariant
9604 meaning in blocks" rule.
9605 * cs-parser.jay (declare_local_variables): Don't use
9606 AddChildVariableNames.
9607 (foreach_statement): Don't create an implicit block: 'foreach'
9610 2004-04-23 Miguel de Icaza <miguel@ximian.com>
9612 * convert.cs (ImplicitNumericConversion): 0 is also positive when
9613 converting from 0L to ulong. Fixes 57522.
9615 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9617 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9618 derived class hides via 'new' keyword field from base class (test-242.cs).
9619 TODO: Handle this in the more general way.
9621 * class.cs (CheckBase): Ditto.
9623 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9625 * decl.cs (caching_flags): New member for storing cached values
9627 (MemberCore.Flags): New enum where bit flags for caching_flags
9629 (MemberCore.cls_compliance): Moved to caching_flags.
9630 (DeclSpace.Created): Moved to caching_flags.
9632 * class.cs: Use caching_flags instead of DeclSpace.Created
9634 2004-04-21 Miguel de Icaza <miguel@ximian.com>
9636 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9637 if we are only a derived class, not a nested class.
9639 * typemanager.cs: Same as above, but do this at the MemberLookup
9640 level (used by field and methods, properties are handled in
9641 PropertyExpr). Allow for the qualified access if we are a nested
9644 2004-04-21 Marek Safar <marek.safar@seznam.cz>
9646 * class.cs: Refactoring.
9647 (IMethodData): New inteface; Holds links to parent members
9648 to avoid member duplication (reduced memory allocation).
9649 (Method): Implemented IMethodData interface.
9650 (PropertyBase): New inner classes for get/set methods.
9651 (PropertyBase.PropertyMethod): Implemented IMethodData interface
9652 (Event): New inner classes for add/remove methods.
9653 (Event.DelegateMethod): Implemented IMethodData interface.
9655 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9656 EmitContext (related to class.cs refactoring).
9658 2004-04-21 Raja R Harinath <rharinath@novell.com>
9660 * delegate.cs (Delegate.VerifyApplicability): If the number of
9661 arguments are the same as the number of parameters, first try to
9662 verify applicability ignoring any 'params' modifier on the last
9666 2004-04-08 Martin Baulig <martin@ximian.com>
9668 Merged latest changes into gmcs. Please keep this comment in
9669 here, it makes it easier for me to see what changed in MCS since
9670 the last time I merged.
9672 2004-04-16 Raja R Harinath <rharinath@novell.com>
9674 * class.cs (TypeContainer.AddIndexer): Use
9675 'ExplicitInterfaceName' to determine if interface name was
9676 explicitly specified. 'InterfaceType' is not initialized at this time.
9677 (TypeContainer.DefineIndexers): Remove use of temporary list. The
9678 Indexers array is already in the required order. Initialize
9679 'IndexerName' only if there are normal indexers.
9680 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9681 (TypeContainer.Emit): Emit DefaultMember attribute only if
9682 IndexerName is initialized.
9685 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
9687 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9690 2004-04-15 Raja R Harinath <rharinath@novell.com>
9692 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9696 * attribute.cs (Attribute.Resolve): Check for duplicate named
9700 2004-04-15 Miguel de Icaza <miguel@ximian.com>
9702 * iterators.cs (MarkYield): track whether we are in an exception,
9703 and generate code accordingly. Use a temporary value to store the
9704 result for our state.
9706 I had ignored a bit the interaction of try/catch with iterators
9707 since their behavior was not entirely obvious, but now it is
9708 possible to verify that our behavior is the same as MS .NET 2.0
9712 2004-04-14 Miguel de Icaza <miguel@ximian.com>
9714 * iterators.cs: Avoid creating temporaries if there is no work to
9717 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9718 Enumerations, use TypeManager.EnumToUnderlying and call
9721 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9724 (This.Emit): Use EmitContext.EmitThis to emit our
9727 (This.EmitAssign): Ditto.
9729 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9730 codepaths, we will move all the functionality into
9733 (FieldExpr.EmitAssign): Ditto.
9735 This fixes several hidden bugs that I uncovered while doing a code
9736 review of this today.
9738 * codegen.cs (EmitThis): reworked so the semantics are more clear
9739 and also support value types "this" instances.
9741 * iterators.cs: Changed so that for iterators in value types, we
9742 do not pass the value type as a parameter.
9744 Initialization of the enumerator helpers is now done in the caller
9745 instead of passing the parameters to the constructors and having
9746 the constructor set the fields.
9748 The fields have now `assembly' visibility instead of private.
9750 2004-04-11 Miguel de Icaza <miguel@ximian.com>
9752 * expression.cs (Argument.Resolve): Check if fields passed as ref
9753 or out are contained in a MarshalByRefObject.
9755 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9756 another compiler type.
9758 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
9760 * class.cs (Indexer.Define): use the new name checking method.
9761 Also, return false on an error.
9762 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9763 (is_identifier_[start/part]_character): make static.
9765 2004-04-10 Miguel de Icaza <miguel@ximian.com>
9767 * expression.cs (Binary.ResolveOperator): Do no append strings
9768 twice: since we can be invoked more than once (array evaluation)
9769 on the same concatenation, take care of this here. Based on a fix
9770 from Ben (bug #56454)
9772 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9774 * codegen.cs: Fix another case where CS1548 must be reported (when
9775 delay-sign isn't specified and no private is available #56564). Fix
9776 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9777 error when MCS is used on the MS runtime and we need to delay-sign
9778 (which seems unsupported by AssemblyBuilder - see #56621).
9780 2004-04-08 Marek Safar <marek.safar@seznam.cz>
9782 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9783 (TypeManager.ComputeNamespaces): Faster implementation for
9786 * compiler.csproj: Updated AssemblyName to mcs.
9788 2004-05-11 Jackson Harper <jackson@ximian.com>
9790 * Makefile: Preserve MONO_PATH
9792 2004-05-11 Jackson Harper <jackson@ximian.com>
9794 * Makefile: Use mono and mcs to build gmcs
9796 2004-05-03 Miguel de Icaza <miguel@ximian.com>
9798 * codegen.cs: Add patch from Robert Shade
9799 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
9802 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
9804 * CryptoConvert.cs: Updated to latest version. Fix issue with
9805 incomplete key pairs (#57941).
9807 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9809 * codegen.cs: Fix another case where CS1548 must be reported (when
9810 delay-sign isn't specified and no private is available #56564). Fix
9811 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9812 error when MCS is used on the MS runtime and we need to delay-sign
9813 (which seems unsupported by AssemblyBuilder - see #56621).
9815 2004-04-29 Jackson Harper <jackson@ximian.com>
9817 * Makefile: Set MONO_PATH to use the bootstrap corlib
9818 * driver.cs: Check the GAC for referenced assemblies.
9820 2004-04-29 Martin Baulig <martin@ximian.com>
9822 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
9824 2004-04-07 Martin Baulig <martin@ximian.com>
9826 * expression.cs (Binary.ResolveOperator): Added special case for
9827 Equality/Inequality between a type parameter and a null literal.
9829 2004-04-07 Martin Baulig <martin@ximian.com>
9831 * convert.cs: Check null literal -> type parameter conversions.
9833 2004-04-07 Martin Baulig <martin@ximian.com>
9835 * generic.cs (ConstructedType.CheckConstraints): Enforce the
9836 `class' and `struct' constraints.
9838 2004-04-07 Martin Baulig <martin@ximian.com>
9840 * generic.cs (SpecialConstraint): New public enum.
9841 (Constraints.Resolve): Added support for the `class' and `struct'
9844 * cs-parser.jay (type_parameter_constraint): Added support for the
9845 `class' and `struct' constraints.
9847 2004-04-07 Martin Baulig <martin@ximian.com>
9849 * support.cs (GenericConstraints): Replaced `Types' by
9850 `ClassConstraint' and `InterfaceConstraints'; added
9851 `HasClassConstraint'.
9853 2004-04-07 Martin Baulig <martin@ximian.com>
9856 (Constraints.InterfaceConstraints): New public property.
9857 (Constraints.Types): Make this property public
9858 (TypeParameter): Implement IMemberContainer.
9859 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
9860 instead of a TypeBuilder/MethodBuilder; pass the interface
9861 constraints to TypeManager.AddTypeParameter().
9862 (TypeParameter.DefineType): Just take an EmitContext and no
9863 TypeBuilder/MethodBuilder. Use the new public API.
9865 * typemanager.cs (TypeManager.AddTypeParameter): Added
9866 `TypeExpr[]' argument; add the interfaces to the
9867 `builder_to_ifaces' hash.
9868 (TypeManager.LookupMemberContainer): For
9869 GenericTypeParameterBuilders, get the TypeParameter from the
9870 `builder_to_type_param'.
9871 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
9872 the TypeParameter and call FindMembers on it.
9874 2004-04-07 Martin Baulig <martin@ximian.com>
9877 (MethodCore.GenericMethod): Moved this field here from Method.
9878 (MethodCore.IsDuplicateImplementation): Take the number of type
9879 parameters into account if we're a generic method.
9881 * expression.cs (Invocation.InferTypeArguments): Don't return true
9882 if `arguments' is null; we still need to check whether we actually
9883 don't need to infer anything in this case.
9884 (MemberAccess): Merged the functionality from GenericMemberAccess
9887 * generic.cs (GenericMemberAccess): Removed.
9889 2004-04-05 Martin Baulig <martin@ximian.com>
9891 * decl.cs (MemberCore): For generic classes, interfaces and
9892 structs, `Name' now includes the number of type parameters
9894 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
9895 encode the number of type arguments in the type name.
9897 * expression.cs (Expression.MemberLookup): Removed the
9898 `num_type_args' argument; we now encode the number of type
9899 arguments in the type name.
9901 * ecore.cs (SimpleName): Encode the number of type arguments in
9902 the type name itself.
9904 * generic.cs (ConstructedType): Likewise.
9906 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
9907 `MemberName'; we now include the number of type parameters in the
9910 * typemanager.cs (TypeManager.CheckGeneric): Removed.
9911 (TypeManager.MemberLookup): Removed the
9912 `num_type_args' argument; we now encode the number of type
9913 arguments in the type name.
9915 2004-04-03 Martin Baulig <martin@ximian.com>
9917 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
9918 (MemberCore.MemberName): Moved here from MemberBase.
9919 (DeclSpace.SetParameterInfo): Just take the constraints as an
9920 ArrayList; we already have the type parameters in our
9921 `MemberName'; also do the CS0080 reporting here.
9923 * cs-parser.jay (struct_declaration): Use `member_name' instead of
9924 `IDENTIFIER opt_type_parameter_list'; when constructing our
9925 `MemberName', it'll already include our type parameters.
9926 (class_declaration, interface_declaration): Likewise.
9927 (delegate_declaration): Likewise.
9928 (MakeName): Take a MemberName and return a MemberName.
9929 The following two changes are required to avoid shift/reduce conflicts:
9930 (member_name): Don't include a TypeName anymore; ie. this is now
9931 just 'IDENTIFIER opt_type_parameter_list'.
9932 (property_declaration, event_declaration): Use a
9933 `namespace_or_type_name' instead of a `member_name'.
9935 2004-04-03 Martin Baulig <martin@ximian.com>
9937 * decl.cs (MemberName): Renamed to `TypeName' and created a new
9939 (TypeName): Formerly known as MemberName.
9941 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
9942 instead of a `MemberName'.
9944 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
9945 (member_name): New rule; create a MemberName.
9947 2004-04-02 Martin Baulig <martin@ximian.com>
9949 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
9950 (CS0305 and CS0308).
9952 2004-04-02 Martin Baulig <martin@ximian.com>
9954 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
9955 support for nested types.
9957 2004-04-02 Martin Baulig <martin@ximian.com>
9959 * ecore.cs (IAlias): New public interface.
9960 (TypeExpr, TypeExpression): Implement IAlias.
9961 (TypeAliasExpression): New public class.
9963 * namespace.cs (Namespace): Implement IAlias.
9964 (Namespace.Lookup): Return an IAlias instead on an object.
9965 (Namespace.DefineName): Take an IAlias instead of an object.
9966 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
9968 (NamespaceEntry.UsingAlias): Take a Membername instead of an
9970 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
9972 (NamespaceEntry.Lookup): Likewise.
9974 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
9977 * decl.cs (DeclSpace): Implement IAlias.
9978 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
9980 * generic.cs (ConstructedType): Improved error checking.
9982 2004-04-02 Martin Baulig <martin@ximian.com>
9984 * convert.cs: Added type parameter conversions.
9987 (UnboxCast.Emit): Emit an `unbox.any' for type params.
9988 (ClassCast.Emit): If the source type is a type parameter, box it.
9989 If the target type is a type parameter, emit an `unbox.any'
9990 instead of a `classcast'.1
9992 2004-04-01 Martin Baulig <martin@ximian.com>
9994 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
9996 2004-04-01 Martin Baulig <martin@ximian.com>
9998 * generic.cs (ConstructedType.CheckConstraints): Use
9999 Convert.ImplicitStandardConversionExists(); user-defined implicit
10000 conversions are not allowed according to the spec.
10002 2004-03-30 Martin Baulig <martin@ximian.com>
10004 * expression.cs (New): Added support for type parameters.
10007 (TypeManager.activator_type): New public static field.
10008 (TypeManager.activator_create_instance): Likewise.
10010 2004-03-30 Martin Baulig <martin@ximian.com>
10012 * typemanager.cs (TypeManager.HasConstructorConstraint): New
10015 2004-03-30 Martin Baulig <martin@ximian.com>
10017 * generic.cs (ConstructedType.CheckConstraints): Actually follow
10018 the spec here: the argument type must be convertible to the
10021 2004-03-30 Martin Baulig <martin@ximian.com>
10024 (TypeParameter.Define, TypeParameter.DefineMethod): Call
10025 TypeManager.AddTypeParameter().
10026 (ConstructedType.CheckConstraints): Re-enable this and actually
10027 check whether we have a constructor constraint.
10030 (TypeManager.builder_to_type_param): New static field.
10031 (TypeManager.AddTypeParameter): New static method.
10032 (TypeManager.LookupTypeParameter): New public method.
10034 2004-03-30 Martin Baulig <martin@ximian.com>
10036 * generic.cs (TypeParameter.DefineType): Return a boolean and use
10037 the new API to actually define the constructor constraint.
10040 (TypeManager.new_constraint_attr_type): New static field.
10041 (TypeManager.InitCoreTypes): Initialize it.
10043 2004-03-30 Martin Baulig <martin@ximian.com>
10045 * generic.cs (Constraints): Completed error checking, use correct
10048 2004-03-29 Martin Baulig <martin@ximian.com>
10050 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10052 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10053 public version which takes a `ParameterData pd' instead of an
10056 2004-03-29 Martin Baulig <martin@ximian.com>
10058 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10061 2004-03-29 Martin Baulig <martin@ximian.com>
10063 * expression.cs (Argument.ResolveMethodGroup): If we're a
10064 ConstructedType, call GetMemberAccess() on it.
10066 2004-03-29 Martin Baulig <martin@ximian.com>
10068 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10069 (MethodCore.CheckGenericOverride): When overriding a generic
10070 method, check whether the constraints match.
10072 * support.cs (GenericConstraints): New public interface.
10073 (ParameterData.GenericConstraints): New public method.
10075 * parameter.cs (Parameter.Resolve): Check whether we're a generic
10076 method parameter and compute our constraints if appropriate.
10077 (Parameter.GenericConstraints): New public property.
10079 * generic.cs (Constraints): Implement GenericConstraints.
10081 2004-03-29 Martin Baulig <martin@ximian.com>
10083 * decl.cs (MemberCache.FindMemberToOverride): Use
10084 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10086 2004-03-29 Martin Baulig <martin@ximian.com>
10088 * generic.cs (GenericMethod.Define): Resolve our type parameters.
10090 2004-03-29 Martin Baulig <martin@ximian.com>
10092 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10093 not allowed on non-generic declarations").
10095 2004-03-29 Martin Baulig <martin@ximian.com>
10097 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10098 public version of this method.
10100 * class.cs (MethodCore.IsDuplicateImplementation): Use
10101 Invocation.InferTypeArguments() to check this.
10103 2004-03-29 Martin Baulig <martin@ximian.com>
10105 * convert.cs: Use TypeManager.IsDelegateType() instead of
10106 comparing types correctly.
10108 2004-03-29 Martin Baulig <martin@ximian.com>
10110 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10111 types directly to make it work for generic instances.
10113 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10115 2004-03-29 Martin Baulig <martin@ximian.com>
10117 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10118 support for arrays.
10120 2004-03-24 Martin Baulig <martin@ximian.com>
10122 * decl.cs (DeclSpace.FindType): Also use
10123 TypeManager.CheckGeneric() for types from the using clauses.
10125 2004-03-23 Martin Baulig <martin@ximian.com>
10127 * expression.cs (Invocation.OverloadResolve): Added `bool
10128 may_fail' argument and use it instead of the Location.IsNull() hack.
10130 2004-03-23 Martin Baulig <martin@ximian.com>
10132 * expression.cs (Invocation.InferType): Use correct type inference
10135 2004-03-23 Martin Baulig <martin@ximian.com>
10137 * ecore.cs (MethodGroupExpr.Name): Use
10138 TypeManager.CSharpSignature() instead of just the name.
10140 * expression.cs (Invocation.OverloadResolve): Provide better error
10142 (Invocation.DoResolve): OverloadResolve() never returns null
10143 without reporting an error, so removed the error -6 reporting here.
10145 2004-03-23 Martin Baulig <martin@ximian.com>
10147 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10150 * cs-parser.jay (delegate_declaration): Support generic delegates.
10152 * delegate.cs: Support generic delegates.
10154 2004-03-22 Martin Baulig <martin@ximian.com>
10156 * expression.cs (Invocation.InferParamsTypeArguments): New static
10157 method; does type inference for params arguments.
10159 2004-03-21 Martin Baulig <martin@ximian.com>
10161 * typemanager.cs (TypeManager.IsGenericMethod): New public static
10162 method; checks whether a method is a generic method.
10164 * expression.cs (Invocation.InferTypeArguments): New static method;
10165 infer type arguments for generic method invocation.
10167 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10168 property; we set this to true if we're resolving a generic method
10169 invocation and the user specified type arguments, ie. we're not
10170 doing type inference.
10172 2004-03-20 Martin Baulig <martin@ximian.com>
10174 * class.cs (MethodData.DeclaringType): New public property.
10175 (MethodData.Define): Set DeclaringType here.
10176 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10177 instead of OperatorMethodBuilder.DeclaringType.
10179 2004-03-20 Martin Baulig <martin@ximian.com>
10181 * cs-tokenizer.cs (xtoken): Return a special
10182 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10184 * cs-parser.jay (default_value_expression): Switch to the new
10187 2004-03-19 Martin Baulig <martin@ximian.com>
10189 * decl.cs (MemberName): New class. We use this to "construct"
10190 namespace_or_type_name's.
10192 * generics.cs (TypeArguments.GetDeclarations): New public method;
10193 returns the type arguments as a string[] and reports a CS0081 if
10194 one of them is not an identifier.
10196 * class.cs (MemberBase): The .ctor now takes the name as a
10197 MemberName instead of a string.
10198 (MemberBase.ExplicitInterfaceName): Changed type from string to
10200 (MemberBase.DoDefine): If we're an explicit implementation, the
10201 InterfaceType may be a generic instance.
10203 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10204 (namespace_name): Call MemberName.GetName () to transform the
10205 MemberName into a string and ensure we don't have any type
10207 (type_name): Call MemberName.GetTypeExpression() to transfrom the
10208 MemberName into an expression.
10209 (method_header): Use namespace_or_type_name instead of member_name.
10211 2004-04-07 Miguel de Icaza <miguel@ximian.com>
10213 * rootcontext.cs: Add new types to the boot resolution.
10215 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10216 MulticastDelegate is not allowed.
10218 * typemanager.cs: Add new types to lookup: System.TypedReference
10221 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10222 check for TypedReference or ArgIterator, they are not allowed.
10224 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10225 makes us properly catch 1510 in some conditions (see bug 56016 for
10228 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
10230 * CryptoConvert.cs: update from corlib version
10233 2004-04-05 Miguel de Icaza <miguel@ximian.com>
10235 * class.cs (Indexer.Define): Check indexername declaration
10237 2004-04-05 Marek Safar <marek.safar@seznam.cz>
10239 * attribute.cs (IsClsCompliant): Fixed problem with handling
10240 all three states (compliant, not-compliant, undetected).
10242 2004-03-30 Marek Safar <marek.safar@seznam.cz>
10244 * attribute.cs (Attribute): Location is now public.
10245 (Resolve): Store resolved arguments (pos_values) in attribute class.
10246 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10247 (GetClsCompliantAttributeValue): New method that gets
10248 CLSCompliantAttribute value.
10249 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10250 if exists else null.
10251 (AttributeTester): New class for CLS-Compliant verification routines.
10253 * class.cs (Emit): Add CLS-Compliant verification.
10254 (Method.GetSignatureForError): Implemented.
10255 (Constructor.GetSignatureForError): Implemented
10256 (Constructor.HasCompliantArgs): Returns if constructor has
10257 CLS-Compliant arguments.
10258 (Constructor.Emit): Override.
10259 (Construcor.IsIdentifierClsCompliant): New method; For constructors
10260 is needed to test only parameters.
10261 (FieldBase.GetSignatureForError): Implemented.
10262 (TypeContainer): New member for storing base interfaces.
10263 (TypeContainer.FindMembers): Search in base interfaces too.
10265 * codegen.cs (GetClsComplianceAttribute): New method that gets
10266 assembly or module CLSCompliantAttribute value.
10267 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10269 (ModuleClass.Emit): Add error 3012 test.
10271 * const.cs (Emit): Override and call base for CLS-Compliant tests.
10273 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10274 state for all decl types.
10275 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10276 if CLS-Compliant tests are required.
10277 (IsClsCompliaceRequired): New method. Analyze whether code
10278 must be CLS-Compliant.
10279 (IsExposedFromAssembly): New method. Returns true when MemberCore
10280 is exposed from assembly.
10281 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10282 value or gets cached value.
10283 (HasClsCompliantAttribute): New method. Returns true if MemberCore
10284 is explicitly marked with CLSCompliantAttribute.
10285 (IsIdentifierClsCompliant): New abstract method. This method is
10286 used to testing error 3005.
10287 (IsIdentifierAndParamClsCompliant): New method. Common helper method
10288 for identifier and parameters CLS-Compliant testing.
10289 (VerifyClsCompliance): New method. The main virtual method for
10290 CLS-Compliant verifications.
10291 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10292 null. I don't know why is null (too many public members !).
10293 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10294 and get value of first CLSCompliantAttribute that found.
10296 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10297 (VerifyClsCompliance): Override and add extra tests.
10299 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10300 clscheck- disable CLS-Compliant verification event if assembly is has
10301 CLSCompliantAttribute(true).
10303 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10304 ApllyAttribute is now called in emit section as in the other cases.
10305 Possible future Emit integration.
10306 (IsIdentifierClsCompliant): New override.
10307 (VerifyClsCompliance): New override.
10308 (GetEnumeratorName): Returns full enum name.
10310 * parameter.cs (GetSignatureForError): Implemented.
10312 * report.cs (WarningData): New struct for Warning message information.
10313 (LocationOfPreviousError): New method.
10314 (Warning): New method. Reports warning based on the warning table.
10315 (Error_T): New method. Reports error based on the error table.
10317 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10318 verifications are done here.
10320 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10322 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10323 CLSCompliantAttribute.
10324 (all_imported_types): New member holds all imported types from other
10326 (LoadAllImportedTypes): New method fills static table with exported types
10327 from all referenced assemblies.
10328 (Modules): New property returns all assembly modules.
10330 2004-03-30 Miguel de Icaza <miguel@ximian.com>
10332 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10333 throwing a parser error.
10335 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10336 which removes the hardcoded get_/set_ prefixes for properties, as
10337 IL allows for the properties to be named something else.
10341 * expression.cs: Do not override operand before we know if it is
10342 non-null. Fix 56207
10344 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10346 * typemanager.cs: support for pinned variables.
10348 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10350 * decl.cs, typemanager.cs: Avoid using an arraylist
10351 as a buffer if there is only one result set.
10353 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10355 * expression.cs: Make sure you cant call a static method
10356 with an instance expression, bug #56174.
10358 2004-03-29 Miguel de Icaza <miguel@ximian.com>
10360 * class.cs (IsDuplicateImplementation): Improve error reporting to
10361 flag 663 (method only differs in parameter modifier).
10363 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10364 in preprocessor directives.
10366 * location.cs (LookupFile): Allow for the empty path.
10368 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
10369 better approach for some of that patch, but its failing with the
10370 CharSet enumeration. For now try/catch will do.
10372 * typemanager.cs: Do not crash if a struct does not have fields.
10375 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10377 * expression.cs: cs0213, cant fix a fixed expression.
10380 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10382 * cs-parser.jay: detect invalid embeded statements gracefully.
10385 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10387 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10390 the invocation type may not be a subclass of the tye of the item/
10391 The type of the item must be a subclass of the invocation item.
10396 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
10398 * attribute.cs: Added methods to get a string and a bool from an
10399 attribute. Required to information from AssemblyKeyFileAttribute,
10400 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10401 * codegen.cs: Modified AssemblyName creation to include support for
10402 strongnames. Catch additional exceptions to report them as CS1548.
10403 * compiler.csproj: Updated include CryptoConvert.cs.
10404 * compiler.csproj.user: Removed file - user specific configuration.
10405 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
10406 Mono.Security assembly. The original class is maintained and tested in
10407 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10408 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10409 like CSC 8.0 (C# v2) supports.
10410 * Makefile: Added CryptoConvert.cs to mcs sources.
10411 * rootcontext.cs: Added new options for strongnames.
10413 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
10415 * driver.cs: For --expect-error, report error code `2'
10416 if the program compiled with no errors, error code `1' if
10417 it compiled with an error other than the one expected.
10419 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
10421 * compiler.csproj: Updated for Visual Studio .NET 2003.
10422 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10423 * compiler.sln: Updated for Visual Studio .NET 2003.
10425 2004-03-24 Ravi Pratap M <ravi@ximian.com>
10427 * expression.cs: Fix bug #47234. We basically need to apply the
10428 rule that we prefer the conversion of null to a reference type
10429 when faced with a conversion to 'object' (csc behaviour).
10431 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10433 * statement.cs: Shorter form for foreach, eliminates
10434 a local variable. r=Martin.
10436 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10438 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10439 checks if we can use brtrue/brfalse to test for 0.
10440 * expression.cs: use the above in the test for using brtrue/brfalse.
10441 cleanup code a bit.
10443 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10445 * expression.cs: Rewrite string concat stuff. Benefits:
10447 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10448 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10449 rather than a concat chain.
10451 * typemanager.cs: Add lookups for more concat overloads.
10453 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10455 * expression.cs: Emit shorter il code for array init.
10472 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
10474 * statement.cs: Before, two switch blocks would be merged if the
10475 total size of the blocks (end_item - begin_item + 1) was less than
10476 two times the combined sizes of the blocks.
10478 Now, it will only merge if after the merge at least half of the
10483 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
10485 * class.cs : csc build fix for GetMethods(). See bug #52503.
10487 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
10489 * expression.cs: Make sure fp comparisons work with NaN.
10490 This fixes bug #54303. Mig approved this patch a long
10491 time ago, but we were not able to test b/c the runtime
10494 2004-03-19 Miguel de Icaza <miguel@ximian.com>
10496 * ecore.cs (TypExpr.GetHashCode): implement this overload.
10498 2004-03-19 Martin Baulig <martin@ximian.com>
10500 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10501 two overloads may unify for some type parameter substitutions and
10502 report a CS0408 if appropriate.
10504 2004-03-19 Martin Baulig <martin@ximian.com>
10506 * class.cs (MemberCore.IsDuplicateImplementation): Report the
10507 error here and not in our caller.
10509 2004-03-19 Martin Baulig <martin@ximian.com>
10511 * interface.cs: Completely killed this file.
10512 (Interface): We're now a TypeContainer and live in class.cs.
10514 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10515 argument; we're now also called for interfaces.
10516 (TypeContainer.DefineMembers): Allow this method being called
10518 (TypeContainer.GetMethods): New public method; formerly known as
10519 Interface.GetMethod(). This is used by PendingImplementation.
10520 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10521 it's now private and non-static.
10522 (Interface): Moved this here; it's now implemented similar to
10524 (Method, Property, Event, Indexer): Added `bool is_interface'
10525 argument to their .ctor's.
10526 (MemberBase.IsInterface): New public field.
10528 * cs-parser.jay: Create normal Method, Property, Event, Indexer
10529 instances instead of InterfaceMethod, InterfaceProperty, etc.
10530 (opt_interface_base): Removed; we now use `opt_class_base' instead.
10531 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10533 2004-03-19 Martin Baulig <martin@ximian.com>
10535 * class.cs (MethodCore.IsDuplicateImplementation): New private
10536 method which does the CS0111 checking.
10537 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10538 Use IsDuplicateImplementation().
10540 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
10542 * decl.cs (FindMemberToOverride): New method to find the correct
10543 method or property to override in the base class.
10545 - Make Method/Property use the above method to find the
10546 version in the base class.
10547 - Remove the InheritableMemberSignatureCompare as it is now
10550 This patch makes large code bases much faster to compile, as it is
10551 O(n) rather than O(n^2) to do this validation.
10553 Also, it fixes bug 52458 which is that nested classes are not
10554 taken into account when finding the base class member.
10556 Reviewed/Approved by Martin.
10558 2004-03-17 Martin Baulig <martin@ximian.com>
10560 * expression.cs (MemberAccess.DoResolve): Take the parent's number
10561 of type arguments into account; use the `real_num_type_args'
10562 approach like in DoResolveAsTypeStep().
10564 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10567 2004-03-17 Marek Safar <marek.safar@seznam.cz>
10569 * interface.cs: In all interface classes removed redundant
10570 member initialization.
10572 2004-03-16 Martin Baulig <martin@ximian.com>
10574 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10576 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10578 * decl.cs (DefineTypeAndParents): New helper method to define a
10579 type's containers before the type itself is defined; This is a
10580 bug exposed by the recent changes to Windows.Forms when an
10581 implemented interface was defined inside a class that had not been
10584 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10586 (Check): Loop correctly to report errors modifiers
10587 (UNSAFE was not in the loop, since it was the same as TOP).
10589 * interface.cs: Every interface member now takes a ModFlags,
10590 instead of a "is_new" bool, which we set on the base MemberCore.
10592 Every place where we called "UnsafeOk" in the interface, now we
10593 call the proper member (InterfaceMethod.UnsafeOK) instead to get
10594 the unsafe settings from the member declaration instead of the
10595 container interface.
10597 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
10599 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10600 `set_indexer_name' to the pending bits (one per type).
10602 We fixed a bug today that was picking the wrong method to
10603 override, since for properties the existing InterfaceMethod code
10604 basically ignored the method name. Now we make sure that the
10605 method name is one of the valid indexer names.
10607 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
10609 * support.cs (SeekableStreamReader): Keep track of stream byte
10610 positions and don't mix them with character offsets to the buffer.
10612 Patch from Gustavo Giráldez
10614 2004-03-15 Marek Safar <marek.safar@seznam.cz>
10616 * interface.cs (InterfaceSetGetBase): Removed double member
10617 initialization, base class does it as well.
10619 2004-03-13 Martin Baulig <martin@ximian.com>
10621 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10622 when compiling corlib.
10624 2004-03-13 Miguel de Icaza <miguel@ximian.com>
10626 * convert.cs (ExplicitConversion): We were reporting an error on
10627 certain conversions (object_type source to a value type, when the
10628 expression was `null') before we had a chance to pass it through
10629 the user defined conversions.
10631 * driver.cs: Replace / and \ in resource specifications to dots.
10634 * class.cs: Add check for duplicate operators. Fixes 52477
10636 2004-03-11 Miguel de Icaza <miguel@ximian.com>
10638 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10639 that are in the middle of the statements, not only at the end.
10642 * class.cs (TypeContainer.AddField): No longer set the
10643 `HaveStaticConstructor' flag, now we call it
10644 `UserDefineStaticConstructor' to diferentiate the slightly
10645 semantic difference.
10647 The situation is that we were not adding BeforeFieldInit (from
10648 Modifiers.TypeAttr) to classes that could have it.
10649 BeforeFieldInit should be set to classes that have no static
10654 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10656 And most importantly Zoltan's comment:
10658 http://bugzilla.ximian.com/show_bug.cgi?id=44229
10660 "I think beforefieldinit means 'it's ok to initialize the type sometime
10661 before its static fields are used', i.e. initialization does not need
10662 to be triggered by the first access to the type. Setting this flag
10663 helps the JIT to compile better code, since it can run the static
10664 constructor at JIT time, and does not need to generate code to call it
10665 (possibly lots of times) at runtime. Unfortunately, mcs does not set
10666 this flag for lots of classes like String.
10668 csc sets this flag if the type does not have an explicit static
10669 constructor. The reasoning seems to be that if there are only static
10670 initalizers for a type, and no static constructor, then the programmer
10671 does not care when this initialization happens, so beforefieldinit
10674 This bug prevents the AOT compiler from being usable, since it
10675 generates so many calls to mono_runtime_class_init that the AOT code
10676 is much slower than the JITted code. The JITted code is faster,
10677 because it does not generate these calls if the vtable is type is
10678 already initialized, which is true in the majority of cases. But the
10679 AOT compiler can't do this."
10681 2004-03-10 Miguel de Icaza <miguel@ximian.com>
10683 * class.cs (MethodData.Emit): Refactor the code so symbolic
10684 information is generated for destructors; For some reasons we
10685 were taking a code path that did not generate symbolic information
10688 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
10690 * class.cs: Create a Constructor.CheckBase method that
10691 takes care of all validation type code. The method
10692 contains some code that was moved from Define.
10694 It also includes new code that checks for duplicate ctors.
10695 This fixes bug #55148.
10697 2004-03-09 Joshua Tauberer <tauberer@for.net>
10699 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10700 a { ... }-style array creation invokes EmitStaticInitializers
10701 which is not good for reference-type arrays. String, decimal
10702 and now null constants (NullCast) are not counted toward
10703 static initializers.
10705 2004-03-05 Martin Baulig <martin@ximian.com>
10707 * location.cs (SourceFile.HasLineDirective): New public field;
10708 specifies whether the file contains or is referenced by a "#line"
10710 (Location.DefineSymbolDocuments): Ignore source files which
10711 either contain or are referenced by a "#line" directive.
10713 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
10715 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10716 direct access to our parent, so check the method inline there.
10718 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
10720 * expression.cs (Invocation.EmitCall): Miguel's last commit
10721 caused a regression. If you had:
10726 In Foo the implict this would be null.
10728 2004-02-27 Miguel de Icaza <miguel@ximian.com>
10730 * expression.cs (Invocation.EmitCall): If the method is not
10731 virtual, do not emit a CallVirt to it, use Call.
10733 * typemanager.cs (GetFullNameSignature): Improve the method to
10734 cope with ".ctor" and replace it with the type name.
10736 * class.cs (ConstructorInitializer.Resolve): Now the method takes
10737 as an argument the ConstructorBuilder where it is being defined,
10738 to catch the recursive constructor invocations.
10740 2004-03-16 Martin Baulig <martin@ximian.com>
10742 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
10743 ConstructedType, call ResolveType() on it to get the type rather
10744 than just using `expr.Type'.
10746 2004-03-16 Martin Baulig <martin@ximian.com>
10748 * generics.cs (ConstructedType.GetMemberAccess): Take the
10749 EmitContext instead on the TypeExpr and use
10750 ec.TypeContainer.CurrentType/ec.ContainerType.
10752 2004-03-16 Martin Baulig <martin@ximian.com>
10754 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
10755 parameters before aliases.
10757 2004-03-16 Martin Baulig <martin@ximian.com>
10759 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
10760 New oublic function; checks whether two generic instances may become
10761 equal under some instantiations (26.3.1).
10763 * class.cs (TypeContainer.Define): Call
10764 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
10767 2004-03-16 Martin Baulig <martin@ximian.com>
10769 * class.cs (TypeContainer.GetClassBases): Moved
10770 Error_TypeParameterAsBase() here and also check whether the base
10771 class is not an attribute.
10773 2004-03-16 Martin Baulig <martin@ximian.com>
10775 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10777 2004-03-16 Martin Baulig <martin@ximian.com>
10779 * class.cs (Error_TypeParameterAsBase): Use correct error number
10782 2004-03-16 Martin Baulig <martin@ximian.com>
10784 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
10787 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
10790 2004-03-15 Martin Baulig <martin@ximian.com>
10792 * typemanager.cs (TypeManager.GetFullName): New public method.
10793 (TypeManager.MemberLookup): Added `int_num_type_arguments'
10794 argument; only return members with the correct number of type
10796 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
10797 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
10798 whether the number of type arguments matches.
10800 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
10801 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
10803 * expression.cs (MemberAccess): Added public `NumTypeArguments'
10804 field; it's set by the protected .ctor when we're actually a
10805 GenericMemberAccess.
10806 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
10807 arguments and pass it to MemberLookupFinal ().
10809 * ecore.cs (Expression.MemberLookup): Added `int
10810 num_type_arguments' argument; only return members with the correct
10811 number of type arguments.
10812 (Expression.MemberLookupFailed): Check whether the MemberLookup
10813 failed because we did not have the correct number of type
10814 arguments; report CS0305 in this case.
10816 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
10817 `e.ResolveAsTypeTerminal()' already did so.
10819 2004-03-15 Martin Baulig <martin@ximian.com>
10821 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
10822 we're a ConstructedType; in this case, the caller must report an
10823 error (for instance CS0131).
10825 * generic.cs (TypeArguments): Added Location argument to the .ctor.
10826 (TypeArguments.Resolve): Actually report errors here.
10828 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10830 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10831 `set_indexer_name' to the pending bits (one per type).
10833 We fixed a bug today that was picking the wrong method to
10834 override, since for properties the existing InterfaceMethod code
10835 basically ignored the method name. Now we make sure that the
10836 method name is one of the valid indexer names.
10838 2004-03-15 Martin Baulig <martin@ximian.com>
10840 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
10841 for generic instances.
10843 2004-03-13 Martin Baulig <martin@ximian.com>
10845 * class.cs (TypeContainer.DefineType): Call
10846 TypeManager.AddUserType() immediately after creating the
10847 TypeBuilder; pass all type parameters when creating the
10850 * decl.cs (DeclSpace.FindNestedType): New public method.
10851 (DeclSpace.FindType): Added `int num_type_args' argument; only
10852 return types with the correct number of type parameters.
10853 (DeclSpace.CountTypeParams): New public property.
10855 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
10856 the number of type parameters; defaults to zero.
10858 * generic.cs (TypeArguments.Count): New public property.
10859 (ConstructedType.DoResolveAsTypeStep): First call
10860 ds.FindNestedType() to find out whether we're nested in the
10861 current generic type; in this case, we inherit all type parameters
10862 from the current class.
10864 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
10865 num_type_args' argument.
10866 (RootContext.LookupType): Added overloaded version which takes the
10867 number of type arguments; only return types with the correct
10868 number of type arguments.
10870 * typemanager.cs (TypeManager.CheckGeneric): New public function;
10871 checks whether `Type t' has `int num_type_args'.
10873 2004-03-13 Martin Baulig <martin@ximian.com>
10875 * generic.cs (GenericMethod.DefineType): New method; calls
10876 DefineType() on all the type parameters.
10878 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
10879 (MethodData.Define): If we're a generic method, call
10880 GenericMethod.DefineType() to define the type parameters.
10882 2004-03-10 Martin Baulig <martin@ximian.com>
10884 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
10885 instead of IsAssignableFrom.
10887 2004-03-10 Martin Baulig <martin@ximian.com>
10889 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
10891 * support.cs (ParameterData.HasArrayParameter): New property.
10892 (ReflectionParameters.ctor): Take a MethodBase instead of a
10893 ParameterInfo[]. If we have any type parameters, get the generic
10894 method definition and ask it whether we have variable arguments.
10896 2004-02-26 Miguel de Icaza <miguel@ximian.com>
10898 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10899 routines to check if a type is an enumerable/enumerator allow
10900 classes that implement the IEnumerable or IEnumerator interfaces.
10902 * class.cs (Property, Operator): Implement IIteratorContainer, and
10903 implement SetYields.
10905 (Property.Define): Do the block swapping for get_methods in the
10906 context of iterators. We need to check if Properties also
10907 include indexers or not.
10909 (Operator): Assign the Block before invoking the
10910 OperatorMethod.Define, so we can trigger the Iterator code
10913 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
10914 Property and Operator classes are not created when we parse the
10915 declarator but until we have the block completed, so we use a
10916 singleton SimpleIteratorContainer.Simple to flag whether the
10917 SetYields has been invoked.
10919 We propagate this setting then to the Property or the Operator to
10920 allow the `yield' to function.
10922 2004-02-25 Marek Safar <marek.safar@seznam.cz>
10924 * codegen.cs: Implemented attribute support for modules.
10925 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10926 Assembly/Module functionality.
10928 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10929 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10930 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10932 2004-02-16 Marek Safar <marek.safar@seznam.cz>
10934 * interface.cs (FindMembers): The operation is performed on all base
10935 interfaces and not only on the first. It is required for future CLS Compliance patch.
10937 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
10939 * statement.cs, codegen.cs:
10940 This patch deals with patterns such as:
10942 public class List : IEnumerable {
10944 public MyEnumerator GetEnumerator () {
10945 return new MyEnumerator(this);
10948 IEnumerator IEnumerable.GetEnumerator () {
10952 public struct MyEnumerator : IEnumerator {
10957 Before, there were a few things we did wrong:
10958 1) we would emit callvirt on a struct, which is illegal
10959 2) we emited ldarg when we needed to emit ldarga
10960 3) we would mistakenly call the interface methods on an enumerator
10961 type that derived from IEnumerator and was in another assembly. For example:
10963 public class MyEnumerator : IEnumerator
10965 Would have the interface methods called, even if there were public impls of the
10966 method. In a struct, this lead to invalid IL code.
10968 2004-02-11 Marek Safar <marek.safar@seznam.cz>
10970 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10973 * delegate.cs (Define): Fixed crash when delegate type is undefined.
10975 2004-02-11 Miguel de Icaza <miguel@ximian.com>
10977 * cs-parser.jay: Fix small regression: we were not testing V2
10978 compiler features correctly.
10980 * interface.cs: If the emit context is null, then create one
10982 2004-02-09 Marek Safar <marek.safar@seznam.cz>
10984 * decl.cs (GetSignatureForError): New virtual method to get full name
10985 for error messages.
10987 * attribute.cs (IAttributeSupport): New interface for attribute setting.
10988 Now it is possible to rewrite ApplyAttributes method to be less if/else.
10990 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10991 Duplicated members and code in these classes has been removed.
10992 Better encapsulation in these classes.
10994 2004-02-07 Miguel de Icaza <miguel@ximian.com>
10996 * assign.cs (Assign.DoResolve): When dealing with compound
10997 assignments, there is a new rule in ECMA C# 2.4 (might have been
10998 there before, but it is documented here) that states that in:
11002 If b is of type int, and the `op' is a shift-operator, then the
11003 above is evaluated as:
11007 * expression.cs (Binary.ResolveOperator): Instead of testing for
11008 int/uint/long/ulong, try to implicitly convert to any of those
11009 types and use that in pointer arithmetic.
11011 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11012 method to print information for from the type, not from the
11013 null-method we were given.
11015 2004-02-01 Duncan Mak <duncan@ximian.com>
11017 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11018 parsing for cmd, fixes bug #53694.
11020 2004-02-04 Marek Safar <marek.safar@seznam.cz>
11022 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11023 in the member name duplication tests. Property and operator name duplication
11024 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11026 2004-02-03 Marek Safar <marek.safar@seznam.cz>
11028 * interface.cs (PopulateMethod): Fixed crash when interface method
11029 returns not existing type (error test cs0246-3.cs).
11031 2004-02-02 Ravi Pratap M <ravi@ximian.com>
11033 * cs-parser.jay (interface_accessors): Re-write actions to also
11034 store attributes attached to get and set methods. Fix spelling
11037 (inteface_property_declaration): Modify accordingly.
11039 (InterfaceAccessorInfo): New helper class to store information to pass
11040 around between rules that use interface_accessors.
11042 * interface.cs (Emit): Apply attributes on the get and set
11043 accessors of properties and indexers too.
11045 * attribute.cs (ApplyAttributes): Modify accordingly to use the
11046 right MethodBuilder when applying attributes to the get and set accessors.
11048 2004-01-31 Miguel de Icaza <miguel@ximian.com>
11050 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11052 2004-01-26 Miguel de Icaza <miguel@ximian.com>
11054 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11056 2004-01-25 Miguel de Icaza <miguel@ximian.com>
11058 * cs-parser.jay: Remove YIELD token, instead use the new grammar
11059 changes that treat `yield' specially when present before `break'
11060 or `return' tokens.
11062 * cs-tokenizer.cs: yield is no longer a keyword.
11064 2004-01-23 Marek Safar <marek.safar@seznam.cz>
11066 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11067 setting for default constructors.
11068 For default constructors are almost every time set wrong Modifier. The
11069 generated IL code has been alright. But inside mcs this values was
11070 wrong and this was reason why several of my CLS Compliance tests
11073 2004-02-27 Martin Baulig <martin@ximian.com>
11075 * generics.cs (ConstructedType.ResolveType): Make the nested type
11076 stuff actually work.
11078 2004-02-25 Martin Baulig <martin@ximian.com>
11080 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11081 property; returns the type parameters just from the current type,
11082 ie. with the ones from outer classes.
11083 (DeclSpace.LookupGeneric): First search in the current class, then
11085 (DeclSpace.initialize_type_params): When hiding a type parameter
11086 from an outer class, put it into the `type_param_list' anyways.
11088 * expression.cs (MemberAccess.expr): Made this field protected.
11090 * class.cs (TypeContainer.Define): The `CurrentType' just contains
11091 the type parameters from the current class.
11093 * generic.cs (ConstructedType.ResolveType): Support nested generic
11094 types by taking the type parameters which we inherit from outer
11095 classes into account.
11096 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11097 support for nested generic types.
11099 2004-02-23 Martin Baulig <martin@ximian.com>
11101 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11102 field and check whether we're nested inside a generic type.
11103 (DeclSpace.ResolveType): If we're resolving to a generic type
11104 definition, create a ConstructedType and return its resolved type.
11105 (DeclSpace.initialize_type_params): New private method;
11106 initializes the `type_param_list' field from the type parameters
11107 from this and all enclosing classes.
11108 (DeclSpace.TypeParameters): Call initialize_type_params() unless
11109 we're already initialized.
11111 2004-02-23 Martin Baulig <martin@ximian.com>
11113 * class.cs (Method.Define): Create the generic method before
11114 calling DoDefine().
11115 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11116 the TypeContainer one); we use this for generic methods.
11118 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11119 parent's TypeBuilder.
11121 2004-02-18 Martin Baulig <martin@ximian.com>
11123 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11124 to check for equality.
11126 2004-02-05 Martin Baulig <martin@ximian.com>
11128 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11129 `ec.TypeContainer.CurrentType', use it instead of
11130 `ec.ContainerType' to check whether we're in the type's ctor.
11132 2004-01-29 Martin Baulig <martin@ximian.com>
11134 * expression.cs (Invocation.DoResolve): If we're a
11135 `ConstructedType', then we're actually a generic method, so
11136 rewrite the expr as a GenericMemberAccess.
11138 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11139 here; manually parse it into a string.
11141 2004-01-28 Martin Baulig <martin@ximian.com>
11143 * typemanager.cs (TypeManager.IsEqual): New static method.
11144 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11145 check for equality instead of using `=='.
11147 2004-01-26 Martin Baulig <martin@ximian.com>
11149 * decl.cs (DeclSpace.CurrentType): New public field.
11151 * expression.cs (This.ResolveBase): If we have an
11152 `ec.TypeContainer.CurrentType', use it instead of
11153 `ec.ContainerType'.
11155 * class.cs (TypeContainer.DefineType): If we're a generic type,
11156 create the `CurrentType' (unresolved).
11157 (TypeContainer.GenericType): New private field.
11158 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11159 it and store it in `GenericType' before creating the MemberCache.
11160 (TypeContainer.GetMembers): If we have a `GenericType', call
11161 TypeManager.FindMembers() on it.
11163 * interface.cs (Interface.GenericType): New private field.
11164 (Interface.DefineType): If we're a generic type, create the
11165 `CurrentType' (unresolved).
11166 (Interface.DefineMembers): If we have a `CurrentType', resolve it
11167 and store it in `GenericType' before creating the MemberCache.
11168 (Interface.GetMembers): If we have a `GenericType', call
11169 TypeManager.FindMembers() on it.
11171 2004-01-22 Martin Baulig <martin@ximian.com>
11173 * cs-parser.jay (namespace_or_type_name): Return an Expression,
11174 not a QualifiedIdentifier. This is what `type_name_expression'
11175 was previously doing.
11176 (type_name_expression): Removed; the code is now in
11177 `namespace_or_type_name'.
11178 (qualified_identifier): Removed, use `namespace_or_type_name'
11180 (QualifiedIdentifier): Removed this class.
11182 2004-01-22 Martin Baulig <martin@ximian.com>
11184 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11185 not a string as alias name.
11187 2004-01-21 Miguel de Icaza <miguel@ximian.com>
11189 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11190 #52730 bug, and instead compute correctly the need to use a
11191 temporary variable when requesting an address based on the
11192 static/instace modified of the field and the constructor.
11194 2004-01-21 Martin Baulig <martin@ximian.com>
11196 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11197 class and namespace before looking up aliases. Fixes #52517.
11199 2004-01-21 Martin Baulig <martin@ximian.com>
11201 * flowanalysis.cs (UsageVector.Merge): Allow variables being
11202 assinged in a 'try'; fixes exception4.cs.
11204 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11205 * class.cs : Implemented parameter-less constructor for TypeContainer
11207 * decl.cs: Attributes are now stored here. New property OptAttributes
11209 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11211 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11213 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11215 * typemanager.cs (CSharpSignature): Now reports also inner class name.
11216 (CSharpSignature): New method for indexer and property signature.
11218 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11220 * pending.cs (IsVirtualFilter): Faster implementation.
11222 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11224 * typemanager.cs: Avoid inclusion of same assembly more than once.
11226 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11228 * cs-parser.jay: Fixed problem where the last assembly attribute
11229 has been applied also to following declaration (class, struct, etc.)
11231 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11233 * class.cs: Added error CS0538, CS0539 reporting.
11234 Fixed crash on Microsoft runtime when field type is void.
11236 * cs-parser.jay: Added error CS0537 reporting.
11238 * pending.cs: Added error CS0535 reporting.
11239 Improved error report for errors CS0536, CS0534.
11241 2004-01-20 Miguel de Icaza <miguel@ximian.com>
11243 Merge a few bits from the Anonymous Method MCS tree.
11245 * statement.cs (ToplevelBlock): New class for toplevel methods,
11246 will hold anonymous methods, lifted variables.
11248 * cs-parser.jay: Create toplevel blocks for delegates and for
11249 regular blocks of code.
11251 2004-01-20 Martin Baulig <martin@ximian.com>
11253 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11254 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11255 and `NeedExplicitReturn'; added `IsLastStatement'.
11256 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11257 have a `ReturnLabel' or we're not unreachable.
11259 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11260 child's reachability; don't just override ours with it. Fixes
11261 #58058 (lluis's example).
11262 (FlowBranching): Added public InTryOrCatch(), InCatch(),
11263 InFinally(), InLoop(), InSwitch() and
11264 BreakCrossesTryCatchBoundary() methods.
11266 * statement.cs (Return): Do all error checking in Resolve().
11267 Unless we are the last statement in a top-level block, always
11268 create a return label and jump to it.
11269 (Break, Continue): Do all error checking in Resolve(); also make
11270 sure we aren't leaving a `finally'.
11271 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11272 statement in a top-level block.
11273 (Block.Flags): Added `IsDestructor'.
11274 (Block.IsDestructor): New public property.
11276 2004-01-20 Martin Baulig <martin@ximian.com>
11278 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11280 2004-01-20 Martin Baulig <martin@ximian.com>
11282 * statement.cs (Statement.ResolveUnreachable): New public method.
11283 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11284 (Block.Resolve): Resolve unreachable statements.
11286 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11288 * expression.cs: We need to fix the case where we do
11289 not have a temp variable here.
11291 * assign.cs: Only expression compound assignments need
11292 temporary variables.
11294 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11296 * flowanalysis.cs: Reduce memory allocation in a few ways:
11297 - A block with no variables should not allocate a bit
11299 - A method with no out parameters does not need any tracking
11300 for assignment of the parameters, so we need not allocate
11303 public readonly Type[] VariableTypes;
11304 public readonly string[] VariableNames;
11305 Are redundant. The data is already stored in the variable
11306 map, so we need not allocate another array for it.
11307 - We need to add alot of checks for if (params | locals) == null
11308 due to the first two changes.
11310 2004-01-18 Miguel de Icaza <miguel@ximian.com>
11312 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11313 implement IMemoryLocation, we store a copy on a local variable and
11314 take the address of it. Patch from Benjamin Jemlich
11316 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11317 to use a special "type_name_expression" rule which reduces the
11318 number of "QualifiedIdentifier" classes created, and instead
11319 directly creates MemberAccess expressions.
11321 2004-01-17 Miguel de Icaza <miguel@ximian.com>
11323 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11324 that fixes #52853. Null literal assignment to ValueType
11326 * class.cs (MethodData.Emit): Instead of checking the name of the
11327 method to determine if its a destructor, create a new derived
11328 class from Method called Destructor, and test for that.
11330 * cs-parser.jay: Create a Destructor object instead of a Method.
11332 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11336 2004-01-16 Miguel de Icaza <miguel@ximian.com>
11338 * expression.cs (Binary.ResolveOperator): Perform an implicit
11339 conversion from MethodGroups to their delegate types on the
11340 Addition operation.
11342 * delegate.cs: Introduce a new class DelegateCreation that is the
11343 base class for `NewDelegate' and `ImplicitDelegateCreation',
11344 factor some code in here.
11346 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11347 conversion from MethodGroups to compatible delegate types.
11349 * ecore.cs (Expression.Resolve): Do not flag error 654
11350 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11351 we allow conversions from MethodGroups to delegate types now.
11353 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11354 assignments in v2 either.
11356 2004-01-10 Miguel de Icaza <miguel@ximian.com>
11358 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11359 static read-only fields in ctors.
11361 Applied patch from Benjamin Jemlich
11363 * expression.cs (UnaryMutator): Avoid leaking local variables.
11365 2004-01-09 Miguel de Icaza <miguel@ximian.com>
11367 * cs-tokenizer.cs (IsCastToken): Allow the various native types
11368 here to return true, as they can be used like this:
11370 (XXX) int.MEMBER ()
11372 Fixed 49836 and all the other dups
11374 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
11376 * driver.cs: Implement /win32res and /win32icon.
11378 2004-01-08 Miguel de Icaza <miguel@ximian.com>
11380 * cs-parser.jay: Add a rule to improve error handling for the
11381 common mistake of placing modifiers after the type.
11383 2004-01-07 Miguel de Icaza <miguel@ximian.com>
11385 * cs-parser.jay (interface_event_declaration): Catch
11386 initialization of events on interfaces, and report cs0068
11388 * cs-parser.jay (interface_event_declaration): Catch
11389 initialization of events.
11391 * ecore.cs: Better report missing constructors.
11393 * expression.cs (Binary.ResolveOperator): My previous bug fix had
11394 the error reporting done in the wrong place. Fix.
11396 * expression.cs (Binary.ResolveOperator): Catch the
11397 operator + (E x, E y) error earlier, and later allow for implicit
11398 conversions in operator +/- (E e, U x) from U to the underlying
11401 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11402 52596, if the container class is abstract, the default constructor
11403 is protected otherwise its public (before, we were always public).
11405 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11408 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11409 Jemlich that fixes bug #52597, MCS was generating invalid code for
11410 idisposable structs. Thanks to Ben for following up with this
11413 2004-01-06 Miguel de Icaza <miguel@ximian.com>
11415 * driver.cs: Allow assemblies without code to be generated, fixes
11418 2004-01-07 Nick Drochak <ndrochak@gol.com>
11420 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11422 2004-01-05 Miguel de Icaza <miguel@ximian.com>
11424 * cs-parser.jay: Add rules to improve error reporting if fields or
11425 methods are declared at the namespace level (error 116)
11427 * Add rules to catch event add/remove
11429 2004-01-04 David Sheldon <dave-mono@earth.li>
11431 * expression.cs: Added matching ")" to error message for
11434 2004-01-03 Todd Berman <tberman@gentoo.org>
11436 * ecore.cs, attribute.cs:
11437 Applying fix from #52429.
11439 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11441 * ecore.cs, expression.cs, statement.cs:
11442 Total rewrite of how we handle branching. We
11443 now handle complex boolean expressions with fewer
11444 jumps. As well if (x == 0) no longer emits a ceq.
11446 if (x is Foo) is much faster now, because we generate
11449 Overall, we get a pretty big improvement on our benchmark
11450 tests. The code we generate is smaller and more readable.
11452 I did a full two-stage bootstrap. The patch was reviewed
11453 by Martin and Miguel.
11455 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11457 * cs-parser.jay: Make primary_expression not take a QI.
11458 we dont need this because the member_access rule covers
11459 us here. So we replace the rule with just IDENTIFIER.
11461 This has two good effects. First, we remove a s/r conflict.
11462 Second, we allocate many fewer QualifiedIdentifier objects.
11464 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11466 * attribute.cs: Handle MarshalAs attributes as pseudo, and
11467 set the correct information via SRE. This prevents
11468 hanging on the MS runtime. Fixes #29374.
11470 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11472 * convert.cs: correctly handle conversions to value types
11473 from Enum and ValueType as unboxing conversions.
11475 Fixes bug #52569. Patch by Benjamin Jemlich.
11477 2004-01-02 Ravi Pratap <ravi@ximian.com>
11479 * expression.cs (BetterConversion): Prefer int -> uint
11480 over int -> ulong (csc's behaviour). This fixed bug #52046.
11482 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
11484 * decl.cs (MemberCache.FindMembers): now returns a
11487 * typemanager.cs: In general, go with with ^^.
11488 (CopyNewMethods): take an IList.
11489 (RealMemberLookup): Only allocate an arraylist
11490 if we copy from two sets of methods.
11492 This change basically does two things:
11493 1) Fewer array lists allocated due to CopyNewMethods.
11494 2) the explicit cast in MemberList costed ALOT.
11496 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
11498 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11499 a hashtable to avoid needless string allocations when an identifier is
11500 used more than once (the common case).
11502 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11504 * pending.cs: MS's TypeBuilder.GetInterfaces ()
11505 is broken, it will not return anything. So, we
11506 have to use the information we have in mcs to
11509 * typemanager.cs: Add a cache for GetInterfaces,
11510 since this will now be used more often (due to ^^)
11512 (GetExplicitInterfaces) New method that gets the
11513 declared, not effective, interfaces on a type
11514 builder (eg, if you have interface IFoo, interface
11515 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11518 This patch makes MCS able to bootstrap itself on
11521 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11523 * expression.cs: Remove the Nop's that Miguel put
11526 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11528 * report.cs, codegen.cs: Give the real stack trace to
11529 the error when an exception is thrown.
11531 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11533 * decl.cs: only allocate hashtables for ifaces if
11536 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11538 * expression.cs: fix the error from cs0121-2.cs
11539 (a parent interface has two child interfaces that
11540 have a function with the same name and 0 params
11541 and the function is called through the parent).
11543 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
11545 * class.cs, rootcontext.cs, typmanager.cs: do not
11548 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
11550 * codegen.cs: remove stack for the ec flow branching.
11551 It is already a linked list, so no need.
11553 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
11555 * Makefile: Allow custom profiler here.
11557 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11559 * typemanager.cs (LookupType):
11560 - Use a static char [], because split takes
11561 a param array for args, so it was allocating
11563 - Do not store true in a hashtable, it boxes.
11565 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11567 * flowanalysis.cs: bytify common enums.
11569 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11571 * modifiers.cs: Add a new set of flags for the
11572 flags allowed on explicit interface impls.
11573 * cs-parser.jay: catch the use of modifiers in
11574 interfaces correctly.
11575 * class.cs: catch private void IFoo.Blah ().
11577 All related to bug #50572.
11579 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11581 * decl.cs: Rewrite the consistant accessability checking.
11582 Accessability is not linear, it must be implemented in
11583 a tableish way. Fixes #49704.
11585 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11587 * expression.cs: Handle negation in a checked context.
11588 We must use subtraction from zero. Fixes #38674.
11590 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11592 * class.cs: Ignore static void main in DLLs.
11593 * rootcontext.cs: Handle the target type here,
11594 since we are have to access it from class.cs
11595 * driver.cs: account for the above.
11597 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11599 * report.cs: Give line numbers and files if available.
11601 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
11603 * driver.cs: Implement /addmodule.
11605 * typemanager.cs: Change 'modules' field so it now contains Modules not
11608 2003-12-20 Martin Baulig <martin@ximian.com>
11610 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11611 (FieldBase.IsAssigned): Removed this field.
11612 (FieldBase.SetAssigned): New public method.
11613 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11615 2003-12-20 Martin Baulig <martin@ximian.com>
11617 * expression.cs (LocalVariableReference.DoResolve): Don't set
11618 `vi.Used' if we're called from DoResolveLValue().
11620 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11621 returns the usage vector it just merged into the current one -
11622 pass this one to UsageWarning().
11623 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11624 of the `EmitContext', don't call this recursively on our children.
11626 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
11628 * driver.cs: Implement /target:module.
11630 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
11632 * support.cs (CharArrayHashtable): New helper class.
11634 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
11635 char arrays, not strings, so we can avoid creating a string in
11636 consume_identifier if the identifier is a keyword.
11638 2003-12-16 Martin Baulig <martin@ximian.com>
11640 * statement.cs (LocalInfo.Assigned): Removed this property.
11641 (LocalInfo.Flags): Removed `Assigned'.
11642 (LocalInfo.IsAssigned): New public method; takes the EmitContext
11643 and uses flow analysis.
11644 (Block.UsageWarning): Made this method private.
11645 (Block.Resolve): Call UsageWarning() if appropriate.
11647 * expression.cs (LocalVariableReference.DoResolve): Always set
11648 LocalInfo.Used here.
11650 2003-12-13 Martin Baulig <martin@ximian.com>
11652 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11653 any value here; we're now using flow analysis to figure out
11654 whether a statement/block returns a value.
11656 2003-12-13 Martin Baulig <martin@ximian.com>
11658 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11660 (FlowBranching.MergeFinally): Don't call
11661 `branching.CheckOutParameters()' here, this is called in
11663 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11664 when adding the `finally' vector.
11666 2003-12-13 Martin Baulig <martin@ximian.com>
11669 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11670 actually work and also fix #48962.
11672 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
11674 * decl.cs: Do not check System.Object for nested types,
11675 since we know it does not have any. Big bang for buck:
11678 Run 1: 8.35 seconds
11679 Run 2: 8.32 seconds
11680 corlib: 17.99 seconds
11682 Run 1: 8.17 seconds
11683 Run 2: 8.17 seconds
11684 corlib: 17.39 seconds
11686 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
11688 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11689 time we are returning 0 members, so we save alot here.
11691 2003-12-11 Martin Baulig <martin@ximian.com>
11693 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11694 `MergeChild()', also just take the `FlowBranching' as argument;
11695 call Merge() on it and return the result.
11696 (FlowBranching.Merge): We don't need to do anything if we just
11699 2003-12-11 Martin Baulig <martin@ximian.com>
11701 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11702 them in an `ArrayList' to reduce memory usage. Thanks to Ben
11703 Maurer for this idea.
11705 2003-12-11 Martin Baulig <martin@ximian.com>
11707 * flowanalysis.cs (MergeResult): This class is now gone; we now
11708 use the `UsageVector' for this. The reason for this is that if a
11709 branching just has one sibling, we don't need to "merge" them at
11710 all - that's the next step to do.
11711 (FlowBranching.Merge): We now return a `UsageVector' instead of a
11714 2003-12-11 Martin Baulig <martin@ximian.com>
11716 Reworked flow analyis and made it more precise and bug-free. The
11717 most important change is that we're now using a special `Reachability'
11718 class instead of having "magic" meanings of `FlowReturns'. I'll
11719 do some more cleanups and optimizations and also add some more
11720 documentation this week.
11722 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11723 largely reworked this class.
11724 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11725 the new `Reachability' class instead of having "magic" values here.
11726 (FlowBranching): We're now using an instance of `Reachability'
11727 instead of having separate `Returns', `Breaks' etc. fields.
11729 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11730 based on flow analysis; ignore the return value of block.Emit ().
11732 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
11734 * driver.cs typemanager.cs: Find the mono extensions to corlib even
11735 if they are private.
11737 2003-12-09 Martin Baulig <martin@ximian.com>
11739 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11740 call them directly on the UsageVector.
11742 2003-12-09 Martin Baulig <martin@ximian.com>
11744 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11745 Changed return type from `FlowReturns' to `Reachability'.
11747 2003-12-09 Martin Baulig <martin@ximian.com>
11749 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11750 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11751 `Reachable' fields with a single `Reachability' one.
11753 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11755 * class.cs (FindMembers): Remove foreach's.
11760 Run 1: 8.74 seconds
11761 Run 2: 8.71 seconds
11764 Run 1: 8.64 seconds
11765 Run 2: 8.58 seconds
11768 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11773 This patch does a few things:
11774 1. EmptyStatement is now a singleton, so it is never reallocated.
11775 2. All blah is EmptyStatement constructs have been changed to
11776 blah == EmptyStatement.Value, which is much faster and valid
11777 now that EmptyStatement is a singleton.
11778 3. When resolving a block, rather than allocating a new array for
11779 the non-empty statements, empty statements are replaced with
11780 EmptyStatement.Value
11781 4. Some recursive functions have been made non-recursive.
11782 Mainly the performance impact is from (3), however (1) and (2) are needed for
11783 this to work. (4) does not make a big difference in normal situations, however
11784 it makes the profile look saner.
11789 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11790 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11791 Total memory allocated: 56397 KB
11794 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11795 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11796 Total memory allocated: 55666 KB
11798 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11800 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11801 than the hashtable in a hashtable version
11803 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11804 we always end up concating a string. This results in a huge perf
11805 loss, because many strings have to be tracked by the GC. In this
11806 patch, we first use a hashtable that works with two keys, so that
11807 the strings do not need to be concat'ed.
11811 Run 1: 8.74 seconds
11812 Run 2: 8.71 seconds
11815 Run 1: 8.65 seconds
11816 Run 2: 8.56 seconds
11818 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11820 * Makefile: Add a new target `do-time' that does a quick and simple
11821 profile, leaving easy to parse output.
11823 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
11825 * codegen.cs (Init): Create the dynamic assembly with
11826 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11828 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
11830 * support.cs: Make the PtrHashtable use only one
11831 instance of its comparer.
11833 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
11835 * typemanager.cs: Fix lookup of GetNamespaces.
11837 2003-11-29 Miguel de Icaza <miguel@ximian.com>
11839 * expression.cs: Removed redundant line.
11841 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11842 ArrayLists, use for loops with bounds.
11844 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11847 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11848 arraylists, use for loop with bounds.
11850 The above three changes give us a 0.071 second performance
11851 improvement out of 3.294 seconds down to 3.223. On my machine
11852 the above changes reduced the memory usage by 1,387 KB during
11853 compiler bootstrap.
11855 * cs-parser.jay (QualifiedIdentifier): New class used to represent
11856 QualifiedIdentifiers. Before we created a new string through
11857 concatenation, and mostly later on, the result would be
11858 manipulated by DecomposeQI through string manipulation.
11860 This reduced the compiler memory usage for bootstrapping from
11861 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11862 compile times in 0.05 seconds.
11864 2003-11-28 Dick Porter <dick@ximian.com>
11866 * support.cs: Do string compares with the Invariant culture.
11874 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11875 the comparison is done with the Invariant culture.
11877 2003-11-27 Miguel de Icaza <miguel@ximian.com>
11879 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11880 GetEnumerator method.
11882 (ProbeCollectionType): Iterate starting at the most specific type
11883 upwards looking for a GetEnumerator
11885 * expression.cs: Shift count can be up to 31 for int/uint and 63
11888 2003-11-26 Miguel de Icaza <miguel@ximian.com>
11890 * statement.cs (Block.LookupLabel): Also look for the label on the
11891 children blocks. Use a hash table to keep track of visited
11894 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11895 we actually did transform the other operand, otherwise fall back
11896 to the common codepath that casts to long.
11898 * cs-tokenizer.cs: Use the same code pattern as the int case.
11899 Maybe I should do the parsing myself, and avoid depending on the
11900 Parse routines to get this done.
11902 2003-11-25 Miguel de Icaza <miguel@ximian.com>
11904 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11905 which fixes bug 51347. This time test it.
11907 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11908 attributes for example can not tell the difference between these.
11909 The difference was only a syntax feature of the language.
11911 * attribute.cs: Apply attributes to delegates.
11913 * delegate.cs: Call the apply attributes method.
11915 2003-11-24 Miguel de Icaza <miguel@ximian.com>
11917 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11918 comparing 0 vs Byte.MinValue, not the value
11920 (ImplicitConversionRequired): When reporting a conversion error,
11921 use error 31 to print out the constant error instead of the
11924 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11925 which fixes bug 51347.
11927 2003-11-22 Miguel de Icaza <miguel@ximian.com>
11929 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
11930 which fixes the -warnaserror command line option.
11932 2003-11-21 Miguel de Icaza <miguel@ximian.com>
11934 * cfold.cs (DoNumericPromotions): During constant folding of
11935 additions on UIntConstant, special case intconstants with
11936 IntConstants like we do on the expression binary operator.
11938 2003-11-12 Miguel de Icaza <miguel@ximian.com>
11940 * convert.cs (ImplicitReferenceConversion): We were missing a case
11941 (System.Enum are not value types or class types, so we need to
11942 classify them separatedly).
11944 * driver.cs: We do not support error 2007.
11946 2003-11-12 Jackson Harper <jackson@ximian.com>
11948 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11949 system directory. Also use the full file name so users can
11950 libraries names mscorlib-o-tron.dll in a non system dir.
11952 2004-01-04 David Sheldon <dave-mono@earth.li>
11954 * expression.cs: Added matching ")" to error message for CS0077.
11956 2003-12-19 Martin Baulig <martin@ximian.com>
11958 * typemanager.cs (TypeManager.IsEqualGenericType): New public
11959 static method; see documentation in the method.
11960 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
11962 * convert.cs (Convert.ImplicitReferenceConversion,
11963 Convert.ImplicitReferenceConversionExists): Add support for
11964 generic type declarations; see gen-36.cs.
11966 2003-12-19 Martin Baulig <martin@ximian.com>
11968 * pending.cs (Pending.InterfaceMethod): Use
11969 `Type.IsAssignableFrom()' instead of `=='.
11971 2003-12-18 Martin Baulig <martin@ximian.com>
11973 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
11976 * convert.cs (Convert.ImplicitStandardConversionExists): Use
11977 `expr_type.Equals (target_type)' instead of `=='.
11979 2003-12-08 Martin Baulig <martin@ximian.com>
11981 * generics.cs (Constraints.Types): Removed.
11982 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
11984 (Constraints.ResolveTypes): New public method; resolves the
11985 TypeExpr's to Type's.
11986 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
11987 longer takes the constraints.
11988 (TypeParameter.DefineMethod): Likewise.
11989 (TypeParameter.DefineType): New public method. Calls
11990 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
11993 2003-12-08 Martin Baulig <martin@ximian.com>
11995 * convert.cs (Convert.ImplicitConversionStandard): Use
11996 `expr_type.Equals (target_type)' instead of `=='.
11998 2003-12-08 Martin Baulig <martin@ximian.com>
12000 * typemanager.cs (TypeManager.GetReferenceType): Call
12001 `Type.MakeByRefType ()'.
12003 2003-12-08 Martin Baulig <martin@ximian.com>
12005 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12006 just has some special meaning in some situations. For instance,
12007 it is allowed to use `where' as the name of a variable etc.
12009 2003-12-04 Martin Baulig <martin@ximian.com>
12011 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12012 `Type.MakeArrayType()' for array types.
12014 2003-11-18 Miguel de Icaza <miguel@ximian.com>
12016 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12019 (SizeOf.DoResolve): assign the `type_queried' field. This gets
12022 2003-11-16 Martin Baulig <martin@ximian.com>
12024 * codegen.cs (EmitContext.IsGeneric): Removed.
12026 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12027 ResolveGeneric() on the DeclSpace.
12029 2003-11-16 Martin Baulig <martin@ximian.com>
12031 * generic.cs (TypeArguments.Resolve):
12032 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12033 `ResolveType()' on it to get the Type.
12035 2003-11-15 Martin Baulig <martin@ximian.com>
12037 * generic.cs (ConstructedType.GetInterfaces): Override this.
12039 2003-11-14 Martin Baulig <martin@ximian.com>
12041 * interface.cs (Interface.DefineType): Define all type parameters
12042 before adding the interfaces we inherit.
12044 2003-11-11 Martin Baulig <martin@ximian.com>
12046 * generic.cs (ConstructedType.ResolveType): Always call
12047 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12049 2003-11-10 Martin Baulig <martin@ximian.com>
12051 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12052 (TypeManager.InitCoreTypes): Initialize them here, but instead of
12053 calling `ResolveType()' on them, directly assign their `Type'.
12055 2003-11-08 Martin Baulig <martin@ximian.com>
12057 * generic.cs (ConstructedType): Override `IsClass' etc.
12059 2003-11-08 Martin Baulig <martin@ximian.com>
12061 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12062 return value and the `out parent' parameter.
12063 (TypeContainer.DefineType): Moved the CS0644 check into
12064 GetClassBases(). Don't pass the interface types to the
12065 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12066 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12068 * ecore.cs (TypeExpr.IsAttribute): New property.
12069 (TypeExpr.GetInterfaces): New method.
12071 * interface.cs (Interface.GetInterfaceTypeByName): Return a
12072 TypeExpr instead of a Type.
12073 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12074 (Interface.DefineType): Don't pass the interface types to the
12075 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12076 them later and then call `TypeBulider.AddInterfaceImplementation()'.
12078 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12079 instead of a `Type[]'.
12080 (TypeManager.RegisterBuilder): Likewise.
12081 (TypeManager.AddUserInterface): Likewise.
12082 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12083 `Type[]' and also return a `TypeExpr[]'.
12084 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12086 2003-11-08 Martin Baulig <martin@ximian.com>
12088 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12091 2003-11-08 Martin Baulig <martin@ximian.com>
12093 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12094 TypeManager.ResolveExpressionTypes().
12096 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12097 instead of an Expression.
12098 (TypeExpr): This is now an abstract base class for `TypeExpression'.
12099 (TypeExpression): New public class; formerly known as `TypeExpr'.
12101 * expression.cs (ComposedCast): Derive from TypeExpr.
12103 * typemanager.cs (TypeManager.system_*_expr): These are now
12104 TypExpr's instead of Expression's.
12105 (TypeManager.ResolveExpressionTypes): New public static function;
12106 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12109 2003-11-06 Miguel de Icaza <miguel@ximian.com>
12111 * expression.cs (New.DoResolve): Do not dereference value that
12112 might be a null return.
12114 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12115 sure that the constant value has the right type. Fixes an
12116 unreported bug, similar to 50425.
12118 * const.cs (Const.LookupConstantValue): Call
12119 ImplicitStandardConversionExists before doing a conversion to
12120 avoid havng the TypeManager.ChangeType do conversions.
12122 Reduced the number of casts used
12124 (Const.ChangeType): New routine to enable reuse of the constant
12125 type changing code from statement.
12127 * typemanager.cs (ChangeType): Move common initialization to
12128 static global variables.
12132 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12133 every value type to go through, even if it was void. Fix that.
12135 * cs-tokenizer.cs: Use is_identifier_start_character on the start
12136 character of the define, and the is_identifier_part_character for
12137 the rest of the string.
12139 2003-11-05 Miguel de Icaza <miguel@ximian.com>
12141 * expression.cs (UnaryMutator.EmitCode): When I updated
12142 LocalVariableReference.DoResolve, I overdid it, and dropped an
12143 optimization done on local variable references.
12145 2003-11-04 Miguel de Icaza <miguel@ximian.com>
12147 * ecore.cs: Convert the return from Ldlen into an int.
12149 2003-10-20 Miguel de Icaza <miguel@ximian.com>
12151 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12152 the accessibility, this is a special case for toplevel non-public
12153 classes (internal for instance).
12155 2003-10-20 Nick Drochak <ndrochak@gol.com>
12157 * ecore.cs: Fix typo and build. Needed another right paren.
12159 2003-10-19 Miguel de Icaza <miguel@ximian.com>
12161 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
12162 `internal' case regular and protected, but not allowing protected
12163 to be evaluated later. Bug 49840
12165 2003-10-15 Miguel de Icaza <miguel@ximian.com>
12167 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12168 to kb.Nlast, and not the kb.nFirst to isolate the switch
12171 Extract the underlying type, so enumerations of long/ulong are
12172 treated like long/ulong.
12174 2003-10-14 Miguel de Icaza <miguel@ximian.com>
12176 * expression.cs (New): Overload the meaning of RequestedType to
12177 track the possible creation of the NewDelegate type, since
12178 DoResolve is invoked more than once for new constructors on field
12181 See bugs: #48800 and #37014
12183 * cs-parser.jay (declare_local_constants): Take an arraylist
12184 instead of a single constant.
12186 (local_constant_declaration): It should take a
12187 constant_declarators, not a constant_declarator. Fixes 49487
12189 * convert.cs: Fix error report.
12191 2003-10-13 Jackson Harper <jackson@ximian.com>
12193 * typemanager.cs (TypeToCoreType): Add float and double this fixes
12196 2003-11-03 Martin Baulig <martin@ximian.com>
12198 * expression.cs (ArrayAccess.GetStoreOpcode): Added
12199 `out bool has_type_arg'; if set, we need to pass the type to
12201 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12202 Stelem_Any/Ldelem_Any for generic parameters.
12204 2003-11-02 Martin Baulig <martin@ximian.com>
12206 * expression.cs (Invocation.EmitCall): Use
12207 `TypeManager.IsValueType()' to check whether it's a value type.
12208 Don't set `struct_call' when calling a method on a type parameter.
12210 2003-11-02 Martin Baulig <martin@ximian.com>
12212 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12213 and removed the TypeBuilder argument.
12215 * typemanager.cs (TypeManager.IsValueType): Return
12216 `t.IsGenericParameter || t.IsValueType'.
12218 2003-10-25 Martin Baulig <martin@ximian.com>
12220 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12221 call ConstructedType.Resolve() on it.
12223 * generic.cs (ConstructedType.Resolve): Set `type' on success.
12225 2003-10-25 Martin Baulig <martin@ximian.com>
12227 * class.cs (TypeContainer.GetClassBases): Changed
12228 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
12229 CS8214 reporting here.
12230 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12231 instead of a `Type' for our parent. In case of a recursive
12232 declaration (see tests/gen-23.cs for an example), our parent is a
12233 ConstructedType and it doesn't have its type set. So, first
12234 create our own TypeBuilder, then call constructed.Resolve() to get
12235 the parent's type and finally TypeBuilder.SetParent() it.
12237 * ecore.cs (TypeExpr.Name): New public virtual property.
12240 (ConstructedType): We're now a TypeExpr and not just an Expression.
12241 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12242 arguments here; this is done later.
12243 (ConstructedType.Resolve): New public method to resolve the type
12244 arguments and bind them.
12246 2003-10-21 Martin Baulig <martin@ximian.com>
12248 * convert.cs: Use `TypeManager.IsValueType' instead of
12249 'type.IsValueType' everywhere.
12251 * typemanager.cs (TypeManager.IsValueType): Return true for type
12252 parameters. The reason for this is that we need to box a type
12253 parameter when converting it to a reference type.
12255 * cs-parser.jay: Added support for default value expressions.
12257 * generics.cs (DefaultValueExpression): New public class.
12259 2003-10-17 Martin Baulig <martin@ximian.com>
12261 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12262 TypeContainer so we can also use this for Interfaces.
12263 (TypeParameter.Resolve): Likewise.
12265 * interface.cs (Interface.DefineType): Added support for generic
12268 * cs-parser.jay: Added support for generic structs and interfaces.
12270 2003-10-17 Martin Baulig <martin@ximian.com>
12272 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12273 call generic methods :-)
12275 2003-10-16 Martin Baulig <martin@ximian.com>
12277 * cs-parser.jay (namespace_or_type_name): Only create a
12278 GenericMemberAccess if we actually have type arguments.
12280 2003-10-13 Martin Baulig <martin@ximian.com>
12282 * class.cs (Method.Define): If we're a generic method, call
12283 TypeBuilder.DefineGenericMethod () before resolving
12285 (MethodData): Added .ctor which takes an additional MethodBuilder
12286 argument; this is used for generic methods.
12287 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12288 we already have a MethodBuilder.
12290 2003-10-10 Martin Baulig <martin@ximian.com>
12292 * class.cs (Method): Added .ctor which takes a `GenericMethod'
12293 instead of a `DeclSpace'. This is used for generic methods.
12295 * cs-parser.jay (method_header): Added support for generic
12296 methods; create a `GenericMethod' instance and pass it to the
12297 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12298 parameters and locals.
12300 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12301 since we already have the location. Check whether we're a generic
12302 type declaration or a generic method and create the correct type
12305 * generic.cs (TypeParameter.DefineMethod): New public method.
12306 (GenericMethod): New public class; derives from DeclSpace and is
12307 used for generic methods.
12309 2003-10-09 Martin Baulig <martin@ximian.com>
12311 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12313 (MethodCore.DoDefineParameters): Removed the TypeContainer
12314 argument; use the DeclSpace which was passed to the .ctor instead.
12315 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12316 TypeContainer; we only need a DeclSpace here.
12318 2003-10-09 Martin Baulig <martin@ximian.com>
12320 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12322 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12323 EmitContext's .ctor.
12325 2003-10-09 Martin Baulig <martin@ximian.com>
12327 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12328 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12329 AsAccessible(), moved them as well.
12331 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12333 2003-10-07 Miguel de Icaza <miguel@ximian.com>
12335 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12336 generation for >=, as spotted by Paolo, bug 48679.
12337 Patch from David Waite.
12339 * cs-tokenizer.cs: Add handling for #pragma.
12341 * cs-parser.jay: Allow for both yield and yield return in the
12342 syntax. The anti-cobolization of C# fight will go on!
12344 * class.cs (TypeBuilder.DefineType): Catch error condition here
12345 (Parent.DefineType erroring out and returning null).
12347 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12348 coping with enumerations variables, we were mistakenly processing
12349 them as a regular value type instead of built-in types. Fixes the
12352 * typemanager.cs (IsBuiltinOrEnum): New method.
12354 2003-09-30 Miguel de Icaza <miguel@ximian.com>
12356 * cs-parser.jay: Upgrade: yield now needs the return clause.
12358 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12360 * cs-parser.jay : Renamed yyName to yyNames related to jay.
12362 2003-09-29 Martin Baulig <martin@ximian.com>
12364 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12365 inflated generic methods.
12367 * generics.cs (ConstructedType): Distinguish between open and
12368 closed constructed types; correctly resolve the arguments.
12370 2003-09-22 Martin Baulig <martin@ximian.com>
12372 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12373 all type arguments meet their constraints.
12375 2003-09-19 Martin Baulig <martin@ximian.com>
12377 * decl.cs (MemberCache.SetupCacheForInterface): Take a
12378 `MemberCache parent' argument. Normally, an interface doesn't
12379 have a parent type except System.Object, but we use this in gmcs
12380 for generic type parameters.
12382 2003-09-18 Martin Baulig <martin@ximian.com>
12384 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12385 on `type.IsInterface'; don't check whether the type has a parent
12386 to determine whether it's an interface.
12388 2003-09-17 Martin Baulig <martin@ximian.com>
12390 * generic.cs (ConstructedType.ToString): Always use `name' as the
12393 2003-09-15 Martin Baulig <martin@ximian.com>
12395 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12397 * generic.cs (Constraints.Resolve): New public method; this is
12398 called to resolve the constraint types and to check whether all
12399 the constraints are correct.
12400 (Constraints.Types): New public property.
12401 (TypeParameter.Resolve): New public method; resolves all the
12402 type's constraints.
12404 * class.cs (TypeContainer.DefineType): Call
12405 TypeParameter.Resolve() before actually defining the type.
12407 2003-09-15 Martin Baulig <martin@ximian.com>
12409 * class.cs (TypeContainer.DefineType): Added an error flag to
12410 avoid reporting duplicate CS0146's ("class definition is
12413 * driver.cs (Driver.MainDriver): Abort if
12414 RootContext.ResolveTree() reported any errors.
12416 2003-09-07 Martin Baulig <martin@ximian.com>
12418 * report.cs (Error, Warning): Added overloaded versions which take
12419 a `params object[] args' and call String.Format().
12421 2003-09-07 Martin Baulig <martin@ximian.com>
12423 * decl.cs (DeclSpace..ctor): Don't call
12424 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12425 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
12426 (DeclSpace.RecordDecl): New method.
12428 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12430 2003-09-02 Ravi Pratap <ravi@ximian.com>
12432 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12433 value attributes to be applied to ParameterBuilders.
12435 * class.cs (MethodCore.LabelParameters): Make static and more
12436 generic so that it can be used from other places - like interface
12437 methods, for instance.
12439 * interface.cs (Interface.Emit): Call LabelParameters before
12440 emitting attributes on the InterfaceMethod.
12442 2003-09-07 Martin Baulig <martin@ximian.com>
12444 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12445 if the number of type parameters doesn't match.
12447 2003-09-04 Martin Baulig <martin@ximian.com>
12449 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12450 for arrays of generic type params (ie. `!0[]').
12452 2003-09-04 Martin Baulig <martin@ximian.com>
12454 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12457 2003-09-04 Martin Baulig <martin@ximian.com>
12459 * decl.cs (DeclSpace.LookupGeneric): New method.
12460 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12463 * generic.cs (TypeParameterExpr): Take a TypeParameter as
12464 argument, not just a string.
12465 (TypeParameter.Define): New public method; this is called to
12466 actually define the generic parameter; after this, you can use the
12467 new `Type' property to get the type.
12469 2003-09-04 Martin Baulig <martin@ximian.com>
12471 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12472 is now an ArrayList; initialize the result of the `TypeParameters'
12474 (DeclSpace.GetGenericData): Removed.
12475 (DeclSpace.LookupGeneric): Temporarily removed; we need to
12476 implement this in a different way.
12477 (DeclSpace.GetTypeParameters): Removed; there's now a
12478 `TypeParameters' property.
12479 (DeclSpace.TypeParameters): New public property.
12481 * generic.cs (Constraints): Make this class public.
12482 (TypeParameter): New public class.
12484 2003-09-04 Martin Baulig <martin@ximian.com>
12486 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12487 generic parameters.
12489 * class.cs (TypeContainer.DefineType): Call
12490 TypeBuilder.DefineGenericParameter () on all generic parameters if
12491 this is a generic type.
12493 2003-08-28 Martin Baulig <martin@ximian.com>
12495 * sample-stack.il: Compile this with ilasm: "ilasm /dll
12498 * sample-hello.cs: Compile this with gmcs: "gmcs
12499 /r:sample-stack.dll sample-hello.cs".
12501 2003-08-28 Martin Baulig <martin@ximian.com>
12503 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12504 the parameters to the generic type.
12506 2003-08-28 Martin Baulig <martin@ximian.com>
12508 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12510 2003-08-28 Martin Baulig <martin@ximian.com>
12512 * cs-parser.jay (opt_type_argument_list): Use
12513 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12514 (primary_expression): Replace `qualified_identifier' with `type_name'.
12515 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12517 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12518 parser to check whether it is syntactically a type parameter list;
12519 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12522 2003-08-26 Martin Baulig <martin@ximian.com>
12524 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12525 resolving aliases; fixes #47927.
12527 2003-08-26 Martin Baulig <martin@ximian.com>
12529 * statement.cs (Using.DoResolve): This is internally emitting a
12530 try/finally clause, so we need to set ec.NeedExplicitReturn if we
12531 do not always return. Fixes #47681.
12533 2003-08-26 Martin Baulig <martin@ximian.com>
12535 * decl.cs (MemberCore): Moved WarningNotHiding(),
12536 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12538 (AdditionResult): Make this nested in DeclSpace.
12539 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12540 argument; call NamespaceEntry.Define() unless we're nested in a
12543 * namespace.cs (Namespace.DefineName): New public function. This
12544 is called from DeclSpace's .ctor to add
12545 (Namespace.Lookup): Include DeclSpaces in the lookup.
12547 * class.cs (Operator): Derive from MemberBase, not MemberCore.
12549 * const.cs (Const): Derive from MemberBase, not MemberCore.
12551 2003-08-25 Martin Baulig <martin@ximian.com>
12553 * convert.cs (Convert.ExplicitReferenceConversion): When
12554 converting from an interface type to a class, unbox if the target
12555 type is a struct type. Fixes #47822.
12557 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12559 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12562 2003-08-22 Martin Baulig <martin@ximian.com>
12564 * class.cs (TypeManager.DefineType): When defining a nested type,
12565 call DefineType() on our parent; fixes #47801.
12567 2003-08-22 Martin Baulig <martin@ximian.com>
12569 * class.cs (MethodData.Define): While checking if a method is an
12570 interface implementation, improve the test a bit more to fix #47654.
12572 2003-08-22 Martin Baulig <martin@ximian.com>
12574 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12575 correctly; fixes #47722.
12577 2003-08-22 Martin Baulig <martin@ximian.com>
12579 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12580 LocalVariableReference, ensure it's not read-only. Fixes #47536.
12582 * statement.cs (Fixed.DoResolve): Make all variables read-only.
12584 2003-08-22 Martin Baulig <martin@ximian.com>
12586 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12587 can only be assigned in static constructors. Fixes #47161.
12589 2003-08-22 Martin Baulig <martin@ximian.com>
12591 Rewrote and improved the flow analysis code.
12593 * flowbranching.cs (FlowBranching): Make this class abstract.
12594 (FlowBranching.CreateBranching): New static function to create a
12595 new flow branching.
12596 (FlowBranchingBlock, FlowBranchingException): New classes.
12597 (FlowBranching.UsageVector.Type): New public readonly field.
12598 (FlowBranching.UsageVector.Breaks): Removed the setter.
12599 (FlowBranching.UsageVector.Returns): Removed the setter.
12600 (FlowBranching.UsageVector): Added Break(), Return(),
12601 NeverReachable() and Throw() methods to modify the reachability.
12602 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12603 done by FlowBranching.Merge().
12604 (FlowBranching.UsageVector.MergeChild): New method; merges the
12605 merge result into the current vector.
12606 (FlowBranching.Merge): New abstract method to merge a branching.
12608 2003-08-12 Martin Baulig <martin@ximian.com>
12610 * expression.cs (Indirection.CacheTemporaries): Create the
12611 LocalTemporary with the pointer type, not its element type.
12613 2003-08-10 Miguel de Icaza <miguel@ximian.com>
12615 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12616 token was a keyword or not.
12618 Add `error' options where an IDENTIFIER was expected; Provide
12619 CheckToken and CheckIdentifierToken convenience error reporting
12622 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12624 * decl.cs: Rename `NamespaceEntry Namespace' public field into
12625 NameSpaceEntry NameSpaceEntry.
12627 (LookupInterfaceOrClass): Avoid creating a full qualified name
12628 from namespace and name: avoid doing lookups when we know the
12629 namespace is non-existant. Use new Tree.LookupByNamespace which
12630 looks up DeclSpaces based on their namespace, name pair.
12632 * driver.cs: Provide a new `parser verbose' to display the
12633 exception thrown during parsing. This is turned off by default
12634 now, so the output of a failure from mcs is more graceful.
12636 * namespace.cs: Track all the namespaces defined in a hashtable
12639 (IsNamespace): New method
12641 2003-08-09 Miguel de Icaza <miguel@ximian.com>
12643 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
12644 we know that we need to concatenate (full typename can never be
12649 * statement.cs: Use a bitfield; Do not initialize to null things
12650 which are done by the constructor by default.
12652 * cs-parser.jay: bug fix, parameter was 4, not 3.
12654 * expression.cs: Just use the property;
12656 * statement.cs: No need for GetVariableInfo method.
12658 2003-08-08 Martin Baulig <martin@ximian.com>
12660 * flowanalysis.cs (FlowReturns): This is now nested in the
12661 `FlowBranching' class.
12662 (MyBitVector): Moved this here from statement.cs.
12663 (FlowBranching.SiblingType): New enum type.
12664 (FlowBranching.CreateSibling): Added `SiblingType' argument.
12666 2003-08-07 Martin Baulig <martin@ximian.com>
12668 * flowanalysis.cs (FlowBranchingType): This is now nested in the
12669 `FlowBranching' class and called `BranchingType'.
12671 2003-08-07 Martin Baulig <martin@ximian.com>
12673 * flowanalysis.cs: Moved all the control flow analysis code into
12676 2003-08-07 Martin Baulig <martin@ximian.com>
12678 * assign.cs (Assign.DoResolve): `target' must either be an
12679 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
12682 2003-08-07 Miguel de Icaza <miguel@ximian.com>
12684 * expression.cs (BinaryMethod): This kind of expression is created by the
12685 Binary class if it determines that the operator has to be handled
12688 (BinaryDelegate): This kind of expression is created if we are
12689 dealing with a + or - operator on delegates.
12691 (Binary): remove method, argumetns, and DelegateOperator: when
12692 dealing with methods,
12694 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12696 * statement.cs (Block): use bitfields for the three extra booleans
12697 we had in use. Remove unused topblock parameter.
12699 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12701 * assign.cs: Drop extra unneeded tests.
12703 2003-08-06 Miguel de Icaza <miguel@ximian.com>
12705 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12707 * statement.cs (Foreach): Use VariableStorage instead of
12710 * codegen.cs (VariableStorage): New class used by clients that
12711 require a variable stored: locals or fields for variables that
12712 need to live across yield.
12714 Maybe provide a convenience api for EmitThis+EmitLoad?
12716 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12719 2003-08-05 Miguel de Icaza <miguel@ximian.com>
12721 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12722 RemapParameterLValue): New methods that are used to turn a
12723 precomputed FieldInfo into an expression like this:
12727 The idea is to use this instead of making LocalVariableReference
12728 have more than one meaning.
12730 * cs-parser.jay: Add error production to BASE.
12732 * ecore.cs: Deal with TypeManager.GetField returning null, which
12733 is now a valid return value.
12735 (FieldExprNoAddress): New expression for Fields whose address can
12738 * expression.cs (LocalVariableReference): During the resolve
12739 phases, create new expressions if we are in a remapping context.
12740 Remove code that dealt with remapping here.
12742 (ParameterReference): same.
12744 (ProxyInstance): New expression, like the `This' expression, but
12745 it is born fully resolved. We know what we are doing, so remove
12746 the errors that are targeted to user-provided uses of `this'.
12748 * statement.cs (Foreach): our variable is now stored as an
12749 Expression; During resolution, follow the protocol, dont just
12750 assume it will return this.
12752 2003-08-06 Martin Baulig <martin@ximian.com>
12754 * support.cs (SeekableStreamReader.cs): New public class.
12756 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12757 SeekableStreamReader instead of the normal StreamReader.
12759 2003-08-04 Martin Baulig <martin@ximian.com>
12761 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12762 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12763 deambiguate casts and delegate invocations.
12764 (parenthesized_expression): Use the new tokens to ensure this is
12765 not a cast of method invocation.
12767 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12768 when reading a `)' and Deambiguate_CloseParens () was previously
12771 * expression.cs (ParenthesizedExpression): New class. This is
12772 just used for the CS0075 test.
12773 (Binary.DoResolve): Check for CS0075.
12775 2003-07-29 Ravi Pratap <ravi@ximian.com>
12777 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12778 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12779 reference comparison.
12781 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12782 examine the ReturnType for equality - this is necessary in the
12783 cases of implicit and explicit operators whose signature also
12784 includes the return type.
12786 2003-07-26 Miguel de Icaza <miguel@ximian.com>
12788 * namespace.cs: Cache the result of the namespace computation,
12789 instead of computing it every time.
12791 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12793 * decl.cs: Use a global arraylist that we reuse over invocations
12794 to avoid excesive memory consumption. Reduces memory usage on an
12795 mcs compile by one meg (45 average).
12797 * typemanager.cs (LookupTypeReflection): In .NET pointers are
12798 private, work around that.
12800 2003-07-23 Miguel de Icaza <miguel@ximian.com>
12802 * literal.cs (IntLiteral): Define Zero and One static literals.
12804 * cs-parser.jay (integer_literal): use static literals to reduce
12805 memory usage for the most used literals (0, 1 and -1). 211kb
12806 reduced in memory usage.
12808 Replace all calls to `new ArrayList' with `new
12809 ArrayList(4)' which is a good average number for most allocations,
12810 and also requires only 16 bytes of memory for its buffer by
12813 This reduced MCS memory usage in seven megabytes for the RSS after
12816 2003-07-28 Ravi Pratap <ravi@ximian.com>
12818 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12819 handle params methods the correct way by forming only one
12820 applicable set with params and normal methods in them. Earlier we
12821 were looking at params methods only if we found no normal methods
12822 which was not the correct thing to do.
12824 (Invocation.BetterFunction): Take separate arguments indicating
12825 when candidate and the best method are params methods in their
12828 This fixes bugs #43367 and #46199.
12830 * attribute.cs: Documentation updates.
12832 (CheckAttribute): Rename to CheckAttributeTarget.
12833 (GetValidPlaces): Rename to GetValidTargets.
12835 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12836 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12840 2003-07-28 Miguel de Icaza <miguel@ximian.com>
12842 * codegen.cs: Compute IsGeneric correctly.
12844 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
12847 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
12848 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
12849 regressions, and I was chasing more bugs than I required.
12851 * interface.cs: Use expressions for base type names (like classes
12852 and structs have been doing for a while now), and resolve that.
12853 This patch should probably go into head as well.
12855 This makes it one less user of FindType.
12857 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12859 This compiler can not self host currently. Need to fix that.
12861 * Makefile: compile to `gmcs.exe'
12863 * driver.cs: Turn on v2 by default on gmcs.
12865 * generic.cs (ConstructedType): Does no longer take a container
12866 type argument; That will be taken care of later.
12868 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
12869 Use SimpleName to resolve for now, so we can continue the work on
12870 the parser, until we get Type.GetType that understands generics.
12872 (ConstructedType.ToString): Implement
12874 (TypeArguments.Resolve): Resolve the child expressions as types.
12876 * cs-parser.jay: Rename interface_constraints to
12877 type_parameter_constraints
12879 (namespace_or_type_name): Only use constructed types for the basic
12880 construction, we will deal with identifier<...> later.
12882 (type/type_name): No longer call DecomposeQI, as
12883 namespace_or_type_name is always decoded now.
12885 2003-07-22 Ravi Pratap <ravi@ximian.com>
12887 * expression.cs (Invocation.OverloadResolve): Follow the spec more
12888 closely: we eliminate methods in base types when we have an
12889 applicable method in a top-level type.
12891 Please see section 14.5.5.1 for an exact description of what goes
12894 This fixes bug #45127 and a host of other related to corlib compilation.
12896 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12897 array is the method corresponding to the top-level type (this is
12898 because of the changes made to icall.c) so we change this
12901 (MethodGroupExpr.Name): This too.
12903 * typemanager.cs (GetElementType): New method which does the right
12904 thing when compiling corlib.
12906 * everywhere: Make use of the above in the relevant places.
12908 2003-07-22 Martin Baulig <martin@ximian.com>
12910 * cs-parser.jay (invocation_expression): Moved
12911 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12912 `cast_expression', but create a InvocationOrCast which later
12913 resolves to either an Invocation or a Cast.
12915 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12916 method; call this before EmitStatement() to make sure that this
12917 expression can be used as a statement.
12919 * expression.cs (InvocationOrCast): New class; resolves to either
12920 an Invocation or a Cast.
12922 * statement.cs (StatementExpression): Call ResolveStatement() on
12923 the ExpressionStatement before emitting it.
12925 2003-07-21 Martin Baulig <martin@ximian.com>
12927 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12928 `ref' and `out' attributes match; fixes #46220.
12929 (MemberAccess.ResolveMemberAccess): You can't reference a type
12930 through an expression; fixes #33180.
12931 (Indexers.GetIndexersForType): Don't return the indexers from
12932 interfaces the class implements; fixes #46502.
12934 2003-07-21 Martin Baulig <martin@ximian.com>
12936 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12937 CS0661 checks; fixes bug #30442.
12939 2003-07-21 Martin Baulig <martin@ximian.com>
12941 * decl.cs (AdditionResult): Added `Error'.
12943 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12945 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
12946 cs0031.cs actually work.
12948 2003-07-20 Miguel de Icaza <miguel@ximian.com>
12950 * cs-parser.jay (namespace_name): do not use
12951 namespace_or_type_name, use qualified_identifier, because
12952 namespace_or_type_name will soon return a composed expression
12953 instead of a string.
12955 (namespace_or_type_name): Instead of returning a string, now this
12956 production returns an expression.
12958 * codegen.cs (EmitContext): Setup IsGeneric property based on
12959 whether our DeclSpace is generic, our the method is generic.
12961 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
12962 the method is generic.
12964 * cs-parser.jay (type_arguments, opt_type_argument_list,
12965 type_parameters, type_parameter_list, opt_type_parameter_list,
12966 type_parameter,, opt_type_parameter_constraints_clauses,
12967 type_parameter_constraints_clauses,
12968 type_parameter_constraint_clause, type_parameter_constraint,
12969 interface_constraints): Add new production
12971 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
12972 DeclSpace is generic or not.
12974 (DeclSpace.SetParameterInfo): New routine, used to set the
12975 parameter info for a type.
12977 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
12978 returns a GenericTypeExpr
12980 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
12981 generic, lookup the generic argument.
12983 * attribute.cs: Do not allow TypeParameterExpressions in
12986 * class.cs: Do not allow the Main method to be defined in a
12989 * expression.cs (SizeOf): Do not allow generic types to be used as
12990 arguments to sizeof.
12992 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
12993 it: whether a type is generic or not. Only works for types we are
12994 currently building for now.
12996 2003-07-20 Martin Baulig <martin@ximian.com>
12998 * namespace.cs: Fixed that bug which caused a crash when compiling
12999 the debugger's GUI.
13001 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13003 * typemanager.cs (LookupTypeReflection): Never expose types which
13004 are NotPublic, NestedPrivate, NestedAssembly, or
13005 NestedFamANDAssem. We used to return these, and later do a check
13006 that would report a meaningful error, but the problem is that we
13007 would not get the real match, if there was a name override.
13009 2003-07-18 Miguel de Icaza <miguel@ximian.com>
13011 * namespace.cs (Namespace, Name): Do not compute the namespace
13012 name dynamically, compute it in the constructor. This reduced
13013 memory usage by 1697 KB.
13015 * driver.cs: Use --pause to pause at the end.
13017 2003-07-17 Peter Williams <peter@newton.cx>
13019 * Makefile: Change the name of the test target so that it doesn't
13020 conflict with the recursive test target.
13022 2003-07-17 Miguel de Icaza <miguel@ximian.com>
13024 * expression.cs (LocalVariableReference.Emit, EmitAssign,
13025 AddressOf): Do not use EmitThis, that was wrong, use the actual
13028 2003-07-15 Miguel de Icaza <miguel@ximian.com>
13030 * class.cs (MethodData.Define): While checking if a method is an
13031 interface implementation, improve the test: If we are not public
13032 (use new test here: use the computed MethodAttributes directly,
13033 instead of the parsed modifier flags) check if the `implementing'
13034 method comes from an interface or not.
13036 * pending.cs (VerifyPendingMethods): Slightly better error
13039 * makefile: add test target that does the mcs bootstrap.
13041 2003-07-16 Ravi Pratap <ravi@ximian.com>
13043 * interface.cs (Define): Do nothing here since there are no
13044 members to populate etc. Move the attribute emission out of here
13045 since this was just totally the wrong place to put it. Attribute
13046 application happens during the 'Emit' phase, not in the 'Define'
13049 (Emit): Add this method and move the attribute emission here
13051 * rootcontext.cs (EmitCode): Call the Emit method on interface
13054 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13056 * expression.cs (OverloadResolve): Report error only if Location
13057 is not 'Null' which means that there was a probe going on.
13059 2003-07-14 Martin Baulig <martin@ximian.com>
13061 * expression.cs (ConditionalLogicalOperator): New public class to
13062 implement user defined conditional logical operators.
13063 This is section 14.11.2 in the spec and bug #40505.
13065 2003-07-14 Martin Baulig <martin@ximian.com>
13067 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13069 2003-07-14 Martin Baulig <martin@ximian.com>
13071 * codegen.cs (EmitContext.InFixedInitializer): New public field.
13073 * ecore.cs (IVariable.VerifyFixed): New interface method.
13075 * expression.cs (Unary.ResolveOperator): When resolving the `&'
13076 operator, check whether the variable is actually fixed. Fixes bug
13077 #36055. Set a variable definitely assigned when taking its
13078 address as required by the spec.
13080 * statement.cs (LocalInfo.IsFixed): New field.
13081 (LocalInfo.MakePinned): Set `IsFixed' to true.
13083 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13085 * attribute.cs (Attribute.Resolve): While doing a Member lookup
13086 for .ctors, ensure that we only ask for members declared in the
13087 attribute type (BindingFlags.DeclaredOnly).
13091 * expression.cs (Error_WrongNumArguments): Report error 1501
13092 correctly the way CSC does.
13094 2003-07-13 Martin Baulig <martin@ximian.com>
13096 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13097 lookup on the fully qualified name, to make things like "X.X" work
13098 where "X.X" is a fully qualified type name, but we also have a
13099 namespace "X" in the using list. Fixes #41975.
13101 2003-07-13 Martin Baulig <martin@ximian.com>
13103 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13104 function. If we're a CompoundAssign, we need to create an embedded
13105 CompoundAssign, not an embedded Assign.
13106 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13109 2003-07-13 Martin Baulig <martin@ximian.com>
13111 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13112 work to fix bug #46088.
13114 2003-07-13 Ravi Pratap <ravi@ximian.com>
13116 * class.cs (Operator.Emit): Do not emit attributes here - it is
13117 taken care of by the Method class that we delegate too. This takes
13118 care of bug #45876.
13120 2003-07-10 Martin Baulig <martin@ximian.com>
13122 * expression.cs (TypeOfVoid): New class.
13123 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
13125 2003-07-10 Martin Baulig <martin@ximian.com>
13127 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13130 2003-07-10 Martin Baulig <martin@ximian.com>
13132 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13133 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13135 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13137 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13139 2003-07-10 Martin Baulig <martin@ximian.com>
13141 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13142 of decimal. Fixes #42850.
13144 NOTE: I also fixed the created byte blob, but this doesn't work on
13145 the MS runtime and csc never produces any byte blobs for decimal
13148 2003-07-10 Martin Baulig <martin@ximian.com>
13150 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13151 structs; fixes #32068.
13152 (Block.AddChildVariableNames): Fixed #44302.
13154 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13156 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13158 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13160 * attribute.cs: And this test is onger needed.
13162 2003-07-08 Martin Baulig <martin@ximian.com>
13164 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13165 inaccessible types. Fixes #36313.
13167 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13169 * namespace.cs (NamespaceEntry): Create implicit entries for all
13170 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13171 implicit entries for N1.N2 and N1.
13173 2003-07-08 Martin Baulig <martin@ximian.com>
13175 Rewrote the handling of namespaces to fix a lot of the issues
13176 wrt. `using' aliases etc.
13178 * namespace.cs (Namespace): Splitted this class into a
13179 per-assembly `Namespace' and a per-file `NamespaceEntry'.
13181 * typemanager.cs (TypeManager.IsNamespace): Removed.
13182 (TypeManager.ComputeNamespaces): Only compute namespaces from
13183 loaded assemblies here, not the namespaces from the assembly we're
13184 currently compiling.
13186 2003-07-08 Martin Baulig <martin@ximian.com>
13188 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13190 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13192 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13195 I thought about the memory savings here, but LookupTypeReflection
13196 is used under already very constrained scenarios. Compiling
13197 corlib or mcs only exposes one hit, so it would not really reduce
13198 any memory consumption.
13200 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13202 * typemanager.cs: fixes bug #45889 by only adding public types from
13203 other assemblies to the list of known types.
13205 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13207 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13208 on the type we resolved.
13210 2003-07-05 Martin Baulig <martin@ximian.com>
13212 * pending.cs (PendingImplementation.ParentImplements): Don't
13213 create the proxy if the parent is abstract.
13215 * class.cs (TypeContainer.DefineIndexers): Process explicit
13216 interface implementations first. Fixes #37714.
13218 2003-07-04 Miguel de Icaza <miguel@ximian.com>
13220 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13221 defined recursively; but since we modify the input parameters
13222 (left is set to `this' temporarily), we reset this value if the
13223 left_is_explicit is false, which gives the original semantics to
13226 * literal.cs (NullPointer): new class used to represent a null
13227 literal in a pointer context.
13229 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13230 type is a pointer, use a NullPointer object instead of a
13231 NullLiteral. Closes 43687
13233 (ExplicitConversion): Convert pointer values using
13234 the conv opcode to the proper type.
13236 * ecore.cs (New): change ValueTypeVariable property into a method,
13237 that returns whether the valuetype is suitable for being used.
13239 * expression.cs (Binary.DoNumericPromotions): Only return if we
13240 the int constant was a valid uint, and we can return both left and
13241 right as uints. If not, we continue processing, to trigger the
13242 type conversion. This fixes 39018.
13244 * statement.cs (Block.EmitMeta): During constant resolution, set
13245 the CurrentBlock property on the emitcontext, so that we resolve
13246 constants propertly.
13248 2003-07-02 Martin Baulig <martin@ximian.com>
13250 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13251 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13253 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13254 than emitting it here.
13256 * statement.cs: Fixed some more flow analysis bugs.
13258 2003-07-02 Martin Baulig <martin@ximian.com>
13260 * class.cs (MethodData.Define): When implementing interface
13261 methods, set Final unless we're Virtual.
13263 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13264 check work for interface methods.
13266 2003-07-01 Martin Baulig <martin@ximian.com>
13268 * ecore.cs (EmitContext.This): Replaced this property with a
13269 GetThis() method which takes a Location argument. This ensures
13270 that we get the correct error location for a CS0188.
13272 2003-07-01 Miguel de Icaza <miguel@ximian.com>
13274 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13275 ImplicitStandardConversion.
13277 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13279 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
13281 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13284 2003-06-30 Miguel de Icaza <miguel@ximian.com>
13286 * class.cs (Constructor.Define): Turn off initlocals for unsafe
13289 (MethodData.Define): Turn off initlocals for unsafe methods.
13291 2003-06-29 Miguel de Icaza <miguel@ximian.com>
13293 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13294 complete; Fixes #37521.
13296 * delegate.cs: Use Modifiers.TypeAttr to compute the
13297 TypeAttributes, instead of rolling our own. This makes the flags
13298 correct for the delegates.
13300 2003-06-28 Miguel de Icaza <miguel@ximian.com>
13302 * class.cs (Constructor.Define): Set the private flag for static
13303 constructors as well.
13305 * cs-parser.jay (statement_expression): Set the return value to
13306 null, to avoid a crash when we catch an error.
13308 2003-06-24 Miguel de Icaza <miguel@ximian.com>
13310 * cs-parser.jay: Applied patch from Jackson that adds support for
13311 extern and unsafe modifiers to destructor declarations.
13313 * expression.cs: Report error 21 if the user is trying to index a
13316 * driver.cs: Add an error message, suggested by the bug report.
13318 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13319 if we do not have a ": this ()" constructor initializer. Fixes 45149
13321 2003-06-14 Miguel de Icaza <miguel@ximian.com>
13323 * namespace.cs: Add some information to reduce FAQs.
13325 2003-06-13 Miguel de Icaza <miguel@ximian.com>
13327 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13328 underlying enumeration types. Fixes #43915.
13330 * expression.cs: Treat ushort/short as legal values to be used in
13331 bitwise operations.
13333 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13335 * delegate.cs: transfer custom attributes for paramenters from
13336 the delegate declaration to Invoke and BeginInvoke.
13338 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13340 * attribute.cs: handle custom marshalers and emit marshal info
13343 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
13345 * makefile.gnu: Added anonymous.cs to the compiler sources.
13347 2003-05-28 Miguel de Icaza <miguel@ximian.com>
13349 * iterators.cs: Change the name of the proxy class to include two
13352 * cs-parser.jay: Update grammar to include anonymous methods.
13354 * anonymous.cs: new file.
13356 2003-05-27 Miguel de Icaza <miguel@ximian.com>
13358 * class.cs (Field.Define): Add missing test for pointers and
13361 2003-05-27 Ravi Pratap <ravi@ximian.com>
13363 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13364 we use the stobj opcode.
13366 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13367 since it wasn't the correct fix.
13369 It still is puzzling that we are required to use stobj for IntPtr
13370 which seems to be a ValueType.
13372 2003-05-26 Miguel de Icaza <miguel@ximian.com>
13374 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13375 during regular simple name resolution. Now, the trick is that
13376 instead of returning for processing the simplename, we do a
13377 TypeManager.LookupType (ie, a rooted lookup as opposed to a
13378 contextual lookup type). If a match is found, return that, if
13379 not, return for further composition.
13381 This fixes long-standing 30485.
13383 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13384 using the address to initialize an object, do an Stobj instead of
13385 using the regular Stelem.
13387 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13388 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13389 Because if we are a BaseIndexerAccess that value will be true.
13392 * statement.cs (GotoCase.Resolve): Return after reporting an
13393 error, do not attempt to continue.
13395 * expression.cs (PointerArithmetic.Emit): If our operand is a
13396 long, convert our constants to match the operand before
13397 multiplying. Convert to I type before adding. Fixes 43670.
13399 2003-05-14 Ravi Pratap <ravi@ximian.com>
13401 * enum.cs (ImplicitConversionExists) : Rename to
13402 ImplicitEnumConversionExists to remove ambiguity.
13404 * ecore.cs (NullCast): New type of cast expression class which
13405 basically is very similar to EmptyCast with the difference being
13406 it still is a constant since it is used only to cast a null to
13408 (eg. (string) null)
13410 * convert.cs (ImplicitReferenceConversion): When casting a null
13411 literal, we return a NullCast.
13413 * literal.cs (NullLiteralTyped): Remove - I don't see why this
13414 should be around anymore.
13416 The renaming (reported was slightly wrong). Corrections:
13418 ConvertImplicitStandard -> ImplicitConversionStandard
13419 ConvertExplicitStandard -> ExplicitConversionStandard
13421 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13422 before passing them in !
13424 * convert.cs (ImplicitConversionStandard): When comparing for
13425 equal expr and target types, ensure that expr is not a
13428 In general, we must not be checking (expr_type ==
13429 target_type) in the top level conversion methods
13430 (ImplicitConversion, ExplicitConversion etc). This checking is
13431 done in the methods that they delegate to.
13433 2003-05-20 Miguel de Icaza <miguel@ximian.com>
13435 * convert.cs: Move Error_CannotConvertType,
13436 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13437 ImplicitNumericConversion, ImplicitConversionExists,
13438 ImplicitUserConversionExists, StandardConversionExists,
13439 FindMostEncompassedType, FindMostSpecificSource,
13440 FindMostSpecificTarget, ImplicitUserConversion,
13441 ExplicitUserConversion, GetConversionOperators,
13442 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13443 TryImplicitIntConversion, Error_CannotConvertImplicit,
13444 ConvertImplicitRequired, ConvertNumericExplicit,
13445 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13446 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13449 Perform the following renames:
13451 StandardConversionExists -> ImplicitStandardConversionExists
13452 ConvertImplicit -> ImplicitConversion
13453 ConvertImplicitStandard -> ImplicitStandardConversion
13454 TryImplicitIntConversion -> ImplicitIntConversion
13455 ConvertImplicitRequired -> ImplicitConversionRequired
13456 ConvertNumericExplicit -> ExplicitNumericConversion
13457 ConvertReferenceExplicit -> ExplicitReferenceConversion
13458 ConvertExplicit -> ExplicitConversion
13459 ConvertExplicitStandard -> ExplicitStandardConversion
13461 2003-05-19 Martin Baulig <martin@ximian.com>
13463 * statement.cs (TypeInfo.StructInfo): Made this type protected.
13464 (TypeInfo): Added support for structs having structs as fields.
13466 * ecore.cs (FieldExpr): Implement IVariable.
13467 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13468 VariableInfo for the field.
13470 2003-05-18 Martin Baulig <martin@ximian.com>
13472 * expression.cs (This.DoResolve): Report a CS0027 if we're
13473 emitting a field initializer.
13475 2003-05-18 Martin Baulig <martin@ximian.com>
13477 * expression.cs (This.ResolveBase): New public function.
13478 (This.DoResolve): Check for CS0188.
13480 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13483 * ecore.cs (MethodGroupExpr.DoResolve): Set the
13484 `instance_expression' to null if we don't have any non-static
13487 2003-05-18 Martin Baulig <martin@ximian.com>
13489 Reworked the way how local variables and parameters are handled by
13490 the flow analysis code.
13492 * statement.cs (TypeInfo, VariableMap): New public classes.
13493 (VariableInfo): New public class. This is now responsible for
13494 checking whether a variable has been assigned. It is used for
13495 parameters and local variables.
13496 (Block.EmitMeta): Take the InternalParameters as argument; compute
13497 the layout of the flow vectors here.
13498 (Block.LocalMap, Block.ParameterMap): New public properties.
13499 (FlowBranching): The .ctor doesn't get the InternalParameters
13500 anymore since Block.EmitMeta() now computes the layout of the flow
13502 (MyStructInfo): This class is now known as `StructInfo' and nested
13503 in `TypeInfo'; we don't access this directly anymore.
13505 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13506 property and removed IsAssigned(), IsFieldAssigned(),
13507 SetAssigned() and SetFieldAssigned(); we now call them on the
13508 VariableInfo so we don't need to duplicate this code everywhere.
13510 * expression.cs (ParameterReference): Added `Block block' argument
13512 (LocalVariableReference, ParameterReference, This): The new
13513 VariableInfo class is now responsible for all the definite
13516 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13517 IsParameterAssigned, SetParameterAssigned): Removed.
13519 2003-05-18 Martin Baulig <martin@ximian.com>
13521 * typemanager.cs (InitCoreTypes): Try calling
13522 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13523 the 3-args-version. Corlib now also needs our `void_type'.
13524 (GetMethod): Added overloaded version which takes an optional
13525 `bool report_errors' to allow lookups of optional methods.
13527 2003-05-12 Martin Baulig <martin@ximian.com>
13529 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13530 only used for locals and not for parameters.
13532 2003-05-12 Miguel de Icaza <miguel@ximian.com>
13534 * support.cs (InternalParameters.ParameterType): Return the
13535 ExternalType of the parameter.
13537 * parameter.cs (Parameter.ExternalType): drop the two arguments,
13540 2003-05-11 Miguel de Icaza <miguel@ximian.com>
13542 * class.cs (MethodData.Define): Do not set the `newslot' on
13543 interface members, if they are also flagged as "override".
13545 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13546 better code for ++i and i++. This only works for static fields
13547 and local variables.
13549 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13550 want to pull the DeclSpace out of the builder_to_declspace instead
13551 of the TypeBuilder (like in TypeContainer.FindMembers).
13553 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13554 instead of LookupTypeContainer. Fixes the crash on .NET for
13555 looking up interface members.
13557 * const.cs: Create our own emit context during the Definition
13558 stage, so that constants are evaluated in the proper context, when
13559 a recursive definition happens.
13561 2003-05-11 Martin Baulig <martin@ximian.com>
13563 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
13564 new block for a switch section.
13565 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13566 the adding/lookup in the switch block. Fixes #39828.
13568 2003-05-09 Miguel de Icaza <miguel@ximian.com>
13570 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13571 functionality: I needed to convert the data after I had performed
13572 the add/sub operation into the operands type size.
13574 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13575 pass the type for the box operation, otherwise the resulting
13576 object would have been of type object.
13578 (BoxedCast): Add constructor to specify the type to box as.
13580 2003-05-07 Miguel de Icaza <miguel@ximian.com>
13582 * iterators.cs: I was reusing the `count' variable inadvertently,
13583 take steps to not allow this to happen.
13585 2003-05-06 Miguel de Icaza <miguel@ximian.com>
13587 * attribute.cs (Attribute.Resolve): Params attributes are encoded
13588 by creating an array at the point where the params starts and
13589 putting all those arguments there, then adjusting the size of the
13592 2003-05-05 Miguel de Icaza <miguel@ximian.com>
13594 * expression.cs (New.AddressOf): Implement interface
13595 IMemoryLocation. This is used when the `new' operator is used in
13596 the context of an invocation to a method on a value type.
13598 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13601 * namespace.cs: Also check the using aliases here.
13603 * driver.cs: Move the test for using validity after the types have
13604 been entered, so we do a single pass that also includes the using
13607 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13608 in the regular case. CreateSiblingForFinally is doing extra
13611 * attribute.cs (GetAttributeArgumentExpression): Store the result
13612 on an out value, and use the return value to indicate failure
13613 instead of using null (which is a valid return for Constant.GetValue).
13615 * statement.cs: Perform the analysis flow for the increment
13616 portion after the statement, because this will be the real flow of
13617 execution. Fixes #42385
13619 * codegen.cs (EmitContext.EmitArgument,
13620 EmitContext.EmitStoreArgument): New helper functions when the
13621 RemapToProxy flag is set.
13623 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13626 Add support for remapping parameters.
13628 * iterators.cs: Propagate parameter values; Store parameter
13629 values in the proxy classes.
13631 2003-05-04 Miguel de Icaza <miguel@ximian.com>
13633 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
13634 need a proxy reference; I do not know what I was thinking
13636 * cs-parser.jay (constructor_initializer): catch another error,
13637 and display nice message.
13639 (field_declaration): catch void field declaration
13640 to flag a better error.
13642 * class.cs (MemberBase.CheckBase): Report an error instead of a
13643 warning if a new protected member is declared in a struct.
13644 (Field.Define): catch the error of readonly/volatile.
13646 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13648 (FieldExpr.AddressOf): ditto. Catch error where the address of a
13649 volatile variable is taken
13651 2003-05-02 Miguel de Icaza <miguel@ximian.com>
13653 * statement.cs (Fixed.Resolve): Report an error if we are not in
13656 2003-05-01 Miguel de Icaza <miguel@ximian.com>
13658 * typemanager.cs: reuse the code that handles type clashes for
13659 delegates and enumerations.
13661 * class.cs (Report28): Always report.
13663 * expression.cs (EncodeAsAttribute): Allow nulls here.
13665 2003-04-28 Miguel de Icaza <miguel@ximian.com>
13667 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13668 the functionality for testing whether an expression is valid for
13669 an attribute here. Also handle the case of arrays of elements
13672 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13673 encoding a linear array into an array of objects that are suitable
13674 to be passed to an CustomAttributeBuilder.
13676 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13678 * ecore.cs: (FieldExpr): Handle field remapping here.
13680 * iteratators.cs: Pass the instance variable (if the method is an
13681 instance method) to the constructors, so we can access the field
13682 variables on the class.
13684 TODO: Test this with structs. I think the THIS variable on
13685 structs might have to be a pointer, and not a refenrece
13687 2003-04-27 Miguel de Icaza <miguel@ximian.com>
13689 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13690 local variables to fields in a proxy class.
13692 * iterators.cs (PopulateProxy): Rename our internal fields to
13694 Create a <THIS> field if we are an instance method, so we can
13695 reference our parent container variables.
13696 (MapVariable): Called back from the EmitContext code to enter a
13697 new variable to field mapping into the proxy class (we just create
13701 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13702 for using the remapped locals to fields.
13704 I placed the code here, because that gives the same semantics to
13705 local variables, and only changes the Emit code.
13707 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13708 statements inside iterators.
13709 (VariableInfo): Add a FieldBuilder for the cases when we are
13710 remapping local variables to fields in a proxy class
13712 * ecore.cs (SimpleNameResolve): Avoid testing two times for
13713 current_block != null.
13715 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13716 not cope with strings, as it has been moved to the
13717 TableSwitchEmit. Fixed bug in switch generation.
13719 * expression.cs (New.DoResolve): Provide more context for the user
13720 when reporting an error.
13722 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13725 * expression.cs (MemberAccess.DoResolve): When we get a type back,
13726 check the permissions for it. Note than in a type-resolution
13727 context the check was already present in DeclSpace.ResolveType,
13728 but was missing from the MemberAccess.
13730 (ArrayCreation.CheckIndices): warn if the user has
13731 more nested levels of expressions, but there are no more
13732 dimensions specified. Avoids crash on bug 41906.
13734 2003-04-26 Miguel de Icaza <miguel@ximian.com>
13736 * statement.cs (Block): replace Implicit bool, for a generic
13738 New flag: `Unchecked'. This is used during the EmitMeta phase
13739 (which is out-of-line with the regular Resolve/Emit process for a
13740 statement, as this is done ahead of time, but still gets a chance
13741 to call constant resolve).
13743 (Block.Flags): new enum for adding a new flag.
13745 (Block.EmitMeta): track the state of unchecked.
13747 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13748 to enable constant resolution to work there as well.
13750 2003-04-22 Miguel de Icaza <miguel@ximian.com>
13752 * typemanager.cs (ienumerable_type): Also look up
13753 System.Collections.IEnumerable.
13755 2003-04-21 Miguel de Icaza <miguel@ximian.com>
13757 TODO: Test more than one conditional per method.
13759 * class.cs (Indexer.Define): Report the location where the user is
13760 referencing the unsupported feature.
13762 (MethodData): Overload the use of `conditionals' to
13763 minimize the creation of needless ArrayLists. This saves roughly
13764 212kb on my machine.
13766 (Method): Implement the new IIteratorContainer interface.
13767 (Method.SetYields): Implement the method by setting the ModFlags
13768 to contain METHOD_YIELDS.
13770 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13771 which just got set to null.
13773 * iterators.cs: New file.
13775 (Yield, YieldBreak): New statements.
13777 * statement.cs (Return.Resolve): Flag an error if we are used in
13778 an iterator method.
13780 * codegen.cs (InIterator): New flag set if the code is being
13781 compiled in an iterator method.
13783 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
13784 internal modifier, and we just use it to avoid adding extra
13785 fields, as this is seldom used.
13787 * cs-parser.jay: Add yield_statement (yield and yield break).
13789 * driver.cs: New flag -v2 to turn on version 2 features.
13791 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13792 hashtable when v2 is enabled.
13794 2003-04-20 Miguel de Icaza <miguel@ximian.com>
13796 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13797 there is already a namespace defined with this name.
13799 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13800 people upgraded their corlibs.
13802 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13803 always use fully qualified types, no need to use the compiler
13806 (TypeManager.IsNamespace): Use binarysearch.
13808 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13809 AddDelegate): I did not quite use the new IsValid API properly: I
13810 have to pass the short-name and the fullname. I was passing only
13811 the basename instead of the fullname sometimes.
13813 (TypeContainer.DefineType): call NamespaceClash.
13815 * interface.cs (Interface.DefineType): use NamespaceClash before
13818 * delegate.cs (Delegate.DefineType): use NamespaceClash before
13821 * enum.cs: (Enum.DefineType): use NamespaceClash before
13824 * typemanager.cs (: 3-line patch that gives us some tasty 11%
13825 speed increase. First, use the negative_hits cache when we get a
13826 negative. Second, add the type with its full original name
13827 instead of the new . and + encoded name (reflection uses + to
13828 separate type from a nested type). Use LookupTypeReflection
13829 directly which bypasses the type->name hashtable (that we already
13830 know does not contain the type.
13832 * decl.cs (DeclSpace.ResolveTypeExpr): track the
13833 location/container type.
13835 * driver.cs: When passing utf8, use directly the UTF8Encoding.
13837 2003-04-19 Miguel de Icaza <miguel@ximian.com>
13839 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13841 * delegate.cs (NewDelegate.Resolve): Test whether an instance
13842 method is being referenced in the method group from a static
13843 context, and report error 120 if so.
13845 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13848 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13849 is created, we create the A namespace).
13851 * cs-parser.jay: A namespace also introduces a DeclarationFound.
13854 2003-04-18 Miguel de Icaza <miguel@ximian.com>
13856 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13857 invocation to ModuleBuilder.GetType with the same values will
13858 return a new type instance, so we need to cache its return
13861 * expression.cs (Binary.ResolveOperator): Only allow the compare
13862 operators on enums if they are of the same type.
13864 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13865 types of ValueType on their own case. Before we were giving them
13866 the same treatment as objects.
13868 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13869 fullname. Short name is used to compare against container name.
13870 Fullname is used to check against defined namespace names.
13872 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13873 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13875 (Method.CheckBase): Call parent.
13876 (MemberBase.CheckBase): Check for protected members on sealed
13878 (PropertyBase.CheckBase): Call parent.
13879 (Field.Define): Call parent.
13881 * report.cs: Negative error codes are now mapped to 8000 - code,
13882 so that the display is render more nicely.
13884 * typemanager.cs: Do not use try/catch, instead report a regular
13887 (GetPointerType, GetReferenceType): These methods provide
13888 mechanisms to obtain the T* and T& from a T. We had the code
13889 previously scattered around the code base, and it also used
13890 TypeManager.LookupType that would go through plenty of caches.
13891 This one goes directly to the type source.
13893 In some places we did the Type.GetType followed by
13894 ModuleBuilder.GetType, but not in others, so this unifies the
13895 processing as well.
13897 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13898 statements now that we have namespace information.
13900 * typemanager.cs (IsNamespace): New method, returns whether the
13901 string presented is a namespace or not.
13903 (ComputeNamespaces): New public entry point, computes the list of
13904 available namespaces, using the GetNamespaces API call in Mono, or
13905 the slower version in MS.NET.
13907 Now before we start the semantic analysis phase, we have a
13908 complete list of namespaces including everything that the user has
13911 Deleted old code to cache namespaces in .nsc files.
13913 2003-04-17 Miguel de Icaza <miguel@ximian.com>
13915 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13916 class/struct location definition Location for the implicit
13917 constructor location.
13919 (Operator.Define): Use the location of the operator for the
13920 implicit Method definition.
13922 (Constructor.Emit): use the constructor location for the implicit
13923 base initializer constructor.
13925 * ecore.cs: Remove ITypeExpression. This interface is now gone,
13926 and the Expression class now contains two new methods:
13928 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
13929 isolate type lookup from the rest of the resolution process.
13931 Since we use Expressions to hold type definitions due to the way
13932 we parse the input we have historically overloaded Resolve to
13933 perform the Type lookups if a special flag is passed. Now this is
13934 eliminated and two methods take their place.
13936 The differences in the two methods between xStep and xTerminal is
13937 that xStep is involved in our current lookup system that uses
13938 SimpleNames to compose a name, while xTerminal is used just to
13939 catch the case where the simplename lookup failed.
13941 2003-04-16 Miguel de Icaza <miguel@ximian.com>
13943 * expression.cs (ResolveMemberAccess): Remove redundant code.
13944 TypeExpr expressions are always born fully resolved.
13946 * interface.cs (PopulateMethod): Do not lookup the types twice.
13947 We were doing it once during SemanticAnalysis and once during
13950 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13951 in local variable type definitions, were being returned as a
13952 SimpleName (we decomposed everything into a string), that is
13953 because primary_expression was being used instead of a type in the
13954 grammar (reduce/reduce conflicts).
13956 The part that was wrong is that we converted the expression into a
13957 string (an oversimplification in one hand, compounded with primary
13958 expressions doing string concatenation).
13964 Would return "A.B.C[]" as a SimpleName. This stopped things like
13965 using clauses from working on this particular context. And a type
13966 was being matched directly against "A.B.C[]".
13968 We now use the correct approach, and allow for ComposedCast to be
13969 part of the unary expression. So the "A.B.C []" become a composed
13970 cast of "A.B.C" (as a nested group of MemberAccess with a
13971 SimpleName at the end) plus the rank composition "[]".
13975 2003-04-10 Miguel de Icaza <miguel@ximian.com>
13977 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13978 for the access level checking.
13980 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
13981 `TypeContainer container', because I kept getting confused when I
13982 was debugging this code.
13984 * expression.cs (Indexers): Instead of tracking getters/setters,
13985 we now track them in parallel. We create one arraylist less, but
13986 most importantly it is possible now for the LValue code to find a
13987 matching get for a set.
13989 (IndexerAccess.DoResolveLValue): Update the code.
13990 GetIndexersForType has been modified already to extract all the
13991 indexers from a type. The code assumed it did not.
13993 Also make the code set the correct return type for the indexer.
13994 This was fixed a long time ago for properties, but was missing for
13995 indexers. It used to be void_type.
13997 (Binary.Emit): Test first for doubles instead of
13998 floats, as they are more common.
14000 (Binary.EmitBranchable): Use the .un version of the branch opcodes
14001 when dealing with floats and the <=, >= operators. This fixes bug
14004 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14005 to load the array value by emitting a load on the foreach variable
14006 type. This was incorrect.
14008 We now emit the code to load an element using the the array
14009 variable type, and then we emit the conversion operator.
14013 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
14015 * attribute.cs: Avoid allocation of ArrayLists in the common case.
14017 2003-04-09 Miguel de Icaza <miguel@ximian.com>
14019 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14020 test for protection before we test for signatures.
14022 (MethodSignature.ToString): implement.
14024 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14025 to the case where we reduced into a LongConstant.
14027 * decl.cs (CheckAccessLevel): If the type is an array, we can not
14028 depend on whether the information is acurrate, because the
14029 Microsoft runtime will always claim that the array type is public,
14030 regardless of the real state.
14032 If the type is a pointer, another problem happens: the type is
14033 reported as non-public in Microsoft.
14035 In both cases we have to call CheckAccessLevel recursively with
14036 the underlying type as the argument to be tested.
14038 2003-04-08 Miguel de Icaza <miguel@ximian.com>
14040 * assign.cs (Assign.Emit): If we are dealing with a compound
14041 assignment expression, we should use the code path that stores the
14042 intermediate result in a temporary value. This fixes #40903.
14044 *expression.cs (Indirection.ToString): Provide ToString method for
14047 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
14049 * class.cs: Null out fields holding references to Block objects so
14050 they can be garbage collected.
14052 * expression.cs (OverloadResolve): Remove unused local.
14054 2003-04-07 Martin Baulig <martin@ximian.com>
14056 * codegen.cs (EmitContext.CurrentFile): New public field.
14057 (EmitContext.Mark): Use the CurrentFile to check whether the
14058 location is in the correct file.
14059 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14061 2003-04-07 Martin Baulig <martin@ximian.com>
14063 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14065 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14066 location. [FIXME: The location argument which gets passed to this
14067 method is sometimes wrong!]
14069 2003-04-07 Nick Drochak <ndrochak@gol.com>
14071 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14073 2003-04-07 Miguel de Icaza <miguel@ximian.com>
14075 * expression.cs (Indirection.EmitAssign): We were using the
14076 temporary, but returning immediately instead of continuing the
14079 2003-04-06 Martin Baulig <martin@ximian.com>
14081 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14082 if it's a nested child, but also deriving from the outer class.
14085 * typemanager.cs (IsNestedChildOf): Make this work if it's a
14086 nested child, but also deriving from the outer class. See
14088 (FilterWithClosure): We may access private members of the outer
14089 class if we're a nested child and deriving from the outer class.
14090 (RealMemberLookup): Only set `closure_private_ok' if the
14091 `original_bf' contained BindingFlags.NonPublic.
14093 2003-04-05 Martin Baulig <martin@ximian.com>
14095 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14096 probe if its a type parameter, and if so, flag an error.
14098 * decl.cs: Move here the SetParameterInfo code from class.cs.
14099 Handle IsGeneric here.
14101 Handle a variety of errors in the parameter info definition.
14103 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14104 type parameters here.
14106 * cs-parser.jay (class_declaration): report errors for parameters
14109 2003-01-21 Miguel de Icaza <miguel@ximian.com>
14111 * generic.cs: New file, contains support code for generics.
14113 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14114 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14116 Update parser for the above removals.
14118 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
14119 now taken care of in the parser.
14121 2003-04-02 Miguel de Icaza <miguel@ximian.com>
14123 * class.cs (Event.Define): Do not allow abstract events to have
14126 2003-04-01 Miguel de Icaza <miguel@ximian.com>
14128 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14129 block in event declarations.
14131 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14132 value type, get its address.
14134 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14135 leaving a class on the stack instead of a boolean value (int
14136 0/1). Change the code so we compare against null, and then the
14137 result against zero.
14139 * class.cs (TypeContainer.GetClassBases): We were checking for the
14140 parent class being sealed too late.
14142 * expression.cs (Binary.Emit): For <= and >= when dealing with
14143 floating point values, use cgt.un and clt.un instead of cgt and
14146 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
14148 * statement.cs: Apply the same optimization as MS: skip the
14149 GetEnumerator returning an IEnumerator, and use the one returning a
14150 CharEnumerator instead. This allows us to avoid the try-finally block
14153 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
14155 * cs-parser.jay: Attributes cannot be applied to
14156 namespaces. Fixes #40473
14158 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14161 (Add*): check if the name is valid using the full name for constants,
14162 fields, properties and events.
14164 2003-03-28 Miguel de Icaza <miguel@ximian.com>
14166 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14167 char constants to be part of the enumeration.
14169 * expression.cs (Conditional.DoResolve): Add support for operator
14170 true. Implements the missing functionality from 14.12
14172 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14173 operator true/false as required by the spec.
14175 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14176 implicit conversion to boolean.
14178 * statement.cs (Statement.ResolveBoolean): A boolean expression is
14179 also one where the type implements `operator true'.
14181 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14182 get an expression that will invoke operator true based on an
14185 (GetConversionOperators): Removed the hack that called op_True
14188 (Expression.ResolveBoolean): Move this from Statement.
14190 2003-03-17 Miguel de Icaza <miguel@ximian.com>
14192 * ecore.cs (FieldExpr): do not allow initialization of initonly
14193 fields on derived classes
14195 2003-03-13 Martin Baulig <martin@ximian.com>
14197 * statement.cs (Block.Emit): Call ig.BeginScope() and
14198 ig.EndScope() when compiling with debugging info; call
14199 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14201 2003-03-08 Miguel de Icaza <miguel@ximian.com>
14203 * expression.cs (Indexers): Do not construct immediately, allow
14204 for new members to be appended as we go. Fixes 38143
14206 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14208 * expression.cs: save/restore context when resolving an unchecked
14211 2003-03-05 Miguel de Icaza <miguel@ximian.com>
14213 * cfold.cs: Catch division by zero in modulus operator during
14216 2003-03-03 Miguel de Icaza <miguel@ximian.com>
14218 * interface.cs (Interface.DefineMembers): Avoid defining members
14221 2003-02-27 Miguel de Icaza <miguel@ximian.com>
14223 * driver.cs: handle the +/- options for -noconfig
14225 * statement.cs (Unckeched.Resolve): Also track the state of
14226 unchecked in the Resolve phase.
14228 2003-02-27 Martin Baulig <martin@ximian.com>
14230 * ecore.cs (Expression.MemberLookup): Don't create a
14231 MethodGroupExpr for something which is not a method. Fixes #38291.
14233 2003-02-25 Miguel de Icaza <miguel@ximian.com>
14235 * class.cs (MemberBase.CheckParameters): Also check that the type
14236 is unmanaged if it is a pointer.
14238 * expression.cs (SizeOf.Resolve): Add location information.
14240 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14241 a managed type is declared.
14243 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14244 parameter modifiers as well. Fixes bug 38606
14246 * class.cs: Very sad. Am backing out the speed up changes
14247 introduced by the ArrayList -> Array in the TypeContainer, as they
14248 were not actually that much faster, and introduced a bug (no error
14249 reports on duplicated methods).
14251 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14252 source first, this will guarantee that we have a valid expression
14253 before calling in lower levels functions that will require a
14254 resolved object. Then use this original_source in the
14255 target.ResolveLValue instead of the original source that was
14258 Another change. Use target.Resolve instead of LValueResolve.
14259 Although we are resolving for LValues, we will let the Assign code
14260 take care of that (it will be called again from Resolve). This
14261 basically allows code like this:
14263 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14264 class Y { void A (X x) { x [0] += o; }
14266 The problem was that the indexer was trying to resolve for
14267 set_Item (idx, object o) and never finding one. The real set_Item
14268 was set_Item (idx, X). By delaying the process we get the right
14273 2003-02-23 Martin Baulig <martin@ximian.com>
14275 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14276 while calling DoEmit ().
14278 * codegen.cs (EmitContext.Mark): Don't mark locations in other
14279 source files; if you use the #line directive inside a method, the
14280 compiler stops emitting line numbers for the debugger until it
14281 reaches the end of the method or another #line directive which
14282 restores the original file.
14284 2003-02-23 Martin Baulig <martin@ximian.com>
14286 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14288 2003-02-23 Martin Baulig <martin@ximian.com>
14290 * statement.cs (Block.AddChildVariableNames): We need to call this
14291 recursively, not just for our immediate children.
14293 2003-02-23 Martin Baulig <martin@ximian.com>
14295 * class.cs (Event.Define): Always make the field private, like csc does.
14297 * typemanager.cs (TypeManager.RealMemberLookup): Make events
14298 actually work, fixes bug #37521.
14300 2003-02-23 Miguel de Icaza <miguel@ximian.com>
14302 * delegate.cs: When creating the various temporary "Parameters"
14303 classes, make sure that we call the ComputeAndDefineParameterTypes
14304 on those new parameters (just like we do with the formal ones), to
14305 allow them to be resolved in the context of the DeclSpace.
14307 This fixes the bug that Dick observed in Bugzilla #38530.
14309 2003-02-22 Miguel de Icaza <miguel@ximian.com>
14311 * expression.cs (ResolveMemberAccess): When resolving a constant,
14312 do not attempt to pull a constant if the value was not able to
14313 generate a valid constant.
14315 * const.cs (LookupConstantValue): Do not report more errors than required.
14317 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14319 * expression.cs: fixes bug #38328.
14321 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14323 * class.cs: Changed all the various members that can be part of a
14324 class from being an ArrayList to be an Array of the right type.
14325 During the DefineType type_list, interface_list, delegate_list and
14326 enum_list are turned into types, interfaces, delegates and enums
14329 And during the member population, indexer_list, event_list,
14330 constant_list, field_list, instance_constructor_list, method_list,
14331 operator_list and property_list are turned into their real arrays.
14333 Although we could probably perform this operation earlier, for
14334 good error reporting we need to keep the lists and remove the
14335 lists for longer than required.
14337 This optimization was triggered by Paolo profiling the compiler
14338 speed on the output of `gen-sample-program.pl' perl script.
14340 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14341 not crash in methods like MemberLookupFailed that use this field.
14343 This problem arises when the compiler fails to resolve a type
14344 during interface type definition for example.
14346 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14348 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14349 inherit from System.Object, so we have to stop at null, not only
14350 when reaching System.Object.
14352 2003-02-17 Miguel de Icaza <miguel@ximian.com>
14354 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14355 DeclaredOnly because the parent indexer might have had a different
14356 name, but did not loop until the top of the hierarchy was reached.
14358 The problem this one fixes is 35492: when a class implemented an
14359 indexer from an interface, we were getting the interface method
14360 (which was abstract) and we were flagging an error (can not invoke
14363 This also keeps bug 33089 functioning, and test-148 functioning.
14365 * typemanager.cs (IsSpecialMethod): The correct way of figuring
14366 out if a method is special is to see if it is declared in a
14367 property or event, or whether it is one of the predefined operator
14368 names. This should fix correctly #36804.
14370 2003-02-15 Miguel de Icaza <miguel@ximian.com>
14372 The goal here is to remove the dependency on EmptyCast.Peel ().
14373 Killing it completely.
14375 The problem is that currently in a number of places where
14376 constants are expected, we have to "probe" for an EmptyCast, and
14377 Peel, which is not the correct thing to do, as this will be
14378 repetitive and will likely lead to errors.
14380 The idea is to remove any EmptyCasts that are used in casts that
14381 can be reduced to constants, so we only have to cope with
14384 This bug hunt was triggered by Bug 37363 and the desire to remove
14385 the duplicate pattern where we were "peeling" emptycasts to check
14386 whether they were constants. Now constants will always be
14389 * ecore.cs: Use an enumconstant here instead of wrapping with
14392 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14393 throwing me off. By handling this we can get rid of a few hacks.
14395 * statement.cs (Switch): Removed Peel() code.
14397 2003-02-14 Miguel de Icaza <miguel@ximian.com>
14399 * class.cs: Location information for error 508
14401 * expression.cs (New.DoResolve): Add a guard against double
14402 resolution of an expression.
14404 The New DoResolve might be called twice when initializing field
14405 expressions (see EmitFieldInitializers, the call to
14406 GetInitializerExpression will perform a resolve on the expression,
14407 and later the assign will trigger another resolution
14409 This leads to bugs (#37014)
14411 * delegate.cs: The signature for EndInvoke should contain any ref
14412 or out parameters as well. We were not doing this in the past.
14414 * class.cs (Field.Define): Do not overwrite the type definition
14415 inside the `volatile' group. Turns out that volatile enumerations
14416 were changing the type here to perform a validity test, which
14419 2003-02-12 Miguel de Icaza <miguel@ximian.com>
14421 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14422 and structs, we do not want to load the instance variable
14424 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14425 enum_type has to be handled like an object reference (implicit
14426 conversions exists from this to object), but the regular IsClass
14427 and IsValueType tests will never return true for this one.
14429 Also we use TypeManager.IsValueType instead of type.IsValueType,
14430 just for consistency with the rest of the code (this is only
14431 needed if we ever use the construct exposed by test-180.cs inside
14432 corlib, which we dont today).
14434 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
14436 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14439 2003-02-09 Martin Baulig <martin@ximian.com>
14441 * namespace.cs (Namespace..ctor): Added SourceFile argument.
14442 (Namespace.DefineNamespaces): New static public method; this is
14443 called when we're compiling with debugging to add all namespaces
14444 to the symbol file.
14446 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14447 pass it to the Namespace's .ctor.
14449 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14450 and MethodBase arguments; pass the namespace ID to the symwriter;
14451 pass the MethodBase instead of the token to the symwriter.
14452 (SymbolWriter.DefineNamespace): New method to add a namespace to
14455 2003-02-09 Martin Baulig <martin@ximian.com>
14457 * symbolwriter.cs: New file. This is a wrapper around
14458 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
14459 methods here in near future.
14461 2003-02-09 Martin Baulig <martin@ximian.com>
14463 * codegen.cs (EmitContext.Mark): Just pass the arguments to
14464 ILGenerator.MarkSequencePoint() which are actually used by the
14467 2003-02-09 Martin Baulig <martin@ximian.com>
14469 * location.cs (SourceFile): New public sealed class. This
14470 contains the name and an index which is used in the location's token.
14471 (Location): Reserve an appropriate number of bits in the token for
14472 the source file instead of walking over that list, this gives us a
14473 really huge performance improvement when compiling with debugging.
14475 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14476 `SourceFile' argument instead of a string.
14477 (Driver.ProcessFile): Add all the files via Location.AddFile(),
14478 but don't parse/tokenize here, we need to generate the list of all
14479 source files before we do that.
14480 (Driver.ProcessFiles): New static function. Parses/tokenizes all
14483 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14484 instead of a string.
14486 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14489 2003-02-09 Martin Baulig <martin@ximian.com>
14491 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14492 filename on `#line default'.
14494 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14496 * statement.cs: don't clear the pinned var when the fixed statement
14497 returns from the method (fixes bug#37752).
14499 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14501 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
14504 2003-02-07 Martin Baulig <martin@ximian.com>
14506 * driver.cs: Removed the `--debug-args' command line argument.
14508 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14509 automatically by the AsssemblyBuilder.
14510 (CodeGen.InitializeSymbolWriter): We don't need to call any
14511 initialization function on the symbol writer anymore. This method
14512 doesn't take any arguments.
14514 2003-02-03 Miguel de Icaza <miguel@ximian.com>
14516 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14517 from referenced assemblies as well.
14519 2003-02-02 Martin Baulig <martin@ximian.com>
14521 * class.cs (MethodData.Emit): Generate debugging info for external methods.
14523 2003-02-02 Martin Baulig <martin@ximian.com>
14525 * class.cs (Constructor.Emit): Open the symbol writer before
14526 emitting the constructor initializer.
14527 (ConstructorInitializer.Emit): Call ec.Mark() to allow
14528 single-stepping through constructor initializers.
14530 2003-01-30 Miguel de Icaza <miguel@ximian.com>
14532 * class.cs: Handle error 549: do not allow virtual methods in
14535 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14537 * decl.cs: Check access levels when resolving types
14539 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14541 * statement.cs: Add parameters and locals set in catch blocks that might
14542 return to set vector
14544 2003-01-29 Miguel de Icaza <miguel@ximian.com>
14546 * class.cs (Operator): Set the SpecialName flags for operators.
14548 * expression.cs (Invocation.DoResolve): Only block calls to
14549 accessors and operators on SpecialName methods.
14551 (Cast.TryReduce): Handle conversions from char constants.
14554 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14556 * statement.cs: small memory and time optimization in FlowBranching.
14558 2003-01-28 Pedro Mart <yoros@wanadoo.es>
14560 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14561 problem that the last fix but in the other sid (Set).
14563 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14564 access when there is no indexer in the hierarchy.
14566 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14568 * class.cs: Combine some if statements.
14570 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14572 * driver.cs: fixed bug #37187.
14574 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
14576 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14577 any indexer, it's needed to build a list with all the indexers in the
14578 hierarchy (AllGetters), else we have problems. Fixes #35653.
14580 2003-01-23 Miguel de Icaza <miguel@ximian.com>
14582 * class.cs (MethodData.Define): It is wrong for an interface
14583 implementation to be static in both cases: explicit and implicit.
14584 We were only handling this in one case.
14586 Improve the if situation there to not have negations.
14588 * class.cs (Field.Define): Turns out that we do not need to check
14589 the unsafe bit on field definition, only on usage. Remove the test.
14591 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14593 * driver.cs: use assembly.Location instead of Codebase (the latest
14594 patch made mcs fail when using MS assemblies).
14596 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
14598 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14599 get the path to *corlib.dll.
14601 2003-01-21 Nick Drochak <ndrochak@gol.com>
14605 * typemanager.cs: Remove compiler warnings
14607 2003-01-20 Duncan Mak <duncan@ximian.com>
14609 * AssemblyInfo.cs: Bump the version number to 0.19.
14611 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14613 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14615 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
14617 * class.cs (Constructor::Emit): Emit debugging info for constructors.
14619 2003-01-17 Miguel de Icaza <miguel@ximian.com>
14621 * cs-parser.jay: Small fix: we were not comparing the constructor
14622 name correctly. Thanks to Zoltan for the initial pointer.
14624 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14626 * cs-tokenizer.cs: Set file name when specified with #line
14628 2003-01-15 Miguel de Icaza <miguel@ximian.com>
14630 * cs-parser.jay: Only perform the constructor checks here if we
14631 are named like the class; This will help provider a better
14632 error. The constructor path is taken when a type definition is
14633 not found, but most likely the user forgot to add the type, so
14634 report that rather than the constructor error.
14636 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14638 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14641 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14643 * cs-parser.jay: Add cleanup call.
14645 2003-01-13 Duncan Mak <duncan@ximian.com>
14647 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14648 consistent with other methods.
14650 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14652 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14654 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14656 * attribute.cs: only set GuidAttr to true when we have a
14659 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14663 * typemanager.cs: fixes to allow mcs compile corlib with the new
14664 Type.IsSubclassOf fix.
14666 2003-01-08 Miguel de Icaza <miguel@ximian.com>
14668 * expression.cs (LocalVariableReference.DoResolve): Classify a
14669 constant as a value, not as a variable. Also, set the type for
14672 * cs-parser.jay (fixed_statement): take a type instead of a
14673 pointer_type, so we can produce a better error message later.
14675 * statement.cs (Fixed.Resolve): Flag types that are not pointers
14678 (For.DoEmit): Make inifinite loops have a
14679 non-conditional branch back.
14681 (Fixed.DoEmit): First populate the pinned variables, then emit the
14682 statement, then clear the variables. Before I was emitting the
14683 code once for each fixed piece.
14686 2003-01-08 Martin Baulig <martin@ximian.com>
14688 * statement.cs (FlowBranching.MergeChild): A break in a
14689 SWITCH_SECTION does not leave a loop. Fixes #36155.
14691 2003-01-08 Martin Baulig <martin@ximian.com>
14693 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14694 lives in the same number space than `param_map'. Fixes #36154.
14696 2003-01-07 Miguel de Icaza <miguel@ximian.com>
14698 * cs-parser.jay (constructor_declaration): Set the
14699 Constructor.ModFlags before probing for it. This makes the
14700 compiler report 514, 515 and 132 (the code was there, but got
14703 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14704 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14705 (GotoCase.Resolve): Set `Returns' to ALWAYS.
14707 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14709 * enum.cs: create the enum static fields using the enum type.
14711 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14713 * class.cs: don't try to create the ParamBuilder for the return
14714 type if it's not needed (and handle it breaking for the ms runtime
14717 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14719 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14721 2002-12-29 Miguel de Icaza <miguel@ximian.com>
14723 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14724 the command. This showed up while compiling the JANET source
14725 code, which used \r as its only newline separator.
14727 2002-12-28 Miguel de Icaza <miguel@ximian.com>
14729 * class.cs (Method.Define): If we are an operator (because it
14730 reuses our code), then set the SpecialName and HideBySig. #36128
14732 2002-12-22 Miguel de Icaza <miguel@ximian.com>
14734 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14735 exception, report error 120 `object reference required'.
14737 * driver.cs: Add --pause option, used during to measure the size
14738 of the process as it goes with --timestamp.
14740 * expression.cs (Invocation.DoResolve): Do not allow methods with
14741 SpecialName to be invoked.
14743 2002-12-21 Miguel de Icaza <miguel@ximian.com>
14745 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14746 number before adding it.
14748 2002-12-21 Ravi Pratap <ravi@ximian.com>
14750 * ecore.cs (StandardImplicitConversion): When in an unsafe
14751 context, we allow conversion between void * to any other pointer
14752 type. This fixes bug #35973.
14754 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14756 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14757 is not thrown when extensionless outputs are used
14759 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14761 * rootcontext.cs: fixed compilation of corlib.
14763 2002-12-19 Miguel de Icaza <miguel@ximian.com>
14765 * attribute.cs (Attributes.Contains): Add new method.
14767 * class.cs (MethodCore.LabelParameters): if the parameter is an
14768 `out' parameter, check that no attribute `[In]' has been passed.
14770 * enum.cs: Handle the `value__' name in an enumeration.
14772 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
14774 * decl.cs: Added special case to allow overrides on "protected
14777 2002-12-18 Ravi Pratap <ravi@ximian.com>
14779 * attribute.cs (Attributes.AddAttributeSection): Rename to this
14780 since it makes much more sense.
14782 (Attributes.ctor): Don't require a Location parameter.
14784 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14786 * attribute.cs (ApplyAttributes): Remove extra Location parameters
14787 since we already have that information per attribute.
14789 * everywhere : make appropriate changes.
14791 * class.cs (LabelParameters): Write the code which actually
14792 applies attributes to the return type. We can't do this on the MS
14793 .NET runtime so we flag a warning in the case an exception is
14796 2002-12-18 Miguel de Icaza <miguel@ximian.com>
14798 * const.cs: Handle implicit null conversions here too.
14800 2002-12-17 Ravi Pratap <ravi@ximian.com>
14802 * class.cs (MethodCore.LabelParameters): Remove the extra
14803 Type [] parameter since it is completely unnecessary. Instead
14804 pass in the method's attributes so that we can extract
14805 the "return" attribute.
14807 2002-12-17 Miguel de Icaza <miguel@ximian.com>
14809 * cs-parser.jay (parse): Use Report.Error to flag errors instead
14810 of ignoring it and letting the compile continue.
14812 * typemanager.cs (ChangeType): use an extra argument to return an
14813 error condition instead of throwing an exception.
14815 2002-12-15 Miguel de Icaza <miguel@ximian.com>
14817 * expression.cs (Unary.TryReduce): mimic the code for the regular
14818 code path. Perform an implicit cast in the cases where we can
14819 implicitly convert to one of the integral types, and then reduce
14820 based on that constant. This fixes bug #35483.
14822 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14824 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14826 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14828 * namespace.cs: fixed bug #35489.
14830 2002-12-12 Miguel de Icaza <miguel@ximian.com>
14832 * class.cs: Remove some dead code.
14834 * cs-parser.jay: Estimate the number of methods needed
14835 (RootContext.MethodCount);
14837 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14838 numbers instead of StringBuilders.
14840 * support.cs (PtrHashtable): Add constructor with initial size;
14841 We can now reduce reallocations of the method table.
14843 2002-12-10 Ravi Pratap <ravi@ximian.com>
14845 * attribute.cs (ApplyAttributes): Keep track of the emitted
14846 attributes on a per-target basis. This fixes bug #35413.
14848 2002-12-10 Miguel de Icaza <miguel@ximian.com>
14850 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14851 default to the Windows 1252 encoding.
14853 (UnixParseOption): Support version, thanks to Alp for the missing
14856 * AssemblyInfo.cs: Add nice assembly information.
14858 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14861 * cs-parser.jay: Allow a trailing comma before the close bracked
14862 in the attribute_section production.
14864 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14865 address of the instance was being taken, I will take this out,
14866 because we take the address of the object immediately here.
14868 2002-12-09 Ravi Pratap <ravi@ximian.com>
14870 * typemanager.cs (AreMultipleAllowed): Take care of the most
14871 obvious case where attribute type is not in the current assembly -
14874 2002-12-08 Miguel de Icaza <miguel@ximian.com>
14876 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14877 definitions, instead of doing that afterwards.
14879 Also we use a nice little hack, depending on the constructor, we
14880 know if we are a "composed" name or a simple name. Hence, we
14881 avoid the IndexOf test, and we avoid
14883 * codegen.cs: Add code to assist in a bug reporter to track down
14884 the source of a compiler crash.
14886 2002-12-07 Ravi Pratap <ravi@ximian.com>
14888 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14889 types have been emitted for a given element and flag an error
14890 if something which does not have AllowMultiple set is used more
14893 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14894 attribute types and their corresponding AllowMultiple properties
14896 (AreMultipleAllowed): Check the property for a given type.
14898 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14899 property in the case we have a TypeContainer.
14901 (Attributes.AddAttribute): Detect duplicates and just skip on
14902 adding them. This trivial fix catches a pretty gross error in our
14903 attribute emission - global attributes were being emitted twice!
14905 Bugzilla bug #33187 is now fixed.
14907 2002-12-06 Miguel de Icaza <miguel@ximian.com>
14909 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14910 instead of pp_and).
14912 * expression.cs (Binary.ResolveOperator): I can only use the
14913 Concat (string, string, string) and Concat (string, string,
14914 string, string) if the child is actually a concatenation of
14917 2002-12-04 Miguel de Icaza <miguel@ximian.com>
14919 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14920 context where we need a 2-character lookahead.
14922 * pending.cs (PendingImplementation): Rework so we can keep track
14923 of interface types all the time, and flag those which were
14924 implemented by parents as optional.
14926 2002-12-03 Miguel de Icaza <miguel@ximian.com>
14928 * expression.cs (Binary.ResolveOperator): Use
14929 String.Concat(string,string,string) or
14930 String.Concat(string,string,string,string) when possible.
14932 * typemanager: More helper methods.
14935 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14937 * pending.cs: remove the bogus return from GetMissingInterfaces()
14938 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14940 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14942 * namespace.cs: avoid duplicated 'using xxx' being added to
14943 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14944 when we get more than one 'using' statement for the same namespace.
14945 Report a CS0105 warning for it.
14947 2002-11-30 Miguel de Icaza <miguel@ximian.com>
14949 * cs-tokenizer.cs (consume_identifier): use read directly, instead
14950 of calling getChar/putback, uses internal knowledge of it.
14952 (xtoken): Reorder tokenizer so most common patterns are checked
14953 first. This reduces the compilation time in another 5% (from 8.11s
14954 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14956 The parsing time is 22% of the compilation in mcs, and from that
14957 64% is spent on the tokenization process.
14959 I tried using a binary search for keywords, but this is slower
14960 than the hashtable. Another option would be to do a couple of
14963 * Not use a StringBuilder, instead use an array of chars,
14964 with a set value. Notice that this way we could catch
14965 the 645 error without having to do it *afterwards*.
14967 * We could write a hand-parser to avoid the hashtable
14968 compares altogether.
14970 The identifier consumption process takes 37% of the tokenization
14971 time. Another 15% is spent on is_number. 56% of the time spent
14972 on is_number is spent on Int64.Parse:
14974 * We could probably choose based on the string length to
14975 use Int32.Parse or Int64.Parse and avoid all the 64-bit
14978 Another 3% is spend on wrapping `xtoken' in the `token' function.
14980 Handle 0xa0 as whitespace (#34752)
14982 2002-11-26 Miguel de Icaza <miguel@ximian.com>
14984 * typemanager.cs (IsCLRType): New routine to tell whether a type
14985 is one of the builtin types.
14987 Maybe it needs to use TypeCodes to be faster. Maybe we could use
14988 typecode in more places instead of doing pointer comparissions.
14989 We could leverage some knowledge about the way the typecodes are
14992 New code to cache namespaces in assemblies, it is currently not
14993 invoked, to be used soon.
14995 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14997 * expression.cs (Binary.ResolveOperator): specially handle
14998 strings, and do not perform user-defined operator overloading for
15001 2002-11-24 Miguel de Icaza <miguel@ximian.com>
15003 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15004 internalcall as it is a pretty simple operation; Avoid whenever
15005 possible to call Char.IsLetter.
15007 (consume_identifier): Cut by half the number of
15008 hashtable calls by merging the is_keyword and GetKeyword behavior.
15010 Do not short-circuit, because if we do, we
15011 report errors (ie, #if false && true would produce an invalid
15015 2002-11-24 Martin Baulig <martin@ximian.com>
15017 * expression.cs (Cast.TryReduce): If we're in checked syntax,
15018 check constant ranges and report a CS0221. Fixes #33186.
15020 2002-11-24 Martin Baulig <martin@ximian.com>
15022 * cs-parser.jay: Make this work for uninitialized variable
15023 declarations in the `for' initializer. Fixes #32416.
15025 2002-11-24 Martin Baulig <martin@ximian.com>
15027 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15028 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
15030 2002-11-24 Martin Baulig <martin@ximian.com>
15032 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15033 argument; if true, we also check for user-defined conversions.
15034 This is only needed if both arguments are of a user-defined type.
15035 Fixes #30443, added test-175.cs.
15036 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15038 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15040 2002-11-24 Martin Baulig <martin@ximian.com>
15042 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15043 function to get the store opcode.
15044 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15045 only emit the Ldelema if the store opcode is Stobj. You must run
15046 both test-34 and test-167 to test this. Fixes #34529.
15048 2002-11-23 Martin Baulig <martin@ximian.com>
15050 * ecore.cs (Expression.MemberLookup): Added additional
15051 `qualifier_type' argument which is used when we're being called
15052 from MemberAccess.DoResolve() and null if we're called from a
15054 (Expression.MemberLookupFailed): New method to report errors; this
15055 does the CS1540 check and reports the correct error message.
15057 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15058 argument for the CS1540 check and redone the way how we're dealing
15059 with private members. See the comment in the source code for details.
15060 (FilterWithClosure): Reverted this back to revision 1.197; renamed
15061 `closure_start_type' to `closure_qualifier_type' and check whether
15062 it's not null. It was not this filter being broken, it was just
15063 being called with the wrong arguments.
15065 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15066 and pass it the correct `qualifier_type'; this also does the error
15069 2002-11-22 Miguel de Icaza <miguel@ximian.com>
15071 * expression.cs (Invocation.EmitParams): If the we are dealing
15072 with a non-built-in value type, load its address as well.
15074 (ArrayCreation): Use a a pretty constant instead
15075 of the hardcoded value 2. Use 6 instead of 2 for the number of
15076 static initializers.
15078 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15079 because they are not really value types, just glorified integers.
15081 * driver.cs: Do not append .exe, the CSC compiler does not do it.
15083 * ecore.cs: Remove redundant code for enumerations, make them use
15084 the same code path as everything else, fixes the casting issue
15085 with enumerations in Windows.Forms.
15087 * attribute.cs: Do only cast to string if it is a string, the
15088 validation happens later.
15090 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15091 people upgrade their corlibs.
15093 * ecore.cs: Oops, enumerations were not following the entire code path
15095 2002-11-21 Miguel de Icaza <miguel@ximian.com>
15097 * typemanager.cs (FilterWithClosure): Commented out the test for
15098 1540 in typemanager.cs, as it has problems when accessing
15099 protected methods from a parent class (see test-174.cs).
15101 * attribute.cs (Attribute.ValidateGuid): new method.
15102 (Attribute.Resolve): Use above.
15104 2002-11-19 Miguel de Icaza <miguel@ximian.com>
15106 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15108 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15109 handling for enumerations, as we only needed the TypeContainer
15110 functionality to begin with (this is required for the fix below to
15111 work for enums that reference constants in a container class for
15114 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15116 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15117 a valid TypeBuilder to perform lookups on.o
15119 * class.cs (InheritableMemberSignatureCompare): Use true in the
15120 call to GetGetMethod and GetSetMethod, because we are comparing
15121 the signature, and we need to get the methods *even* if they are
15124 (PropertyBase.CheckBase): ditto.
15126 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15127 GotoCase.Resolve): Use Peel on EmpytCasts.
15129 * ecore.cs (EmptyCast): drop child, add Peel method.
15131 2002-11-17 Martin Baulig <martin@ximian.com>
15133 * ecore.cs (EmptyCast.Child): New public property.
15135 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15136 label resolved to an EmptyCast. Fixes #34162.
15137 (GotoCase.Resolve): Likewise.
15138 (Block.EmitMeta): Likewise.
15140 2002-11-17 Martin Baulig <martin@ximian.com>
15142 * expression.cs (Invocation.BetterConversion): Prefer int over
15143 uint; short over ushort; long over ulong for integer literals.
15144 Use ImplicitConversionExists instead of StandardConversionExists
15145 since we also need to check for user-defined implicit conversions.
15146 Fixes #34165. Added test-173.cs.
15148 2002-11-16 Martin Baulig <martin@ximian.com>
15150 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15151 with the `true' and `false' literals. Fixes #33151.
15153 2002-11-16 Martin Baulig <martin@ximian.com>
15155 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15156 October 22nd; don't do the cs1540 check for static members.
15158 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15159 now using our own filter here and doing the cs1540 check again.
15161 2002-11-16 Martin Baulig <martin@ximian.com>
15163 * support.cs (InternalParameters): Don't crash if we don't have
15164 any fixed parameters. Fixes #33532.
15166 2002-11-16 Martin Baulig <martin@ximian.com>
15168 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15169 when looking up static methods to make this work on Windows.
15172 2002-11-16 Martin Baulig <martin@ximian.com>
15174 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15175 a setter rather than using PropertyInfo.CanWrite.
15177 2002-11-15 Nick Drochak <ndrochak@gol.com>
15179 * class.cs: Allow acces to block member by subclasses. Fixes build
15182 2002-11-14 Martin Baulig <martin@ximian.com>
15184 * class.cs (Constructor.Emit): Added the extern/block check.
15187 2002-11-14 Martin Baulig <martin@ximian.com>
15189 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15190 iteration while looking for indexers, this is needed because the
15191 indexer may have a different name in our base classes. Fixed the
15192 error reporting (no indexers at all, not get accessor, no
15193 overloaded match). Fixes bug #33089.
15194 (IndexerAccess.DoResolveLValue): Likewise.
15196 2002-11-14 Martin Baulig <martin@ximian.com>
15198 * class.cs (PropertyBase.CheckBase): Make this work for multiple
15199 indexers. Fixes the first part of bug #33089.
15200 (MethodSignature.InheritableMemberSignatureCompare): Added support
15203 2002-11-13 Ravi Pratap <ravi@ximian.com>
15205 * attribute.cs (Attribute.Resolve): Catch the
15206 NullReferenceException and report it since it isn't supposed to
15209 2002-11-12 Miguel de Icaza <miguel@ximian.com>
15211 * expression.cs (Binary.EmitBranchable): Also handle the cases for
15212 LogicalOr and LogicalAnd that can benefit from recursively
15213 handling EmitBranchable. The code now should be nice for Paolo.
15215 2002-11-08 Miguel de Icaza <miguel@ximian.com>
15217 * typemanager.cs (LookupType): Added a negative-hit hashtable for
15218 the Type lookups, as we perform quite a number of lookups on
15219 non-Types. This can be removed once we can deterministically tell
15220 whether we have a type or a namespace in advance.
15222 But this might require special hacks from our corlib.
15226 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15227 and double which avoids a conversion from an integer to a double.
15229 * expression.cs: tiny optimization, avoid calling IsConstant,
15230 because it effectively performs the lookup twice.
15232 2002-11-06 Miguel de Icaza <miguel@ximian.com>
15234 But a bogus return here to keep the semantics of the old code
15235 until the Mono runtime is fixed.
15237 * pending.cs (GetMissingInterfaces): New method used to remove all
15238 the interfaces that are already implemented by our parent
15239 classes from the list of pending methods.
15241 * interface.cs: Add checks for calls after ResolveTypeExpr.
15243 2002-11-05 Miguel de Icaza <miguel@ximian.com>
15245 * class.cs (Class.Emit): Report warning 67: event not used if the
15246 warning level is beyond 3.
15248 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15249 being a NullLiteral.
15251 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15254 * class.cs (TypeContainer.GetClassBases): Cover a missing code
15255 path that might fail if a type can not be resolved.
15257 * expression.cs (Binary.Emit): Emit unsigned versions of the
15260 * driver.cs: use error 5.
15262 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15264 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15266 2002-11-01 Miguel de Icaza <miguel@ximian.com>
15268 * cs-parser.jay (switch_section): A beautiful patch from Martin
15269 Baulig that fixed 33094.
15271 2002-10-31 Miguel de Icaza <miguel@ximian.com>
15273 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15274 Check whether the base is abstract and report an error if so.
15276 * expression.cs (IndexerAccess.DoResolveLValue,
15277 IndexerAccess.DoResolve): ditto.
15279 (Invocation.DoResolve): ditto.
15281 (Invocation.FullMethodDesc): Improve the report string.
15283 * statement.cs (Block): Eliminate IsVariableDefined as it is
15284 basically just a wrapper for GetVariableInfo.
15286 * ecore.cs (SimpleName): Use new
15288 * support.cs (ReflectionParamter.ParameterType): We unwrap the
15289 type, as we return the actual parameter ref/unref state on a
15292 2002-10-30 Miguel de Icaza <miguel@ximian.com>
15294 * support.cs: Return proper flags REF/OUT fixing the previous
15297 * expression.cs: Reverted last patch, that was wrong. Is_ref is
15298 not used to mean `ref' but `ref or out' in ParameterReference
15300 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15301 full type signature instead of calling TypeManger.CSharpName
15304 * support.cs (InternalParameters.ParameterDesc): Do not compare
15305 directly to the modflags, because REF/OUT will actually be bitsets
15308 * delegate.cs (VerifyMethod): Check also the modifiers.
15310 * cs-tokenizer.cs: Fix bug where floating point values with an
15311 exponent where a sign was missing was ignored.
15313 * driver.cs: Allow multiple assemblies to be specified in a single
15316 2002-10-28 Miguel de Icaza <miguel@ximian.com>
15318 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
15319 because identifiers after a parenthesis would end up in this kind
15320 of production, and we needed to desamiguate it for having casts
15323 (UserDefinedType *) xxx
15325 2002-10-24 Miguel de Icaza <miguel@ximian.com>
15327 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15328 we should set on the Bindingflags.NonPublic, but not turn on
15329 private_ok. private_ok controls whether a Private member is
15330 returned (this is chekced on the filter routine), while the
15331 BindingFlags.NonPublic just controls whether private/protected
15332 will be allowed. This fixes the problem part of the problem of
15333 private properties being allowed to be used in derived classes.
15335 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15336 so we can call the children DoResolveLValue method (this will
15337 properly signal errors on lvalue assignments to base properties)
15339 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15340 getter are null, and we have a property info, we know that this
15341 happened because the lookup failed, so we report an error 122 for
15342 protection level violation.
15344 We also silently return if setter and getter are null in the
15345 resolve functions, this condition only happens if we have flagged
15346 the error before. This is the other half of the problem.
15348 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15349 not have accessibility information, that is why we were returning
15350 true in the filter function in typemanager.cs.
15352 To properly report 122 (property is inaccessible because of its
15353 protection level) correctly, we report this error in ResolveAccess
15354 by failing if both the setter and the getter are lacking (ie, the
15357 DoResolve and DoLResolve have been modified to check for both
15358 setter/getter being null and returning silently, the reason being
15359 that I did not want to put the knowledge about this error in upper
15362 int old = Report.Errors;
15363 x = new PropertyExpr (...);
15364 if (old != Report.Errors)
15369 So the property expr is returned, but it is invalid, so the error
15370 will be flagged during the resolve process.
15372 * class.cs: Remove InheritablePropertySignatureCompare from the
15373 class, as we no longer depend on the property signature to compute
15374 whether it is possible to implement a method or not.
15376 The reason is that calling PropertyInfo.GetGetMethod will return
15377 null (in .NET, in Mono it works, and we should change this), in
15378 cases where the Get Method does not exist in that particular
15383 class X { public virtual int A { get { return 1; } } }
15385 class Z : Y { public override int A { get { return 2; } } }
15387 Would fail in Z because the parent (Y) would not have the property
15388 defined. So we avoid this completely now (because the alternative
15389 fix was ugly and slow), and we now depend exclusively on the
15392 (PropertyBase.CheckBase): Use a method-base mechanism to find our
15393 reference method, instead of using the property.
15395 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15396 routines are gone now.
15398 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15399 names, they were incorrectly named.
15401 * cs-tokenizer.cs: Return are more gentle token on failure.
15403 * pending.cs (PendingImplementation.InterfaceMethod): This routine
15404 had an out-of-sync index variable, which caused it to remove from
15405 the list of pending methods the wrong method sometimes.
15407 2002-10-22 Miguel de Icaza <miguel@ximian.com>
15409 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15410 CanWrite, because those refer to this particular instance of the
15411 property, and do not take into account the fact that we can
15412 override single members of a property.
15414 Constructor requires an EmitContext. The resolution process does
15415 not happen here, but we need to compute the accessors before,
15416 because the resolution does not always happen for properties.
15418 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15419 subclass, before we did not update this flag, but we did update
15422 (GetAccessors): Drop this routine, as it did not work in the
15423 presence of partially overwritten set/get methods.
15425 Notice that this broke the cs1540 detection, but that will require
15428 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15432 * driver.cs: issue a warning instead of an error if we don't support
15433 debugging for the platform. Also ignore a couple of errors that may
15434 arise when trying to write the symbols. Undo my previous patch.
15436 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15438 * driver.cs: ignore /debug switch except for Unix platforms.
15440 2002-10-23 Nick Drochak <ndrochak@gol.com>
15442 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15444 2002-10-21 Miguel de Icaza <miguel@ximian.com>
15446 * driver.cs: Do not make mcs-debug conditional, so we do not break
15447 builds that use it.
15449 * statement.cs (UsageVector.MergeChildren): I would like Martin to
15450 review this patch. But basically after all the children variables
15451 have been merged, the value of "Breaks" was not being set to
15452 new_breaks for Switch blocks. I think that it should be set after
15453 it has executed. Currently I set this to the value of new_breaks,
15454 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15455 conservative, but I do not understand this code very well.
15457 I did not break anything in the build, so that is good ;-)
15459 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15461 2002-10-20 Mark Crichton <crichton@gimp.org>
15463 * cfold.cs: Fixed compile blocker. Really fixed it this time.
15465 2002-10-20 Nick Drochak <ndrochak@gol.com>
15467 * cfold.cs: Fixed compile blocker.
15469 2002-10-20 Miguel de Icaza <miguel@ximian.com>
15471 * driver.cs: I was chekcing the key, not the file.
15473 2002-10-19 Ravi Pratap <ravi@ximian.com>
15475 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15476 message that we were generating - we just need to silently return
15479 2002-10-19 Miguel de Icaza <miguel@ximian.com>
15481 * class.cs (Event.Define): Change my previous commit, as this
15482 breaks the debugger. This is a temporary hack, as it seems like
15483 the compiler is generating events incorrectly to begin with.
15485 * expression.cs (Binary.ResolveOperator): Added support for
15486 "U operator - (E x, E y)"
15488 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15491 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15492 init-only variables, but this path did not take into account that
15493 there might be also instance readonly variables. Correct this
15496 This fixes bug 32253
15498 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15501 * driver.cs: Change the extension for modules to `netmodule'
15503 * cs-parser.jay: Improved slightly the location tracking for
15504 the debugger symbols.
15506 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15507 modifiers that were specified instead of the hardcoded value
15508 (FamAndAssem). This was basically ignoring the static modifier,
15509 and others. Fixes 32429.
15511 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15512 fixed a bug in the process (32476)
15514 * expression.cs (ArrayAccess.EmitAssign): Patch from
15515 hwang_rob@yahoo.ca that fixes bug 31834.3
15517 2002-10-18 Miguel de Icaza <miguel@ximian.com>
15519 * driver.cs: Make the module extension .netmodule.
15521 2002-10-16 Miguel de Icaza <miguel@ximian.com>
15523 * driver.cs: Report an error if the resource file is not found
15524 instead of crashing.
15526 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15527 false, like Emit does.
15529 2002-10-16 Nick Drochak <ndrochak@gol.com>
15531 * typemanager.cs: Remove unused private member. Also reported mcs
15532 bug to report this as a warning like csc.
15534 2002-10-15 Martin Baulig <martin@gnome.org>
15536 * statement.cs (Statement.Emit): Made this a virtual method; emits
15537 the line number info and calls DoEmit().
15538 (Statement.DoEmit): New protected abstract method, formerly knows
15539 as Statement.Emit().
15541 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15543 2002-10-11 Miguel de Icaza <miguel@ximian.com>
15545 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15546 have fixed a remaining problem: not every AddXXXX was adding a
15547 fully qualified name.
15549 Now everyone registers a fully qualified name in the DeclSpace as
15550 being defined instead of the partial name.
15552 Downsides: we are slower than we need to be due to the excess
15553 copies and the names being registered this way.
15555 The reason for this is that we currently depend (on the corlib
15556 bootstrap for instance) that types are fully qualified, because
15557 we dump all the types in the namespace, and we should really have
15558 types inserted into the proper namespace, so we can only store the
15559 basenames in the defined_names array.
15561 2002-10-10 Martin Baulig <martin@gnome.org>
15563 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15564 from bug #31834, see the bug report for a testcase which is
15567 2002-10-10 Martin Baulig <martin@gnome.org>
15569 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15570 flow analysis code for this.
15572 * statement.cs (Do, While, For): Tell the flow analysis code about
15574 (FlowBranching.UsageVector): Added support for infinite loops.
15575 (Block.Resolve): Moved the dead code elimination here and use flow
15578 2002-10-09 Miguel de Icaza <miguel@ximian.com>
15580 * class.cs (Field.Define): Catch cycles on struct type
15583 * typemanager.cs (IsUnmanagedtype): Do not recursively check
15584 fields if the fields are static. We only need to check instance
15587 * expression.cs (As.DoResolve): Test for reference type.
15589 * statement.cs (Using.ResolveExpression): Use
15590 ConvertImplicitRequired, not ConvertImplicit which reports an
15592 (Using.ResolveLocalVariableDecls): ditto.
15594 * expression.cs (Binary.ResolveOperator): Report errors in a few
15595 places where we had to.
15597 * typemanager.cs (IsUnmanagedtype): Finish implementation.
15599 2002-10-08 Miguel de Icaza <miguel@ximian.com>
15601 * expression.cs: Use StoreFromPtr instead of extracting the type
15602 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
15604 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15605 an enumeration value to a System.Enum, but System.Enum is not a
15606 value type, but an class type, so we need to box.
15608 (Expression.ConvertExplicit): One codepath could return
15609 errors but not flag them. Fix this. Fixes #31853
15611 * parameter.cs (Resolve): Do not allow void as a parameter type.
15613 2002-10-06 Martin Baulig <martin@gnome.org>
15615 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15616 if it's a class type and not a struct. Fixes #31815.
15618 2002-10-06 Martin Baulig <martin@gnome.org>
15620 * statement.cs: Reworked the flow analysis code a bit to make it
15621 usable for dead code elimination.
15623 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15625 * cs-parser.jay: allow empty source files. Fixes bug #31781.
15627 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15629 * expression.cs (ComposedCast.DoResolveType): A quick workaround
15630 to fix the test 165, will investigate deeper.
15632 2002-10-04 Martin Baulig <martin@gnome.org>
15634 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15635 finally blocks actually work.
15636 (Try.Resolve): We don't need to create a sibling for `finally' if
15637 there is no finally block.
15639 2002-10-04 Martin Baulig <martin@gnome.org>
15641 * class.cs (Constructor.Define): The default accessibility for a
15642 non-default constructor is private, not public.
15644 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15646 * class.cs (Constructor): Make AllowedModifiers public, add
15649 * cs-parser.jay: Perform the modifiers test here, as the
15650 constructor for the Constructor class usually receives a zero
15651 because of the way we create it (first we create, later we
15652 customize, and we were never checking the modifiers).
15654 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15655 is a version of LookupTypeReflection that includes the type-name
15656 cache. This can be used as a fast path for functions that know
15657 the fully qualified name and are only calling into *.GetType() to
15658 obtain a composed type.
15660 This is also used by TypeManager.LookupType during its type
15663 (LookupType): We now also track the real type name, as sometimes
15664 we can get a quey for the real type name from things like
15665 ComposedCast. This fixes bug 31422.
15667 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15668 complete type fullname, it does not have to go through the type
15669 resolution system to obtain the composed version of the type (for
15670 obtaining arrays or pointers).
15672 (Conditional.Emit): Use the EmitBoolExpression to
15673 generate nicer code, as requested by Paolo.
15675 (ArrayCreation.CheckIndices): Use the patch from
15676 hwang_rob@yahoo.ca to validate the array initializers.
15678 2002-10-03 Miguel de Icaza <miguel@ximian.com>
15680 * class.cs (ConstructorInitializer.Emit): simplify code by using
15681 Invocation.EmitCall, and at the same time, fix the bugs in calling
15682 parent constructors that took variable arguments.
15684 * ecore.cs (Expression.ConvertNumericExplicit,
15685 Expression.ImplicitNumericConversion): Remove the code that
15686 manually wrapped decimal (InternalTypeConstructor call is now gone
15689 * expression.cs (Cast.TryReduce): Also handle decimal types when
15690 trying to perform a constant fold on the type.
15692 * typemanager.cs (IsUnmanagedtype): Partially implemented.
15694 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15695 that only turned off an error report, and did nothing else.
15697 2002-10-02 Miguel de Icaza <miguel@ximian.com>
15699 * driver.cs: Handle and ignore /fullpaths
15701 2002-10-01 Miguel de Icaza <miguel@ximian.com>
15703 * expression.cs (Binary.ResolveOperator): Catch the case where
15704 DoNumericPromotions returns true,
15706 (Binary.DoNumericPromotions): Simplify the code, and the tests.
15708 2002-09-27 Miguel de Icaza <miguel@ximian.com>
15710 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15713 2002-09-26 Miguel de Icaza <miguel@ximian.com>
15715 * ecore.cs (ConvertNumericExplicit): It is not enough that the
15716 conversion exists, but it is also required that the conversion be
15717 performed. This manifested in "(Type64Enum) 2".
15719 * class.cs (TypeManager.AddMethod): The fix is not to change
15720 AddEnum, because that one was using a fully qualified name (every
15721 DeclSpace derivative does), but to change the AddMethod routine
15722 that was using an un-namespaced name. This now correctly reports
15723 the duplicated name.
15725 Revert patch until I can properly fix it. The issue
15726 is that we have a shared Type space across all namespaces
15727 currently, which is wrong.
15729 Options include making the Namespace a DeclSpace, and merge
15730 current_namespace/current_container in the parser.
15732 2002-09-25 Miguel de Icaza <miguel@ximian.com>
15734 * cs-parser.jay: Improve error reporting when we get a different
15735 kind of expression in local_variable_type and
15736 local_variable_pointer_type.
15738 Propagate this to avoid missleading errors being reported.
15740 * ecore.cs (ImplicitReferenceConversion): treat
15741 TypeManager.value_type as a target just like object_type. As
15746 Is valid, and needs to result in the int 1 being boxed before it
15747 is assigned to the value type v.
15749 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15750 to validate the enumeration name.
15752 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15753 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
15754 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15756 * ecore.cs (TryImplicitIntConversion): When doing an
15757 implicit-enumeration-conversion, check if the type is 64-bits and
15758 perform a conversion before passing to EnumConstant.
15760 2002-09-23 Miguel de Icaza <miguel@ximian.com>
15762 * decl.cs (Error_AmbiguousTypeReference); New routine used to
15763 report ambiguous type references. Unlike the MS version, we
15764 report what the ambiguity is. Innovation at work ;-)
15766 (DeclSpace.FindType): Require a location argument to
15767 display when we display an ambiguous error.
15769 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15771 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15773 * expression.cs (EmitDynamicInitializers): Apply patch from
15774 hwang_rob@yahoo.ca that fixes the order in which we emit our
15777 2002-09-21 Martin Baulig <martin@gnome.org>
15779 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15780 delegate takes no arguments.
15782 2002-09-20 Miguel de Icaza <miguel@ximian.com>
15784 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15787 * expression.cs: Extract the underlying type.
15789 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15791 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15793 2002-09-19 Miguel de Icaza <miguel@ximian.com>
15795 * class.cs (TypeContainer.DefineType): We can not use the nice
15796 PackingSize with the size set to 1 DefineType method, because it
15797 will not allow us to define the interfaces that the struct
15800 This completes the fixing of bug 27287
15802 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15803 means also structs. This fixes part of the problem.
15804 (Expresion.ImplicitReferenceConversionExists): ditto.
15806 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15807 error if there were no errors reported during the type lookup
15808 process, to avoid duplicates or redundant errors. Without this
15809 you would get an ambiguous errors plus a type not found. We have
15810 beaten the user enough with the first error.
15812 (DeclSparce.FindType): Emit a warning if we have an ambiguous
15815 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15816 during the resolution process, stop the lookup, this avoids
15817 repeated error reports (same error twice).
15819 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15821 * typemanager.cs (LookupType): Redo the type lookup code to match
15822 the needs of System.Reflection.
15824 The issue is that System.Reflection requires references to nested
15825 types to begin with a "+" sign instead of a dot. So toplevel
15826 types look like: "NameSpace.TopLevelClass", and nested ones look
15827 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15830 2002-09-19 Martin Baulig <martin@gnome.org>
15832 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15833 says that a method always returns or always throws an exception,
15834 don't report the CS0161.
15836 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15837 set `Returns = new_returns'.
15839 2002-09-19 Martin Baulig <martin@gnome.org>
15841 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15842 to an enum constant, check for a CS0176.
15844 2002-09-18 Miguel de Icaza <miguel@ximian.com>
15846 * class.cs (TypeContainer.CheckPairedOperators): Now we check
15847 for operators that must be in pairs and report errors.
15849 * ecore.cs (SimpleName.DoResolveType): During the initial type
15850 resolution process, when we define types recursively, we must
15851 check first for types in our current scope before we perform
15852 lookups in the enclosing scopes.
15854 * expression.cs (MakeByteBlob): Handle Decimal blobs.
15856 (Invocation.VerifyArgumentsCompat): Call
15857 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15858 I thought we were supposed to always call this, but there are a
15859 few places in the code where we dont do it.
15861 2002-09-17 Miguel de Icaza <miguel@ximian.com>
15863 * driver.cs: Add support in -linkres and -resource to specify the
15864 name of the identifier.
15866 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15868 * ecore.cs (StandardConversionExists): Sync with the conversion
15869 code: allow anything-* to void* conversions.
15871 (FindMostSpecificSource): Use an Expression argument
15872 instead of a Type, because we might be handed over a Literal which
15873 gets a few more implicit conversions that plain types do not. So
15874 this information was being lost.
15876 Also, we drop the temporary type-holder expression when not
15879 2002-09-17 Martin Baulig <martin@gnome.org>
15881 * class.cs (PropertyBase.CheckBase): Don't check the base class if
15882 this is an explicit interface implementation.
15884 2002-09-17 Martin Baulig <martin@gnome.org>
15886 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15887 different `IndexerName' attributes.
15889 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15890 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15891 virtual CommonResolve().
15893 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15895 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15896 and convert that to the UnderlyingType.
15898 * statement.cs (Foreach.Resolve): Indexers are just like variables
15899 or PropertyAccesses.
15901 * cs-tokenizer.cs (consume_string): Track line numbers and columns
15902 inside quoted strings, we were not doing this before.
15904 2002-09-16 Martin Baulig <martin@gnome.org>
15906 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15907 resolve it. This is needed for the definite assignment check of the
15908 instance expression, fixes bug #29846.
15909 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15911 2002-09-16 Nick Drochak <ndrochak@gol.com>
15913 * parameter.cs: Fix compile error. Cannot reference static member
15914 from an instance object. Is this an mcs bug?
15916 2002-09-14 Martin Baulig <martin@gnome.org>
15918 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15919 multiple times. Fixes bug #30295, added test-166.cs.
15921 2002-09-14 Martin Baulig <martin@gnome.org>
15923 * statement.cs (Block.Emit): Don't emit unreachable code.
15924 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15925 `break' statements.
15926 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15928 2002-09-14 Martin Baulig <martin@gnome.org>
15930 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15933 2002-09-14 Martin Baulig <martin@gnome.org>
15935 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15936 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15937 be false on the ms runtime.
15939 2002-09-13 Martin Baulig <martin@gnome.org>
15941 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15942 the CS0038 error message.
15944 2002-09-12 Miguel de Icaza <miguel@ximian.com>
15946 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15947 constant inside, return it.
15949 2002-09-12 Martin Baulig <martin@gnome.org>
15951 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15952 implicit conversion can be done between enum types.
15954 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15955 check whether an implicit conversion to the current enum's UnderlyingType
15956 exists and report an error if not.
15958 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15959 without debugging support.
15961 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15962 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
15964 2002-09-12 Martin Baulig <martin@gnome.org>
15966 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15968 * ecore.cs (IMemberExpr.DeclaringType): New property.
15969 (SimpleName.SimpleNameResolve): Check whether we're accessing a
15970 nonstatic member of an outer type (CS0038).
15972 2002-09-11 Miguel de Icaza <miguel@ximian.com>
15974 * driver.cs: Activate the using-error detector at warning level
15975 4 (at least for MS-compatible APIs).
15977 * namespace.cs (VerifyUsing): Small buglett fix.
15979 * pending.cs (PendingImplementation): pass the container pointer.
15981 * interface.cs (GetMethods): Allow for recursive definition. Long
15982 term, I would like to move every type to support recursive
15983 definitions, not the current ordering mechanism that we have right
15986 The situation is this: Attributes are handled before interfaces,
15987 so we can apply attributes to interfaces. But some attributes
15988 implement interfaces, we will now handle the simple cases
15989 (recursive definitions will just get an error).
15991 * parameter.cs: Only invalidate types at the end if we fail to
15994 2002-09-09 Martin Baulig <martin@gnome.org>
15996 * ecore.cs (PropertyExpr.Emit): Also check for
15997 TypeManager.system_int_array_get_length so this'll also work when
15998 compiling corlib. Fixes #30003.
16000 2002-09-09 Martin Baulig <martin@gnome.org>
16002 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16003 and throw an exception if we can't get the type's size. Fixed #30040,
16006 2002-09-09 Martin Baulig <martin@gnome.org>
16008 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16010 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16011 context. Fixes bug #30027.
16013 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16014 virtual functions. Fixes bug #30043, added test-164.cs.
16016 2002-09-08 Ravi Pratap <ravi@ximian.com>
16018 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16020 2002-09-08 Nick Drochak <ndrochak@gol.com>
16022 * driver.cs: Use an object to get the windows codepage since it's not a
16025 2002-09-08 Miguel de Icaza <miguel@ximian.com>
16027 * statement.cs (For.Emit): for infinite loops (test == null)
16028 return whether there is a break inside, not always "true".
16030 * namespace.cs (UsingEntry): New struct to hold the name of the
16031 using definition, the location where it is defined, and whether it
16032 has been used in a successful type lookup.
16034 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16039 2002-09-06 Ravi Pratap <ravi@ximian.com>
16041 * attribute.cs : Fix incorrect code which relied on catching
16042 a NullReferenceException to detect a null being passed in
16043 where an object was expected.
16045 2002-09-06 Miguel de Icaza <miguel@ximian.com>
16047 * statement.cs (Try): flag the catch variable as assigned
16049 * expression.cs (Cast): Simplified by using ResolveType instead of
16050 manually resolving.
16052 * statement.cs (Catch): Fix bug by using ResolveType.
16054 2002-09-06 Ravi Pratap <ravi@ximian.com>
16056 * expression.cs (BetterConversion): Special case for when we have
16057 a NullLiteral as the argument and we have to choose between string
16058 and object types - we choose string the way csc does.
16060 * attribute.cs (Attribute.Resolve): Catch the
16061 NullReferenceException and report error #182 since the Mono
16062 runtime no more has the bug and having this exception raised means
16063 we tried to select a constructor which takes an object and is
16066 2002-09-05 Ravi Pratap <ravi@ximian.com>
16068 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16069 message (1502, 1503) when we can't locate a method after overload
16070 resolution. This is much more informative and closes the bug
16073 * interface.cs (PopulateMethod): Return if there are no argument
16074 types. Fixes a NullReferenceException bug.
16076 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16077 expressions too. Previously we were checking only in one place for
16078 positional arguments leaving out named arguments.
16080 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16081 type to the enum type is not allowed. Remove code corresponding to
16084 (ConvertNumericExplicit): Allow explicit conversions from
16085 the underlying type to enum type. This precisely follows the spec
16086 and closes a bug filed by Gonzalo.
16088 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16091 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16093 2002-09-03 Miguel de Icaza <miguel@ximian.com>
16095 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16096 it was important that we stored the right value after the
16097 reduction in `converted'.
16099 2002-09-04 Martin Baulig <martin@gnome.org>
16101 * location.cs (Location.SymbolDocument): Use full pathnames for the
16104 2002-08-30 Miguel de Icaza <miguel@ximian.com>
16106 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16107 of the expression resolve mechanism, because that will catch the
16108 SimpleName error failures.
16110 (Conditional): If we can not resolve the
16111 expression, return, do not crash.
16113 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16116 (location): display token name instead of its number.
16118 2002-08-28 Martin Baulig <martin@gnome.org>
16120 * expression.cs (Binary.ResolveOperator): Don't silently return
16121 but return an error if an operator cannot be applied between two
16124 2002-08-28 Martin Baulig <martin@gnome.org>
16126 * class.cs (Constructor.Define): Set the permission attributes
16127 correctly instead of making all constructors public.
16129 2002-08-28 Martin Baulig <martin@gnome.org>
16131 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16132 for private members before reporting a CS0103; if we find anything,
16135 2002-08-28 Martin Baulig <martin@gnome.org>
16137 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16138 to check whether `closure_start_type == closure_invocation_type',
16139 we also need to check whether `m.DeclaringType == closure_invocation_type'
16140 before bypassing the permission checks. We might be accessing
16141 protected/private members from the base class.
16142 (TypeManager.RealMemberLookup): Only set private_ok if private
16143 members were requested via BindingFlags.NonPublic.
16145 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16147 * expression.cs (MemberAccess.ResolveMemberAccess): Set
16148 MethodGroupExpr.IsExplicitImpl if appropriate.
16149 (Invocation.DoResolve): Don't report the CS0120 for explicit
16150 interface implementations.
16152 2002-08-27 Martin Baulig <martin@gnome.org>
16154 * expression.cs (Invocation.DoResolve): If this is a static
16155 method and we don't have an InstanceExpression, we must report
16158 2002-08-25 Martin Baulig <martin@gnome.org>
16160 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16161 `==' between a valuetype and an object.
16163 2002-08-25 Miguel de Icaza <miguel@ximian.com>
16165 * ecore.cs (TypeExpr): Provide a ToString method.
16167 2002-08-24 Martin Baulig <martin@gnome.org>
16169 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16170 now called proggie.dbg and it's a binary file.
16172 2002-08-23 Martin Baulig <martin@gnome.org>
16174 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16176 2002-08-23 Martin Baulig <martin@gnome.org>
16178 * struct.cs (MyStructInfo.ctor): Make this work with empty
16179 structs; it's not allowed to use foreach() on null.
16181 2002-08-23 Martin Baulig <martin@gnome.org>
16183 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16184 writer the full pathname of the generated assembly.
16186 2002-08-23 Martin Baulig <martin@gnome.org>
16188 * statements.cs (FlowBranching.UsageVector.MergeChildren):
16189 A `finally' block never returns or breaks; improved handling of
16192 2002-08-23 Martin Baulig <martin@gnome.org>
16194 * statement.cs (Throw.Resolve): Allow `throw null'.
16196 2002-08-23 Martin Baulig <martin@gnome.org>
16198 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16199 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16200 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
16201 MemberLookup would return a wrong event if this is an explicit
16202 interface implementation and the class has an event with the same
16205 2002-08-23 Martin Baulig <martin@gnome.org>
16207 * statement.cs (Block.AddChildVariableNames): New public method.
16208 (Block.AddChildVariableName): Likewise.
16209 (Block.IsVariableNameUsedInChildBlock): Likewise.
16210 (Block.AddVariable): Check whether a variable name has already
16211 been used in a child block.
16213 * cs-parser.jay (declare_local_variables): Mark all variable names
16214 from the current block as being used in a child block in the
16217 2002-08-23 Martin Baulig <martin@gnome.org>
16219 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16220 find the symbol writer.
16222 * driver.cs: csc also allows the arguments to /define being
16223 separated by commas, not only by semicolons.
16225 2002-08-23 Martin Baulig <martin@gnome.org>
16227 * interface.cs (Interface.GetMembers): Added static check for events.
16229 2002-08-15 Martin Baulig <martin@gnome.org>
16231 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16232 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16234 * ecore.cs (Expression.MemberLookup): Added documentation and explained
16235 why the MethodData.EmitDestructor() change was necessary.
16237 2002-08-20 Martin Baulig <martin@gnome.org>
16239 * class.cs (TypeContainer.FindMembers): Added static check for events.
16241 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16243 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16244 use Type.GetEvents(), not Type.FindMembers().
16246 2002-08-20 Martin Baulig <martin@gnome.org>
16248 * decl.cs (MemberCache): Added a special method cache which will
16249 be used for method-only searched. This ensures that a method
16250 search will return a MethodInfo with the correct ReflectedType for
16253 2002-08-20 Martin Baulig <martin@gnome.org>
16255 * decl.cs (DeclSpace.FindMembers): Made this public.
16257 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16259 * delegate.cs: fixed build on windows.
16260 [FIXME: Filed as bug #29150: MCS must report these errors.]
16262 2002-08-19 Ravi Pratap <ravi@ximian.com>
16264 * ecore.cs (StandardConversionExists): Return a false
16265 if we are trying to convert the void type to anything else
16266 since that is not allowed.
16268 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16269 we flag error 70 in the event an event is trying to be accessed
16270 directly from outside the declaring type.
16272 2002-08-20 Martin Baulig <martin@gnome.org>
16274 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16275 MemberCache from typemanager.cs to decl.cs.
16277 2002-08-19 Martin Baulig <martin@gnome.org>
16279 * class.cs (TypeContainer): Implement IMemberContainer.
16280 (TypeContainer.DefineMembers): Create the MemberCache.
16281 (TypeContainer.FindMembers): Do better BindingFlags checking; only
16282 return public members if BindingFlags.Public was given, check
16283 whether members are static.
16285 2002-08-16 Martin Baulig <martin@gnome.org>
16287 * decl.cs (DeclSpace.Define): Splitted this in Define and
16288 DefineMembers. DefineMembers is called first and initializes the
16291 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
16292 DefineMembers() on all our DeclSpaces.
16294 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16295 but call DefineMembers() on all nested interfaces. We call their
16296 Define() in our new Define() function.
16298 * interface.cs (Interface): Implement IMemberContainer.
16299 (Interface.Define): Moved all code except the attribute stuf to
16301 (Interface.DefineMembers): Initialize the member cache.
16303 * typemanager.cs (IMemberFinder): Removed this interface, we don't
16304 need this anymore since we can use MemberCache.FindMembers directly.
16306 2002-08-19 Martin Baulig <martin@gnome.org>
16308 * typemanager.cs (MemberCache): When creating the cache for an
16309 interface type, add all inherited members.
16310 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16311 to `out bool used_cache' and documented it.
16312 (TypeManager.MemberLookup): If we already used the cache in the first
16313 iteration, we don't need to do the interfaces check.
16315 2002-08-19 Martin Baulig <martin@gnome.org>
16317 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
16318 here from IMemberFinder and don't implement this interface anymore.
16319 (DeclSpace.MemberCache): Moved here from IMemberFinder.
16321 * typemanager.cs (IMemberFinder): This interface is now only used by
16322 classes which actually support the member cache.
16323 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16324 since we only put DeclSpaces into this Hashtable.
16325 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16326 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16328 2002-08-16 Martin Baulig <martin@gnome.org>
16330 * typemanager.cs (ICachingMemberFinder): Removed.
16331 (IMemberFinder.MemberCache): New property.
16332 (TypeManager.FindMembers): Merged this with RealFindMembers().
16333 This function will never be called from TypeManager.MemberLookup()
16334 so we can't use the cache here, just the IMemberFinder.
16335 (TypeManager.MemberLookup_FindMembers): Check whether the
16336 IMemberFinder has a MemberCache and call the cache's FindMembers
16338 (MemberCache): Rewrote larger parts of this yet another time and
16339 cleaned it up a bit.
16341 2002-08-15 Miguel de Icaza <miguel@ximian.com>
16343 * driver.cs (LoadArgs): Support quoting.
16345 (Usage): Show the CSC-like command line arguments.
16347 Improved a few error messages.
16349 2002-08-15 Martin Baulig <martin@gnome.org>
16351 * typemanager.cs (IMemberContainer.Type): New property.
16352 (IMemberContainer.IsInterface): New property.
16354 The following changes are conditional to BROKEN_RUNTIME, which is
16355 defined at the top of the file.
16357 * typemanager.cs (MemberCache.MemberCache): Don't add the base
16358 class'es members, but add all members from TypeHandle.ObjectType
16359 if we're an interface.
16360 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16361 is the current type.
16362 (MemberCache.CacheEntry.Container): Removed this field.
16363 (TypeHandle.GetMembers): Include inherited members.
16365 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16367 * typemanager.cs: fixed compilation and added a comment on a field that
16370 2002-08-15 Martin Baulig <martin@gnome.org>
16372 * class.cs (ConstructorInitializer.Resolve): In the
16373 Expression.MemberLookup call, use the queried_type as
16376 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16377 declared' attribute, it's always true.
16378 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16379 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16380 temporary wrapper for FindMembers which tells MemberLookup whether
16381 members from the base classes are included in the return value.
16382 This will go away soon.
16383 (TypeManager.MemberLookup): Use this temporary hack here; once the
16384 new MemberCache is completed, we don't need to do the DeclaredOnly
16385 looping here anymore since the MemberCache will take care of this.
16386 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16387 (MemberCache): When creating the MemberCache for a class, get
16388 members from the current class and all its base classes.
16389 (MemberCache.CacheEntry.Container): New field. This is a
16390 temporary hack until the Mono runtime is fixed to distinguish
16391 between ReflectedType and DeclaringType. It allows us to use MCS
16392 with both the MS runtime and the unfixed Mono runtime without
16393 problems and without accecting performance.
16394 (MemberCache.SearchMembers): The DeclaredOnly looping from
16395 TypeManager.MemberLookup is now done here.
16397 2002-08-14 Martin Baulig <martin@gnome.org>
16399 * statement.cs (MyStructInfo.MyStructInfo): Don't call
16400 Type.GetFields on dynamic types but get the fields from the
16401 corresponding TypeContainer.
16402 (MyStructInfo.GetStructInfo): Added check for enum types.
16404 * typemanager.cs (MemberList.IsSynchronized): Implemented.
16405 (MemberList.SyncRoot): Implemented.
16406 (TypeManager.FilterWithClosure): No need to check permissions if
16407 closure_start_type == closure_invocation_type, don't crash if
16408 closure_invocation_type is null.
16410 2002-08-13 Martin Baulig <martin@gnome.org>
16412 Rewrote TypeContainer.FindMembers to use a member cache. This
16413 gives us a speed increase of about 35% for the self-hosting MCS
16414 build and of about 15-20% for the class libs (both on GNU/Linux).
16416 * report.cs (Timer): New class to get enhanced profiling. This
16417 whole class is "TIMER" conditional since it remarkably slows down
16420 * class.cs (MemberList): New class. This is an IList wrapper
16421 which we're now using instead of passing MemberInfo[]'s around to
16422 avoid copying this array unnecessarily.
16423 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16424 (ICachingMemberFinder, IMemberContainer): New interface.
16425 (TypeManager.FilterWithClosure): If `criteria' is null, the name
16426 has already been checked, otherwise use it for the name comparision.
16427 (TypeManager.FindMembers): Renamed to RealMemberFinder and
16428 provided wrapper which tries to use ICachingMemberFinder.FindMembers
16429 if possible. Returns a MemberList, not a MemberInfo [].
16430 (TypeHandle): New class, implements IMemberContainer. We create
16431 one instance of this class per type, it contains a MemberCache
16432 which is used to do the member lookups.
16433 (MemberCache): New class. Each instance of this class contains
16434 all members of a type and a name-based hash table.
16435 (MemberCache.FindMembers): This is our new member lookup
16436 function. First, it looks up all members of the requested name in
16437 the hash table. Then, it walks this list and sorts out all
16438 applicable members and returns them.
16440 2002-08-13 Martin Baulig <martin@gnome.org>
16442 In addition to a nice code cleanup, this gives us a performance
16443 increase of about 1.4% on GNU/Linux - not much, but it's already
16444 half a second for the self-hosting MCS compilation.
16446 * typemanager.cs (IMemberFinder): New interface. It is used by
16447 TypeManager.FindMembers to call FindMembers on a TypeContainer,
16448 Enum, Delegate or Interface.
16449 (TypeManager.finder_to_member_finder): New PtrHashtable.
16450 (TypeManager.finder_to_container): Removed.
16451 (TypeManager.finder_to_delegate): Removed.
16452 (TypeManager.finder_to_interface): Removed.
16453 (TypeManager.finder_to_enum): Removed.
16455 * interface.cs (Interface): Implement IMemberFinder.
16457 * delegate.cs (Delegate): Implement IMemberFinder.
16459 * enum.cs (Enum): Implement IMemberFinder.
16461 * class.cs (TypeContainer): Implement IMemberFinder.
16463 2002-08-12 Martin Baulig <martin@gnome.org>
16465 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16467 2002-08-12 Martin Baulig <martin@gnome.org>
16469 * ecore.cs (ITypeExpression): New interface for expressions which
16471 (TypeExpression): Renamed to TypeLookupExpression.
16472 (Expression.DoResolve): If we're doing a types-only lookup, the
16473 expression must implement the ITypeExpression interface and we
16474 call DoResolveType() on it.
16475 (SimpleName): Implement the new ITypeExpression interface.
16476 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16477 hack, the situation that we're only looking up types can't happen
16478 anymore when this method is called. Moved the type lookup code to
16479 DoResolveType() and call it.
16480 (SimpleName.DoResolveType): This ITypeExpression interface method
16481 is now doing the types-only lookup.
16482 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16483 (ResolveFlags): Added MaskExprClass.
16485 * expression.cs (MemberAccess): Implement the ITypeExpression
16487 (MemberAccess.DoResolve): Added support for a types-only lookup
16488 when we're called via ITypeExpression.DoResolveType().
16489 (ComposedCast): Implement the ITypeExpression interface.
16491 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
16492 Expression.Resolve() with ResolveFlags.Type instead.
16494 2002-08-12 Martin Baulig <martin@gnome.org>
16496 * interface.cs (Interface.Define): Apply attributes.
16498 * attribute.cs (Attribute.ApplyAttributes): Added support for
16499 interface attributes.
16501 2002-08-11 Martin Baulig <martin@gnome.org>
16503 * statement.cs (Block.Emit): Only check the "this" variable if we
16504 do not always throw an exception.
16506 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16507 whether the property has a set accessor.
16509 2002-08-11 Martin Baulig <martin@gnome.org>
16511 Added control flow analysis support for structs.
16513 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16514 with control flow analysis turned off.
16515 (IVariable): New interface.
16516 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16517 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16518 (FieldExpr.DoResolve): Resolve the instance expression with flow
16519 analysis turned off and do the definite assignment check after the
16520 resolving when we know what the expression will resolve to.
16522 * expression.cs (LocalVariableReference, ParameterReference):
16523 Implement the new IVariable interface, only call the flow analysis
16524 code if ec.DoFlowAnalysis is true.
16525 (This): Added constructor which takes a Block argument. Implement
16526 the new IVariable interface.
16527 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16528 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16529 This does the definite assignment checks for struct members.
16531 * class.cs (Constructor.Emit): If this is a non-static `struct'
16532 constructor which doesn't have any initializer, call
16533 Block.AddThisVariable() to tell the flow analysis code that all
16534 struct elements must be initialized before control returns from
16537 * statement.cs (MyStructInfo): New public class.
16538 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16539 argument to this indexer. If non-zero, check an individual struct
16540 member, not the whole struct.
16541 (FlowBranching.CheckOutParameters): Check struct members.
16542 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16543 overloaded versions of these methods which take an additional
16544 `int field_idx' argument to check struct members.
16545 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16546 overloaded versions of these methods which take an additional
16547 `string field_name' argument to check struct member.s
16548 (VariableInfo): Implement the IVariable interface.
16549 (VariableInfo.StructInfo): New public property. Returns the
16550 MyStructInfo instance of the variable if it's a struct or null.
16551 (Block.AddThisVariable): New public method. This is called from
16552 Constructor.Emit() for non-static `struct' constructor which do
16553 not have any initializer. It creates a special variable for the
16554 "this" instance variable which will be checked by the flow
16555 analysis code to ensure that all of the struct's fields are
16556 initialized before control returns from the constructor.
16557 (UsageVector): Added support for struct members. If a
16558 variable/parameter is a struct with N members, we reserve a slot
16559 in the usage vector for each member. A struct is considered fully
16560 initialized if either the struct itself (slot 0) or all its
16561 members are initialized.
16563 2002-08-08 Martin Baulig <martin@gnome.org>
16565 * driver.cs (Driver.MainDriver): Only report an error CS5001
16566 if there were no compilation errors.
16568 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16569 `UnsafeContext' property to determine whether the parent is in
16570 unsafe context rather than checking the parent's ModFlags:
16571 classes nested in an unsafe class are unsafe as well.
16573 2002-08-08 Martin Baulig <martin@gnome.org>
16575 * statement.cs (UsageVector.MergeChildren): Distinguish between
16576 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16577 we return. Added test17() and test18() to test-154.cs.
16579 2002-08-08 Martin Baulig <martin@gnome.org>
16581 * typemanager.cs (TypeManager.FilterWithClosure): If we have
16582 Family access, make sure the invoking type isn't a subclass of the
16583 queried type (that'd be a CS1540).
16585 * ecore.cs (Expression.MemberLookup): Added overloaded version of
16586 this method which takes an additional `Type invocation_type'.
16588 * expression.cs (BaseAccess.DoResolve): Use the base type as
16589 invocation and query type.
16590 (MemberAccess.DoResolve): If the lookup failed and we're about to
16591 report a CS0122, try a lookup with the ec.ContainerType - if this
16592 succeeds, we must report a CS1540.
16594 2002-08-08 Martin Baulig <martin@gnome.org>
16596 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16597 (MethodGroupExpr): Implement the IMemberExpr interface.
16599 * expression (MemberAccess.ResolveMemberAccess): No need to have
16600 any special code for MethodGroupExprs anymore, they're now
16603 2002-08-08 Martin Baulig <martin@gnome.org>
16605 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16606 Family, FamANDAssem and FamORAssem permissions.
16607 (TypeManager.IsSubclassOrNestedChildOf): New public method.
16609 2002-08-08 Martin Baulig <martin@gnome.org>
16611 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16612 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16615 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16617 * driver.cs: implemented /resource option to embed managed resources.
16619 2002-08-07 Martin Baulig <martin@gnome.org>
16621 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16622 (FieldBase.HasFieldInitializer): New public property.
16623 (FieldBase.GetInitializerExpression): New public method. Resolves and
16624 returns the field initializer and makes sure it is only resolved once.
16625 (TypeContainer.EmitFieldInitializers): Call
16626 FieldBase.GetInitializerExpression to get the initializer, this ensures
16627 that it isn't resolved multiple times.
16629 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
16630 the resolving process (SimpleName/MemberLookup) that we're currently
16631 emitting a field initializer (which must not access any instance members,
16632 this is an error CS0236).
16634 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16635 argument, if the `IsFieldInitializer' flag is set, we must report and
16636 error CS0236 and not an error CS0120.
16638 2002-08-07 Martin Baulig <martin@gnome.org>
16640 * ecore.cs (IMemberExpr): New public interface.
16641 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16642 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16643 if the expression is an IMemberExpr.
16645 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16646 to be null, implicitly default to `this' if we're non-static in
16647 this case. Simplified the code a lot by using the new IMemberExpr
16648 interface. Also fixed bug #28176 here.
16650 2002-08-06 Martin Baulig <martin@gnome.org>
16652 * cs-parser.jay (SimpleLookup): Removed. We need to create
16653 ParameterReferences during semantic analysis so that we can do a
16654 type-only search when resolving Cast, TypeOf and SizeOf.
16655 (block): Pass the `current_local_parameters' to the Block's
16658 * class.cs (ConstructorInitializer): Added `Parameters parameters'
16659 argument to the constructor.
16660 (ConstructorInitializer.Resolve): Create a temporary implicit
16661 block with the parameters.
16663 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16664 references here if we aren't doing a type-only search.
16666 * statement.cs (Block): Added constructor which takes a
16667 `Parameters parameters' argument.
16668 (Block.Parameters): New public property.
16670 * support.cs (InternalParameters.Parameters): Renamed `parameters'
16671 to `Parameters' and made it public readonly.
16673 2002-08-06 Martin Baulig <martin@gnome.org>
16675 * ecore.cs (Expression.Warning): Made this public as well.
16677 * report.cs (Report.Debug): Print the contents of collections.
16679 2002-08-06 Martin Baulig <martin@gnome.org>
16681 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
16682 used to tell Resolve() which kinds of expressions it may return.
16683 (Expression.Resolve): Added overloaded version of this method which
16684 takes a `ResolveFlags flags' argument. This can be used to tell
16685 Resolve() which kinds of expressions it may return. Reports a
16687 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16688 ResolveFlags.SimpleName.
16689 (Expression.Error118): Added overloaded version of this method which
16690 takes a `ResolveFlags flags' argument. It uses the flags to determine
16691 which kinds of expressions are allowed.
16693 * expression.cs (Argument.ResolveMethodGroup): New public method.
16694 Resolves an argument, but allows a MethodGroup to be returned.
16695 This is used when invoking a delegate.
16697 * TODO: Updated a bit.
16699 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16701 Fixed compilation with csc.
16703 * ecore.cs: Expression.Error made public. Is this correct? Should
16704 Warning be made public too?
16706 * expression.cs: use ea.Location instead of ea.loc.
16707 [FIXME: Filed as bug #28607: MCS must report these errors.]
16709 2002-08-06 Martin Baulig <martin@gnome.org>
16711 * ecore.cs (Expression.loc): Moved the location here instead of
16712 duplicating it in all derived classes.
16713 (Expression.Location): New public property.
16714 (Expression.Error, Expression.Warning): Made them non-static and
16715 removed the location argument.
16716 (Expression.Warning): Added overloaded version which takes an
16717 `int level' argument.
16718 (Expression.Error118): Make this non-static and removed the
16719 expression and location arguments.
16720 (TypeExpr): Added location argument to the constructor.
16722 * expression.cs (StaticCallExpr): Added location argument to
16724 (Indirection, PointerArithmetic): Likewise.
16725 (CheckedExpr, UnCheckedExpr): Likewise.
16726 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16727 (StringPtr): Likewise.
16730 2002-08-05 Martin Baulig <martin@gnome.org>
16732 * expression.cs (BaseAccess.DoResolve): Actually report errors.
16734 * assign.cs (Assign.DoResolve): Check whether the source
16735 expression is a value or variable.
16737 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16738 while resolving the corresponding blocks.
16740 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16741 an error, don't silently return null.
16743 * statement.cs (Block.AddVariable): Do the error reporting here
16744 and distinguish between CS0128 and CS0136.
16745 (Block.DoResolve): Report all unused labels (warning CS0164).
16746 (LabeledStatement): Pass the location to the constructor.
16747 (LabeledStatement.HasBeenReferenced): New property.
16748 (LabeledStatement.Resolve): Set it to true here.
16750 * statement.cs (Return.Emit): Return success even after reporting
16751 a type mismatch error (CS0126 or CS0127), this is what csc does and
16752 it avoids confusing the users with any consecutive errors.
16754 2002-08-05 Martin Baulig <martin@gnome.org>
16756 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16758 * const.cs (Const.LookupConstantValue): Catch circular definitions.
16760 * expression.cs (MemberAccess.DoResolve): Silently return if an
16761 error has already been reported.
16763 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16764 error has already been reported.
16766 2002-08-05 Martin Baulig <martin@gnome.org>
16768 * statement.cs (UsageVector): Only initialize the `parameters'
16769 vector if we actually have any "out" parameters.
16771 2002-08-05 Martin Baulig <martin@gnome.org>
16773 * expression.cs (Binary.ResolveOperator): When combining delegates,
16774 they must have the same type.
16776 2002-08-05 Martin Baulig <martin@gnome.org>
16778 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16779 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16780 work with the ms runtime and we also don't need it: if we're a
16781 PropertyBuilder and not in the `indexer_arguments' hash, then we
16782 are a property and not an indexer.
16784 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16785 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16786 since the latter one doesn't work with the ms runtime.
16788 2002-08-03 Martin Baulig <martin@gnome.org>
16790 Fixed bugs #27998 and #22735.
16792 * class.cs (Method.IsOperator): New public field.
16793 (Method.CheckBase): Report CS0111 if there's already a method
16794 with the same parameters in the current class. Report CS0508 when
16795 attempting to change the return type of an inherited method.
16796 (MethodData.Emit): Report CS0179 if a method doesn't have a body
16797 and it's not marked abstract or extern.
16798 (PropertyBase): New abstract base class for Property and Indexer.
16799 (PropertyBase.CheckBase): Moved here from Property and made it work
16801 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16802 the same so we can reuse it there.
16803 (Property, Indexer): Derive from PropertyBase.
16804 (MethodSignature.inheritable_property_signature_filter): New delegate
16805 to find properties and indexers.
16807 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16808 argument and improved error reporting.
16810 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16811 EmptyReadOnlyParameters and made it a property.
16813 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16814 version of this method which takes a `PropertyInfo indexer'.
16815 (TypeManager.RegisterIndexer): New method.
16817 * class.cs: Added myself as author of this file :-)
16819 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16821 * class.cs: fixed compilation on windoze.
16823 2002-08-03 Martin Baulig <martin@gnome.org>
16825 * interface.cs (Interface.GetInterfaceBases): Check whether all
16826 base interfaces are at least as accessible than the current one.
16828 * class.cs (TypeContainer.GetClassBases): Check whether base types
16829 are at least as accessible than the current type.
16830 (TypeContainer.AsAccessible): Implemented and made non-static.
16831 (MemberBase.CheckParameters): Report errors if the accessibility
16834 * delegate.cs (Delegate.Delegate): The default visibility is
16835 internal for top-level types and private for nested types.
16836 (Delegate.Define): Report errors if the accessibility checks fail.
16838 * enum.cs (Enum.Enum): The default visibility is internal for
16839 top-level types and private for nested types.
16840 (Enum.DefineType): Compute the correct visibility.
16842 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16843 function which takes a `bool is_toplevel' instead of a TypeContainer.
16845 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16848 2002-08-02 Martin Baulig <martin@gnome.org>
16850 * expression.cs (LocalVariableReferenc): Added constructor which
16851 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16852 (LocalVariableReference.IsReadOnly): New property.
16853 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16854 variable is readonly, use our own readonly flag to do this; you can
16855 use the new constructor to get a writable reference to a read-only
16858 * cs-parser.jay (foreach_statement, using_statement): Get a writable
16859 reference to the local variable.
16861 2002-08-01 Miguel de Icaza <miguel@ximian.com>
16863 * rootcontext.cs (ResolveCore): Also include System.Exception
16865 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16866 we reach an EmptyStatement.
16868 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16871 * expression.cs (Binary.ResolveOperator): Check error result in
16874 use brtrue/brfalse directly and avoid compares to null.
16876 2002-08-02 Martin Baulig <martin@gnome.org>
16878 * class.cs (TypeContainer.Define): Define all nested interfaces here.
16879 Fixes bug #28407, added test-155.cs.
16881 2002-08-01 Martin Baulig <martin@gnome.org>
16883 * class.cs (Event.EmitDefaultMethod): Make this work with static
16884 events. Fixes #28311, added verify-3.cs.
16886 2002-08-01 Martin Baulig <martin@gnome.org>
16888 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16889 `is_disposable' fields.
16890 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16891 `hm.is_disposable' if we're using the collection pattern.
16892 (Foreach.EmitCollectionForeach): Use the correct type for the
16893 enumerator's local variable, only emit the try/finally block if
16894 necessary (fixes #27713).
16896 2002-08-01 Martin Baulig <martin@gnome.org>
16898 * ecore.cs (Expression.report118): Renamed to Error118 and made
16901 * statement.cs (Throw.Resolve): Check whether the expression is of
16902 the correct type (CS0118) and whether the type derives from
16903 System.Exception (CS0155).
16904 (Catch.Resolve): New method. Do the type lookup here and check
16905 whether it derives from System.Exception (CS0155).
16906 (Catch.CatchType, Catch.IsGeneral): New public properties.
16908 * typemanager.cs (TypeManager.exception_type): Added.
16910 2002-07-31 Miguel de Icaza <miguel@ximian.com>
16912 * driver.cs: Updated About function.
16914 2002-07-31 Martin Baulig <martin@gnome.org>
16916 Implemented Control Flow Analysis.
16918 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16919 (EmitContext.CurrentBranching): Added.
16920 (EmitContext.StartFlowBranching): Added.
16921 (EmitContext.EndFlowBranching): Added.
16922 (EmitContext.KillFlowBranching): Added.
16923 (EmitContext.IsVariableAssigned): Added.
16924 (EmitContext.SetVariableAssigned): Added.
16925 (EmitContext.IsParameterAssigned): Added.
16926 (EmitContext.SetParameterAssigned): Added.
16927 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16928 Added control flow analysis stuff here.
16930 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16931 resolve the expression as lvalue.
16932 (LocalVariableReference.DoResolve): Check whether the variable has
16933 already been assigned.
16934 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16935 the parameter as assigned here.
16936 (ParameterReference.DoResolve): Check whether the parameter has already
16938 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16939 expression as lvalue.
16941 * statement.cs (FlowBranching): New class for the flow analysis code.
16942 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16943 (LabeledStatement.IsDefined): New public property.
16944 (LabeledStatement.AddUsageVector): New public method to tell flow
16945 analyis that the label may be reached via a forward jump.
16946 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16948 (VariableInfo.Number): New public field. This is used by flow analysis
16949 to number all locals of a block.
16950 (Block.CountVariables): New public property. This is the number of
16951 local variables in this block (including the locals from all parent
16953 (Block.EmitMeta): Number all the variables.
16955 * statement.cs: Added flow analysis support to all classes.
16957 2002-07-31 Martin Baulig <martin@gnome.org>
16959 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16960 To get debugging messages, compile mcs with /define:MCS_DEBUG and
16961 then use this argument.
16963 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16965 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16966 use this to specify /define options.
16968 2002-07-29 Martin Baulig <martin@gnome.org>
16970 * statement.cs (Fixed): Moved all code that does variable lookups
16971 and resolvings from Emit to Resolve.
16973 * statement.cs (For): Moved all code that does variable lookups
16974 and resolvings from Emit to Resolve.
16976 * statement.cs (Using): Moved all code that does variable lookups
16977 and resolvings from Emit to Resolve.
16979 2002-07-29 Martin Baulig <martin@gnome.org>
16981 * attribute.cs (Attribute.Resolve): Explicitly catch a
16982 System.NullReferenceException when creating the
16983 CustromAttributeBuilder and report a different warning message.
16985 2002-07-29 Martin Baulig <martin@gnome.org>
16987 * support.cs (ParameterData.ParameterName): Added method to
16988 get the name of a parameter.
16990 * typemanager.cs (TypeManager.IsValueType): New public method.
16992 2002-07-29 Martin Baulig <martin@gnome.org>
16994 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
16995 is a flag which specifies that it's either ref or out.
16996 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16997 the out parameter to `out Parameter.Modifier mod', also set the
16998 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17000 * support.cs (InternalParameters.ParameterModifier): Distinguish
17001 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17002 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17004 * expression.cs (Argument.GetParameterModifier): Distinguish
17005 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17006 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17008 2002-07-29 Martin Baulig <martin@gnome.org>
17010 * expression.cs (ParameterReference.ParameterReference): Added
17011 `Location loc' argument to the constructor.
17013 * cs-parser.jay: Pass location to ParameterReference.
17015 2002-07-28 Miguel de Icaza <miguel@ximian.com>
17017 * statement.cs (Try): Initialize the location.
17019 * cs-parser.jay: pass location to Try.
17021 * expression.cs (Unary.Reduce): Change the prototype to return
17022 whether a constant fold could be performed or not. The result is
17023 returned in an out parameters. In the case of Indirection and
17024 AddressOf, we want to perform the full tests.
17026 2002-07-26 Miguel de Icaza <miguel@ximian.com>
17028 * statement.cs (Statement.Emit): Flag dead code.
17030 2002-07-27 Andrew Birkett <andy@nobugs.org>
17032 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17034 2002-07-27 Martin Baulig <martin@gnome.org>
17036 * class.cs (MethodData.Define): Put back call to
17037 TypeManager.AddMethod(), accidentally commented this out.
17039 * report.cs (Debug): New public method to print debugging information,
17040 this is `[Conditional ("DEBUG")]'.
17042 2002-07-26 Martin Baulig <martin@gnome.org>
17044 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17045 (switch_statement): Push the current_block to the switch_stack and
17046 pop it again when we're done with the switch.
17047 (switch_section): The new block is a child of the current_block.
17048 Fixes bug #24007, added test-152.cs.
17050 2002-07-27 Martin Baulig <martin@gnome.org>
17052 * expression.cs (Invocation.EmitArguments): When calling a varargs
17053 function with only its fixed arguments, we need to pass an empty
17056 2002-07-27 Martin Baulig <martin@gnome.org>
17058 Mono 0.13 has been released.
17060 2002-07-25 Miguel de Icaza <miguel@ximian.com>
17062 * driver.cs: Rename --resource to --linkres, because that is what
17063 we do currently, we dont support --resource yet.
17065 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17067 2002-07-25 Martin Baulig <martin@gnome.org>
17069 * class.cs (MethodData): New public class. This is a `method builder'
17070 class for a method or one accessor of a Property/Indexer/Event.
17071 (MethodData.GetMethodFlags): Moved here from MemberBase.
17072 (MethodData.ApplyAttributes): Likewise.
17073 (MethodData.ApplyObsoleteAttribute): Likewise.
17074 (MethodData.ApplyConditionalAttribute): Likewise.
17075 (MethodData.ApplyDllImportAttribute): Likewise.
17076 (MethodData.CheckAbstractAndExternal): Likewise.
17077 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17078 (MethodData.Emit): Formerly known as Method.Emit().
17079 (MemberBase): Moved everything which was specific to a single
17080 accessor/method to MethodData.
17081 (Method): Create a new MethodData and call Define() and Emit() on it.
17082 (Property, Indexer, Event): Create a new MethodData objects for each
17083 accessor and call Define() and Emit() on them.
17085 2002-07-25 Martin Baulig <martin@gnome.org>
17087 Made MethodCore derive from MemberBase to reuse the code from there.
17088 MemberBase now also checks for attributes.
17090 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17091 (MemberBase.GetMethodFlags): Moved here from class Method and marked
17093 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17094 `CallingConventions cc' and `Attributes opt_attrs' arguments.
17095 (MemberBase.ApplyAttributes): New virtual method; applies the
17096 attributes to a method or accessor.
17097 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17098 (MemberBase.ApplyConditionalAttribute): Likewise.
17099 (MemberBase.ApplyDllImportAttribute): Likewise.
17100 (MemberBase.CheckAbstractAndExternal): Likewise.
17101 (MethodCore.ParameterTypes): This is now a property instead of a
17102 method, it's initialized from DoDefineParameters().
17103 (MethodCore.ParameterInfo): Removed the set accessor.
17104 (MethodCore.DoDefineParameters): New protected virtual method to
17105 initialize ParameterTypes and ParameterInfo.
17106 (Method.GetReturnType): We can now simply return the MemberType.
17107 (Method.GetMethodFlags): Override the MemberBase version and add
17108 the conditional flags.
17109 (Method.CheckBase): Moved some code from Define() here, call
17110 DoDefineParameters() here.
17111 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17112 here to avoid some larger code duplication.
17113 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17114 ensure that abstract and external accessors don't declare a body.
17116 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17117 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17118 lookup in the attribute's parent classes, so we need to abort as soon
17119 as we found the first match.
17120 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17121 the attribute has no arguments.
17123 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17126 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17128 * cs-parser.jay: reverted previous patch.
17130 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17132 * cs-parser.jay: fixed bug #22119.
17134 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17136 * attribute.cs: fixed compilation. The error was:
17137 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
17138 be assigned to before control leaves the current method."
17139 [FIXME: Filed as bug #28186: MCS must report this error.]
17141 2002-07-25 Martin Baulig <martin@gnome.org>
17143 * attribute.cs (Attribute.Conditional_GetConditionName): New static
17144 method to pull the condition name ouf of a Conditional attribute.
17145 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17146 the obsolete message and error flag out of an Obsolete attribute.
17148 * class.cs (Method.GetMethodFlags): New public method to get the
17149 TypeManager.MethodFlags for this method.
17150 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17152 (Method.Define): Get and apply the Obsolete and Conditional attributes;
17153 if we're overriding a virtual function, set the new private variable
17154 `parent_method'; call the new TypeManager.AddMethod().
17156 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
17157 the MethodBuilder and the Method in a PtrHashtable.
17158 (TypeManager.builder_to_method): Added for this purpose.
17159 (TypeManager.MethodFlags): Added IsObsoleteError.
17160 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
17161 Obsolete and Conditional arguments in MethodBuilders. If we discover
17162 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17163 the message from the attribute.
17165 2002-07-24 Martin Baulig <martin@gnome.org>
17167 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17168 preprocessor directives, ensure that the argument to #define/#undef is
17169 exactly one identifier and that it's actually an identifier.
17171 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17174 2002-07-24 Martin Baulig <martin@gnome.org>
17176 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17177 initialize it to TypeManager.object_type in the constructor.
17178 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17179 of the `hm.get_current' method if we're using the collection pattern.
17180 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17181 for the explicit conversion to make it work when we're using the collection
17182 pattern and the `Current' property has a different return type than `object'.
17185 2002-07-24 Martin Baulig <martin@gnome.org>
17187 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17188 does not match, but don't report any errors. This method is called in
17189 order for all methods in a MethodGroupExpr until a matching method is
17190 found, so we don't want to bail out if the first method doesn't match.
17191 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17192 matches, report the 123. Fixes #28070.
17194 2002-07-24 Martin Baulig <martin@gnome.org>
17196 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17197 TypeManager.TypeToCoreType() to the top of the method so the
17198 following equality checks will work. Fixes #28107.
17200 2002-07-24 Martin Baulig <martin@gnome.org>
17202 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17203 operand is of type uint, and the other operand is of type sbyte,
17204 short or int, the operands are converted to type long." -
17205 Actually do what this comment already told us. Fixes bug #28106,
17208 2002-07-24 Martin Baulig <martin@gnome.org>
17210 * class.cs (MethodBase): New abstract class. This is now a base
17211 class for Property, Indexer and Event to avoid some code duplication
17212 in their Define() and DefineMethods() methods.
17213 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17214 generic methods for Define() and DefineMethods().
17215 (FieldBase): Derive from MemberBase, not MemberCore.
17216 (Property): Derive from MemberBase, not MemberCore.
17217 (Property.DefineMethod): Moved all the code from this method to the
17218 new MethodBase.DefineAccessor(), just call it with appropriate
17220 (Property.Define): Call the new Property.DoDefine(), this does some
17221 sanity checks and we don't need to duplicate the code everywhere.
17222 (Event): Derive from MemberBase, not MemberCore.
17223 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17224 accessors, this will also make them work with interface events.
17225 (Indexer): Derive from MemberBase, not MemberCore.
17226 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17227 (Indexer.Define): Use the new MethodBase functions.
17229 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17230 argument to the constructor.
17231 (Interface.FindMembers): Added support for interface events.
17232 (Interface.PopluateEvent): Implemented.
17234 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
17236 2002-07-22 Miguel de Icaza <miguel@ximian.com>
17238 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17239 but this is required to check for a method name being the same as
17240 the containing class.
17244 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17246 * interface.cs: initialize variable.
17248 2002-07-23 Martin Baulig <martin@gnome.org>
17250 Implemented the IndexerName attribute in interfaces.
17252 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17253 name if this is an explicit interface implementation.
17254 (Indexer.InterfaceIndexerName): New public variable. If we're
17255 implementing an interface indexer, this is the IndexerName in that
17256 interface. Otherwise, it's the IndexerName.
17257 (Indexer.DefineMethod): If we're implementing interface indexer,
17258 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
17259 and Pending.ImplementIndexer methods.
17260 (Indexer.Define): Also define the PropertyBuilder if we're
17261 implementing an interface indexer and this is neither an explicit
17262 interface implementation nor do the IndexerName match the one in
17265 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17266 If a method is defined here, then we always need to create a proxy
17267 for it. This is used when implementing interface indexers.
17268 (Pending.IsInterfaceIndexer): New public method.
17269 (Pending.ImplementIndexer): New public method.
17270 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17271 This is used when implementing interface indexers to define a proxy
17273 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17274 define a proxy if necessary.
17276 * interface.cs (Interface.IndexerName): New public variable.
17277 (Interface.PopulateIndexer): Set the IndexerName.
17278 (Interface.DefineIndexers): New private method. Populate all the
17279 indexers and make sure their IndexerNames match.
17281 * typemanager.cs (IndexerPropertyName): Added support for interface
17284 2002-07-22 Martin Baulig <martin@gnome.org>
17286 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17287 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17288 ret if HasReturnLabel.
17289 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17292 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17293 and set the ec.LoopBeginTryCatchLevel.
17294 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17295 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17296 the current ec.TryCatchLevel, the branch goes out of an exception
17297 block. In this case, we need to use Leave and not Br.
17299 2002-07-22 Martin Baulig <martin@gnome.org>
17301 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17302 block unless the block does not always return or it is contained in
17303 another try { ... } catch { ... } block. Fixes bug #26506.
17304 Added verify-1.cs to the test suite.
17306 2002-07-22 Martin Baulig <martin@gnome.org>
17308 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17309 then we do not always return. Fixes bug #24985.
17311 2002-07-22 Martin Baulig <martin@gnome.org>
17313 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17314 lookup on a per-class level; ie. walk up the class hierarchy until we
17315 found at least one applicable method, then choose the best among them.
17316 Fixes bug #24463 and test-29.cs.
17318 2002-07-22 Martin Baulig <martin@gnome.org>
17320 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17321 return types of the methods. The return type is not part of the
17322 signature and we must not check it to make the `new' modifier work.
17323 Fixes bug #27999, also added test-147.cs.
17324 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17326 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17327 on the method's return type.
17329 2002-07-21 Martin Baulig <martin@gnome.org>
17331 * assign.cs: Make this work if the rightmost source is a constant and
17332 we need to do an implicit type conversion. Also adding a few more tests
17333 to test-38.cs which should have caught this.
17335 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17336 target in the makefile for this. The makefile.gnu is primarily intended
17337 for end-users who don't want to debug the compiler.
17339 2002-07-21 Martin Baulig <martin@gnome.org>
17341 * assign.cs: Improved the Assign class so it can now handle embedded
17342 assignments (X = Y = Z = something). As a side-effect this'll now also
17343 consume less local variables. test-38.cs now passes with MCS, added
17344 a few new test cases to that test.
17346 2002-07-20 Martin Baulig <martin@gnome.org>
17348 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17349 instructions. Fixes bug #27977, also added test-146.cs.
17351 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17353 * cs-tokenizer.cs: fixed getHex ().
17355 2002-07-19 Martin Baulig <martin@gnome.org>
17357 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17358 not Type.GetType() to lookup the array type. This is needed when
17359 we're constructing an array of a user-defined type.
17360 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17361 single-dimensional arrays, but also for single-dimensial arrays of
17364 2002-07-19 Martin Baulig <martin@gnome.org>
17366 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17367 this function is called, it's not allowed to share LocalBuilders
17368 among ILGenerators.
17370 2002-07-19 Martin Baulig <martin@gnome.org>
17372 * expression.cs (Argument.Resolve): Report an error 118 when trying
17373 to pass a type as argument.
17375 2002-07-18 Martin Baulig <martin@gnome.org>
17377 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17378 Conv_R_Un for the signed `long' type.
17380 2002-07-15 Miguel de Icaza <miguel@ximian.com>
17382 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17383 `expr' for the temporary result, as that will fail if we do
17384 multiple resolves on the same expression.
17386 2002-07-05 Miguel de Icaza <miguel@ximian.com>
17388 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17389 ec.TypeContainer for looking up aliases.
17391 * class.cs (TypeContainer): Remove LookupAlias from here.
17393 * decl.cs (DeclSpace); Move here.
17395 2002-07-01 Miguel de Icaza <miguel@ximian.com>
17397 * class.cs (FindMembers): Only call filter if the constructor
17398 bulider is not null.
17400 Also handle delegates in `NestedTypes' now. Now we will perform
17401 type lookups using the standard resolution process. This also
17404 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17405 This uses Expressions (the limited kind that can be parsed by the
17406 tree) instead of strings.
17408 * expression.cs (ComposedCast.ToString): Implement, used to flag
17409 errors since now we have to render expressions.
17411 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
17414 * ecore.cs (SimpleName.ToString): ditto.
17416 * cs-parser.jay: Instead of using strings to assemble types, use
17417 Expressions to assemble the type (using SimpleName, ComposedCast,
17418 MemberAccess). This should fix the type lookups in declarations,
17419 because we were using a different code path for this.
17421 * statement.cs (Block.Resolve): Continue processing statements
17422 even when there is an error.
17424 2002-07-17 Miguel de Icaza <miguel@ximian.com>
17426 * class.cs (Event.Define): Also remove the `remove' method from
17427 the list of pending items.
17429 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17430 generate more compact code.
17432 2002-07-17 Martin Baulig <martin@gnome.org>
17434 * const.cs (Const.LookupConstantValue): Add support for constant
17435 `unchecked' and `checked' expressions.
17436 Also adding test case test-140.cs for this.
17438 2002-07-17 Martin Baulig <martin@gnome.org>
17440 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17441 check whether mi.ReturnType implements the IEnumerator interface; the
17442 `==' and the IsAssignableFrom() will fail in this situation.
17444 2002-07-16 Ravi Pratap <ravi@ximian.com>
17446 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
17449 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17451 * expression.cs: fixed bug #27811.
17453 2002-07-14 Miguel de Icaza <miguel@ximian.com>
17455 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17456 Molaro: when we are a ref, the value already contains a pointer
17457 value, do not take the address of it.
17459 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17460 * removed mb-parser.jay and mb-tokenizer.cs
17462 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17464 * expression.cs: check against the building corlib void type.
17466 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17468 * ecore.cs: fix for valuetype static readonly fields: when
17469 initializing them, we need their address, not the address of a copy.
17471 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17473 * typemanager.cs: register also enum_type in corlib.
17475 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17477 * class.cs: allow calling this (but not base) initializers in structs.
17479 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17481 * ecore.cs: make sure we compare against the building base types
17484 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17486 * typemanager.cs: fix TypeToCoreType() to handle void and object
17487 (corlib gets no more typerefs after this change).
17489 2002-07-12 Miguel de Icaza <miguel@ximian.com>
17491 * expression.cs (ArrayCreation.EmitArrayArguments): use
17492 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17494 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17495 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
17496 array indexes, the runtime actually forbids them.
17498 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17499 for array arguments here.
17501 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17502 instead of the default for ValueTypes.
17504 (New.DoEmit): Use IsValueType instead of
17505 IsSubclassOf (value_type)
17506 (New.DoResolve): ditto.
17507 (Invocation.EmitCall): ditto.
17509 * assign.cs (Assign): ditto.
17511 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17512 Statements *are* currently doing part of their resolution during
17515 Expressions do always resolve during resolve, but statements are
17516 only required to propagate resolution to their children.
17518 2002-07-11 Miguel de Icaza <miguel@ximian.com>
17520 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17522 (LoadAssembly): Do not add the dll if it is already specified
17524 (MainDriver): Add the System directory to the link path at the end,
17525 after all the other -L arguments.
17527 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17528 wrong opcode for loading bytes and bools (ldelem.i1 instead of
17529 ldelem.u1) and using the opposite for sbytes.
17531 This fixes Digger, and we can finally run it.
17533 * driver.cs (UnixParseOption): Move the option parsing here.
17534 (CSCParseOption): Implement CSC-like parsing of options.
17536 We now support both modes of operation, the old Unix way, and the
17537 new CSC-like way. This should help those who wanted to make cross
17538 platform makefiles.
17540 The only thing broken is that /r:, /reference: and /lib: are not
17541 implemented, because I want to make those have the same semantics
17542 as the CSC compiler has, and kill once and for all the confussion
17543 around this. Will be doing this tomorrow.
17545 * statement.cs (Unsafe.Resolve): The state is checked during
17546 resolve, not emit, so we have to set the flags for IsUnsfe here.
17548 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17550 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17551 not catch the Error_ObjectRefRequired in SimpleName (as it is
17552 possible to have a class/instance variable name that later gets
17553 deambiguated), we have to check this here.
17555 2002-07-10 Ravi Pratap <ravi@ximian.com>
17557 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17558 make static and put into Expression.
17560 (Event.Define): Register the private field of the event with the
17561 TypeManager so that GetFieldFromEvent can get at it.
17563 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17564 keep track of the private field associated with an event which
17567 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17570 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17572 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17574 * expression.cs (Binary.EmitBranchable): this routine emits the
17575 Binary expression in a branchable context. This basically means:
17576 we need to branch somewhere, not just get the value on the stack.
17578 This works together with Statement.EmitBoolExpression.
17580 * statement.cs (Statement.EmitBoolExpression): Use
17583 2002-07-09 Miguel de Icaza <miguel@ximian.com>
17585 * statement.cs (For): Reduce the number of jumps in loops.
17587 (For): Implement loop inversion for the For statement.
17589 (Break): We can be breaking out of a Try/Catch controlled section
17590 (foreach might have an implicit try/catch clause), so we need to
17591 use Leave instead of Br.
17593 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17594 now). If the instace expression supports IMemoryLocation, we use
17595 the AddressOf method from the IMemoryLocation to extract the
17596 address instead of emitting the instance.
17598 This showed up with `This', as we were emitting the instance
17599 always (Emit) instead of the Address of This. Particularly
17600 interesting when This is a value type, as we dont want the Emit
17601 effect (which was to load the object).
17603 2002-07-08 Miguel de Icaza <miguel@ximian.com>
17605 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17607 * statement.cs (Checked): Set the CheckedState during the resolve
17608 process too, as the ConvCast operations track the checked state on
17609 the resolve process, and not emit.
17611 * cs-parser.jay (namespace_member_declaration): Flag that we have
17612 found a declaration when we do. This is used to flag error 1529
17614 * driver.cs: Report ok when we display the help only.
17616 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
17618 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17620 2002-07-04 Miguel de Icaza <miguel@ximian.com>
17622 * cs-tokenizer.cs (define): We also have to track locally the
17623 defines. AllDefines is just used for the Conditional Attribute,
17624 but we also need the local defines for the current source code.
17626 2002-07-03 Miguel de Icaza <miguel@ximian.com>
17628 * statement.cs (While, For, Do): These loops can exit through a
17629 Break statement, use this information to tell whether the
17630 statement is the last piece of code.
17632 (Break): Flag that we break.
17634 * codegen.cs (EmitContexts): New `Breaks' state variable.
17636 2002-07-03 Martin Baulig <martin@gnome.org>
17638 * class.cs (TypeContainer.MethodModifiersValid): Allow override
17639 modifiers in method declarations in structs. Otherwise, you won't
17640 be able to override things like Object.Equals().
17642 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17644 * class.cs (Method, Property, Indexer): Do not allow the public
17645 modifier to be used in explicit interface implementations.
17647 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17648 override modifiers in method declarations in structs
17650 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
17652 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17653 integer or real overflow, report an error
17655 2002-07-02 Martin Baulig <martin@gnome.org>
17657 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17658 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17659 to tell the runtime about our newly created System.Object and
17660 System.ValueType types.
17662 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17664 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17665 struct instead of Ldarg/Starg.
17667 2002-07-02 Martin Baulig <martin@gnome.org>
17669 * expression.cs (Indirection.Indirection): Call
17670 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17672 2002-07-02 Martin Baulig <martin@gnome.org>
17674 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17675 ValueType, call TypeManager.TypeToCoreType() on it.
17676 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17677 the OpCodes.Newarr argument.
17679 2002-07-02 Martin Baulig <martin@gnome.org>
17681 * expression.cs (Invocation.EmitCall): When compiling corlib,
17682 replace all calls to the system's System.Array type to calls to
17683 the newly created one.
17685 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17686 System.Array methods.
17687 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17688 from the system's System.Array type which must be replaced.
17690 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17692 * typemanager.cs: load unverifiable_code_ctor so we can build
17693 corlib using the correct type. Avoid using GetTypeCode() with
17695 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17696 TypeManager.object_type to allow building corlib.
17698 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17700 * ecore.cs: handle System.Enum separately in LoadFromPtr().
17702 2002-07-01 Martin Baulig <martin@gnome.org>
17704 * class.cs: Make the last change actually work, we need to check
17705 whether `ifaces != null' to avoid a crash.
17707 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17709 * class.cs: when we build structs without fields that implement
17710 interfaces, we need to add the interfaces separately, since there is
17711 no API to both set the size and add the interfaces at type creation
17714 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17716 * expression.cs: the dimension arguments to the array constructors
17717 need to be converted if they are a long.
17719 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17721 * class.cs: don't emit ldarg.0 if there is no parent constructor
17722 (fixes showstopper for corlib).
17724 2002-06-29 Martin Baulig <martin@gnome.org>
17726 MCS now compiles corlib on GNU/Linux :-)
17728 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17729 ie. check for MethodImplOptions.InternalCall.
17731 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17732 and TypeManager.attribute_type are null, so we must explicitly check
17733 whether parent is not null to find out whether it's an attribute type.
17734 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17735 and SetBuilder, not only if the property is neither abstract nor external.
17736 This is necessary to set the MethodImplOptions on the accessor methods.
17737 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17738 SetBuilder, see Property.Emit().
17740 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17741 populate "System.Object", "System.ValueType" and "System.Attribute" since
17742 they've already been populated from BootCorlib_PopulateCoreTypes().
17744 2002-06-29 Martin Baulig <martin@gnome.org>
17746 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17747 is the NullLiteral, we also need to make sure that target_type is not
17750 2002-06-29 Martin Baulig <martin@gnome.org>
17752 * rootcontext.cs (RootContext.ResolveCore): We must initialize
17753 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17754 before calling BootstrapCorlib_ResolveDelegate ().
17756 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17758 * statement.cs: fixed build-breaker. All tests passed ok.
17760 2002-06-27 Martin Baulig <martin@gnome.org>
17762 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17763 for System.Decimal when compiling corlib.
17765 2002-06-27 Martin Baulig <martin@gnome.org>
17767 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17768 switch blocks which contain nothing but a default clause.
17770 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
17772 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17774 2002-06-27 Martin Baulig <martin@gnome.org>
17776 * ecore.cs (PropertyExpr.PropertyExpr): Call
17777 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17779 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17780 is already a TypeBuilder.
17782 2002-06-27 Martin Baulig <martin@gnome.org>
17784 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17785 `target_type == TypeManager.array_type', not IsAssignableFrom() in
17786 the "from an array-type to System.Array" case. This makes it work
17787 when compiling corlib.
17789 2002-06-27 Martin Baulig <martin@gnome.org>
17791 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17792 non-static PropertyExpr, set its InstanceExpression. This makes
17793 the `ICollection.Count' property work in System/Array.cs.
17795 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
17797 * driver.cs: Made error handling more consistent. Errors now
17798 tracked by Report class, so many methods which used to return int
17799 now return void. Main() now prints success/failure and
17800 errors/warnings message.
17802 Renamed '--probe' compiler argument to '--expect-error'. Removed
17803 the magic number return values (123 and 124). Now, if the
17804 expected error occurs, the compiler exits with success (exit value
17805 0). If the compilation completes without seeing that particular
17806 error, the compiler exits with failure (exit value 1). The
17807 makefile in mcs/errors has been changed to handle the new behaviour.
17809 * report.cs: Made 'expected error' number a property and renamed
17810 it from 'Probe' to 'ExpectedError'.
17812 * genericparser.cs: Removed error handling support, since it is
17813 now all done by Report class.
17815 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17816 class, so parse() no longer returns an int.
17818 * namespace.cs: Use Report.Error instead of GenericParser.error
17820 2002-06-22 Miguel de Icaza <miguel@ximian.com>
17822 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17823 TypeContainer.AddOperator): At the front of the list put the
17824 explicit implementations, so they get resolved/defined first.
17826 2002-06-21 Miguel de Icaza <miguel@ximian.com>
17828 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17829 interface type is implemented by this TypeContainer. Used during
17830 explicit interface implementation.
17832 (Property.Define, Indexer.Define, Method.Define): Validate that
17833 the given interface in the explicit implementation is one of the
17834 base classes for the containing type.
17836 Also if we are explicitly implementing an interface, but there is
17837 no match in the pending implementation table, report an error.
17839 (Property.Define): Only define the property if we are
17840 not explicitly implementing a property from an interface. Use the
17841 correct name also for those properties (the same CSC uses,
17842 although that is really not needed).
17844 (Property.Emit): Do not emit attributes for explicitly implemented
17845 properties, as there is no TypeBuilder.
17847 (Indexer.Emit): ditto.
17849 Hiding then means that we do not really *implement* a pending
17850 implementation, which makes code fail.
17852 2002-06-22 Martin Baulig <martin@gnome.org>
17854 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17855 the return value of Object.GetType(). [FIXME: we need to do this whenever
17856 we get a type back from the reflection library].
17858 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17860 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17862 2002-06-20 Miguel de Icaza <miguel@ximian.com>
17864 * attribute.cs: Return null if we can not look up the type.
17866 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17867 the interface types found.
17869 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17870 interface types found.
17872 * typemanager.cs (GetInterfaces): Make this routine returns alll
17873 the interfaces and work around the lame differences between
17874 System.Type and System.Reflection.Emit.TypeBuilder in the results
17875 result for GetInterfaces.
17877 (ExpandInterfaces): Given an array of interface types, expand and
17878 eliminate repeated ocurrences of an interface. This expands in
17879 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17882 2002-06-21 Martin Baulig <martin@gnome.org>
17884 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17887 2002-06-21 Martin Baulig <martin@gnome.org>
17889 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
17890 and called with one of the core types, return the corresponding typebuilder for
17893 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17896 2002-06-21 Martin Baulig <martin@gnome.org>
17898 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17899 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17900 (Expression.ConvertReferenceExplicit): Likewise.
17902 * expression.cs (ElementAccess.DoResolve): Likewise.
17903 (ElementAccess.DoResolveLValue): Likewise.
17905 2002-06-10 Martin Baulig <martin@gnome.org>
17907 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17908 add the "value" parameter to the parameter list.
17910 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17913 2002-06-19 Miguel de Icaza <miguel@ximian.com>
17915 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17916 the argument to an int, uint, long or ulong, per the spec. Also
17917 catch negative constants in array creation.
17919 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17921 * class.cs: do not allow the same interface to appear twice in
17922 the definition list.
17924 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17926 * ecore.cs: don't use ldlen with System.Array.
17928 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17930 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17932 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17934 * modifiers.cs: produce correct field attributes for protected
17935 internal. Easy fix so miguel can work on ther harder stuff:-)
17937 2002-06-18 Miguel de Icaza <miguel@ximian.com>
17939 * pending.cs: New file. Move the code from class.cs here.
17940 Support clearning the pending flag for all methods (when not doing
17941 explicit interface implementation).
17943 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17945 * rootcontext.cs: added a couple more types needed to bootstrap.
17947 2002-06-17 Miguel de Icaza <miguel@ximian.com>
17949 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17950 constructor in the type, instead of any constructor in the type
17951 hierarchy. Thanks to Paolo for finding this bug (it showed up as
17952 a bug in the Mono runtime when applying the params attribute).
17954 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17955 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17957 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
17959 * expression.cs (Unary.ResolveOperator): Use TypeManager
17960 to resolve the type.
17962 2002-06-13 Ravi Pratap <ravi@ximian.com>
17964 * cs-parser.jay (enum_member_declaration): Pass in the attributes
17967 * enum.cs (AddEnumMember): Add support to store the attributes associated
17968 with each member too.
17970 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17971 field builders too - this takes care of the enum member case.
17973 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
17975 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17976 address-of operator on both value types and pointers.
17978 2002-06-10 Martin Baulig <martin@gnome.org>
17980 * interface.cs (Interface.PopulateIndexer): Add the indexer's
17981 PropertyBuilder to the `property_builders' list.
17983 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17984 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17985 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
17986 find any indexers which are inherited from an interface.
17988 2002-06-09 Martin Baulig <martin@gnome.org>
17990 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17991 the same type as the constant if necessary. There's also a test-130.cs
17994 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17996 * typemanager.cs (TypeManager.ChangeType): Previously known as
17997 Enum.ChangeEnumType().
17999 2002-06-09 Martin Baulig <martin@gnome.org>
18001 * expression.cs (Cast.TryReduce): Added support for consts.
18003 2002-06-08 Ravi Pratap <ravi@ximian.com>
18005 * class.cs (Accessor): Hold attributes information so we can pass
18008 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18009 Modify to pass in attributes attached to the methods.
18011 (add_accessor_declaration, remove_accessor_declaration): Ditto.
18013 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18014 to handle the Accessor kind :-)
18016 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18018 2002-06-08 Martin Baulig <martin@gnome.org>
18020 * expression.cs (Unary.TryReduceNegative): Added support for
18023 2002-06-08 Martin Baulig <martin@gnome.org>
18025 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18026 name can't be found in the `defined_names' - the caller will do a
18027 MemberLookup in this case and thus find methods in System.Enum
18028 such as Enum.IsDefined().
18030 2002-06-08 Martin Baulig <martin@gnome.org>
18032 * enum.cs (Enum.ChangeEnumType): This is a custom version of
18033 Convert.ChangeType() which works with TypeBuilder created types.
18034 (Enum.LookupEnumValue, Enum.Define): Use it here.
18036 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18037 `TypeBuilder.BaseType != null' check.
18038 (TypeContainer.FindMembers): Only lookup parent members if we
18039 actually have a parent.
18040 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18041 (ConstructorInitializer.Resolve): Likewise.
18043 * interface.cs (Interface.FindMembers): Added
18044 `TypeBuilder.BaseType != null' check.
18046 * rootcontext.cs (RootContext.ResolveCore): Added
18047 "System.Runtime.CompilerServices.IndexerNameAttribute" to
18048 classes_second_stage.
18050 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18051 debug_type and trace_type when compiling with --nostdlib.
18053 2002-06-07 Martin Baulig <martin@gnome.org>
18055 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18056 (AddField): Set it to true when adding a non-static field.
18057 (DefineType): Use `have_nonstatic_fields' to find out whether we
18058 have non-static fields, not `Fields != null'.
18060 2002-06-02 Miguel de Icaza <miguel@ximian.com>
18062 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18063 dereferencing a null on the static-field code path)
18065 2002-05-30 Martin Baulig <martin@gnome.org>
18067 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18068 to take command line arguments. Use reflection to call the new
18069 custom `Initialize' function on the symbol writer and pass it the
18070 command line arguments.
18072 * driver.cs (--debug-args): New command line argument to pass command
18073 line arguments to the symbol writer.
18075 2002-05-28 Miguel de Icaza <miguel@ximian.com>
18077 * assign.cs (DoResolve): Forgot to do the implicit conversion to
18078 the target type for indexers and properties. Thanks to Joe for
18081 2002-05-27 Miguel de Icaza <miguel@ximian.com>
18083 * typemanager.cs (MethodFlags): returns the method flags
18084 (Obsolete/ShouldIgnore) that control warning emission and whether
18085 the invocation should be made, or ignored.
18087 * expression.cs (Invocation.Emit): Remove previous hack, we should
18088 not do this on matching a base type, we should do this based on an attribute
18090 Only emit calls to System.Diagnostics.Debug and
18091 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18092 on the command line.
18094 * rootcontext.cs: Global settings for tracing and debugging.
18096 * cs-tokenizer.cs (define): New utility function to track
18097 defines. Set the global settings for TRACE and DEBUG if found.
18099 2002-05-25 Ravi Pratap <ravi@ximian.com>
18101 * interface.cs (Populate*): Pass in the TypeContainer as well as
18102 the DeclSpace as parameters so that we can create EmitContexts and
18103 then use that to apply attributes etc.
18105 (PopulateMethod, PopulateEvent, PopulateProperty)
18106 (PopulateIndexer): Apply attributes everywhere.
18108 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18111 (ApplyAttributes): Update accordingly.
18113 We now apply interface attributes for all members too.
18115 2002-05-26 Miguel de Icaza <miguel@ximian.com>
18117 * class.cs (Indexer.Define); Correctly check if we are explicit
18118 implementation (instead of checking the Name for a ".", we
18119 directly look up if the InterfaceType was specified).
18121 Delay the creation of the PropertyBuilder.
18123 Only create the PropertyBuilder if we are not an explicit
18124 interface implementation. This means that explicit interface
18125 implementation members do not participate in regular function
18126 lookups, and hence fixes another major ambiguity problem in
18127 overload resolution (that was the visible effect).
18129 (DefineMethod): Return whether we are doing an interface
18132 * typemanager.cs: Temporary hack until we get attributes in
18133 interfaces (Ravi is working on that) and we get IndexerName
18134 support in interfaces.
18136 * interface.cs: Register the indexers as properties.
18138 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18139 warning, I have verified that this is a bug in the .NET runtime
18140 (JavaScript suffers of the same problem).
18142 * typemanager.cs (MemberLookup): When looking up members for
18143 interfaces, the parent of an interface is the implicit
18144 System.Object (so we succeed in searches of Object methods in an
18145 interface method invocation. Example: IEnumerable x; x.ToString
18148 2002-05-25 Miguel de Icaza <miguel@ximian.com>
18150 * class.cs (Event): Events should also register if they do
18151 implement the methods that an interface requires.
18153 * typemanager.cs (MemberLookup); use the new GetInterfaces
18156 (GetInterfaces): The code used to lookup interfaces for a type is
18157 used in more than one place, factor it here.
18159 * driver.cs: Track the errors at the bottom of the file, we kept
18162 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18163 instance if the method we are calling is static!
18165 2002-05-24 Miguel de Icaza <miguel@ximian.com>
18167 * attribute.cs (ApplyAttributes): Make this function filter out
18168 the IndexerName attribute (as that attribute in reality is never
18169 applied) and return the string constant for the IndexerName
18172 * class.cs (TypeContainer.Emit): Validate that all the indexers
18173 have the same IndexerName attribute, and if so, set the
18174 DefaultName attribute on the class.
18176 * typemanager.cs: The return value might contain other stuff (not
18177 only methods). For instance, consider a method with an "Item"
18178 property and an Item method.
18180 * class.cs: If there is a problem with the parameter types,
18183 2002-05-24 Ravi Pratap <ravi@ximian.com>
18185 * ecore.cs (ImplicitConversionExists): Wrapper function which also
18186 looks at user defined conversion after making a call to
18187 StandardConversionExists - we need this for overload resolution.
18189 * expression.cs : Update accordingly the various method calls.
18191 This fixes 2 bugs filed against implicit user defined conversions
18193 2002-05-22 Miguel de Icaza <miguel@ximian.com>
18195 * statement.cs: Track the result of the assignment.
18197 2002-05-21 Miguel de Icaza <miguel@ximian.com>
18199 * expression.cs (MemberAccess): Improved error reporting for
18200 inaccessible members.
18202 2002-05-22 Martin Baulig <martin@gnome.org>
18204 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
18205 itself with debugging support.
18207 2002-05-22 Martin Baulig <martin@gnome.org>
18209 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18210 Removed, this isn't needed anymore.
18212 2002-05-20 Martin Baulig <martin@gnome.org>
18214 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18215 be underlying type for an enum.
18217 2002-05-20 Miguel de Icaza <miguel@ximian.com>
18219 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18220 that splits out the loading of just the core types.
18222 * rootcontext.cs (ResolveCore): Split the struct resolution in
18223 two, so we can load the enumeration underlying types before any
18226 * expression.cs (Is): Bandaid until we fix properly Switch (see
18227 bug #24985 for details).
18229 * typemanager.cs (ImplementsInterface): The hashtable will contain
18230 a null if there are no interfaces implemented.
18232 2002-05-18 Miguel de Icaza <miguel@ximian.com>
18234 * cs-parser.jay (indexer_declarator): It is fine to have array
18237 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18239 * typemanager.cs: (RegisterBuilder): New function used to register
18240 TypeBuilders that implement interfaces. Since
18241 TypeBuilder.GetInterfaces (as usual) does not work with lame
18243 (AddUserType): register interfaces.
18245 (ImplementsInterface): Use the builder_to_ifaces hash if we are
18246 dealing with TypeBuilder. Also, arrays are showing up as
18247 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18248 methods can not be invoked on them!
18250 * ecore.cs (ExplicitReferenceConversionExists): Made public.
18251 (ImplicitReferenceConversionExists): Split out from
18252 StandardConversionExists.
18254 * expression.cs (As): We were only implementing one of the three
18255 cases for the as operator. We now implement them all.
18256 (Is): Implement the various other cases for Is as well.
18258 * typemanager.cs (CACHE): New define used to control if we want or
18259 not the FindMembers cache. Seems to have a negative impact on
18260 performance currently
18262 (MemberLookup): Nested types have full acess to
18263 enclosing type members
18265 Remove code that coped with instance/static returns for events, we
18266 now catch this in RealFindMembers.
18268 (RealFindMembers): only perform static lookup if the instance
18269 lookup did not return a type or an event.
18271 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18273 * assign.cs (CompoundAssign): We pass more semantic information
18274 now to Compound Assignments than we did before: now we have all
18275 the information at hand, and now we resolve the target *before* we
18276 do the expression expansion, which allows the "CacheValue" method
18277 to have the effect we intended (before, a [x] += 1 would generate
18278 two differen ArrayAccess expressions from the ElementAccess,
18279 during the resolution process).
18281 (CompoundAssign.DoResolve): Resolve target and original_source here.
18283 2002-05-16 Miguel de Icaza <miguel@ximian.com>
18285 * expression.cs (ArrayAccess): dropped debugging information.
18287 * typemanager.cs: Small bug fix: I was always returning i_members,
18288 instead of one of i_members or s_members (depending on which had
18291 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
18292 method is invoked before any code generation takes place, and it
18293 is a mechanism to inform that the expression will be invoked more
18294 than once, and that the method should use temporary values to
18295 avoid having side effects
18297 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18299 * ecore.cs (Expression.CacheTemporaries): Provide empty default
18302 * expression.cs (Indirection, ArrayAccess): Add support for
18303 CacheTemporaries in these two bad boys.
18305 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18306 ldobj or ldind_ref.
18307 (StoreFromPtr): Handle stobj as well.
18309 * expression.cs (UnaryMutator): Share more code.
18311 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18312 down: I was not tracking the Filter function as well, which
18313 was affecting the results of the cache.
18315 2002-05-15 Miguel de Icaza <miguel@ximian.com>
18317 * attribute.cs: Remove the hack to handle the CharSet property on
18320 2002-05-14 Miguel de Icaza <miguel@ximian.com>
18322 * attribute.cs (DoResolve): More uglyness, we now only try to
18323 resolve the attribute partially, to extract the CharSet
18324 information (only if we are a StructLayout attribute). Otherwise
18326 (GetExtraTypeInfo): Add some code to conditionally kill in the
18327 future this. I am more and more convinced that the .NET
18328 framework has special code to handle the attribute setting on
18331 * expression.cs (IsParamsMethodApplicable): Revert my previous
18332 foreach change here, it was wrong.
18334 2002-05-13 Miguel de Icaza <miguel@ximian.com>
18336 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18337 (pp_expr): do not abort on unknown input, just return.
18338 (eval): abort if there are pending chars.
18340 * attribute.cs (Attribute.Resolve): Positional parameters are
18341 optional. Deal with that case.
18343 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18344 the Ansi/Unicode/Auto information for the type.
18346 (TypeContainer.DefineType): instantiate the EmitContext here, as
18347 we will be using it during the type definition (to resolve
18348 attributes) and during the emit phase.
18350 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18351 to pull type information out of the attributes
18353 (Attribute.Resolve): track the constructor builder, and allow for
18354 multiple invocations (structs and classes will use this).
18356 * ecore.cs (MemberLookupFinal): new version with all the
18357 parameters customizable.
18359 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18360 constructors. Return if the result value is null (as the error
18361 would have been flagged already by MemberLookupFinal)
18363 Do not allow instances of abstract classes or interfaces to be
18366 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18367 We have to compare the assembly property here when dealing with
18368 FamANDAssem and Assembly access modifiers, because we might be
18369 creating an assembly from *modules* (that means that we are not
18370 getting TypeBuilders for types defined in other modules that are
18371 part of this assembly).
18373 (Method.Emit): If the method is marked abstract and has a body,
18376 (TypeContainer.DefineMembers): If both the defined member and the
18377 parent name match are methods, then do not emit any warnings: let
18378 the Method.Define routine take care of flagging warnings. But if
18379 there is a mismatch (method overrides something else, or method is
18380 overriwritten by something, then emit warning).
18382 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18383 set to null, this means `do not check for the return type on the
18386 (Method.Define): set the return type for the method signature to
18387 null, so that we get methods with the same name and parameters and
18388 different return types. This is used to flag warning 114 (you are
18389 hiding a method, and you probably want to use the new/override
18392 * typemanager.cs (MemberLookup): Implemented proper access
18393 control, closing a long standing set of bug reports. The problem
18394 was that the Framework only has two bits: Public and NonPublic,
18395 and NonPublic includes private and protected methods, but we need
18396 to enforce the FamANDAssem, FamOrAssem and Family.
18398 2002-05-11 Miguel de Icaza <miguel@ximian.com>
18400 * statement.cs (GotoCase): Return true: Ammounts to giving up
18401 knowledge on whether we return or not, and letting the other case
18402 be responsible for it.
18404 2002-05-10 Miguel de Icaza <miguel@ximian.com>
18406 * driver.cs: Do not load directories for each file processed, only
18407 do it if there is a pattern.
18409 * ecore.cs: Report readonly assigns here as well, as we might have
18410 been resolved only by MemberAccess.
18412 (SimpleName.SimpleNameResolve): Also be useful for LValue
18413 resolution. We need this to propagate assign to local readonly variables
18415 * typemanager.cs: Use a ptrhashtable for the criteria, because we
18416 do not want to reuse potential criteria memory.
18418 * class.cs (MyEventBuilder): Set reflected_type;
18420 * ecore.cs (Constantify): Added support for constifying bools.
18422 (RootContext.LookupType): Added a cache for values looked up in
18423 the declaration space.
18425 * typemanager.cs (FindMembers): Now is a front-end to
18426 RealFindMembers, and provides a two-level hashtable-based cache to
18429 15% performance improvement: from 22.5 to 19.2 seconds.
18431 * expression.cs (IsParamsMethodApplicable): use foreach.
18432 (Invocation.DoResolve): ditto.
18433 (New.DoResolve): ditto.
18434 (ArrayCreation.DoResolve): ditto.
18436 * ecore.cs (FindMostEncompassingType): use foreach.
18438 * delegate.cs (NewDelegate.DoResolve): Use foreach
18440 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18441 (RemoveMethods): use foreach.
18443 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18444 nested foreach statements instead of for, and also break out of
18445 the inner loop once a match is found.
18447 (Invocation.OverloadResolve): Use foreach, simplify the code.
18449 2002-05-08 Miguel de Icaza <miguel@ximian.com>
18451 * cfold.cs (BinaryFold): During an enumeration evaluation context,
18452 we actually unwrap the expression to allow for extra information
18455 * expression.cs: Use Shr_Un on unsigned operations.
18457 2002-05-08 Ravi Pratap <ravi@ximian.com>
18459 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
18460 applicable operators was not being considered correctly. This closes
18461 the bug Miguel reported.
18463 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18465 * attribute.cs: check that the type derives from System.Attribute
18466 and report the correct error in that case (moved the duplicate code to
18467 its own method, too).
18469 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18471 * attribute.cs: lookup attribute type name as the spec says: first the
18472 bare attribute name and then name + "Attribute" (nant compiles with
18473 mcs after this fix).
18475 2002-05-07 Miguel de Icaza <miguel@ximian.com>
18477 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
18478 Because of the way we parse things, we should try to see if a
18479 UIntConstant can fit in an integer.
18481 2002-05-07 Ravi Pratap <ravi@ximian.com>
18483 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18484 when we are in an explicit context.
18486 (ConvertReferenceExplicit): When converting from Iface type S to Class
18487 T make sure the rules are implemented as an OR.
18489 * parameter.cs (ParameterType): Make it a property for now although the
18490 purpose really isn't anything immediate.
18492 * expression.cs (Is*Applicable): Do better checking on the parameter type
18493 of a ref/out parameter. The ones from the system assemblies are already
18494 marked with the correct type so we don't need to do any correction.
18496 * ecore.cs (StandardConversionExists): Conversion from Interface types to
18497 the object type is standard too so include that.
18499 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18501 * ecore.cs (StandardConversionExists): Augment with missing code:
18502 deal with IntConstant, LongConstants and Enumerations.
18504 * assign.cs: Report the error, instead of failing silently
18506 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18507 typecontainer that they are declared, because the
18508 typecontainer/namespace will have the list of using clauses that
18509 need to be applied.
18511 Assembly Attributes were escaping the normal registration
18514 (EmitCode): Apply attributes within an EmitContext that represents
18515 the container they were declared on.
18517 * cs-parser.jay: Track bases for structs. How did I get this wrong?
18519 2002-05-06 Ravi Pratap <ravi@ximian.com>
18521 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18522 Revamp completely - make much cleaner as we now operate only
18525 (FindMostSpecificSource, FindMostSpecificTarget): New methods
18526 to implement the logic detailed in the spec more correctly.
18528 (UserDefinedConversion): Update accordingly.
18530 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18532 * statement.cs: Return flow analysis information up.
18534 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18537 (token): Do not consume an extra character before calling
18540 2002-05-06 Piers Haken <piersh@friskit.com>
18542 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18544 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18546 * class.cs (Constructor.Emit): Set the IsStatic flag in the
18547 EmitContext during the instance constructor initializer
18548 resolution, to stop access to instance variables.
18550 This is mandated by the spec, last paragraph of the `constructor
18551 initializers' section.
18553 2002-05-05 Miguel de Icaza <miguel@ximian.com>
18555 * cs-parser.jay, class.cs (Accessor): new class used to represent
18556 an accessor (get or set). In the past we used `null' to represent
18557 a missing accessor. But this is ambiguous because there was no
18558 way to tell in abstract indexers/properties if one of them was
18561 Now there is a way of addressing that.
18563 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18564 instead of FindMembers.
18566 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18567 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18569 * attribute.cs: Treat indexers and properties as the same in terms
18570 of applying attributes
18572 * ecore.cs (FindMostEncompassedType): Use statically initialized
18573 EmptyExpressions()s like we do elsewhere to avoid creating useless
18574 objects (and we take this out of the tight loop).
18576 (GetConversionOperators): Move the code to extract the actual
18577 operators to a separate routine to clean things up.
18579 2002-05-04 Miguel de Icaza <miguel@ximian.com>
18581 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18582 events are always registered FieldBuilders.
18584 * class.cs (FieldBase): New class shared by Fields
18586 * delegate.cs: If we are a toplevel delegate, use our full name.
18587 If we are a nested delegate, then only use our tail name.
18589 2002-05-02 Ravi Pratap <ravi@ximian.com>
18591 * expression.cs (IsApplicable): Ensure that we add the "&" to
18592 ref/out types before comparing it with the type of the argument.
18594 (IsParamsMethodApplicable): Ditto.
18596 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
18599 * delegate.cs : Handle the case when we have more than one applicable
18600 method. Flag an error only when we finish checking all.
18602 2002-05-02 Miguel de Icaza <miguel@ximian.com>
18604 * expression.cs: Add support for boolean static initializers.
18606 2002-05-01 Miguel de Icaza <miguel@ximian.com>
18608 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18610 * parameter.cs (ComputeParameterTypes,
18611 ComputeAndDefineParameterTypes): Better error handling: now we
18612 clear the `types' cache if we fail during any of the type lookups.
18613 We also return the status code correctly to our caller
18615 * delegate.cs: If we fail to define a delegate, abort the extra
18618 * expression.cs (Binary.ResolveOperator): for
18619 operator==(object,object) and operator !=(object, object) we also
18620 have to verify that there is an implicit conversion from one to
18623 (ArrayAccess.DoResolve): Array Access can operate on
18626 2002-04-30 Miguel de Icaza <miguel@ximian.com>
18628 * assign.cs (CompoundAssign): A new class used as a "flag" that
18629 the assignment actually is happening as part of a compound
18630 assignment operator.
18632 During compound assignment, a few new rules exist to enable things
18639 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18640 to the type of x) if y is implicitly convertible to the type of x,
18641 and the operator is a builtin operator and the return type of the
18642 operator is explicitly convertible to the type of x.
18644 * rootcontext.cs: Reset warning level to 2. 4 catches various
18645 "interesting" features in mcs, we must clean this up at some
18646 point, but currently am trying to kill other bugs ;-)
18648 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18649 in container classes as well.
18651 * expression.cs (Binary.ResolveOperator): Handle string case
18652 before anything else (as operator overloading does emit an error
18653 before doing anything else).
18655 This code could go away when we move to a table driven model, but
18656 i could not come up with a good plan last night.
18658 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
18660 * typemanager.cs (CSharpName): reimplementation using regex.
18661 * class.cs: added null check for fields in Emit
18662 * rootcontext.cs: set warninglevel to 4
18664 2002-04-29 Miguel de Icaza <miguel@ximian.com>
18666 * typemanager.cs (CSharpName): reimplemented with Lupus
18669 2002-04-28 Miguel de Icaza <miguel@ximian.com>
18671 * statement.cs (If): correclty implement Resolve, because we were
18672 not catching sem errors in there. The same process is needed
18674 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18677 (Statement.Warning_DeadCodeFound): Factorize code.
18678 (While): Report dead code here too.
18680 (Statement): Added Resolve virtual method to allow
18681 for resolution split from the emit code.
18683 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18685 * statement.cs (EmitBoolExpression): No longer try to resolve the
18687 (MakeBoolean): New utility function that resolve, implicitly
18688 converts to boolean and tags the expression.
18691 (If, Do): Implement dead code elimination.
18692 (While): Implement loop inversion
18694 (Do, While, For, If): Resolve the expression prior to calling our
18697 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
18700 - added method Report28 (warning: program has more than one entry point)
18701 - added method IsEntryPoint, implements paragraph 10.1 of the spec
18702 - modified method Method.Define, the part at the end of the method
18704 * rootcontext.cs: added static public Location EntryPointLocation;
18706 * ../errors/cs0028.cs : Add test case for the above warning.
18709 - modified method CSharpName to allow arrays of primitive type to
18710 be printed nicely (e.g. instead of System.Int32[][] it now prints
18712 - added method CSharpSignature: returns the signature of a method
18713 in string format to be used in reporting errors, warnings, etc.
18715 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18718 2002-04-26 Ravi Pratap <ravi@ximian.com>
18720 * delegate.cs (Define): Fix extremely silly bug where I was
18721 setting the type of the 'object' parameter of the BeginInvoke
18722 method to System.IAsyncResult instead of System.Object ;-)
18724 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18726 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18729 (Constructor.Emit): return if we fail to initialize the
18730 constructor. Another door closed!
18732 * expression.cs (New.DoResolve): Improve error message (from -6 to
18733 1501). Use DeclaredOnly lookup to find the exact constructor.
18735 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18736 loop. This is useful.
18738 * cs-parser.jay: Adjust the default parameters so that destructors
18739 have the proper signature.
18741 2002-04-26 Martin Baulig <martin@gnome.org>
18743 * driver.cs (LoadAssembly): If `assembly' contains any characters
18744 which are only valid in path names and not in assembly names
18745 (currently slash, backslash and point), use Assembly.LoadFrom ()
18746 instead of Assembly.Load () on the `assembly' (before iteration
18747 over the link_paths).
18749 2002-04-26 Martin Baulig <martin@gnome.org>
18751 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18753 2002-04-25 Miguel de Icaza <miguel@ximian.com>
18755 * class.cs (Property): use the new typemanager.MemberLookup
18757 (TypeContainer.MemberLookup): Implement using the
18758 TypeManager.MemberLookup now.
18760 * typemanager.cs: Make MemberLookup a function of the TypeManager,
18761 and return MemberInfos, so that these can be used without an
18762 EmitContext (what we had before).
18764 2002-04-24 Miguel de Icaza <miguel@ximian.com>
18766 * expression.cs: Fix the case where the argument to params if the
18767 type of the params. I omitted handling this before. Fixed
18769 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18771 * driver.cs: Call BootCorlib_PopulateCoreType
18773 * class.cs (Property.CheckBase): Check for properties only, not
18776 * interface.cs: Temporary hack: try/catch around the
18777 CustomAttributeBuilder, because I am getting an exception that I
18780 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18781 types whose definitions are required to be there (attributes are
18782 defined before standard types).
18784 Compute definitions as we boot the various types, as they are used
18785 immediately (value_type class will need object_type, but if we do
18786 not initialize object_type, we will pass a null, which will let
18787 the runtime pick the System.Object from the existing corlib, which
18788 is not what we want).
18790 2002-04-22 Patrik Torstensson <totte@labs2.com>
18792 * cs-tokenizer.cs: fixed a number of trim() issues.
18794 2002-04-22 Ravi Pratap <ravi@ximian.com>
18796 * expression.cs (Argument.Type): Ensure that we return the correct
18797 type when we have out or ref parameters [in which case we
18800 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18802 * class.cs (Property, Indexer): Allow extern modifier in there.
18804 * typemanager.cs (InitBaseTypes): Initializes object_type and
18805 value_type, since those will be used early on during the bootstrap
18806 process to compile corlib.
18808 (InitCoreTypes): Move code from here to InitBaseTypes.
18810 2002-04-21 Miguel de Icaza <miguel@ximian.com>
18812 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18813 single-dimension arrays as using the ldlen opcode.
18815 Daniel Lewis discovered this optimization.
18817 * typemanager.cs: Add signature for System.Array::get_Length
18819 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18821 * statement.cs: report the error when the foreach does not apply to an
18822 array nor a collection.
18824 2002-04-19 Miguel de Icaza <miguel@ximian.com>
18826 * expression.cs: Add implicit conversions to the operator ~.
18828 * constant.cs (DecimalConstant.Emit): Emit decimal value.
18830 * typemanager.cs: Locate the decimal constructor.
18832 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18834 * attribute.cs: use the new property of TypeOf.
18835 * expression.cs: added 'get' property around typearg.
18837 These changes fix a build breaker reported by NickD. Is this the
18838 correct way to fix? If not, please, revert my changes and make it
18841 2002-04-17 Miguel de Icaza <miguel@ximian.com>
18843 * attribute.cs: Add support for typeof in attribute invocations.
18844 I am not sure that this is right though.
18846 2002-04-14 Duncan Mak <duncan@ximian.com>
18848 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18849 Binary.Operator.Division case.
18851 2002-04-13 Ravi Pratap <ravi@ximian.com>
18853 * class.cs (DefineType): Ensure that we do a proper check on
18854 attribute types and also register it with the TypeManager.
18856 (TypeContainer.Targets): The default for attribute types is
18857 AttributeTargets.All.
18859 * attribute.cs (ApplyAttributes): Registering the attribute type
18860 is done elsewhere, not when we discover we have a Usage attribute.
18862 2002-04-12 Ravi Pratap <ravi@ximian.com>
18864 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18865 and get rid of is_delegate parameter.
18867 * everywhere : update.
18869 2002-04-12 Ravi Pratap <ravi@ximian.com>
18871 * cs-parser.jay (compilation_unit): Revamp completely to use
18872 some new ideas that I got from Rhys' grammar to solve the problems
18873 with assembly level attributes.
18875 (outer_declaration): New grammar production.
18877 (attribute_sections): Add.
18879 (opt_attributes): Base on attribute_sections
18881 (namespace_declaration): Allow opt_attributes to tackle the case
18882 when we have assembly level attributes - we are clever in this
18885 * attribute.cs (ApplyAttributes): Do not worry about assembly
18886 attributes in the non-global context.
18888 * rootcontext.cs (AddGlobalAttributes): Go back to using this
18889 instead of SetGlobalAttributes.
18891 * class.cs, rootcontext.cs : Ensure we define and generate
18892 attribute types before anything else.
18894 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18895 and flag the new error -20 for the case when the attribute type
18896 does not have valid targets specified. csc does not catch this.
18898 * ../errors/errors.txt : update for error # -20
18900 2002-04-11 Ravi Pratap <ravi@ximian.com>
18902 * support.cs (InternalParameters.ParameterModifier): Do some null
18903 checking and return sane values.
18905 * class.cs (Method.Define): If we are a PInvoke method, ensure
18906 that we are static and extern. Report error # 601
18908 * ../errors/cs0601.cs : Add test case for the above error.
18910 2002-04-07 Ravi Pratap <ravi@ximian.com>
18912 * rootcontext.cs (attribute_types): We need to keep type of
18913 all attribute types separately and emit code for them first.
18915 (RegisterAttribute) : Implement.
18917 * class.cs (DefineType): Check if the current Type is a custom
18918 attribute type and register it accordingly.
18920 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18921 adding the first attribute twice and rename to
18923 (SetGlobalAttributes): this.
18925 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18928 * attribute.cs (ApplyAttributes): Take an additional argument telling us
18929 if we are processing global arguments. Hmm, I am unsure of this.
18931 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18933 * expression.cs: added static array of strings to avoid calling
18934 Enum.ToString () for Operator in Binary. Significant recover of
18937 2002-04-10 Miguel de Icaza <miguel@ximian.com>
18939 * class.cs (FindMembers): Allow the Builders of the various
18940 members to be null. If they are skip them. This only happens
18941 during the PInvoke declaration.
18943 2002-04-09 Miguel de Icaza <miguel@ximian.com>
18945 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18946 failure, so we do not keep going afterwards.
18948 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18949 wanted to pass `false' as the `is_delegate' argument. If this is
18950 the case, why not use delegate_type == null to mean `is_delegate =
18951 false' and anything else as is_delegate = true.
18953 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
18955 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18956 code for the section, not the beginning of the tests.
18958 2002-04-08 Miguel de Icaza <miguel@ximian.com>
18960 * cfold.cs: Handle operator + (Enum x, Underlying x)
18962 * expression.cs (Binary): same. Warn about errors where we have
18963 Enum/Enum in operator + as well.
18965 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
18968 - added support for switch(bool)
18969 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18970 - add TableSwitchEmit() to handle table-based switch statements
18972 2002-04-05 Ravi Pratap <ravi@ximian.com>
18974 * expression.cs (Invocation.OverloadResolve): Factor out code which
18975 does parameter compatibility checking with arguments so that we can
18976 re-use the code even from Delegate.VerifyApplicability
18978 (VerifyArgumentsCompat): Move above code here.
18980 * delegate.cs (VerifyApplicability): Get rid of duplicate code
18981 and instead make a call to the above method.
18983 2002-03-31 Ravi Pratap <ravi@ximian.com>
18985 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18986 We use it to keep track of classes which are attribute types.
18988 2002-04-02 Miguel de Icaza <miguel@ximian.com>
18990 * delegate.cs (Delegate.Define): Correctly define the types in the
18991 presence of fixed and array parameters.
18993 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18996 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18997 include NonPublic after the first iteration.
18999 * class.cs (Indexer.CheckBase): Only check if both parents are
19002 * cs-parser.jay (accessor_body): If empty, set to null.
19004 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19005 same code path here to resolve constants names that we did have in
19006 MemberAccess.DoResolve. There is too much code duplicated here.
19008 2002-04-01 Miguel de Icaza <miguel@ximian.com>
19010 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19012 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19015 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19016 tokens, numbers and strings.
19018 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19021 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19022 asyncronous parameters and the regular parameters.
19024 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19025 specify the target directory.
19027 * expression.cs: (This.DoResolve): Simplify
19028 (As.Emit): Optimize, do not generate IsInst if the expression is
19029 always of the given type.
19031 (Is.DoResolve): Bug fix, we were reporting both always/never for
19034 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19035 creating too many unnecessary arrays.
19037 2002-03-31 Miguel de Icaza <miguel@ximian.com>
19039 * class.cs (EmitFieldInitializer): Use Assign expression to assign
19040 fields instead of rolling our own initializer. Takes care of all
19041 implicit conversions, and drops unnecessary static checks/argument.
19043 2002-03-31 Dick Porter <dick@ximian.com>
19045 * driver.cs: use the GetDirectories() return values properly, and
19046 use "/" as path separator.
19048 2002-03-30 Miguel de Icaza <miguel@ximian.com>
19050 * expression.cs (Unary): Optimize - - expr into expr.
19051 (Binary): Optimize a + (-b) into a -b.
19053 * codegen.cs (CodeGen): Made all methods static.
19055 2002-03-29 Miguel de Icaza <miguel@ximian.com>
19059 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19060 TypeBuilder property.
19062 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19065 * tree.cs: Removed the various RecordXXXX, and replaced with a
19066 single RecordDecl. Removed all the accessor methods, and just
19067 left a single access point Type
19069 * enum.cs: Rename DefineEnum to DefineType.
19071 * decl.cs: New abstract method `DefineType' used to unify the
19072 Defines for Enumerations, Interfaces, TypeContainers and
19075 (FindType): Moved LookupInterfaceOrClass here. Moved the
19076 LookupBaseClasses method that used to live in class.cs and
19077 interface.cs here, and renamed to FindType.
19079 * delegate.cs: Implement DefineType. Take advantage of the
19080 refactored pattern for locating the parent builder without taking
19081 the parent_builder argument (which we know does not work if we are
19082 nested, and triggering a toplevel definition).
19084 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19086 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19087 accessibility of a member has changed during override and report
19090 * class.cs (Method.Define, Property.Define): Only complain on
19091 overrides if the method is private, any other accessibility is
19092 fine (and since we just checked the permission is the same, we are
19095 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19096 and elif are processed always. The other pre-processing
19097 directives are only processed if we are "taking" the path
19099 2002-03-29 Martin Baulig <martin@gnome.org>
19101 * class.cs (Method.Emit): Only emit symbolic debugging info if the
19102 current location is not Null.
19104 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19105 a separate method so we can profile it.
19107 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19108 `span.Seconds' are just seconds, but no minutes or hours.
19109 (MainDriver): Profile the CodeGen.SaveSymbols calls.
19111 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19113 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19114 Remove the gratuitous set of Final:
19116 // If an interface implementation, then we can set Final.
19117 if (((flags & MethodAttributes.Abstract) == 0) &&
19118 implementing.DeclaringType.IsInterface)
19119 flags |= MethodAttributes.Final;
19121 I do not know what I was smoking when I used that.
19124 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19125 step into fixing the name resolution issues for delegates and
19126 unifying the toplevel name resolution.
19128 2002-03-28 Martin Baulig <martin@gnome.org>
19130 * class.cs (Method.Emit): If we have a symbol writer, call its
19131 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19132 tell it about the current method.
19134 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19135 writer that we're going to emit the first byte of IL code for a new
19136 statement (a new source line).
19137 (EmitContext.EmitTopBlock): If we have a symbol writer, call
19138 EmitContext.Mark() before emitting any code.
19140 * location.cs (SymbolDocument): Return null when we're Null.
19142 * statement.cs (Statement): Moved the `Location loc' variable here.
19143 (Statement.EmitBoolExpression): If we have a symbol writer, call
19144 ec.Mark() before emitting any code to tell it that we're at the
19145 beginning of a new statement.
19146 (StatementExpression): Added `Location' argument to the constructor.
19147 (Block): Added public readonly variable `StartLocation' and public
19148 variable `EndLocation'. The latter is to be set using SetEndLocation().
19149 (Block): Added constructor which takes a start and end location.
19150 (Block.SetEndLocation): New method. This sets the end location.
19151 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19152 local variables we create.
19153 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19154 each statement and do also mark the begin and end of the block.
19156 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19157 tell it the current lexer.Location, use Location.Null for the end of the
19159 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19160 current block, set its end location using SetEndLocation().
19161 (statement_expression): StatementExpression constructor now takes the
19162 lexer.Location as additional argument.
19163 (for_statement, declare_local_variables): Likewise.
19164 (declare_local_variables): When creating a new implicit block, use the
19165 new Block constructor and pass it the lexer.Location.
19167 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19169 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19170 members also on the parent interfaces recursively.
19172 2002-03-27 Miguel de Icaza <miguel@ximian.com>
19174 * report.cs: Use new formats, since Gonzalo finished the missing
19177 * expression.cs (Binary.ResolveOperator): added missing operator|
19178 operator& and operator^ for bool/bool.
19180 * cs-parser.jay: CheckDef now takes a Location argument that is
19181 used to report errors more precisly (instead of reporting the end
19182 of a definition, we try to track something which is a lot closer
19183 to the source of the problem).
19185 * cs-tokenizer.cs: Track global token use, so we can properly flag
19186 the use of #define/#undef after the first token has been seen.
19188 Also, rename the reportXXXX to Error_DescriptiveName
19190 * decl.cs (DeclSpace.IsTopLevel): Move property here from
19191 TypeContainer, so that Enum and Interface can use this too.
19193 * class.cs (TypeContainer.LookupInterfaceOrClass,
19194 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19195 `builder' argument. Typically this was used to pass the parent
19196 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19199 The problem is that a nested class could trigger the definition of
19200 a toplevel class, and the builder would be obviously wrong in that
19203 So we drop this argument, and we compute dynamically the
19204 TypeBuilder/ModuleBuilder (the correct information was available
19205 to us anyways from DeclSpace.Parent)
19207 * interface.cs (Interface.DefineInterface): Drop builder
19208 parameter cleanup like class.cs
19210 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
19213 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19216 (Try.Emit): Propagate the returns value from the statement.
19218 (Return.Emit): Even if we are leavning
19220 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19222 * modifiers.cs: Fix the computation of MethodAttributes flags.
19224 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19226 * driver.cs: allow compilation of files that start with '/'.
19227 Add a default case when checking the argument of --target.
19229 2002-03-25 Miguel de Icaza <miguel@ximian.com>
19231 * interface.cs: Implement the same search algorithm for types in
19232 the interface code.
19234 * delegate.cs: Do not allow multiple definition.
19236 * Recovered ChangeLog that got accidentally amputated
19238 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19240 * rootcontext.cs: Load manually enum to allow core classes to
19241 contain enumerations.
19243 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19244 Update to new static methods in TypeManager.
19246 * typemanager.cs (GetMethod, GetConstructor): Use our
19247 implementation of FindMembers to find the members, since during
19248 corlib compilation, the types are TypeBuilders and GetMethod and
19249 GetConstructor do not work.
19251 Make all methods in TypeManager static.
19253 (InitCodeHelpers): Split the functionality from
19254 the InitCodeTypes function.
19256 * driver.cs: Call InitCodeHelpers after we have populated the
19259 * cs-parser.jay (delegate_declaration): we did not used to compute
19260 the delegate name correctly for void delegates.
19262 2002-03-24 Miguel de Icaza <miguel@ximian.com>
19264 * rootcontext.cs (RootContext): Init the interface_resolve_order
19265 and type_container_resolve_order always.
19267 (ResolveCore, BootstrapCorlib_ResolveClass,
19268 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19269 compiler when compiling with --nostdlib
19271 * class.cs (TypeContainer.DefineType): Check that our parent is
19272 not null. This test is most important when we are bootstraping
19275 * codegen.cs: Split out the symbol writing code.
19277 2002-03-25 Martin Baulig <martin@gnome.org>
19279 * driver.cs (-g): Made -g an alias for --debug.
19281 2002-03-24 Martin Baulig <martin@gnome.org>
19283 * codegen.cs (SymbolWriter): New public variable. Returns the
19284 current symbol writer.
19285 (CodeGen): Added `bool want_debugging_support' argument to the
19286 constructor. If true, tell the ModuleBuild that we want debugging
19287 support and ask it for the ISymbolWriter.
19288 (Save): If we have a symbol writer, call it's Close() method after
19289 saving the assembly.
19291 * driver.c (--debug): New command line argument to create a
19292 debugger information file.
19294 * location.cs (SymbolDocument): New public property. Returns an
19295 ISymbolDocumentWriter object for the current source file or null
19296 if we don't have a symbol writer.
19298 2002-03-21 Miguel de Icaza <miguel@ximian.com>
19300 * driver.cs (LoadAssembly): Correctly return when all the paths
19301 have been tried and not before.
19303 * statement.cs (Switch.Emit): return the actual coverage for this
19304 statement (returns/not-returns)
19306 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19307 switch of the statement if we are the last switch section. That
19308 kills two problems: try/catch problems (we used to emit an empty
19309 nop at the end) and switch statements where all branches would
19312 2002-03-19 Miguel de Icaza <miguel@ximian.com>
19314 * driver.cs: Add default assemblies (the equivalent to the
19315 Microsoft CSC.RSP file)
19317 * cs-tokenizer.cs: When updating `cols and setting it to zero,
19318 also update tokens_seen and set it to false.
19320 * driver.cs: Implement --recurse for Mike.
19322 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19323 correctly splitting out the paths.
19325 2002-03-18 Miguel de Icaza <miguel@ximian.com>
19327 * interface.cs (Interface.PopulateProperty): Instead of using
19328 `parent' as the declaration space for the set parameters, use
19331 * support.cs (InternalParameters): InternalParameters constructor
19332 takes a DeclSpace instead of a TypeContainer.
19334 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19335 types are being initialized, load the address of it before calling
19338 (New): Provide a mechanism to disable the generation of local
19339 value type temporaries when the caller will be providing us with
19340 an address to store it.
19342 (ArrayCreation.EmitDynamicInitializers): Use it.
19344 2002-03-17 Miguel de Icaza <miguel@ximian.com>
19346 * expression.cs (Invocation.EmitArguments): Only probe for array
19347 property if there is more than one argument. Sorry about that.
19349 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19350 empty param arrays.
19352 * class.cs (Method.LabelParameters): Fix incorrect code path that
19353 prevented the `ParamArrayAttribute' from being applied to the
19356 2002-03-16 Miguel de Icaza <miguel@ximian.com>
19358 * support.cs (ReflectionParameters): Correctly compute whether the
19359 last argument is a params array. Fixes the problem with
19362 * typemanager.cs: Make the assemblies array always be non-null
19363 (empty, but non-null)
19365 * tree.cs (RecordDecl): New function that abstracts the recording
19366 of names. This reports error 101, and provides a pointer to the
19367 previous declaration. Fixes a crash in the compiler.
19369 * cs-parser.jay (constructor_declaration): Update to new grammar,
19370 and provide a constructor_body that can be empty.
19372 2002-03-15 Miguel de Icaza <miguel@ximian.com>
19374 * driver.cs: Add support for --resources.
19376 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19377 Make all types for the various array helper methods be integer.
19379 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19380 CheckState to ConvCast.
19382 (ConvCast): Now it takes a `checked' state argument, to avoid
19383 depending on the emit context for the conversion, and just using
19384 the resolve time setting.
19386 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19387 instead of Invocation.EmitArguments. We do not emit the original
19388 arguments, instead we emit those which have been converted to
19389 unsigned int expressions.
19391 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19393 * codegen.cs: ditto.
19395 * expression.cs (LocalVariableReference): Drop the use of the
19396 Store function that depended on the variable index.
19398 * statement.cs (VariableInfo): Drop the `Idx' property from this
19399 class, as this is not taking into account the indexes for
19400 temporaries tat we generate during the execution, getting the
19403 * class.cs: First emit class initializers, then call the parent
19406 * expression.cs (Binary): Fix opcode emision.
19407 (UnaryMutator.EmitCode): Support checked code generation
19409 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19410 matches for events for both the Static and Instance scans,
19411 pointing to the same element. Fix that.
19413 2002-03-14 Miguel de Icaza <miguel@ximian.com>
19415 * rootcontext.cs (ResolveTree): Always set the
19416 interface_resolve_order, because nested interfaces will be calling
19419 * class.cs (GetInterfaceOrClass): Track the same resolution
19420 process used by TypeManager.LookupType. This fixes the nested
19421 type lookups in class declarations (separate path from
19424 (TypeContainer.DefineType): Also define nested interfaces.
19425 (TypeContainer.RegisterOrder): New public function used to
19426 register the order in which child interfaces need to be closed.
19428 Nested interfaces need to be closed after their parents have been
19431 * interface.cs (InterfaceAttr): Put all the logic for computing
19432 the interface attribute here.
19434 (DefineInterface): Register our interface order with the
19435 RootContext or with the TypeContainer depending on the case.
19437 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19439 * cs-parser.jay: rework foreach statement to work with the new
19440 changes to the policy on SimpleNames.
19442 * report.cs: support Stacktrace on warnings as well.
19444 * makefile: drop --unsafe and /unsafe from the compile.
19446 2002-03-13 Ravi Pratap <ravi@ximian.com>
19448 * ecore.cs (StandardConversionExists): Modify to take an Expression
19449 as the first parameter. Ensure we do null -> reference type conversion
19452 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19453 temporary Expression objects.
19455 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19457 * interface.cs: workaround bug in method overloading resolution
19458 (there is already a bugzilla bug for it).
19460 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19462 We could also solve this problem by having a separate path for
19463 performing type lookups, instead of DoResolve, we could have a
19464 ResolveType entry point, and only participating pieces of the
19465 production (simplename, deref, array) would implement this.
19467 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19468 signal SimpleName to only resolve type names and not attempt to
19469 resolve anything else.
19471 * expression.cs (Cast): Set the flag.
19473 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19475 * class.cs: Only report 108 if there is no `new' modifier.
19477 * cs-parser.jay: rework foreach statement to work with the new
19478 changes to the policy on SimpleNames.
19480 * report.cs: support Stacktrace on warnings as well.
19482 * makefile: drop --unsafe and /unsafe from the compile.
19484 2002-03-11 Miguel de Icaza <miguel@ximian.com>
19486 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19487 lookups here, instead of doing that at parse time. This means
19488 that our grammar will not introduce `LocalVariableReferences' as
19489 expressions at this point. That solves the problem of code like
19493 static void Main ()
19497 This is only half the fix. The full fix requires parameters to
19498 also be handled in this way.
19500 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19501 makes the use more obvious of the DeclSpace. The
19502 ec.TypeContainer.TypeBuilder is now only used to pull the
19503 TypeBuilder for it.
19505 My theory is that I can get rid of the TypeBuilder completely from
19506 the EmitContext, and have typecasts where it is used (from
19507 DeclSpace to where it matters).
19509 The only pending problem is that the code that implements Aliases
19510 is on TypeContainer, and probably should go in DeclSpace.
19512 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19513 lookups here, instead of doing that at parse time. This means
19514 that our grammar will not introduce `LocalVariableReferences' as
19515 expressions at this point. That solves the problem of code like
19519 static void Main ()
19523 This is only half the fix. The full fix requires parameters to
19524 also be handled in this way.
19526 * class.cs (Property.DefineMethod): When implementing an interface
19527 method, set newslot, when implementing an abstract method, do not
19528 set the flag (before we tried never setting it, or always setting
19529 it, which is the difference).
19530 (Indexer.DefineMethod): same.
19531 (Method.DefineMethod): same.
19533 * ecore.cs: Only set the status used flag if we get back a Field.
19535 * attribute.cs: Temporary hack, so Paolo can keep working.
19537 2002-03-08 Ravi Pratap <ravi@ximian.com>
19539 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19540 the unmanaged type in the case we have a MarshalAs attribute.
19542 (Resolve): Handle the case when we are parsing the special MarshalAs
19543 attribute [we need to store the unmanaged type to use later]
19545 * typemanager.cs (marshal_as_attr_type): Built in type for the
19546 MarshalAs Attribute.
19548 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
19549 on parameters and accordingly set the marshalling info.
19551 2002-03-09 Miguel de Icaza <miguel@ximian.com>
19553 * class.cs: Optimizing slightly by removing redundant code after
19554 we switched to the `NoTypes' return value.
19555 (Property.DefineMethod): use NoTypes here too.
19557 This fixes the bug I introduced in my last batch of changes.
19559 2002-03-05 Ravi Pratap <ravi@ximian.com>
19561 * tree.cs (RecordEnum): Add. We now keep track of enums too.
19563 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19564 Enums since those are types too.
19566 * cs-parser.jay (enum_declaration): Record enums as we parse them.
19568 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
19569 thanks to a call during the lookup process.
19571 2002-03-07 Miguel de Icaza <miguel@ximian.com>
19573 * statement.cs (Foreach): Lots of work to accomodate a particular
19574 kind of foreach statement that I had not kept in mind. It is
19575 possible to have foreachs on classes that provide a GetEnumerator
19576 method that return objects that implement the "pattern" for using
19577 a foreach, there is no need to support GetEnumerator
19580 This is needed to compile nant.
19582 * decl.cs: Only report 114 if the member is not `Finalize' and if
19583 the warning level is at least 2.
19585 * class.cs: Moved the compare function from Method to
19588 (MethodSignature.InheritableMemberSignatureCompare): Add new
19589 filter function that is used to extract inheritable methods from a
19592 (Method.Define): Use the new `inheritable_method_signature_filter'
19595 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19598 2002-03-06 Miguel de Icaza <miguel@ximian.com>
19600 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19602 * cs-parser.jay: Add opt_semicolon to the interface declaration.
19604 * expression.cs: Pass location information to
19605 ConvertImplicitStandard.
19607 * class.cs: Added debugging code to track return values from
19610 2002-03-05 Miguel de Icaza <miguel@ximian.com>
19612 * expression.cs (Is.DoResolve): If either side of the `is' is an
19613 interface, do not flag the warning.
19615 * ecore.cs (ImplicitReferenceConversion): We need a separate test
19618 * report.cs: Allow for --fatal to be used with --probe.
19620 * typemanager.cs (NoTypes): Move the definition for the empty Type
19623 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19625 (TypeContainer.DefineProxy): New function used to proxy to parent
19626 implementations when implementing interfaces.
19627 (TypeContainer.ParentImplements): used to lookup if our parent
19628 implements a public function that is required by an interface.
19629 (TypeContainer.VerifyPendingMethods): Hook this up.
19631 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19632 `modules' and `assemblies' arraylists into arrays. We only grow
19633 these are the very early start up of the program, so this improves
19634 the speedof LookupType (nicely measured).
19636 * expression.cs (MakeByteBlob): Replaced unsafe code with
19637 BitConverter, as suggested by Paolo.
19639 * cfold.cs (ConstantFold.Binary): Special case: perform constant
19640 folding of string concatenation, but if either side is a string,
19641 and the other is not, then return null, and let the runtime use
19642 the concatenation on the string plus the object (using
19643 `Object.ToString').
19645 2002-03-04 Miguel de Icaza <miguel@ximian.com>
19647 Constant Folding has been implemented now.
19649 * expression.cs (Unary.Reduce): Do not throw an exception, catch
19650 the error instead on types that are not supported in one's
19653 * constant.cs (Constant and all children): New set of functions to
19654 perform implict and explicit conversions.
19656 * ecore.cs (EnumConstant): Implement the new functions to perform
19657 conversion by proxying to the child expression.
19659 * codegen.cs: (ConstantCheckState): Constant evaluation has its
19660 own separate setting that can not be turned off from the command
19661 line using --unchecked or --checked and is only controlled using
19662 the checked/unchecked statements and expressions. This setting is
19663 used by the constant folder to flag errors.
19665 * expression.cs (CheckedExpr, UncheckedExpr): Set the
19666 ConstantCheckState as well.
19668 During Resolve, they also have to flag the state, because the
19669 constant folder runs completely in the Resolve phase.
19671 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19674 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19676 * cfold.cs: New file, this file contains the constant folder.
19678 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19679 argument to track whether we are using the resulting address to
19680 load or store a value and provide better error messages.
19682 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19683 new AddressOf arguments.
19685 * statement.cs (Foreach.EmitCollectionForeach): Update
19687 * expression.cs (Argument.Emit): Call AddressOf with proper
19688 arguments to track usage.
19690 (New.DoEmit): Call AddressOf with new arguments.
19692 (Unary.Emit): Adjust AddressOf call.
19694 2002-03-01 Ravi Pratap <ravi@ximian.com>
19696 * cs-parser.jay (member_access): Change the case for pre-defined types
19697 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
19700 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19703 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19704 essentially like methods and apply attributes like MethodImplOptions to them too.
19706 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19709 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19710 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19713 * Update code everywhere accordingly.
19715 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19717 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19719 2002-02-28 Ravi Pratap <ravi@ximian.com>
19721 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19722 try performing lookups against those instead of jumping straight into using
19723 the 'using' clauses.
19725 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19727 (LookupType): Perform lookups in implicit parents too.
19729 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19730 sequence as RootContext.LookupType.
19732 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
19733 the various cases of namespace lookups into this method.
19735 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19737 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19738 in positional arguments)
19740 * class.cs (Operator): Update the AllowedModifiers to contain
19743 * cs-parser.jay: Update operator declaration to allow for the
19744 operator body to be empty.
19746 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19749 2002-02-27 Miguel de Icaza <miguel@ximian.com>
19751 * class.cs (Method.Emit): Label parameters.
19753 * driver.cs: Return 1 or 0 as the program exit code.
19755 2002-02-26 Miguel de Icaza <miguel@ximian.com>
19757 * expression.cs: Special case the `null' object when trying to
19758 auto-compute the type, as anything can be explicitly converted to
19761 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19762 spotting this Paolo.
19764 (Expression.ImplicitNumericConversion): Perform comparissions of
19765 the type using the underlying type in the case of an enumeration
19766 rather than using the enumeration type for the compare.
19768 Cope with the underlying == type case, which is not possible to
19771 (Expression.ConvertNumericExplicit): Perform comparissions of
19772 the type using the underlying type in the case of an enumeration
19773 rather than using the enumeration type for the compare.
19775 * driver.cs: If the user does not supply an extension, assume .exe
19777 * cs-parser.jay (if_statement): Rewrote so that we can track the
19778 location for the if statement.
19780 * expression.cs (Binary.ConstantFold): Only concat strings when
19781 the operation is "+", not everything ;-)
19783 * statement.cs (Statement.EmitBoolExpression): Take a location
19785 (If, While, Do): Track location.
19787 * expression.cs (Binary.ResolveOperator): In the object + string
19788 case, I was missing a call to ConvertImplicit
19790 2002-02-25 Ravi Pratap <ravi@ximian.com>
19792 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19793 Location arguments. Ensure we use RootContext.LookupType to do our work
19794 and not try to do a direct Type.GetType and ModuleBuilder.GetType
19796 * interface.cs (PopulateMethod): Handle the type of the parameter being
19799 * expression.cs (Invocation.BetterFunction): Handle the case when we
19800 have a params method with no fixed arguments and a call is made with no
19803 2002-02-25 Miguel de Icaza <miguel@ximian.com>
19805 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19806 the verbatim-string-literal
19808 * support.cs (InternalParameters.ParameterModifier): handle null
19810 (InternalParameters.ParameterType): ditto.
19812 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19813 duplicating the name of the variable parameter.
19814 (GetParameterByName): Fix bug where we were not looking up array
19815 paramters if they were the only present (thanks Paolo!).
19816 (GetParameterInfo): We only have an empty set of types if both
19817 fixed and array are set to null.
19818 (GetParameterInfo-idx): Handle FixedParameter == null
19820 * cs-parser.jay: Handle the case where there is no catch
19821 statements (missing null test).
19823 2002-02-22 Miguel de Icaza <miguel@ximian.com>
19825 * driver.cs (MainDriver): Be conservative on our command line
19828 Catch DirectoryNotFoundException when calling GetFiles.
19830 (SplitPathAndPattern): Used to split the input specification into
19831 a path and a pattern that we can feed to Directory.GetFiles.
19833 2002-02-21 Miguel de Icaza <miguel@ximian.com>
19835 * statement.cs (Fixed): Implement the last case of the Fixed
19836 statement (string handling).
19838 * expression.cs (StringPtr): New class used to return a char * to
19839 a string; Used by the Fixed statement.
19841 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
19843 * expression.cs (Binary.ResolveOperator): Remove redundant
19844 MemberLookup pn parent type.
19845 Optimize union call, we do not need a union if the types are the same.
19846 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19849 Specialize the use of MemberLookup everywhere, instead of using
19850 the default settings.
19852 (StackAlloc): Implement stackalloc keyword.
19854 * cs-parser.jay: Add rule to parse stackalloc.
19856 * driver.cs: Handle /h, /help, /?
19858 * expression.cs (MakeByteBlob): Removed the hacks we had in place
19859 before we supported unsafe code.
19861 * makefile: add --unsafe to the self compilation of mcs.
19863 2002-02-20 Miguel de Icaza <miguel@ximian.com>
19865 * expression.cs (PointerArithmetic): New class that is used to
19866 perform pointer arithmetic.
19867 (Binary.Resolve): Handle pointer arithmetic
19868 Handle pointer comparission.
19869 (ArrayPtr): Utility expression class that is used to take the
19870 address of an array.
19872 (ElementAccess): Implement array access for pointers
19874 * statement.cs (Fixed): Implement fixed statement for arrays, we
19875 are missing one more case before we are done.
19877 * expression.cs (Indirection): Implement EmitAssign and set the
19878 ExprClass to Variable. This allows pointer dereferences to be
19879 treated as variables, and to have values assigned to them.
19881 * ecore.cs (Expression.StoreFromPtr): New utility function to
19882 store values dereferencing.
19884 2002-02-20 Ravi Pratap <ravi@ximian.com>
19886 * expression.cs (Binary.ResolveOperator): Ensure that we are
19887 not trying to operate on a void type - this fixes the reported
19890 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19891 the parent implementation is sealed.
19893 * ../errors/cs0239.cs : Add.
19895 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19897 * typemanager.cs (unverifiable_code_type): Corresponds to
19898 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19899 which have unsafe code in them.
19901 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
19904 2002-02-19 Miguel de Icaza <miguel@ximian.com>
19906 * cs-tokenizer.cs: Add support for @"litreal strings"
19908 Make tokenizer accept pre-processor directives
19909 on any column (remove the old C-like limitation).
19911 * rootcontext.cs (EmitCode): Emit any global attributes.
19912 (AddGlobalAttributes): Used to keep track of assembly attributes.
19914 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19916 * cs-parser.jay: Add support for global attributes.
19918 2002-02-17 Miguel de Icaza <miguel@ximian.com>
19920 * expression.cs (Indirection): New helper class. Unary will
19921 create Indirection classes to be able to implement the
19922 IMemoryLocation interface on it.
19924 2002-02-16 Miguel de Icaza <miguel@ximian.com>
19926 * cs-parser.jay (fixed_statement): reference the right statement.
19928 * statement.cs (Fixed.Emit): Finish implementing the fixed
19929 statement for the &x case.
19931 2002-02-14 Miguel de Icaza <miguel@ximian.com>
19933 * class.cs (Property.Define, Method.Define): Remove newslot when
19936 * modifiers.cs: My use of NewSlot when `Abstract' was set was
19937 wrong. NewSlot should only be used if the `new' keyword is present.
19939 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19940 locating our system dir. Sorry about this.
19942 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19944 * driver.cs (GetSystemDir): Compute correctly the location of our
19945 system assemblies. I was using the compiler directory instead of
19946 the library directory.
19948 2002-02-13 Ravi Pratap <ravi@ximian.com>
19950 * expression.cs (BetterFunction): Put back in what Miguel commented out
19951 since it is the correct fix. The problem is elsewhere ;-)
19953 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19954 parameters of the parms method are themselves compatible or not !
19956 (StandardConversionExists): Fix very dangerous bug where we were forgetting
19957 to check that a class implements an interface before saying that an implicit
19958 conversion was allowed. Use ImplementsInterface to do the checking.
19960 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19962 * class.cs (Method.Define): Track whether we are an explicit
19963 implementation or not. And only call DefineMethodOverride if we
19964 are an explicit implementation.
19966 (Property.DefineMethod): Ditto.
19968 2002-02-11 Ravi Pratap <ravi@ximian.com>
19970 * expression.cs (BetterFunction): Catch hideous bug which was
19971 preventing us from detecting ambiguous calls due to implicit casts i.e
19974 2002-01-29 Miguel de Icaza <miguel@ximian.com>
19976 * support.cs (Pair): Remove un-needed method. I figured why I was
19977 getting the error in cs-parser.jay, the variable in a foreach loop
19978 is readonly, and the compiler does not really treat this as a variable.
19980 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
19981 instead of EQUALS in grammar.
19983 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19985 * expression.cs (Unary.DoResolve): Check whether the argument is
19988 2002-01-28 Miguel de Icaza <miguel@ximian.com>
19990 * support.cs: Api for Pair to set a value. Despite the fact that
19991 the variables are public the MS C# compiler refuses to compile
19992 code that accesses the field if the variable is part of a foreach
19995 * statement.cs (Fixed): Begin implementation of the fixed
19998 (Block.AddVariable): Return the VariableInfo on success and null
19999 on failure instead of true/false.
20001 * cs-parser.jay (foreach): Catch errors on variables already
20002 defined (we were ignoring this value before) and properly unwind
20003 the block hierarchy
20005 (fixed_statement): grammar for the fixed statement.
20007 2002-01-25 Miguel de Icaza <miguel@ximian.com>
20009 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20010 pointer types to be incretemented.
20012 (SizeOf): Implement.
20014 * cs-parser.jay (pointer_member_access): Implement
20015 expr->IDENTIFIER production.
20017 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20018 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20021 (Unary): Implement indirection.
20023 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20024 use in non-unsafe context).
20026 (SimpleName.DoResolve): Check for pointers in field access on safe
20029 (Expression.LoadFromPtr): Factor the load-indirect code in this
20030 function. This was duplicated in UnboxCast and ParameterReference
20032 2002-01-24 Miguel de Icaza <miguel@ximian.com>
20034 * expression.cs (ComposedCast): report an error if a pointer cast
20035 is used in a safe region.
20037 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20038 pointer type casts in unsafe context.
20040 * codegen.cs (EmitContext): Set up IsUnsafe.
20042 * cs-parser.jay (non_expression_type): Add productions for pointer
20045 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20046 code. We should not use force into static mode if the method is
20047 not virtual. Fixes bug in MIS
20049 * statement.cs (Do.Emit, While.Emit, For.Emit,
20050 Statement.EmitBoolExpression): Add support to Do and While to
20051 propagate infinite loop as `I do return' semantics.
20053 Improve the For case to also test for boolean constants.
20055 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20056 to the list of attributes we can add.
20058 Remove `EmitContext' argument.
20060 * class.cs (Method.Define): Apply parameter attributes.
20061 (Constructor.Define): Apply parameter attributes.
20062 (MethodCore.LabelParameters): Move here the core of labeling
20065 * support.cs (ReflectionParameters.ParameterModifier,
20066 InternalParameters.ParameterModifier): Use IsByRef on the type and
20067 only return the OUT bit for these parameters instead of in/out/ref
20070 This is because I miss-understood things. The ParameterInfo.IsIn
20071 and IsOut represent whether the parameter has the [In] and [Out]
20074 2002-01-22 Miguel de Icaza <miguel@ximian.com>
20076 * ecore.cs (FieldExpr.Emit): Release temporaries.
20078 * assign.cs (LocalTemporary.Release): new function.
20080 * codegen.cs (EmitContext.GetTemporaryStorage,
20081 EmitContext.FreeTemporaryStorage): Rework the way we deal with
20082 temporary storage. Now we can "put back" localbuilders when we
20085 2002-01-21 Miguel de Icaza <miguel@ximian.com>
20087 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20088 need to make a copy of the variable to generate verifiable code.
20090 2002-01-19 Miguel de Icaza <miguel@ximian.com>
20092 * driver.cs: Compute dynamically the system directory.
20094 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20095 Slower, but more generally useful. Used by the abstract
20096 registering implementation.
20098 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20099 the rules for the special rule on Type/instances. First check if
20100 we have the same name, and if so, try that special static path
20101 rather than the instance path.
20103 2002-01-18 Miguel de Icaza <miguel@ximian.com>
20105 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20108 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20109 Enum, ValueType, Delegate or Array for non-corlib compiles.
20111 * cs-tokenizer.cs: Catch long identifiers (645)
20113 * typemanager.cs (IndexerPropetyName): Ravi never tested this
20116 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20117 fix, we were returning too early, so we were not registering
20118 pending methods from abstract classes.
20120 Do not register pending methods if the class is abstract.
20122 * expression.cs (Conditional.DoResolve): Report circular implicit
20123 conversions when we neecd to compute it for conditional
20126 (Is.DoResolve): If the expression is always of the provided type,
20127 flag warning 183. If the expression can not ever be of the
20128 provided type flag warning 184.
20130 * class.cs: Catch 169 as well.
20132 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20135 2002-01-18 Nick Drochak <ndrochak@gol.com>
20137 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
20139 2002-01-17 Miguel de Icaza <miguel@ximian.com>
20141 * interface.cs: (PopulateMethod): Check for pointers being defined
20142 only if the unsafe context is active.
20143 (PopulateProperty): ditto.
20144 (PopulateIndexer): ditto.
20146 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20147 specified. If pointers are present, make sure that they are
20148 present in an unsafe context.
20149 (Constructor, Constructor.Define): ditto.
20150 (Field, Field.Define): ditto.
20151 (Property, Property.Define): ditto.
20152 (Event, Event.Define): ditto.
20154 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20155 hashtable if there are classes or structs defined.
20157 * expression.cs (LocalVariableReference.DoResolve): Simplify this
20158 code, as the constant resolution moved.
20160 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20161 the metadata, so we can flag error 133.
20163 * decl.cs (MemberCore.UnsafeOK): New function to test that a
20164 pointer is being declared in an unsafe context.
20166 2002-01-16 Miguel de Icaza <miguel@ximian.com>
20168 * modifiers.cs (Modifiers.Check): Require a Location argument.
20169 Report error 227 for Unsafe use.
20171 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20173 * statement.cs (For.Emit): If the test is null, then report that
20174 we do `return', as we wont reach anything afterwards.
20176 (Switch.SwitchGoverningType): Track the expression that matched
20179 * driver.cs: Allow negative numbers as an error code to flag.
20181 * cs-parser.jay: Handle 1551.
20183 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20185 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20187 * cs-parser.jay: Report 1518 (type declaration can only contain
20188 class, struct, interface, enum or delegate)
20190 (switch_label): Report 1523 (keywords `case' or `default' must
20193 (opt_switch_sections): Report 1522 (empty switch)
20195 * driver.cs: Report 1515 (response file specified multiple times)
20196 Report 1516 (Source file specified multiple times).
20198 * expression.cs (Argument.Resolve): Signal 1510
20200 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20201 access not allowed in static code)
20203 2002-01-11 Ravi Pratap <ravi@ximian.com>
20205 * typemanager.cs (IsPointerType): Utility method which we are going
20208 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20209 the object type, so we take care of that.
20211 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20213 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20214 added to non-params parameters :-)
20216 * typemanager.cs (CSharpName): Include 'void' type too.
20218 (void_ptr_type): Include in the set of core types.
20220 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
20223 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
20226 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
20227 completely forgotten about it.
20229 2002-01-10 Ravi Pratap <ravi@ximian.com>
20231 * cs-parser.jay (pointer_type): Add. This begins our implementation
20232 of parsing rules for unsafe code.
20234 (unsafe_statement): Implement.
20236 (embedded_statement): Modify to include the above.
20238 * statement.cs (Unsafe): Implement new class for unsafe blocks.
20240 * codegen.cs (EmitContext.InUnsafe): Add. This determines
20241 if the current context is an unsafe one.
20243 * cs-parser.jay (local_variable_pointer_type): Since local variable types
20244 are handled differently, we need separate rules for them.
20246 (local_variable_declaration): Update to use local_variable_pointer_type
20247 to allow variable declarations of unmanaged pointer types.
20249 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20250 in unsafe contexts.
20252 * ../errors/cs0214.cs : Add.
20254 2002-01-16 Nick Drochak <ndrochak@gol.com>
20256 * makefile: remove 'response' file when cleaning.
20258 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20260 * cs-parser.jay: Report 1524.
20262 2002-01-14 Miguel de Icaza <miguel@ximian.com>
20264 * typemanager.cs (RegisterMethod): drop checking if we have
20265 registered this from here
20267 2002-01-12 Miguel de Icaza <miguel@ximian.com>
20269 * class.cs (Method.EmitDestructor): Implement calling our base
20272 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20273 value of InFinally.
20275 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20276 this routine and will wrap the call in a try/catch block. Deal
20279 2002-01-11 Miguel de Icaza <miguel@ximian.com>
20281 * ecore.cs (Expression.MemberLookup): instead of taking a
20282 parameter `same_type' that was used to tell whether we could
20283 access private members we compute our containing type from the
20286 (FieldExpr): Added partial support for volatile fields. This does
20287 not work for volatile fields exposed from assemblies, as I can not
20288 figure out how to extract the modreq from it.
20290 Updated all the source files to use this.
20292 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20293 because it is referenced by MemberLookup very often.
20295 2002-01-09 Ravi Pratap <ravi@ximian.com>
20297 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20298 TypeBuilder.GetCustomAttributes to retrieve what we need.
20300 Get rid of redundant default_member_attr_type as this is the same as
20301 default_member_type which already exists.
20303 * interface.cs, attribute.cs : Update accordingly.
20305 2002-01-08 Miguel de Icaza <miguel@ximian.com>
20307 * typemanager.cs: Enable IndexerPropertyName again. It does not
20308 work for TYpeBuilders though. Ravi, can you please fix this?
20310 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20312 * expression.cs (Argument.Emit): Handle the case of ref objects
20313 being passed to ref functions;
20315 (ParameterReference.EmitLoad): Loads the content of the pointer
20316 without dereferencing.
20318 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20320 * cs-tokenizer.cs: Implemented the pre-processing expressions.
20322 2002-01-08 Ravi Pratap <ravi@ximian.com>
20324 * class.cs (Indexer.DefineMethod): Incorporate the interface
20325 type in the name of the method if we are doing explicit interface
20328 * expression.cs (ConversionExists): Remove as it is completely obsolete.
20330 (BetterConversion): Fix extremely trivial bug where we were referring to
20331 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20334 * ../errors/bug16.cs : Add although we have fixed it.
20336 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20338 * expression.cs (BaseIndexer): Begin implementation.
20340 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20342 * cs-parser.jay (indexer_declarator): Use qualified_identifier
20343 production directly to remove a shift/reduce, and implement
20344 explicit interface implementation.
20346 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20347 after a floating point suffix.
20349 * expression.cs (DoNumericPromotions): Improved the conversion for
20350 uint/uint. If we have a constant, we avoid doing a typecast to a
20353 * class.cs (Indexer): Implement explicit interface implementation
20356 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20358 * class.cs: make the default instance constructor public and hidebysig.
20360 2001-01-03 Ravi Pratap <ravi@ximian.com>
20362 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20363 so we can call it from elsewhere.
20365 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20366 we emit it internally if the class has a defined indexer; otherwise the user
20367 emits it by decorating the class definition with the DefaultMemberAttribute.
20369 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20370 attribute is not used on a type which defines an indexer.
20372 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20373 character when we skip whitespace.
20375 * ../errors/cs0646.cs : Add.
20377 2002-01-03 Miguel de Icaza <miguel@ximian.com>
20379 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20382 * makefile: Add practical target `mcs3.exe' which builds the third
20383 generation compiler.
20385 * expression.cs (New): Fix structures constructor calling.
20387 * class.cs (Property, Method, Indexer): Emit Final flag on the
20388 method if we are an interface implementation and we are not
20391 * ecore.cs (PropertyExpr): New public field `IsBase', tells
20392 whether this property is referencing a `base' method.
20394 * expression.cs (Invocation.EmitCall): take an extra argument:
20395 is_base, this is used to determine whether the `call' or
20396 `callvirt' opcode should be used.
20399 * delegate.cs: update EmitCall.
20401 * class.cs (Method.Define): Set NewSlot for the cases where we are
20402 not implementing an interface method.
20404 (Property.Define): ditto.
20406 2002-01-02 Miguel de Icaza <miguel@ximian.com>
20408 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20409 'r'. Allows mcs to parse itself fully.
20411 2002-01-02 Ravi Pratap <ravi@ximian.com>
20413 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20414 of the number of initializers that require the InitializeArray method.
20416 (CheckIndices): Store the Expression in all cases - not the plain value. Also
20417 update the above field where necessary.
20419 (MakeByteBlob): Update accordingly.
20421 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
20424 (EmitDynamicInitializers): Update in accordance with the new optimization.
20426 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20427 same OpCode applies.
20429 * cs-parser.jay : Fix some glaring errors I introduced.
20431 2002-01-01 Ravi Pratap <ravi@ximian.com>
20433 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20434 so that we can check for name clashes there too.
20436 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20437 for interface indexers.
20439 * interfaces.cs (Define): Emit the default member attribute.
20441 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20442 variable was being referred to while setting the value ;-)
20444 2002-01-01 Miguel de Icaza <miguel@ximian.com>
20446 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20447 byte-by-byte information when we know the data is zero.
20449 Make the block always a multiple of 4, because
20450 DefineInitializedData has a bug.
20452 * assign.cs: Fix, we should assign from the temporary, not from
20455 * expression.cs (MakeByteBlob): Fix my incorrect code.
20457 2001-12-31 Miguel de Icaza <miguel@ximian.com>
20459 * typemanager.cs (EnumToUnderlying): This function is used to get
20460 the underlying type from an enumeration, because it does not
20463 * constant.cs: Use the I4_S form for values between -128 and 127.
20465 * statement.cs (Block.LookupLabel): Looks up a label.
20466 (Block): Drop support for labeled blocks.
20468 (LabeledStatement): New kind of statement that represents a label
20471 (Goto): Finally implement this bad boy.
20473 * cs-parser.jay: Update to reflect new mechanism to implement
20476 2001-12-30 Miguel de Icaza <miguel@ximian.com>
20478 * codegen.cs (EmitContext.This): a codegen property that keeps the
20479 a single instance of this instead of creating many different this
20482 * delegate.cs (Delegate.DoResolve): Update to use the property;
20484 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20486 * expression.cs (BaseAccess.DoResolve): Ditto.
20488 2001-12-29 Ravi Pratap <ravi@ximian.com>
20490 * typemanager.cs (methodimpl_attr_type): Add to hold the type
20491 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20493 (InitCoreTypes): Update accordingly.
20495 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20496 so we can quickly store the state.
20498 (ApplyAttributes): Set the correct implementation flags
20499 for InternalCall methods.
20501 2001-12-29 Miguel de Icaza <miguel@ximian.com>
20503 * expression.cs (EmitCall): if a method is not virtual, then do
20504 not use callvirt on it.
20506 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20507 user defined stuff) requires the use of stobj, which takes an
20508 address on the stack instead of an array and an index. So emit
20509 the Ldelema operation for it.
20511 (EmitStoreOpcode): Use stobj for valuetypes.
20513 (UnaryMutator.EmitCode): Use the right 1 value depending on
20514 whether we are dealing with int64/uint64, float or doubles.
20516 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20517 constructors that I implemented last night.
20519 (Constructor.IsDefault): Fix to work properly for static
20522 * cs-parser.jay (CheckDef): report method signature errors.
20523 Update error number 103 to be 132.
20525 * decl.cs: New AdditionResult enumeration value: MethodExists.
20526 Although we do this check for methods later on in the semantic
20527 analysis, catching repeated default constructors is so easy that
20528 we catch these here.
20530 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20533 (ParameterReference.EmitAssign, Emit): handle
20536 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20537 (ArrayAccess.EmitStoreOpcode): ditto.
20539 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20541 * expression.cs (MakeByteBlob): Complete all the missing types
20542 (uint, short, ushort, byte, sbyte)
20544 * class.cs: Only init instance field initializers on instance
20547 Rename `constructors' to instance_constructors.
20549 (TypeContainer.AddConstructor): Only add constructors to the list
20550 if it is not static.
20552 Make sure that we handle default_static_constructor independently
20553 everywhere where we handle instance_constructors
20555 2001-12-28 Miguel de Icaza <miguel@ximian.com>
20557 * class.cs: Do not lookup or create a base initializer for a
20558 static constructor.
20560 (ConstructorInitializer.Resolve): use the proper type to lookup
20563 * cs-parser.jay: Report error 1585 (modifiers between type and name).
20565 * enum.cs, interface.cs: Remove CloseType, this is taken care by
20568 * decl.cs: CloseType is now an virtual method, the default
20569 implementation just closes this type.
20571 2001-12-28 Ravi Pratap <ravi@ximian.com>
20573 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20574 to PreserveSig by default. Also emit HideBySig on such methods.
20576 Basically, set the defaults to standard values.
20578 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20579 argument, if candidate is better, it can't be worse than the best !
20581 (Invocation): Re-write bits to differentiate between methods being
20582 applicable in their expanded form and their normal form - for params
20585 Get rid of use_standard everywhere as only standard conversions are allowed
20586 in overload resolution.
20588 More spec conformance.
20590 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20592 * driver.cs: Add --timestamp, to see where the compiler spends
20595 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20596 `this' in static code.
20598 (SimpleName.DoResolve): Implement in terms of a helper function
20599 that allows static-references to be passed upstream to
20602 (Expression.ResolveWithSimpleName): Resolve specially simple
20603 names when called by MemberAccess to implement the special
20606 (Expression.ImplicitReferenceConversion): Handle conversions from
20607 Null to reference types before others, as Null's type is
20610 * expression.cs (Invocation.EmitCall): Handle the special case of
20611 calling methods declared on a reference type from a ValueType
20612 (Base classes System.Object and System.Enum)
20614 (MemberAccess.Resolve): Only perform lookups on Enumerations if
20615 the left hand side is a TypeExpr, not on every enumeration.
20617 (Binary.Resolve): If types are reference types, then do a cast to
20618 object on operators != and == of both arguments.
20620 * typemanager.cs (FindMembers): Extract instance and static
20621 members if requested.
20623 * interface.cs (PopulateProperty): Use void_type instead of null
20624 as the return type for the setter method.
20626 (PopulateIndexer): ditto.
20628 2001-12-27 Ravi Pratap <ravi@ximian.com>
20630 * support.cs (ReflectionParameters): Fix minor bug where we
20631 were examining the wrong parameter for the ParamArray attribute.
20633 Cope with requests for the type of the parameter at position
20634 greater than the params parameter's. We now return the element
20635 type of the params array as that makes more sense.
20637 * expression.cs (Invocation.IsParamsMethodApplicable): Update
20638 accordingly as we no longer have to extract the element type
20641 (Invocation.OverloadResolve): Update.
20643 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20645 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20646 against IEnumerator, test whether the return value is a descendant
20647 of the IEnumerator interface.
20649 * class.cs (Indexer.Define): Use an auxiliary method to implement
20650 the other bits of the method definition. Begin support for
20651 explicit interface implementation.
20653 (Property.DefineMethod): Use TypeManager.void_type instead of null
20654 for an empty return value.
20656 2001-12-26 Miguel de Icaza <miguel@ximian.com>
20658 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20659 dealing with a FieldExpr which is composed of a FieldBuilder, in
20660 the code path we did extract the constant, but we should have
20661 obtained the underlying value to be able to cast it (otherwise we
20662 end up in an infinite loop, this is what Ravi was running into).
20664 (ArrayCreation.UpdateIndices): Arrays might be empty.
20666 (MemberAccess.ResolveMemberAccess): Add support for section
20667 14.5.4.1 that deals with the special case of E.I when E is a type
20668 and something else, that I can be a reference to a static member.
20670 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20671 handle a particular array type to create byte blobs, it is just
20672 something we dont generate byteblobs for.
20674 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20677 * location.cs (Push): remove the key from the hashtable that we
20678 are about to add. This happens for empty files.
20680 * driver.cs: Dispose files after we have parsed them.
20682 (tokenize): new function that only runs the tokenizer on its
20683 input, for speed testing.
20685 2001-12-26 Ravi Pratap <ravi@ximian.com>
20687 * class.cs (Event.Define): Define the private field only if there
20688 are no accessors defined.
20690 * expression.cs (ResolveMemberAccess): If there is no associated
20691 field with the event, that means we have an event defined with its
20692 own accessors and we should flag error cs0070 since transforming
20693 ourselves into a field is not valid in that case.
20695 * ecore.cs (SimpleName.DoResolve): Same as above.
20697 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20698 and charset to sane values.
20700 2001-12-25 Ravi Pratap <ravi@ximian.com>
20702 * assign.cs (DoResolve): Perform check on events only if they
20703 are being accessed outside the declaring type.
20705 * cs-parser.jay (event_declarations): Update rules to correctly
20706 set the type of the implicit parameter etc.
20708 (add_accessor, remove_accessor): Set current local parameters.
20710 * expression.cs (Binary): For delegate addition and subtraction,
20711 cast the return value from the method into the appropriate delegate
20714 2001-12-24 Ravi Pratap <ravi@ximian.com>
20716 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20717 of these as the workaround is unnecessary.
20719 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20720 delegate data - none of that is needed at all.
20722 Re-write bits to extract the instance expression and the delegate method
20725 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
20728 * attribute.cs (ApplyAttributes): New method to take care of common tasks
20729 of attaching attributes instead of duplicating code everywhere.
20731 * everywhere : Update code to do attribute emission using the above method.
20733 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20735 * expression.cs (IsParamsMethodApplicable): if there are not
20736 parameters, return immediately.
20738 * ecore.cs: The 0 literal can be implicity converted to an enum
20741 (SimpleName.DoResolve): First lookup the type, then lookup the
20744 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20745 want to get its address. If the InstanceExpression is not
20746 addressable, store the result in a temporary variable, then get
20749 * codegen.cs: Only display 219 errors on warning level or above.
20751 * expression.cs (ArrayAccess): Make it implement the
20752 IMemoryLocation interface.
20754 (Binary.DoResolve): handle the operator == (object a, object b)
20755 and operator != (object a, object b) without incurring into a
20756 BoxedCast (because 5 != o should never be performed).
20758 Handle binary enumerator operators.
20760 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20761 value type, otherwise use Ldelem_ref.
20763 Use precomputed names;
20765 (AddressOf): Implement address of
20767 * cs-parser.jay (labeled_statement): Fix recursive block
20768 addition by reworking the production.
20770 * expression.cs (New.DoEmit): New has a special case:
20772 If we are dealing with a ValueType, we have a few
20773 situations to deal with:
20775 * The target of New is a ValueType variable, that is
20776 easy, we just pass this as the variable reference
20778 * The target of New is being passed as an argument,
20779 to a boxing operation or a function that takes a
20782 In this case, we need to create a temporary variable
20783 that is the argument of New.
20786 2001-12-23 Ravi Pratap <ravi@ximian.com>
20788 * rootcontext.cs (LookupType): Check that current_type is not null before
20789 going about looking at nested types.
20791 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20792 not implement the IAssignMethod interface any more.
20794 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20795 where we tranform them into FieldExprs if they are being resolved from within
20796 the declaring type.
20798 * ecore.cs (SimpleName.DoResolve): Do the same here.
20800 * assign.cs (DoResolve, Emit): Clean up code considerably.
20802 * ../errors/bug10.cs : Add.
20804 * ../errors/cs0070.cs : Add.
20806 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20808 * assign.cs : Get rid of EventIsLocal everywhere.
20810 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20812 * ecore.cs (ConvertIntLiteral): finished the implementation.
20814 * statement.cs (SwitchLabel): Convert the value we are using as a
20815 key before looking up the table.
20817 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20819 * codegen.cs (EmitTopBlock): Require a Location argument now.
20821 * cs-parser.jay (constructor_declarator): We need to setup
20822 current_local_parameters before we parse the
20823 opt_constructor_initializer, to allow the variables to be bound
20824 to the constructor arguments.
20826 * rootcontext.cs (LookupType): First lookup nested classes in our
20827 class and our parents before we go looking outside our class.
20829 * expression.cs (ConstantFold): Extract/debox the values at the
20832 * rootcontext.cs (EmitCode): Resolve the constants first before we
20833 resolve the types. This is not really needed, but it helps debugging.
20835 * statement.cs: report location.
20837 * cs-parser.jay: pass location to throw statement.
20839 * driver.cs: Small bug fix.
20841 * report.cs: Updated format to be 4-zero filled digits.
20843 2001-12-22 Ravi Pratap <ravi@ximian.com>
20845 * expression.cs (CheckIndices): Fix minor bug where the wrong
20846 variable was being referred to ;-)
20848 (DoEmit): Do not call EmitStaticInitializers when the
20849 underlying type is System.Object.
20851 2001-12-21 Ravi Pratap <ravi@ximian.com>
20853 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20854 and do the usual workaround for SRE.
20856 * class.cs (MyEventBuilder.EventType): New member to get at the type
20857 of the event, quickly.
20859 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20861 * assign.cs (Assign.DoResolve): Handle the case when the target
20862 is an EventExpr and perform the necessary checks.
20864 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20867 (SimpleName.MemberStaticCheck): Include check for EventExpr.
20869 (EventExpr): Set the type in the constructor itself since we
20870 are meant to be born fully resolved.
20872 (EventExpr.Define): Revert code I wrote earlier.
20874 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20875 instance expression is null. The instance expression is a This in that case
20876 or a null, depending on whether it is a static method or not.
20878 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20879 refers to more than one method.
20881 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20882 and accordingly flag errors.
20884 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20886 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20888 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20890 * location.cs (ToString): Provide useful rutine.
20892 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20894 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20895 objects, return the actual integral boxed.
20897 * statement.cs (SwitchLabel): define an ILLabel for each
20900 (Switch.CheckSwitch): If the value is a Literal, extract
20901 the underlying literal.
20903 Also in the unused hashtable we had, add the SwitchLabel so we can
20904 quickly look this value up.
20906 * constant.cs: Implement a bunch of new constants. Rewrite
20907 Literal based on this. Made changes everywhere to adapt to this.
20909 * expression.cs (Expression.MakeByteBlob): Optimize routine by
20910 dereferencing array only once, and also copes with enumrations.
20912 bytes are two bytes wide, not one.
20914 (Cast): Perform constant conversions.
20916 * ecore.cs (TryImplicitIntConversion): Return literals instead of
20917 wrappers to the literals here.
20919 * expression.cs (DoNumericPromotions): long literals can converted
20920 to ulong implicity (this is taken care of elsewhere, but I was
20921 missing this spot).
20923 * ecore.cs (Expression.Literalize): Make the return type Literal,
20924 to improve type checking.
20926 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20928 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20930 * literal.cs: Revert code from ravi that checked the bounds. The
20931 bounds are sane by the definition of the type itself.
20933 * typemanager.cs: Fix implementation of ImplementsInterface. We
20934 need to actually look up in our parent hierarchy for interfaces
20937 * const.cs: Use the underlying type for enumerations
20939 * delegate.cs: Compute the basename for the delegate creation,
20940 that should fix the delegate test case, and restore the correct
20941 Type Lookup semantics in rootcontext
20943 * rootcontext.cs: Revert Ravi's last patch. The correct way of
20944 referencing a nested type with the Reflection API is using the "+"
20947 * cs-parser.jay: Do not require EOF token at the end.
20949 2001-12-20 Ravi Pratap <ravi@ximian.com>
20951 * rootcontext.cs (LookupType): Concatenate type names with
20952 a '.' instead of a '+' The test suite passes again.
20954 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20955 field of the enumeration.
20957 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20958 the case when the member is an EventExpr.
20960 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20961 static has an associated instance expression.
20963 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20965 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20967 * class.cs (Event.Define): Register event and perform appropriate checks
20970 We define the Add and Remove methods even if the use provides none because
20971 in that case, we provide default implementations ourselves.
20973 Define a private field of the type of the event. This is done by the CSC compiler
20974 and we should be doing it too ;-)
20976 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20977 More methods we use in code we generate.
20979 (multicast_delegate_type, delegate_type): Two separate types since the distinction
20982 (InitCoreTypes): Update accordingly for the above.
20984 * class.cs (Event.Emit): Generate code for default accessors that we provide
20986 (EmitDefaultMethod): Do the job in the above.
20988 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
20991 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20993 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20994 builders even if we were missing one.
20996 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20997 pass the Basename as our class name instead of the Name. The
20998 basename will be correctly composed for us.
21000 * parameter.cs (Paramters): Now takes a Location argument.
21002 * decl.cs (DeclSpace.LookupType): Removed convenience function and
21003 make all the code call directly LookupType in RootContext and take
21004 this chance to pass the Location information everywhere.
21006 * Everywhere: pass Location information.
21008 2001-12-19 Miguel de Icaza <miguel@ximian.com>
21010 * class.cs (Constructor.Define): Updated way of detecting the
21011 length of the parameters.
21013 (TypeContainer.DefineType): Use basename as the type name for
21016 (TypeContainer.Define): Do not recursively define types here, as
21017 definition is taken care in order by the RootContext.
21019 * tree.cs: Keep track of namespaces in a per-file basis.
21021 * parameter.cs (Parameter.ComputeSignature): Update to use
21024 (Parameters.GetSignature): ditto.
21026 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21027 instead of a TypeContainer.
21029 (Interface.SemanticAnalysis): Use `this' instead of our parent to
21030 resolve names. Because we need to be resolve in our context, not
21033 * driver.cs: Implement response files.
21035 * class.cs (TypeContainer.DefineType): If we are defined, do not
21036 redefine ourselves.
21038 (Event.Emit): Emit the code for add/remove handlers.
21039 (Event.Define): Save the MethodBuilders for add/remove.
21041 * typemanager.cs: Use pair here too.
21043 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21044 DictionaryEntry requires the first argument to be non-null.
21046 (enum_declaration): Compute full name for registering the
21049 (delegate_declaration): Instead of using
21050 formal_parameter_list, use opt_formal_parameter_list as the list
21053 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21054 (EventParsing): New property that controls whether `add' and
21055 `remove' are returned as tokens or identifiers (for events);
21057 2001-12-19 Ravi Pratap <ravi@ximian.com>
21059 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21060 use MyEventBuilder only and let it wrap the real builder for us.
21062 (MyEventBuilder): Revamp constructor etc.
21064 Implement all operations that we perform on EventBuilder in precisely the same
21067 (FindMembers): Update to use the EventBuilder member.
21069 (Event.Emit): Update accordingly.
21071 2001-12-18 Ravi Pratap <ravi@ximian.com>
21073 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21074 by calling the appropriate methods.
21076 (GetCustomAttributes): Make stubs as they cannot possibly do anything
21079 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21081 2001-12-17 Ravi Pratap <ravi@ximian.com>
21083 * delegate.cs (Delegate.Populate): Check that the return type
21084 and various parameters types are indeed accessible.
21086 * class.cs (Constructor.Define): Same here.
21088 (Field.Define): Ditto.
21090 (Event.Define): Ditto.
21092 (Operator.Define): Check that the underlying Method defined itself
21093 correctly - so it's MethodBuilder should not be null.
21095 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21096 expression happens to be null.
21098 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21099 members but as of now we don't seem to be able to do anything really useful with it.
21101 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21102 not the EventBuilder.
21104 2001-12-18 Miguel de Icaza <miguel@ximian.com>
21106 * cs-tokenizer.cs: Add support for defines.
21107 Add support for #if, #elif, #else, #endif
21109 (eval_var): evaluates a variable.
21110 (eval): stubbed for evaluating functions.
21112 * cs-parser.jay: Pass the defines information
21114 * driver.cs: Add --define command line option.
21116 * decl.cs: Move MemberCore here.
21118 Make it the base class for DeclSpace. This allows us to catch and
21119 report 108 and 109 for everything now.
21121 * class.cs (TypeContainer.Define): Extract all the members
21122 before populating and emit the warning 108 (new keyword required
21123 to override) instead of having each member implement this.
21125 (MemberCore.Define): New abstract method, we will be using this in
21126 the warning reporting engine in Populate.
21128 (Operator.Define): Adjust to new MemberCore protocol.
21130 * const.cs (Const): This does not derive from Expression, it is a
21131 temporary object we use to create fields, it is a MemberCore.
21133 * class.cs (Method.Define): Allow the entry point to be in a
21136 * driver.cs: Rewrite the argument handler to clean it up a bit.
21138 * rootcontext.cs: Made it just an auxiliary namespace feature by
21139 making everything static.
21141 * driver.cs: Adapt code to use RootContext type name instead of
21144 * delegate.cs: Remove RootContext argument.
21146 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21149 * class.cs (Event.Define): The lookup can fail.
21151 * cs-tokenizer.cs: Begin implementation of pre-procesor.
21153 * expression.cs: Resolve the this instance before invoking the code.
21155 2001-12-17 Miguel de Icaza <miguel@ximian.com>
21157 * cs-parser.jay: Add a production in element_access that allows
21158 the thing to become a "type" reference. This way we can parse
21159 things like "(string [])" as a type.
21161 Note that this still does not handle the more complex rules of
21165 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
21167 * ecore.cs: (CopyNewMethods): new utility function used to
21168 assemble the list of methods from running FindMembers.
21170 (MemberLookup): Rework FindMembers so that
21172 2001-12-16 Miguel de Icaza <miguel@ximian.com>
21174 * class.cs (TypeContainer): Remove Delegates who fail to be
21177 * delegate.cs (Populate): Verify that we dont get null return
21178 values. TODO: Check for AsAccessible.
21180 * cs-parser.jay: Use basename to emit error 574 (destructor should
21181 have the same name as container class), not the full name.
21183 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21184 possible representation.
21186 Also implements integer type suffixes U and L.
21188 2001-12-15 Miguel de Icaza <miguel@ximian.com>
21190 * expression.cs (ArrayCreation.DoResolve): We need to do the
21191 argument resolution *always*.
21193 * decl.cs: Make this hold the namespace. Hold the root context as
21195 (LookupType): Move here.
21197 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21199 * location.cs (Row, Name): Fixed the code, it was always returning
21200 references to the first file.
21202 * interface.cs: Register properties defined through interfaces.
21204 * driver.cs: Add support for globbing on the command line
21206 * class.cs (Field): Make it derive from MemberCore as well.
21209 2001-12-15 Ravi Pratap <ravi@ximian.com>
21211 * class.cs (Event::Define): Check that the type of the event is a delegate
21212 type else flag error #66.
21214 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21217 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21218 values of EntryPoint, CharSet etc etc.
21220 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21222 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21223 be null and we should ignore this. I am not sure if this is really clean. Apparently,
21224 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21225 which needs this to do its work.
21227 * ../errors/cs0066.cs : Add.
21229 2001-12-14 Miguel de Icaza <miguel@ximian.com>
21231 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21234 * class.cs: (MethodSignature.MethodSignature): Removed hack that
21235 clears out the parameters field.
21236 (MemberSignatureCompare): Cleanup
21238 (MemberCore): New base class used to share code between MethodCore
21241 (RegisterRequiredImplementations) BindingFlags.Public requires
21242 either BindingFlags.Instace or Static. Use instance here.
21244 (Property): Refactored code to cope better with the full spec.
21246 * parameter.cs (GetParameterInfo): Return an empty array instead
21249 * class.cs (Property): Abstract or extern properties have no bodies.
21251 * parameter.cs (GetParameterInfo): return a zero-sized array.
21253 * class.cs (TypeContainer.MethodModifiersValid): Move all the
21254 method modifier validation to the typecontainer so we can reuse
21255 this on properties.
21257 (MethodCore.ParameterTypes): return an empty sized array of types.
21259 (Property.Define): Test property modifier validity.
21261 Add tests for sealed/override too.
21263 (Method.Emit): abstract or extern methods have no bodies.
21265 2001-12-14 Ravi Pratap <ravi@ximian.com>
21267 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21270 (Method::Define, ::Emit): Modify accordingly.
21272 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21274 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21276 * makefile: Pass in /unsafe.
21278 2001-12-13 Miguel de Icaza <miguel@ximian.com>
21280 * class.cs (MakeKey): Kill routine.
21282 * class.cs (TypeContainer.Define): Correctly define explicit
21283 method implementations (they require the full interface name plus
21286 * typemanager.cs: Deply the PtrHashtable here and stop using the
21287 lame keys. Things work so much better.
21289 This of course broke everyone who depended on `RegisterMethod' to
21290 do the `test for existance' test. This has to be done elsewhere.
21292 * support.cs (PtrHashtable): A hashtable that avoid comparing with
21293 the object stupid Equals method (because, that like fails all over
21294 the place). We still do not use it.
21296 * class.cs (TypeContainer.SetRequiredInterface,
21297 TypeContainer.RequireMethods): Killed these two routines and moved
21298 all the functionality to RegisterRequiredImplementations.
21300 (TypeContainer.RegisterRequiredImplementations): This routine now
21301 registers all the implementations required in an array for the
21302 interfaces and abstract methods. We use an array of structures
21303 which can be computed ahead of time to reduce memory usage and we
21304 also assume that lookups are cheap as most classes will not
21305 implement too many interfaces.
21307 We also avoid creating too many MethodSignatures.
21309 (TypeContainer.IsInterfaceMethod): Update and optionally does not
21310 clear the "pending" bit if we find that there are problems with
21313 (TypeContainer.VerifyPendingMethods): Update to report errors of
21314 methods that look like implementations but are not.
21316 (TypeContainer.Define): Add support for explicit interface method
21319 2001-12-12 Miguel de Icaza <miguel@ximian.com>
21321 * typemanager.cs: Keep track of the parameters here instead of
21322 being a feature of the TypeContainer.
21324 * class.cs: Drop the registration of parameters here, as
21325 InterfaceMethods are also interface declarations.
21327 * delegate.cs: Register methods with the TypeManager not only with
21328 the TypeContainer. This code was buggy.
21330 * interface.cs: Full registation here.
21332 2001-12-11 Miguel de Icaza <miguel@ximian.com>
21334 * expression.cs: Remove reducer for binary expressions, it can not
21337 * const.cs: Put here the code that used to go into constant.cs
21339 * constant.cs: Put here the code for constants, this is a new base
21340 class for Literals.
21342 * literal.cs: Make Literal derive from Constant.
21344 2001-12-09 Miguel de Icaza <miguel@ximian.com>
21346 * statement.cs (Return.Emit): Report error 157 if the user
21347 attempts to return from a finally block.
21349 (Return.Emit): Instead of emitting a return, jump to the end of
21352 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21353 LocalBuilder to store the result of the function. ReturnLabel is
21354 the target where we jump.
21357 2001-12-09 Radek Doulik <rodo@ximian.com>
21359 * cs-parser.jay: remember alias in current namespace
21361 * ecore.cs (SimpleName::DoResolve): use aliases for types or
21364 * class.cs (LookupAlias): lookup alias in my_namespace
21366 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21368 (LookupAlias): lookup alias in this and if needed in parent
21371 2001-12-08 Miguel de Icaza <miguel@ximian.com>
21375 * rootcontext.cs: (ModuleBuilder) Made static, first step into
21376 making things static. I need this to avoid passing the
21377 TypeContainer when calling ParameterType.
21379 * support.cs (InternalParameters.ParameterType): Remove ugly hack
21380 that did string manipulation to compute the type and then call
21381 GetType. Use Parameter.ParameterType instead.
21383 * cs-tokenizer.cs: Consume the suffix for floating values.
21385 * expression.cs (ParameterReference): figure out whether this is a
21386 reference parameter or not. Kill an extra variable by computing
21387 the arg_idx during emission.
21389 * parameter.cs (Parameters.GetParameterInfo): New overloaded
21390 function that returns whether a parameter is an out/ref value or not.
21392 (Parameter.ParameterType): The type of the parameter (base,
21393 without ref/out applied).
21395 (Parameter.Resolve): Perform resolution here.
21396 (Parameter.ExternalType): The full type (with ref/out applied).
21398 * statement.cs (Using.Emit, Using.EmitExpression): Implement
21399 support for expressions on the using statement.
21401 2001-12-07 Miguel de Icaza <miguel@ximian.com>
21403 * statement.cs (Using.EmitLocalVariableDecls): Split the
21404 localvariable handling of the using statement.
21406 (Block.EmitMeta): Keep track of variable count across blocks. We
21407 were reusing slots on separate branches of blocks.
21409 (Try.Emit): Emit the general code block, we were not emitting it.
21411 Check the type of the declaration to be an IDisposable or
21412 something that can be implicity converted to it.
21414 Emit conversions if required.
21416 * ecore.cs (EmptyExpression): New utility class.
21417 (Expression.ImplicitConversionExists): New utility function.
21419 2001-12-06 Miguel de Icaza <miguel@ximian.com>
21421 * statement.cs (Using): Implement.
21423 * expression.cs (LocalVariableReference): Support read only variables.
21425 * statement.cs: Remove the explicit emit for the Leave opcode.
21426 (VariableInfo): Add a readonly field.
21428 2001-12-05 Miguel de Icaza <miguel@ximian.com>
21430 * ecore.cs (ConvCast): new class used to encapsulate the various
21431 explicit integer conversions that works in both checked and
21432 unchecked contexts.
21434 (Expression.ConvertNumericExplicit): Use new ConvCast class to
21435 properly generate the overflow opcodes.
21437 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21439 * statement.cs: The correct type for the EmptyExpression is the
21440 element_type, not the variable type. Ravi pointed this out.
21442 2001-12-04 Ravi Pratap <ravi@ximian.com>
21444 * class.cs (Method::Define): Handle PInvoke methods specially
21445 by using DefinePInvokeMethod instead of the usual one.
21447 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21448 above to do the task of extracting information and defining the method.
21450 2001-12-04 Ravi Pratap <ravi@ximian.com>
21452 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21453 of the condition for string type.
21455 (Emit): Move that here.
21457 (ArrayCreation::CheckIndices): Keep string literals in their expression
21460 (EmitDynamicInitializers): Handle strings appropriately.
21462 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21464 * codegen.cs (EmitContext): Replace multiple variables with a
21465 single pointer to the current Switch statement.
21467 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21470 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21474 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21477 (Foreach.Emit): Foreach on arrays was not setting
21478 up the loop variables (for break/continue).
21480 (GotoCase): Semi-implented.
21482 2001-12-03 Ravi Pratap <ravi@ximian.com>
21484 * attribute.cs (CheckAttribute): Handle system attributes by using
21485 Attribute.GetAttributes to examine information we need.
21487 (GetValidPlaces): Same here.
21489 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21491 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21493 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21495 (Method::Define): Set appropriate flags if we have a DllImport attribute.
21497 (Method::Emit): Handle the case when we are a PInvoke method.
21499 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21501 * expression.cs: Use ResolveWithSimpleName on compound names.
21503 2001-12-02 Ravi Pratap <ravi@ximian.com>
21505 * constant.cs (EmitConstant): Make sure we resolve the associated expression
21506 before trying to reduce it.
21508 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21510 * constant.cs (LookupConstantValue): Implement.
21512 (EmitConstant): Use the above in emitting the constant.
21514 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21515 that are user-defined by doing a LookupConstantValue on them.
21517 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21520 2001-11-29 Miguel de Icaza <miguel@ximian.com>
21522 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21524 (BaseAccess.DoResolve): Implement.
21526 (MemberAccess.DoResolve): Split this routine into a
21527 ResolveMemberAccess routine that can be used independently
21529 2001-11-28 Miguel de Icaza <miguel@ximian.com>
21531 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21532 As that share bits of the implementation. Is returns a boolean,
21533 while As returns the Type that is being probed.
21535 2001-12-01 Ravi Pratap <ravi@ximian.com>
21537 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21538 instead of a Literal - much easier.
21540 (EnumInTransit): Remove - utterly useless :-)
21542 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21544 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21546 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21547 chain when we have no associated expression.
21549 2001-11-30 Ravi Pratap <ravi@ximian.com>
21551 * constant.cs (Define): Use Location while reporting the errror.
21553 Also emit a warning when 'new' is used and there is no inherited
21556 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
21559 (LookupEnumValue): Implement to lookup an enum member's value and define it
21562 (Populate): Re-write accordingly to use the above routine.
21564 2001-11-27 Miguel de Icaza <miguel@ximian.com>
21566 * expression.cs (This): Fix prototype for DoResolveLValue to
21567 override the base class DoResolveLValue.
21569 * cs-parser.cs: Report errors cs574 and cs575 (destructor
21572 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21573 (we need to load the address of the field here). This fixes
21576 (FieldExpr.DoResolveLValue): Call the DoResolve
21577 function to initialize the Instance expression.
21579 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21580 correctly the GetEnumerator operation on a value type.
21582 * cs-parser.jay: Add more simple parsing error catches.
21584 * statement.cs (Switch): Add support for string switches.
21585 Handle null specially.
21587 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
21589 2001-11-28 Ravi Pratap <ravi@ximian.com>
21591 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21593 (declare_local_constant): New helper function.
21595 * statement.cs (AddConstant): Keep a separate record of constants
21597 (IsConstant): Implement to determine if a variable is a constant.
21599 (GetConstantExpression): Implement.
21601 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21603 * statement.cs (IsVariableDefined): Re-write.
21605 2001-11-27 Ravi Pratap <ravi@ximian.com>
21607 * class.cs (TypeContainer::FindMembers): Look for constants
21608 in the case when we are looking for MemberTypes.Field
21610 * expression.cs (MemberAccess::DoResolve): Check that in the
21611 case we are a FieldExpr and a Literal, we are not being accessed
21612 by an instance reference.
21614 * cs-parser.jay (local_constant_declaration): Implement.
21616 (declaration_statement): Implement for constant declarations.
21618 2001-11-26 Miguel de Icaza <miguel@ximian.com>
21620 * statement.cs (Switch): Catch double defaults.
21622 (Switch): More work on the switch() statement
21623 implementation. It works for integral values now, need to finish
21627 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21629 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21630 integer literals into other integer literals. To be used by
21633 2001-11-24 Ravi Pratap <ravi@ximian.com>
21635 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21638 (EmitDynamicInitializers): Cope with the above since we extract data
21639 directly from ArrayData now.
21641 (ExpectInitializers): Keep track of whether initializers are mandatory
21644 (Bounds): Make it a hashtable to prevent the same dimension being
21645 recorded for every element in that dimension.
21647 (EmitDynamicInitializers): Fix bug which prevented the Set array method
21650 Also fix bug which was causing the indices to be emitted in the reverse
21653 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21655 * expression.cs (ArrayCreation): Implement the bits that Ravi left
21656 unfinished. They do not work, because the underlying code is
21659 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21661 * cs-parser.jay: Remove bogus fixme.
21663 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21664 on Switch statement.
21666 2001-11-23 Ravi Pratap <ravi@ximian.com>
21668 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21671 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21672 parameter. Apparently, any expression is allowed.
21674 (ValidateInitializers): Update accordingly.
21676 (CheckIndices): Fix some tricky bugs thanks to recursion.
21678 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
21679 I was being completely brain-dead.
21681 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21682 and re-write acordingly.
21684 (DelegateInvocation): Re-write accordingly.
21686 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21688 (MakeByteBlob): Handle types more correctly.
21690 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21691 initialization from expressions but it is incomplete because I am a complete
21694 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21696 * statement.cs (If.Emit): Fix a bug that generated incorrect code
21697 on If. Basically, we have to return `true' (ie, we do return to
21698 our caller) only if both branches of the if return.
21700 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21701 short-circuit operators, handle them as short circuit operators.
21703 (Cast.DoResolve): Resolve type.
21704 (Cast.Cast): Take an expression as the target type.
21706 * cs-parser.jay (cast_expression): Remove old hack that only
21707 allowed a limited set of types to be handled. Now we take a
21708 unary_expression and we resolve to a type during semantic
21711 Use the grammar productions from Rhys to handle casts (this is
21712 not complete like Rhys syntax yet, we fail to handle that corner
21713 case that C# has regarding (-x), but we will get there.
21715 2001-11-22 Ravi Pratap <ravi@ximian.com>
21717 * class.cs (EmitFieldInitializer): Take care of the case when we have a
21718 field which is an array type.
21720 * cs-parser.jay (declare_local_variables): Support array initialization too.
21722 * typemanager.cs (MakeKey): Implement.
21724 (everywhere): Use the above appropriately.
21726 * cs-parser.jay (for_statement): Update for array initialization while
21727 declaring variables.
21729 * ecore.cs : The error message was correct, it's the variable's names that
21730 were misleading ;-) Make the code more readable.
21732 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21733 the correct type etc.
21735 (ConvertExplicit): Handle Enum types by examining the underlying type.
21737 2001-11-21 Ravi Pratap <ravi@ximian.com>
21739 * parameter.cs (GetCallingConvention): Always return
21740 CallingConventions.Standard for now.
21742 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21744 * expression.cs (Binary.ResolveOperator): Update the values of `l'
21745 and `r' after calling DoNumericPromotions.
21747 * ecore.cs: Fix error message (the types were in the wrong order).
21749 * statement.cs (Foreach.ProbeCollectionType): Need to pass
21750 BindingFlags.Instance as well
21752 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21753 implicit int literal conversion in an empty cast so that we
21754 propagate the right type upstream.
21756 (UnboxCast): new class used to unbox value types.
21757 (Expression.ConvertExplicit): Add explicit type conversions done
21760 (Expression.ImplicitNumericConversion): Oops, forgot to test for
21761 the target type before applying the implicit LongLiterals to ULong
21764 2001-11-21 Miguel de Icaza <miguel@ximian.com>
21766 * cs-parser.jay (for_statement): Reworked the way For works: now
21767 we declare manually any variables that are introduced in
21768 for_initializer to solve the problem of having out-of-band code
21769 emition (that is what got for broken).
21771 (declaration_statement): Perform the actual variable declaration
21772 that used to be done in local_variable_declaration here.
21774 (local_variable_declaration): Do not declare anything, just pass
21775 the information on a DictionaryEntry
21777 2001-11-20 Ravi Pratap <ravi@ximian.com>
21779 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21780 re-write of the logic to now make it recursive.
21782 (UpdateIndices): Re-write accordingly.
21784 Store element data in a separate ArrayData list in the above methods.
21786 (MakeByteBlob): Implement to dump the array data into a byte array.
21788 2001-11-19 Ravi Pratap <ravi@ximian.com>
21790 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21793 * constant.cs (Define): Implement.
21795 (EmitConstant): Re-write fully.
21797 Pass in location info.
21799 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21802 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21803 DictionaryEntry since we need location info too.
21805 (constant_declaration): Update accordingly.
21807 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21808 code into another method : UpdateIndices.
21810 2001-11-18 Ravi Pratap <ravi@ximian.com>
21812 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21813 some type checking etc.
21815 2001-11-17 Ravi Pratap <ravi@ximian.com>
21817 * expression.cs (ArrayCreation::ValidateInitializers): Implement
21818 bits to provide dimension info if the user skips doing that.
21820 Update second constructor to store the rank correctly.
21822 2001-11-16 Ravi Pratap <ravi@ximian.com>
21824 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21825 and try to implement.
21827 * ../errors/cs0150.cs : Add.
21829 * ../errors/cs0178.cs : Add.
21831 2001-11-16 Miguel de Icaza <miguel@ximian.com>
21833 * statement.cs: Implement foreach on multi-dimensional arrays.
21835 * parameter.cs (Parameters.GetParameterByName): Also lookup the
21836 name of the params argument.
21838 * expression.cs: Use EmitStoreOpcode to get the right opcode while
21839 initializing the array.
21841 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21842 we can use this elsewhere.
21844 * statement.cs: Finish implementation of foreach for single
21847 * cs-parser.jay: Use an out-of-band stack to pass information
21848 around, I wonder why I need this.
21850 foreach_block: Make the new foreach_block the current_block.
21852 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21853 function used to return a static Parameters structure. Used for
21854 empty parameters, as those are created very frequently.
21856 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21858 2001-11-15 Ravi Pratap <ravi@ximian.com>
21860 * interface.cs : Default modifier is private, not public. The
21861 make verify test passes again.
21863 2001-11-15 Ravi Pratap <ravi@ximian.com>
21865 * support.cs (ReflectionParameters): Fix logic to determine
21866 whether the last parameter is a params one. Test 9 passes again.
21868 * delegate.cs (Populate): Register the builders we define with
21869 RegisterParameterForBuilder. Test 19 passes again.
21871 * cs-parser.jay (property_declaration): Reference $6 instead
21872 of $$ to get at the location.
21874 (indexer_declaration): Similar stuff.
21876 (attribute): Ditto.
21878 * class.cs (Property): Register parameters for the Get and Set methods
21879 if they exist. Test 23 passes again.
21881 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21882 call to EmitArguments as we are sure there aren't any params arguments.
21883 Test 32 passes again.
21885 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21886 IndexOutOfRangeException.
21888 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21889 Test 33 now passes again.
21891 2001-11-15 Miguel de Icaza <miguel@ximian.com>
21893 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21894 broke a bunch of things. Will have to come up with a better way
21895 of tracking locations.
21897 * statement.cs: Implemented foreach for single dimension arrays.
21899 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21901 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21902 an error. This removes the lookup from the critical path.
21904 * cs-parser.jay: Removed use of temporary_loc, which is completely
21907 2001-11-14 Miguel de Icaza <miguel@ximian.com>
21909 * support.cs (ReflectionParameters.ParameterModifier): Report
21910 whether the argument is a PARAMS argument or not.
21912 * class.cs: Set the attribute `ParamArrayAttribute' on the
21913 parameter argument.
21915 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21916 and cons_param_array_attribute (ConstructorInfo for
21917 ParamArrayAttribute).,
21919 * codegen.cs: Emit the return using the `Return' statement, that
21920 way we can report the error correctly for missing return values.
21922 * class.cs (Method.Emit): Clean up.
21924 * expression.cs (Argument.Resolve): Take another argument: the
21925 location where this argument is used. Notice that this is not
21926 part of the "Argument" class as to reduce the size of the
21927 structure (we know the approximate location anyways).
21929 Test if the argument is a variable-reference, if not, then
21930 complain with a 206.
21932 (Argument.Emit): Emit addresses of variables.
21934 (Argument.FullDesc): Simplify.
21936 (Invocation.DoResolve): Update for Argument.Resolve.
21938 (ElementAccess.DoResolve): ditto.
21940 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21941 method should be virtual, as this method is always virtual.
21943 (NewDelegate.DoResolve): Update for Argument.Resolve.
21945 * class.cs (ConstructorInitializer.DoResolve): ditto.
21947 * attribute.cs (Attribute.Resolve): ditto.
21949 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21951 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21953 * expression.cs (ParameterReference): Drop IStackStorage and implement
21954 IAssignMethod instead.
21956 (LocalVariableReference): ditto.
21958 * ecore.cs (FieldExpr): Drop IStackStorage and implement
21959 IAssignMethod instead.
21961 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21963 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21964 enumerations that are used in heavily used structures derive from
21965 byte in a laughable and pathetic attempt to reduce memory usage.
21966 This is the kind of pre-optimzations that you should not do at
21967 home without adult supervision.
21969 * expression.cs (UnaryMutator): New class, used to handle ++ and
21970 -- separatedly from the other unary operators. Cleans up the
21971 code, and kills the ExpressionStatement dependency in Unary.
21973 (Unary): Removed `method' and `Arguments' from this class, making
21974 it smaller, and moving it all to SimpleCall, so I can reuse this
21975 code in other locations and avoid creating a lot of transient data
21976 strucutres when not required.
21978 * cs-parser.jay: Adjust for new changes.
21980 2001-11-11 Miguel de Icaza <miguel@ximian.com>
21982 * enum.cs (Enum.Populate): If there is a failure during
21985 * cs-parser.jay (opt_enum_base): we used to catch type errors
21986 here, but this is really incorrect. The type error should be
21987 catched during semantic analysis.
21989 2001-12-11 Ravi Pratap <ravi@ximian.com>
21991 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21992 current_local_parameters as expected since I, in my stupidity, had forgotten
21995 * attribute.cs (GetValidPlaces): Fix stupid bug.
21997 * class.cs (Method::Emit): Perform check on applicability of attributes.
21999 (Constructor::Emit): Ditto.
22001 (Field::Emit): Ditto.
22003 (Field.Location): Store location information.
22005 (Property, Event, Indexer, Operator): Ditto.
22007 * cs-parser.jay (field_declaration): Pass in location for each field.
22009 * ../errors/cs0592.cs : Add.
22011 2001-11-12 Ravi Pratap <ravi@ximian.com>
22013 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22015 (InitCoreTypes): Update accordingly.
22017 (RegisterAttrType, LookupAttr): Implement.
22019 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22020 info about the same.
22022 (Resolve): Update to populate the above as necessary.
22024 (Error592): Helper.
22026 (GetValidPlaces): Helper to the above.
22028 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22030 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22032 2001-11-12 Ravi Pratap <ravi@ximian.com>
22034 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22036 * ../errors/cs0617.cs : Add.
22038 2001-11-11 Ravi Pratap <ravi@ximian.com>
22040 * enum.cs (Emit): Rename to Populate to be more consistent with what
22041 we expect it to do and when exactly it is called.
22043 * class.cs, rootcontext.cs : Update accordingly.
22045 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22046 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22048 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22050 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22051 of a fieldinfo using the above, when dealing with a FieldBuilder.
22053 2001-11-10 Ravi Pratap <ravi@ximian.com>
22055 * ../errors/cs0031.cs : Add.
22057 * ../errors/cs1008.cs : Add.
22059 * ../errrors/cs0543.cs : Add.
22061 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22064 (FindMembers): Implement.
22066 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22067 enums and delegates too.
22069 (enum_types): Rename to builder_to_enum.
22071 (delegate_types): Rename to builder_to_delegate.
22073 * delegate.cs (FindMembers): Implement.
22075 2001-11-09 Ravi Pratap <ravi@ximian.com>
22077 * typemanager.cs (IsEnumType): Implement.
22079 * enum.cs (Emit): Re-write parts to account for the underlying type
22080 better and perform checking etc.
22082 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22083 of the underlying type.
22085 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22088 * enum.cs (error31): Helper to report error #31.
22090 * cs-parser.jay (enum_declaration): Store location of each member too.
22092 * enum.cs (member_to_location): New hashtable.
22094 (AddEnumMember): Update location hashtable.
22096 (Emit): Use the location of each member while reporting errors.
22098 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22100 * cs-parser.jay: A for_initializer if is a
22101 local_variable_declaration really ammount to have an implicit
22102 block with the variable declaration and no initializer for for.
22104 * statement.cs (For.Emit): Cope with null initializers.
22106 This fixes the infinite loop on for initializers.
22108 2001-11-08 Miguel de Icaza <miguel@ximian.com>
22110 * enum.cs: More cleanup.
22112 * ecore.cs: Remove dead code.
22114 * class.cs (Property.Emit): More simplification.
22115 (Event.Emit): ditto.
22117 Reworked to have less levels of indentation.
22119 2001-11-08 Ravi Pratap <ravi@ximian.com>
22121 * class.cs (Property): Emit attributes.
22131 * enum.cs (Emit): Ditto.
22133 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22136 * class.cs (Field, Event, etc.): Move attribute generation into the
22137 Emit method everywhere.
22139 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22140 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22141 as we had no way of defining nested enums !
22143 * rootcontext.cs : Adjust code accordingly.
22145 * typemanager.cs (AddEnumType): To keep track of enum types separately.
22147 2001-11-07 Ravi Pratap <ravi@ximian.com>
22149 * expression.cs (EvalConstantExpression): Move into ecore.cs
22151 * enum.cs (Enum): Rename some members and make them public and readonly
22152 according to our convention.
22154 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22157 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22159 (Enum::Emit): Write a simple version for now which doesn't try to compute
22160 expressions. I shall modify this to be more robust in just a while.
22162 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22164 (TypeContainer::CloseType): Create the Enum types too.
22166 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22168 * expression.cs (EvalConstantExpression): Get rid of completely.
22170 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22171 user-defined values and other cases.
22173 (IsValidEnumLiteral): Helper function.
22175 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
22176 out there in the case we had a literal FieldExpr.
22178 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22180 (Literalize): Revamp a bit to take two arguments.
22182 (EnumLiteral): New class which derives from Literal to wrap enum literals.
22184 2001-11-06 Ravi Pratap <ravi@ximian.com>
22186 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22188 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22190 (Resolve): Use the above to ensure we have proper initializers.
22192 2001-11-05 Ravi Pratap <ravi@ximian.com>
22194 * expression.cs (Expression::EvalConstantExpression): New method to
22195 evaluate constant expressions.
22197 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22199 2001-11-07 Miguel de Icaza <miguel@ximian.com>
22201 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22204 (Binary.ResolveOperator): Handle operator != (object a, object b)
22205 and operator == (object a, object b);
22207 (Binary.DoNumericPromotions): Indicate whether the numeric
22208 promotion was possible.
22210 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22213 Made the ArrayAccess implement interface IAssignMethod instead of
22214 IStackStore as the order in which arguments are passed reflects
22217 * assign.cs: Instead of using expr.ExprClass to select the way of
22218 assinging, probe for the IStackStore/IAssignMethod interfaces.
22220 * typemanager.cs: Load InitializeArray definition.
22222 * rootcontext.cs (RootContext.MakeStaticData): Used to define
22223 static data that can be used to initialize arrays.
22225 2001-11-05 Miguel de Icaza <miguel@ximian.com>
22227 * expression.cs: Handle operator== and operator!= for booleans.
22229 (Conditioal.Reduce): Implement reducer for the ?: operator.
22231 (Conditional.Resolve): Implement dead code elimination.
22233 (Binary.Resolve): Catch string literals and return a new
22234 concatenated string.
22236 (Unary.Reduce): Implement reduction of unary expressions.
22238 * ecore.cs: Split out the expression core handling here.
22240 (Expression.Reduce): New method used to perform constant folding
22241 and CSE. This is needed to support constant-expressions.
22243 * statement.cs (Statement.EmitBoolExpression): Pass true and false
22244 targets, and optimize for !x.
22246 2001-11-04 Ravi Pratap <ravi@ximian.com>
22248 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22249 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22250 set custom atttributes.
22252 * literal.cs (Literal::GetValue): New abstract method to return the actual
22253 value of the literal, cast as an object.
22255 (*Literal): Implement GetValue method.
22257 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22258 expressions to the arraylist but objects of type Argument.
22260 * class.cs (TypeContainer::Emit): Emit our attributes too.
22262 (Method::Emit, Constructor::Emit): Ditto.
22264 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22265 to be ignoring earlier.
22267 2001-11-03 Ravi Pratap <ravi@ximian.com>
22269 * attribute.cs (AttributeSection::Define): Implement to do the business
22270 of constructing a CustomAttributeBuilder.
22272 (Attribute): New trivial class. Increases readability of code.
22274 * cs-parser.jay : Update accordingly.
22276 (positional_argument_list, named_argument_list, named_argument): New rules
22278 (attribute_arguments): Use the above so that we are more correct.
22280 2001-11-02 Ravi Pratap <ravi@ximian.com>
22282 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22283 to perform all checks for a method with a params parameter.
22285 (Invocation::OverloadResolve): Update to use the above method and therefore
22286 cope correctly with params method invocations.
22288 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
22291 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22292 constructors in our parent too because we can't afford to miss out on
22295 * attribute.cs (AttributeSection): New name for the class Attribute
22297 Other trivial changes to improve readability.
22299 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22300 use the new class names.
22302 2001-11-01 Ravi Pratap <ravi@ximian.com>
22304 * class.cs (Method::Define): Complete definition for params types too
22306 (Indexer::Define): Ditto.
22308 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22309 Cope everywhere with a request for info about the array parameter.
22311 2001-11-01 Ravi Pratap <ravi@ximian.com>
22313 * tree.cs (RecordNamespace): Fix up to check for the correct key.
22315 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
22316 local_variable_type to extract the string corresponding to the type.
22318 (local_variable_type): Fixup the action to use the new helper method.
22320 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
22323 * expression.cs : Clean out code which uses the above.
22325 2001-10-31 Ravi Pratap <ravi@ximian.com>
22327 * typemanager.cs (RegisterMethod): Check if we already have an existing key
22328 and bale out if necessary by returning a false.
22330 (RegisterProperty): Ditto.
22332 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22333 and print out appropriate error messages.
22335 * interface.cs (everywhere): Ditto.
22337 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22338 location to constructor.
22340 * class.cs (Property, Event, Indexer): Update accordingly.
22342 * ../errors/cs111.cs : Added.
22344 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22345 of a method, as laid down by the spec.
22347 (Invocation::OverloadResolve): Use the above method.
22349 2001-10-31 Ravi Pratap <ravi@ximian.com>
22351 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22352 now take a TypeContainer and a Parameters object.
22354 (ParameterData): Modify return type of ParameterModifier method to be
22355 Parameter.Modifier and not a string.
22357 (ReflectionParameters, InternalParameters): Update accordingly.
22359 * expression.cs (Argument::GetParameterModifier): Same here.
22361 * support.cs (InternalParameters::ParameterType): Find a better way of determining
22362 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22363 symbol in it at all so maybe this is only for now.
22365 2001-10-30 Ravi Pratap <ravi@ximian.com>
22367 * support.cs (InternalParameters): Constructor now takes an extra argument
22368 which is the actual Parameters class.
22370 (ParameterDesc): Update to provide info on ref/out modifiers.
22372 * class.cs (everywhere): Update call to InternalParameters to pass in
22373 the second argument too.
22375 * support.cs (ParameterData): Add ParameterModifier, which is a method
22376 to return the modifier info [ref/out etc]
22378 (InternalParameters, ReflectionParameters): Implement the above.
22380 * expression.cs (Argument::ParameterModifier): Similar function to return
22381 info about the argument's modifiers.
22383 (Invocation::OverloadResolve): Update to take into account matching modifiers
22386 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22387 a new SetFormalParameters object which we pass to InternalParameters.
22389 2001-10-30 Ravi Pratap <ravi@ximian.com>
22391 * expression.cs (NewArray): Merge into the ArrayCreation class.
22393 2001-10-29 Ravi Pratap <ravi@ximian.com>
22395 * expression.cs (NewArray): Merge classes NewBuiltinArray and
22396 NewUserdefinedArray into one as there wasn't much of a use in having
22399 * expression.cs (Argument): Change field's name to ArgType from Type.
22401 (Type): New readonly property which returns the proper type, taking into
22402 account ref/out modifiers.
22404 (everywhere): Adjust code accordingly for the above.
22406 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22407 whether we are emitting for a ref or out parameter.
22409 * expression.cs (Argument::Emit): Use the above field to set the state.
22411 (LocalVariableReference::Emit): Update to honour the flag and emit the
22414 * parameter.cs (Attributes): Set the correct flags for ref parameters.
22416 * expression.cs (Argument::FullDesc): New function to provide a full desc.
22418 * support.cs (ParameterData): Add method ParameterDesc to the interface.
22420 (ReflectionParameters, InternalParameters): Implement the above method.
22422 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22425 (Invocation::FullMethodDesc): Ditto.
22427 2001-10-29 Miguel de Icaza <miguel@ximian.com>
22429 * cs-parser.jay: Add extra production for the second form of array
22432 * expression.cs (ArrayCreation): Update to reflect the above
22435 * Small changes to prepare for Array initialization.
22437 2001-10-28 Miguel de Icaza <miguel@ximian.com>
22439 * typemanager.cs (ImplementsInterface): interface might be null;
22440 Deal with this problem;
22442 Also, we do store negative hits on the cache (null values), so use
22443 this instead of calling t.GetInterfaces on the type everytime.
22445 2001-10-28 Ravi Pratap <ravi@ximian.com>
22447 * typemanager.cs (IsBuiltinType): New method to help determine the same.
22449 * expression.cs (New::DoResolve): Get rid of array creation code and instead
22450 split functionality out into different classes.
22452 (New::FormArrayType): Move into NewBuiltinArray.
22454 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22457 (NewBuiltinArray): New class to handle creation of built-in arrays.
22459 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22460 account creation of one-dimensional arrays.
22462 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22464 (NewUserdefinedArray::DoResolve): Implement.
22466 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22468 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22469 we maintain inside the TypeManager. This is necessary to perform lookups on the
22472 (LookupType): Update to perform GetType on the module builders too.
22474 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22476 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22478 2001-10-23 Ravi Pratap <ravi@ximian.com>
22480 * expression.cs (New::DoResolve): Implement guts of array creation.
22482 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22484 2001-10-27 Miguel de Icaza <miguel@ximian.com>
22486 * expression.cs: Fix bug I introduced lsat night that broke
22489 (Expression.Resolve): Report a 246 error (can not resolve name)
22490 if we find a SimpleName in the stream.
22492 (Expression.ResolveLValue): Ditto.
22494 (Expression.ResolveWithSimpleName): This function is a variant of
22495 ResolveName, this one allows SimpleNames to be returned without a
22496 warning. The only consumer of SimpleNames is MemberAccess
22498 2001-10-26 Miguel de Icaza <miguel@ximian.com>
22500 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22501 might arrive here. I have my doubts that this is correct.
22503 * statement.cs (Lock): Implement lock statement.
22505 * cs-parser.jay: Small fixes to support `lock' and `using'
22507 * cs-tokenizer.cs: Remove extra space
22509 * driver.cs: New flag --checked, allows to turn on integer math
22512 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22513 Threading.Monitor.Exit
22515 2001-10-23 Miguel de Icaza <miguel@ximian.com>
22517 * expression.cs (IndexerAccess::DoResolveLValue): Set the
22518 Expression Class to be IndexerAccess.
22520 Notice that Indexer::DoResolve sets the eclass to Value.
22522 2001-10-22 Miguel de Icaza <miguel@ximian.com>
22524 * class.cs (TypeContainer::Emit): Emit code for indexers.
22526 * assign.cs (IAssignMethod): New interface implemented by Indexers
22527 and Properties for handling assignment.
22529 (Assign::Emit): Simplify and reuse code.
22531 * expression.cs (IndexerAccess, PropertyExpr): Implement
22532 IAssignMethod, clean up old code.
22534 2001-10-22 Ravi Pratap <ravi@ximian.com>
22536 * typemanager.cs (ImplementsInterface): New method to determine if a type
22537 implements a given interface. Provides a nice cache too.
22539 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22542 (ConvertReferenceExplicit): Ditto.
22544 * delegate.cs (Delegate::Populate): Update to define the parameters on the
22545 various methods, with correct names etc.
22547 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
22548 Operator.UnaryNegation.
22550 * cs-parser.jay (operator_declarator): Be a little clever in the case where
22551 we have a unary plus or minus operator.
22553 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
22556 * everywhere : update accordingly.
22558 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22561 * class.cs (Method::Define): For the case where we are implementing a method
22562 inherited from an interface, we need to set the MethodAttributes.Final flag too.
22563 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22565 2001-10-21 Ravi Pratap <ravi@ximian.com>
22567 * interface.cs (FindMembers): Implement to work around S.R.E
22570 * typemanager.cs (IsInterfaceType): Implement.
22572 (FindMembers): Update to handle interface types too.
22574 * expression.cs (ImplicitReferenceConversion): Re-write bits which
22575 use IsAssignableFrom as that is not correct - it doesn't work.
22577 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22578 and accordingly override EmitStatement.
22580 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22581 using the correct logic :-)
22583 2001-10-19 Ravi Pratap <ravi@ximian.com>
22585 * ../errors/cs-11.cs : Add to demonstrate error -11
22587 2001-10-17 Miguel de Icaza <miguel@ximian.com>
22589 * assign.cs (Assign::Resolve): Resolve right hand side first, and
22590 then pass this as a hint to ResolveLValue.
22592 * expression.cs (FieldExpr): Add Location information
22594 (FieldExpr::LValueResolve): Report assignment to readonly
22597 (Expression::ExprClassFromMemberInfo): Pass location information.
22599 (Expression::ResolveLValue): Add new method that resolves an
22602 (Expression::DoResolveLValue): Default invocation calls
22605 (Indexers): New class used to keep track of indexers in a given
22608 (IStackStore): Renamed from LValue, as it did not really describe
22609 what this did. Also ResolveLValue is gone from this interface and
22610 now is part of Expression.
22612 (ElementAccess): Depending on the element access type
22614 * typemanager.cs: Add `indexer_name_type' as a Core type
22615 (System.Runtime.CompilerServices.IndexerNameAttribute)
22617 * statement.cs (Goto): Take a location.
22619 2001-10-18 Ravi Pratap <ravi@ximian.com>
22621 * delegate.cs (Delegate::VerifyDelegate): New method to verify
22622 if two delegates are compatible.
22624 (NewDelegate::DoResolve): Update to take care of the case when
22625 we instantiate a delegate from another delegate.
22627 * typemanager.cs (FindMembers): Don't even try to look up members
22628 of Delegate types for now.
22630 2001-10-18 Ravi Pratap <ravi@ximian.com>
22632 * delegate.cs (NewDelegate): New class to take care of delegate
22635 * expression.cs (New): Split the delegate related code out into
22636 the NewDelegate class.
22638 * delegate.cs (DelegateInvocation): New class to handle delegate
22641 * expression.cs (Invocation): Split out delegate related code into
22642 the DelegateInvocation class.
22644 2001-10-17 Ravi Pratap <ravi@ximian.com>
22646 * expression.cs (New::DoResolve): Implement delegate creation fully
22647 and according to the spec.
22649 (New::DoEmit): Update to handle delegates differently.
22651 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22652 because of which we were printing out arguments in reverse order !
22654 * delegate.cs (VerifyMethod): Implement to check if the given method
22655 matches the delegate.
22657 (FullDelegateDesc): Implement.
22659 (VerifyApplicability): Implement.
22661 * expression.cs (Invocation::DoResolve): Update to accordingly handle
22662 delegate invocations too.
22664 (Invocation::Emit): Ditto.
22666 * ../errors/cs1593.cs : Added.
22668 * ../errors/cs1594.cs : Added.
22670 * delegate.cs (InstanceExpression, TargetMethod): New properties.
22672 2001-10-16 Ravi Pratap <ravi@ximian.com>
22674 * typemanager.cs (intptr_type): Core type for System.IntPtr
22676 (InitCoreTypes): Update for the same.
22678 (iasyncresult_type, asynccallback_type): Ditto.
22680 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22683 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22686 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22687 the builders for the 4 members of a delegate type :-)
22689 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22692 * expression.cs (New::DoResolve): Implement guts for delegate creation.
22694 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22696 2001-10-15 Miguel de Icaza <miguel@ximian.com>
22698 * statement.cs (Break::Emit): Implement.
22699 (Continue::Emit): Implement.
22701 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
22702 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
22703 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
22704 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
22707 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22708 properties that track the label for the current loop (begin of the
22709 loop and end of the loop).
22711 2001-10-15 Ravi Pratap <ravi@ximian.com>
22713 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22714 use of emitting anything at all.
22716 * class.cs, rootcontext.cs : Get rid of calls to the same.
22718 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22720 (Populate): Define the constructor correctly and set the implementation
22723 * typemanager.cs (delegate_types): New hashtable to hold delegates that
22726 (AddDelegateType): Implement.
22728 (IsDelegateType): Implement helper method.
22730 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22732 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22733 and accordingly handle it.
22735 * delegate.cs (Populate): Take TypeContainer argument.
22736 Implement bits to define the Invoke method. However, I still haven't figured out
22737 how to take care of the native int bit :-(
22739 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
22740 Qualify the name of the delegate, not its return type !
22742 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22745 (StandardConversionExists): Checking for array types turns out to be recursive.
22747 (ConvertReferenceExplicit): Implement array conversion.
22749 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22751 2001-10-12 Ravi Pratap <ravi@ximian.com>
22753 * cs-parser.jay (delegate_declaration): Store the fully qualified
22754 name as it is a type declaration.
22756 * delegate.cs (ReturnType, Name): Rename members to these. Make them
22759 (DefineDelegate): Renamed from Define. Does the same thing essentially,
22760 as TypeContainer::DefineType.
22762 (Populate): Method in which all the definition of the various methods (Invoke)
22765 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22768 (CloseDelegate): Finally creates the delegate.
22770 * class.cs (TypeContainer::DefineType): Update to define delegates.
22771 (Populate, Emit and CloseType): Do the same thing here too.
22773 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22774 delegates in all these operations.
22776 2001-10-14 Miguel de Icaza <miguel@ximian.com>
22778 * expression.cs: LocalTemporary: a new expression used to
22779 reference a temporary that has been created.
22781 * assign.cs: Handle PropertyAccess back here, so that we can
22782 provide the proper semantic access to properties.
22784 * expression.cs (Expression::ConvertReferenceExplicit): Implement
22785 a few more explicit conversions.
22787 * modifiers.cs: `NEW' modifier maps to HideBySig.
22789 * expression.cs (PropertyExpr): Make this into an
22790 ExpressionStatement, and support the EmitStatement code path.
22792 Perform get/set error checking, clean up the interface.
22794 * assign.cs: recognize PropertyExprs as targets, and if so, turn
22795 them into toplevel access objects.
22797 2001-10-12 Miguel de Icaza <miguel@ximian.com>
22799 * expression.cs: PropertyExpr::PropertyExpr: use work around the
22802 * typemanager.cs: Keep track here of our PropertyBuilders again to
22803 work around lameness in SRE.
22805 2001-10-11 Miguel de Icaza <miguel@ximian.com>
22807 * expression.cs (LValue::LValueResolve): New method in the
22808 interface, used to perform a second resolution pass for LValues.
22810 (This::DoResolve): Catch the use of this in static methods.
22812 (This::LValueResolve): Implement.
22814 (This::Store): Remove warning, assigning to `this' in structures
22817 (Invocation::Emit): Deal with invocation of
22818 methods on value types. We need to pass the address to structure
22819 methods rather than the object itself. (The equivalent code to
22820 emit "this" for structures leaves the entire structure on the
22821 stack instead of a pointer to it).
22823 (ParameterReference::DoResolve): Compute the real index for the
22824 argument based on whether the method takes or not a `this' pointer
22825 (ie, the method is static).
22827 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22828 value types returned from functions when we need to invoke a
22829 method on the sturcture.
22832 2001-10-11 Ravi Pratap <ravi@ximian.com>
22834 * class.cs (TypeContainer::DefineType): Method to actually do the business of
22835 defining the type in the Modulebuilder or Typebuilder. This is to take
22836 care of nested types which need to be defined on the TypeBuilder using
22837 DefineNestedMethod.
22839 (TypeContainer::GetClassBases): Implement. Essentially the code from the
22840 methods in RootContext, only ported to be part of TypeContainer.
22842 (TypeContainer::GetInterfaceOrClass): Ditto.
22844 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22846 * interface.cs (Interface::DefineInterface): New method. Does exactly
22847 what RootContext.CreateInterface did earlier, only it takes care of nested types
22850 (Interface::GetInterfaces): Move from RootContext here and port.
22852 (Interface::GetInterfaceByName): Same here.
22854 * rootcontext.cs (ResolveTree): Re-write.
22856 (PopulateTypes): Re-write.
22858 * class.cs (TypeContainer::Populate): Populate nested types too.
22859 (TypeContainer::Emit): Emit nested members too.
22861 * typemanager.cs (AddUserType): Do not make use of the FullName property,
22862 instead just use the name argument passed in as it is already fully
22865 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22866 to TypeContainer mapping to see if a type is user-defined.
22868 * class.cs (TypeContainer::CloseType): Implement.
22870 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22871 the default constructor.
22873 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22876 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22878 * interface.cs (CloseType): Create the type here.
22880 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22883 Remove all the methods which are now in TypeContainer.
22885 2001-10-10 Ravi Pratap <ravi@ximian.com>
22887 * delegate.cs (Define): Re-write bits to define the delegate
22890 2001-10-10 Miguel de Icaza <miguel@ximian.com>
22892 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22894 * expression.cs (ImplicitReferenceConversion): handle null as well
22895 as a source to convert to any reference type.
22897 * statement.cs (Return): Perform any implicit conversions to
22898 expected return type.
22900 Validate use of return statement.
22902 * codegen.cs (EmitContext): Pass the expected return type here.
22904 * class.cs (Method, Constructor, Property): Pass expected return
22905 type to EmitContext.
22907 2001-10-09 Miguel de Icaza <miguel@ximian.com>
22909 * expression.cs: Make DoResolve take an EmitContext instead of a
22912 Replaced `l' and `location' for `loc', for consistency.
22914 (Error, Warning): Remove unneeded Tc argument.
22916 * assign.cs, literal.cs, constant.cs: Update to new calling
22919 * codegen.cs: EmitContext now contains a flag indicating whether
22920 code is being generated in a static method or not.
22922 * cs-parser.jay: DecomposeQI, new function that replaces the old
22923 QualifiedIdentifier. Now we always decompose the assembled
22924 strings from qualified_identifier productions into a group of
22927 2001-10-08 Miguel de Icaza <miguel@ximian.com>
22929 * rootcontext.cs: Deal with field-less struct types correctly now
22930 by passing the size option to Define Type.
22932 * class.cs: Removed hack that created one static field.
22934 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22936 * statement.cs: Moved most of the code generation here.
22938 2001-10-09 Ravi Pratap <ravi@ximian.com>
22940 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22943 (ElementAccess): Remove useless bits for now - keep checks as the spec
22946 2001-10-08 Ravi Pratap <ravi@ximian.com>
22948 * expression.cs (ElementAccess::DoResolve): Remove my crap code
22949 and start performing checks according to the spec.
22951 2001-10-07 Ravi Pratap <ravi@ximian.com>
22953 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22954 rank_specifiers instead.
22956 (rank_specifiers): Change the order in which the rank specifiers are stored
22958 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22960 * expression.cs (ElementAccess): Implement the LValue interface too.
22962 2001-10-06 Ravi Pratap <ravi@ximian.com>
22964 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22965 except that user defined conversions are not included.
22967 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
22968 perform the conversion of the return type, if necessary.
22970 (New::DoResolve): Check whether we are creating an array or an object
22971 and accordingly do the needful.
22973 (New::Emit): Same here.
22975 (New::DoResolve): Implement guts of array creation.
22977 (New::FormLookupType): Helper function.
22979 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22981 * codegen.cs: Removed most of the code generation here, and move the
22982 corresponding code generation bits to the statement classes.
22984 Added support for try/catch/finalize and throw.
22986 * cs-parser.jay: Added support for try/catch/finalize.
22988 * class.cs: Catch static methods having the flags override,
22989 virtual or abstract.
22991 * expression.cs (UserCast): This user cast was not really doing
22992 what it was supposed to do. Which is to be born in fully resolved
22993 state. Parts of the resolution were being performed at Emit time!
22997 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22999 * expression.cs: Implicity convert the result from UserCast.
23001 2001-10-05 Ravi Pratap <ravi@ximian.com>
23003 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23004 prevented it from working correctly.
23006 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23007 merely ConvertImplicit.
23009 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23011 * typemanager.cs: Make the LookupTypeContainer function static,
23012 and not per-instance.
23014 * class.cs: Make static FindMembers (the one that takes a Type
23017 * codegen.cs: Add EmitForeach here.
23019 * cs-parser.jay: Make foreach a toplevel object instead of the
23020 inline expansion, as we need to perform semantic analysis on it.
23022 2001-10-05 Ravi Pratap <ravi@ximian.com>
23024 * expression.cs (Expression::ImplicitUserConversion): Rename to
23025 UserDefinedConversion.
23027 (Expression::UserDefinedConversion): Take an extra argument specifying
23028 whether we look for explicit user conversions too.
23030 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23032 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23034 (ExplicitUserConversion): Make it a call to UserDefinedConversion
23035 with the appropriate arguments.
23037 * cs-parser.jay (cast_expression): Record location too.
23039 * expression.cs (Cast): Record location info.
23041 (Expression::ConvertExplicit): Take location argument.
23043 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23044 to determine if we are doing explicit conversions.
23046 (UserCast::Emit): Update accordingly.
23048 (Expression::ConvertExplicit): Report an error if everything fails.
23050 * ../errors/cs0030.cs : Add.
23052 2001-10-04 Miguel de Icaza <miguel@ximian.com>
23054 * modifiers.cs: If the ABSTRACT keyword is present, also set the
23055 virtual and newslot bits.
23057 * class.cs (TypeContainer::RegisterRequiredImplementations):
23058 Record methods we need.
23060 (TypeContainer::MakeKey): Helper function to make keys for
23061 MethodBases, since the Methodbase key is useless.
23063 (TypeContainer::Populate): Call RegisterRequiredImplementations
23064 before defining the methods.
23066 Create a mapping for method_builders_to_methods ahead of time
23067 instead of inside a tight loop.
23069 (::RequireMethods): Accept an object as the data to set into the
23070 hashtable so we can report interface vs abstract method mismatch.
23072 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23074 * report.cs: Make all of it static.
23076 * rootcontext.cs: Drop object_type and value_type computations, as
23077 we have those in the TypeManager anyways.
23079 Drop report instance variable too, now it is a global.
23081 * driver.cs: Use try/catch on command line handling.
23083 Add --probe option to debug the error reporting system with a test
23086 * report.cs: Add support for exiting program when a probe
23087 condition is reached.
23089 2001-10-03 Ravi Pratap <ravi@ximian.com>
23091 * expression.cs (Binary::DoNumericPromotions): Fix the case when
23092 we do a forcible conversion regardless of type, to check if
23093 ForceConversion returns a null.
23095 (Binary::error19): Use location to report error.
23097 (Unary::error23): Use location here too.
23099 * ../errors/cs0019.cs : Check in.
23101 * ../errors/cs0023.cs : Check in.
23103 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23104 case of a non-null MethodInfo object with a length of 0 !
23106 (Binary::ResolveOperator): Flag error if overload resolution fails to find
23107 an applicable member - according to the spec :-)
23108 Also fix logic to find members in base types.
23110 (Unary::ResolveOperator): Same here.
23112 (Unary::report23): Change name to error23 and make first argument a TypeContainer
23113 as I was getting thoroughly confused between this and error19 :-)
23115 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23116 (::FindMostEncompassedType): Implement.
23117 (::FindMostEncompassingType): Implement.
23118 (::StandardConversionExists): Implement.
23120 (UserImplicitCast): Re-vamp. We now need info about most specific
23121 source and target types so that we can do the necessary conversions.
23123 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23124 mathematical union with no duplicates.
23126 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23128 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23129 in order from base classes to child classes, so that we can in
23130 child classes look up in our parent for method names and
23131 attributes (required for handling abstract, virtual, new, override
23132 constructs: we need to instrospect our base class, and if we dont
23133 populate the classes in order, the introspection might be
23134 incorrect. For example, a method could query its parent before
23135 the parent has any methods and would determine that the parent has
23136 no abstract methods (while it could have had them)).
23138 (RootContext::CreateType): Record the order in which we define the
23141 2001-10-02 Miguel de Icaza <miguel@ximian.com>
23143 * class.cs (TypeContainer::Populate): Also method definitions can
23144 fail now, keep track of this.
23146 (TypeContainer::FindMembers): Implement support for
23147 DeclaredOnly/noDeclaredOnly flag.
23149 (Constructor::Emit) Return the ConstructorBuilder.
23151 (Method::Emit) Return the MethodBuilder.
23152 Check for abstract or virtual methods to be public.
23154 * rootcontext.cs (RootContext::CreateType): Register all the
23155 abstract methods required for the class to be complete and the
23156 interface methods that must be implemented.
23158 * cs-parser.jay: Report error 501 (method requires body if it is
23159 not marked abstract or extern).
23161 * expression.cs (TypeOf::Emit): Implement.
23163 * typemanager.cs: runtime_handle_type, new global type.
23165 * class.cs (Property::Emit): Generate code for properties.
23167 2001-10-02 Ravi Pratap <ravi@ximian.com>
23169 * expression.cs (Unary::ResolveOperator): Find operators on base type
23170 too - we now conform exactly to the spec.
23172 (Binary::ResolveOperator): Same here.
23174 * class.cs (Operator::Define): Fix minor quirk in the tests.
23176 * ../errors/cs0215.cs : Added.
23178 * ../errors/cs0556.cs : Added.
23180 * ../errors/cs0555.cs : Added.
23182 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23184 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23185 single integer which is really efficient
23187 2001-10-01 Ravi Pratap <ravi@ximian.com>
23189 * expression.cs (Expression::ImplicitUserConversion): Use location
23190 even in the case when we are examining True operators.
23192 * class.cs (Operator::Define): Perform extensive checks to conform
23193 with the rules for operator overloading in the spec.
23195 * expression.cs (Expression::ImplicitReferenceConversion): Implement
23196 some of the other conversions mentioned in the spec.
23198 * typemanager.cs (array_type): New static member for the System.Array built-in
23201 (cloneable_interface): For System.ICloneable interface.
23203 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23204 we start resolving the tree and populating types.
23206 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23208 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23210 * expression.cs (Expression::ExprClassFromMemberInfo,
23211 Expression::Literalize): Create literal expressions from
23212 FieldInfos which are literals.
23214 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23215 type casts, because they were wrong. The test suite in tests
23218 (ImplicitNumericConversion): ushort to ulong requires a widening
23221 Int32 constant to long requires widening cast as well.
23223 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23224 for integers because the type on the stack is not i4.
23226 2001-09-30 Miguel de Icaza <miguel@ximian.com>
23228 * expression.cs (report118): require location argument.
23230 * parameter.cs: Do not dereference potential null value.
23232 * class.cs: Catch methods that lack the `new' keyword when
23233 overriding a name. Report warnings when `new' is used without
23234 anything being there to override.
23236 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23238 * class.cs: Only add constructor to hashtable if it is non-null
23239 (as now constructors can fail on define).
23241 (TypeManager, Class, Struct): Take location arguments.
23243 Catch field instance initialization in structs as errors.
23245 accepting_filter: a new filter for FindMembers that is static so
23246 that we dont create an instance per invocation.
23248 (Constructor::Define): Catch errors where a struct constructor is
23251 * cs-parser.jay: Pass location information for various new
23254 * delegate.cs (Delegate): take a location argument.
23256 * driver.cs: Do not call EmitCode if there were problesm in the
23257 Definition of the types, as many Builders wont be there.
23259 * decl.cs (Decl::Decl): Require a location argument.
23261 * cs-tokenizer.cs: Handle properly hex constants that can not fit
23262 into integers, and find the most appropiate integer for it.
23264 * literal.cs: Implement ULongLiteral.
23266 * rootcontext.cs: Provide better information about the location of
23267 failure when CreateType fails.
23269 2001-09-29 Miguel de Icaza <miguel@ximian.com>
23271 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23274 * expression.cs (Binary::CheckShiftArguments): Add missing type
23276 (Binary::ResolveOperator): Add type to the logical and and logical
23277 or, Bitwise And/Or and Exclusive Or code paths, it was missing
23280 (Binary::DoNumericPromotions): In the case where either argument
23281 is ulong (and most signed types combined with ulong cause an
23282 error) perform implicit integer constant conversions as well.
23284 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23286 * expression.cs (UserImplicitCast): Method should always be
23288 (Invocation::BetterConversion): Simplified test for IntLiteral.
23290 (Expression::ImplicitNumericConversion): Split this routine out.
23291 Put the code that performs implicit constant integer conversions
23294 (Expression::Resolve): Become a wrapper around DoResolve so we can
23295 check eclass and type being set after resolve.
23297 (Invocation::Badness): Remove this dead function
23299 (Binary::ResolveOperator): Do not compute the expensive argumnets
23300 unless we have a union for it.
23302 (Probe::Emit): Is needs to do an isinst and then
23303 compare against null.
23305 (::CanConvert): Added Location argument. If the Location argument
23306 is null (Location.Null), then we do not report errors. This is
23307 used by the `probe' mechanism of the Explicit conversion. We do
23308 not want to generate an error for something that the user
23309 explicitly requested to be casted. But the pipeline for an
23310 explicit cast first tests for potential implicit casts.
23312 So for now, if the Location is null, it means `Probe only' to
23313 avoid adding another argument. Might have to revise this
23316 (ClassCast): New class used to type cast objects into arbitrary
23317 classes (used in Explicit Reference Conversions).
23319 Implement `as' as well.
23321 Reverted all the patches from Ravi below: they were broken:
23323 * The use of `level' as a mechanism to stop recursive
23324 invocations is wrong. That was there just to catch the
23325 bug with a strack trace but not as a way of addressing
23328 To fix the problem we have to *understand* what is going
23329 on and the interactions and come up with a plan, not
23330 just get things going.
23332 * The use of the type conversion cache that I proposed
23333 last night had an open topic: How does this work across
23334 protection domains. A user defined conversion might not
23335 be public in the location where we are applying the
23336 conversion, a different conversion might be selected
23337 (ie, private A->B (better) but public B->A (worse),
23338 inside A, A->B applies, but outside it, B->A will
23341 * On top of that (ie, even if the above is solved),
23342 conversions in a cache need to be abstract. Ie, `To
23343 convert from an Int to a Short use an OpcodeCast', not
23344 `To convert from an Int to a Short use the OpcodeCast on
23345 the variable 5' (which is what this patch was doing).
23347 2001-09-28 Ravi Pratap <ravi@ximian.com>
23349 * expression.cs (Invocation::ConversionExists): Re-write to use
23350 the conversion cache
23352 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23353 cache all conversions done, not just user-defined ones.
23355 (Invocation::BetterConversion): The real culprit. Use ConversionExists
23356 to determine if a conversion exists instead of acutually trying to
23357 perform the conversion. It's faster too.
23359 (Expression::ConvertExplicit): Modify to use ConversionExists to check
23360 and only then attempt the implicit conversion.
23362 2001-09-28 Ravi Pratap <ravi@ximian.com>
23364 * expression.cs (ConvertImplicit): Use a cache for conversions
23365 already found. Check level of recursion and bail out if necessary.
23367 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23369 * typemanager.cs (string_concat_string_string, string_concat_object_object):
23370 Export standard methods that we expect for string operations.
23372 * statement.cs (Block::UsageWarning): Track usage of variables and
23373 report the errors for not used variables.
23375 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23378 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23380 * codegen.cs: remove unnneded code
23382 * expression.cs: Removed BuiltinTypeAccess class
23384 Fix the order in which implicit conversions are
23387 The previous fixed dropped support for boxed conversions (adding a
23388 test to the test suite now)
23390 (UserImplicitCast::CanConvert): Remove test for source being null,
23391 that code is broken. We should not feed a null to begin with, if
23392 we do, then we should track the bug where the problem originates
23393 and not try to cover it up here.
23395 Return a resolved expression of type UserImplicitCast on success
23396 rather than true/false. Ravi: this is what I was talking about,
23397 the pattern is to use a static method as a "constructor" for
23400 Also, do not create arguments until the very last minute,
23401 otherwise we always create the arguments even for lookups that
23402 will never be performed.
23404 (UserImplicitCast::Resolve): Eliminate, objects of type
23405 UserImplicitCast are born in a fully resolved state.
23407 * typemanager.cs (InitCoreTypes): Init also value_type
23408 (System.ValueType).
23410 * expression.cs (Cast::Resolve): First resolve the child expression.
23412 (LValue): Add new method AddressOf to be used by
23415 Change the argument of Store to take an EmitContext instead of an
23416 ILGenerator, because things like FieldExpr need to be able to call
23417 their children expression to generate the instance code.
23419 (Expression::Error, Expression::Warning): Sugar functions for
23422 (Expression::MemberLookup): Accept a TypeContainer instead of a
23423 Report as the first argument.
23425 (Expression::ResolvePrimary): Killed. I still want to improve
23426 this as currently the code is just not right.
23428 (Expression::ResolveMemberAccess): Simplify, but it is still
23431 (Unary::Resolve): Catch errors in AddressOf operators.
23433 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23434 index to a byte for the short-version, or the compiler will choose
23435 the wrong Emit call, which generates the wrong data.
23437 (ParameterReference::Emit, ::Store): same.
23439 (FieldExpr::AddressOf): Implement.
23441 * typemanager.cs: TypeManager: made public variable instead of
23444 * driver.cs: document --fatal.
23446 * report.cs (ErrorMessage, WarningMessage): new names for the old
23447 Error and Warning classes.
23449 * cs-parser.jay (member_access): Turn built-in access to types
23450 into a normal simplename
23452 2001-09-27 Ravi Pratap <ravi@ximian.com>
23454 * expression.cs (Invocation::BetterConversion): Fix to cope
23455 with q being null, since this was introducing a bug.
23457 * expression.cs (ConvertImplicit): Do built-in conversions first.
23459 2001-09-27 Ravi Pratap <ravi@ximian.com>
23461 * expression.cs (UserImplicitCast::Resolve): Fix bug.
23463 2001-09-27 Ravi Pratap <ravi@ximian.com>
23465 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23466 I had introduced long ago (what's new ?).
23468 * expression.cs (UserImplicitCast::CanConvert): Static method to do
23469 the work of all the checking.
23470 (ConvertImplicit): Call CanConvert and only then create object if necessary.
23471 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23473 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23474 that is the right way.
23476 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
23477 overloading resolution. Use everywhere instead of cutting and pasting code.
23479 (Binary::ResolveOperator): Use MakeUnionSet.
23481 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
23482 we have to convert to bool types. Not complete yet.
23484 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23486 * typemanager.cs (TypeManager::CSharpName): support ushort.
23488 * expression.cs (Expression::TryImplicitIntConversion): Attempts
23489 to provide an expression that performsn an implicit constant int
23490 conversion (section 6.1.6).
23491 (Expression::ConvertImplicitRequired): Reworked to include
23492 implicit constant expression conversions.
23494 (Expression::ConvertNumericExplicit): Finished.
23496 (Invocation::Emit): If InstanceExpression is null, then it means
23497 that we perform a call on this.
23499 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23501 * expression.cs (Unary::Emit): Remove some dead code.
23502 (Probe): Implement Resolve and Emit for `is'.
23503 (Expression::ConvertImplicitRequired): Attempt to do constant
23504 expression conversions here. Maybe should be moved to
23505 ConvertImplicit, but I am not sure.
23506 (Expression::ImplicitLongConstantConversionPossible,
23507 Expression::ImplicitIntConstantConversionPossible): New functions
23508 that tell whether is it possible to apply an implicit constant
23509 expression conversion.
23511 (ConvertNumericExplicit): Started work on explicit numeric
23514 * cs-parser.jay: Update operator constants.
23516 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23517 (Parameters::GetSignature): Hook up VerifyArgs here.
23518 (Parameters::VerifyArgs): Verifies that no two arguments have the
23521 * class.cs (Operator): Update the operator names to reflect the
23522 ones that the spec expects (as we are just stringizing the
23525 * expression.cs (Unary::ResolveOperator): Fix bug: Use
23526 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23527 previous usage did only work for our methods.
23528 (Expression::ConvertImplicit): Handle decimal implicit numeric
23529 conversions as well.
23530 (Expression::InternalTypeConstructor): Used to invoke constructors
23531 on internal types for default promotions.
23533 (Unary::Emit): Implement special handling for the pre/post
23534 increment/decrement for overloaded operators, as they need to have
23535 the same semantics as the other operators.
23537 (Binary::ResolveOperator): ditto.
23538 (Invocation::ConversionExists): ditto.
23539 (UserImplicitCast::Resolve): ditto.
23541 2001-09-26 Ravi Pratap <ravi@ximian.com>
23543 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23544 operator, return after emitting body. Regression tests pass again !
23546 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23547 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23548 (Invocation::OverloadResolve): Ditto.
23549 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23551 * everywhere : update calls to the above methods accordingly.
23553 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23555 * assign.cs (Assign): Make it inherit from ExpressionStatement.
23557 * expression.cs (ExpressionStatement): New base class used for
23558 expressions that can appear in statements, so that we can provide
23559 an alternate path to generate expression that do not leave a value
23562 (Expression::Emit, and all the derivatives): We no longer return
23563 whether a value is left on the stack or not. Every expression
23564 after being emitted leaves a single value on the stack.
23566 * codegen.cs (EmitContext::EmitStatementExpression): Use the
23567 facilties of ExpressionStatement if possible.
23569 * cs-parser.jay: Update statement_expression.
23571 2001-09-25 Miguel de Icaza <miguel@ximian.com>
23573 * driver.cs: Change the wording of message
23575 2001-09-25 Ravi Pratap <ravi@ximian.com>
23577 * expression.cs (Binary::ResolveOperator): Had forgottten to set
23578 the type of the expression to the return type of the method if
23579 we have an overloaded operator match ! The regression tests pass again !
23580 (Unary::ResolveOperator): Ditto.
23582 * expression.cs (Invocation::ConversionExists): Correct the member lookup
23583 to find "op_Implicit", not "implicit" ;-)
23584 (UserImplicitCast): New class to take care of user-defined implicit conversions.
23585 (ConvertImplicit, ForceConversion): Take TypeContainer argument
23587 * everywhere : Correct calls to the above accordingly.
23589 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23590 (ConvertImplicit): Do user-defined conversion if it exists.
23592 2001-09-24 Miguel de Icaza <miguel@ximian.com>
23594 * assign.cs: track location.
23595 (Resolve): Use implicit conversions on assignment.
23597 * literal.cs: Oops. Not good, Emit of short access values should
23598 pass (Bytes) or the wrong argument will be selected.
23600 * expression.cs (Unary::Emit): Emit code for -expr.
23602 (Unary::ResolveOperator): Handle `Substract' for non-constants
23603 (substract from zero from the non-constants).
23604 Deal with Doubles as well.
23606 (Expression::ConvertImplicitRequired): New routine that reports an
23607 error if no implicit conversion exists.
23609 (Invocation::OverloadResolve): Store the converted implicit
23610 expressions if we make them
23612 2001-09-24 Ravi Pratap <ravi@ximian.com>
23614 * class.cs (ConstructorInitializer): Take a Location argument.
23615 (ConstructorBaseInitializer): Same here.
23616 (ConstructorThisInitializer): Same here.
23618 * cs-parser.jay : Update all calls accordingly.
23620 * expression.cs (Unary, Binary, New): Take location argument.
23621 Update accordingly everywhere.
23623 * cs-parser.jay : Update all calls to the above to take a location
23626 * class.cs : Ditto.
23628 2001-09-24 Ravi Pratap <ravi@ximian.com>
23630 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23631 (Invocation::BetterConversion): Same here
23632 (Invocation::ConversionExists): Ditto.
23634 (Invocation::ConversionExists): Implement.
23636 2001-09-22 Ravi Pratap <ravi@ximian.com>
23638 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23639 Also take an additional TypeContainer argument.
23641 * All over : Pass in TypeContainer as argument to OverloadResolve.
23643 * typemanager.cs (CSharpName): Update to check for the string type and return
23646 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23649 2001-09-21 Ravi Pratap <ravi@ximian.com>
23651 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23652 (Invocation::BetterFunction): Implement.
23653 (Invocation::BetterConversion): Implement.
23654 (Invocation::ConversionExists): Skeleton, no implementation yet.
23656 Okay, things work fine !
23658 2001-09-21 Miguel de Icaza <miguel@ximian.com>
23660 * typemanager.cs: declare and load enum_type, delegate_type and
23663 * expression.cs (Expression::Emit): Now emit returns a value that
23664 tells whether a value is left on the stack or not. This strategy
23665 might be reveted tomorrow with a mechanism that would address
23666 multiple assignments.
23667 (Expression::report118): Utility routine to report mismatches on
23670 (Unary::Report23): Report impossible type/operator combination
23673 (Unary::IsIncrementableNumber): Whether the type can be
23674 incremented or decremented with add.
23675 (Unary::ResolveOperator): Also allow enumerations to be bitwise
23677 (Unary::ResolveOperator): Implement ++, !, ~,
23679 (Invocation::Emit): Deal with new Emit convetion.
23681 * All Expression derivatives: Updated their Emit method to return
23682 whether they leave values on the stack or not.
23684 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23685 stack for expressions that are statements.
23687 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23689 * expression.cs (LValue): New interface. Must be implemented by
23691 (LocalVariableReference, ParameterReference, FieldExpr): Implement
23694 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23695 interface for generating code, simplifies the code.
23697 2001-09-20 Ravi Pratap <ravi@ximian.com>
23699 * expression.cs (everywhere): Comment out return statements in ::Resolve
23700 methods to avoid the warnings.
23702 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23704 * driver.cs (parse): Report error 2001 if we can not open the
23707 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23710 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23713 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23714 otherwise nested blocks end up with the same index.
23716 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23718 * expression.cs: Instead of having FIXMEs in the Resolve
23719 functions, throw exceptions so it is obvious that we are facing a
23722 * cs-parser.jay (invocation_expression): Pass Location information.
23724 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23725 Use a basename for those routines because .NET does not like paths
23728 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23731 2001-09-19 Miguel de Icaza <miguel@ximian.com>
23733 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23734 are loading the correct data types (throws an exception if not).
23735 (TypeManager::InitCoreTypes): Use CoreLookupType
23737 * expression.cs (Unary::ResolveOperator): return the child
23738 expression for expressions which are just +expr.
23739 (Unary::ResolveOperator): Return negative literals for -LITERAL
23740 expressions (otherwise they are Unary {Literal}).
23741 (Invocation::Badness): Take into account `Implicit constant
23742 expression conversions'.
23744 * literal.cs (LongLiteral): Implement long literal class.
23745 (IntLiteral): export the `Value' of the intliteral.
23747 2001-09-19 Ravi Pratap <ravi@ximian.com>
23749 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23751 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
23752 instead of 'Operator'
23754 * expression.cs (Binary::ResolveOperator): Update accordingly.
23755 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23758 * cs-parser.jay (unary_expression): Update to use the new names.
23760 * gen-treedump.cs (GetUnary): Same here.
23762 * expression.cs (Unary::Resolve): Implement.
23763 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
23764 operators are found instead of making noise ;-)
23765 (Unary::ResolveOperator): New method to do precisely the same thing which
23766 Binary::ResolveOperator does for Binary expressions.
23767 (Unary.method, .Arguments): Add.
23768 (Unary::OperName): Implement.
23769 (Unary::ForceConversion): Copy and Paste !
23771 * class.cs (Operator::Define): Fix a small bug for the case when we have
23774 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23775 for the inbuilt operators. Only overloading works for now ;-)
23777 2001-09-18 Miguel de Icaza <miguel@ximian.com>
23779 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23780 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23782 * expression.cs (This::Emit): Implement.
23783 (This::Resolve): Implement.
23784 (TypeOf:Resolve): Implement.
23785 (Expression::ResolveSimpleName): Add an implicit this to instance
23787 (MemberAccess::Resolve): Deal with Parameters and Fields.
23788 Bind instance variable to Field expressions.
23789 (FieldExpr::Instance): New field used to track the expression that
23790 represents the object instance.
23791 (FieldExpr::Resolve): Track potential errors from MemberLookup not
23793 (FieldExpr::Emit): Implement.
23795 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23796 the last instruction contains a return opcode to avoid generating
23797 the last `ret' instruction (this generates correct code, and it is
23798 nice to pass the peverify output).
23800 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23801 initializer for static and instance variables.
23802 (Constructor::Emit): Allow initializer to be null in the case of
23803 static constructors. Only emit initializer for instance
23806 (TypeContainer::FindMembers): Return a null array if there are no
23809 Also fix the code for the MemberTypes.Method branch, as it was not
23810 scanning that for operators (or tried to access null variables before).
23812 * assign.cs (Assign::Emit): Handle instance and static fields.
23816 * driver.cs: Stop compilation if there are parse errors.
23818 * cs-parser.jay (constructor_declaration): Provide default base
23819 initializer for non-static constructors.
23820 (constructor_declarator): Do not provide a default base
23821 initializers if none was specified.
23822 Catch the fact that constructors should not have parameters.
23824 * class.cs: Do not emit parent class initializers for static
23825 constructors, that should be flagged as an error.
23827 2001-09-18 Ravi Pratap <ravi@ximian.com>
23829 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23830 Move back code into TypeContainer::Populate.
23832 2001-09-18 Ravi Pratap <ravi@ximian.com>
23834 * class.cs (TypeContainer::AddConstructor): Fix the check to
23835 compare against Name, not Basename.
23836 (Operator::OpType): Change Plus and Minus to Add and Subtract.
23838 * cs-parser.jay : Update accordingly.
23840 * class.cs (TypeContainer::FindMembers): For the case where we are searching
23841 for methods, don't forget to look into the operators too.
23842 (RegisterMethodBuilder): Helper method to take care of this for
23843 methods, constructors and operators.
23844 (Operator::Define): Completely revamp.
23845 (Operator.OperatorMethod, MethodName): New fields.
23846 (TypeContainer::Populate): Move the registering of builders into
23847 RegisterMethodBuilder.
23848 (Operator::Emit): Re-write.
23850 * expression.cs (Binary::Emit): Comment out code path to emit method
23851 invocation stuff for the case when we have a user defined operator. I am
23852 just not able to get it right !
23854 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23856 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23859 (Expression::MemberLookup): Provide a version that allows to
23860 specify the MemberTypes and BindingFlags.
23862 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23863 so it was not fetching variable information from outer blocks.
23865 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23866 Beforefieldinit as it was buggy.
23868 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23869 that Ravi put here.
23871 * class.cs (Constructor::Emit): Only emit if block is not null.
23872 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23873 deal with this by semantically definining it as if the user had
23876 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23877 constructors as we now "emit" them at a higher level.
23879 (TypeContainer::DefineDefaultConstructor): Used to define the
23880 default constructors if none was provided.
23882 (ConstructorInitializer): Add methods Resolve and Emit.
23884 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23886 2001-09-17 Ravi Pratap <ravi@ximian.com>
23888 * class.cs (TypeContainer::EmitDefaultConstructor): Register
23889 the default constructor builder with our hashtable for methodbuilders
23892 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23893 and argument_count is 0 in which case we have a match.
23894 (Binary::ResolveOperator): More null checking and miscellaneous coding
23897 2001-09-17 Ravi Pratap <ravi@ximian.com>
23899 * rootcontext.cs (IsNameSpace): Compare against null.
23901 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23903 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23904 and Unary::Operator.
23906 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23909 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23910 we have overloaded operators.
23911 (Binary::ResolveOperator): Implement the part which does the operator overload
23914 * class.cs (Operator::Emit): Implement.
23915 (TypeContainer::Emit): Emit the operators we have too.
23917 * expression.cs (Binary::Emit): Update to emit the appropriate code for
23918 the case when we have a user-defined operator.
23920 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23922 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23924 2001-09-16 Ravi Pratap <ravi@ximian.com>
23926 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23927 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23928 (Constructor::Emit): Implement.
23929 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23930 if we have no work to do.
23931 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
23934 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23935 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23937 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23940 2001-09-15 Ravi Pratap <ravi@ximian.com>
23942 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23944 (Tree::RecordNamespace): Method to do what the name says ;-)
23945 (Tree::Namespaces): Property to get at the namespaces hashtable.
23947 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
23950 * rootcontext.cs (IsNamespace): Fixed it :-)
23952 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23954 * class.cs (TypeContainer::FindMembers): Add support for
23956 (MethodCore): New class that encapsulates both the shared aspects
23957 of a Constructor and a Method.
23958 (Method, Constructor): Factored pieces into MethodCore.
23960 * driver.cs: Added --fatal which makes errors throw exceptions.
23961 Load System assembly as well as part of the standard library.
23963 * report.cs: Allow throwing exceptions on errors for debugging.
23965 * modifiers.cs: Do not use `parent', instead use the real type
23966 container to evaluate permission settings.
23968 * class.cs: Put Ravi's patch back in. He is right, and we will
23969 have to cope with the
23971 2001-09-14 Ravi Pratap <ravi@ximian.com>
23973 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23974 FamORAssem, not FamANDAssem.
23976 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23978 * driver.cs: Added --parse option that only parses its input files
23981 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
23982 incorrect. IsTopLevel is not used to tell whether an object is
23983 root_types or not (that can be achieved by testing this ==
23984 root_types). But to see if this is a top-level *class* (not
23985 necessarly our "toplevel" container).
23987 2001-09-14 Ravi Pratap <ravi@ximian.com>
23989 * enum.cs (Enum::Define): Modify to call the Lookup method on the
23990 parent instead of a direct call to GetType.
23992 2001-09-14 Ravi Pratap <ravi@ximian.com>
23994 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23995 Modifiers.TypeAttr. This should just be a call to that method.
23997 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23998 object so that we can determine if we are top-level or not.
24000 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
24003 * enum.cs (Enum::Define): Ditto.
24005 * modifiers.cs (FieldAttr): Re-write.
24007 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24008 (TypeContainer::HaveStaticConstructor): New property to provide access
24009 to precisely that info.
24011 * modifiers.cs (MethodAttr): Re-write.
24012 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24014 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24015 of top-level types as claimed.
24017 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24019 * expression.cs (MemberLookup): Fruitless attempt to lookup
24020 constructors. Maybe I need to emit default constructors? That
24021 might be it (currently .NET emits this for me automatically).
24022 (Invocation::OverloadResolve): Cope with Arguments == null.
24023 (Invocation::EmitArguments): new function, shared by the new
24024 constructor and us.
24025 (Invocation::Emit): Handle static and instance methods. Emit
24026 proper call instruction for virtual or non-virtual invocations.
24027 (New::Emit): Implement.
24028 (New::Resolve): Implement.
24029 (MemberAccess:Resolve): Implement.
24030 (MethodGroupExpr::InstanceExpression): used conforming to the spec
24031 to track instances.
24032 (FieldExpr::Resolve): Set type.
24034 * support.cs: Handle empty arguments.
24036 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24037 SimpleLookup): Auxiliary routines to help parse a qualifier
24040 Update qualifier_identifier rule.
24042 * codegen.cs: Removed debugging messages.
24044 * class.cs: Make this a global thing, this acts just as a "key" to
24045 objects that we might have around.
24047 (Populate): Only initialize method_builders_to_methods once.
24049 * expression.cs (PropertyExpr): Initialize type from the
24052 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24053 Resolve pattern. Attempt to implicitly convert value to boolean.
24056 * expression.cs: Set the type for the int32/int32 argument case.
24057 (Binary::ResolveOperator): Set the return type to boolean for
24058 comparission operators
24060 * typemanager.cs: Remove debugging print code.
24062 (Invocation::Resolve): resolve type.
24064 * class.cs: Allocate a MemberInfo of the correct size, as the code
24065 elsewhere depends on the test to reflect the correct contents.
24067 (Method::) Keep track of parameters, due to System.Reflection holes
24069 (TypeContainer::Populate): Keep track of MethodBuilders to Method
24072 (TypeContainer::FindMembers): Use ArrayList and then copy an array
24073 of the exact size and return that.
24075 (Class::LookupMethodByBuilder): New function that maps
24076 MethodBuilders to its methods. Required to locate the information
24077 on methods because System.Reflection bit us again.
24079 * support.cs: New file, contains an interface ParameterData and
24080 two implementations: ReflectionParameters and InternalParameters
24081 used to access Parameter information. We will need to grow this
24084 * expression.cs (Invocation::GetParameterData): implement a cache
24085 and a wrapper around the ParameterData creation for methods.
24086 (Invocation::OverloadResolve): Use new code.
24088 2001-09-13 Ravi Pratap <ravi@ximian.com>
24090 * class.cs (TypeContainer::EmitField): Remove and move into
24091 (Field::Define): here and modify accordingly.
24092 (Field.FieldBuilder): New member.
24093 (TypeContainer::Populate): Update accordingly.
24094 (TypeContainer::FindMembers): Implement.
24096 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24098 * statement.cs: (VariableInfo::VariableType): New field to be
24099 initialized with the full type once it is resolved.
24101 2001-09-12 Miguel de Icaza <miguel@ximian.com>
24103 * parameter.cs (GetParameterInfo): Use a type cache to compute
24104 things only once, and to reuse this information
24106 * expression.cs (LocalVariableReference::Emit): Implement.
24107 (OpcodeCast::Emit): fix.
24109 (ParameterReference::Resolve): Implement.
24110 (ParameterReference::Emit): Implement.
24112 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24113 that are expressions need to stay as Expressions.
24115 * typemanager.cs (CSharpName): Returns the C# name of a type if
24118 * expression.cs (Expression::ConvertImplicit): New function that
24119 implements implicit type conversions.
24121 (Expression::ImplicitReferenceConversion): Implements implicit
24122 reference conversions.
24124 (EmptyCast): New type for transparent casts.
24126 (OpcodeCast): New type for casts of types that are performed with
24127 a sequence of bytecodes.
24129 (BoxedCast): New type used for casting value types into reference
24130 types. Emits a box opcode.
24132 (Binary::DoNumericPromotions): Implements numeric promotions of
24133 and computation of the Binary::Type.
24135 (Binary::EmitBranchable): Optimization.
24137 (Binary::Emit): Implement code emission for expressions.
24139 * typemanager.cs (TypeManager): Added two new core types: sbyte
24142 2001-09-12 Ravi Pratap <ravi@ximian.com>
24144 * class.cs (TypeContainer::FindMembers): Method which does exactly
24145 what Type.FindMembers does, only we don't have to use reflection. No
24146 implementation yet.
24148 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24149 typecontainer objects as we need to get at them.
24150 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24152 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24153 typecontainer object.
24155 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24156 of just a Report object.
24158 2001-09-11 Ravi Pratap <ravi@ximian.com>
24160 * class.cs (Event::Define): Go back to using the prefixes "add_" and
24162 (TypeContainer::Populate): Now define the delegates of the type too.
24163 (TypeContainer.Delegates): Property to access the list of delegates defined
24166 * delegates.cs (Delegate::Define): Implement partially.
24168 * modifiers.cs (TypeAttr): Handle more flags.
24170 2001-09-11 Ravi Pratap <ravi@ximian.com>
24172 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24174 (Operator::Define): Re-write logic to get types by using the LookupType method
24175 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24176 (Indexer::Define): Ditto.
24177 (Event::Define): Ditto.
24178 (Property::Define): Ditto.
24180 2001-09-10 Ravi Pratap <ravi@ximian.com>
24182 * class.cs (TypeContainer::Populate): Now define operators too.
24183 (TypeContainer.Operators): New property to access the list of operators
24185 (Operator.OperatorMethodBuilder): New member to hold the method builder
24186 for the operator we are defining.
24187 (Operator::Define): Implement.
24189 2001-09-10 Ravi Pratap <ravi@ximian.com>
24191 * class.cs (Event::Define): Make the prefixes of the accessor methods
24192 addOn_ and removeOn_
24194 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24195 of the location being passed in too. Ideally, this should go later since all
24196 error reporting should be done through the Report object.
24198 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24199 (Populate): Iterate thru the indexers we have and define them too.
24200 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24201 for the get and set accessors.
24202 (Indexer::Define): Implement.
24204 2001-09-09 Miguel de Icaza <miguel@ximian.com>
24206 * expression.cs (Binary::Resolve): Beginning of it. I scratched
24207 my previous implementation, did not work.
24209 * typemanager.cs: Add a couple of missing types (the longs).
24211 * literal.cs: Use TypeManager.bool_type instead of getting it.
24213 * expression.cs (EventExpr): New kind of expressions.
24214 (Expressio::ExprClassFromMemberInfo): finish
24216 2001-09-08 Miguel de Icaza <miguel@ximian.com>
24218 * assign.cs: Emit stores to static fields differently.
24220 2001-09-08 Ravi Pratap <ravi@ximian.com>
24222 * Merge in changes and adjust code to tackle conflicts. Backed out my
24223 code in Assign::Resolve ;-)
24225 2001-09-08 Ravi Pratap <ravi@ximian.com>
24227 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24228 instead Report.Error and also pass in the location.
24229 (CSharpParser::Lexer): New readonly property to return the reference
24230 to the Tokenizer object.
24231 (declare_local_variables): Use Report.Error with location instead of plain
24235 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24236 (Operator.CheckBinaryOperator): Ditto.
24238 * cs-parser.jay (operator_declarator): Update accordingly.
24240 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24241 (CheckBinaryOperator): Same here.
24243 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24244 on the name without any prefixes of namespace names etc. This is because we
24245 already might have something already fully qualified like
24246 'System.Console.WriteLine'
24248 * assign.cs (Resolve): Begin implementation. Stuck ;-)
24250 2001-09-07 Ravi Pratap <ravi@ximian.com>
24252 * cs-tokenizer.cs (location): Return a string which also contains
24255 * expression.cs (ElementAccess): New class for expressions of the
24256 type 'element access.'
24257 (BaseAccess): New class for expressions of the type 'base access.'
24258 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24261 * cs-parser.jay (element_access): Implement action.
24262 (base_access): Implement actions.
24263 (checked_expression, unchecked_expression): Implement.
24265 * cs-parser.jay (local_variable_type): Correct and implement.
24266 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24268 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24270 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24271 name and the specifiers.
24273 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24275 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
24276 making them all public ;-)
24278 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24281 2001-09-07 Miguel de Icaza <miguel@ximian.com>
24283 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24285 (FieldExpr, PropertyExprs): New resolved expressions.
24286 (SimpleName::MemberStaticCheck): Perform static checks for access
24287 to non-static fields on static methods. Maybe this should be
24288 generalized for MemberAccesses.
24289 (SimpleName::ResolveSimpleName): More work on simple name
24292 * cs-parser.jay (primary_expression/qualified_identifier): track
24293 the parameter index.
24295 * codegen.cs (CodeGen::Save): Catch save exception, report error.
24296 (EmitContext::EmitBoolExpression): Chain to expression generation
24297 instead of temporary hack.
24298 (::EmitStatementExpression): Put generic expression code generation.
24300 * assign.cs (Assign::Emit): Implement variable assignments to
24301 local variables, parameters and fields.
24303 2001-09-06 Miguel de Icaza <miguel@ximian.com>
24305 * statement.cs (Block::GetVariableInfo): New method, returns the
24306 VariableInfo for a variable name in a block.
24307 (Block::GetVariableType): Implement in terms of GetVariableInfo
24309 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24310 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24312 2001-09-06 Ravi Pratap <ravi@ximian.com>
24314 * cs-parser.jay (operator_declaration): Continue on my quest : update
24315 to take attributes argument.
24316 (event_declaration): Ditto.
24317 (enum_declaration): Ditto.
24318 (indexer_declaration): Ditto.
24320 * class.cs (Operator::Operator): Update constructor accordingly.
24321 (Event::Event): Ditto.
24323 * delegate.cs (Delegate::Delegate): Same here.
24325 * enum.cs (Enum::Enum): Same here.
24327 2001-09-05 Ravi Pratap <ravi@ximian.com>
24329 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24331 * ../tests/cs0658.cs : New file to demonstrate error 0658.
24333 * attribute.cs (Attributes): New class to encapsulate all attributes which were
24334 being passed around as an arraylist.
24335 (Attributes::AddAttribute): Method to add attribute sections.
24337 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24338 (struct_declaration): Update accordingly.
24339 (constant_declaration): Update.
24340 (field_declaration): Update.
24341 (method_header): Update.
24342 (fixed_parameter): Update.
24343 (parameter_array): Ditto.
24344 (property_declaration): Ditto.
24345 (destructor_declaration): Ditto.
24347 * class.cs (Struct::Struct): Update constructors accordingly.
24348 (Class::Class): Ditto.
24349 (Field::Field): Ditto.
24350 (Method::Method): Ditto.
24351 (Property::Property): Ditto.
24352 (TypeContainer::OptAttribute): update property's return type.
24354 * interface.cs (Interface.opt_attributes): New member.
24355 (Interface::Interface): Update to take the extra Attributes argument.
24357 * parameter.cs (Parameter::Parameter): Ditto.
24359 * constant.cs (Constant::Constant): Ditto.
24361 * interface.cs (InterfaceMemberBase): New OptAttributes field.
24362 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
24363 the attributes as a parameter.
24364 (InterfaceProperty): Update constructor call.
24365 (InterfaceEvent): Ditto.
24366 (InterfaceMethod): Ditto.
24367 (InterfaceIndexer): Ditto.
24369 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
24370 pass the attributes too.
24371 (interface_event_declaration): Ditto.
24372 (interface_property_declaration): Ditto.
24373 (interface_method_declaration): Ditto.
24374 (interface_declaration): Ditto.
24376 2001-09-05 Miguel de Icaza <miguel@ximian.com>
24378 * class.cs (Method::Define): Track the "static Main" definition to
24379 create an entry point.
24381 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24382 EntryPoint if we find it.
24384 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24385 (EmitContext::ig): Make this variable public.
24387 * driver.cs: Make the default output file be the first file name
24388 with the .exe extension.
24390 Detect empty compilations
24392 Handle various kinds of output targets. Handle --target and
24393 rename -t to --dumper.
24395 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24396 methods inherited from Expression return now an Expression. This
24397 will is used during the tree rewriting as we resolve them during
24400 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24401 the spec. Missing entirely is the information about
24402 accessability of elements of it.
24404 (Expression::ExprClassFromMemberInfo): New constructor for
24405 Expressions that creates a fully initialized Expression based on
24406 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24409 (Invocation::Resolve): Begin implementing resolution of invocations.
24411 * literal.cs (StringLiteral): Implement Emit.
24413 2001-09-05 Ravi Pratap <ravi@ximian.com>
24415 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24418 2001-09-04 Ravi Pratap <ravi@ximian.com>
24420 * cs-parser.jay (attribute_arguments): Implement actions.
24421 (attribute): Fix bug in production. Implement action.
24422 (attribute_list): Implement.
24423 (attribute_target): Implement.
24424 (attribute_target_specifier, opt_target_specifier): Implement
24425 (CheckAttributeTarget): New method to check if the attribute target
24427 (attribute_section): Implement.
24428 (opt_attributes): Implement.
24430 * attribute.cs : New file to handle attributes.
24431 (Attribute): Class to hold attribute info.
24433 * cs-parser.jay (opt_attribute_target_specifier): Remove production
24434 (attribute_section): Modify production to use 2 different rules to
24435 achieve the same thing. 1 s/r conflict down !
24436 Clean out commented, useless, non-reducing dimension_separator rules.
24438 * class.cs (TypeContainer.attributes): New member to hold list
24439 of attributes for a type.
24440 (Struct::Struct): Modify to take one more argument, the attribute list.
24441 (Class::Class): Ditto.
24442 (Field::Field): Ditto.
24443 (Method::Method): Ditto.
24444 (Property::Property): Ditto.
24446 * cs-parser.jay (struct_declaration): Update constructor call to
24447 pass in the attributes too.
24448 (class_declaration): Ditto.
24449 (constant_declaration): Ditto.
24450 (field_declaration): Ditto.
24451 (method_header): Ditto.
24452 (fixed_parameter): Ditto.
24453 (parameter_array): Ditto.
24454 (property_declaration): Ditto.
24456 * constant.cs (Constant::Constant): Update constructor similarly.
24457 Use System.Collections.
24459 * parameter.cs (Parameter::Parameter): Update as above.
24461 2001-09-02 Ravi Pratap <ravi@ximian.com>
24463 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24464 (TypeContainer.delegates): New member to hold list of delegates.
24466 * cs-parser.jay (delegate_declaration): Implement the action correctly
24467 this time as I seem to be on crack ;-)
24469 2001-09-02 Miguel de Icaza <miguel@ximian.com>
24471 * rootcontext.cs (RootContext::IsNamespace): new function, used to
24472 tell whether an identifier represents a namespace.
24474 * expression.cs (NamespaceExpr): A namespace expression, used only
24475 temporarly during expression resolution.
24476 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24477 utility functions to resolve names on expressions.
24479 2001-09-01 Miguel de Icaza <miguel@ximian.com>
24481 * codegen.cs: Add hook for StatementExpressions.
24483 * class.cs: Fix inverted test for static flag in methods.
24485 2001-09-02 Ravi Pratap <ravi@ximian.com>
24487 * class.cs (Operator::CheckUnaryOperator): Correct error number used
24488 to make it coincide with MS' number.
24489 (Operator::CheckBinaryOperator): Ditto.
24491 * ../errors/errors.txt : Remove error numbers added earlier.
24493 * ../errors/cs1019.cs : Test case for error # 1019
24495 * ../errros/cs1020.cs : Test case for error # 1020
24497 * cs-parser.jay : Clean out commented cruft.
24498 (dimension_separators, dimension_separator): Comment out. Ostensibly not
24499 used anywhere - non-reducing rule.
24500 (namespace_declarations): Non-reducing rule - comment out.
24502 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24503 with TypeContainer::AddEnum.
24505 * delegate.cs : New file for delegate handling classes.
24506 (Delegate): Class for declaring delegates.
24508 * makefile : Update.
24510 * cs-parser.jay (delegate_declaration): Implement.
24512 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
24514 * class.cs (Event::Define): Implement.
24515 (Event.EventBuilder): New member.
24517 * class.cs (TypeContainer::Populate): Update to define all enums and events
24519 (Events): New property for the events arraylist we hold. Shouldn't we move to using
24520 readonly fields for all these cases ?
24522 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24524 * class.cs (Property): Revamp to use the convention of making fields readonly.
24525 Accordingly modify code elsewhere.
24527 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24528 the Define method of the Property class.
24530 * class.cs : Clean up applied patch and update references to variables etc. Fix
24532 (TypeContainer::Populate): Update to define all the properties we have. Also
24533 define all enumerations.
24535 * enum.cs (Define): Implement.
24537 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24539 * cs-parser.jay (overloadable_operator): The semantic value is an
24540 enum of the Operator class.
24541 (operator_declarator): Implement actions.
24542 (operator_declaration): Implement.
24544 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24545 validity of definitions.
24546 (Operator::CheckBinaryOperator): Static method to check for binary operators
24547 (TypeContainer::AddOperator): New method to add an operator to a type.
24549 * cs-parser.jay (indexer_declaration): Added line to actually call the
24550 AddIndexer method so it gets added ;-)
24552 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
24553 already taken care of by the MS compiler ?
24555 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24557 * class.cs (Operator): New class for operator declarations.
24558 (Operator::OpType): Enum for the various operators.
24560 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24562 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24563 ostensibly handle this in semantic analysis.
24565 * cs-parser.jay (general_catch_clause): Comment out
24566 (specific_catch_clauses, specific_catch_clause): Ditto.
24567 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24568 (catch_args, opt_catch_args): New productions.
24569 (catch_clause): Rewrite to use the new productions above
24570 (catch_clauses): Modify accordingly.
24571 (opt_catch_clauses): New production to use in try_statement
24572 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24573 and re-write the code in the actions to extract the specific and
24574 general catch clauses by being a little smart ;-)
24576 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24577 Hooray, try and catch statements parse fine !
24579 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24581 * statement.cs (Block::GetVariableType): Fix logic to extract the type
24582 string from the hashtable of variables.
24584 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24585 I end up making that mistake ;-)
24586 (catch_clauses): Fixed gross error which made Key and Value of the
24587 DictionaryEntry the same : $1 !!
24589 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24591 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24593 * cs-parser.jay (event_declaration): Correct to remove the semicolon
24594 when the add and remove accessors are specified.
24596 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24598 * cs-parser.jay (IndexerDeclaration): New helper class to hold
24599 information about indexer_declarator.
24600 (indexer_declarator): Implement actions.
24601 (parsing_indexer): New local boolean used to keep track of whether
24602 we are parsing indexers or properties. This is necessary because
24603 implicit_parameters come into picture even for the get accessor in the
24604 case of an indexer.
24605 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24607 * class.cs (Indexer): New class for indexer declarations.
24608 (TypeContainer::AddIndexer): New method to add an indexer to a type.
24609 (TypeContainer::indexers): New member to hold list of indexers for the
24612 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24614 * cs-parser.jay (add_accessor_declaration): Implement action.
24615 (remove_accessor_declaration): Implement action.
24616 (event_accessors_declaration): Implement
24617 (variable_declarators): swap statements for first rule - trivial.
24619 * class.cs (Event): New class to hold information about event
24621 (TypeContainer::AddEvent): New method to add an event to a type
24622 (TypeContainer::events): New member to hold list of events.
24624 * cs-parser.jay (event_declaration): Implement actions.
24626 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24628 * cs-parser.jay (dim_separators): Implement. Make it a string
24629 concatenating all the commas together, just as they appear.
24630 (opt_dim_separators): Modify accordingly
24631 (rank_specifiers): Update accordingly. Basically do the same
24632 thing - instead, collect the brackets here.
24633 (opt_rank_sepcifiers): Modify accordingly.
24634 (array_type): Modify to actually return the complete type string
24635 instead of ignoring the rank_specifiers.
24636 (expression_list): Implement to collect the expressions
24637 (variable_initializer): Implement. We make it a list of expressions
24638 essentially so that we can handle the array_initializer case neatly too.
24639 (variable_initializer_list): Implement.
24640 (array_initializer): Make it a list of variable_initializers
24641 (opt_array_initializer): Modify accordingly.
24643 * expression.cs (New::NType): Add enumeration to help us
24644 keep track of whether we have an object/delegate creation
24645 or an array creation.
24646 (New:NewType, New::Rank, New::Indices, New::Initializers): New
24647 members to hold data about array creation.
24648 (New:New): Modify to update NewType
24649 (New:New): New Overloaded contructor for the array creation
24652 * cs-parser.jay (array_creation_expression): Implement to call
24653 the overloaded New constructor.
24655 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
24657 * class.cs (TypeContainer::Constructors): Return member
24658 constructors instead of returning null.
24660 2001-08-26 Miguel de Icaza <miguel@ximian.com>
24662 * typemanager.cs (InitCoreTypes): Initialize the various core
24663 types after we have populated the type manager with the user
24664 defined types (this distinction will be important later while
24665 compiling corlib.dll)
24667 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24668 on Expression Classification. Now all expressions have a method
24669 `Resolve' and a method `Emit'.
24671 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24672 generation from working. Also add some temporary debugging
24675 2001-08-24 Miguel de Icaza <miguel@ximian.com>
24677 * codegen.cs: Lots of code generation pieces. This is only the
24678 beginning, will continue tomorrow with more touches of polish. We
24679 handle the fundamentals of if, while, do, for, return. Others are
24680 trickier and I need to start working on invocations soon.
24682 * gen-treedump.cs: Bug fix, use s.Increment here instead of
24685 * codegen.cs (EmitContext): New struct, used during code
24686 emission to keep a context. Most of the code generation will be
24689 * cs-parser.jay: Add embedded blocks to the list of statements of
24690 this block. So code generation proceeds in a top down fashion.
24692 2001-08-23 Miguel de Icaza <miguel@ximian.com>
24694 * statement.cs: Add support for multiple child blocks.
24696 2001-08-22 Miguel de Icaza <miguel@ximian.com>
24698 * codegen.cs (EmitCode): New function, will emit the code for a
24699 Block of code given a TypeContainer and its ILGenerator.
24701 * statement.cs (Block): Standard public readonly optimization.
24702 (Block::Block constructors): Link children.
24703 (Block::Child): Child Linker.
24704 (Block::EmitVariables): Emits IL variable declarations.
24706 * class.cs: Drop support for MethodGroups here, delay until
24708 (Method::): Applied the same simplification that I did before, and
24709 move from Properties to public readonly fields.
24710 (Method::ParameterTypes): Returns the parameter types for the
24711 function, and implements a cache that will be useful later when I
24712 do error checking and the semantic analysis on the methods is
24714 (Constructor::GetCallingConvention): Renamed from CallingConvetion
24715 and made a method, optional argument tells whether this is a class
24716 or a structure to apply the `has-this' bit.
24717 (Method::GetCallingConvention): Implement, returns the calling
24719 (Method::Define): Defines the type, a second pass is performed
24720 later to populate the methods.
24722 (Constructor::ParameterTypes): implement a cache similar to the
24723 one on Method::ParameterTypes, useful later when we do semantic
24726 (TypeContainer::EmitMethod): New method. Emits methods.
24728 * expression.cs: Removed MethodGroup class from here.
24730 * parameter.cs (Parameters::GetCallingConvention): new method.
24732 2001-08-21 Miguel de Icaza <miguel@ximian.com>
24734 * class.cs (TypeContainer::Populate): Drop RootContext from the
24737 (Constructor::CallingConvention): Returns the calling convention.
24738 (Constructor::ParameterTypes): Returns the constructor parameter
24741 (TypeContainer::AddConstructor): Keep track of default constructor
24742 and the default static constructor.
24744 (Constructor::) Another class that starts using `public readonly'
24745 instead of properties.
24747 (Constructor::IsDefault): Whether this is a default constructor.
24749 (Field::) use readonly public fields instead of properties also.
24751 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24752 track of static constructors; If none is used, turn on
24753 BeforeFieldInit in the TypeAttributes.
24755 * cs-parser.jay (opt_argument_list): now the return can be null
24756 for the cases where there are no arguments.
24758 (constructor_declarator): If there is no implicit `base' or
24759 `this', then invoke the default parent constructor.
24761 * modifiers.cs (MethodAttr): New static function maps a set of
24762 modifiers flags into a MethodAttributes enum
24763 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
24764 MethodAttr, TypeAttr to represent the various mappings where the
24765 modifiers are used.
24766 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
24768 2001-08-19 Miguel de Icaza <miguel@ximian.com>
24770 * parameter.cs (GetParameterInfo): Fix bug where there would be no
24773 * interface.cs (PopulateIndexer): Implemented the code generator
24774 for interface indexers.
24776 2001-08-17 Miguel de Icaza <miguel@ximian.com>
24778 * interface.cs (InterfaceMemberBase): Now we track the new status
24781 (PopulateProperty): Implement property population. Woohoo! Got
24782 Methods and Properties going today.
24784 Removed all the properties for interfaces, and replaced them with
24785 `public readonly' fields.
24787 2001-08-16 Miguel de Icaza <miguel@ximian.com>
24789 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24790 initialize their hashtables/arraylists only when they are needed
24791 instead of doing this always.
24793 * parameter.cs: Handle refs and out parameters.
24795 * cs-parser.jay: Use an ArrayList to construct the arguments
24796 instead of the ParameterCollection, and then cast that to a
24799 * parameter.cs: Drop the use of ParameterCollection and use
24800 instead arrays of Parameters.
24802 (GetParameterInfo): Use the Type, not the Name when resolving
24805 2001-08-13 Miguel de Icaza <miguel@ximian.com>
24807 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24808 and instead use public readonly fields.
24810 * class.cs: Put back walking code for type containers.
24812 2001-08-11 Miguel de Icaza <miguel@ximian.com>
24814 * class.cs (MakeConstant): Code to define constants.
24816 * rootcontext.cs (LookupType): New function. Used to locate types
24819 2001-08-08 Miguel de Icaza <miguel@ximian.com>
24821 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
24822 this System.Reflection code is. Kudos to Microsoft
24824 * typemanager.cs: Implement a type cache and avoid loading all
24825 types at boot time. Wrap in LookupType the internals. This made
24826 the compiler so much faster. Wow. I rule!
24828 * driver.cs: Make sure we always load mscorlib first (for
24829 debugging purposes, nothing really important).
24831 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
24832 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
24834 * rootcontext.cs: Lookup types on their namespace; Lookup types
24835 on namespaces that have been imported using the `using' keyword.
24837 * class.cs (TypeContainer::TypeAttr): Virtualize.
24838 (Class::TypeAttr): Return attributes suitable for this bad boy.
24839 (Struct::TypeAttr): ditto.
24840 Handle nested classes.
24841 (TypeContainer::) Remove all the type visiting code, it is now
24842 replaced with the rootcontext.cs code
24844 * rootcontext.cs (GetClassBases): Added support for structs.
24846 2001-08-06 Miguel de Icaza <miguel@ximian.com>
24848 * interface.cs, statement.cs, class.cs, parameter.cs,
24849 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24850 Drop use of TypeRefs, and use strings instead.
24852 2001-08-04 Miguel de Icaza <miguel@ximian.com>
24856 * class.cs (Struct::Struct): set the SEALED flags after
24857 checking the modifiers.
24858 (TypeContainer::TypeAttr): new property, returns the
24859 TypeAttributes for a class.
24861 * cs-parser.jay (type_list): Oops, list production was creating a
24862 new list of base types.
24864 * rootcontext.cs (StdLib): New property.
24865 (GetInterfaceTypeByName): returns an interface by type name, and
24866 encapsulates error handling here.
24867 (GetInterfaces): simplified.
24868 (ResolveTree): Encapsulated all the tree resolution here.
24869 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24872 * driver.cs: Add support for --nostdlib, to avoid loading the
24873 default assemblies.
24874 (Main): Do not put tree resolution here.
24876 * rootcontext.cs: Beginning of the class resolution.
24878 2001-08-03 Miguel de Icaza <miguel@ximian.com>
24880 * rootcontext.cs: Provide better error reporting.
24882 * cs-parser.jay (interface_base): set our $$ to be interfaces.
24884 * rootcontext.cs (CreateInterface): Handle the case where there
24885 are no parent interfaces.
24887 (CloseTypes): Routine to flush types at the end.
24888 (CreateInterface): Track types.
24889 (GetInterfaces): Returns an array of Types from the list of
24890 defined interfaces.
24892 * typemanager.c (AddUserType): Mechanism to track user types (puts
24893 the type on the global type hash, and allows us to close it at the
24896 2001-08-02 Miguel de Icaza <miguel@ximian.com>
24898 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24899 RecordInterface instead.
24901 * cs-parser.jay: Updated to reflect changes above.
24903 * decl.cs (Definition): Keep track of the TypeBuilder type that
24904 represents this type here. Not sure we will use it in the long
24905 run, but wont hurt for now.
24907 * driver.cs: Smaller changes to accomodate the new code.
24909 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24912 * rootcontext.cs (CreateInterface): New method, used to create
24913 the System.TypeBuilder type for interfaces.
24914 (ResolveInterfaces): new entry point to resolve the interface
24916 (CodeGen): Property, used to keep track of the code generator.
24918 2001-07-26 Miguel de Icaza <miguel@ximian.com>
24920 * cs-parser.jay: Add a second production for delegate_declaration
24923 (enum_body): Put an opt_comma here instead of putting it on
24924 enum_body or enum_member_declarations so we can handle trailing
24925 commas on enumeration members. Gets rid of a shift/reduce.
24927 (type_list): Need a COMMA in the middle.
24929 (indexer_declaration): Tell tokenizer to recognize get/set
24931 * Remove old targets.
24933 * Re-add the parser target.
24935 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24937 * cs-parser.jay: Add precendence rules for a number of operators
24938 ot reduce the number of shift/reduce conflicts in the grammar.
24940 2001-07-17 Miguel de Icaza <miguel@ximian.com>
24942 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24945 Get rid of old crufty code.
24947 * rootcontext.cs: Use this to keep track of the parsed
24948 representation and the defined types available to the program.
24950 * gen-treedump.cs: adjust for new convention.
24952 * type.cs: Split out the type manager, and the assembly builder
24955 * typemanager.cs: the type manager will live here now.
24957 * cil-codegen.cs: And the code generator here.
24959 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
24961 * makefile: Fixed up for easy making.
24963 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24965 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24968 (unary_expression): Expand pre_increment_expression and
24969 post_decrement_expression to reduce a shift/reduce.
24971 2001-07-11 Simon Cozens
24973 * cs-tokenizer.cs: Hex numbers should begin with a 0.
24975 Improve allow_keyword_as_indent name.
24977 2001-06-19 Miguel de Icaza <miguel@ximian.com>
24979 * Adjustments for Beta2.
24981 2001-06-13 Miguel de Icaza <miguel@ximian.com>
24983 * decl.cs: Added `Define' abstract method.
24984 (InTransit): new property, used to catch recursive definitions.
24986 * interface.cs: Implement `Define'.
24988 * modifiers.cs: Map Modifiers.constants to
24989 System.Reflection.TypeAttribute flags.
24991 * class.cs: Keep track of types and user-defined types.
24992 (BuilderInit): New method for creating an assembly
24993 (ResolveType): New function to launch the resolution process, only
24994 used by interfaces for now.
24996 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24997 that are inserted into the name space.
24999 2001-06-08 Miguel de Icaza <miguel@ximian.com>
25001 * ARGH. I have screwed up my tree so many times due to the use of
25002 rsync rather than using CVS. Going to fix this at once.
25004 * driver.cs: Objetify driver. Load assemblies, use assemblies to
25007 2001-06-07 Miguel de Icaza <miguel@ximian.com>
25009 * Experiment successful: Use System.Type rather that our own
25012 2001-05-25 Miguel de Icaza <miguel@ximian.com>
25014 * cs-parser.jay: Removed nsAliases from here.
25016 Use new namespaces, handle `using XXX;'
25018 * namespace.cs: Reimplemented namespace handling, use a recursive
25019 definition of the class. Now we can keep track of using clauses
25020 and catch invalid using clauses.
25022 2001-05-24 Miguel de Icaza <miguel@ximian.com>
25024 * gen-treedump.cs: Adapted for all the renaming.
25026 * expression.cs (Expression): this class now has a Type property
25027 which returns an expression Type.
25029 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25030 `Type', as this has a different meaning now in the base
25032 2001-05-22 Miguel de Icaza <miguel@ximian.com>
25034 * interface.cs, class.cs: Removed from all the sources the
25035 references to signature computation, as we can not do method
25036 signature computation during the parsing time, as we are not
25037 trying to solve at that point distinguishing:
25041 void a (NS.Blah x) {}
25044 Which depending on the context might be valid or not, as we do not
25045 know if Blah is the same thing as NS.Blah at that point.
25047 * Redid everything so the code uses TypeRefs now instead of
25048 Types. TypeRefs are just temporary type placeholders, that need
25049 to be resolved. They initially have a pointer to a string and the
25050 current scope in which they are used. This is used later by the
25051 compiler to resolve the reference to an actual Type.
25053 * DeclSpace is no longer a CIR.Type, and neither are
25054 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
25055 are all DeclSpaces, but no Types.
25057 * type.cs (TypeRefManager): This implements the TypeRef manager,
25058 which keeps track of all the types that need to be resolved after
25059 the parsing has finished.
25061 2001-05-13 Miguel de Icaza <miguel@ximian.com>
25063 * ARGH. We are going to have to store `foreach' as a class rather
25064 than resolving it, as we need to verify error 1579 after name
25065 resolution. *OR* we could keep a flag that says `This request to
25066 IEnumerator comes from a foreach statement' which we can then use
25067 to generate the error.
25069 2001-05-10 Miguel de Icaza <miguel@ximian.com>
25071 * class.cs (TypeContainer.AddMethod): we now add methods to the
25072 MethodGroup instead of the method hashtable.
25074 * expression.cs: Add MethodGroup abstraction, which gets us one
25075 step closer to the specification in the way we handle method
25078 * cs-parser.jay (primary_expression): qualified_identifier now
25079 tried to match up an identifier to a local variable reference or
25080 to a parameter reference.
25082 current_local_parameters is now a parser global variable that
25083 points to the current parameters for the block, used during name
25086 (property_declaration): Now creates an implicit `value' argument to
25089 2001-05-09 Miguel de Icaza <miguel@ximian.com>
25091 * parameter.cs: Do not use `param' arguments as part of the
25092 signature, per the spec.
25094 2001-05-08 Miguel de Icaza <miguel@ximian.com>
25096 * decl.cs: Base class for classes, structs and interfaces. This
25097 is the "Declaration Space"
25099 * cs-parser.jay: Use CheckDef for checking declaration errors
25100 instead of having one on each function.
25102 * class.cs: Factor out some code for handling error handling in
25103 accordance to the "Declarations" section in the "Basic Concepts"
25104 chapter in the ECMA C# spec.
25106 * interface.cs: Make all interface member classes derive from
25107 InterfaceMemberBase.
25109 2001-05-07 Miguel de Icaza <miguel@ximian.com>
25111 * Many things: all interfaces are parsed and generated in
25112 gen-treedump. Support for member variables, constructors,
25113 destructors, properties, constants is there.
25115 Beginning of the IL backend, but very little done, just there for
25118 2001-04-29 Miguel de Icaza <miguel@ximian.com>
25120 * cs-parser.jay: Fix labeled statement.
25122 * cs-tokenizer.cs (escape): Escape " and ' always.
25123 ref_line, ref_name: keep track of the line/filename as instructed
25124 by #line by the compiler.
25127 2001-04-27 Miguel de Icaza <miguel@ximian.com>
25129 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25130 to match the values in System.CodeDOM.
25132 Divid renamed to Divide.
25134 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25136 (Statements.set): remove.
25138 * System.CodeDOM/CodeCatchClause.cs: always have a valid
25141 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25142 falseStatements always have valid values.
25144 * cs-parser.jay: Use System.CodeDOM now.