1 2006-03-07 Martin Baulig <martin@ximian.com>
3 * generic.cs (TypeManager.InferType): Allow infering
4 `IEnumerable<T>' with an array of T; see gtest-251.cs.
6 2006-03-06 Martin Baulig <martin@ximian.com>
9 (TypeManager.InferType): Fix gtest-250.cs.
12 (TypeManager.IsSubclassOf): Also check the base class.
15 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
18 2006-03-01 Raja R Harinath <rharinath@novell.com>
21 * expression.cs (ParameterReference.DoResolveBase): Change return
23 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
27 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
30 * typemanager.cs (GetFullNameSignature): Don't nullref on
33 2006-02-16 Martin Baulig <martin@ximian.com>
36 (TypeManager.GetGenericFieldDefinition): New public method; use it
37 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
39 2006-02-14 Martin Baulig <martin@ximian.com>
41 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
43 2006-02-14 Martin Baulig <martin@ximian.com>
46 (TypeManager.DropGenericMethodArguments): New public method; don't
47 use GetGenericMethodDefinition() on something which is not a
50 2006-02-14 Martin Baulig <martin@ximian.com>
53 (ConstraintChecker.CheckConstraints): If a type parameter has the
54 `struct' constraint, the type must be a non-nullable valuetype.
56 2006-02-10 Martin Baulig <martin@ximian.com>
59 (TypeManager.IsOverride): Make this work for instantiated methods
60 in a generic class; fixes #77509.
61 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
62 rather than calling it directly; fixes #77488.
64 2006-02-08 Martin Baulig <martin@ximian.com>
66 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
67 reporting into CheckConstraint() so we can use the correctly
70 2006-02-08 Martin Baulig <martin@ximian.com>
72 * expression.cs (BaseAccess): Add support for generic methods.
74 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
75 the new MethodGroupExpr.
77 2006-02-07 Martin Baulig <martin@ximian.com>
79 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
80 also reference types; fixes #77483.
82 2006-02-07 Martin Baulig <martin@ximian.com>
85 (TypeManager.IsGenericMethod): We now return whether something is
86 an instantiated generic method (and not a generic method def).
87 (TypeManager.IsGenericMethodDefinition): New public method.
90 (TypeManager.CSharpSignature): Only include type arguments for
91 "real" generic methods, not for any instantiated method.
92 (TypeManager.GetMethodName): Likewise, but also allow generic
93 method definitions here.
95 2006-02-06 Miguel de Icaza <miguel@novell.com>
97 * codegen.cs (EmitScopeInitFromBlock): check here the
98 capture_context, there is no need to make two calls to the
101 * anonymous.cs: Add some debugging messages that might help me
102 track other instances of this problem in the future (the
103 regression of test 467).
105 * cs-parser.jay: track the variable block, as we need to initalize
106 any captured variables declared in this block for the "catch"
107 portion of the "Try" statement.
109 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
110 scope initialization for captured variables.
112 Also, move the emit for the variables after the block location has
115 2006-02-06 Marek Safar <marek.safar@seznam.cz>
117 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
119 2006-02-06 Martin Baulig <martin@ximian.com>
121 * class.cs (TypeContainer.DefineType): If we're a struct, pass
122 `TypeManager.value_type' as parent type to
123 ModuleBuilder.DefineType(). Fixes #77358.
125 2006-02-02 Miguel de Icaza <miguel@novell.com>
127 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
128 commit yesterday, the initialization for the roots is necessary.
129 What is not necessary is the scope activation.
131 2006-02-02 Raja R Harinath <rharinath@novell.com>
133 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
134 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
136 (Argument.Resolve): Remove CS0206 checks.
138 2006-02-01 Miguel de Icaza <miguel@novell.com>
140 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
141 scopes for all the roots, the scopes will now be emitted when the
142 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
144 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
145 code. This reduces a lot of existing cruft.
147 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
148 that the ScopeInfo is generated as we enter the scope, not at the
149 time of use, which is what we used to do before.
151 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
152 every time a Block is about to be emitted if we have a
155 2006-02-01 Raja R Harinath <rharinath@novell.com>
157 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
158 attribute for mscorlib too.
160 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
162 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
164 * typemanager.cs (cons_param_array_attribute): Make private.
165 (Reset): Set it to null.
166 (InitCoreHelpers): Don't initialize it.
167 (ConsParamArrayAttribute): New. Initialize it as needed.
168 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
170 2006-01-31 Miguel de Icaza <miguel@novell.com>
172 * expression.cs: There might be errors reported during the
173 selection of applicable methods. If there are errors, do not
174 continue execution as it will lead the compiler to crash.
176 2006-01-30 Miguel de Icaza <miguel@novell.com>
178 * expression.cs: Member access is not allowed on anonymous
179 methods. Fixes #77402.
181 2006-01-30 Raja R Harinath <rharinath@novell.com>
184 * cs-parser.jay (VariableDeclaration): Don't set
185 current_array_type to null.
186 (field_declaration, event_declaration, declaration_statement):
189 2006-01-29 Raja R Harinath <harinath@gmail.com>
192 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
194 2006-01-28 Raja R Harinath <harinath@gmail.com>
196 * typemanager.cs (GenericParameterPosition): New.
199 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
201 * doc.cs : To process "include" elements, first we should create
202 another list than XmlNodeList, because it could result in node
203 removal, which could result in that the XmlNodeList gives up
206 2006-01-25 Miguel de Icaza <miguel@novell.com>
208 * expression.cs: Introduce an error report that we were not
209 catching before. Gonzalo ran into it.
211 2006-01-23 Miguel de Icaza <miguel@novell.com>
213 A fix for bug: #76957
215 * iterators.cs (MoveNextMethod.CreateMethodHost): call
216 ComputeMethodHost before creating the method, this is a new
219 * anonymous.cs (AnonymousContainer): Now we track all the scopes
220 that this method references (RegisterScope). The actual scope
221 where the method is hosted is computed with the ComputeMethodHost
222 before we create the method.
224 Moved the Deepest routine here.
226 (AnonymousContainer.ComputeMethodHost): New routine used to
227 compute the proper ScopeInfo that will host the anonymous method.
229 (ScopeInfo): Deal with multiple roots. The problem was that we
230 did not have a unique root where all ScopeInfos could be hanged
231 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
234 Remove AdjustMethodScope which is now computed at the end. Remove
235 LinkScope which did a partial link, instead link all ScopeInfos
236 before code generation from the new "LinkScopes" routine.
238 Simplify all the Add* routines as they no longer need to maintain
239 the tree, they just need to record that they are using variables
242 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
243 routines to produce the forest of ScopeInfo trees.
245 * class.cs (TypeContainer.AppendMethod): This is just like
246 AddMethod, but ensures that an interface implementation method
247 (IEnumerable.XXX) is not inserted at the beginning of the queue of
248 methods, but at the end.
250 We use this functionality to ensure that the generated MoveNext
251 method in the iterator class is resolved/emitted before the
252 enumerator methods created.
254 This is required because the MoveNext method computes the right
255 ScopeInfo for the method. And the other methods will eventually
256 need to resolve and fetch information computed from the anonymous
260 2006-01-23 Raja R Harinath <rharinath@novell.com>
262 Improve implementation of section 14.4.2.2 (Better function member).
263 * expression.cs (Invocation.MoreSpecific): Compare all type
264 arguments before deciding if one type is more specific than
265 another. Handle array types too. Return the more specific type.
266 (Invocation.BetterFunction): Add more tie-breaking rules from
267 section 14.4.2.2. Perform "more specific" check after
268 other tie-breaking rules. Compare all parameter types before
269 choosing the "more specific" method.
271 2006-01-21 Raja R Harinath <harinath@gmail.com>
272 Carlos Alberto Cortez <calberto.cortez@gmail.com>
275 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
277 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
278 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
280 2006-01-18 Martin Baulig <martin@ximian.com>
282 * class.cs (TypeContainer.AddToMemberContainer): Use
283 `symbol.MemberName.MethodName' instead of just `symbol.Name';
286 2006-01-18 Martin Baulig <martin@ximian.com>
288 Fix #76417: a generic class may now have methods which may unify
289 for some type parameter substitutions.
291 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
292 for methods which may unify anymore.
294 * expression.cs (Invocation.MoreSpecific): New private static
295 method; checks whether one method is more specific than another
296 according to 14.4.2.2 of the spec.
297 (Invocation.BetterFunction): Implement the tie-breaking rules from
298 14.4.2.2 of the spec: if two methods unify for some type parameter
299 substitution, we need to pick the more specific one.
301 2006-01-18 Raja R Harinath <rharinath@novell.com>
303 Fix #76656, cs0231-2.cs.
304 * cs-parser.jay (formal_parameter_list): Make error case catch
306 (parenthesized_expression_0): Add CS1026 check.
307 (invocation_expression): Remove unused { $$ = lexer.Location }.
309 2006-01-17 Raja R Harinath <rharinath@novell.com>
312 * cs-parser.jay (statement_expression): Don't list out the
313 individual statement-expressions. Convert syntax error into
316 2006-01-16 Raja R Harinath <rharinath@novell.com>
319 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
320 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
321 CheckIntermediateModification.
322 (FieldExpr.DoResolve): Add new two-argument version that
323 allows us to resolve the InstanceExpression as an lvalue.
324 The one-argument variant is now just a wrapper.
325 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
326 Resolve the lhs as an lvalue if the it has a value type.
327 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
328 from Assign.DoResolve.
329 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
330 resolved as an lvalue.
331 (PropertyExpr.DoResolve): Update.
332 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
333 has a value type. Move CS1612 check here from
334 CheckIntermediateModification.
335 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
336 * expression.cs (EmptyExpression.OutAccess): New. Used as the
337 'right_side' of a ResolveLValue on an 'out' argument.
338 (EmptyExpression.LValueMemberAccess): New. Used as the
339 'right_side' of a propagated ResolveLValue on a value type.
340 (LocalVariableReference.DoResolveBase): Recognize
341 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
343 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
344 EmptyExpression.Null.
346 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
348 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
349 Type.IsGenericParameter(). Fixed bug #77183.
350 * doc.cs : it is now identical to doc.cs in mcs.
352 2006-01-16 Martin Baulig <martin@ximian.com>
354 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
356 2006-01-16 Martin Baulig <martin@ximian.com>
358 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
361 2006-01-12 Miguel de Icaza <miguel@novell.com>
363 This fixes the problem where we used ldfld instead of ldflda to
364 load the "THIS" pointer on captured parameters, when THIS is a
365 value type. See bug #77205.
367 * iterators.cs (CapturedThisReference.Emit): Pass false to
368 EmitThis (we do not need the address).
370 * codegen.cs (EmitThis): it needs to know whether we need the
371 address of `this' or not. This is used by value types.
373 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
374 every other call passes false.
376 2006-01-12 Raja R Harinath <rharinath@novell.com>
379 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
381 * expression.cs (Invocation.OverloadResolve): Update.
382 (Invocation.DoResolve): Avoid double resolution of invocation.
384 2006-01-11 Raja R Harinath <rharinath@novell.com>
387 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
388 unary negation of floating point types as 0-expr; negation cannot
389 overflow in floating point types.
392 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
393 on operands of 'void' type.
396 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
397 and ExclusiveOr for boolean constants too.
399 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
401 * expression.cs: Fix Console.WriteLine ((this = x).foo);
403 2006-01-12 Miguel de Icaza <miguel@novell.com>
405 * cs-tokenizer.cs (Position): New class used to save and restore
406 the position state in the tokenizer. Before this patch the save
407 and restore was not complete enough so the line and columns would
408 start to drift and the debugger and stack traces will get the
411 2006-01-10 Martin Baulig <martin@ximian.com>
414 (TypeParameter.InflateConstraints): New public method.
416 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
417 constraints; fixes #77042.
419 2006-01-10 Martin Baulig <martin@ximian.com>
421 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
422 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
425 2006-01-09 Raja R Harinath <rharinath@novell.com>
428 * expression.cs (Invocation.OverloadResolve): Replace reflected
429 override methods with their base virtual methods, rather than
431 * typemanager.cs (TypeManager.GetOverride): New.
433 2005-12-21 Miguel de Icaza <miguel@novell.com>
435 * driver.cs: Report the case of no source files and no -out:
438 2005-12-20 Raja R Harinath <rharinath@novell.com>
441 * expression.cs (ComposedCast.GetSignatureForError): Define.
443 2006-01-05 Jb Evain <jbevain@gmail.com>
445 * class.cs (Property.Define, Indexer.Define): do not tag the
446 properties as SpecialName | RTSpecialName.
448 2006-01-04 Miguel de Icaza <miguel@novell.com>
450 * class.cs (MethodCore.IsDuplicateImplementation): This method was
451 doing a low-level comparission of parameter types. It was lacking
452 a check for __argslist.
454 2005-12-30 Miguel de Icaza <miguel@novell.com>
456 * expression.cs (ParameterReference.DoResolveBase): Allow
457 reference parameters if they are local to this block.
459 This allows the ref and out parameters of a delegate to be used in
460 an anonymous method, for example:
462 delegate void set (out int x);
464 set s = delegate (out int x){
468 This is used by functionality introduced late in the C# language.
470 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
471 method that take ref and out parameters.
473 Fixes #77119 which was a late change in the spec.
475 2005-12-23 Miguel de Icaza <miguel@novell.com>
477 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
478 parent if its the same scope. Fixes #77060.
480 2005-12-22 Marek Safar <marek.safar@seznam.cz>
482 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
484 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
486 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
487 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
488 that doesn't contain the full public key. This is a update of the
489 friend assemblies in .Net 2.0 release.
491 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
495 * namespace.cs (NamespaceEntry): Add extern_aliases as a
496 ListDictionary, to contain the ExternAliasEntry entries (in
497 addition to the NamespaceEntry.aliases hashtable). This field is
498 shared between the original entry and its doppelganger (bodyless
500 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
501 extern_aliases field.
502 (NamespaceEntry.Lookup): Move the IsImplicit check after the
503 lookup in extern_aliases.
505 2005-12-16 Raja R Harinath <rharinath@novell.com>
508 * class.cs (TypeContainer.Mark_HasEquals): New.
509 (TypeContainer.Mark_HasGetHashCode): New.
510 (ClassPart): Override them.
511 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
513 * generic.cs (GenericMethod.DefineMembers): Update to changes.
514 (TypeParameter.TypeParameter): Change type of 'parent' argument to
518 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
519 'parent' argument to the base constructor.
521 Remove all mention of TypeContainer from decl.cs.
522 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
523 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
524 (DeclSpace.DeclSpace): Likewise.
525 (DeclSpace.DefineMembers): Remove unused argument.
526 * cs-parser.jay (pop_current_class): Update to changes. Simplify
527 debugging check -- we don't care if the debug code throws an
528 InvalidCastException instead of an InternalErrorException.
529 * class.cs (TypeContainer.DefineMembers): Update to changes.
530 (TypeContainer.DoDefineMembers): Likewise.
531 (TypeContainer.GetMethods): Likewise.
532 (PropertyMember.Define): Likewise.
533 (MemberBase.Parent): New property that forwards to
534 MemberCore.Parent, but ensures that we get a TypeContainer.
535 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
536 (RootContext.PopulateTypes): Likewise. Remove special case code
537 for !RootContext.StdLib: DefineMembers is idempotent.
539 2005-12-13 Marek Safar <marek.safar@seznam.cz>
541 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
543 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
545 * doc.cs : The search for referenced namespace was insufficient to
546 get global one as it used to do. Fixed bug #76965.
548 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
550 * doc.cs : check name in cref in the last phase that whether it is
553 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
555 * cs-tokenizer.cs : reverted the latest change: it somehow broke
558 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
560 * doc.cs : so it turned out that we cannot skip override check for
561 interface members. Fixed bug #76954.
563 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
565 * cs-tokenizer.cs : fixed bug #75984:
566 - #warning and #error should not be handled when the source line
568 - #line is not checked strictly when the source line is disabled.
569 - #define and #undef is on the other hand checked strictly at any
572 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
574 * cs-tokenizer.cs : missing Location (actually, filename) in one of
577 2005-12-15 Raja R Harinath <rharinath@novell.com>
579 * generic.cs (TypeManager.IsGeneric): Remove unused method.
581 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
584 2005-12-14 Martin Baulig <martin@ximian.com>
586 * typemanager.cs (TypeManager.GetFullName): Make this public;
587 `Type.Fullname' now never returns null.
589 * class.cs (Method.Define): Use TypeManager.GetFullName() for
590 explicit interface implementations; we're now using the same
591 naming convention than csc does.
593 2005-12-14 Miguel de Icaza <miguel@novell.com>
595 * convert.cs (ExplicitConversionCore): Check the return value from
596 ExplicitConversionCore which can return null on failure. Fixes #76914
598 2005-12-09 Raja R Harinath <rharinath@novell.com>
600 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
601 instead of IsGenericInstance.
602 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
603 code that's now covered by the more general test.
604 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
606 * generic.cs (DropGenericTypeArguments): New. Captures the common
607 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
608 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
609 * generic.cs, report.cs, typemanager.cs: Likewise.
611 2005-12-08 Martin Baulig <martin@ximian.com>
613 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
615 * typemanager.cs (TypeManager.CSharpSignature): Include type
616 arguments in the signature of a generic method.
618 2005-12-07 Martin Baulig <martin@ximian.com>
620 Add support for custom attributes on type parameters.
622 * cs-parser.jay (type_arguments): Added `opt_attributes'.
624 * generic.cs (TypeParameterName): New public class; we use this
625 instead of a `string' to store the name of a type parameter, so we
626 can also have `Attributes'.
627 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
628 array instead of a `string[]' array.
629 (TypeParameter.ctor): We now also take an `Attributes' argument.
630 (TypeParameter.EmitAttributes): New public method; emit our
631 `OptAttributes' here.
632 (GenericMethod.EmitAttributes): New public method; emit the custom
633 attributes on all our type parameters.
635 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
637 (MethodData.Define): If we're a generic method, call
638 EmitAttributes() on it.
640 2005-12-07 Martin Baulig <martin@ximian.com>
643 (ConstraintChecker): New public abstract class; move the
644 constraint checking here from `ConstructedType' and also do
645 constraint checking for generic methods here.
647 * expression.cs (Invocation.OverloadResolve): Use
648 ConstraintChecker.CheckConstraints() if we resolved to a generic
651 2005-12-05 Marek Safar <marek.safar@seznam.cz>
653 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
655 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
657 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
658 (FieldBase.Initializer): Initializer is now optional.
659 (EventField.Define): Only event field can have initializer.
661 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
663 * const.cs (Const): Reuse initializer.
665 * cs-parser.jay: Updated after FieldBase changes.
666 Added current_array_type to simplify array initializers.
668 * ecore.cs (NullCast.IsDefaultValue): Implemented.
670 * expression.cs, iterators.cs: Updated.
672 * namespace.cs (NamespaceEntry): Made UsingFound private.
674 2005-12-05 Marek Safar <marek.safar@seznam.cz>
676 * parameterCollection.cs: Obsolete, removed.
677 * parser.cs: Obsolete, removed.
679 2005-12-05 Marek Safar <marek.safar@seznam.cz>
682 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
684 * enum.cs (Enum.Define): Set obsolete context here.
686 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
689 - FindDocumentedMember() now expects 1) paramList as null
690 when "we don't have to check the number of parameters" and
691 2) Type.EmptyTypes when "there is no arguments".
692 - Introduced FoundMember struct to hold the exact type which was
693 used to find the documented member (the above change broke
694 test-xml-044; it might be better just to use DeclaringType than
695 what MS does, like this change does, but it depends on usage.)
697 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
699 * doc.cs : documented member might be from DeclaringType for nested
700 types. Fixed bug #76782.
702 2005-12-03 Ben Maurer <bmaurer@ximian.com>
704 * anonymous.cs: Have the param code handle leaving copies on the
705 stack etc. Allows anonymous params to take part in the assignment
706 code (++, +=, etc). Fixes bug #76550
708 * expression.cs: Handle the prepare_for_load/leave_copy by passing
709 it down to the anon code.
711 * iterators.cs: Use dummy var here
713 * codegen.cs: Handle new vars
715 2005-12-01 Marek Safar <marek.safar@seznam.cz>
718 * class.cs (MethodData.Define): Set proper Obsolete context.
720 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
722 (FieldExpr.DoResolve): Ditto.
724 2005-12-01 Marek Safar <marek.safar@seznam.cz>
727 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
728 parent is not obsolete.
730 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
732 * doc.cs : (FindDocumentedMember) find parameterless members first
733 and get CS0419 in the early stage. Fixed first case of bug #76727.
735 2005-11-30 Marek Safar <marek.safar@seznam.cz>
738 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
739 no error was reported.
741 *expression.cs (Binary.DoResolve): left can be null.
743 2005-12-06 Raja R Harinath <rharinath@novell.com>
745 * class.cs (MethodCore.CheckGenericOverride): Delete unused
746 abstract method and all overrides.
747 * support.cs (ParameterData.GenericConstraints): Delete.
748 (ReflectionParameters.type_params): Delete.
749 (ReflectionParameters.ReflectionParameters): Make private.
750 (ReflectionParameters.GetConstaints): New factory method.
751 * generic.cs (TypeParameterDefineType): Use it.
752 (TypeManager.GetTypeParameterConstraints): Likewise.
754 2005-11-22 Marek Safar <marek.safar@seznam.cz>
757 * class.cs (MethodData.Emit): Parameters should be labeled first.
759 2005-11-21 Marek Safar <marek.safar@seznam.cz>
762 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
764 2005-11-18 Marek Safar <marek.safar@seznam.cz>
766 * attribute.cs (AreParametersCompliant): Moved to Parameter.
768 * class.cs (MethodCore): Parameter clean up.
769 (IMethodData): Added ParameterInfo.
770 (MethodData): Parameter clean up.
771 (Indexer.Define): Parameter clean up.
783 * typemanager.cs: Parameter clean up.
785 * delegate.cs (Define): Get rid of duplicated code.
787 * expression.cs (ParameterReference): Removed useless parameters
791 * parameter.cs (ParamsParameter): New class, params specialization.
792 (ArglistParameter): Attemp to separate arglist.
793 (Parameter): Refactored to be reusable and faster.
794 (Parameter.Modifier): Made understandable.
795 (Parameters): Changed to be used as a class for `this' assembly
796 parameters. Refactored to use new specialized classes.
798 * support.cs (ParameterData): Added Types property.
799 (InternalParameters): Deleted.
801 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
803 * doc.cs : the previous patch does not actually fix the bug.
804 PropertyInfo override check is now implemented and really fixed it.
805 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
807 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
809 * doc.cs : apply "override filter" also to properties.
812 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
814 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
815 no need to check overrides. For classes, omit those results from
816 interfaces since they must exist in the class. Fixed bug #76726.
818 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
820 * typemanager.cs : (GetFullNameSignature) differentiate indexers
821 with different parameters. Fixed the second problem in #76685.
823 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
825 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
826 get expected 'protected' access in CheckValidFamilyAccess()).
829 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
831 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
832 Fixed bug #76705. CS1569 was incorrectly commented out.
834 2005-11-23 Martin Baulig <martin@ximian.com>
836 * generic.cs (Constraints.Define): Removed.
837 (TypeParameter.DefineConstraints): Removed.
838 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
839 on the GenericTypeParameterBuilder here.
841 2005-11-23 Martin Baulig <martin@ximian.com>
843 * typemanager.cs (TypeManager.GetProperty): Make this public.
845 * generic.cs (Nullable.NullableInfo.ctor): Use
846 TypeManager.GetProperty() rather than using reflection directly.
848 2005-11-17 Martin Baulig <martin@ximian.com>
850 * expression.cs (Indexers.GetIndexersForType): Added support for
851 generic parameters; fixes #76587.
853 2005-11-17 Martin Baulig <martin@ximian.com>
856 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
857 inherit the scope from our parent. Fixes #76653.
859 2005-11-15 Martin Baulig <martin@ximian.com>
861 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
862 instead of `ScopeTypeBuilder' to refer to the "current" type.
863 (AnonymousMethod.CreateScopeType): Correctly create the helper
864 class if we're inside a generic type definition.
866 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
868 * doc.cs : use Invocation.IsOverride() to do real override check.
869 * expression.cs : made Invocation.IsOverride() internal.
871 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
873 * doc.cs : use TypeManager.FindMembers() instead of (possible)
874 TypeBuilder.FindMembers() and filter overriden base members out.
877 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
879 * doc.cs : ref/out parameters are represented as '@' (instead of
880 '&' in type FullName). Fixed bug #76630 (additionally crefs).
882 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
884 * doc.cs : when there was no '.' in cref to methods in doc comment,
885 then parameters were missing in the output. Fixed bug #76691.
887 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
889 * driver.cs : don't output docs when there is an error.
892 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
895 Now it should detect indexers. Fixed primary concern in bug #76685.
896 Fixed CS0419 message to not show the identical member signature in
899 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
901 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
902 instead of Type.FindMembers() since it does not handle events.
905 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
907 * codegen.cs: Fixed typo (speficied -> specified).
909 2005-11-11 Marek Safar <marek.safar@seznam.cz>
912 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
914 2005-11-11 Marek Safar <marek.safar@seznam.cz>
916 * attribute.cs: Changed error message.
918 * cs-tokenizer.cs: One more check.
920 2005-11-10 Marek Safar <marek.safar@seznam.cz>
922 * statement.cs (Block.Resolve): Ignore empty statement.
924 2005-11-10 Marek Safar <marek.safar@seznam.cz>
926 * report.cs: Made error/warning methods more strict to avoid
929 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
930 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
931 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
932 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
934 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
936 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
937 Use the more explicit AssemblyName.FullName instead of
938 AssemblyName.Name to report errors.
940 2005-11-11 Marek Safar <marek.safar@seznam.cz>
942 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
945 2005-11-10 Marek Safar <marek.safar@seznam.cz>
955 * report.cs: Fixed error reporting and typos.
957 * generic.cs (TypeParameter.GetSignatureForError): New method.
958 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
960 * typemanager.cs (GetFullName): Refactored.
962 2005-11-08 Marek Safar <marek.safar@seznam.cz>
964 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
965 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
967 * class.cs (TypeContainer.IsComImport): New property.
968 (Constructor.Define): Create proper ctor for ComImport types.
970 * expression.cs (New.CheckComImport): Fixed.
972 2005-11-07 Miguel de Icaza <miguel@novell.com>
974 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
975 that a parameter has been captured does not mean that we do not
976 have to do the rest of the processing. This fixes the second part
977 of #76592. If there was another anonymous method capturing
978 values in the past, the Scope would never be set for the second
979 method that captured the same parameter.
981 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
982 properly manipulate the stack. Second part of fix for #76592.
984 * expression.cs (New): Add support for invoking "new" on
985 interfaces that have been flagged with the ComImport attribute and
986 the CoClass. Fixes #76637
988 * statement.cs (Try.DoEmit): When a variable is captured, do not
989 try to emit the vi.LocalBuilder variable as it has been captured.
990 Create a temporary variable and store the results on the
991 FieldBuilder. Fixes #76642
993 2005-11-07 Marek Safar <marek.safar@seznam.cz>
995 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
997 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
999 * expression.cs (Binary.DoResolve): Added && optimalization.
1001 * typemanager.cs (AddUserType): Removed useless argument.
1003 2005-11-04 Marek Safar <marek.safar@seznam.cz>
1005 * statement.cs (Block.variables): Uses ListDictionary.
1007 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1010 * class.cs (PartialContainer.EmitType): Customized to emit
1011 security attributes.
1012 (ClassPart.ApplyAttributeBuilder): Transform security attribute
1013 for partial classes.
1015 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1018 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1019 access has to be fixed.
1021 * typemanager.cs (IsUnmanagedType): Wrong common field type.
1023 2005-11-01 Marek Safar <marek.safar@seznam.cz>
1026 * ecore.cs (NullCast.Reduce): Implemented.
1028 * expression.cs (ArrayCreation.CheckIndices): Correcly check
1031 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1033 (Foreach.Resolve): Catch null properly.
1035 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1037 * cs-tokenizer.cs: Warning text fix.
1039 * driver.cs: AllWarningNumbers exposed on public interface.
1041 * report.cs (): Reviewed warning numbers.
1042 (IsValidWarning): Use binary search.
1044 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1046 * driver.cs: Implemeted resource visibility.
1047 (Resources): New class for code sharing between /res: and
1050 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1052 decl.cs (CurrentTypeParameters): Fixed to be public.
1054 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1056 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1058 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1060 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1062 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
1064 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1066 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1068 Add friend assembly access support.
1069 * typemanager.cs: assembly_internals_vis_attrs
1070 cache for friend assembly access.
1071 (TypeManager.IsFriendAssembly): New method for
1072 checking friend assembly access.
1073 (TypeManager.Error_FriendAccessNameNotMatching): New
1075 (TypeManager.CompareKeyTokens): Likewise.
1076 (TypeManager.Filter): Handle friend accessible
1079 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1080 friend accessible types.
1082 * ecore.cs (Expression.IsAccessorAccessible): Handle
1083 friend accessible properties.
1085 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1088 2005-10-28 Marek Safar <marek.safar@seznam.cz>
1091 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1094 * convert (Convert.ImplicitReferenceConversion): NullCast holds
1097 * ecore.cs (NullCast): Child is contant only.
1099 * literal.cs (NullLiteral.Reduce): null can be converted to any
1102 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
1104 * driver.cs: Use Encoding.Default as default code page instead
1107 2005-10-27 Raja R Harinath <rharinath@novell.com>
1110 * expression.cs (Invocation.Error_InvalidArguments): Handle
1111 __arglist parameters.
1112 (Invocation.VerifyArgumentsCompat): Likewise.
1113 * support.cs (ReflectionParameters.GetSignatureForError): Print
1114 __arglist parameters.
1115 (InternalParamters.GetSignatureForError): Likewise.
1116 * parameter.cs (Parameters.GetSignatureForError): Likewise.
1118 2005-10-26 Marek Safar <marek.safar@seznam.cz>
1120 * attribute.cs (GetPropertyValue): Made public.
1122 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1124 Add new property WrapNonExceptionThrows to handle 2.0 assembly
1126 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1129 * driver.cs: Reflect method name change.
1131 * statement.cs (Try.Resolve): Warn when try has both general
1134 * typemanager.cs: runtime_compatibility_attr_type new predefined
1137 2005-10-26 Raja R Harinath <harinath@gmail.com>
1140 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1141 treat it as an empty parameter list.
1143 2005-10-26 Raja R Harinath <rharinath@novell.com>
1146 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
1147 ResolveAsTypeStep silent.
1148 * statement.cs (Block.AddConstant): Mark block as used.
1149 (Block.ResolveMeta): Avoid piling on error messages
1150 if a constant initializer resolution fails.
1152 2005-10-25 Raja R Harinath <rharinath@novell.com>
1154 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1156 (NamespaceEntry.VerifyAllUsing): New.
1157 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
1158 behaviour. Delegates actual resolution of alias to ...
1159 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
1160 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1162 * driver.cs (Driver.MainDriver): Update.
1164 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1165 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1167 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1169 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1170 RootNamespace.DefineNamespacesForAll.
1172 2005-10-24 Raja R Harinath <harinath@gmail.com>
1174 * typemanager.cs (assemblies, external_aliases, modules)
1175 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1176 (ComputeNamespaces, GetRootNamespace): Remove extra staging
1177 overhead. Move resposibility ...
1178 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
1179 * driver.cs, attribute.cs, codegen.cs: Update to changes.
1181 2005-10-23 Raja R Harinath <harinath@gmail.com>
1183 * namespace.cs (RootNamespace.all_namespaces): Renamed from
1184 cached_namespaces. Improve usage.
1185 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1186 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1187 Move from GlobalRootNamespace and simplify.
1188 (RootNamespace.Global): Make instance variable.
1189 (RootNamespace.RootNamespace): Add "alias name" parameter.
1190 (GlobalRootNamespace): Simplify drastically.
1191 (Namespace.Lookup): Don't use GetNamespace.
1192 * typemanager.cs (GetRootNamespace): Rename from
1193 ComputeNamespaceForAlias.
1194 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1196 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1198 * anonymous.cs (AnonymousContainer): Don't crash when container
1201 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1203 * expression.cs (Binary.DoResolve): Warn when comparing same
1206 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1209 * expression.cs (Binary.DoResolve): It looks like there are no
1210 convetsion rules in enum context.
1212 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1214 Add support for extern alias qualifiers.
1215 * typemanager.cs: Move some LookupTypeReflection code
1216 to namespace.cs, to have cleaner code. Added some methods
1217 to help us keep track of the extern aliased references.
1218 * driver.cs: Add suport for extern alias assemblies on command
1219 line and check for their warnings/errors. Also keep track of the
1220 extern aliased assemblies.
1221 * namespace.cs: Move the global functionality of Namespace
1222 to GlobalRootNamespace/RootNamespace. Now the global namespace
1223 is GlobalRootNamespace.Globa. Also the code moved from
1224 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
1225 Finally added LocalAliasEntry (AliasEntry before) and
1226 ExternAliasEntry, to handle alias statements.
1227 * cs-parser.jay: Add support in the grammar for extern alias
1229 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
1230 Update callings to Namespace (now in GlobalRootNamespace).
1232 2005-10-25 Martin Baulig <martin@ximian.com>
1234 * convert.cs (ImplicitTypeParameterConversion): Make base
1235 interfaces actually work; fixes #76557.
1237 2005-10-25 Martin Baulig <martin@ximian.com>
1240 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1241 all the type parameters; fixes #76551.
1243 2005-10-25 Martin Baulig <martin@ximian.com>
1248 (GenericMethod.ctor): Added `Expression return_type' and
1249 `Parameters parameters' arguments.
1250 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1251 parameter and return types to check their constraints if they're
1254 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1257 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1258 constraints of a generic type if `ec.ResolvingGenericMethod'.
1260 * class.cs (MethodCore.DoDefineParameters): Set
1261 `ec.ResolvingGenericMethod' if we're a generic method.
1262 (MemberBase.MemberType): Likewise.
1264 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1266 * typemanager.cs (TypeManager): Added
1267 TypeManager.internals_visible_attr_type to cache
1268 S.R.CompilerServices.InternalsVisibleToAttribute.
1270 * codegen.cs (AssemblyClass): Added checks for
1271 InternalsVisibleToAttribute in new method
1272 CheckInternalsVisibleAttribute () and also cache the
1273 AssemblyName in AssemblyClass.Name.
1275 2005-10-24 Martin Baulig <martin@ximian.com>
1278 (TypeManager.ExpandInterfaces): Added overloaded version which
1279 just takes a `Type[]' array.
1282 (Constraints.Resolve): Don't expand the interfaces here; ie. we
1283 just use the interfaces which were explicitly specified and not
1284 the interfaces they inherit. Fixes #76482.
1285 (TypeParameter.FindMembers): Expand the interfaces here.
1287 2005-10-21 Martin Baulig <martin@ximian.com>
1290 (Constraints.Resolve): Also resolve the actual types here.
1291 (Constraints.ResolveTypes): Just check the constraints here.
1292 Fixes #76363; see gtest-218.cs.
1294 2005-10-21 Martin Baulig <martin@ximian.com>
1297 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1298 instead of a `BoxedCast'; fixes gtest-217.cs.
1300 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
1302 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1303 1) "new()" is specified as generic parameter constraint and 2) the
1304 type is TypeBuilder and 3) the type is abstract even if it has a
1305 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1307 2005-10-20 Martin Baulig <martin@ximian.com>
1310 (GenericConstraints.TypeParameter): New public property.
1311 (TypeParameter.ctor): Also take a `DeclSpace' argument.
1312 (TypeParameter.DeclSpace): New public property.
1313 (TypeParameter.DefineType): Inflate the constraints if our
1314 `DeclSpace' is an `Iterator'.
1316 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
1318 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
1319 GenericMethod argument to compare methods' generic type arguments.
1322 2005-10-19 Martin Baulig <martin@ximian.com>
1324 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1325 not ResolveType() when resolving the base type, so we're not
1326 checking the constraints here.
1327 (TypeContainer.ResolveType): Call ResolveType() on our base_type
1330 2005-10-19 Martin Baulig <martin@ximian.com>
1332 * generic.cs (ConstructedType.CheckConstraints): Committing
1333 untested fix for #76441.
1335 2005-10-18 Raja R Harinath <rharinath@novell.com>
1338 * class.cs (TypeContainer.DefineType): Move updating of
1339 topological sort earlier in the code.
1340 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1342 2005-10-18 Marek Safar <marek.safar@seznam.cz>
1345 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1347 * constant.cs (Constant.TryReduce): Moved from Cast class.
1348 (Reduce): Made little bit more OO and fixed missing conversions.
1350 * ecore.cs (Reduce): Implemented.
1351 (Binary.EnumLiftUp): New method to upgrade values to enum values.
1353 * literal.cs (Reduce): Implemented.
1355 * class.cs: Reverted Miguel's wrong commit.
1357 2005-10-14 Miguel de Icaza <miguel@novell.com>
1359 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1361 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
1363 * cs-parser.jay, expression.cs : CS0214 was missing error location
1364 for constants. Fixed bug #76404.
1366 2005-10-10 Raja R Harinath <rharinath@novell.com>
1368 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1370 (PropertyExpr.EmitCall): Likewise.
1371 * expression.cs (Invocation.EmitArguments): Handle case where
1373 (Invocation.EmitCall): Avoid allocating temporary variable if
1374 there are no arguments.
1376 2005-10-11 Marek Safar <marek.safar@seznam.cz>
1379 * convert.cs (ExplicitConversionCore): Fixed object->enum
1382 2005-10-07 Raja R Harinath <rharinath@novell.com>
1385 * convert.cs (ImplicitConversionStandard): Move conversion of
1386 void* to arbitrary pointer types ...
1387 (ExplicitConversionStandard): .. here.
1388 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1389 error to always print typenames.
1391 2005-10-07 Raja R Harinath <rharinath@novell.com>
1393 * convert.cs (GetConversionOperator): Rename from
1394 GetConversionOperators. Move operator selection code from ...
1395 (UserDefinedConversion): ... here.
1397 2005-10-06 Marek Safar <marek.safar@seznam.cz>
1399 * convert.cs (ExplicitConversionCore): Removed duplicate enum
1402 2005-10-05 Marek Safar <marek.safar@seznam.cz>
1404 * assign.cs (Assign.DoResolve): Error method changed.
1406 * cfold.cs (DoConstantNumericPromotions): Error method changed.
1408 * const.cs (ResolveValue): Reset in_transit immediately.
1410 * constant.cs: Error method changed.
1412 * convert.cs: Removed useless location parameter.
1413 (ExplicitNumericConversion): Don't do double enum check.
1414 (ExplicitConversionCore): Renamed from ExplicitConversion.
1415 (ExplicitUnsafe): Extracted from ExplicitConversion.
1416 (ExplicitConversion): Uses for error reporting.
1418 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
1420 (ResolveBoolean): Uses common error method.
1421 (CastToDecimal): Get rid of ec.
1422 (CastFromDecimal): Optimized.
1423 (ConvCast): Get rid of ec.
1425 * enum.cs (ResolveValue): Reset in_transit immediately.
1426 (Emit): Return after first error.
1428 * expression.cs: Convert changes.
1430 * literal.cs: Error method changed.
1432 * statement.cs: Error method changed.
1434 2005-10-06 Raja R Harinath <rharinath@novell.com>
1436 Fix gtest-131.cs and gtest-211.cs.
1437 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
1438 Only emit code for a label if it is used. Unreachable code can
1439 violate ECMA evaluation stack invariants.
1441 2005-09-27 Marek Safar <marek.safar@seznam.cz>
1443 * anonymous.cs: Implemented ExprClassName.
1445 * assign.cs (Assign.DoResolve): Don't chrash when type is not
1448 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
1451 * class.cs (StaticClass.DefineContainerMembers): Report protected
1454 * codegen.cs: if(ed) PRODUCTION.
1456 * convert.cs (Error_CannotImplicitConversion): Better error
1459 * cs-parser.jay: More error checks.
1461 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
1463 * driver.cs (CSCParseOption): Enabled wrong option check.
1465 * ecore.cs (Expression.ExprClassName): Turned to property.
1466 (MemberExpr.CheckIntermediateModification): For checking boxed
1467 value types modification.
1469 * statement.cs (Fixed.Resolve): Expression type must be
1470 convertible to fixed type.
1471 (CollectionForeach.GetEnumeratorFilter,TryType):
1472 Small refactoring for easier error checking.
1474 2005-09-26 Marek Safar <marek.safar@seznam.cz>
1476 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
1479 * class.cs (GeneratedBaseInitializer): New class for customization
1480 compiler generated initializers.
1481 (MemberBase.DoDefine): Check Obsolete attribute here.
1482 (FieldMember.DoDefine): Ditto.
1484 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1487 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1488 (MemberCore.GetObsoleteAttribute): Removed argument.
1489 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1490 (MemberCore.CheckObsoleteType): New helper.
1494 * statement.cs: Updates after MemberCore changes.
1496 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1497 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1499 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1500 obsolete attribute for compiler construct.
1501 (As.DoResolve): Cache result.
1503 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1505 2005-10-01 Miguel de Icaza <miguel@novell.com>
1507 * expression.cs (Probe): instead of having a "Type probe_type"
1508 keep the extra information as a TypeExpr probe_type_expr since the
1509 "As" operator needs to perform some type checks.
1511 * (As.DoResolve): If the type is a type parameter, ensure that it
1512 is constrained by a class.
1514 2005-09-22 Miguel de Icaza <miguel@novell.com>
1516 * statement.cs (Lock): Use the TemporaryVariable class instead of
1517 manually using local variables as those do not work when variables
1520 * ecore.cs: Moved the TemporaryVariable class from being a nested
1521 class inside Foreach to be a public class that can be employed in
1524 2005-09-19 Marek Safar <marek.safar@seznam.cz>
1526 * cs-parser.jay: interface_accessors replaced by
1527 accessor_declarations.
1529 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1532 * statement.cs (GotoCase.Resolve): Convert null constant to
1534 (SwitchLabel.ResolveAndReduce): Ditto.
1535 (SwitchLabel.NullStringCase): Custom null stamp.
1536 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1538 typemanager.cs (CSharpSignature): Don't skip first argument
1541 2005-09-16 Marek Safar <marek.safar@seznam.cz>
1543 * cfold.cs, constant.cs, convert.cs, ecore.cs,
1544 expression.cs, iterators.cs, literal.cs: Store constants and
1547 * class.cs (MemberBase.ShortName): Pass location.
1549 * cs-parser.jay: Some location fixes.
1551 * ecore.cs (Expression.Location): Made virtual.
1553 2005-09-27 Marek Safar <marek.safar@seznam.cz>
1556 * const.cs (Const.ResolveValue): Check for assigning non-null
1557 value to reference type.
1559 2005-09-26 Raja R Harinath <rharinath@novell.com>
1562 * expression.cs (This.VerifyFixed): In a value type T, the type of
1563 'this' is T&, iow, 'this' is either an out or ref parameter. In a
1564 value type R, 'this' is treated as a value parameter.
1566 2005-09-05 Miguel de Icaza <miguel@novell.com>
1568 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1569 if the underlying types are the same, otherwise we need to produce
1570 code that will do the proper cast.
1572 This was exposed by Marek's constant rewrite which produced
1573 invalid code for the call site:
1576 void Method (X v) {}
1580 This fixes test-49.cs
1582 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1584 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1585 Type/Object should be allowed as well. Fixed bug #75968.
1587 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1589 * expression.cs : (Binary.DoResolve): when one is enum constant and
1590 another is constant 0, then return enum one *as enum type*.
1593 2005-10-04 Martin Baulig <martin@ximian.com>
1595 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
1596 `SetMemberIsUsed()' work for generics, too.
1598 2005-10-04 Martin Baulig <martin@ximian.com>
1600 * expression.cs (DelegateInvocation.EmitStatement): Make this work
1601 for corlib. Fixes #75691.
1603 2005-09-28 Marek Safar <marek.safar@seznam.cz>
1606 * driver.cs: Fix compilation files with full root path.
1608 2005-09-25 Miguel de Icaza <miguel@novell.com>
1610 * report.cs (SymbolRelatedToPreviousError): Format the output so
1611 it does not use an open parenthesis that is never closed.
1613 * driver.cs: Follow coding guidelines
1615 2005-09-18 Miguel de Icaza <miguel@novell.com>
1617 * driver.cs: Set InEmacs based on the environment variable EMACS.
1619 * location.cs (InEmacs): in this mode, do not report column
1620 location as it confuses Emacs.
1622 2005-10-03 Raja R Harinath <rharinath@novell.com>
1624 * support.cs (SeekableStreamReader.Position): Don't error out when
1625 the requested position is just beyond the end of the current
1628 2005-09-28 Raja R Harinath <rharinath@novell.com>
1630 * support.cs (SeekableStreamReader): Simplify drastically. Don't
1631 try to keep in sync with the byte count of the underlying Stream.
1632 However, this limits us to a window size of 2048 characters: i.e.,
1633 the maximum lookahead of our lexer/parser can be 2048 characters.
1635 2005-09-22 Martin Baulig <martin@ximian.com>
1637 * driver.cs: Removed a debugging FIXME.
1639 2005-09-21 Raja R Harinath <rharinath@novell.com>
1641 * cs-parser.jay (type_arguments): Add CS1644 check.
1642 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
1644 2005-09-15 Raja R Harinath <rharinath@novell.com>
1646 * Makefile (PROGRAM): Make profile specific.
1647 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
1648 the current directory.
1651 * expression.cs (Invocation.EmitCall): Remove optimization on
1652 this_call since it doesn't handle 'this' being a value type.
1654 2005-09-05 Geoff Norton <gnorton@customerdna.com>
1656 * driver.cs: Ensure file handles are closed after parsing
1658 2005-09-05 Miguel de Icaza <miguel@novell.com>
1660 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1661 if the underlying types are the same, otherwise we need to produce
1662 code that will do the proper cast.
1664 This was exposed by Marek's constant rewrite which produced
1665 invalid code for the call site:
1668 void Method (X v) {}
1672 This fixes test-49.cs
1674 2005-09-05 Martin Baulig <martin@ximian.com>
1676 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
1677 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
1679 * cs-parser.jay (delegate_declaration): Small fix for #75852.
1681 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1683 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
1684 to be a pointer type due to the spec 25.2, so check if declaring
1685 type is generic type definition. Fixed bug #75772.
1687 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1690 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
1691 both types are not defined by methods.
1692 * expression.cs : (Invocation.IsApplicable): it should work when
1693 the argument type is equal to the parameter type, not only when
1694 ImplicitConversionExists() returns true.
1696 2005-09-02 Raja R Harinath <rharinath@novell.com>
1698 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
1702 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
1703 flow-branching for LocalVariableReferences in case we were invoked
1704 from a MemberAccess.
1705 * expression.cs (LocalVariableReference.VerifyAssigned): New.
1707 (LocalVariableReference.DoResolveBase): ... this.
1708 (MemberAccess.Resolve): Do the check that was disabled during
1711 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
1714 (PartialContainer.Create): check abstract/sealed/static strictly
1715 but abstract/sealed can exist only at one side. Fixed bug #75883.
1717 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
1720 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
1721 specified, don't default to UnmanagedType.I4.
1723 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
1725 * expression.cs : conditional operator should check possibly
1726 incorrect assign expression. Fixed bug #75946.
1728 2005-08-30 Raja R Harinath <rharinath@novell.com>
1731 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
1732 (ScopeInfo.EmitScopeType): Use it to construct field names from
1733 names of captured locals.
1736 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
1737 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
1738 Pass 'target_type' to BoxedCast. Don't default to 'object'.
1739 (ExplicitConversion): Remove enum cases already handled by
1740 implicit conversion. Move implicit conversion check to the beginning.
1741 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
1742 * expression.cs (ArrayCreation.EmitDynamicInitializers):
1743 Don't treat System.Enum as a struct.
1745 2005-08-30 Jb Evain <jbevain@gmail.com>
1747 * attribute.cs: handles as expression in parameters.
1749 2005-08-30 Raja R Harinath <rharinath@novell.com>
1752 * class.cs (TypeContainer.VerifyClsName): Don't use a
1753 PartialContainer when verifying CLS compliance.
1754 (AbstractPropertyEventMethod): Set Parent here, ...
1755 (PropertyMethod): ... not here.
1757 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
1759 * attribute.cs : escaped attribute name should not be allowed to be
1760 resolved (e.g. @class as classAttribute). Fixed bug #75930.
1762 2005-08-29 Raja R Harinath <rharinath@novell.com>
1765 * convert.cs (ImplicitStandardConversionExists): Allow zero also
1766 when converting a long constant to unsigned long.
1767 * expression.cs (Invocation.OverloadResolve): Add sanity check to
1768 detect where IsApplicable and VerifyArgumentsCompat disagree.
1770 2005-08-29 Raja R Harinath <rharinath@novell.com>
1771 and Carlos Alberto Cortez <carlos@unixmexico.org>
1774 * class.cs (TypeContainer.CanElideInitializer): New helper.
1775 (TypeContainer.EmitFieldInitializers): Use it to determine if we
1776 can safely emitting the initializer of a field.
1778 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1780 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
1781 allowed inside a switch (without loop). Fixed bug #75433.
1783 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
1785 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1786 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1788 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1790 * driver.cs : kinda reverting the default encoding changes (not exact
1791 revert since I noticed that "codepage:reset" might not work fine).
1793 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1795 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
1796 Location. Now getter and setter store location correctly.
1797 (errors/cs0111-12.cs now reports the expected location.)
1799 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1801 * driver.cs : Use default encoding on the environment.
1802 Removed (now that) extra parameter for SeekableStreamReader.
1803 * support.cs : (SeekableStreamReader) third .ctor() argument for
1804 StreamReader is not required (always true). preamble size could
1805 be acquired in simpler and safe way.
1807 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
1809 * cs-parser.jay: report CS0642 at warning level 3
1810 and report CS0642 for an if else statement also
1811 fixes bug #74745. Patch by John Luke (and a bit
1813 Removed extra CS0642 warning check for "while",
1815 * statement.cs: In Block.Resolve(), CS0642 check
1816 is reimplemented to check a sequence of an empty
1817 statement and a block.
1819 Both fix bug #66777.
1821 2005-08-24 Marek Safar <marek.safar@seznam.cz>
1823 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
1824 detection until I fix it.
1826 * cs-tokenizer.cs: Changed error message.
1828 * cs-parser.jay: Fixed 2 error locations.
1830 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
1831 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
1834 * enum.cs (GetSignatureForError): Fixed.
1836 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
1840 * typemanager.cs (RegisterProperty): Removed.
1842 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
1844 2005-08-24 Raja R Harinath <rharinath@novell.com>
1847 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
1848 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
1850 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1852 * expression.cs : tiny fix is required for not warning positive ulong.
1855 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1857 * expression.cs : add CS0652 check for constant and integral
1858 expression. Fixed bug #53974.
1860 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1862 * expression.cs : in DoNumericPromotions(), check if there is implicit
1863 conversion overload for string (to check CS0034). Fixed bug #52492.
1865 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1867 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
1869 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1871 * ecore.cs : report location when it is *not* Null.
1873 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1879 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
1880 correctly. Fixed bug #75721.
1882 2005-08-23 Raja R Harinath <rharinath@novell.com>
1884 * support.cs (SeekableStreamReader.Position): Avoid an expensive
1885 loop that performs 'min (pos, char_count)'.
1888 * expression.cs (Unary.ResolveOperator): Don't discard implicit
1889 converted value in Operator.OnesComplement.
1891 2005-08-22 Ben Maurer <bmaurer@ximian.com>
1893 * anonymous.cs: If the anon method is pulled into a helper class,
1894 it needs to be `internal' not `private'. Fixes runtime behavior on
1897 2005-08-17 Marek Safar <marek.safar@seznam.cz>
1900 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
1903 2005-08-16 Marek Safar <marek.safar@seznam.cz>
1905 The big constants rewrite
1906 Fix #75746, #75685 and more
1907 As a side effect saved 1MB for MWF ;-)
1909 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
1910 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
1911 enum based for corlib compilation.
1913 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
1916 * class.cs (FixedField.Define): Use ResolveAsConstant.
1918 * const.cs (IConstant): Interface constants and enums.
1919 (Const.ResolveValue): New method for constant resolvning.
1920 (ExternalConstant): Constants from imported assemblies.
1922 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
1923 conversion; like enums.
1924 (Constant.ToType): Converts this constant to different type.
1925 (Constant.Increment): Adds 1.
1927 * convert.cs (ImplicitConversionRequired): Simplified.
1929 * cs-parser.jay: Create EnumMember directly.
1931 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
1933 * doc.cs (GenerateEnumDocComment): Removed.
1935 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
1936 (ConvertIntLiteral): Removed.
1937 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
1939 * enum.cs (EnumMember): Implement IConstant.
1940 (Enum.IsValidEnumConstant): Removed.
1941 (Enum.GetNextDefaultValue): Removed.
1942 (Enum.FindMembers): Updated.
1943 (Enum.GenerateDocComment): Iterate enum members.
1945 * expression.cs (Cast.TryReduce): Handle enums correctly.
1946 (New.Constantify): Made public.
1947 (MemberAccess.DoResolve): Removed contant specific if(s).
1949 * literal.cs (NullLiteral): Implement new abstract methods.
1951 * statement.cs (GotoCase.Resolve): Use new constant methods.
1952 (SwitchLabel.ResolveAndReduce): Use new constant methods.
1954 * typemanager.cs (LookupEnum): Removed.
1955 (IsEnumType): Fixed to work with corlib.
1956 (RegisterConstant): Removed.
1957 (LookupConstant): Removed.
1958 (GetConstant): Changed to work with IConstant.
1960 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
1962 * location.cs : Fixed overflown (>255) column number.
1964 2005-08-03 Raja R Harinath <rharinath@novell.com>
1966 First cut of the qualified-alias-member feature.
1967 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1969 * cs-parser.jay (DOUBLE_COLON): New token.
1970 (namespace_or_type_name): Add rule for recognizing
1971 qualified-alias-members.
1972 (primary_expression): Likewise.
1973 (element_access): Allow QualifiedAliasMember as a possible
1974 type-bearing expression.
1975 (local_variable_type, local_variable_pointer_type): Likewise.
1976 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
1977 aliases in the current and enclosing namespace declarations.
1978 (NamespaceEntry.UsingAlias): Add CS0440 warning.
1979 * decl.cs (MemberName.is_double_colon): New.
1980 (MemberName.MemberName): Add new constructor for alias-member.
1981 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
1982 * expression.cs (QualifiedAliasMember): New expression type.
1984 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1986 * location.cs : it borked when no argument was specified.
1988 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1990 * location.cs : tiny ToString() format fix.
1992 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1994 * statement.cs : oops, it was missing.
1996 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1998 A set of fixes for precise line/column location.
2001 "token" field now holds a file/line "delta", a line number offset
2002 from the segment, and a column number. See also:
2003 http://lists.ximian.com/pipermail/mono-devel-list/2004-
2004 December/009508.html
2005 Removed static IsNull. Use instance IsNull property instead.
2007 For some tokens it stores Location. For Identifier it stores
2008 LocatedToken which is a pair of string name and location.
2009 Column numbers are adjusted only at getChar().
2011 Use Location.ToString() for reporting (it now contains column).
2013 Largely modified to use LocatedToken instead of
2014 string (IDENTIFIER), and to acquire Location from some tokens.
2015 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2016 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2018 Now MemberName holds Location. DeclSpace.ctor() receives Location
2019 as a parameter. Removed extra parameters to all derived classes.
2020 Replaced Location.IsNull() with instance property.
2021 * assign.cs, expression.cs :
2022 Added .ctor() overload that omits Location.
2024 Added "nameEscaped" flag that indicates the identifier was escaped
2025 in the source file. This fixes bug #57047.
2027 2005-09-02 Martin Baulig <martin@ximian.com>
2029 * class.cs: Make CS3005 a warning, not an error.
2031 2005-08-02 Marek Safar <marek.safar@seznam.cz>
2033 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2034 New method, looking for lo-case imported cls type.
2036 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2039 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2041 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2043 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2045 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2047 Optimized to save 3.5 MB for SWF compilation.
2049 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2051 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2052 (PartialContainer.Create): Moved logic AddToContainer.
2053 (PartialContainer.MarkForDuplicationCheck): Shares name.
2055 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2058 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2060 (Namespace.GetSignatureForError): New method.
2062 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2063 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2065 2005-08-01 Raja R Harinath <rharinath@novell.com>
2068 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2069 member lookup rather than qualifier_type, since qualifier_type can
2072 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2074 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2077 2005-07-31 Miguel de Icaza <miguel@novell.com>
2079 * statement.cs: Copy the local exception into the exception
2080 captured local. Fixes 75674
2082 2005-07-31 Raja R Harinath <harinath@gmail.com>
2085 * expression.cs (Invocation.OverloadResolve): Don't report error
2086 CS1501 if error CS1502 has been reported.
2087 (New.DoResolve): Delegate CS1501 reporting to
2088 Invocation.OverloadResolve.
2091 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2092 invariant-meaning-in-block property in an enclosing block if
2095 2005-07-29 Marek Safar <marek.safar@seznam.cz>
2097 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2098 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2099 (Switch.CheckSwitch): Just save 50kb for SWF.
2101 2005-07-27 Martin Baulig <martin@ximian.com>
2103 * anonymous.cs (CaptureContext.AddField): Added
2104 `AnonymousContainer am' argument; compute its toplevel scope if
2105 it's not already computed. Fixes #75649.
2107 2005-07-26 Raja R Harinath <rharinath@novell.com>
2110 * class.cs (Constructor.Emit): Reset block to null if the block
2113 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2115 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2117 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2119 * class.cs (MethodData.Define): Check whether accessor implementing
2120 interface is public.
2122 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2124 2005-07-22 Marek Safar <marek.safar@seznam.cz>
2127 * namespace.cs (LookupType): Moved same type check to...
2129 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2132 2005-07-21 Raja R Harinath <rharinath@novell.com>
2134 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2135 already found a typebuilder.
2136 * class.cs (MethodCore.IsDuplicateImplementation): Compare
2137 MemberNames, not strings.
2139 * const.cs (Error_ExpressionMustBeConst):
2140 Rename from Error_EpressionMustBeConst.
2141 * const.cs, class.cs, statement.cd: Update.
2143 2005-07-21 Marek Safar <marek.safar@seznam.cz>
2147 * const.cs (Const.LookupConstantValue): Report missing contant expression
2149 (Error_EpressionMustBeConstant): Only one error method.
2151 * class.cs, statement.c: Updated.
2153 2005-07-20 Raja R Harinath <rharinath@novell.com>
2155 * statement.cs (Block.Flags): Add back HasVarargs.
2156 (Block.flags): Make protected.
2157 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2159 * typemanager.cs (types, typecontainers, user_types): Remove.
2160 (UserTypes, TypeContainers): Likewise.
2161 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2162 (CleanUp, Reset): Update.
2163 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
2164 (GetNestedType): Use Type.GetNestedType.
2165 (CoreLookupType): Take two arguments, the namespace and the
2166 basename of the type. Update to use the Namespace.Lookup
2168 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2169 (RealMemberLookup): Use IsNestedChildOf instead of playing with
2170 string concatenation and substring matches.
2171 * class.cs, enum.cs, delegate.cs: Update to changes.
2173 2005-07-20 Marek Safar <marek.safar@seznam.cz>
2175 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2176 Expression and made virtual.
2178 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2179 (ImplicitStandardConversionExists): Fixed `byte' typo ?
2181 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2183 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2186 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2189 2005-07-18 Marek Safar <marek.safar@seznam.cz>
2192 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2193 AssemblyCultureAttribute is not used on executable.
2196 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2198 2005-07-16 Raja R Harinath <rharinath@novell.com>
2201 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2202 New. Reports CS0252/CS0253.
2203 Mostly taken from preliminary patch by Duncak Mak.
2204 (Binary.DoResolveOperator): Store results of operator lookup.
2205 Use them to detect if we need to warn about unintended reference
2208 2005-07-15 Raja R Harinath <rharinath@novell.com>
2211 * namespace.cs (Namespace.Lookup): Add back location parameter.
2212 (Namespace.LookupType): Add CS0436 report. Add location parameter.
2213 * delegate.cs, ecore.cs, expression.cs: Update to changes.
2215 * codegen.cs (EmitContext.DeclSpace): Make readonly.
2216 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2217 (Namespace.LookupType): ... this.
2218 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2220 * typemanager.cs (LookupTypeReflection): Remove buggy code that
2221 purported to handle pointers.
2222 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2225 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2227 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2230 2005-07-15 Raja R Harinath <rharinath@novell.com>
2232 * namespace.cs (Namespace.Lookup): Drop location parameter.
2233 (NamespaceEntry.LookupAlias): Remove. Merge into ...
2234 (NamespaceEntry.Lookup): ... this.
2235 (NamespaceEntry.Error_AmbiguousTypeReference):
2236 Move here from DeclSpace.
2237 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2239 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2240 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2241 Move to NamespaceEntry.
2242 * delegate.cs, expression.cs: Update to changes.
2244 2005-08-31 Martin Baulig <martin@ximian.com>
2246 Committing a patch from Atsushi Enomoto for #75850.
2248 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2249 Prefer a generic enumerator over a non-generic one.
2251 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2253 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2254 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2256 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2258 * driver.cs : reverting default encoding change as well as mcs.
2260 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2262 * driver.cs, support.cs : merged r48826.
2264 > could you integrate your mcs changes to gmcs otherwise
2265 > gmcs cannot compile some files.
2267 2005-08-20 Martin Baulig <martin@ximian.com>
2269 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2270 scope if we don't already have it.
2272 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2273 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2276 2005-07-31 Miguel de Icaza <miguel@novell.com>
2278 * statement.cs: Copy the local exception into the exception
2279 captured local. Fixes 75674
2281 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2283 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2286 2005-08-12 Martin Baulig <martin@ximian.com>
2288 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2289 for nested types here to avoid hitting the cache too early.
2291 2005-08-09 Miguel de Icaza <miguel@novell.com>
2293 * enum.cs: On the new compiler CLS error 3005 is now a warning not
2296 2005-08-03 Martin Baulig <martin@ximian.com>
2298 Make iterators in generic methods work; see gtest-191.cs.
2301 (Constraints.Resolve): Protect against being called twice.
2304 (TypeContainer.GetClassBases): Make this `protected virtual'.
2306 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2307 (Iterator.GetClassBases): Override this and compute the base
2309 (Iterator.DefineNestedTypes): If we're a generic method, all our
2310 method type parameters become class type parameters on the proxy
2314 (ToplevelBlock.Parameters): Make this a property, not a field.
2315 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2317 2005-08-03 Martin Baulig <martin@ximian.com>
2319 * typemanager.cs (TypeManager.IsSubclassOf): Use
2320 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2321 (TypeManager.GetFullName_recursed): Improved.
2323 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2326 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2327 Private accessor case, using TypeManager.IsPrivateAccessible instead of
2328 invocation_type == mi.DeclaringType, since the first one also checks
2329 other condition used by generic instances.
2331 2005-07-27 Martin Baulig <martin@ximian.com>
2333 * anonymous.cs (CaptureContext.AddField): Added
2334 `AnonymousContainer am' argument; compute its toplevel scope if
2335 it's not already computed. Fixes #75649.
2337 2005-07-14 Marek Safar <marek.safar@seznam.cz>
2339 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2340 CheckAttributeType and refactored.
2341 (Attribute.ResolvePossibleAttributeType): Changed to reuse
2342 ResolveAsTypeTerminal error handling.
2343 (ResolveAsTypeTerminal): Introduced because of global attributes extra
2345 (GetSignatureForError): Print errors in same way.
2348 * codegen.cs: Reflect attribute GetSignatureForError change.
2351 * expression.cs: Add silent parameter to ResolveAsTypeStep.
2353 * namespace.cs (UsingEntry): Refactored to make fields private.
2356 statement.cs: Error_UnexpectedKind has extra parameter.
2358 2005-07-14 Raja R Harinath <rharinath@novell.com>
2360 * ecore.cs (IAlias): Remove.
2361 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
2362 that implement the interface.
2363 * namespace.cs (Namespace): Likewise.
2364 (Namespace.declspaces): Renamed from 'defined_names'.
2365 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
2366 DeclSpace instead of an IAlias.
2367 * tree.cs (Tree.AddDecl): Update.
2369 2005-07-12 Raja R Harinath <rharinath@novell.com>
2371 * statement.cs (Block.Flags); Remove HasVarargs.
2372 (Block.HasVarargs): Move to ToplevelBlock.
2373 (Block.ThisVariable, Block.AddThisVariable): Likewise.
2374 (Block.Variables): Make protected. Initialize variable hashtable
2376 (Block.AddVariable): Update.
2377 (Block.Resolve): Update to changes.
2378 (ToplevelBlock.HasVarargs): New boolean.
2379 (ToplevelBlock.ThisVariable): Move here from Block.
2380 (ToplevelBlock.AddThisVariable): Likewise.
2381 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
2382 * expression.cs (This.ResolveBase): Update to changes.
2383 (ArglistAccess.DoResolve): Likewise.
2385 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2388 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2390 * class.cs (TypeContainer.VerifyMembers): Distinguish between
2391 not used and not used & assigned.
2392 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2394 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2397 * expression.cs (Is.DoResolve): null is never provided type.
2399 2005-07-08 Marek Safar <marek.safar@seznam.cz>
2402 * cs-parser.jay: Less strict event error rule to catch more errors.
2404 2005-07-11 Martin Baulig <martin@ximian.com>
2406 * generic.cs (ConstructedType.CheckConstraints): Improve the check
2407 for the constructor constraint: we do not only have to check
2408 whether the class has a public constructor, but also ensure that
2409 it's parameterless. Fixes #75492.
2411 2005-07-11 Martin Baulig <martin@ximian.com>
2413 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
2414 between type parameters if they either have the reference type
2415 constraint or the class constraint.
2417 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
2419 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
2421 2005-07-07 Marek Safar <marek.safar@seznam.cz>
2424 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2425 (ExtractSecurityPermissionSet): Cope with self referencing security
2426 attributes properly.
2428 * driver.cs (SetOutputFile): Made public property OutputFile.
2430 2005-07-07 Raja R Harinath <rharinath@novell.com>
2433 * class.cs (TypeContainer.first_nonstatic_field): Rename from
2434 has_nonstatic_fields. Make into a FieldBase pointer.
2435 (TypeContainer.AddField): Add CS0282 check.
2436 (TypeContainer.EmitType): Update.
2438 2005-07-06 Miguel de Icaza <miguel@novell.com>
2440 * cs-tokenizer.cs (consume_identifier): Do not create strings to
2441 compare if they start with __.
2443 2005-07-06 Raja R Harinath <rharinath@novell.com>
2445 * statement.cs (Switch.SwitchGoverningType): Only look at
2446 UserCasts that don't need implicit standard conversions to one of
2447 the allowed switch types (Fixes test-322.cs).
2448 (LocalInfo.Resolve): Re-enable sanity-test.
2450 2005-07-06 Marek Safar <marek.safar@seznam.cz>
2452 * cs-tokenizer.cs (consume_identifier): Detect double undescores
2454 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2456 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2458 2005-07-06 Raja R Harinath <rharinath@novell.com>
2461 * ecore.cs (SimpleName.GetSignatureForError): Add.
2462 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2463 (MemberAccess.GetSignatureForError): Add.
2465 2005-07-05 Marek Safar <marek.safar@seznam.cz>
2467 The big error and warning messages review.
2497 * typemanager.cs: Updated.
2499 * class.cs: (MethodCore.SetYields): Moved here to share.
2500 (PropertyMethod.Define): Moved iterator setup here.
2502 * iterators.cs: Add orig_method to have full access to parent
2505 2005-07-05 Raja R Harinath <rharinath@novell.com>
2507 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2508 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2509 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2510 variable of struct type.
2511 * expression.cs (Unary.ResolveOperator): Update to change.
2512 (Indirection.VerifyFixed): Likewise.
2513 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2514 (ParameterReference.VerifyFixed): Value parameters are fixed.
2515 (This.VerifyFixed): Treat 'this' as a value parameter.
2516 * statement.cs (LocalInfo.IsFixed): Remove.
2518 2005-07-01 Martin Baulig <martin@ximian.com>
2520 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2521 `ec.EmitThis ()' to get the correct scope.
2523 2005-07-01 Martin Baulig <martin@ximian.com>
2525 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2526 instance is a ParameterReference; fixes #75299.
2528 2005-06-30 Raja R Harinath <rharinath@novell.com>
2531 * expression.cs (Indexers.map): Remove.
2532 (Indexers.Append): Filter out inaccessible setters and getters.
2533 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2536 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
2538 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2539 (FieldExpr.Emit, PropertyExpr.Emit): Update.
2540 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2541 * expression.cs (Invocation.EmitCall): Add CS0120 check.
2543 2005-06-30 Marek Safar <marek.safar@seznam.cz>
2546 * class.cs (FieldBase.GetInitializerExpression): One more field
2549 2005-06-28 Miguel de Icaza <miguel@novell.com>
2551 * pending.cs: Do not define a proxy if the base method is virtual,
2552 it will be picked up by the runtime (bug 75270).
2554 2005-07-08 Martin Baulig <martin@ximian.com>
2556 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2557 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2559 2005-07-07 Martin Baulig <martin@ximian.com>
2561 * generic.cs (ConstructedType.CheckConstraint): Use
2562 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
2563 called recursively; fixes #75329.
2565 2005-07-06 Martin Baulig <martin@ximian.com>
2567 * generic.cs (TypeManager.InferTypeArguments): Added support for
2568 anonymous methods; fixes #75461.
2570 2005-07-01 Martin Baulig <martin@ximian.com>
2572 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2573 `ec.EmitThis ()' to get the correct scope.
2575 2005-07-01 Martin Baulig <martin@ximian.com>
2577 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
2578 instance is `This'; fixes #75299.
2580 2005-06-30 Martin Baulig <martin@ximian.com>
2582 * class.cs (Indexer): Implement IIteratorContainer; added support
2583 for iterators in indexers.
2586 (EmitContext.CurrentIterator): Make this a property, not a field.
2588 * anonymous.cs (AnonymousContainer.Iterator): New public property.
2590 2005-06-28 Miguel de Icaza <miguel@novell.com>
2592 * pending.cs: Do not define a proxy if the base method is virtual,
2593 it will be picked up by the runtime (bug 75270).
2595 2005-06-28 Martin Baulig <martin@ximian.com>
2597 * cs-parser.jay (interface_method_declaration): Avoid a
2598 reduce/reduce conflict by moving some of the code into a separate
2599 `interface_method_declaration_body' rule; fixes #75368.
2601 2005-06-28 Martin Baulig <martin@ximian.com>
2603 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
2604 array check after the check for TypeBuilder's.
2606 2005-06-21 Raja R Harinath <rharinath@novell.com>
2608 * convert.cs (FindMostEncompassedType): Add two trivial special
2609 cases (number_of_types == 0 || number_of_types == 1).
2610 (FindMostEncompasingType): Likewise.
2612 2005-06-17 Raja R Harinath <rharinath@novell.com>
2614 Some cleanups preparing for the fix of #75283.
2615 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2617 (EventExpr.InstanceResolve): Likewise.
2618 (EventExpr.DoResolve): Remove redundant checks.
2620 2005-06-08 Miguel de Icaza <miguel@novell.com>
2622 * class.cs: Small fix.
2624 2005-06-08 Raja R Harinath <rharinath@novell.com>
2627 * class.cs (GetPartialBases): Fix return value check of
2630 2005-06-07 Raja R Harinath <rharinath@novell.com>
2632 Ensure that partial classes are registered in their enclosing
2633 namespace. Initial part of fix of #75160.
2634 * tree.cs (Tree.RecordDecl): Add new namespace argument.
2635 Register declspace with namespace here, not in
2636 DeclSpace.RecordDecl.
2637 * cs-parser.jay: Pass namespace to RecordDecl.
2638 * class.cs (PartialContainer.Create): Likewise.
2639 (ClassPart.DefineType): New sanity-check. Throws an exception if
2641 * decl.cs (Declspace.RecordDecl): Remove.
2642 * namespace.cs (NamespaceEntry.DefineName): Remove.
2644 2005-06-06 Marek Safar <marek.safar@seznam.cz>
2646 * rootcontext.cs: Reset TargetExt as well.
2648 2005-06-03 Raja R Harinath <rharinath@novell.com>
2650 * ecore.cs (Expression.Resolve): Emit CS0654 error when
2653 2005-06-02 Raja R Harinath <rharinath@novell.com>
2655 Fix #75080, cs0119.cs.
2656 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
2658 (Expression.Resolve): ... this. Use it. Remove bogus code
2659 allowing ExprClass.Type and ExprClass.Namespace for
2660 ResolveFlags.VariableOrValue.
2661 (Expression.Resolve) [1-argument variant]: Change default resolve
2662 flags based on language version.
2663 (Expression.Error_UnexpectedKind): Use a simple string array
2664 rather than an ArrayList.
2665 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
2667 (TypeOfVoid.DoResolve): Likewise.
2668 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
2669 flags argument -- it always has the same value.
2671 2005-05-31 Raja R Harinath <rharinath@novell.com>
2674 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
2675 Use it in the error message.
2676 * assign.cs, expression.cs, statement.cs: Update.
2678 2005-05-30 Raja R Harinath <rharinath@novell.com>
2681 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
2682 the "almostMatchedMember" case too.
2683 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
2684 that failed the accessibility checks to 'almost_match'.
2686 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
2688 * attribute.cs: Use internal MethodBuilder methods to set
2689 ExactSpelling and SetLastError on PInvoke methods, instead
2690 of passing them via charset. Fixes #75060.
2692 2005-05-27 Raja R Harinath <rharinath@novell.com>
2694 * parameter.cs (Parameter): Remove TODO comment.
2695 (Parameter.DefineParameter): Remove Location parameter.
2696 (Parameters.LabelParameters): Likewise.
2697 * class.cs (Constructor.Emit): Update to change.
2698 (MethodData.Emit): Likewise.
2699 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
2700 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
2702 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
2705 Removed Parameters.Location and added Parameter.Location instead.
2706 Removed Location parameter from Emit() and GetSignature().
2713 Modified all related calls.
2715 2005-06-21 Martin Baulig <martin@ximian.com>
2717 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
2718 left-hand side is not a nullable type; fixes #75328.
2720 2005-06-21 Martin Baulig <martin@ximian.com>
2723 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
2724 (TypeManager.GetFullNameSignature): Likewise.
2726 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
2727 `source.FullName' and `target.FullName' to check whether there are
2728 two conflicting definitions.
2730 2005-06-21 Martin Baulig <martin@ximian.com>
2732 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
2733 a BoxedCast - also for reference types - to be compatible with csc.
2735 2005-06-21 Martin Baulig <martin@ximian.com>
2737 * expression.cs (MemberAccess.DoResolve): Add support for nested
2738 types in a generic instance; fixes #75320.
2740 2005-06-20 Martin Baulig <martin@ximian.com>
2742 * generic.cs (TypeManager.InferType): Also walk the class
2743 hierarchy for generic instances; fixes #75261.
2745 2005-06-17 Martin Baulig <martin@ximian.com>
2747 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
2748 to make things work for corlib.
2750 2005-06-15 Martin Baulig <martin@ximian.com>
2752 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
2753 obsolete `SecurityAction' values.
2755 2005-06-06 Marek Safar <marek.safar@seznam.cz>
2757 * rootcontext.cs: Reset TargetExt as well.
2759 2005-06-09 Martin Baulig <martin@ximian.com>
2761 * delegate.cs (Delegate.VerifyMethod): Added
2762 `MethodGroupExpr old_mg' argument; inherit its
2763 `HasTypeParameters'; fix #75085.
2765 2005-06-09 Martin Baulig <martin@ximian.com>
2767 * expression.cs (Invocation.OverloadResolve): Correctly handle
2768 generic methods for the SetMemberIsUsed(); fix #75064.
2770 2005-06-09 Martin Baulig <martin@ximian.com>
2772 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
2775 2005-06-08 Martin Baulig <martin@ximian.com>
2777 * cs-parser.jay (nullable_type_or_conditional): If we put the
2778 nullable back and our `type' is a `ComposedCast', remove the
2779 nullable from it. Fixes #75156.
2781 * expression.cs (ComposedCast.RemoveNullable): New public method.
2783 2005-06-08 Martin Baulig <martin@ximian.com>
2785 The big Iterators rewrite :-)
2787 * iterators.cs: Rewrite this to use the anonymous methods framework.
2789 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
2790 before the TypeContainers; see 2test-21.cs.
2793 (TypeContainer.DefineType): Don't create a new EmitContext if we
2794 already have one (this only happens if we're an Iterator).
2795 (TypeContainer.Define): Also call Define() on all our iterators.
2796 (Method.CreateEmitContext): Added support for iterators.
2799 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
2800 (AnonymousContainer.CreateMethodHost): Moved here from
2801 AnonymousMethod and made abstract.
2802 (AnonymousContainer.CreateScopeType): New abstract method.
2803 (AnonymousContainer.IsIterator): New public property.
2804 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
2805 get the ScopeTypeBuilder rather than manually defining it here.
2806 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
2809 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
2810 before RootContext.DefineTypes().
2812 * codegen.cs (EmitContext.RemapToProxy): Removed.
2813 (EmitContext.CurrentAnonymousMethod): Changed type from
2814 AnonymousMethod -> AnonymousContainer.
2815 (EmitContext.ResolveTopBlock): Protect from being called twice.
2816 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
2817 (EmitContext.EmitThis): Removed the iterators hacks; use the
2818 anonymous methods framework for that.
2821 (ToplevelBlock.Container): Make this a property, not a field.
2822 (ToplevelBlock.ReParent): New public method; move the
2823 ToplevelBlock into a new container.
2824 (Foreach.TemporaryVariable): Simplify.
2826 2005-06-05 Martin Baulig <martin@ximian.com>
2828 * statement.cs (LocalInfo.CompilerGenerated): New flag.
2829 (Block.AddTemporaryVariable): New public method; creates a new
2830 `LocalInfo' for a temporary variable.
2831 (Block.EmitMeta): Create the LocalBuilders for all the temporary
2833 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
2834 non-iterator variables.
2836 2005-06-05 Martin Baulig <martin@ximian.com>
2838 * statement.cs (Foreach.TemporaryVariable): Create the
2839 LocalBuilder in the Emit phase and not in Resolve since in some
2840 situations, we don't have an ILGenerator during Resolve; see
2841 2test-19.cs for an example.
2843 2005-06-04 Martin Baulig <martin@ximian.com>
2845 The big Foreach rewrite - Part II.
2847 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
2848 with `PropertyInfo ienumerator_getcurrent'.
2850 * codegen.cs (VariableStorage): Removed.
2853 (Foreach): Derive from Statement, not ExceptionStatement.
2854 (Foreach.CollectionForeach): New nested class. Moved all the code
2855 dealing with collection foreach here.
2856 (Foreach.ForeachHelperMethods): Removed.
2857 (Foreach.TemporaryVariable): Implement IMemoryLocation.
2859 2005-05-23 Martin Baulig <martin@ximian.com>
2861 * statement.cs (Try.DoResolve): Don't create a `finally' if we
2862 don't need to. Fix #75014.
2864 2005-05-26 Raja R Harinath <rharinath@novell.com>
2866 Improve user-defined conversion handling.
2867 * convert.cs (GetConversionOperators): Rewrite. Return only the
2868 applicable operators.
2869 (AddConversionOperators): New. Helper for GetConversionOperators.
2870 (FindMostEncompassedType, FindMostEncompassingType): Verify that
2871 there is only one most encompassed/encompassing type.
2872 (FindMostSpecificSource, FindMostSpecificTarget): Remove
2873 "applicable operator" handling.
2874 (UserConversion): Move cache here from GetConversionOperators.
2875 Directly cache the chosen operator, rather than the whole
2877 (ExplicitNumericConversion): Fix buggy implementation of Decimal
2878 case. Allow conversion of decimal to sbyte and byte too.
2879 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2880 New static methods. Used to avoid allocating EmptyExpressions in
2883 2005-05-24 Duncan Mak <duncan@novell.com>
2885 * ecore.cs (CastFromDecimal): New class for casting a decimal to
2886 another class, used in Convert.ExplicitNumericConversion.
2887 (CastToDecimal): New class, similar to above, but casts to
2888 System.Decimal, used in Convert.ImplicitNumericConversion and also
2889 in explicit convesion from double/float to decimal.
2891 * convert.cs (ImplicitNumericConversion): Handle implicit
2892 conversions to System.Decimal.
2893 (ExplicitNumericConversion): handle explicit conversions to
2898 2005-05-20 Miguel de Icaza <miguel@novell.com>
2900 * typemanager.cs: Do not throw an exception in the TypeBuilder
2901 case, we take care of it on the TypeCode.
2903 2005-05-17 Marek Safar <marek.safar@seznam.cz>
2905 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
2908 * cs-parser.jay: Catch more lexical errors.
2910 * report.cs: Add one more Error method.
2913 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
2915 2005-05-20 Martin Baulig <martin@ximian.com>
2917 * class.cs (TypeContainer.CircularDepException): Removed.
2918 (TypeContainer.DefineType): Removed the `InTransit' stuff.
2919 (TypeContainer.CheckRecursiveDefinition): Check for circular class
2920 (CS0146) and interface (CS0529) dependencies here.
2922 2005-05-20 Martin Baulig <martin@ximian.com>
2924 * expression.cs (New.DoResolve): Move the CS0712 check above the
2925 CS0144 check; otherwise it can never be reached.
2927 2005-05-20 Martin Baulig <martin@ximian.com>
2929 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
2931 2005-05-20 Martin Baulig <martin@ximian.com>
2933 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
2935 * typemanager.cs (TypeManager.IsAttributeType): New public method.
2937 2005-05-19 Martin Baulig <martin@ximian.com>
2940 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
2941 to disable error reporting.
2943 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
2944 here since we don't want to report an error; see the new test-336.cs.
2946 2005-05-19 Raja R Harinath <rharinath@novell.com>
2948 * statement.cs (ToplevelBlock.GetParameterReference)
2949 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
2950 Move here from class Block.
2951 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
2952 * expression.cs (ParameterReference.DoResolveBase): Likewise.
2954 2005-05-18 Martin Baulig <martin@ximian.com>
2959 (FlowBranching.Reachability): Add non-static public And() and Or()
2961 (FlowBranchingSwitch): New class; do the `break_origins' thing
2962 like in FlowBranchingLoop.
2963 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
2964 reachability, not just locals and parameters.
2965 (FlowBranching.MergeChild): Remove some of the hacks for loop and
2966 switch; MergeBreakOrigins() now takes care of that.
2968 2005-05-18 Martin Baulig <martin@ximian.com>
2970 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2971 a loop and may leave it, reset the barrier; fixes #74974.
2973 2005-05-16 Raja R Harinath <rharinath@novell.com>
2975 Fix test-382.cs. Emit values of decimal constants.
2976 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
2978 (TypeContainer.AddField): ... this.
2979 (TypeContainer.EmitFieldInitializers): Allow the list of fields
2980 with initializers to include 'Const's.
2981 (ClassPart.RegisterFieldForInitialization): Forward to
2983 * const.cs (Const.Const): Pass initializer to base class.
2984 (Const.Define): In case of decimal constants, register them for
2985 initialization in a static constructor.
2987 2005-05-14 Martin Baulig <martin@ximian.com>
2989 * statement.cs (Block.Resolve): Correctly handle unreachable code;
2990 do not call ResolveUnreachable() on unreachable statements in
2991 here, see the comment in the source code.
2993 2005-05-13 Raja R Harinath <rharinath@novell.com>
2996 * expression.cs (BinaryResolveOperator): If one of the operands of
2997 an equality comparison is 'null' and the other is a pointer type,
2998 convert the null to a NullPointer.
2999 * convert.cs (ImplicitReferenceConversion): If the expression is a
3000 NullLiteral and the target type is a pointer type, return a
3001 NullPointer instead.
3002 (ImplicitConversionStandard): Likewise.
3004 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3006 * cs-parser.jay: Set readonly context based on special constructs.
3008 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3009 readonly variable error handling.
3011 * rootcontext.cs (EmitCode): Don't verify members when error
3014 * statement.cs (LocalInfo): Add reaodnly context information.
3015 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3017 2005-05-17 Martin Baulig <martin@ximian.com>
3019 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3022 2005-05-13 Martin Baulig <martin@ximian.com>
3024 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3025 handle unreachable blocks.
3027 2005-05-13 Martin Baulig <martin@ximian.com>
3030 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3031 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3034 2005-05-13 Martin Baulig <martin@ximian.com>
3036 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3037 instance variable, not a local. Fix #74873.
3038 (Block.ResolveUnreachable): Set it to true here.
3040 2005-05-12 Martin Baulig <martin@ximian.com>
3042 * cs-parser.jay (property_declaration): Pass the `current_class',
3043 not the `current_container' to Property's .ctor. Fixes #74912.
3045 2005-05-11 Martin Baulig <martin@ximian.com>
3047 * typemanager.cs (Closure): Copy this from MCS and merge all the
3048 GMCS-specific changes into it.
3050 2005-05-12 Raja R Harinath <harinath@gmail.com>
3053 * typemanager.cs (unmanaged_enclosing_types): New.
3054 (IsUnmanagedType): Avoid infloops by using
3055 'unmanaged_enclosing_types' to talk with recursive invocations.
3057 2005-05-11 Duncan Mak <duncan@novell.com>
3059 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3060 continuing to process for 'arg'.
3061 (handle_preprocessing_directive): Check the argument of the #endif
3062 directive and report error CS1025 if there are any trailing
3065 According to the C# spec, having even whitespace after the #endif
3066 directive is illegal; however, because we call arg.TrimEnd ()
3067 beforehand, we have the same behavior as csc, allowing whitespace
3068 after the directive.
3072 2005-05-11 Marek Safar <marek.safar@seznam.cz>
3076 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3077 (Constructor.GetObsoleteAttribute): Implemented correctly.
3079 2005-05-10 Martin Baulig <martin@ximian.com>
3081 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3082 resolve the type; fixes #74864.
3083 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3084 in DoResolve(); fixes #74862.
3086 2005-05-10 Martin Baulig <martin@ximian.com>
3088 * support.cs (ReflectionParameters.ParameterModifier): Use
3089 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3090 and `ParameterAttributes.In'. Fixes #74884.
3092 2005-05-10 Martin Baulig <martin@ximian.com>
3094 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3095 the cache if we're just looking for `MemberTypes.NestedType' in a
3098 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3099 constraints if we're still resolving the type tree.
3100 (Expression.MemberLookup): If we're resolving the type tree, only
3101 look for `MemberTypes.NestedType' since we're only interested in
3104 * class.cs (TypeContainer.DefineType): Don't resolve the type
3105 parameters here; do this later in ResolveType() after the type
3106 tree has been resolved.
3107 (TypeContainer.ResolveType): New public method; this is called
3108 after the type tree is resolved and before the types are being
3109 populated. We resolve the generic constraints here.
3110 (TypeContainer.DoDefineMember): Check the constraints on our base
3111 class and interfaces.
3113 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3114 set the `ResolvingTypeTree' flag on the EmitContext.
3116 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3118 2005-05-10 Marek Safar <marek.safar@seznam.cz>
3120 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3122 * expression.cs (Argument.GetParameterModifier): Turned to property.
3123 (Invocation.Error_InvalidArguments): Add more descriptive errors.
3125 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3128 2005-05-09 Raja R Harinath <rharinath@novell.com>
3131 * decl.cs (MemberCache.AddMethods): Register override methods,
3132 rather than non-override methods.
3133 * typemanager.cs (RegisterOverride): New.
3134 (IsOverride): Update.
3136 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3138 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3140 2005-05-06 Martin Baulig <martin@ximian.com>
3143 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3144 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3146 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3150 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3151 recursive declaration.
3153 * statement.cs (Block.ResolveMeta): Report any error in resolving.
3155 2005-05-06 Marek Safar <marek.safar@seznam.cz>
3157 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3159 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3161 2005-05-05 Raja R Harinath <rharinath@novell.com>
3164 * decl.cs (DeclSpace.FamilyAccessible):
3165 Use TypeManager.IsNestedFamilyAccessible.
3167 Fix reopened #64812.
3168 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3171 2005-05-04 Raja R Harinath <rharinath@novell.com>
3172 Abin Thomas <projectmonokochi@rediffmail.com>
3173 Anoob V E <projectmonokochi@rediffmail.com>
3174 Harilal P R <projectmonokochi@rediffmail.com>
3177 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3178 allow access to all static members.
3180 2005-05-04 Martin Baulig <martin@ximian.com>
3182 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3184 2005-05-04 Martin Baulig <martin@ximian.com>
3188 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3189 section at the end; make things work if `default' is not the last
3192 2005-05-04 Martin Baulig <martin@ximian.com>
3196 * statement.cs (Switch): Replaced the `got_default' field with a
3197 `default_section' one.
3198 (Switch.CheckSwitch): Set `default_section' here.
3199 (Switch.Resolve): If we're a constant switch and the constant is
3200 not found, use the default section.
3202 2005-05-03 Martin Baulig <martin@ximian.com>
3204 * expression.cs (ArrayAccess.EmitGetLength): New public method.
3206 * statement.cs (Foreach.ArrayForeach): New nested class.
3207 (Foreach.TemporaryVariable): New nested class.
3208 (Foreach.EmitArrayForeach): Removed; this is now in the new
3211 2005-05-03 Raja R Harinath <rharinath@novell.com>
3213 * pending.cs (BaseImplements): Move the #74773 fix here. This is
3215 (VerifyPendingMethods): Revert change below.
3217 * typemanager.cs (IsOverride, RegisterNonOverride): New.
3218 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3219 that used to trigger warning -28. Remove warning -28.
3220 * expression.cs (Invocation.OverloadResolve): Use
3221 TypeManager.IsOverride to distinguish override methods.
3224 * pending.cs (VerifyPendingMethods): If a base type implements the
3225 requested interface, don't bother checking individual methods of
3226 the base type. As a side-effect, this prevents the creation of
3227 unnecessary proxies.
3229 2005-05-02 Martin Baulig <martin@ximian.com>
3233 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3234 Also `And' the locals if the old vector is null.
3235 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3236 null; in this case we basically reset all the variables.
3238 2005-05-02 Martin Baulig <martin@ximian.com>
3242 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3243 Added `FlowBranching branching' argument; always `and' the
3244 variables instead of `or'ing them unless we're an infinite loop.
3246 * statement.cs (While.Resolve): Create a new sibling unless we're
3249 2005-05-02 Martin Baulig <martin@ximian.com>
3253 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3254 arguments; use it instead of creating a new TopLevelBlock.
3255 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3256 our ConstructorInitializer.
3259 (TopLevelBlock.TopLevelBranching): New public property.
3260 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3261 and create our `TopLevelBranching'.
3263 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3264 anonymous method host, use `block.TopLevelBranching' rather than
3265 creating a new branching.
3267 2005-04-20 Miguel de Icaza <miguel@novell.com>
3269 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3270 a ScopeInfo, if any of the current children is a child of the new
3271 entry, move those children there.
3273 2005-04-30 Martin Baulig <martin@ximian.com>
3275 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3276 at the beginning of a SwitchSection. Fix #73335.
3278 2005-04-27 Marek Safar <marek.safar@seznam.cz>
3281 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3283 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3284 (FieldExpr.DoResolve): Obsolete members are ignored for field
3287 2005-04-26 Marek Safar <marek.safar@seznam.cz>
3289 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3290 of arrays detection.
3292 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3294 (Field.VerifyClsCompliance): Volatile fields are not compliant.
3296 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3299 2005-04-25 Ben Maurer <bmaurer@ximian.com>
3301 * cs-parser.jay: Use the prefered version of -unsafe in error
3304 2005-04-22 Marek Safar <marek.safar@seznam.cz>
3306 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3309 2005-04-20 John Luke <john.luke@gmail.com>
3311 * driver.cs: fix typo in error message, --outout to --output
3313 2005-04-30 Martin Baulig <martin@ximian.com>
3315 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3316 handle the .NET 2.x security attributes.
3318 2005-04-30 Martin Baulig <martin@ximian.com>
3321 (TypeManager.ExpandInterfaces): Don't add things twice.
3324 (TypeContainer.VerifyClsCompliance): Allow generic instances.
3326 2005-04-29 Martin Baulig <martin@ximian.com>
3328 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3330 * anonymous.cs: Added support for anonymous generic methods.
3332 2005-04-29 Martin Baulig <martin@ximian.com>
3334 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3337 2005-04-29 Martin Baulig <martin@ximian.com>
3339 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3341 * expression.cs (New.DoResolve): Fix the CS0304 check.
3343 2005-04-29 Martin Baulig <martin@ximian.com>
3345 * typemanager.cs (TypeManager.GetFullName): Updated to the new
3348 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3349 explicit interface implementation, compare the interface types.
3350 (MethodData.Define): Use the new naming scheme from the latest
3352 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3354 * decl.cs (MemberName.GetMemberName): Removed.
3355 (MemberName.MethodName, FullName): New properties.
3357 2005-04-25 Raja R Harinath <rharinath@novell.com>
3359 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3361 2005-04-22 Martin Baulig <martin@ximian.com>
3363 * generic.cs (GenericMethod): Create the EmitContext in the
3364 `Define()'; in `Define(MethodBuilder)', create the type parameters
3365 before calling `Define()'. Fixes #73933.
3367 2005-04-22 Martin Baulig <martin@ximian.com>
3370 (Constraints.Resolve): Make things work wrt. the new type lookup system.
3371 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3373 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3374 ConstructedType, check its constraints.
3376 2005-04-20 Marek Safar <marek.safar@seznam.cz>
3378 * codegen.cs (InRefOutArgumentResolving): New field.
3380 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3381 fields outside contructor.
3383 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3385 2005-04-19 Miguel de Icaza <miguel@novell.com>
3387 * anonymous.cs (CaptureContext.EmitParameterInstance): The
3388 parameter code was not completed ever, so it was not as up-to-date
3389 as local variables. Must finish it.
3391 The bug fix was to compare the Toplevel of the block, not the
3392 current block. Thanks for Ben for pointing this out.
3394 2005-04-19 Raja R Harinath <rharinath@novell.com>
3396 * decl.cs (AddMethods): Use the declaring type of the problem
3397 method to determine if we want to squash a warning.
3399 2005-04-19 Marek Safar <marek.safar@seznam.cz>
3401 * attribute.cs: Removed debug output.
3403 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3405 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3408 2005-04-18 Raja R Harinath <rharinath@novell.com>
3411 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3412 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3413 all null comparisons against reference types.
3415 2005-04-18 Marek Safar <marek.safar@seznam.cz>
3418 * class.cs (TypeContainer.CircularDepException) New nested
3420 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3421 (TypeContainer.DefineType): Removed error, reset InTransit before
3423 (Class.DefineType): Throw exception when is in Transit.
3424 Catch exception and report error.
3425 (Struct.DefineType): Throw exception when is in Transit.
3426 Catch exception and report error.
3427 (Interface.DefineType): Throw exception when is in Transit.
3428 Catch exception and report error.
3430 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3431 handle nested exception handlers.
3433 * flowanalysis.cs (InTryWithCatch): New method, search for try with
3436 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3437 InFinally and InCatch storage.
3439 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3440 (Catch.Resolve): Set and Restore ec.InCatch.
3441 (Try.Resolve): Set and Restore ec.InFinally.
3442 (Try.HasCatch): True when try has catch.
3444 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
3446 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3447 for the same event member, so exclude such cases from warning 419.
3450 2005-04-16 Miguel de Icaza <miguel@novell.com>
3452 * expression.cs (Binary.ResolveOperator): Apply patch from John
3453 Luke to fix bug 59864: operators &, | and ^ on enumerations
3454 require that the same enum type on both sides.
3456 * driver.cs: Add warnings to old flag usage, this is to assist
3457 people who produce Makefiles and hope that the Makefiles will be
3460 * class.cs (TypeContainer.EmitType): Moved the definition of the
3461 special $PRIVATE$ field from the resolve phase to the Emit phase.
3462 During resolve we do not know if we are a struct with
3463 HasExplicitLayout, we know this only after the attributes for the
3466 Set the FieldOffset to zero on the dummy field that we create for
3467 the class. Fixes 74590.
3469 2005-04-16 Raja R Harinath <rharinath@novell.com>
3472 * ecore.cs (PropertyExpr.resolved): New.
3473 (DoResolve): Use it to handle a case of double resolution here.
3474 Handle a case of identical-name-and-type-name.
3475 * expression.cs (ArrayCreation.CheckIndices): Avoid double
3476 resolution by storing the results of expression resolution back
3477 into the "probes" array.
3479 2005-04-15 Raja R Harinath <rharinath@novell.com>
3481 Fix cs0208-7.cs and cs0208-8.cs.
3482 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3483 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
3484 error reporting to point out the reason a struct is not unmanaged.
3486 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3488 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
3489 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3491 2005-04-13 Raja R Harinath <rharinath@novell.com>
3494 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3495 IdenticalNameAndTypeName here.
3496 (EventExpr.InstanceResolve): Likewise.
3498 2005-04-13 Marek Safar <marek.safar@seznam.cz>
3500 C# 2.0 DefaultCharSetAttribute implementation
3502 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3503 which allows us to set GlobalNamespace for every resolve.
3504 (Attribute.ResolveArguments): Cut from Resolve.
3505 (Attribute.GetCharSetValue): Returns CharSet named argument.
3506 (Attribute.DefinePInvokeMethod): Gets default charset from
3508 (GlobalAttribute.ResolveAsTypeStep): Override.
3509 (GlobalAttribute.ResolveArguments): Override.
3511 * class.cs (TypeAttr): Is protected.
3513 * codegen.cs (ModuleClass.DefaultCharSet): New member.
3514 (ModuleClass.DefaultCharSetType): New memeber.
3515 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3517 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3518 charset from module.
3520 * delegate.cs (TypeAttr): Override.
3521 (Delegate.DefineType): Use this TypeAttr.
3523 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3524 at very early stage (before types are defined) to resolve model
3525 module attributes. It will probably not work with corlib but it
3528 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3529 charset from module.
3531 * typemanager.cs (default_charset_type): New type.
3533 2005-04-13 Raja R Harinath <rharinath@novell.com>
3535 * decl.cs (MemberCache.AddMethods): Don't warn if
3536 System.Object.Finalize has buggy MethodAttributes.
3538 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3541 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3543 * doc.cs : detect ambiguous reference to overloaded members.
3544 Fixed bug #71603. MS 1.1 csc does not detect it.
3546 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3548 * doc.cs : delegates must not be referenced with parameters.
3551 2005-04-12 Miguel de Icaza <miguel@novell.com>
3553 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3555 2005-04-10 Miguel de Icaza <miguel@novell.com>
3557 * driver.cs (MainDriver): Stop processing if the CLS stage found
3560 (CompilerCallableEntryPoint.InvokeCompiler): Always
3561 reset after execution; Take a TextWriter argument for the
3564 * report.cs: Use the error stream instead of hardcoding stderr.
3566 2005-04-09 Miguel de Icaza <miguel@novell.com>
3568 * class.cs: Reduce code paths to test, too small of an
3569 optimization to make it worth the extra testing. Always perform
3572 2005-04-08 Raja R Harinath <rharinath@novell.com>
3575 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3576 operators that had errors reported on them.
3578 2005-04-08 Marek Safar <marek.safar@seznam.cz>
3580 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3582 (Attribute.Resolve): Add named argument type checking.
3584 * class.cs (FixedField.Define): Use IsPrimitiveType
3586 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3588 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3589 unsafe parameter types.
3591 * statement.cs (Using.ResolveExpression): Add better error description.
3593 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3595 2005-04-08 Raja R Harinath <rharinath@novell.com>
3598 * attribute.cs (Attribute.GetAttributeUsage): Resolve
3599 AttributeUsageAttribute in the emitcontext of the attribute class,
3600 not in the emitcontext of the attributable entity it was attached to.
3601 * cs-parser.jay: Use 'current_class', not 'current_container',
3602 when creating a GlobalAttribute.
3604 2005-04-08 Alp Toker <alp@atoker.com>
3606 * pending.cs: The fix to #58413 failed to compile methods implementing
3607 interfaces with/without params modifiers and vice versa, even though
3608 params modifiers aren't part of the signature. Make the modifier check
3609 less strict as in csc.
3611 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
3612 Anoob V E <projectmonokochi@rediffmail.com>
3613 Harilal P R <projectmonokochi@rediffmail.com>
3616 * pending.cs (TypeAndMethods.mods): New. Store the parameter
3617 modifiers of pending methods.
3618 (PendingImplementation.PendingImplementation): Initialize it.
3619 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3620 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3621 with ParameterData. Add check for modifiers.
3622 * class.cs (MethodData.Define): Update to changes.
3624 2005-04-07 Raja R Harinath <rharinath@novell.com>
3626 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3628 2005-04-07 Marek Safar <marek.safar@seznam.cz>
3630 * class.cs (PropertyMethod.Define): Check private accessor in abstract
3633 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3636 * typemanager.cs: Registered RequiredAttributeAttribute.
3638 2005-04-06 Marek Safar <marek.safar@seznam.cz>
3640 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3641 Warning CS0169 is back at level 3.
3642 (IMethodData.SetMemberIsUsed): New method.
3644 * decl.cs (IsUsed): New value; moved from FieldBase.Status
3645 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3647 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3649 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3651 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3654 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3657 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3658 to avoid the problems with nested types.
3660 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
3661 Anoob V.E <projectmonokochi@rediffmail.com>
3662 Harilal P.R <projectmonokochi@rediffmail.com>
3663 Raja R Harinath <rharinath@novell.com>
3666 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3668 * typemanager (GetConstructor): Make public.
3670 2005-04-05 John Luke <john.luke@gmail.com>
3671 Raja R Harinath <rharinath@novell.com>
3674 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3675 struct too. Return false quicker in a few cases.
3676 (VerifyUnManaged): Use it.
3678 2005-04-05 Raja R Harinath <rharinath@novell.com>
3681 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
3682 not 'unreachable_seen'.
3684 2005-04-04 Marek Safar <marek.safar@seznam.cz>
3686 * attribute.cs (Attribute.GetValue): Removed unused.
3688 * codegen.cs (CodeGen.TrimExt): Removed unused.
3690 * cs-parser.jay (output): Removed unused.
3692 * cs-tokenizer.cs (hex_digits): Removed unused.
3694 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
3696 * expression.cs (Indirection.LoadExprValue): Removed unused.
3697 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
3699 * iterators.cs (Iterator.param_types): Removed unused.
3701 * statement.cs (Goto.block): Removed unused.
3702 (ToplevelBlock.did): Removed unused.
3703 (Switch.ResolveConstantSwitch): Removed unused.
3705 2005-04-01 Ben Maurer <bmaurer@ximian.com>
3707 * rootcontext.cs: Allow mcs to bootstrap with the compilation
3710 2005-04-19 Martin Baulig <martin@ximian.com>
3712 Merged r42462 from MCS and made it work for GMCS.
3714 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
3716 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
3718 2005-04-01 Raja R Harinath <rharinath@novell.com>
3720 Fix #74232 and cs0208-3.cs.
3721 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
3722 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
3723 unmanaged type. Don't use FieldBuilders when 't' is a
3724 TypeBuilder. Use ModFlags and MemberType fields.
3725 * class.cs (MemberBase.member_type): Rename from MemberType.
3726 (MemberBase.MemberType): New property. Determines member_type on
3728 (MemberBase.DoDefine): Don't initialize MemberType here.
3729 (FieldMember.Define): Likewise.
3731 2005-04-01 Marek Safar <marek.safar@seznam.cz>
3734 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
3735 Attributes are emitted there.
3737 2005-04-01 Raja R Harinath <rharinath@novell.com>
3739 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
3740 keyword in 'partial enum' too.
3741 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
3743 Report from Kamil Skalski <nazgul@omega.pl>.
3746 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
3747 have partial containers too.
3749 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
3750 in block' checks to Block.CheckInvariantMeaningInBlock.
3751 * statement.cs (Block.GetKnownVariableInfo): Make private.
3752 (Block.IsVariableUsedInChildBlock): Remove.
3753 (Block.IsVariableUsedInBlock): Likewise.
3754 (Block.CheckInvariantMeaningInBlock): New. Show location of
3755 conflicting declaration.
3756 (Block.AddVariable): Make error messages less long-winded and more
3757 specific. Show location of conflicting declaration.
3758 * parameter.cs (Parameters.Location): New readonly property.
3760 2005-03-31 Raja R Harinath <rharinath@novell.com>
3762 Clean up semantics of invoking ResolveMemberAccess.
3763 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
3764 can have an instance, ensure that we pass in a non-TypeExpression
3765 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
3766 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
3767 argument. Update to changes and simplify.
3768 (FieldExpr.Emitinstance): Remove CS0120 check.
3769 (PropertyExpr.EmitInstance): Likewise.
3770 * expression.cs (Argument.Resolve): Likewise.
3771 (Invocation.DoResolve): Update to changes in semantics of
3774 2005-03-31 Marek Safar <marek.safar@seznam.cz>
3777 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
3780 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
3782 2005-03-31 Raja R Harinath <rharinath@novell.com>
3784 Fix difference in behaviour with commandline invocation.
3785 * driver.cs (Driver.Reset): New.
3786 (CompilerCallableEntryPoint): Call it.
3788 * statement.cs (If.Resolve): Avoid spurious "uninitialized
3789 variable" warnings if the boolean expression failed to resolve.
3791 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
3793 * attribute.cs: Fix the union of several permissions when some of them
3794 are unrestricted (so the result isn't an unrestricted permission set).
3797 2005-03-30 Raja R Harinath <rharinath@novell.com>
3799 * ecore.cs (MemberExpr): New class. Convert from interface
3801 (MemberExpr.ResolveMemberAccess): Refactor and move here from
3802 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
3804 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
3805 (MethodGroupExpr.IsExplicitImpl): Remove.
3806 (Expression.GetFieldFromEvent): Remove.
3807 (SimpleName.MemberStaticCheck): Remove.
3808 (SimpleName.DoSimpleNameResolve): Update to changes.
3809 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
3810 (MemberAccess.IdenticalNameAndTypeName): Remove.
3811 (MemberAccess.error176): Move to MemberExpr.
3812 (MemberAccess.DoResolve): Update to changes.
3813 (BaseAccess.DoResolve): Likewise.
3815 2005-03-30 Marek Safar <marek.safar@seznam.cz>
3817 C# 2.0 Conditional attribute class implementation
3819 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
3820 Analyzes class whether it has attribute which has ConditionalAttribute
3821 and its condition is not defined.
3823 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
3824 (Class.IsExcluded): New method. Search for at least one defined
3825 condition in ConditionalAttribute of attribute class.
3827 2005-03-30 Raja R Harinath <rharinath@novell.com>
3829 * ecore.cs (PropertyExpr): Derive from Expression, not
3830 ExpressionStatement.
3831 (PropertyExpr.EmitStatement): Remove.
3833 2005-03-29 Raja R Harinath <rharinath@novell.com>
3836 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
3837 internal field "value__" of an enum be private. The examples for
3838 "value__" that I found on MSDN all used FieldAttributes.Private.
3840 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
3841 Don't mention IL method attribute names.
3843 Fix #47991. Remove a TODO.
3844 * statement.cs (Block.Toplevel): Make into a field.
3845 (Block.Parameters): Move into ToplevelBlock.
3846 (Block.known_variables): Rename from child_variable_names.
3847 (Block.Block): Remove variants that take Parameters. Initialize
3848 'Toplevel' with the immediately surrounding toplevel block.
3849 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
3850 LocalInfo parameter.
3851 (Block.GetKnownVariableInfo): New.
3852 (Block.IsVariableNameUsedInChildBlock): Update.
3853 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
3854 the block, even though it may not be in scope.
3855 (Block.AddVariable): Remove Parameters parameter. Use
3856 Toplevel.Parameters instead.
3857 (Block.AddConstant): Remove Parameters parameter.
3858 (Block.GetParameterReference): Update to use Toplevel.Parameters.
3859 (Block.IsParamaterReference): Likewise.
3860 (Block.IsLocalParameter): Likewise. Simplify a lot.
3861 (ToplevelBlock.Parameters): New. Moved from Block.
3862 (ToplevelBlock.ToplevelBlock): Update to changes. Always
3863 initialize Parameters to a non-null value.
3864 * cs-parser.jay: Update to changes.
3865 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
3866 simple names that mean different things in the same block. Use
3867 Block.IsVariableNameUsedInBlock.
3869 2005-03-28 Raja R Harinath <rharinath@novell.com>
3871 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
3873 2005-03-26 Raja R Harinath <harinath@acm.org>
3876 * assign.cs (Assign.DoResolve): When the RHS of an assignment
3877 fails to resolve, ensure that the LHS is still resolved as an
3880 2005-03-25 Raja R Harinath <harinath@acm.org>
3882 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
3884 (Enum.current_ec): Remove.
3885 (Enum.LookupEnumValue): Remove EmitContext argument.
3886 Just uses the one created during DefineType.
3887 (Enum.FindMembers): Update.
3888 * expression.cs (MemberAccess.DoResolve): Update.
3890 2005-03-22 Marek Safar <marek.safar@seznam.cz>
3892 * assign.cs (Assign.DoResolve): Check for CS1717 when
3893 source and target are same (uses Equals).
3895 * expression.cs (LocalVariableReference, ParameterReference,
3896 This): Implemented Equals, GetHashCode.
3898 * statement.cs (Block.GetParameterReference): Removed useless
3901 2005-03-22 Raja R Harinath <rharinath@novell.com>
3904 * statement.cs (Block.AddVariable): Ensure that we skip implicit
3905 blocks before deciding whether the error is cs0136 or cs0128.
3907 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
3908 (using_alias_directive, using_namespace_directive): Pass
3909 MemberName, not an expression to Namespace.UsingAlias and
3911 (MakeName): Use the MemberName of the namespace.
3912 * namespace.cs (Namespace.MemberName): New.
3913 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
3914 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
3916 * decl.cs (MemberName.Name): Make readonly.
3917 (MemberName.FromDotted): New "constructor".
3918 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
3919 (MemberCore.Name): Compute from MemberName on demand.
3920 (MemberCore.SetMemberName): Provide a way to change the
3922 (MemberCore.AddToContainer): Don't take a fullname parameter.
3923 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
3924 fully qualified name of the container to the member name.
3925 (TypeContainer.AddToTypeContainer): Use a fully qualified name
3926 only if the type is a member of the root container.
3927 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
3928 MemberName.Left rather than searching for an embedded ".".
3929 (PartialContainer.CreatePart): Update to changes in RootContext.
3930 (MemberBase.ShortName): Turn into a property. Use
3931 MemberCore.SetMemberName.
3932 (MemberBase.ExplicitInterfaceName): Remove.
3933 (MemberBase.UpdateMemberName): Remove.
3934 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
3935 (PropertyBase.SetMemberName): New override.
3936 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
3937 (Tree.GetDecl): New.
3938 (Tree.AllDecls): Rename from Decls.
3939 * attribute.cs, enum.cs, report.cs: Update to changes.
3940 * driver.cs (MainDriver): Use MemberName.FromDotted on
3941 RootContext.MainClass.
3943 2005-03-21 Marek Safar <marek.safar@seznam.cz>
3945 * class.cs (FixedField.Define): Check for CS1664 and more sanity
3948 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
3950 2005-03-18 Marek Safar <marek.safar@seznam.cz>
3952 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
3953 property accessor modifiers.
3955 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
3956 fixed buffer attribute (CS1716).
3957 (PropertyMethod.HasCustomAccessModifier): When property accessor
3958 has custom modifier.
3960 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
3962 (PropertyExpr.DoResolveLValue): Add CS0272.
3964 2005-03-17 Miguel de Icaza <miguel@novell.com>
3966 * convert.cs: When converting to a pointer, use the proper Conv.U
3967 or Conv.I depending on the source data type.
3969 * cs-tokenizer.cs: Make the size for large decimal constants,
3972 2005-03-17 Martin Baulig <martin@ximian.com>
3974 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3975 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
3977 2005-03-17 Martin Baulig <martin@ximian.com>
3979 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3980 to bool so we can return an error condition.
3981 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3984 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
3986 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
3989 2005-03-16 Raja R Harinath <rharinath@novell.com>
3991 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
3992 Refactor to avoid traversing the list of assemblies, and to avoid
3993 string concatenation.
3994 * typemanager.cs (guid_attr_type): Remove.
3995 (negative_hits, pointers, references): Remove hashes.
3997 (GetConstructedType): New. Uses type_hash to handle constructed
3998 types (arrays, references, pointers).
3999 (GetReferenceType, GetPointerType): Use it.
4000 (GetNestedType): New. Uses type_hash to handle nested types of
4002 (LookupType, LookupTypeDirect): Remove.
4003 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4004 'types' hash and LookupTypeReflection directly.
4005 (params_string, params_object): Use GetConstructedType.
4006 * namespace.cs (Namespace.cached_types): New. Cache of reflected
4008 (Namespace.Lookup): Use cached_types.
4009 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4010 provided by old TypeManager.LookupType.
4011 * rootcontext.cs (MakeFQN): Remove.
4012 * decl.cs (DeclSpace.MakeFQN): Likewise.
4013 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4014 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4015 TypeManager.GetConstructedType.
4016 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4018 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
4020 * cs-parser.jay: Fix build.
4022 2005-03-15 Marek Safar <marek.safar@seznam.cz>
4024 * class.cs (TypeContainer.CircularDepException) New nested
4025 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4027 * cs-parser.jay: Reports CS1527 for any namespace element.
4029 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4032 * expression.cs (ParameterReference.IsAssigned): Changed error to
4034 (Error_WrongNumArguments): Moved CS0245 detection here.
4036 * statement.cs (Return.Resolve): Add CS1622 report.
4038 2005-03-11 Marek Safar <marek.safar@seznam.cz>
4040 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4042 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
4044 * attribute.cs expression.cs: Get rid of some allocations.
4046 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
4048 * doc.cs : just eliminate the latest change.
4050 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4052 * doc.cs : commented out the latest change. It breaks xml-030.cs
4054 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4056 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4057 fail. So invoke CreateType() in FindDocumentedType().
4059 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4061 * cs-tokenizer.cs : added IsKeyword().
4062 * doc.cs : Detect keyword incorrectly used as identifier.
4063 Allow identifiers prefixed by @.
4065 2005-03-10 Marek Safar <marek.safar@seznam.cz>
4067 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4068 It caused exception in namespace resolving (again!).
4070 * class.cs (Class.ctor): Removed exit.
4071 (PropertyMethod.ctor): ditto.
4073 * codegen.cs (Codegen.Reset): Reset static data.
4074 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4076 * cs-tokenizer.cs (Cleanup): Removed.
4078 * driver.cs (GetSystemDir): Rewrote to one line command.
4079 It caused problem with unloaded dynamic modules.
4080 (UnixParseOption): Removed Exit.
4081 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4082 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4083 Now can be mcs used as library.
4085 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4088 * location.cs (Reset): Reset static data.
4090 * namespace.cs (Reset): Reset static data.
4092 * report.cs (Report.Reset): Reset static data.
4094 * rootcontext.cs (RootContext.Reset): Reset static data.
4096 * tree.cs (RootTypes.ctor): Use Location.Null
4098 * typemanager.cs (TypeManager.Reset): Reset static data.
4099 (CoreLookupType): Removed Exit.
4100 (TypeHandle.Reset): Reset static data.
4102 2005-03-10 Raja R Harinath <rharinath@novell.com>
4105 * typemanager.cs (ComputeNamespaces): Import namespaces from
4106 referenced modules too.
4108 2005-03-09 Raja R Harinath <rharinath@novell.com>
4110 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4113 2005-03-09 Raja R Harinath <rharinath@novell.com>
4115 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4116 enclosing DeclSpace. This ensures that a name-lookup populates
4117 more caches and there are fewer 'TypeExpression's. Carve out
4118 nested type lookup into ...
4119 (LookupNestedTypeInHierarchy): ... this.
4121 2005-04-15 Martin Baulig <martin@ximian.com>
4123 Merged r41590 from MCS and make it work in the generics land.
4125 * generic.cs (TypeParameter.UpdateConstraints): Removed the
4128 * class.cs (PartialContainer.UpdateConstraints): Removed.
4129 (PartialContainer.CheckConstraints): Removed.
4130 (PartialContainer.SetParameterInfo): Store the constraints here.
4131 (PartialContainer.DefineTypeParameters): New public method;
4132 resolve the type parameter's constraints here. Note that the
4133 PartialContainer doesn't have an EmitContext anymore, so we must
4134 do this in the ClassPart.
4136 2005-03-09 Raja R Harinath <rharinath@novell.com>
4138 Clean up a few partial-class semantics.
4139 Fixes test-357.cs and cs1618-2.cs.
4140 * cs-parser.jay (struct_declaration): Use 'current_class' as
4141 parent of newly-created struct. Remove call to Register ().
4142 Use 'pop_current_class' to complete handing the current struct.
4143 (interface_declaration): Likewise.
4144 (class_declaration): Likewise.
4145 (enum_declaration): Use 'current_class' as parent of newly created
4147 (delegate_declaration): Likewise.
4148 (pop_current_class): New function. This is used to handle closing
4149 up the 'current_class' and 'current_container', and pointing them
4150 to the enclosing class/container.
4151 (CSharpParser): Initialize 'current_class' too.
4152 * decl.cs (MemberCore): Add check for invariant: a partial
4153 container is not a parsed entity, and thus does not enclose any
4155 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4156 (DeclSpace.BaseTypeExpr): Use it.
4157 (DeclSpace.LookupType): Add check for invariant.
4158 * class.cs (TypeContainer): Add check for invariant: a nested
4159 class should have the same NamespaceEntry as its enclosing class.
4160 (TypeContainer.EmitFieldInitializers): Make virtual.
4161 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4163 (TypeContainer.Register): Remove.
4164 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4165 null. Use TypeResolveEmitContext for resolving base types and
4166 interfaces. Move initialization of Parts.TypeBuilder here from
4168 (TypeContainer.DefineNestedTypes): ... here.
4169 (PartialContainer): Take a Namespace not a NamespaceEntry.
4170 (PartialContainer.Create): Don't use Register. Call the
4171 appropriate Add... function directly.
4172 (ClassPart): Take both the PartialContainer and the enclosing
4173 class as constructor arguments.
4174 (ClassPart.EmitFieldInitializers): Override.
4175 (ClassPart.PartFindNestedTypes): Remove.
4176 (FieldBase.GetInitializerExpression): Resolve the initializer
4177 expression in the emit context of the enclosing class.
4178 * tree.cs (RootTypes): Remove Register ().
4180 2005-03-08 Marek Safar <marek.safar@seznam.cz>
4182 * cs-parser.jay: Removed CS0134.
4184 * driver.cs: Removed CS1901.
4186 * expression.cs (SizeOf.DoResolve): Don't report CS0233
4187 for predefined types.
4189 2005-03-07 Duncan Mak <duncan@novell.com>
4191 * codegen.cs (Save): Catch UnauthorizedAccessException as
4192 well. Fixes bug #73454.
4194 2005-03-07 Marek Safar <marek.safar@seznam.cz>
4196 * cs-tokenizer.cs (xtoken): Add CS1035.
4198 * class.cs (MethodData.Define): Add CS0683.
4199 (FieldMember.ctor): Add CS0681.
4201 2005-03-07 Raja R Harinath <rharinath@novell.com>
4203 * ecore.cs (SimpleName.DoResolve): Rename from
4204 SimpleName.DoResolveAllowStatic.
4205 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4206 Pass 'intermediate' flag to MemberStaticCheck.
4207 (SimpleName.MemberStaticCheck): Skip "static check" only in case
4208 of "intermediate" lookups via MemberAccess.
4209 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
4210 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4212 2005-03-07 Raja R Harinath <rharinath@novell.com>
4215 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4216 slipped in because of variable names that are identical to a
4217 builtin type's BCL equivalent ('string String;', 'int Int32;').
4218 (PropertyExpr.EmitInstance): Likewise.
4220 2005-03-04 Marek Safar <marek.safar@seznam.cz>
4222 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4224 * report.cs (warning_ignore_table): Made public.
4226 2005-03-04 Raja R Harinath <rharinath@novell.com>
4229 * class.cs (MethodData.Emit): Pass 'container' to
4230 container.GetObsoleteAttribute instead of 'container.Parent'.
4232 2005-03-03 Marek Safar <marek.safar@seznam.cz>
4234 * cs-parser.jay: Add 1534 error test.
4236 * iterators.cs (Yield.CheckContext): Add error 1629.
4237 (Iterator.ctor): Save unsafe modifier.
4238 (MoveNextMethod.DoEmit): Restore unsafe context.
4240 * namespace.cs (UsingAlias): Better error message.
4242 2005-03-03 Dan Winship <danw@novell.com>
4244 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4245 the warning message [#73219]
4247 2005-03-03 Raja R Harinath <rharinath@novell.com>
4249 Fix compile with MCS 1.0.0.0.
4250 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4251 w_restore to not depend on string constant folding.
4253 2005-03-03 Raja R Harinath <rharinath@novell.com>
4255 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
4256 CS0246 check to users who passed 'silent = false'.
4257 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4259 (SimpleName.SimpleNameResolve): Update.
4260 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4261 (MemberAccess.IdenticalNameAndTypeName): Update.
4262 * doc.cs (FindDocumentedTypeNonArray): Update.
4264 2005-03-03 Raja R Harinath <rharinath@novell.com>
4266 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4267 * parameters.cs (ComputeAndDefineParameters): Remove.
4268 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4269 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4270 Use GetParameterInfo.
4272 2005-03-02 Marek Safar <marek.safar@seznam.cz>
4274 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4276 2005-03-02 Raja R Harinath <rharinath@novell.com>
4278 Unify DeclSpace.LookupType and DeclSpace.FindType.
4279 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
4280 is in charge of defining nested types on demand.
4281 (DeclSpace.LookupType): Use it when the current_type is a
4282 TypeBuilder. Use LookupTypeDirect for reflected types.
4283 (DeclSpace.FindType): Remove.
4284 (DeclSpace.LookupInterfaceOrClass): Likewise.
4285 (DeclSpace.DefineTypeAndParents): Likewise.
4286 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4287 DeclSpace.LookupType.
4288 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4289 * typemanager.cs (LookupType): Simplify.
4290 (AddUserType): Remove type from negative_hits.
4291 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4292 * class.cs (TypeContainer.FindMembers): Move handling of nested
4294 (TypeContainer.FindMembers_NestedTypes): ... here.
4295 (TypeContainer.FindNestedType): Implement override.
4296 (ClassPart.FindNestedType): Delegate to PartialContainer.
4297 (ClassPart.PartFindNestedType): Looks up the nested types of the
4300 2005-04-14 Martin Baulig <martin@ximian.com>
4302 * generic.cs (ConstructedType): Moved all the type lookup and
4303 nested class logic into SimpleName.
4304 (ConstructedType.ResolveConstructedType): Our underlying type is
4305 already fully resolved; all the type lookup stuff is in
4308 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4309 constructed types here instead of in ConstructedType.
4311 * decl.cs (MemberName.GetTypeExpression): Always create a
4312 SimpleName, not a ConstructedType.
4313 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4315 2005-03-02 Martin Baulig <martin@ximian.com>
4317 * class.cs (TypeContainer.DoDefineMembers): We also need a default
4318 static constructor in static classes.
4320 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
4322 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4323 sizeParamIndex is not specified.
4325 2005-03-01 Marek Safar <marek.safar@seznam.cz>
4328 * report.cs (WarningMessage.IsEnabled): Missing null check.
4330 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4332 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4333 in the fields and not in the properties.
4335 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
4337 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
4340 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4342 * attribute.cs: Small refactoring (improved robustness).
4343 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4344 (ValidateGuid): Removed.
4345 (Resolve): Removed referenced to above mentioned.
4346 (GetAttributeUsage): Made private and changed to work without
4348 (GetIndexerAttributeValue): Don't crash.
4349 (GetConditionalAttributeValue): Ditto.
4350 (GetClsCompliantAttributeValue): Ditto.
4351 (ExtractSecurityPermissionSet): All attributes exceptions are
4353 (GetPropertyValue): New helper.
4354 (GetMethodImplOptions): New method.
4355 (DefinePInvokeMethod): Reuse common code. Implemented handling of
4356 some missing properties.
4358 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4359 (Method.ApplyAttributeBuilder): Updated.
4361 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4364 2005-02-28 Raja R Harinath <rharinath@novell.com>
4367 * report.cs (Report.SymbolRelatedToPreviousError): Handle
4368 non-simple types (array, pointer, reference).
4370 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4372 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4374 * class.cs (MethodCore.IsDuplicateImplementation): Special error
4376 (Method.CheckBase): Catch wrong destructor here.
4377 (MethodData.Define): Add errors 550, 668.
4379 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4381 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4383 * pending.cs (VerifyPendingMethods): Add error 551.
4385 * typemanager.cs (CSharpName): Next error report helper.
4387 2005-02-25 Marek Safar <marek.safar@seznam.cz>
4389 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4390 attributes. Removed useless attribute double check.
4391 It saves almost 2MBs for corlib.
4393 2005-02-25 Raja R Harinath <rharinath@novell.com>
4396 * statement.cs (ExpressionStatement.Resolve): Make robust to being
4397 called twice in case of error.
4399 2005-02-23 Chris Toshok <toshok@ximian.com>
4401 Fix compiler portions of #72827.
4402 * statement.cs (Block.Emit): call Begin/EndScope on the
4403 EmitContext instead of the ILGenerator.
4405 * codegen.cs (EmitContext.BeginScope): new method, call
4406 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4408 (EmitContext.BeginScope): same, but EndScope and CloseScope
4410 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4411 offset and call the superclass's OpenScope(int) with it.
4412 (SymbolWriter.CloseScope): get the current il
4413 offset and call superclass's CloseScope(int) with it.
4415 2005-02-23 Marek Safar <marek.safar@seznam.cz>
4417 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4418 CS1677 for out and ref as well.
4420 * class.cs (Method.Define): Add error CS1599 detection.
4422 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4424 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4426 * delegate.cs (Delegate.Define): Add error CS1599 detection.
4428 * support.cs.cs (ModifierDesc): New helper method.
4430 2005-02-23 Raja R Harinath <rharinath@novell.com>
4431 Abin Thomas <projectmonokochi@rediffmail.com>
4432 Anoob V E <projectmonokochi@rediffmail.com>
4433 Harilal P R <projectmonokochi@rediffmail.com>
4436 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4437 MemberLookup (used for error reporting) actually returns a result.
4438 Fix error report number (122, not 112).
4440 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
4441 Anoob V E <projectmonokochi@rediffmail.com>
4442 Harilal P R <projectmonokochi@rediffmail.com>
4445 * pending.cs (PendingImplementation.GetAbstractMethods):
4446 Find NonPublic members too.
4448 2005-02-22 Marek Safar <marek.safar@seznam.cz>
4450 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4453 * class.cs (MethodCore.CheckMethodAgainstBase):
4454 Add error 239 report.
4456 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4458 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4460 * class.cs (Operator.Define): Add error 217 report.
4462 2005-02-21 Raja R Harinath <rharinath@novell.com>
4465 * expression.cs (Invocation.IsApplicable): Make public.
4466 (Invocation.IsParamsMethodApplicable): Likewise.
4467 * delegate.cs (Delegate.VerifyApplicability): Don't use
4468 Invocation.VerifyArgumentCompat for parameter applicability
4469 testing. Use Invocation.IsApplicable and
4470 Invocation.IsParamsMethodApplicable.
4472 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4474 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4476 * class.cs (Operator.Define): Add error 217 report.
4478 2005-02-21 Raja R Harinath <rharinath@novell.com>
4480 * namespace.cs (UsingEntry.Resolve): Undo change below.
4482 2005-02-21 Raja R Harinath <rharinath@novell.com>
4485 * ecore.cs (Expression.MemberLookupFailed): Add argument to
4486 disable the error message when the extended MemberLookup also
4488 (Expression.MemberLookupFinal): Update.
4489 (SimpleName.DoSimpleNameResolve): Update.
4490 * expression.cs (MemberAccess.ResolveNamespaceOrType):
4491 Don't use MemberLookupFinal.
4492 (New.DoResolve): Update.
4493 (BaseAccess.CommonResolve): Update.
4495 2005-02-21 Raja R Harinath <rharinath@novell.com>
4498 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4499 occured previously, don't resolve again.
4501 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4504 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4505 argument. Call ResolveAttributeUsage for unresolved.
4506 when types doesn't match ctor arguments.
4508 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4509 for nested attribute classes.
4510 (Class.attribute_usage): Removed.
4511 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4512 for attribute class.
4514 * ecore.cs (IsAttribute): Removed.
4516 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4518 * rootcontext.cs (RegisterAttribute): Removed, attributes are
4520 (attribute_types): Removed.
4521 (EmitCode): Global attributes are emited as the latest.
4523 2005-02-18 Marek Safar <marek.safar@seznam.cz>
4525 * class.cs (EmitFieldInitializers): Don't emit field initializer
4526 for default values when optimilization is on.
4528 * constant.cs (Constant.IsDefaultValue): New property.
4530 * driver.cs: Add /optimize handling.
4534 * literal.cs: Implement new IsDefaultValue property.
4536 * rootcontext.cs (Optimize): New field, holds /optimize option.
4538 2005-02-18 Raja R Harinath <rharinath@novell.com>
4540 Fix crasher in re-opened #72347.
4541 * namespace.cs (Namespace.Lookup): Return null if
4542 DeclSpace.DefineType returns null.
4545 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4547 2005-02-18 Raja R Harinath <rharinath@novell.com>
4549 Fix remainder of #63202. Change semantics of DoResolveLValue: it
4550 now returns null if it cannot resolve to an lvalue.
4551 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4552 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4553 returned null. Remove check for SimpleName.
4554 (EventExpr.DoResolveLValue): New.
4555 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4556 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
4558 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
4560 (Unary.ResolveOperator): Move CS0211 check ...
4561 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
4563 (Unary.DoResolveLValue): Simplify.
4564 (AddressOf.DoResolveLValue): New.
4565 (ArrayAccess.DoResolveLValue): New.
4567 2005-02-16 Marek Safar <marek.safar@seznam.cz>
4569 * attribute.cs (Attribute.Resolve): Add arguments casting for
4570 when types doesn't match ctor arguments.
4572 2005-02-16 Raja R Harinath <rharinath@novell.com>
4574 Fix parts of #63202.
4575 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4576 lookup of operator in base type. Ensure that all checks happen
4577 when the operator resolves to an "op_..." method.
4579 2005-02-15 Raja R Harinath <rharinath@novell.com>
4582 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4583 'ignore_cs0104' parameter. Pass it to ...
4584 (NamespaceEntry.Lookup): ... this.
4585 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4586 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4587 (TypeLookupExpression.DoResolveAsTypeStep): Update.
4588 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4589 Update. Request that cs0104 errors be ignored.
4590 (ComposedCast.ResolveAsTypeStep): Update.
4592 2005-02-14 Raja R Harinath <rharinath@novell.com>
4595 * expression.cs (Invocation.BetterFunction): Remove support for
4596 comparing virtual functions and their overrides.
4597 (Invocation.IsOverride): New.
4598 (Invocation.OverloadResolve): Don't consider 'override' functions
4599 during candidate selection. Store them in a lookaside list.
4600 If the selected method is a 'virtual' function, use the list to
4601 find any overrides that are closer to the LHS type.
4603 2005-02-14 Marek Safar <marek.safar@seznam.cz>
4605 * expression.cs (New.DoResolve): Add complex core type reduction.
4606 (New.Constantify): Converts complex core type syntax like 'new int ()'
4609 2005-02-14 Raja R Harinath <rharinath@novell.com>
4611 * decl.cs (EntryType.EntryType): New constructor to create an
4612 updated copy of a cache entry.
4613 (MemberCache.AddMethods): Use it.
4614 (MemberCache.ClearDeclaredOnly): Remove.
4615 (MemberCache.MemberCache): Update.
4617 2005-02-11 Miguel de Icaza <miguel@novell.com>
4619 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4620 variable. This one is represents the actual low-level declaration
4621 of the method, as opposed to the semantic level `IsStatic'.
4623 An anonymous method which is hosted into a static method might be
4624 actually an instance method. IsStatic would reflect the
4625 container, while MethodIsStatic represents the actual code
4628 * expression.cs (ParameterReference): Use the new MethodIsStatic
4629 instead of IsStatic.
4631 * anonymous.cs (AnonymousMethod.Compatible): Pass the
4632 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4633 set on the current EmitContext.
4635 * expression.cs (Cast): Overload DoResolveLValue so we can pass
4636 resolve our casted expression as an LValue. This triggers the
4637 proper LValue processing that is later required by Assign.
4641 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4643 2005-02-11 Marek Safar <marek.safar@seznam.cz>
4645 C# 2.0 Fixed buffer implementation
4647 * anonymous.cs: Update after RegisterHelperClass renaming.
4649 * attribute.cs (AttributeTester.fixed_buffer_cache):
4650 Cache of external fixed buffers.
4651 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4652 implementation if field is fixed buffer else null.
4655 (TypeContainer.AddField): Accept FieldMember instead of Field.
4656 (FieldBase.IsFieldClsCompliant): Extracted code from
4657 VerifyClsCompliance descendant customization.
4658 (FixedField): New class handles fixed buffer fields.
4659 (FixedFieldExternal): Keeps information about imported fixed
4661 (IFixedField): Make access to internal or external fixed buffer
4664 * cs-parser.jay: Add fixed buffer parsing.
4666 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4669 * expression.cs (Indirection): Extended implementation to accept
4671 (PointerArithmetic.Emit): Get element from fixed buffer as well.
4672 (ElementAccess.MakePointerAccess): Get type as parameter.
4673 (DoResolve): Add fixed buffer field expression conversion.
4674 (DoResolveLValue): Ditto.
4675 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4676 (ArrayPtr): Derives from FixedBufferPtr.
4677 (ArrayPtr.Emit): Add extra emit for array elements.
4679 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4681 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4682 for compiler generated types.
4683 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4685 * statement.cs (Fixed): Refactored to be easier add fixed buffer
4686 and consume less memory.
4687 (Fixed.Resolve): Add fixed buffer case.
4689 * typemanager.cs (compiler_generated_attr_ctor,
4690 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
4691 (HasElementType): Add our own implementation to work on every
4694 2005-02-11 Miguel de Icaza <miguel@novell.com>
4696 * anonymous.cs (CaptureContext): Track whether `this' has been
4699 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
4700 only captured `this' if it was implicitly done (instance
4701 methods/variables were used).
4703 * codegen.cs (EmitContext.CaptureThis): New method to flag that
4704 `this' must be captured.
4706 2005-01-30 Miguel de Icaza <miguel@novell.com>
4708 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
4709 is null it means that there has been no need to capture anything,
4710 so we just create a sibling.
4712 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
4714 Just a partial fix. The other half is fairly elusive.
4716 2005-02-10 Raja R Harinath <rharinath@novell.com>
4718 Fix #52586, cs0121-4.cs.
4719 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
4720 and return a hashtable.
4721 (MemberCache.ClearDeclaredOnly): New.
4722 (MemberCache.MemberCache): Update to change. Make a deep copy of
4723 the method_hash of a base type too.
4724 (MemberCache.AddMethods): Adapt to having a deep copy of the base
4725 type methods. Overwrite entries with the same MethodHandle so
4726 that the ReflectedType is correct. The process leaves in base
4727 virtual functions and their overrides as distinct entries.
4728 (CacheEntry): Now a class instead of a struct. It shouldn't alter
4729 matters since it was boxed in a ArrayList before.
4730 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
4732 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
4733 case of a virtual function and its override (choose the overload
4735 (Invocation.OverloadResolve): Avoid 'override' members during
4736 'applicable_type' calculation.
4738 2005-03-28 Raja R Harinath <rharinath@novell.com>
4740 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4741 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4742 GetTypeHandle. It is possible for a reflected type to derive from
4743 a TypeBuilder (e.g., int[] derives from the TypeBuilder
4744 System.Array during mscorlib compilation).
4745 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4746 contain a method_hash, don't create one either. Don't create a
4747 deep copy of the base cache's method_hash.
4748 (MemberCache.SetupCache): Rename back from DeepCopy.
4749 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4750 already initialized. If we see an override function, add its
4751 underlying base virtual function to the member_hash too.
4753 2005-02-09 Raja R Harinath <rharinath@novell.com>
4755 Combine two near-redundant caches.
4756 * typemanager.cs (method_params): Rename from method_internal_params.
4757 (TypeManager.GetParameterData): New. Replace
4758 Invocation.GetParameterData.
4759 (TypeManager.LookupParametersByBuilder): Remove.
4760 * expression.cs (Invocation.method_parameter_cache): Remove.
4761 (Invocation.GetParameterData): Remove.
4763 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
4766 2005-02-08 Raja R Harinath <rharinath@novell.com>
4769 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
4770 TypeManager.multicast_delegate_type is null, resolve it by looking
4771 up "System.MulticastDelegate".
4772 * rootcontext.cs (RootContext.ResolveCore): Simplify.
4774 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
4775 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
4776 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
4779 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
4780 (LabeledStatement.AddReference): New. Set 'referenced'.
4781 (Goto.Resolve): Use it.
4783 2005-02-05 John Luke <john.luke@gmail.com>
4785 * driver.cs: remove duplicate -doc line in Usage ()
4787 2005-02-04 Raja R Harinath <rharinath@novell.com>
4789 * location.cs (Location.AddFile): Fix CS2002 error report.
4791 2005-02-02 Martin Baulig <martin@ximian.com>
4793 * delegate.cs (Delegate.DefineType): Report an internal error if
4794 TypeManager.multicast_delegate_type is null. See bug #72015 for
4797 2005-02-02 Raja R Harinath <rharinath@novell.com>
4799 Fix a crasher in a variant of #31984.
4800 * const.cs (Constant.CheckBase): New override that defers the
4801 new-or-override check in case the base type hasn't been populated
4803 (Constant.Define): Ensure the new-or-override check is performed.
4805 2005-02-01 Duncan Mak <duncan@ximian.com>
4807 * const.cs (LookupConstantValue): Check that `ce' is not null
4808 before calling GetValue ().
4810 2005-02-01 Raja R Harinath <rharinath@novell.com>
4812 Fix test-334.cs (#69519).
4813 * cs-parser.jay (using_alias_directive): Pass in an expression to
4814 NamespaceEntry.UsingAlias.
4815 (using_namespace_directive): Pass in an expression to
4816 NamespaceEntry.Using.
4817 (namespace_name): Don't flatten to a string.
4818 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
4819 (NamespaceEntry.AliasEntry.Resolve): Lookup using
4821 (NamespaceEntry.UsingEntry): Likewise.
4822 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
4824 (NamespaceEntry.LookupForUsing): Remove.
4825 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
4827 (NamespaceEntry.Lookup): Remove support for dotted names.
4829 2005-02-01 Raja R Harinath <rharinath@novell.com>
4831 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
4833 (NamespaceEntry.ImplicitParent): Compute on demand.
4834 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
4835 parallels the current.
4836 (NamespaceEntry.LookupForUsing): Use it.
4837 (NamespaceEntry.Lookup): If the current namespace-entry is
4838 implicit, don't search aliases and using tables.
4840 2005-02-01 Raja R Harinath <rharinath@novell.com>
4843 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
4845 (TypeContainer.BaseCache): Compute on demand.
4846 (TypeContainer.FindMembers): Define constants and types if they're
4847 not already created.
4848 (FieldMember.Define): Move resetting of ec.InUnsafe before error
4850 * const.cs (Constant.Define): Make idempotent.
4852 2005-01-29 Miguel de Icaza <miguel@novell.com>
4854 * pending.cs: Produce better code (no nops produced by using Ldarg
4857 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
4858 i - 1' it should be arg + 1.
4862 2005-01-28 Raja R Harinath <rharinath@novell.com>
4864 * attribute.cs (Attribute.CheckAttributeType): Make private
4866 (Attribute.ResolveType): Make virtual.
4867 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
4868 handling of RootContext.Tree.Types.
4870 2005-01-27 Raja R Harinath <rharinath@novell.com>
4872 Update attribute-handling to use the SimpleName/MemberAccess
4874 * cs-parser.jay (attribute): Pass in an expression to the
4875 constructors of Attribute and GlobalAttribute.
4876 * attribute.cs (Attribute): Take an expression for the name.
4877 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
4878 passed in attribute name expression.
4879 (Attribute.CheckAttributeType): Use it.
4880 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
4881 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
4882 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
4883 argument to prevent error messages if the lookup fails.
4885 2005-01-27 Marek Safar <marek.safar@seznam.cz>
4887 * expression.cs (Indirection): Implemented IVariable interface
4888 to support indirection in AddressOf operator.
4889 (PointerArithmetic.Emit): Add optimalization for case where
4890 result can be precomputed.
4892 2005-01-26 Martin Baulig <martin@ximian.com>
4894 * class.cs (TypeContainer.AttributeTargets): Return the correct
4895 AttributeTargets depending on our `Kind' instead of throwing an
4896 exception; fixes #71632.
4898 2005-01-26 Marek Safar <marek.safar@seznam.cz>
4901 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
4904 2005-03-17 Martin Baulig <martin@ximian.com>
4906 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4907 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4909 2005-03-17 Martin Baulig <martin@ximian.com>
4911 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4912 to bool so we can return an error condition.
4913 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4916 2005-03-17 Martin Baulig <martin@ximian.com>
4918 * generic.cs (TypeMananager.IsIEnumerable): New public method.
4920 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
4921 converting from an array-type of T to `IEnumerable<T>'.
4923 2005-03-16 Martin Baulig <martin@ximian.com>
4925 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
4926 (Nullable.LiftedUnaryMutator): New public class.
4928 * expression.cs (UnaryMutator.DoResolve): Added support for
4931 2005-03-14 Martin Baulig <martin@ximian.com>
4933 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
4935 2005-03-14 Martin Baulig <martin@ximian.com>
4937 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
4938 the comparision operators `<', `>', `<=' and `>='.
4940 2005-03-13 Martin Baulig <martin@ximian.com>
4943 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
4944 avoid confusion with the `NullLiteral'.
4945 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
4947 2005-03-13 Martin Baulig <martin@ximian.com>
4949 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
4950 comparing arbitrary types with the null literal.
4952 2005-03-13 Martin Baulig <martin@ximian.com>
4954 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
4955 boolean operators '&&', '||', '&' and '|'.
4956 (Nullable.OperatorTrueOrFalse): New public class.
4958 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
4959 instead of a `StaticCallExpr'; added support for nullables.
4961 2005-03-10 Martin Baulig <martin@ximian.com>
4964 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
4965 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
4967 2005-03-07 Martin Baulig <martin@ximian.com>
4969 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
4970 it work if `expr' is not an IMemoryLocation.
4971 (Nullable.Lifted): Implement IMemoryLocation.
4972 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
4975 2005-03-05 Martin Baulig <martin@ximian.com>
4977 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
4978 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
4979 (Nullable): Added support for lifted unary and binary operators.
4981 * expression.cs (Unary.DoResolve): Added support for nullable types.
4982 (Binary.DoResolve): Likewise.
4983 (Conditional.DoResolve): Likewise.
4985 2005-03-02 Martin Baulig <martin@ximian.com>
4987 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
4989 * class.cs (ClassPart.SetParameterInfo): Override this.
4990 (PartialContainer.SetParameterInfo): Override this.
4991 (TypeContainer.CheckConstraints): New protected method.
4992 (PartialContainer.CheckConstraints): Override this and check
4993 whether the same contraints were specified in all parts of a
4994 partial generic type definition.
4995 (PartialContainer.UpdateConstraints): New public method.
4997 * generic.cs (TypeParameter.UpdateConstraints): New public method.
4999 2005-03-02 Martin Baulig <martin@ximian.com>
5001 Committing a patch from Carlos Alberto Cortez to fix #72887.
5003 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5004 casts from `T []' to `int []'.
5006 2005-03-02 Martin Baulig <martin@ximian.com>
5008 * generic.cs (TypeManager.IsEqual): Make this symmetric.
5010 * expression.cs (Binary.ResolveOperator): When resolving a
5011 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5012 `=='. Fixes #71866. See gen-127.cs.
5014 2005-03-02 Martin Baulig <martin@ximian.com>
5016 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5017 static constructor in static classes.
5019 2005-03-02 Martin Baulig <martin@ximian.com>
5022 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5023 (Nullable.LiftedConversion): Added support for user-defined
5026 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5028 * cs-parser.jay: Use ComposedCast everywhere instead of
5029 NullableType, so we don't need to check for NullableType
5031 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5032 case where we'll be resolved into a `parenthesized_expression_0'
5036 (Convert.UserDefinedConversion): Added nullable conversions.
5038 2005-02-28 Martin Baulig <martin@ximian.com>
5040 * generic.cs (TypeManager.IsNullableType): New static method.
5041 (Nullable): New abstract class.
5042 (Nullable.NullLiteral): New public class.
5043 (Nullable.LiftedConversion): New public class.
5045 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5046 `builtin_types opt_nullable'.
5049 (Convert.ImplicitConversionStandard): Added nullable conversions.
5050 (Convert.ExplicitConversionStandard): Likewise.
5051 (Convert.ExplicitConversion): Likewise.
5053 2005-02-26 Martin Baulig <martin@ximian.com>
5055 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5056 begin with a "?", for instance "?[]". Don't do a type lookup if
5059 2005-02-25 Martin Baulig <martin@ximian.com>
5061 The first part of Nullable Types :-)
5063 * generic.cs (NullableType): New public class.
5064 (NullCoalescingOperator): New public class.
5065 (TypeArguments.Resolve): Add a CS0306 check.
5067 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5068 (opt_nullable): New rule.
5069 (type): Added `opt_nullable' to `namespace_or_type_name',
5070 `builtin_types' and `pointer_type'.
5071 (array_type): Added `opt_nullable'.
5072 (opt_rank_specifier_or_nullable): New rule; this is the
5073 combination of `opt_rank_specifier' and `opt_nullable'.
5074 (opt_error): New rule; catch errors here.
5075 (nullable_type_or_conditional): New rule; we use this to check for
5076 nullable and still detect the conditional operator.
5077 (local_variable_type): Use `opt_rank_specifier_or_nullable'
5078 instead `opt_rank_specifier'.
5080 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5083 2005-02-24 Martin Baulig <martin@ximian.com>
5085 * README, README.Changes: Removed; they're old and obsolete.
5087 2005-02-22 Martin Baulig <martin@ximian.com>
5089 * generic.cs (TypeParameter.Resolve): If resolving the constraints
5090 returned an error, set `constraints' to null to avoid a crash
5092 (TypeParameter.ResolveType): Likewise.
5094 2005-02-22 Martin Baulig <martin@ximian.com>
5097 (Constraints.ResolveTypes): Protect against being called twice.
5098 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5099 (TypeParameter.ResolveType): New public method; calls
5100 constraints.ResolveTypes().
5101 (TypeParameter.DefineType): Moved constraints.ResolveType() out
5102 into the new ResolveType().
5103 (GenericMethod.Define): Call ResolveType() on all our
5106 2005-02-21 Martin Baulig <martin@ximian.com>
5109 (TypeManager.generic_nullable_type): New static public field.
5110 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5113 (RootContext.ResolveCore): Resolve "System.Nullable`1".
5115 2005-02-15 Martin Baulig <martin@ximian.com>
5117 * generic.cs (ConstructedType.Constraints): Correctly check
5118 constraints if the argument type is a type parameter; fixes
5121 2005-02-02 Martin Baulig <martin@ximian.com>
5123 * delegate.cs (Delegate.DefineType): Report an internal error if
5124 TypeManager.multicast_delegate_type is null. See bug #72015 for
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-26 Martin Baulig <martin@ximian.com>
5139 * cs-parser.jay (indexer_declarator): Don't report an error if we
5140 have type parameters since we can be an explicit interface
5141 implementation; fixes #71449.
5143 2005-01-26 Martin Baulig <martin@ximian.com>
5145 * class.cs (TypeContainer.AttributeTargets): Return the correct
5146 AttributeTargets depending on our `Kind' instead of throwing an
5147 exception; fixes #71632.
5149 2005-01-26 Martin Baulig <martin@ximian.com>
5151 * delegate.cs (Delegate.DefineType): Correctly define our type
5152 parameters. Fixes #71483.
5154 2005-01-25 Raja R Harinath <rharinath@novell.com>
5157 * expression.cs (MemberAccess.DoResolve): Don't complain with
5158 cs0572 when the LHS of a member access has identical name and type
5161 2005-01-25 Marek Safar <marek.safar@seznam.cz>
5164 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5166 Create custom PermissionSet only for PermissionSetAttribute.
5168 2005-01-24 Marek Safar <marek.safar@seznam.cz>
5171 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5172 delegates in static class.
5174 2005-01-24 Martin Baulig <martin@ximian.com>
5176 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5177 merging an implicit block, just use its reachability.
5179 * statement.cs (Block.Resolve): Make the unreachable code check
5180 work wrt. implicit blocks; see test-337 from #63842.
5182 2005-01-21 Alp Toker <alp@atoker.com>
5184 * cs-parser.jay: destructor_declaration's container is PartialContainer
5185 not Class when partial types are used, so use Kind prop instead of
5188 2005-01-22 Miguel de Icaza <miguel@ximian.com>
5190 * cs-parser.jay: Improve error reporting when an interface
5193 2005-01-20 Dick Porter <dick@ximian.com>
5195 * support.cs: SeekableStreamReader fix from Sandor Dobos
5196 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5197 chars are read. Fixes bug 70369.
5199 2005-01-20 Raja R Harinath <rharinath@novell.com>
5201 * cs-parser.jay (catch_clause): Simplify current_block handling
5204 2005-01-17 Miguel de Icaza <miguel@ximian.com>
5206 * convert.cs (ImplicitStandardConversionExists): Synchronize the
5207 code with ImplicitStandardConversion to handle the implicit
5208 conversion of method groups into valid delegate invocations.
5210 The problem is that in parameter handling we were using this code
5211 path. Fixes bug #64698
5213 2005-01-19 Raja R Harinath <rharinath@novell.com>
5215 * cs-parser.jay: Fix several infelicities.
5216 - Avoid assigning to the parser value stack. Code like
5217 '$3 = null' is unclean. Synthesize a value for the code block
5219 - Avoid using oob_stack for storing location information. Use ...
5220 (_mark_): ... this. New (empty) rule. Saves the current location
5222 (foreach_statement): Avoid using oob_stack for current_block
5223 handling. Use technique used in for_statement and
5224 using_statement. Synthesize a value for the code block to store
5225 additional intermediate information.
5227 2005-01-13 Miguel de Icaza <miguel@ximian.com>
5229 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5230 of a different type is only allowed to private fields of a
5231 containing type, not on fields of a base class.
5233 See test-174.cs and error cs0122-9.cs
5235 2005-01-13 Raja R Harinath <rharinath@novell.com>
5237 Fix test-335.cs (bug #58126).
5238 * cs-parser.jay (argument): Split out non-expression parts of the
5239 rule into 'non_simple_argument'.
5240 (invocation_expression): Support parenthesized invocations with
5241 multiple arguments, and with single non-simple arguments.
5243 2005-01-13 Raja R Harinath <rharinath@novell.com>
5245 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5248 2005-01-12 Raja R Harinath <rharinath@novell.com>
5250 Fix cs0038-1.cs, cs1640-6.cs.
5251 * ecore.cs (Expression.Resolve): Remove special-case for
5252 SimpleName in error-handling.
5253 (Expression.almostMatchedMembers): Relax access permission to
5255 (Expression.MemberLookupFailed): Handle duplicates in
5256 almostMatchedMembers list.
5257 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5258 * expression.cs (New.DoResolve): Report CS1540 for more cases.
5259 * typemanager.cs (GetFullNameSignature): Use the MethodBase
5260 overload if the passed in MemberInfo is a MethodBase.
5262 2005-01-25 Martin Baulig <martin@ximian.com>
5265 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5267 2005-01-12 Marek Safar <marek.safar@seznam.cz>
5270 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5271 for non-CAS & merge permission sets properly.
5273 2005-01-11 Raja R Harinath <rharinath@novell.com>
5275 Improve standard-compliance of simple name and member access
5276 resolution. Fixes bugs #52697, #57200, #67520, #69519.
5277 * ecore.cs (FullNamedExpression): New abstract base class
5278 for Namespaces and TypeExpressions.
5279 (ResolveFlags.SimpleName): Remove.
5280 (SimpleName): Remove support for dotted names.
5281 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
5282 DeclSpace.FindType and DeclSpace.LookupType.
5283 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5284 (Expression.ExprClassName): Make member function.
5285 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5286 a namespace. Remove creation of dotted "SimpleName"s.
5287 (MemberAccess.DoResolve): Likewise.
5288 * decl.cs (DeclSpace.Cache): Make private.
5289 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5290 (DeclSpace.FindType): Update.
5291 (DeclSpace.LookupType): Move here from RootContext. Return a
5292 FullNamedExpression.
5293 * namespace.cs (Namespace): Derive from FullNamedExpression
5294 so that it can be part of expression resolution.
5295 (Namespace.Lookup): Return an FullNamedExpression.
5296 (NamespaceEntry.LookupAlias): Lookup aliases only in current
5298 * rootcontext.cs (NamespaceLookup): Remove.
5299 (LookupType): Move to DeclSpace.
5300 * attribute.cs (CheckAttributeType): Update.
5301 * doc.cs (FindDocumentedType): Remove allowAlias argument.
5302 (FindDocumentedTypeNonArray): Likewise.
5304 2005-01-11 Raja R Harinath <rharinath@novell.com>
5306 Fix cs0509.cs, cs1632.cs.
5307 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5308 is the same as IsInterface.
5309 (TypeContainer.GetClassBases): Likewise.
5310 * statement.cs (LabeledStatement.ig): New field.
5311 (LabeledStatement.LabelTarget): Save ILGenerator which created the
5313 (LabeledStatement.DoEmit): Check that the label was created with
5314 the same ILGenerator.
5316 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5319 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5320 accessors to its properties.
5322 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5323 from accessors to property.
5325 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5328 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5331 2005-01-08 Miguel de Icaza <miguel@ximian.com>
5333 * attribute.cs: Check for null and empty strings.
5335 I have lost another battle to Paolo.
5337 2005-01-07 Marek Safar <marek.safar@seznam.cz>
5340 * class.cs (PropertyMethod): Set Parent field in ctors.
5341 (SetMethod.InternalParameters): Add unsafe switch hack.
5342 Override MarkForDuplicationCheck where it is appropriate.
5344 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5345 It says whether container allows members with the same name.
5347 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5348 Removed is_method parameter.
5350 2005-01-06 Duncan Mak <duncan@ximian.com>
5352 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5353 because the previous change led to incorrect reporting of CS1032
5354 ("Cannot define/undefine preprocessor symbols after first token in
5355 file"). Instead of using `tokens_seen' as the only flag that
5356 triggers CS1040, introduce `comments_seen'. This new flag is used
5357 to signify having seen comments on the current line, so it is
5358 unset after a newline.
5360 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5362 * doc.cs : When searching for a type, find nested type too.
5363 This fixes bug #71040.
5365 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5368 - Warn missing member comment on those classes which also does not
5369 have doc comments. Fixed bug #71041.
5370 - Don't warn missing doc comment on default constructor.
5373 2005-01-06 Duncan Mak <duncan@ximian.com>
5375 * cs-tokenizer.cs (xtoken): After handling traditional C-style
5376 comments, set `tokens_seen' to true. This allows us to detect
5377 misplaced preprocessor directives (i.e. not at the beginning of
5378 the a line, nor after whitespaces). In that case, report error
5379 CS1040. This fixes bug #56460.
5381 * cs-parser.jay (interface_member_declaration): Add checks for
5382 IsExplicitImpl, and report CS0541 error if an interface member is
5383 defined as an explicit interface declaration.
5385 2005-01-06 Marek Safar <marek.safar@seznam.cz>
5388 * class.cs (PropertyMethod): Set Parent field in ctors.
5389 (SetMethod.InternalParameters): Add unsafe switch hack.
5391 * decl.cs (MemberCore.Parent): Cannot be readonly.
5393 2005-01-06 Raja R Harinath <rharinath@novell.com>
5395 * decl.cs (DeclSpace.ResolveType): Remove.
5396 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5397 Merge in code from ...
5398 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
5399 * class.cs, enum.cs: Update to changes.
5401 2005-01-06 Miguel de Icaza <miguel@ximian.com>
5403 * anonymous.cs: Ensure that we init the scope of our parent if it
5404 has not been initialized yet.
5406 2004-12-30 Duncan Mak <duncan@ximian.com>
5408 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5409 if field.FieldBuilder is null. Fixes #70758.
5411 * convert.cs: Fixed some typos and updated some of the comments.
5412 (ImplicitStandardConversionExists):
5413 (TryImplicitIntConversion): If `target_type' is an interface and
5414 the type of `ic' implements this interface, return true or a new
5415 BoxedCast instead of null. This fixes #70468.
5417 2004-12-29 Duncan Mak <duncan@ximian.com>
5419 * expression.cs (Argument.Emit): Check that Expr is
5420 IMemoryLocation before casting to it, and report CS1510 otherwise.
5424 2004-12-21 Ben Maurer <bmaurer@ximian.com>
5426 * statement.cs (Block.ThisVariable): remove the recursion here, to
5427 make the --profile more sane.
5429 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
5431 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5432 assembly, by JB Evain.
5434 2004-12-17 Raja R Harinath <rharinath@novell.com>
5436 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
5437 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5438 "parent" refers to enclosing type/class. "base" refers to superclass.
5440 2004-12-17 Raja R Harinath <rharinath@novell.com>
5442 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5443 Ensure that we only have GlobalAttributes.
5444 * attribute.cs (Attribute.Emit): Make non-virtual.
5445 (GlobalAttribute.Emit): Remove.
5446 (Attribute.Resolve): Make virtual.
5447 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
5448 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5449 the argument. Don't create one.
5450 (Attribute.GetObsoleteAttribute): Likewise.
5451 (Attribute.GetClsCompliantAttributeValue): Likewise.
5452 * class.cs, decl.cs: Update to changes.
5454 2004-12-17 Marek Safar <marek.safar@seznam.cz>
5456 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5458 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5460 * statement.cs (Foreach.Resolve): Add error 186 report.
5462 2004-12-16 Marek Safar <marek.safar@seznam.cz>
5464 * expression.cs (Conditional.DoResolve): Add warning 429.
5466 * statement.cs (If.Resolve): Add warning 665.
5468 2004-12-16 Raja R Harinath <rharinath@novell.com>
5470 New invariant: RootContext.Tree.Types.NamespaceEntry == null
5471 except when in the parser, and in GlobalAttribute.
5472 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5473 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5474 RootContext.Tree.Types.NamespaceEntry once work is done.
5475 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
5476 and resets RootContext.Tree.Types.NamespaceEntry.
5478 2004-12-15 Marek Safar <marek.safar@seznam.cz>
5480 * cs-parser.jay: Don't create a block for every variable.
5482 2004-12-14 Miguel de Icaza <miguel@ximian.com>
5484 * location.cs: Provide extra information.
5486 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5487 variables from the captured environment, it is the ldarg_0.
5489 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5491 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5494 * class.cs: Changed warning level for 169 to avoid developer
5495 displeasure from warning flooding. It will be changed back when they
5496 fix most of current BCL warnings.
5498 * RootContext.cs: Pushed default WarningLevel to 3.
5500 * statement.cs: Removed unused variable.
5502 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5504 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5505 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5506 Add error 502 report.
5507 (StaticClass.DefineType): Add error 441 report.
5508 (Class.AllowedModifiersProp): New virtual property as temporary
5509 extension to AllowedModifiers.
5510 (Class.DefineType): Add error 418 report. Moved ModFlags check here
5511 to share implementation with StaticClass and don't call virtual
5514 * driver.cs (MainDriver): Add error 1558 test.
5516 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5517 report. Moved error 36 test here.
5519 * statement.cs (Throw.Resolve): Add error 724 report.
5521 * typemanager.cs: Add out_attribute_type core type.
5523 2004-12-13 Marek Safar <marek.safar@seznam.cz>
5525 * class.cs (TypeContainer.VerifyClsCompliance): Add error
5527 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5529 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5532 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5534 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
5535 Add error 3023 report.
5536 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5538 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5541 2004-12-12 John Luke <john.luke@gmail.com>
5543 * driver.cs (AddArgs): take -- into account when
5544 adding arguments, fixes bug 65710
5546 2004-12-12 Martin Baulig <martin@ximian.com>
5548 * expression.cs (Unary.TryReduceNegative): Added support for
5549 SByteConstant and ByteConstant.
5550 (Unary.Reduce): Check error values from TryReduceNegative().
5552 2004-12-10 Marek Safar <marek.safar@seznam.cz>
5554 * attributes.cs (Attribute.Resolve): Avoid multiple error report
5555 and report exception as error 182.
5557 2004-12-10 Raja R Harinath <rharinath@novell.com>
5559 * driver.cs (Main): Fix message when there are warnings.
5561 2004-12-09 Miguel de Icaza <miguel@ximian.com>
5563 * delegate.cs: Fixed my fix from yesterday, sorry about that.
5565 2004-12-09 Marek Safar <marek.safar@seznam.cz>
5567 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
5568 Reduced number of warnings.
5570 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5572 2004-12-08 Miguel de Icaza <miguel@ximian.com>
5574 * driver.cs: Removed message.
5576 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5578 2004-12-08 <vargaz@freemail.hu>
5580 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5582 2004-12-08 Martin Baulig <martin@ximian.com>
5584 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5585 instead of a CS3002 for properties and indexer.
5587 2004-12-08 Martin Baulig <martin@ximian.com>
5589 * decl.cs (MemberName.ToString): Make this work again.
5591 2004-12-08 Marek Safar <marek.safar@seznam.cz>
5593 * attribute.cs (Resolve): Add error 591 detection.
5595 * class.cs (FieldMember.Define): Add error 1547 detection.
5596 (Indexer.Define): Add error 620 detection.
5597 (Operator.Define): Add error 590 detection.
5599 * ecore.cs: Missing argument for error 79.
5601 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5604 2004-12-07 Marek Safar <marek.safar@seznam.cz>
5607 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5610 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
5612 * cs-parser.jay : handle doc comments on implicit/explicit operators.
5613 Some operator comments were suppressed.
5614 * doc.cs : Implicit/explicit operator name in doc comments are like
5615 "op_Explicit(type)~returnType", so added suffix handling.
5617 2005-01-21 Alp Toker <alp@atoker.com>
5619 * cs-parser.jay: destructor_declaration's container is PartialContainer
5620 not Class when partial types are used, so use Kind prop instead of 'is'.
5622 2004-12-12 Martin Baulig <martin@ximian.com>
5624 * expression.cs (Unary.TryReduceNegative): Added support for
5625 SByteConstant and ByteConstant.
5626 (Unary.Reduce): Check error values from TryReduceNegative().
5628 2004-12-11 Martin Baulig <martin@ximian.com>
5630 * support.cs (ReflectionParameters.ParameterName): If we have a
5631 `gpd', call `ParameterName' on it.
5633 * parameter.cs (Parameter.GetParameterAttributes): New static method.
5635 * pending.cs (PendingImplementation.DefineProxy): Call
5636 DefineParameter() for all of the MethodBuilder's arguments.
5638 2004-12-09 Martin Baulig <martin@ximian.com>
5640 * doc.cs (DocUtil): Make this a static class.
5642 2004-12-09 Martin Baulig <martin@ximian.com>
5644 * expression.cs (Invocation.InferType): Moved the type inference
5645 implementation into TypeManager.
5647 * generics.cs (TypeManager): Moved the type inference
5648 implementation here.
5650 2004-12-09 Martin Baulig <martin@ximian.com>
5652 * typemanager.cs (TypeManager): Make this a partial class.
5655 (TypeManager): Move the generics part of `TypeManager' here.
5657 2004-12-08 Martin Baulig <martin@ximian.com>
5659 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5660 instead of a CS3002 for properties and indexer. Added CS3024
5661 check for generic interfaces.
5663 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
5664 instances are not CLS-compliant.
5666 2004-12-08 Martin Baulig <martin@ximian.com>
5669 (void_pointer_expression): New rule for `void*', `void**' etc.
5670 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
5672 2004-12-08 Martin Baulig <martin@ximian.com>
5674 * expression.cs (Invocation.InferType): Removed the hack for
5675 MethodCore.MayUnify().
5677 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
5680 * class.cs (MethodCore.MayUnify): Use
5681 TypeManager.MayBecomeEqualGenericTypes().
5683 2004-12-08 Martin Baulig <martin@ximian.com>
5685 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
5686 parameter, box it. Fixes #69233.
5688 2004-12-08 Martin Baulig <martin@ximian.com>
5690 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
5691 have the ctor constraint. Fixes #68326.
5693 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
5695 * cs-parser.jay : interface comment was not consumed because of
5696 extra opt_semicolon before doc handling.
5698 2004-12-03 Raja R Harinath <rharinath@novell.com>
5700 Fix test-327.cs, test-328.cs, and put in early infrastructure
5701 for eventually fixing #52697.
5702 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
5703 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
5705 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
5706 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
5707 (VerifyUsing, error246): Update.
5708 * rootcontext.cs (RootContext.NamespaceLookup): Just use
5709 'NamespaceEntry.LookupNamespaceOrType'.
5711 2004-12-07 Martin Baulig <martin@ximian.com>
5713 * driver.cs: Call it "BETA SOFTWARE" :-)
5715 2004-12-06 Raja R Harinath <rharinath@novell.com>
5717 Fix crash on cs0657-17.cs.
5718 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5719 Use RootContext.Tree.Types, not 'new RootTypes ()'.
5720 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5721 the case where the NamespaceEntry gets overwritten.
5723 2004-12-06 Marek Safar <marek.safar@seznam.cz>
5725 Fixed #69195, #56821
5726 * ecore.cs (ResolveBoolean): Tiny refactoring.
5728 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5729 of right expression resolving when left is false constant and
5730 operator is LogicalAnd OR true constant and operator is LogicalOr.
5732 * statement.cs (ResolveUnreachable): Always reports warning.
5734 2004-12-05 Miguel de Icaza <miguel@ximian.com>
5736 * class.cs: Distinguish between 1721 and 1722 (just a little help
5737 for the programmer).
5739 2004-12-03 Miguel de Icaza <miguel@ximian.com>
5741 * delegate.cs: Only allow this on new versions of the language.
5743 2004-12-02 Duncan Mak <duncan@ximian.com>
5745 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
5747 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
5748 here as a static method. Take an additional bool out parameter
5749 `must_do_cs1540_check' for signaling to InstanceResolve.
5750 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
5751 member field from PropertyExpr class and made it an argument of
5753 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
5754 check for MarshalByRefObject, and report CS0122 instead of CS1540.
5755 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
5756 and `remove_accessor' as well as InstanceResolve: report CS0122
5761 2004-12-07 Martin Baulig <martin@ximian.com>
5763 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
5764 and CS0692 where appropriate.
5766 2004-12-06 Martin Baulig <martin@ximian.com>
5768 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
5769 IsDuplicateImplementation() and improved it.
5771 * expression.cs (Invocation.InferTypeArguments): Added
5772 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
5773 and removed the "ref" modifier from `infered_types'.
5775 * decl.cs (MemberName.ToString): Removed the exception.
5777 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
5779 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
5780 comments are allowed.
5782 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5784 * delegate.cs: Add checks for subtypes in paramaters and return values
5785 in VerifyMethod () to add support for Covariance/Contravariance
5788 2004-12-02 Miguel de Icaza <miguel@ximian.com>
5790 * report.cs: Remove extra closing parenthesis.
5792 * convert.cs (Error_CannotImplicitConversion): If the name of the
5793 types are the same, provide some extra information.
5795 2004-12-02 Marek Safar <marek.safar@seznam.cz>
5798 * attribute.cs (Resolve): Improved implementation of params
5799 attribute arguments.
5801 * support.cs (ParameterData): Add HasParams to be faster.
5803 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
5805 all things are for /doc support:
5807 * doc.cs: new file that supports XML documentation generation.
5808 * mcs.exe.sources: added doc.cs.
5810 Handle /doc command line option.
5811 Report error 2006 instead of 5 for missing file name for /doc.
5812 Generate XML documentation when required, after type resolution.
5814 Added support for picking up documentation (/// and /** ... */),
5815 including a new XmlCommentState enumeration.
5817 Added lines to fill Documentation element for field, constant,
5818 property, indexer, method, constructor, destructor, operator, event
5819 and class, struct, interface, delegate, enum.
5820 Added lines to warn incorrect comment.
5822 Added Documentation field (passed only when /doc was specified).
5824 Added DocComment, DocCommentHeader, GenerateDocComment() and
5825 OnGenerateDocComment() and some supporting private members for
5826 /doc feature to MemberCore.
5828 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
5830 Added overriden DocCommentHeader.
5832 Added overriden DocCommentHeader and GenerateDocComment().
5834 2004-12-01 Miguel de Icaza <miguel@ximian.com>
5836 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
5837 unwrapping the enumeration values, chain to
5838 DoConstantNumericPromotions again, so we can promote things to the
5839 fundamental types (takes care of enums that are bytes, sbytes).
5843 2004-12-01 Raja R Harinath <rharinath@novell.com>
5845 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
5846 Fix long-standing bug in type-lookup. Use FindType instead of
5847 LookupType when ec.ResolvingTypeTree.
5848 (Attribute.ResolveType, Attribute.Resolve)
5849 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
5851 (Attributes.Search): Remove internal version. Update.
5852 (Attributes.SearchMulti): Update.
5853 (Attributes.GetClsCompliantAttribute): Remove.
5854 (Attributes.GetIndexerNameAttribute): Remove.
5855 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
5856 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
5857 * class.cs (Indexer.Define): Likewise.
5859 2004-12-01 Marek Safar <marek.safar@seznam.cz>
5862 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
5863 MarshallByReference members access.
5865 * expression.cs: Use CheckMarshallByRefAccess;
5866 Better error CS0197 message.
5868 * report.cs: Print whole related error message.
5870 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5872 * class (GetClassBases): Better error 60 report.
5873 (EventProperty): Disabled warning 67 detection.
5875 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5878 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
5880 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
5883 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5886 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
5888 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
5890 2004-11-26 Miguel de Icaza <miguel@ximian.com>
5892 * attribute.cs (Attribute.Resolve): Refine error reporting and
5893 report a cs0117 if the identifier does not exist, to distinguish
5894 from 0617 which is a miss-use of the actual identifier.
5896 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
5897 between cs0070 and cs0079.
5899 * class.cs (MemberBase.DoDefine): When reporting a wrong
5900 accessibility level, we use MethodCore to compare instead of
5901 Method (this was a regression in some refactoring effort).
5903 So now we correctly report cs0056 again.
5905 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
5906 testing the target_type (which was known to be object_type) and
5907 not the source type (which is anonymous_method).
5909 Fixed reporting of error cs1660.
5911 * expression.cs (UserCast.Source): Expose the underlying cast.
5913 * statement.cs (Switch.SwitchGoverningType): Sort the list of
5914 allowed types to find a match to int32 first (most common).
5916 In addition, it ignores any ImplicitUserConversions that did an
5917 internal implicit conversion (as the switch statement allows only
5918 one integral conversion to exist).
5920 * class.cs (PartialContainer.Create): rename `name' to
5921 `member_name' for clarity. Then replace the string calls with a
5922 call to MemberName.GetPartialName, as now using
5923 MemberName.ToString is an error (this is due to the side effects
5924 it had, that were fixed in the past).
5926 This will restore the error reporting on a number of partial class
5927 errors that were missusing this (and getting an exception as a
5928 results, which is now just a plain textual warning, because
5929 yyparse debug output would crash otherwise).
5931 2004-11-26 Raja R Harinath <rharinath@novell.com>
5933 * Makefile (PROGRAM_INSTALL_DIR): Remove.
5935 2004-11-25 Ben Maurer <bmaurer@ximian.com>
5937 * rootcontext.cs (LookupType): Make sure to cache lookups that
5938 don't give us a negative result. This saves about 5% of corlib
5941 2004-11-25 Miguel de Icaza <miguel@ximian.com>
5943 * report.cs (AbstractMessage.Print): messages are sent to stderr
5945 * class.cs (TypeContainer.GetClassBases): It is an error to have a
5946 non-interface in the list of interfaces (at this point, either
5947 parent was properly set, or a base class is being listed in the
5948 interfaces section).
5950 This flags error 1722, and resolves the crash from bug 69259.
5952 2004-11-25 Ben Maurer <bmaurer@ximian.com>
5954 * statement.cs (Using.EmitExpressionFinally): make this work right
5955 for valuetypes. Fixes 69926.
5957 2004-11-25 Miguel de Icaza <miguel@ximian.com>
5959 * const.cs (Const.ChangeType): Cope with the "0 literal can be
5960 converted to an enum" here, before we try to change the underlying
5961 type. This code exists, but it is a different code path than the
5962 one used while encoding constants.
5964 (ImplicitReferenceConversionExists): In addition, resynchronized
5965 the code here, so it matches the same code in
5966 ImplicitReferenceConversionExists for the `from any class-type S
5967 to any interface-type T'.
5969 2004-11-25 Marek Safar <marek.safar@seznam.cz>
5971 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
5973 2004-11-24 Miguel de Icaza <miguel@ximian.com>
5975 * cs-parser.jay: Use verbosity accordingly.
5977 2004-11-24 Marek Safar <marek.safar@seznam.cz>
5979 * expression.cs (Unary.ResolveOperator): Do not report warning;
5980 AddressOf reads from variable.
5982 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
5984 2004-11-24 Marek Safar <marek.safar@seznam.cz>
5988 * attribute.cs (Attributable): Removed CheckTargets.
5989 (Attributes.Emit): Explicit attribute targets are tested here.
5991 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
5992 not enabled for interfaces.
5994 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
5995 (GetAssemblyName): Ouch next bug there.
5997 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5999 * expression.cs: Error 275 added.
6001 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6003 Fix bug #69177 (Implemented decimal constant support)
6005 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6006 (BinaryFold): Add DecimalConstant.
6008 * const.cs (Define): Decimal constant
6010 (ChangeType): Add decimal type handling.
6011 (LookupConstantValue): Don't set value for decimal type but
6012 emit DecimalConstantAttribute. Needed for constant optimization.
6014 * constant.cs (ToDecimal): New method.
6015 (ConvertToDecimal): New method.
6016 (IntConstant): Implemented ConvertToDecimal.
6017 (DecimalConstant.Emit): Emit optimized version for decimals in
6020 * expression.cs (ResolveOperator): Changed order of constant
6021 reduction to work correctly with native types which have
6022 overloaded operators.
6023 (ResolveMemberAccess): Extract constant value from attribute
6026 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6028 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6029 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6030 (ChangeType): Decimal is special.
6031 (TypeToCoreType): Add decimal type.
6033 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6035 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6038 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6040 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6043 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6045 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6047 * pending.cs (PendingImplementation): Grab only interfaces.
6049 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6051 * statement.cs (ForeachHelperMethods): Add location member and
6052 error 202 detection.
6054 2004-11-18 Marek Safar <marek.safar@seznam.cz>
6056 * expression.cs (DoResolveBase): Fixed wrong warning for out
6059 2004-12-04 Martin Baulig <martin@ximian.com>
6061 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6062 to check whether the conversion is ok.
6064 * typemanager.cs (TypeManager.GetTypeArguments): Just return
6065 `Type.EmptyTypes' if we're not a generic TypeContainer.
6067 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6069 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6070 old bug: when converting from the null literal to a pointer,
6071 return an EmptyCast, not the NullLiteral.
6073 This fixes #69921, the recent null_type changes probably made this
6076 2004-12-03 Martin Baulig <martin@ximian.com>
6078 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6079 method as our child, call AnonymousMethod.Compatible() on it.
6081 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6083 * class.cs (FieldBase): Use an unused bit field from the field to
6084 encode the `has_offset' property from the FieldMember. This saves
6085 a couple of Ks on bootstrap compilation.
6087 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6088 method as our child, return the AnonymousMethod resolved
6091 * expression.cs (New.DoResolve): Allow return values from
6092 NewDelegate to also include AnonymousMethods.
6096 2004-11-29 Raja R Harinath <rharinath@novell.com>
6098 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6100 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6101 System.Runtime.InteropServices._Exception, since it's a base
6102 interface of the core type System.Exception in the net_2_0 profile.
6104 2004-11-27 Martin Baulig <martin@ximian.com>
6106 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6108 2004-11-26 Raja R Harinath <rharinath@novell.com>
6110 * Makefile: Convert to use executable.make.
6111 * gmcs.exe.sources: New.
6113 2004-11-25 Martin Baulig <martin@ximian.com>
6115 * expression.cs (Invocation.InferType): Added support for byref types.
6117 2004-11-25 Martin Baulig <martin@ximian.com>
6119 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6120 in TypeManager.TypeToCoreType().
6122 2004-11-25 Martin Baulig <martin@ximian.com>
6124 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6125 "Dispose" method from the `current_type'.
6126 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6127 DoDefineMembers() instead of using the MethodBuilder; this is
6128 required for generic iterators.
6130 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6132 2004-11-24 Martin Baulig <martin@ximian.com>
6134 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6136 2004-11-20 Martin Baulig <martin@ximian.com>
6138 * expression.cs (Invocation.InferType): Correctly infer generic
6139 instances; see gen-103.cs.
6140 (Invocation.InferTypeArguments): If a generic method doesn't have
6141 any unbound type parameters, we don't need to infer anything.
6143 2004-11-19 Raja R Harinath <rharinath@novell.com>
6145 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6147 2004-11-17 Raja R Harinath <rharinath@novell.com>
6149 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6150 (TypeHandle.GetMemberCache): New.
6151 (TypeHandle.TypeHandle): Update.
6152 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6153 (TypeManager.LookupParentInterfacesCache):
6154 Rename from LookupInterfaceCache. Optimize slightly.
6155 (TypeManager.MemberLookup_FindMembers): Update.
6156 * decl.cs (MemberCache.MemberCache): Set Container to null in the
6158 (AddCacheContents): Rename from AddHashtable.
6159 * class.cs (TypeContainer.parent_container): Remove.
6160 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6161 (TypeContainer.DoDefineMembers): Don't initialize it.
6162 Update to name changes.
6164 2004-11-17 Miguel de Icaza <miguel@ximian.com>
6166 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6167 that factors the code to check access modifiers on override.
6169 (PropertyBase): Use the code here.
6171 Patch from Lluis S'anchez, fixes bug #69361.
6173 2004-11-15 Miguel de Icaza <miguel@ximian.com>
6175 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6176 routine that is used to report the use of a captured variable
6177 whose address has been taken.
6179 There are two checks: one when variables are being captured and
6180 the other check is when the address of a variable is taken.
6182 (because an anonymous methods might be resolved before *or* after
6183 the address has been taken) and
6185 * expression.cs (Conditional.DoResolve): Remove the special
6186 casing that Martin added to trueExpr and falseExpr being both
6187 NullLiteral. We get the right behavior now just by introducing
6188 the null_type into the compiler.
6190 * convert.cs (ExplicitConversion): Change the code to use
6191 null_type instead of testing `expr is NullLiteral'.
6192 (ImplicitConversionStandard): use null_type too.
6193 (ImplicitReferenceConversionExists): use null_type too.
6194 (ImplicitReferenceConversion): use null_type too.
6196 * literal.cs: The type of `NullLiteral' is now null_type instead
6198 (Resolve): Set the type here.
6200 * typemanager.cs: Introduce null_type.
6202 2004-11-18 Martin Baulig <martin@ximian.com>
6205 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6207 2004-11-18 Martin Baulig <martin@ximian.com>
6209 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6211 2004-11-18 Martin Baulig <martin@ximian.com>
6213 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6214 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
6215 call ResolveConstructedType() on it to resolve it without checking
6217 (Constraints.ResolveTypes): Check them here.
6218 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6219 but don't check constraints.
6220 (ConstructedType.ResolveAsTypeTerminal): Override this and also
6221 check constraints here.
6222 (ConstructedType.ResolveConstructedType): New public method. This
6223 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6224 resolve ourselves without checking constraints.
6226 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6228 2004-11-18 Martin Baulig <martin@ximian.com>
6231 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6233 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6235 2004-11-18 Martin Baulig <martin@ximian.com>
6237 * ecore.cs (TypeExpr.ResolveType): Removed.
6238 (Expression.ResolveAsTypeTerminal): We always return a fully
6239 resolved `TypeExpr', so we can just access its `Type'.
6241 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6243 2004-11-17 Martin Baulig <martin@ximian.com>
6245 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6246 sure we don't return any unresolved TypeExpr's.
6247 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6249 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6251 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6252 unresolved `ConstructedType's.
6254 2004-11-17 Martin Baulig <martin@ximian.com>
6256 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6258 2004-11-17 Martin Baulig <martin@ximian.com>
6261 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6263 * decl.cs (DeclSpace.ResolveType): Removed.
6264 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6266 2004-11-17 Martin Baulig <martin@ximian.com>
6268 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6269 direction, like FindMembers() does. Fixes #69546, testcase is in
6272 2004-11-16 Martin Baulig <martin@ximian.com>
6274 This is based on a patch from Marek Safar, see bug #69082.
6275 Fixes bugs #63705 and #67130.
6277 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6278 method; create a MemberCache for an interface type and cache the
6281 * decl.cs (IMemberContainer.ParentContainer): Removed.
6282 (IMemberContainer.ParentCache): New property.
6283 (MemberCache.SetupCacheForInterface): Removed.
6284 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6285 to create a cache for an interface's "parent".
6287 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6290 2004-11-14 Ben Maurer <bmaurer@ximian.com>
6292 * statement.cs: Avoid adding bools to a hashtable.
6294 2004-11-15 Martin Baulig <martin@ximian.com>
6296 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6298 2004-11-11 Martin Baulig <martin@ximian.com>
6300 * typemanager.cs (TypeManager.GetMethodName): New method.
6302 * class.cs (MethodData.Define): Include the generic arity in the
6303 name of an explicit interface; also add it to the method name.
6305 * pending.cs (PendingImplementation.InterfaceMethod): The method
6306 name now includes the generic arity.
6308 2004-11-07 Miguel de Icaza <miguel@ximian.com>
6310 * expression.cs (Invocation.OverloadResolve): Flag error if we are
6311 calling an unsafe method from a safe location.
6313 2004-11-06 Marek Safar <marek.safar@seznam.cz>
6316 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6318 2004-11-06 Miguel de Icaza <miguel@ximian.com>
6320 * namespace.cs (VerifyUsing): use GetPartialName instead of
6323 2004-11-05 Miguel de Icaza <miguel@ximian.com>
6325 * statement.cs (Return.Resolve): Fix regression in typo: if
6326 `in_exc', we have to request a NeedReturnLabel, this was a typo
6327 introduced in the anonymous method check-in. Fixes #69131.
6329 * Indexers were using the ShortName when defining themselves,
6330 causing a regression in the compiler bootstrap when applying the
6331 patch from 2004-11-02 (first part), now they use their full name
6332 and the bug is gone.
6334 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
6336 * driver.cs: Strip the path from the names of embedded resources. Fixes
6339 2004-11-04 Raja R Harinath <rharinath@novell.com>
6341 Fix error message regression: cs0104-2.cs.
6342 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6343 (AliasEntry.Resolve): Update.
6344 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
6346 (RootContext.LookupType): Update.
6348 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
6350 * cs-parser.jay: Add support for handling accessor modifiers
6351 * class: Add support port accessor modifiers and error checking,
6352 define PropertyMethod.Define as virtual (not abstract anymore)
6353 * ecore.cs: Add checking for proeprties access with access modifiers
6354 * iterators.cs: Modify Accessor constructor call based in the modified
6356 2004-11-02 Ben Maurer <bmaurer@ximian.com>
6358 * expression.cs (StringConcat): Handle being called twice,
6359 as when we have a concat in a field init with more than two
6362 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6364 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6365 special case explicit implementations, we should always produce
6366 the .property or .event declaration.
6368 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6369 since it will not return correct data if people use this
6370 unresolved in the presence of using statements (see test-313).
6372 * class.cs (MethodData.Define): If we are an explicit interface
6373 implementation, set the method name to the full name of the
6374 interface plus the name of the method.
6376 Notice that using the method.MethodName.GetFullName() does not
6377 work, as it will only contain the name as declared on the source
6378 file (it can be a shorthand in the presence of using statements)
6379 and not the fully qualifed type name, for example:
6383 class D : ICloneable {
6384 object ICloneable.Clone () {
6388 Would produce a method called `ICloneable.Clone' instead of
6389 `System.ICloneable.Clone'.
6391 * namespace.cs (Alias.Resolve): Use GetPartialName.
6393 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6395 * cs-parser.jay: Add error 1055 report.
6397 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6399 * assign.cs (Assign.DoResolve): Only do the transform of
6400 assignment into a New if the types are compatible, if not, fall
6401 through and let the implicit code deal with the errors and with
6402 the necessary conversions.
6404 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6406 * cs-parser.jay: Add error 1031 report.
6408 * cs-tokenizer.cs: Add location for error 1038.
6410 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6412 * cs-parser.jay: Add error 1016 report.
6414 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6416 * cs-parser.jay: Add errors 1575,1611 report.
6418 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6420 * cs-parser.jay: Add error 1001 report.
6422 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6425 * attribute.cs (GetMarshal): Add method argument for
6426 caller identification.
6428 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6429 agument for GetMarshal and RuntimeMissingSupport.
6431 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6433 * attribute.cs (ExtractSecurityPermissionSet): Removed
6434 TypeManager.code_access_permission_type.
6436 * typemanager.cs: Removed TypeManager.code_access_permission_type.
6438 2004-10-27 Miguel de Icaza <miguel@ximian.com>
6440 * expression.cs (LocalVariableReference.DoResolveLValue): Check
6441 for obsolete use of a variable here. Fixes regression on errors
6442 cs0619-25 and cs0619-26.
6444 2004-10-27 Marek Safar <marek.safar@seznam.cz>
6446 Fix #62358, implemented security attribute encoding.
6448 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6449 Tests permitted SecurityAction for assembly or other types.
6450 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6451 data from SecurityPermissionAttribute to PermisionSet class.
6453 * class.cs (ApplyAttributeBuilder): Added special handling
6454 for System.Security.Permissions.SecurityAttribute based types.
6456 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6457 special handling for System.Security.Permissions.SecurityAttribute
6460 * enum.cs (ApplyAttributeBuilder): Added special handling
6461 for System.Security.Permissions.SecurityAttribute based types.
6463 * parameter.cs (ApplyAttributeBuilder): Added special handling
6464 for System.Security.Permissions.SecurityAttribute based types.
6466 * rootcontext.cs: Next 2 core types.
6468 * typemanager.cs (TypeManager.security_permission_attr_type):
6469 Built in type for the SecurityPermission Attribute.
6470 (code_access_permission_type): Build in type.
6472 2004-10-17 Miguel de Icaza <miguel@ximian.com>
6474 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6475 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6476 all of this information into
6477 EmitContext.EmitCapturedVariableInstance.
6479 * codegen.cs (EmitCapturedVariableInstance): move here the
6480 funcionality of emitting an ldarg.0 in the presence of a
6481 remapping. This centralizes the instance emit code.
6483 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6484 then emit a load of this: it means that we have reached the
6485 topmost ScopeInfo: the one that contains the pointer to the
6486 instance of the class hosting the anonymous method.
6488 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6489 captures to the topmost CaptureContext.
6491 2004-10-12 Miguel de Icaza <miguel@ximian.com>
6493 * expression.cs (LocalVariableReference): Move the knowledge about
6494 the iterators into codegen's EmitCapturedVariableInstance.
6496 2004-10-11 Miguel de Icaza <miguel@ximian.com>
6498 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6499 all code paths return a value from an anonymous method (it is the
6500 same as the 161 error, but for anonymous methods).
6502 2004-10-08 Miguel de Icaza <miguel@ximian.com>
6504 The introduction of anonymous methods in the compiler changed
6505 various ways of doing things in the compiler. The most
6506 significant one is the hard split between the resolution phase
6507 and the emission phases of the compiler.
6509 For instance, routines that referenced local variables no
6510 longer can safely create temporary variables during the
6511 resolution phase: they must do so from the emission phase,
6512 since the variable might have been "captured", hence access to
6513 it can not be done with the local-variable operations from the runtime.
6517 (Block.Flags): New flag `IsTopLevel' to indicate that this block
6518 is a toplevel block.
6520 (ToplevelBlock): A new kind of Block, these are the blocks that
6521 are created by the parser for all toplevel method bodies. These
6522 include methods, accessors and anonymous methods.
6524 These contain some extra information not found in regular blocks:
6525 A pointer to an optional CaptureContext (for tracking captured
6526 local variables and parameters). A pointer to the parent
6529 (Return.Resolve): Catch missmatches when returning a value from an
6530 anonymous method (error 1662).
6531 Invoke NeedReturnLabel from the Resolve phase instead of the emit
6534 (Break.Resolve): ditto.
6536 (SwitchLabel): instead of defining the labels during the
6537 resolution phase, we now turned the public ILLabel and ILLabelCode
6538 labels into methods called GetILLabelCode() and GetILLabel() that
6539 only define the label during the Emit phase.
6541 (GotoCase): Track the SwitchLabel instead of the computed label
6542 (its contained therein). Emit the code by using
6543 SwitchLabel.GetILLabelCode ().
6545 (LocalInfo.Flags.Captured): A new flag has been introduce to track
6546 whether the Local has been captured or not.
6548 (LocalInfo.IsCaptured): New property, used to tell whether the
6549 local has been captured.
6551 * anonymous.cs: Vastly updated to contain the anonymous method
6554 The main classes here are: CaptureContext which tracks any
6555 captured information for a toplevel block and ScopeInfo used to
6556 track the activation frames for various local variables.
6558 Each toplevel block has an optional capture context associated
6559 with it. When a method contains an anonymous method both the
6560 toplevel method and the anonymous method will create a capture
6561 context. When variables or parameters are captured, they are
6562 recorded on the CaptureContext that owns them, for example:
6566 MyDelegate d = delegate {
6571 Here `a' will be recorded as captured on the toplevel
6572 CapturedContext, the inner captured context will not have anything
6573 (it will only have data if local variables or parameters from it
6574 are captured in a nested anonymous method.
6576 The ScopeInfo is used to track the activation frames for local
6577 variables, for example:
6579 for (int i = 0; i < 10; i++)
6580 for (int j = 0; j < 10; j++){
6581 MyDelegate d = delegate {
6586 At runtime this captures a single captured variable `i', but it
6587 captures 10 different versions of the variable `j'. The variable
6588 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6589 recorded on a child.
6591 The toplevel ScopeInfo will also track information like the `this'
6592 pointer if instance variables were referenced (this is necessary
6593 as the anonymous method lives inside a nested class in the host
6594 type of the method).
6596 (AnonymousMethod): Expanded to track the Toplevel, implement
6597 `AnonymousMethod.Compatible' to tell whether an anonymous method
6598 can be converted to a target delegate type.
6600 The routine now also produces the anonymous method content
6602 (AnonymousDelegate): A helper class that derives from
6603 DelegateCreation, this is used to generate the code necessary to
6604 produce the delegate for the anonymous method that was created.
6606 * assign.cs: API adjustments for new changes in
6607 Convert.ImplicitStandardConversionExists.
6609 * class.cs: Adjustments to cope with the fact that now toplevel
6610 blocks are of type `ToplevelBlock'.
6612 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6613 insteda of standard blocks.
6615 Flag errors if params arguments are passed to anonymous methods.
6617 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6618 `CurrentAnonymousMethod' which points to the current Anonymous
6619 Method. The variable points to the AnonymousMethod class that
6620 holds the code being compiled. It is set in the new EmitContext
6621 created for the anonymous method.
6623 (EmitContext.Phase): Introduce a variable and an enumeration to
6624 assist in enforcing some rules about when and where we are allowed
6625 to invoke certain methods (EmitContext.NeedsReturnLabel is the
6626 only one that enfonces this right now).
6628 (EmitContext.HaveCaptureInfo): new helper method that returns
6629 whether we have a CapturedContext initialized.
6631 (EmitContext.CaptureVariable): New method used to register that a
6632 LocalInfo must be flagged for capturing.
6634 (EmitContext.CapturedParameter): New method used to register that a
6635 parameters must be flagged for capturing.
6637 (EmitContext.CapturedField): New method used to register that a
6638 field must be flagged for capturing.
6640 (EmitContext.HaveCapturedVariables,
6641 EmitContext.HaveCapturedFields): Return whether there are captured
6642 variables or fields.
6644 (EmitContext.EmitMethodHostInstance): This is used to emit the
6645 instance for the anonymous method. The instance might be null
6646 (static methods), this (for anonymous methods that capture nothing
6647 and happen to live side-by-side with the current method body) or a
6648 more complicated expression if the method has a CaptureContext.
6650 (EmitContext.EmitTopBlock): Routine that drives the emission of
6651 code: it will first resolve the top block, then emit any metadata
6652 and then emit the code. The split is done so that we can extract
6653 any anonymous methods and flag any captured variables/parameters.
6655 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6656 during this phase, the ILGenerator should not be used as labels
6657 and local variables declared here might not be accessible to any
6658 code that is part of an anonymous method.
6660 Exceptions to this include the temporary variables that are
6661 created by some statements internally for holding temporary
6664 (EmitContext.EmitMeta): New routine, in charge of emitting all the
6667 (EmitContext.TemporaryReturn): This method is typically called
6668 from the Emit phase, and its the only place where we allow the
6669 ReturnLabel to be defined other than the EmitMeta. The reason is
6670 that otherwise we would have to duplicate a lot of logic in the
6671 Resolve phases of various methods that today is on the Emit
6674 (EmitContext.NeedReturnLabel): This no longer creates the label,
6675 as the ILGenerator is not valid during the resolve phase.
6677 (EmitContext.EmitThis): Extended the knowledge in this class to
6678 work in anonymous methods in addition to iterators.
6680 (EmitContext.EmitCapturedVariableInstance): This emits whatever
6681 code is necessary on the stack to access the instance to a local
6682 variable (the variable will be accessed as a field).
6684 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6685 EmitContext.EmitAddressOfParameter): Routines to support
6686 parameters (not completed at this point).
6688 Removals: Removed RemapLocal and RemapLocalLValue. We probably
6689 will also remove the parameters.
6691 * convert.cs (Convert): Define a `ConstantEC' which points to a
6692 null. This is just to prefity some code that uses
6693 ImplicitStandardConversion code and do not have an EmitContext
6696 The idea is to flag explicitly that at that point in time, it is
6697 known that the conversion will not trigger the delegate checking
6698 code in implicit conversions (which requires a valid
6701 Everywhere: pass new EmitContext parameter since
6702 ImplicitStandardConversionExists now requires it to check for
6703 anonymous method conversions.
6705 (Convert.ImplicitStandardConversionExists): If the type of an
6706 expression is the anonymous_method_type, and the type is a
6707 delegate, we invoke the AnonymousMethod.Compatible method to check
6708 whether an implicit conversion is possible.
6710 (Convert.ImplicitConversionStandard): Only do implicit method
6711 group conversions if the language level is not ISO_1.
6713 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6714 MethodInfo for the Invoke method. used by Delegate and
6717 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6718 method conversions if the target type is a delegate.
6720 Removed extra debugging nops.
6722 (LocalVariableReference): Turn the `local_info' into a public
6725 Add `prepared' field, the same hack used for FieldExprs to cope
6726 with composed assignments, as Local variables do not necessarily
6727 operate purely on the stack as they used to: they can be captured
6730 Add `temp' for a temporary result, like fields.
6732 Refactor DoResolve and DoResolveLValue into DoResolveBase.
6734 It now copes with Local variables that are captured and emits the
6735 proper instance variable to load it from a field in the captured
6738 (ParameterReference.DoResolveBase): During the resolve phase,
6739 capture parameters if we are in an anonymous method.
6741 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6742 anonymous method, use the EmitContext helper routines to emit the
6743 parameter reference.
6745 * iterators.cs: Set RemapToProxy to true/false during the
6748 * parameters.cs (GetParameterByName): New helper method.
6750 * typemanager.cs (anonymous_method_type) a new type that
6751 represents an anonyous method. This is always an internal type,
6752 used as a fencepost to test against the anonymous-methodness of an
6755 2004-10-20 Marek Safar <marek.safar@seznam.cz>
6757 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6759 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6761 2004-11-10 Martin Baulig <martin@ximian.com>
6763 * expression.cs (Invocation.BetterFunction): If two methods have
6764 equal parameter types, but only one of them is generic, the
6765 non-generic one wins.
6766 (New.DoResolve): Don't set `is_struct' to false if we're a generic
6767 instance; just use `Type.IsValueType' to determine whether
6768 something is a struct or not.
6769 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
6770 so we can be called multiple times.
6772 2004-11-10 Martin Baulig <martin@ximian.com>
6774 * generic.cs (TypeParameter.DefineConstraints): New public method.
6775 (TypeParameter.CheckAccessLevel): Override this and return true.
6776 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
6777 override ResolveType() anymore.
6778 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
6780 2004-11-10 Martin Baulig <martin@ximian.com>
6782 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
6783 call DeclSpace.ResolveNestedType() on it.
6785 2004-11-10 Martin Baulig <martin@ximian.com>
6787 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
6788 non-null, call ParameterModifier() on it.
6790 2004-11-10 Martin Baulig <martin@ximian.com>
6793 (Iterators): Added `current_type' and `this_type' fields.
6794 (Iterators.DefineIterator): Create a new EmitContext and store it
6795 in `ec'; compute `this_type'.
6797 2004-11-10 Martin Baulig <martin@ximian.com>
6800 (TypeManager.IsPrivateAccessible): New public method.
6801 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
6803 2004-11-10 Martin Baulig <martin@ximian.com>
6805 * class.cs (TypeContainer.DefineType): Call
6806 TypeBuilder.DefineGenericParameters() before resolving the type
6808 (MethodData.parent_method): New protected field.
6809 (MethodData..ctor): Added `MethodInfo parent_method' argument.
6810 (MethodData.Define): Compute `parent_method'.
6813 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6814 (MemberCore.GetClsCompliantAttributeValue): Likewise.
6815 (DeclSpace.ec): New protected field; store the EmitContext here.
6816 (DeclSpace.EmitContext): New public property.
6817 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
6818 (DeclSpace.ResolveNestedType): New public method.
6819 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
6820 (DeclSpace.NestedAccessible): Added `Type tb' argument.
6821 (DeclSpace.FamilyAccessible): Likewise.
6822 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
6823 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6826 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
6829 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6830 (Enum.Emit): Don't create a new EmitContext.
6832 2004-10-18 Martin Baulig <martin@ximian.com>
6834 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6835 `Type' directly, but call ResolveType() on it.
6836 (Catch.Resolve): Likewise.
6837 (Foreach.Resolve): Likewise.
6839 2004-10-18 Martin Baulig <martin@ximian.com>
6841 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6842 `Type' directly, but call ResolveType() on it.
6843 (Probe.DoResolve): Likewise.
6844 (ArrayCreation.LookupType): Likewise.
6845 (TypeOf.DoResolve): Likewise.
6846 (SizeOf.DoResolve): Likewise.
6848 2004-10-18 Raja R Harinath <rharinath@novell.com>
6850 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6853 2004-10-17 John Luke <john.luke@gmail.com>
6855 * class.cs (Operator.GetSignatureForError): use CSharpName
6857 * parameter.cs (Parameter.GetSignatureForError): Returns
6858 correct name even if was not defined.
6860 2004-10-13 Raja R Harinath <rharinath@novell.com>
6863 * class.cs (TypeContainer.EmitContext): New property.
6864 (DefineNestedTypes): Create an emitcontext for each part.
6865 (MethodCore.DoDefineParameters): Use container's emitcontext.
6866 Pass type array to InternalParameters.
6867 (MemberBase.DoDefine): Use container's emitcontext.
6868 (FieldMember.Define): Likewise.
6869 (Event.Define): Likewise.
6870 (SetMethod.GetParameterInfo): Change argument to EmitContext.
6871 Pass type array to InternalParameters.
6872 (SetIndexerMethod.GetParameterInfo): Likewise.
6873 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6874 * delegate.cs (Define): Pass emitcontext to
6875 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
6876 array to InternalParameters.
6877 * expression.cs (ParameterReference.DoResolveBase): Pass
6878 emitcontext to GetParameterInfo.
6879 (ComposedCast.DoResolveAsTypeStep): Remove check on
6880 ec.ResolvingTypeTree.
6881 * parameter.cs (Parameter.Resolve): Change argument to
6882 EmitContext. Use ResolveAsTypeTerminal.
6883 (Parameter.GetSignature): Change argument to EmitContext.
6884 (Parameters.ComputeSignature): Likewise.
6885 (Parameters.ComputeParameterTypes): Likewise.
6886 (Parameters.GetParameterInfo): Likewise.
6887 (Parameters.ComputeAndDefineParameterTypes): Likewise.
6888 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
6889 * support.cs (InternalParameters..ctor): Remove variant that takes
6891 * typemanager.cs (system_intptr_expr): New.
6892 (InitExpressionTypes): Initialize it.
6894 2004-10-12 Chris Toshok <toshok@ximian.com>
6896 * cs-parser.jay: fix location for try_statement and catch_clause.
6898 2004-10-18 Martin Baulig <martin@ximian.com>
6900 * class.cs (FieldMember.Define): Don't access the TypeExpr's
6901 `Type' directly, but call ResolveType() on it.
6902 (MemberBase.DoDefine): Likewise.
6904 * expression.cs (New.DoResolve): Don't access the TypeExpr's
6905 `Type' directly, but call ResolveType() on it.
6906 (ComposedCast.DoResolveAsTypeStep): Likewise.
6908 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6909 `Type' directly, but call ResolveType() on it.
6911 2004-10-17 John Luke <john.luke@gmail.com>
6913 * class.cs (Operator.GetSignatureForError): use CSharpName
6915 * parameter.cs (Parameter.GetSignatureForError): Returns
6916 correct name even if was not defined.
6918 2004-10-13 Raja R Harinath <rharinath@novell.com>
6921 * class.cs (TypeContainer.EmitContext): New property.
6922 (DefineNestedTypes): Create an emitcontext for each part.
6923 (MethodCore.DoDefineParameters): Use container's emitcontext.
6924 Pass type array to InternalParameters.
6925 (MemberBase.DoDefine): Use container's emitcontext.
6926 (FieldMember.Define): Likewise.
6927 (Event.Define): Likewise.
6928 (SetMethod.GetParameterInfo): Change argument to EmitContext.
6929 Pass type array to InternalParameters.
6930 (SetIndexerMethod.GetParameterInfo): Likewise.
6931 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6932 * delegate.cs (Define): Pass emitcontext to
6933 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
6934 array to InternalParameters.
6935 * expression.cs (ParameterReference.DoResolveBase): Pass
6936 emitcontext to GetParameterInfo.
6937 (ComposedCast.DoResolveAsTypeStep): Remove check on
6938 ec.ResolvingTypeTree.
6939 * parameter.cs (Parameter.Resolve): Change argument to
6940 EmitContext. Use ResolveAsTypeTerminal.
6941 (Parameter.GetSignature): Change argument to EmitContext.
6942 (Parameters.ComputeSignature): Likewise.
6943 (Parameters.ComputeParameterTypes): Likewise.
6944 (Parameters.GetParameterInfo): Likewise.
6945 (Parameters.ComputeAndDefineParameterTypes): Likewise.
6946 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
6947 * support.cs (InternalParameters..ctor): Remove variant that takes
6949 * typemanager.cs (system_intptr_expr): New.
6950 (InitExpressionTypes): Initialize it.
6952 2004-10-12 Chris Toshok <toshok@ximian.com>
6954 * cs-parser.jay: fix location for try_statement and catch_clause.
6956 2004-10-07 Raja R Harinath <rharinath@novell.com>
6958 More DeclSpace.ResolveType avoidance.
6959 * decl.cs (MemberCore.InUnsafe): New property.
6960 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
6961 with newly created EmitContext.
6962 (FieldMember.Define): Likewise.
6963 * delegate.cs (Delegate.Define): Likewise.
6964 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
6965 only if normal name-lookup fails.
6966 (TypeExpr.DoResolve): Enable error-checking.
6967 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
6968 (SizeOf.DoResolve): Likewise.
6969 (ComposedCast.DoResolveAsTypeStep): Likewise.
6970 (StackAlloc.DoResolve): Likewise.
6971 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
6972 (Block.Unsafe): New property.
6973 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
6974 (Unsafe): Set 'unsafe' flag of contained block.
6975 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
6976 (Fixed.Resolve): Likewise.
6977 (Catch.Resolve): Likewise.
6978 (Using.ResolveLocalVariableDecls): Likewise.
6979 (Foreach.Resolve): Likewise.
6981 2004-10-05 John Luke <john.luke@gmail.com>
6983 * cs-parser.jay: add location to error CS0175
6985 2004-10-04 Miguel de Icaza <miguel@ximian.com>
6987 * ecore.cs (Expression.Constantity): Add support for turning null
6990 * const.cs (Const.Define): Allow constants to be reference types
6991 as long as the value is Null.
6993 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
6995 * namespace.cs (NamespaceEntry.Using): No matter which warning
6996 level is set, check if this namespace name has already been added.
6998 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7000 * expression.cs: reftype [!=]= null should always use br[true,false].
7003 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7006 * attribute.cs: Enum conversion moved to
7007 GetAttributeArgumentExpression to be applied to the all
7010 2004-10-01 Raja R Harinath <rharinath@novell.com>
7012 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7013 * class.c (TypeContainer.DefineType): Flag error if
7014 base types aren't accessible due to access permissions.
7015 * decl.cs (DeclSpace.ResolveType): Move logic to
7016 Expression.ResolveAsTypeTerminal.
7017 (DeclSpace.ResolveTypeExpr): Thin layer over
7018 Expression.ResolveAsTypeTerminal.
7019 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7020 Refactor code into NestedAccess. Use it.
7021 (DeclSpace.NestedAccess): New.
7022 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7023 argument to silence errors. Check access permissions.
7024 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7025 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7026 (Cast.DoResolve): Likewise.
7027 (New.DoResolve): Likewise.
7028 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7029 (TypeOf.DoResolve): Likewise.
7031 * expression.cs (Invocation.BetterConversion): Return the Type of
7032 the better conversion. Implement section 14.4.2.3 more faithfully.
7033 (Invocation.BetterFunction): Make boolean. Make correspondence to
7034 section 14.4.2.2 explicit.
7035 (Invocation.OverloadResolve): Update.
7036 (Invocation): Remove is_base field.
7037 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7038 (Invocation.Emit): Likewise.
7040 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7042 * cs-parser.jay: Reverted 642 warning fix.
7044 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7047 * decl.cs (FindMemberWithSameName): Indexer can have more than
7050 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7052 * expression.cs (LocalVariableReference.DoResolveLValue):
7053 Do not report warning 219 for out values.
7054 (EmptyExpression.Null): New member to avoid extra allocations.
7056 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7058 * cs-parser.jay: Fix wrong warning 642 report.
7060 * cs-tokenizer.cs (CheckNextToken): New helper;
7061 Inspect next character if is same as expected.
7063 2004-09-23 Martin Baulig <martin@ximian.com>
7065 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7066 (Convert.ImplicitReferenceConversionExists): Likewise.
7068 2004-11-09 Raja R Harinath <rharinath@novell.com>
7070 * Makefile (DISTFILES): Comment out a few missing files.
7072 2004-10-29 Raja R Harinath <rharinath@novell.com>
7074 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7075 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
7076 (gmcs.exe): Invoke bootstrap-libs.
7077 (clean-local): Clean the net_2_0_bootstrap profile too.
7078 (PROGRAM_INSTALL_DIR): New.
7079 (install-local): Use it.
7081 2004-10-13 Martin Baulig <martin@ximian.com>
7083 * generic.cs (TypeManager.InflatedConstraints): New nested class.
7084 (TypeParameter.DefineType): If we're a method type parameter and
7085 that method is overriding something, "inflate" its constraints.
7087 2004-10-12 Martin Baulig <martin@ximian.com>
7089 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7090 and have type arguments, create and resolve a ConstructedType.
7092 2004-10-12 Martin Baulig <martin@ximian.com>
7094 * decl.cs (MemberCache.FindMemberToOverride): Use
7095 TypeManager.IsEqual() to compare the parameters and Type.Equals()
7096 to compare the invocationType.
7098 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7099 When comparing two type parameters, only do the signature-only
7100 comparision for method type parameters.
7102 2004-10-11 Martin Baulig <martin@ximian.com>
7104 * report.cs: Don't make --fatal abort on warnings, we have
7105 -warnaserror for that.
7107 2004-10-11 Martin Baulig <martin@ximian.com>
7110 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7111 (TypeManager.IsEqual): Call ourself recursively instead of using
7114 2004-10-11 Martin Baulig <martin@ximian.com>
7116 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7117 on our own type parameters, not on the ones we inherit from a containing
7120 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7123 * generic.cs (TypeParameter.Define): We may only be called once.
7125 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7126 instead of TypeManager.IsEqual().
7128 2004-09-28 Martin Baulig <martin@ximian.com>
7131 (GenericConstraints.EffectiveBaseClass): New public property.
7132 (TypeParameter.GenericConstraints): New public property.
7133 (ConstructedType.CheckConstraints): Improved.
7135 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7136 (Convert.TypeParameterConversion): New private method; use this in
7137 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7138 for all conversions related to type parameters.
7140 2004-09-24 Martin Baulig <martin@ximian.com>
7142 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7143 type parameter conversions for type parameters which are known to
7146 2004-09-24 Martin Baulig <martin@ximian.com>
7148 * generic.cs (GenericConstraints): Added `IsReferenceType' and
7149 `IsValueType' properties.
7151 * support.cs (ReflectionConstraints): Use
7152 Type.GetGenericParameterConstraints() instead of the old hack.
7154 2004-09-24 Martin Baulig <martin@ximian.com>
7156 * generic.cs (GenericConstraints): Moved here and made it an
7159 * support.cs (GenericConstraints): Moved to generic.cs.
7161 2004-09-24 Martin Baulig <martin@ximian.com>
7164 (ReflectionConstraints): Un-nested this class and made it public.
7167 (TypeManager.GetTypeParameterConstraints): New public method.
7168 (TypeManager.HasConstructorConstraint): Use the attributes.
7170 2004-09-24 Martin Baulig <martin@ximian.com>
7172 * support.cs (GenericConstraints): Replaced `HasConstructor',
7173 `IsReferenceType' and `IsValueType' with `Attributes'.
7174 (ReflectionParameters.ReflectionConstraints): Removed the Create()
7175 method and made the .ctor public.
7177 * generic.cs (Constraints.Attributes): New public property.
7178 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7179 `IsReferenceType' -> `HasReferenceTypeConstraint' and
7180 `IsValueType' -> `HasValueTypeConstraint'.
7182 2004-09-23 Martin Baulig <martin@ximian.com>
7184 * generic.cs (Constraints): Reflect latest runtime changes.
7186 2004-09-23 Martin Baulig <martin@ximian.com>
7188 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7189 (Convert.ImplicitReferenceConversionExists): Likewise.
7191 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7193 * class.cs (Operator.Define): Add error 448 and 559 report.
7195 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7197 * class.cs (MemberBase.IsTypePermitted): New protected
7198 method for checking error CS0610.
7200 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7202 * class.cs (TypeContainer.HasExplicitLayout): New property
7203 Returns whether container has StructLayout attribute set Explicit.
7204 (FieldMember): New abstract class for consts and fields.
7205 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7206 (Field): Reuse FieldMember.
7208 * const.cs (Const): Reuse FieldMember.
7210 * rootcontext.cs: EmitConstants call moved to class.
7212 2004-09-22 Martin Baulig <martin@ximian.com>
7214 Marek and me just fixed one of our oldest bugs: #28562 :-)
7216 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7218 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7219 we're an EnumConstant, just return that.
7220 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7221 an EnumConstant. In this case, we need to use GetValueAsEnumType()
7222 to get the value which'll actually be written into the attribute.
7223 However, we have to use GetValue() to access the attribute's value
7226 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7228 * constant.cs (Constant.IsNegative): New abstract property
7231 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7232 (StackAlloc.DoResolve): Reused IsNegative.
7234 2004-09-22 Martin Baulig <martin@ximian.com>
7236 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7237 public method; like LookupTypeContainer, but also works for
7240 * report.cs (Report.SymbolRelatedToPreviousError): Use
7241 TypeManager.LookupGenericTypeContainer().
7243 2004-09-22 Martin Baulig <martin@ximian.com>
7245 Thanks to Peter Sestoft for this bug report.
7247 * expression.cs (Conditional): If both the `trueExpr' and the
7248 `falseExpr' is a NullLiteral, return a NullLiteral.
7250 2004-09-22 Martin Baulig <martin@ximian.com>
7252 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7253 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7254 for the "get_Current" call.
7256 2004-09-21 Martin Baulig <martin@ximian.com>
7258 * convert.cs (Convert.ImplicitReferenceConversion): When
7259 converting to an interface type, first check whether we're
7260 converting from a reference type.
7262 2004-09-14 Martin Baulig <martin@ximian.com>
7264 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7266 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7269 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7270 called and is obsolete then this member suppress message
7271 when call is inside next [Obsolete] method or type.
7273 * expression.cs: Use TestObsoleteMethodUsage member.
7275 2004-09-14 Martin Baulig <martin@ximian.com>
7277 * genericparser.cs: Removed.
7279 2004-09-13 Marek Safar <marek.safar@seznam.cz>
7281 * class.cs (MethodCore.CheckBase): Fix bug #65757.
7283 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7285 * attribute.cs (Attribute.Resolve): Add error 653 report.
7287 * class.cs (Class.ApplyAttributeBuilder): Add error 641
7289 (Method.ApplyAttributeBuilder): Add error 685 report.
7290 (Operator.Define): Add error 564 report.
7292 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7294 * expression.cs (Invocation.DoResolve): Add error
7297 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7300 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7302 * class.cs (ConstructorInitializer.Resolve):
7303 Wrong error number (515->516).
7305 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7307 * class.cs (Indexer.Define): Add error 631 report.
7309 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7311 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7313 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7315 * expression.cs (Probe.DoResolve): Add error CS0241 report.
7317 2004-09-10 Marek Safar <marek.safar@seznam.cz>
7319 * cs-parser.jay: Added error CS0241 report.
7321 2004-09-10 Raja R Harinath <rharinath@novell.com>
7323 * cs-parser.jay (fixed_statement): Introduce a scope for the
7324 declaration in the 'fixed' statement.
7326 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7328 * cs-parser.jay: Added CS0230 error report.
7330 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7332 * cs-parser.jay: Added errors CS0231 and CS0257 report.
7334 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7336 * expression.cs (Argument.Resolve): Added error CS0192 and
7339 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7341 C# 2.0 #pragma warning feature
7343 * cs-tokenizer.cs (PreProcessPragma): New method;
7344 Handles #pragma directive.
7346 * report.cs (WarningRegions): New class; Support
7347 class for #pragma warning directive. It tests whether
7348 warning is enabled for a given line.
7350 2004-09-08 Miguel de Icaza <miguel@ximian.com>
7352 * const.cs: Add more descriptive error report, tahnks to
7355 2004-09-08 Marek Safar <marek.safar@seznam.cz>
7357 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7359 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7361 * expression.cs: Apply patch from Ben: Remove dead code from
7362 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7363 as that code just threw an exception anwyays.
7365 * const.cs: Remove the call to the turnintoconstant, for details
7368 * literal.cs: The type of the null-literal is the null type; So
7369 we use a placeholder type (literal.cs:System.Null, defined here)
7372 * expression.cs (Conditional.DoResolve): Remove some old code that
7373 is no longer needed, conversions have been fixed.
7375 (ArrayCreationExpression.DoResolve): Return false if we fail to
7376 resolve the inner expression.
7378 2004-09-07 Raja R Harinath <rharinath@novell.com>
7381 * cs-parser.jay (delegate_declaration): Record a delegate
7382 declaration as a type declaration.
7383 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7385 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7387 * parameter.cs: Do not crash if the type can not be resolved.
7389 * expression.cs: Report errors with unsafe pointers, fixes #64896
7391 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7393 * expression.cs: Pointer arith always needs to do a conv.i
7394 if the operand is a long. fix 65320
7396 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7398 Fixed cs0619-37.cs, cs0619-38.cs
7400 * enum.cs (GetObsoleteAttribute): Removed.
7402 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7403 on Enum member is double staged. The first is tested member
7406 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7408 Fixed #56986, #63631, #65231
7410 * class.cs: (TypeContainer.AddToMemberContainer): New method,
7411 adds member to name container.
7412 (TypeContainer.AddToTypeContainer): New method, adds type to
7414 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7415 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7416 AddOperator): Simplified by reusing AddToMemberContainer.
7417 (TypeContainer.UserDefinedStaticConstructor): Changed to property
7419 (Method.CheckForDuplications): Fixed implementation to test all
7421 (MemberBase): Detection whether member is explicit interface
7422 implementation is now in constructor.
7423 (MemberBase.UpdateMemberName): Handles IndexerName.
7424 (Accessor): Changed to keep also location information.
7425 (AbstractPropertyEventMethod): Is derived from MemberCore.
7426 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7427 will be emited or not.
7428 (PropertyBase.AreAccessorsDuplicateImplementation):
7429 Tests whether accessors are not in collision with some method.
7430 (Operator): Is derived from MethodCore to simplify common
7433 * decl.cs (Flags.TestMethodDuplication): Test for duplication
7435 (DeclSpace.AddToContainer): Adds the member to defined_names
7436 table. It tests for duplications and enclosing name conflicts.
7438 * enum.cs (EnumMember): Clean up to reuse the base structures
7440 2004-09-03 Martin Baulig <martin@ximian.com>
7442 Merged latest changes into gmcs. Please keep this comment in
7443 here, it makes it easier for me to see what changed in MCS since
7444 the last time I merged.
7446 2004-09-03 Martin Baulig <martin@ximian.com>
7448 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7449 into TypeContainer, to make partial classes work again.
7451 2004-09-03 Martin Baulig <martin@ximian.com>
7453 * rootcontext.cs (RootContext.V2): Removed.
7455 2004-03-23 Martin Baulig <martin@ximian.com>
7457 * expression.cs (Invocation.OverloadResolve): Added `bool
7458 may_fail' argument and use it instead of the Location.IsNull() hack.
7460 2004-09-09 Martin Baulig <martin@ximian.com>
7462 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
7464 2004-09-09 Martin Baulig <martin@ximian.com>
7466 * generic.cs (TypeParameter.DefineType): Added support for
7467 explicit interface methods.
7469 2004-09-09 Martin Baulig <martin@ximian.com>
7471 * README.Changes: New document. Started to list important changes
7472 between MCS and GMCS here.
7474 2004-09-08 Martin Baulig <martin@ximian.com>
7477 (TypeContainer.CheckRecursiveDefinition): New protected method.
7478 (TypeContainer.DefineType): Move the CS0146 check into
7479 CheckRecursiveDefinition().
7481 2004-09-06 Martin Baulig <martin@ximian.com>
7483 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
7484 types for the constructor constraint.
7486 2004-09-03 Martin Baulig <martin@ximian.com>
7488 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7489 into TypeContainer, to make partial classes work again.
7491 2004-09-03 Martin Baulig <martin@ximian.com>
7493 * rootcontext.cs (RootContext.V2): Removed.
7495 2004-03-23 Martin Baulig <martin@ximian.com>
7497 * expression.cs (Invocation.OverloadResolve): Added `bool
7498 may_fail' argument and use it instead of the Location.IsNull() hack.
7500 2004-09-03 Martin Baulig <martin@ximian.com>
7502 Merged latest changes into gmcs. Please keep this comment in
7503 here, it makes it easier for me to see what changed in MCS since
7504 the last time I merged.
7506 2004-09-03 Raja R Harinath <rharinath@novell.com>
7509 * expression.cs (BetterConversion): Don't allow either conversion
7510 to be null. Remove redundant implicit conversion test when 'q ==
7511 null' -- when this function is invoked, we already know that the
7512 implicit conversion exists.
7513 (BetterFunction): Assume that 'best' is non-null. Remove
7514 redundant reimplementation of IsApplicable when 'best' is null.
7515 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7516 number of arguments.
7517 (IsAncestralType): Extract from OverloadResolve.
7518 (OverloadResolve): Make robust to the MethodGroupExpr being
7519 unsorted. Implement all the logic of Section 14.5.5.1, and
7520 support overloading of methods from multiple applicable types.
7521 Clean up logic somewhat. Don't pass null methods to BetterFunction.
7523 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7524 (RealError, Warning): Append type of report to related symbol.
7526 2004-09-03 Marek Safar <marek.safar@seznam.cz>
7528 * enum.cs: Fixed CLS-Compliance checks for enum members.
7529 Error tests cs3008-8.cs, cs3014-8.cs
7531 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7533 Fixed bug #62342, #63102
7534 * class.cs: ImplementIndexer uses member.IsExplicitImpl
7535 like ImplementMethod.
7537 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7539 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7542 2004-09-02 Martin Baulig <martin@ximian.com>
7544 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7545 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7548 2004-09-01 Marek Safar <marek.safar@seznam.cz>
7550 C# 2.0 Static classes implemented
7552 * class.cs (TypeContainer): instance_constructors,
7553 initialized_fields, initialized_static_fields,
7554 default_constructor, base_inteface_types are protected to be
7555 accessible from StaticClass.
7556 (TypeContainer.DefineDefaultConstructor): New virtual method
7557 for custom default constructor generating
7558 (StaticClass): New class to handle "Static classes" feature.
7560 * cs-parser.jay: Handle static keyword on class like instance
7563 * driver.cs: Added "/langversion" command line switch with two
7564 options (iso-1, default).
7566 2004-08-31 Marek Safar <marek.safar@seznam.cz>
7568 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7570 2004-08-31 Miguel de Icaza <miguel@ximian.com>
7572 * delegate.cs: Style.
7574 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
7576 * delegate.cs: Add seperate instance expr field for miguel.
7578 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7580 * PointerArithmetic (Resolve): make sure we are not doing
7581 pointer arith on void*. Also, make sure we are resolved
7582 by not setting eclass until resolve.
7584 All callers: Make sure that PointerArithmetic gets resolved.
7586 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7588 * ArrayCreation (LookupType): If the type does not resolve
7589 to an array, give an error.
7591 2004-08-27 Marek Safar <marek.safar@seznam.cz>
7593 * statement.cs (Try.Resolve): Fixed bug #64222
7595 2004-08-27 Martin Baulig <martin@ximian.com>
7598 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7601 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7603 * ecore.cs (Constantify): Get underlying type via
7604 System.Enum.GetUnderlyingType to avoid StackOverflow on the
7605 Windows in special cases.
7607 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7609 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7610 for obtaining also private methods.
7611 (GetRemoveMethod): Used GetRemoveMethod (true)
7612 for obtaining also private methods.
7614 2004-09-02 Martin Baulig <martin@ximian.com>
7616 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7617 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7620 2004-08-27 Martin Baulig <martin@ximian.com>
7623 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7626 2004-08-25 Martin Baulig <martin@ximian.com>
7628 * support.cs (ReflectionParameters..ctor): If this is a generic
7629 method, retrieve and store its type parameters.
7630 (InternalParameters..ctor): Added `TypeParameter[]' argument.
7631 (ReflectionParameters.GenericConstraints): The argument specifies
7632 the type parameter, not the method parameter.
7633 (InternalParameters.GenericConstraints): Likewise.
7635 * generic.cs (TypeParameter.DefineType): Correctly handle
7636 constraints wrt. generic methods in interfaces and their
7639 2004-08-24 Martin Baulig <martin@ximian.com>
7641 * generic.cs (TypeParameter.IsSubclassOf): New public method.
7642 (Constraints.IsSubclassOf): New internal method.
7644 * typemanager.cs (TypeManager.FindMembers): Added special support
7645 for GenericTypeParameterBuilder's.
7646 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
7649 2004-08-24 Martin Baulig <martin@ximian.com>
7652 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7653 this for accessibility checks.
7654 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7655 IsNestedFamilyAccessible.
7656 (TypeManager.IsSubclassOf): New method, do what the name actually
7659 2004-08-24 Martin Baulig <martin@ximian.com>
7661 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
7662 as a SimpleName, include the generic arity.
7664 2004-08-24 Martin Baulig <martin@ximian.com>
7666 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7667 MethodAttributes.HideBySig for operators.
7669 2004-08-23 Martin Baulig <martin@ximian.com>
7671 Back to the old error reporting system :-)
7673 * report.cs (Message): Removed.
7674 (Report.MessageData, ErrorData, WarningData): Removed.
7675 (Report.Error, Warning): Back to the old system.
7677 2004-08-23 Martin Baulig <martin@ximian.com>
7679 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7681 * class.cs (TypeContainer.ParentContainer): New public virtual
7682 method; replaces the explicit interface implementation.
7683 (ClassPart.ParentContainer): Override.
7685 2004-08-23 Martin Baulig <martin@ximian.com>
7687 * statement.cs (Switch): Added support for constant switches; see
7688 #59428 or test-285.cs.
7690 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7693 * statement.cs (GetEnumeratorFilter): Removed useless
7694 logic because C# specs is strict. GetEnumerator must be
7697 2004-08-22 Martin Baulig <martin@ximian.com>
7699 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7700 a switch and may break, reset the barrier. Fixes #59867.
7702 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7704 CLS-Compliance speed up (~5% for corlib)
7706 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7707 New method. Tests container for CLS-Compliant names
7709 * class.cs (TypeContainer.VerifyClsName): New method.
7710 Checks whether container name is CLS Compliant.
7711 (Constructor): Implements IMethodData.
7713 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7714 low-case table for CLS Compliance test.
7715 (MemberCache.VerifyClsParameterConflict): New method.
7716 Checks method parameters for CS3006 error.
7718 * enum.cs (EnumMember): Is derived from MemberCore.
7719 (Enum.VerifyClsName): Optimized for better performance.
7721 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7723 * report.cs: Renamed Error_T to Error and changed all
7726 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7728 * class.cs (TypeContainer.IndexerArrayList): New inner class
7729 container for indexers.
7730 (TypeContainer.DefaultIndexerName): New constant for default
7731 indexer name. Replaced all "Item" with this constant.
7732 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7734 * typemanager.cs (TypeManager.default_member_ctor): Cache here
7735 DefaultMemberAttribute constructor.
7737 2004-08-05 Martin Baulig <martin@ximian.com>
7739 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7742 2004-08-05 Marek Safar <marek.safar@seznam.cz>
7744 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7745 multi platforms problem.
7747 * compiler.csproj: Included shared files.
7749 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7751 Fix bug 60333, 55971 in the more general way
7752 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7753 Added arg_type argument for constant conversion.
7754 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7756 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7759 * class.cs (TypeContainer ): New inner classes MethodArrayList,
7760 OperatorArrayList, MethodCoreArrayList for typecontainer
7761 containers. Changed class member types to these new types.
7762 (MethodArrayList.DefineMembers): Added test for CS0659.
7764 2004-08-04 Miguel de Icaza <miguel@ximian.com>
7766 * cfold.cs: Synchronize the folding with the code in expression.cs
7767 Binary.DoNumericPromotions for uint operands.
7769 * attribute.cs: Revert patch from Raja, it introduced a regression
7770 while building Blam-1.2.1 (hard to isolate a test case).
7772 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7776 (TypeContainer.Define): Renamed to DefineContainerMembers because of
7778 (MethodCore.parent_method): New member. The method we're overriding
7779 if this is an override method.
7780 (MethodCore.CheckBase): Moved from Method class and made common.
7781 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7783 (MethodCore.CheckForDuplications): New abstract method. For custom
7784 member duplication search in a container
7785 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7786 method and its return type.
7787 (Event.conflict_symbol): New member. Symbol with same name in the
7791 (MemberCache.FindMemberWithSameName): New method. The method
7792 is looking for conflict with inherited symbols.
7794 2004-08-04 Martin Baulig <martin@ximian.com>
7796 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7798 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7800 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7802 * report.cs (Message): New enum for better error, warning reference in
7804 (MessageData): New inner abstract class. It generally handles printing of
7805 error and warning messages.
7806 Removed unused Error, Warning, Message methods.
7808 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7810 Fix for cs0592-8.cs test
7812 (Attributable.ValidAttributeTargets): Made public.
7813 (Attribute.ExplicitTarget): New member for explicit target value.
7814 (Attribute.CheckTargets): Now we translate explicit attribute
7815 target to Target here.
7817 2004-08-03 Ben Maurer <bmaurer@ximian.com>
7819 * ecore.cs (MethodGroupExpr): new IsBase property.
7821 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7823 * delegate.cs (DelegateCreation): store a MethodGroupExpr
7824 rather than an instance expr.
7826 (DelegateCreation.Emit): Use the method group rather than
7827 the instance expression. Also, if you have base.Foo as the
7828 method for a delegate, make sure to emit ldftn, not ldftnvirt.
7830 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
7832 (NewDelegate.DoResolve): Only check for the existance of Invoke
7833 if the method is going to be needed. Use MethodGroupExpr.
7835 (NewDelegate.Emit): Remove, DelegateCreation implements this.
7837 * expression.cs: For pointer arith., make sure to use
7838 the size of the type, not the size of the pointer to
7841 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7844 * class.cs (Class): Added error CS0502 test.
7846 2004-08-03 John Luke <jluke@cfl.rr.com>
7847 Raja R Harinath <rharinath@novell.com>
7850 * attribute.cs (Attribute.complained_before): New flag.
7851 (Attribute.ResolveType, Attribute.Resolve),
7852 (Attribute.DefinePInvokeMethod): Set it.
7853 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7855 2004-08-03 Martin Baulig <martin@ximian.com>
7857 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7858 use a user-defined operator; we still need to do numeric
7859 promotions in case one argument is a builtin type and the other
7860 one has an implicit conversion to that type. Fixes #62322.
7862 2004-08-18 Martin Baulig <martin@ximian.com>
7864 * class.cs (Method.Define): Use the correct method name when
7865 creating the MethodBuilder for a generic method.
7867 2004-08-17 Martin Baulig <martin@ximian.com>
7869 * generic.cs (Constraints): Support type parameter constraints.
7871 2004-08-16 Martin Baulig <martin@ximian.com>
7873 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
7874 (Token.GENERIC_DIMENSION): New token; this is returned if we
7875 encounter an unbound generic type in a typeof() expression.
7877 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
7878 this token is only generated while parsing a typeof() expression.
7879 (typeof_expression): Removed the old unbound_type hack.
7881 * generic.cs (TypeArguments.IsUnbound): New public property.
7883 * decl.cs (MemberName): Added support for unbound types.
7885 2004-08-14 Martin Baulig <martin@ximian.com>
7888 (TypeManager.IsEqualGenericInstance): New static method.
7889 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
7890 just used to check accessibility, so follow the rules of 26.1.6.
7892 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
7893 ConstructedType instead of a TypeExpression if we have type arguments.
7895 * cs-parser.jay (typeof_expression): Support unbound generic types.
7897 * ecore.cs (UnboundTypeExpression): New public class.
7899 2004-08-12 Martin Baulig <martin@ximian.com>
7901 * typemanager.cs (TypeManager.IsNestedChildOf): Use
7902 TypeManager.IsEqual() rather than `=='.
7904 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
7905 generic instances as well.
7907 2004-08-12 Martin Baulig <martin@ximian.com>
7909 * expression.cs (Invocation.InferType): We can only infer method
7910 type parameters. Fixes #62647.
7912 2004-08-11 Martin Baulig <martin@ximian.com>
7914 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
7915 before resolving the base classes.
7917 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7919 * Makefile: install .mdb file too.
7921 2004-08-05 Martin Baulig <martin@ximian.com>
7923 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
7924 initializer, the current type is just the TypeBuilder, not the
7925 instantiated generic type.
7926 (FieldExpr.IsFieldInitializer): New public property.
7928 2004-08-04 Martin Baulig <martin@ximian.com>
7930 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7932 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7934 2004-08-03 Martin Baulig <martin@ximian.com>
7936 * class.cs (MethodData.Define): If we're an explicit
7937 implementation, remove the generic arity from the type name.
7939 2004-08-03 Martin Baulig <martin@ximian.com>
7941 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7942 use a user-defined operator; we still need to do numeric
7943 promotions in case one argument is a builtin type and the other
7944 one has an implicit conversion to that type. Fixes #62322.
7946 2004-08-02 Martin Baulig <martin@ximian.com>
7948 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
7950 (TypeContainer.GetClassBases): Return the unexpanded list of
7951 interfaces; we expand them later.
7952 (TypeContainer.DefineType): After creating the TypeBuilder, call
7953 TypeManager.ExpandInterfaces() to get an expanded and resolved
7956 * ecore.cs (TypeExpr.GetInterfaces): Removed
7958 * generics.cs (Constraints.InterfaceConstraints): Remove.
7959 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
7960 register the interface constraints.
7963 (TypeManager.AddUserType): Removed the `ifaces' argument.
7964 (TypeManager.AddTypeParameter): Likewise.
7965 (TypeManager.AddUserInterface): Removed, was unused.
7966 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
7967 `TypeExpr[]' array for the interfaces.
7968 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
7969 has been defined, returns a list of the resolved interfaces types.
7970 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
7971 (TypeManager.GetExplicitInterfaces): Likewise.
7973 2004-08-02 Martin Baulig <martin@ximian.com>
7975 * expression.cs (Invocation.EmitCall): If we're invoking a method
7976 on a type parameter, use the new `Constrained' prefix opcode.
7978 2004-08-02 Martin Baulig <martin@ximian.com>
7980 * statement.cs (LocalInfo.Flags): Added `IsThis'.
7981 (LocalInfo.IsThis): New public property.
7982 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7984 2004-08-01 Martin Baulig <martin@ximian.com>
7986 * class.cs (TypeContainer.GetClassBases): Don't set the default
7987 here since we may get called from GetPartialBases().
7988 (TypeContainer.DefineType): If GetClassBases() didn't return a
7989 parent, use the default one.
7991 2004-07-30 Martin Baulig <martin@ximian.com>
7993 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7995 * class.cs (SourceMethod): New public class, derive from the
7996 symbol writer's ISourceMethod.
7997 (Method): Use the new symbol writer API.
7999 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8000 as argument and use the new symbol writer.
8003 (SourceFile): Implement the symbol writer's ISourceFile.
8004 (Location.SymbolDocument): Removed.
8005 (Location.SourceFile): New public property.
8007 * symbolwriter.cs: Use the new symbol writer API.
8009 2004-07-30 Raja R Harinath <rharinath@novell.com>
8011 * Makefile (install-local): Remove. Functionality moved to
8014 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8016 * Makefile: Install mcs.exe.config file together with mcs.exe.
8017 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8018 correct runtime version.
8020 2004-07-25 Martin Baulig <martin@ximian.com>
8023 (TypeContainer.RegisterOrder): Removed, this was unused.
8024 (TypeContainer, interface_order): Removed.
8025 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8026 TypeContainer as argument since we can also be called with a
8027 `PartialContainer' for a partial class/struct/interface.
8028 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8029 of checking whether we're an `Interface' - we could be a
8031 (PartialContainer.Register): Override; call
8032 AddClass()/AddStruct()/AddInterface() on our parent.
8034 * cs-parser.jay (interface_member_declaration): Add things to the
8035 `current_container', not the `current_class'.
8037 * rootcontext.cs (RegisterOrder): The overloaded version which
8038 takes an `Interface' was unused, removed.
8040 * typemanager.cs (TypeManager.LookupInterface): Return a
8041 `TypeContainer', not an `Interface'.
8042 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8043 contain a `PartialContainer' for an interface, so check it's
8044 `Kind' to figure out what it is.
8046 2004-07-25 Martin Baulig <martin@ximian.com>
8048 * class.cs (Class.DefaultTypeAttributes): New public constant.
8049 (Struct.DefaultTypeAttributes): Likewise.
8050 (Interface.DefaultTypeAttributes): Likewise.
8051 (PartialContainer.TypeAttr): Override this and add the
8052 DefaultTypeAttributes.
8054 2004-07-25 Martin Baulig <martin@ximian.com>
8056 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8057 we can just use the `Parent' field instead.
8059 2004-07-25 Martin Baulig <martin@ximian.com>
8061 * class.cs (TypeContainer.Emit): Renamed to EmitType().
8063 2004-07-25 Martin Baulig <martin@ximian.com>
8065 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8066 our parts before defining any methods.
8067 (TypeContainer.VerifyImplements): Make this virtual.
8068 (ClassPart.VerifyImplements): Override and call VerifyImplements()
8069 on our PartialContainer.
8071 2004-07-25 Martin Baulig <martin@ximian.com>
8073 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8075 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8076 argument, we can just use the `Parent' field instead.
8079 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
8080 (MemberBase.DoDefine): Likewise.
8082 2004-07-24 Martin Baulig <martin@ximian.com>
8084 * decl.cs (MemberCore.Parent): New public field.
8085 (DeclSpace.Parent): Moved to MemberCore.
8087 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8088 (MemberBase.ctor): Added TypeContainer argument, pass it to our
8090 (FieldBase, Field, Operator): Likewise.
8091 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8092 (EventField, Event): Likewise.
8094 2004-07-23 Martin Baulig <martin@ximian.com>
8096 * class.cs (PartialContainer): New public class.
8097 (ClassPart): New public class.
8098 (TypeContainer): Added support for partial classes.
8099 (TypeContainer.GetClassBases): Splitted some of the functionality
8100 out into GetNormalBases() and GetPartialBases().
8102 * cs-tokenizer.cs (Token.PARTIAL): New token.
8103 (Tokenizer.consume_identifier): Added some hacks to recognize
8104 `partial', but only if it's immediately followed by `class',
8105 `struct' or `interface'.
8107 * cs-parser.jay: Added support for partial clases.
8109 2004-07-23 Martin Baulig <martin@ximian.com>
8111 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8112 a `DeclSpace' and also made it readonly.
8113 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8114 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8115 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8117 * cs-parser.jay: Pass the `current_class', not the
8118 `current_container' (at the moment, this is still the same thing)
8119 to a new Method, Property, Event, Indexer or Constructor.
8121 2004-07-23 Martin Baulig <martin@ximian.com>
8123 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8124 and removed the `current_interface' one.
8125 (struct_declaration, class_declaration, interface_declaration):
8126 Set `current_class' to the newly created class/struct/interface;
8127 set their `Bases' and call Register() before parsing their body.
8129 2004-07-23 Martin Baulig <martin@ximian.com>
8131 * class.cs (Kind): New public enum.
8132 (TypeContainer): Made this class abstract.
8133 (TypeContainer.Kind): New public readonly field.
8134 (TypeContainer.CheckDef): New public method; moved here from
8136 (TypeContainer.Register): New public abstract method.
8137 (TypeContainer.GetPendingImplementations): New public abstract
8139 (TypeContainer.GetClassBases): Removed the `is_class' and
8140 `is_iface' parameters.
8141 (TypeContainer.DefineNestedTypes): Formerly known as
8143 (ClassOrStruct): Made this class abstract.
8145 * tree.cs (RootTypes): New public type.
8147 2004-07-20 Martin Baulig <martin@ximian.com>
8149 * tree.cs (Tree.RecordNamespace): Removed.
8150 (Tree.Namespaces): Removed.
8152 * rootcontext.cs (RootContext.IsNamespace): Removed.
8154 * cs-parser.jay (namespace_declaration): Just create a new
8155 NamespaceEntry here.
8157 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
8159 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8160 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8161 entry to make sure it runs in the correct runtime version.
8163 2004-07-18 Martin Baulig <martin@ximian.com>
8165 * generic.cs (ConstructedType.CheckConstraints): Improved
8166 constraints checking.
8168 2004-07-18 Martin Baulig <martin@ximian.com>
8170 * expression.cs (Invocation.BetterMethod): Call
8171 TypeManager.TypeToCoreType() on all types and removed my previous
8172 hack; we're already doig the right thing here.
8174 2004-07-17 Martin Baulig <martin@ximian.com>
8176 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8178 2004-07-16 Martin Baulig <martin@ximian.com>
8180 * iterators.cs: Added generics support.
8182 2004-07-16 Martin Baulig <martin@ximian.com>
8184 * iterators.cs: Rewrote this. We're now using one single Proxy
8185 class for both the IEnumerable and the IEnumerator interface and
8186 `Iterator' derives from Class so we can use the high-level API.
8188 * class.cs (TypeContainer.AddIterator): New method.
8189 (TypeContainer.DoDefineType): New protected virtual method, which
8190 is called from DefineType().
8191 (TypeContainer.DoDefineMembers): Call DefineType() and
8192 DefineMembers() on all our iterators.
8193 (TypeContainer.Emit): Call Emit() on all our iterators.
8194 (TypeContainer.CloseType): Call CloseType() on all our iterators.
8196 * codegen.cs (EmitContext.CurrentIterator): New public field.
8198 2004-07-15 Martin Baulig <martin@ximian.com>
8201 (TypeManager.not_supported_exception_type): New type.
8203 2004-07-14 Martin Baulig <martin@ximian.com>
8206 (TypeManager.generic_ienumerable_type): New type.
8207 (TypeManager.generic_ienumerator_type): New type.
8210 (RootContext.interfaces_first_stage): Added
8211 "System.Collections.Generic.IEnumerator`1" and
8212 "System.Collections.Generic.IEnumerable`1".
8214 2004-07-14 Martin Baulig <martin@ximian.com>
8216 * iterators.cs: Use real error numbers.
8218 2004-07-14 Martin Baulig <martin@ximian.com>
8220 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8221 requires this to be a System.Collection.IEnumerable and not a
8222 class implementing that interface.
8223 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
8225 2004-07-13 Marek Safar <marek.safar@seznam.cz>
8227 * class.cs: Fixed previous fix, it broke some error tests.
8229 2004-07-12 Martin Baulig <martin@ximian.com>
8231 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8234 2004-07-14 Martin Baulig <martin@ximian.com>
8236 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8237 an exclamation mark (!) for the generic arity to reflect the
8238 latest spec changes; ie. use "System.Collections.Generic.IList`1".
8240 2004-07-13 Martin Baulig <martin@ximian.com>
8242 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8243 specifiers being part of a type argument.
8245 2004-07-13 Martin Baulig <martin@ximian.com>
8247 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8248 name for generic types.
8250 2004-07-13 Martin Baulig <martin@ximian.com>
8252 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8255 2004-07-09 Miguel de Icaza <miguel@ximian.com>
8257 * assign.cs (LocalTemporary): Add new argument: is_address,If
8258 `is_address' is true, then the value that we store is the address
8259 to the real value, and not the value itself.
8261 * ecore.cs (PropertyExpr): use the new local temporary
8262 stuff to allow us to handle X.Y += z (where X is a struct)
8264 2004-07-08 Martin Baulig <martin@ximian.com>
8266 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8267 not always return, just like we're doing in Using.Resolve().
8269 2004-07-07 Miguel de Icaza <miguel@ximian.com>
8271 * cs-parser.jay (fixed_statement): flag this as Pinned.
8273 2004-07-06 Miguel de Icaza <miguel@ximian.com>
8275 * typemanager.cs (TypeManager): Removed MakePinned method, this
8276 mechanism is replaced with the .NET 2.x compatible mechanism of
8277 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8279 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
8280 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8281 `IsFixed' property which has a different meaning.
8283 2004-07-02 Raja R Harinath <rharinath@novell.com>
8285 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8286 visible from inside a nested class, not just the names of the
8287 immediately enclosing class.
8290 2004-06-24 Raja R Harinath <rharinath@novell.com>
8292 * expression.cs (BetterConversion): Remove buggy special-case
8293 handling of "implicit constant expression conversions". At this
8294 point, we already know that the conversion is possible -- we're
8295 only checking to see which is better.
8297 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8299 * cs-parser.jay: Added error CS0210 test.
8301 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8303 * cs-parser.jay: Added error CS0134 test.
8305 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8308 * cs-parser.jay: Added error CS0145 test.
8310 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8312 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8314 2004-06-23 Ben Maurer <bmaurer@ximian.com>
8316 * expression.cs (StackAlloc.Resolve): The argument may not
8317 be a constant; deal with this case.
8319 2004-06-23 Marek Safar <marek.safar@seznam.cz>
8321 * attribute.cs (IndexerName_GetIndexerName): Renamed to
8322 GetIndexerAttributeValue.
8323 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8325 * class.cs (Indexer.Define): Added error tests for CS0415,
8328 2004-06-23 Miguel de Icaza <miguel@ximian.com>
8330 * attribute.cs (Attribute.Resolve): Keep field code in sync with
8333 2004-06-23 Martin Baulig <martin@ximian.com>
8335 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8336 neither return nor throw, reset the barrier as well. Fixes #60457.
8338 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
8340 * class.cs : EventAttributes is now set to None by default.
8341 This fixes bug #60459.
8343 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8346 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8347 Don't throw exception but return null (it's sufficient now).
8349 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8351 * typemanager.cs (GetArgumentTypes): Faster implementation.
8353 2004-06-18 Martin Baulig <martin@ximian.com>
8355 * attribute.cs (Attribute.Resolve): Check whether we're an
8356 EmptyCast which a Constant child. Fixes #60333.
8358 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8360 * statement.cs (EmitCollectionForeach): Account for the fact that
8361 not all valuetypes are in areas which we can take the address of.
8362 For these variables, we store to a temporary variable. Also, make
8363 sure that we dont emit a `callvirt' on a valuetype method.
8365 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8367 * expression.cs (StackAlloc.DoReSolve): Added test for
8368 negative parameter (CS0247).
8370 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8373 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8375 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8378 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8381 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8383 Fix bug #58254 & cs1555.cs, cs1556.cs
8384 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8386 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8388 * cs-parser.jay: Added error CS1669 test for indexers.
8390 2004-06-18 Martin Baulig <martin@ximian.com>
8392 * generics.cs (GenericMethod.ctor): Don't take an Attributes
8393 argument. Fixes #60441.
8395 2004-06-16 Ben Maurer <bmaurer@ximian.com>
8396 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8397 The name needs to have the actual name of the method in order
8398 for other tests (such as the one in OverloadResolve for Invoke
8399 on a delegate) to work. As well, it does not really help
8400 error reporting because the method group had multiple methods.
8401 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8402 Make profiling work.
8404 2004-06-13 Martin Baulig <martin@ximian.com>
8406 * cs-parser.jay: Don't allow generic attributes.
8408 2004-06-13 Martin Baulig <martin@ximian.com>
8410 * class.cs (MemberBase.DoDefineBase): New protected method.
8411 (MemberBase.DoDefine): Compute the `flags' in the new
8412 DoDefineBase() which must be called first.
8413 (Method.Define): Call DoDefineBase() first so we have the flags
8414 when defining the generic method.
8416 * cs-parser.jay (interface_method_declaration): Support generic methods.
8418 2004-06-13 Martin Baulig <martin@ximian.com>
8420 * decl.cs (TypeName): Removed.
8421 (MemberName): Removed TypeName and MemberNow; now we just have
8424 * cs-parser.jay: Don't distinguish between type arguments and type
8425 parameters in the grammar and simplified the rules a bit. The
8426 reduce/reduce conflicts are now gone (except the one we inherited
8429 2004-06-11 Martin Baulig <martin@ximian.com>
8431 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8432 call this twice: for params and varargs methods.
8434 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8437 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8439 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8441 * attribute.cs (Attribute.GetValidTargets): Made public.
8444 (AbstractPropertyEventMethod): New class for better code sharing.
8445 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8447 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8449 2004-06-09 Martin Baulig <martin@ximian.com>
8451 * cs-parser.jay: Removed a reduce/reduce conflict.
8453 2004-06-03 Martin Baulig <martin@ximian.com>
8455 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
8456 GetSimpleName() and return a SimpleName.
8458 * ecore.cs (SimpleName.Arguments): New public field.
8459 (SimpleName): Added overloaded ctor which takes an additional
8460 TypeArguments argument.
8461 (SimpleName.SimpleNameResolve): Added support for generic methods.
8462 (MethodGroupExpr.ResolveGeneric): New public method. The code was
8463 formerly in MemberAccess.DoResolve(), but we also need it in
8464 SimpleNameResolve().
8466 * expression.cs (MemberAccess.DoResolve): Use the new
8467 MethodGroupExpr.ResolveGeneric().
8469 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8471 * decl.cs: If possible, use lookuptypedirect here. We can only do
8472 this if there is no `.' after the namespace. Avoids using
8473 LookupType, which does lots of slow processing.
8474 (FindNestedType) New method, does what it says :-).
8475 * namespace.cs: use LookupTypeDirect.
8476 * rootcontext.cs: use membercache, if possible.
8477 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8479 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8482 According to the spec,
8484 In a member access of the form E.I, if E is a single identifier,
8485 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8486 field, property, localvariable, or parameter with the same type as
8487 the meaning of E as a type-name (§3.8), then both possible
8488 meanings of E are permitted.
8490 We did not check that E as a simple-name had the same type as E as
8493 This trivial check gives us 5-7% on bootstrap time.
8495 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8497 * expression.cs (Invocation.OverloadResolve): Avoid the
8498 use of hashtables and boxing here by allocating on demand.
8500 2004-05-30 Martin Baulig <martin@ximian.com>
8502 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8503 we're doing a silent lookup. Don't try to lookup nested types in
8504 TypeManager.object_type (thanks to Ben Maurer).
8506 2004-05-30 Martin Baulig <martin@ximian.com>
8508 Committing a patch from Ben Maurer.
8510 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8512 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8514 * convert.cs: add a trivial cache for overload operator resolution.
8516 2004-05-31 Marek Safar <marek.safar@seznam.cz>
8519 (AttributeTester.GetObsoleteAttribute): Returns instance of
8520 ObsoleteAttribute when type is obsolete.
8523 (TypeContainer.VerifyObsoleteAttribute): Override.
8524 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8525 (MethodCode.VerifyObsoleteAttribute): Override.
8526 (MemberBase.VerifyObsoleteAttribute): Override.
8529 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8530 and report proper error.
8533 (Delegate.VerifyObsoleteAttribute): Override.
8536 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8537 and report proper error.
8538 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8541 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8545 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8546 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8547 Added test for ObsoleteAttribute.
8550 (Catch): Derived from Statement.
8552 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8554 * decl.cs: If possible, use lookuptypedirect here. We can only do
8555 this if there is no `.' after the namespace. Avoids using
8556 LookupType, which does lots of slow processing.
8557 (FindNestedType) New method, does what it says :-).
8558 * namespace.cs: use LookupTypeDirect.
8559 * rootcontext.cs: use membercache, if possible.
8560 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8562 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8565 According to the spec,
8567 In a member access of the form E.I, if E is a single identifier,
8568 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8569 field, property, localvariable, or parameter with the same type as
8570 the meaning of E as a type-name (§3.8), then both possible
8571 meanings of E are permitted.
8573 We did not check that E as a simple-name had the same type as E as
8576 This trivial check gives us 5-7% on bootstrap time.
8578 2004-05-30 Marek Safar <marek.safar@seznam.cz>
8580 Fixed bug #59071 & cs0160.cs
8581 * statement.cs (Try.Resolve): Check here whether order of catch
8582 clauses matches their dependencies.
8584 2004-05-30 Marek Safar <marek.safar@seznam.cz>
8587 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
8590 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8592 * expression.cs (Invocation.OverloadResolve): Avoid the
8593 use of hashtables and boxing here by allocating on demand.
8595 2004-05-30 Martin Baulig <martin@ximian.com>
8597 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8598 we're doing a silent lookup. Don't try to lookup nested types in
8599 TypeManager.object_type (thanks to Ben Maurer).
8601 2004-05-30 Martin Baulig <martin@ximian.com>
8603 Committing a patch from Ben Maurer.
8605 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8607 2004-05-29 Martin Baulig <martin@ximian.com>
8609 * class.cs (IMethodData.ShouldIgnore): New method.
8611 * typemanager.cs (TypeManager.MethodFlags): Don't take a
8612 `Location' argument, we don't need it anywhere. Use
8613 `IMethodData.ShouldIgnore ()' instead of
8614 `MethodData.GetMethodFlags ()'.
8615 (TypeManager.AddMethod): Removed.
8616 (TypeManager.AddMethod2): Renamed to AddMethod.
8618 2004-05-29 Martin Baulig <martin@ximian.com>
8620 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8622 * convert.cs (Convert.ImplicitReferenceConversion): If we're
8623 converting from a class type S to an interface type and we already
8624 have an object on the stack, don't box it again. Fixes #52578.
8626 2004-05-29 Martin Baulig <martin@ximian.com>
8628 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8629 Added support for `params' parameters. Fixes #59267.
8631 2004-05-29 Martin Baulig <martin@ximian.com>
8633 * literal.cs (NullPointer): Provide a private .ctor which sets
8634 `type' to TypeManager.object_type. Fixes #59048.
8636 2004-05-29 Martin Baulig <martin@ximian.com>
8638 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8639 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
8641 * ecore.cs (EventExpr.instance_expr): Make the field private.
8643 2004-05-26 Marek Safar <marek.safar@seznam.cz>
8645 Fixed bug #50080 & cs0214-2.cs
8646 * expression.cs (Cast.DoResolve): Check unsafe context here.
8648 * statement.cs (Resolve.DoResolve): Likewise.
8650 2004-05-26 Martin Baulig <martin@ximian.com>
8652 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8654 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8655 (RootContext.LookupType): Pass down the `silent' flag.
8657 2004-05-25 Martin Baulig <martin@ximian.com>
8660 (MethodGroupExpr.IdenticalTypeName): New public property.
8661 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8662 expression actually refers to a type.
8664 2004-05-25 Martin Baulig <martin@ximian.com>
8666 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8667 for #56176 and made it actually work.
8669 2004-05-25 Martin Baulig <martin@ximian.com>
8671 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8672 (FieldExpr, PropertyExpr): Override and implement
8673 CacheTemporaries. Fixes #52279.
8675 2004-05-25 Miguel de Icaza <miguel@ximian.com>
8677 * location.cs: In the new compiler listing a file twice is a
8678 warning, not an error.
8680 2004-05-24 Martin Baulig <martin@ximian.com>
8682 * enum.cs (Enum.DefineType): For the `BaseType' to be a
8683 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
8685 2004-05-24 Martin Baulig <martin@ximian.com>
8687 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8688 walking the `using' list. Fixes #53921.
8690 2004-05-24 Martin Baulig <martin@ximian.com>
8692 * const.cs (Const.LookupConstantValue): Added support for
8693 EmptyCast's; fixes #55251.
8695 2004-05-24 Martin Baulig <martin@ximian.com>
8697 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8698 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8699 which does the CS0135 check. The reason is that we first need to
8700 check whether the variable actually exists.
8702 2004-05-24 Martin Baulig <martin@ximian.com>
8704 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8705 than RootContext.LookupType() to find the explicit interface
8708 2004-05-24 Raja R Harinath <rharinath@novell.com>
8710 * Makefile: Simplify. Use executable.make.
8711 * mcs.exe.sources: New file. List of sources of mcs.exe.
8713 2004-05-24 Anders Carlsson <andersca@gnome.org>
8717 Use the invariant culture when doing String.Compare for CLS case
8720 2004-05-23 Martin Baulig <martin@ximian.com>
8722 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8723 don't have any dots. Fixes #52622, added cs0246-8.cs.
8725 * namespace.cs (NamespaceEntry.Lookup): Likewise.
8727 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8729 * class.cs (MemberBase.Define): Reuse MemberType member for
8730 resolved type. Other methods can use it too.
8732 2004-05-23 Martin Baulig <martin@ximian.com>
8734 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8735 the variable also exists in the current block (otherwise, we need
8736 to report a CS0103). Fixes #58670.
8738 2004-05-23 Martin Baulig <martin@ximian.com>
8740 * flowanalysis.cs (Reachability.Reachable): Compute this
8741 on-the-fly rather than storing it as a field.
8743 2004-05-23 Martin Baulig <martin@ximian.com>
8745 * flowanalysis.cs (Reachability.And): Manually compute the
8746 resulting `barrier' from the reachability.
8748 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8751 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8752 instance of ObsoleteAttribute when symbol is obsolete.
8755 (IMethodData): Extended interface for ObsoleteAttribute support.
8757 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8759 * attribute.cs: Fix bug #55970
8761 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8765 (GetObsoleteAttribute): New method. Creates the instance of
8767 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8768 ObsoleteAttribute when member is obsolete.
8769 (AttributeTester.Report_ObsoleteMessage): Common method for
8770 Obsolete error/warning reporting.
8773 (TypeContainer.base_classs_type): New member for storing parent type.
8776 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8777 for this MemberCore.
8779 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8781 * attribute.cs, const.cs: Fix bug #58590
8783 2004-05-21 Martin Baulig <martin@ximian.com>
8785 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8786 out parameters if the end of the method is unreachable. Fixes
8789 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8791 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8792 Hari was right, why extra method.
8794 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8796 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8798 2004-05-20 Martin Baulig <martin@ximian.com>
8800 * delegate.cs: Convert this file to Unix mode - like the original
8803 2004-05-20 Martin Baulig <martin@ximian.com>
8805 * attribute.cs: Convert this file to Unix mode - like the original
8808 2004-05-19 Marek Safar <marek.safar@seznam.cz>
8810 Fix bug #58688 (MCS does not report error when the same attribute
8813 * attribute.cs (Attribute.Emit): Distinction between null and default.
8815 2004-05-19 Raja R Harinath <rharinath@novell.com>
8817 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8818 of a top-level attribute without an attribute target.
8819 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
8821 (Attribute.Conditional_GetConditionName),
8822 (Attribute.Obsolete_GetObsoleteMessage): Update.
8823 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
8824 part of ScanForIndexerName.
8825 (Attribute.CanIgnoreInvalidAttribute): New function.
8826 (Attribute.ScanForIndexerName): Move to ...
8827 (Attributes.ScanForIndexerName): ... here.
8828 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8829 (Attributes.Search): New internal variant that can choose not to
8830 complain if types aren't resolved. The original signature now
8832 (Attributes.GetClsCompliantAttribute): Use internal variant, with
8833 complaints suppressed.
8834 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8835 only if it not useful.
8836 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8837 top-level for attributes that are shared between the assembly
8838 and a top-level class.
8839 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8840 * class.cs: Update to reflect changes.
8841 (DefineIndexers): Fuse loops.
8842 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
8843 a couple more variants of attribute names.
8845 2004-05-18 Marek Safar <marek.safar@seznam.cz>
8847 Fix bug #52585 (Implemented explicit attribute declaration)
8850 (Attributable.ValidAttributeTargets): New abstract method. It gets
8851 list of valid attribute targets for explicit target declaration.
8852 (Attribute.Target): It holds target itself.
8853 (AttributeSection): Removed.
8854 (Attribute.CheckTargets): New method. It checks whether attribute
8855 target is valid for the current element.
8858 (EventProperty): New class. For events that are declared like
8859 property (with add and remove accessors).
8860 (EventField): New class. For events that are declared like field.
8863 * cs-parser.jay: Implemented explicit attribute target declaration.
8865 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
8866 Override ValidAttributeTargets.
8869 (ReturnParameter): Class for applying custom attributes on
8871 (ParameterAtribute): New class. Class for applying custom
8872 attributes on the parameter type.
8874 2004-05-17 Miguel de Icaza <miguel@ximian.com>
8876 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8879 (Method): Allow UNSAFE here.
8881 * modifiers.cs: Support unsafe reporting.
8883 2004-05-17 Marek Safar <marek.safar@seznam.cz>
8885 * decl.cs: Fix bug #58478.
8887 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8889 * statement.cs: When checking for unreachable code on an EmptyStatement,
8890 set the location. Fixes bug #58488.
8892 2004-05-13 Miguel de Icaza <miguel@ximian.com>
8894 * driver.cs: Add -pkg handling.
8896 From Gonzalo: UseShelLExecute=false
8898 2004-05-12 Marek Safar <marek.safar@seznam.cz>
8901 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8903 (Attribute.IsClsCompliaceRequired): Moved to base for better
8905 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8906 when attribute is AttributeUsageAttribute.
8907 (Attribute.GetValidTargets): Simplified.
8908 (Attribute.GetAttributeUsage): New method returns AttributeUsage
8909 attribute for this type.
8910 (Attribute.ApplyAttributes): Method renamed to Emit and make
8912 (GlobalAttributeSection): New class for special handling of global
8913 attributes (assembly, module).
8914 (AttributeSection.Emit): New method.
8916 * class.cs: Implemented Attributable abstract methods.
8917 (MethodCore.LabelParameters): Moved to Parameter class.
8918 (Accessor): Is back simple class.
8919 (PropertyMethod): Implemented Attributable abstract class.
8920 (DelegateMethod): Implemented Attributable abstract class.
8921 (Event): New constructor for disctintion between normal Event
8922 and Event with accessors.
8924 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8926 * codegen.cs, const.cs, decl.cs, delegate.cs:
8927 (CommonAssemblyModulClass): Implemented Attributable abstract class
8930 * enum.cs: Implement IAttributeSupport interface.
8931 (EnumMember): New class for emum members. Implemented Attributable
8935 (ParameterBase): Is abstract.
8936 (ReturnParameter): New class for easier [return:] attribute handling.
8938 * typemanager.cs: Removed builder_to_attr.
8940 2004-05-11 Raja R Harinath <rharinath@novell.com>
8943 * attribute.cs (Attribute.GetPositionalValue): New function.
8944 * class.cs (TypeContainer.VerifyMembers): New function.
8945 (TypeContainer.Emit): Use it.
8946 (ClassOrStruct): New base class for Class and Struct.
8947 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
8948 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8950 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8951 then each non-static field should have a FieldOffset attribute.
8952 Otherwise, none of the fields should have a FieldOffset attribute.
8953 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
8954 and FieldOffset attributes.
8955 * typemanager.cs (TypeManager.struct_layout_attribute_type)
8956 (TypeManager.field_offset_attribute_type): New core types.
8957 (TypeManager.InitCoreTypes): Initialize them.
8959 2004-05-11 Michal Moskal <malekith@pld-linux.org>
8961 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8962 Return correct type.
8965 2004-05-09 Miguel de Icaza <miguel@ximian.com>
8967 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8968 be implicitly converted to ulong.
8970 * expression.cs: The logic for allowing operator &, | and ^ worked
8971 was wrong, it worked before because we did not report an error in
8972 an else branch. Fixes 57895.
8974 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8975 allow volatile fields to be reference types.
8977 2004-05-07 Miguel de Icaza <miguel@ximian.com>
8979 * driver.cs: Add support for /debug-
8981 2004-05-07 Raja R Harinath <rharinath@novell.com>
8983 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
8984 Add a 'complain' parameter to silence errors.
8985 (Attribute.Resolve): Update to changes. Put in sanity check to catch
8986 silently overlooked type-resolutions.
8987 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8989 (Attributes.Search): New function.
8990 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
8991 (Attributes.GetAttributeFullName): Remove hack.
8992 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
8993 Update to reflect changes.
8994 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8995 Use Attributes.Search instead of nested loops.
8997 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9000 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9001 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9002 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9004 * report.cs: (Report.Warning): Renamed to Warning_T because of
9005 parameter collision.
9007 2004-05-05 Raja R Harinath <rharinath@novell.com>
9009 * expression.cs (MemberAccess.ResolveMemberAccess):
9010 Exit with non-zero status after Report.Error.
9011 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9013 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9015 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9017 * support.cs: Don't hang when the file is empty.
9019 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9021 * support.cs: In SeekableStreamReader, compute the preamble size of the
9022 underlying stream. Position changes should take into account that initial
9025 2004-05-03 Todd Berman <tberman@sevenl.net>
9027 * driver.cs: remove unused GetSysVersion function.
9029 2004-05-03 Todd Berman <tberman@sevenl.net>
9031 * driver.cs: Remove the hack from saturday, as well as the hack
9032 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9033 link_paths to get that bit proper.
9035 2004-05-01 Todd Berman <tberman@sevenl.net>
9037 * driver.cs: Try a LoadFrom before a Load, this checks the current
9038 path. This is currently a bug in mono that is be fixed, however, this
9039 provides a workaround for now. This will be removed when the bug
9042 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9044 * CryptoConvert.cs: Updated to latest version. Fix issue with
9045 incomplete key pairs (#57941).
9047 2004-05-01 Todd Berman <tberman@sevenl.net>
9049 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9052 2004-04-30 Jackson Harper <jackson@ximian.com>
9054 * codegen.cs: Open keys readonly.
9056 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9058 * typemanager.cs: don't report cyclic struct layout when a struct
9059 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9060 which has 2 Pango.Rectangle fields.
9062 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9064 * expression.cs: Handle IntPtr comparisons with IL code
9065 rather than a method call.
9067 2004-04-29 Martin Baulig <martin@ximian.com>
9069 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9070 the list of PropertyInfo's in class hierarchy and find the
9071 accessor. Fixes #56013.
9073 2004-04-29 Martin Baulig <martin@ximian.com>
9075 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9077 2004-04-29 Martin Baulig <martin@ximian.com>
9079 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9081 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9083 2004-04-29 Martin Baulig <martin@ximian.com>
9085 * class.cs (ConstructorInitializer.Resolve): Check whether the
9086 parent .ctor is accessible. Fixes #52146.
9088 2004-04-29 Martin Baulig <martin@ximian.com>
9090 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9092 * statement.cs (Using.EmitLocalVariableDecls): Use
9093 TypeManager.idisposable_type, not typeof (IDisposable).
9094 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9096 2004-04-29 Martin Baulig <martin@ximian.com>
9098 * class.cs (Event.Define): Don't emit the field and don't set
9099 RTSpecialName and SpecialName for events on interfaces. Fixes
9102 2004-04-29 Raja R Harinath <rharinath@novell.com>
9104 Refactor Attribute.ApplyAttributes.
9105 * attribute.cs (Attributable): New base class for objects that can
9106 have Attributes applied on them.
9107 (Attribute): Make AttributeUsage fields public.
9108 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9109 (Attribute.IsInternalCall): New property.
9110 (Attribute.UsageAttr): Convert to a public read-only property.
9111 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9112 (Attribute.ResolveType, Attribute.Resolve)
9113 (Attribute.ScanForIndexerName): Update to reflect changes.
9114 (Attribute.CheckAttributeTarget): Re-format.
9115 (Attribute.ApplyAttributes): Refactor, to various
9116 Attributable.ApplyAttributeBuilder methods.
9117 * decl.cs (MemberCore): Make Attributable.
9118 * class.cs (Accessor): Make Attributable.
9119 (MethodData.ApplyAttributes): Use proper attribute types, not
9121 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9122 (TypeContainer.ApplyAttributeBuilder)
9123 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9124 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9125 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9126 (Operator.ApplyAttributeBuilder): New factored-out methods.
9127 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9128 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9129 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9130 * parameter.cs (ParameterBase): New Attributable base class
9131 that can also represent Return types.
9132 (Parameter): Update to the changes.
9134 2004-04-29 Jackson Harper <jackson@ximian.com>
9136 * driver.cs: Prefer the corlib system version when looking for
9137 assemblies in the GAC. This is still a hack, but its a better hack
9140 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9142 * decl.cs, enum.cs: Improved error 3005 reporting.
9144 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9145 (related_symbols): New private member for list of symbols
9146 related to reported error/warning.
9148 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9150 2004-04-29 Martin Baulig <martin@ximian.com>
9152 * ecore.cs (Expression.Constantify): If we're an enum and
9153 TypeManager.TypeToCoreType() doesn't give us another type, use
9154 t.UnderlyingSystemType. Fixes #56178.
9156 2004-04-29 Martin Baulig <martin@ximian.com>
9158 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9159 interfaces and for each interface, only add members directly
9160 declared in that interface. Fixes #53255.
9162 2004-04-28 Martin Baulig <martin@ximian.com>
9164 * expression.cs (ConditionalLogicalOperator): Use a temporary
9165 variable for `left' to avoid that we evaluate it more than once;
9168 2004-04-28 Martin Baulig <martin@ximian.com>
9170 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9173 2004-04-28 Martin Baulig <martin@ximian.com>
9175 * statement.cs (LocalInfo.Resolve): Check whether the type is not
9178 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9179 whether the type is not void (CS1547).
9181 2004-04-28 Martin Baulig <martin@ximian.com>
9183 * expression.cs (Unary.DoResolveLValue): Override this and report
9184 CS0131 for anything but Operator.Indirection.
9186 2004-04-28 Martin Baulig <martin@ximian.com>
9188 Committing a patch from Ben Maurer; see bug #50820.
9190 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9193 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9196 2004-04-28 Martin Baulig <martin@ximian.com>
9198 Committing a patch from Ben Maurer; see bug #50820.
9200 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9203 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9206 2004-04-28 Martin Baulig <martin@ximian.com>
9208 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9209 (Block.AddLabel): Call DoLookupLabel() to only search in the
9212 2004-04-28 Martin Baulig <martin@ximian.com>
9214 * cfold.cs (ConstantFold.BinaryFold): Added special support for
9215 comparing StringConstants and NullLiterals in Equality and Inequality.
9217 2004-04-28 Jackson Harper <jackson@ximian.com>
9219 * driver.cs: Attempt to load referenced assemblies from the
9220 GAC. This is the quick and dirty version of this method that
9221 doesnt take into account versions and just takes the first
9222 canidate found. Will be good enough for now as we will not have more
9223 then one version installed into the GAC until I update this method.
9225 2004-04-28 Martin Baulig <martin@ximian.com>
9227 * typemanager.cs (TypeManager.CheckStructCycles): New public
9228 static method to check for cycles in the struct layout.
9230 * rootcontext.cs (RootContext.PopulateTypes): Call
9231 TypeManager.CheckStructCycles() for each TypeContainer.
9232 [Note: We only need to visit each type once.]
9234 2004-04-28 Martin Baulig <martin@ximian.com>
9236 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9238 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9239 success and added `out object value'. Use a `bool resolved' field
9240 to check whether we've already been called rather than
9241 `ConstantValue != null' since this breaks for NullLiterals.
9243 2004-04-28 Raja R Harinath <rharinath@novell.com>
9245 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9246 setting of this flag, since the 'set' method may be non-public.
9248 2004-04-28 Raja R Harinath <rharinath@novell.com>
9250 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9251 check on current_vector.Block.
9253 2004-04-27 Martin Baulig <martin@ximian.com>
9255 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9256 a field initializer. Fixes #56459.
9258 2004-04-27 Martin Baulig <martin@ximian.com>
9260 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9261 we're not attempting to use an indexer. Fixes #52154.
9263 2004-04-27 Martin Baulig <martin@ximian.com>
9265 * statement.cs (Return): Don't create a return label if we don't
9266 need it; reverts my change from January 20th. Thanks to Ben
9269 2004-04-27 Martin Baulig <martin@ximian.com>
9271 According to the spec, `goto' can only leave a nested scope, but
9274 * statement.cs (Block.LookupLabel): Only lookup in the current
9275 block, don't recurse into parent or child blocks.
9276 (Block.AddLabel): Check in parent and child blocks, report
9277 CS0140/CS0158 if we find a duplicate.
9278 (Block): Removed this indexer for label lookups.
9279 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9280 this already does the error reporting for us.
9283 (FlowBranching.UsageVector.Block): New public variable; may be null.
9284 (FlowBranching.CreateSibling): Added `Block' argument.
9285 (FlowBranching.LookupLabel): New public virtual method. Lookup a
9286 label for the target of a `goto' and check whether we're not
9287 leaving a `finally'.
9289 2004-04-27 Martin Baulig <martin@ximian.com>
9291 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9292 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9295 2004-04-27 Martin Baulig <martin@ximian.com>
9297 * statement.cs (Block.AddLabel): Also check for implicit blocks
9298 and added a CS0158 check.
9300 2004-04-27 Martin Baulig <martin@ximian.com>
9302 * flowanalysis.cs (FlowBranchingLoop): New class.
9303 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9304 UsageVector's instead of an ArrayList.
9305 (FlowBranching.Label): Likewise.
9306 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9307 (FlowBranching.AddBreakVector): New method.
9309 2004-04-27 Miguel de Icaza <miguel@ximian.com>
9311 * attribute.cs: Small regression fix: only convert the type if we
9312 the type is different, fixes System.Drawing build.
9314 2004-04-27 Martin Baulig <martin@ximian.com>
9316 * attribute.cs (Attribute.Resolve): If we have a constant value
9317 for a named field or property, implicity convert it to the correct
9320 2004-04-27 Raja R Harinath <rharinath@novell.com>
9322 * statement.cs (Block.Block): Implicit blocks share
9323 'child_variable_names' fields with parent blocks.
9324 (Block.AddChildVariableNames): Remove.
9325 (Block.AddVariable): Mark variable as "used by a child block" in
9326 every surrounding block.
9327 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9328 been used in a child block, complain about violation of "Invariant
9329 meaning in blocks" rule.
9330 * cs-parser.jay (declare_local_variables): Don't use
9331 AddChildVariableNames.
9332 (foreach_statement): Don't create an implicit block: 'foreach'
9335 2004-04-23 Miguel de Icaza <miguel@ximian.com>
9337 * convert.cs (ImplicitNumericConversion): 0 is also positive when
9338 converting from 0L to ulong. Fixes 57522.
9340 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9342 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9343 derived class hides via 'new' keyword field from base class (test-242.cs).
9344 TODO: Handle this in the more general way.
9346 * class.cs (CheckBase): Ditto.
9348 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9350 * decl.cs (caching_flags): New member for storing cached values
9352 (MemberCore.Flags): New enum where bit flags for caching_flags
9354 (MemberCore.cls_compliance): Moved to caching_flags.
9355 (DeclSpace.Created): Moved to caching_flags.
9357 * class.cs: Use caching_flags instead of DeclSpace.Created
9359 2004-04-21 Miguel de Icaza <miguel@ximian.com>
9361 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9362 if we are only a derived class, not a nested class.
9364 * typemanager.cs: Same as above, but do this at the MemberLookup
9365 level (used by field and methods, properties are handled in
9366 PropertyExpr). Allow for the qualified access if we are a nested
9369 2004-04-21 Marek Safar <marek.safar@seznam.cz>
9371 * class.cs: Refactoring.
9372 (IMethodData): New inteface; Holds links to parent members
9373 to avoid member duplication (reduced memory allocation).
9374 (Method): Implemented IMethodData interface.
9375 (PropertyBase): New inner classes for get/set methods.
9376 (PropertyBase.PropertyMethod): Implemented IMethodData interface
9377 (Event): New inner classes for add/remove methods.
9378 (Event.DelegateMethod): Implemented IMethodData interface.
9380 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9381 EmitContext (related to class.cs refactoring).
9383 2004-04-21 Raja R Harinath <rharinath@novell.com>
9385 * delegate.cs (Delegate.VerifyApplicability): If the number of
9386 arguments are the same as the number of parameters, first try to
9387 verify applicability ignoring any 'params' modifier on the last
9391 2004-04-08 Martin Baulig <martin@ximian.com>
9393 Merged latest changes into gmcs. Please keep this comment in
9394 here, it makes it easier for me to see what changed in MCS since
9395 the last time I merged.
9397 2004-04-16 Raja R Harinath <rharinath@novell.com>
9399 * class.cs (TypeContainer.AddIndexer): Use
9400 'ExplicitInterfaceName' to determine if interface name was
9401 explicitly specified. 'InterfaceType' is not initialized at this time.
9402 (TypeContainer.DefineIndexers): Remove use of temporary list. The
9403 Indexers array is already in the required order. Initialize
9404 'IndexerName' only if there are normal indexers.
9405 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9406 (TypeContainer.Emit): Emit DefaultMember attribute only if
9407 IndexerName is initialized.
9410 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
9412 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9415 2004-04-15 Raja R Harinath <rharinath@novell.com>
9417 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9421 * attribute.cs (Attribute.Resolve): Check for duplicate named
9425 2004-04-15 Miguel de Icaza <miguel@ximian.com>
9427 * iterators.cs (MarkYield): track whether we are in an exception,
9428 and generate code accordingly. Use a temporary value to store the
9429 result for our state.
9431 I had ignored a bit the interaction of try/catch with iterators
9432 since their behavior was not entirely obvious, but now it is
9433 possible to verify that our behavior is the same as MS .NET 2.0
9437 2004-04-14 Miguel de Icaza <miguel@ximian.com>
9439 * iterators.cs: Avoid creating temporaries if there is no work to
9442 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9443 Enumerations, use TypeManager.EnumToUnderlying and call
9446 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9449 (This.Emit): Use EmitContext.EmitThis to emit our
9452 (This.EmitAssign): Ditto.
9454 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9455 codepaths, we will move all the functionality into
9458 (FieldExpr.EmitAssign): Ditto.
9460 This fixes several hidden bugs that I uncovered while doing a code
9461 review of this today.
9463 * codegen.cs (EmitThis): reworked so the semantics are more clear
9464 and also support value types "this" instances.
9466 * iterators.cs: Changed so that for iterators in value types, we
9467 do not pass the value type as a parameter.
9469 Initialization of the enumerator helpers is now done in the caller
9470 instead of passing the parameters to the constructors and having
9471 the constructor set the fields.
9473 The fields have now `assembly' visibility instead of private.
9475 2004-04-11 Miguel de Icaza <miguel@ximian.com>
9477 * expression.cs (Argument.Resolve): Check if fields passed as ref
9478 or out are contained in a MarshalByRefObject.
9480 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9481 another compiler type.
9483 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
9485 * class.cs (Indexer.Define): use the new name checking method.
9486 Also, return false on an error.
9487 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9488 (is_identifier_[start/part]_character): make static.
9490 2004-04-10 Miguel de Icaza <miguel@ximian.com>
9492 * expression.cs (Binary.ResolveOperator): Do no append strings
9493 twice: since we can be invoked more than once (array evaluation)
9494 on the same concatenation, take care of this here. Based on a fix
9495 from Ben (bug #56454)
9497 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9499 * codegen.cs: Fix another case where CS1548 must be reported (when
9500 delay-sign isn't specified and no private is available #56564). Fix
9501 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9502 error when MCS is used on the MS runtime and we need to delay-sign
9503 (which seems unsupported by AssemblyBuilder - see #56621).
9505 2004-04-08 Marek Safar <marek.safar@seznam.cz>
9507 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9508 (TypeManager.ComputeNamespaces): Faster implementation for
9511 * compiler.csproj: Updated AssemblyName to mcs.
9513 2004-05-11 Jackson Harper <jackson@ximian.com>
9515 * Makefile: Preserve MONO_PATH
9517 2004-05-11 Jackson Harper <jackson@ximian.com>
9519 * Makefile: Use mono and mcs to build gmcs
9521 2004-05-03 Miguel de Icaza <miguel@ximian.com>
9523 * codegen.cs: Add patch from Robert Shade
9524 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
9527 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
9529 * CryptoConvert.cs: Updated to latest version. Fix issue with
9530 incomplete key pairs (#57941).
9532 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9534 * codegen.cs: Fix another case where CS1548 must be reported (when
9535 delay-sign isn't specified and no private is available #56564). Fix
9536 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9537 error when MCS is used on the MS runtime and we need to delay-sign
9538 (which seems unsupported by AssemblyBuilder - see #56621).
9540 2004-04-29 Jackson Harper <jackson@ximian.com>
9542 * Makefile: Set MONO_PATH to use the bootstrap corlib
9543 * driver.cs: Check the GAC for referenced assemblies.
9545 2004-04-29 Martin Baulig <martin@ximian.com>
9547 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
9549 2004-04-07 Martin Baulig <martin@ximian.com>
9551 * expression.cs (Binary.ResolveOperator): Added special case for
9552 Equality/Inequality between a type parameter and a null literal.
9554 2004-04-07 Martin Baulig <martin@ximian.com>
9556 * convert.cs: Check null literal -> type parameter conversions.
9558 2004-04-07 Martin Baulig <martin@ximian.com>
9560 * generic.cs (ConstructedType.CheckConstraints): Enforce the
9561 `class' and `struct' constraints.
9563 2004-04-07 Martin Baulig <martin@ximian.com>
9565 * generic.cs (SpecialConstraint): New public enum.
9566 (Constraints.Resolve): Added support for the `class' and `struct'
9569 * cs-parser.jay (type_parameter_constraint): Added support for the
9570 `class' and `struct' constraints.
9572 2004-04-07 Martin Baulig <martin@ximian.com>
9574 * support.cs (GenericConstraints): Replaced `Types' by
9575 `ClassConstraint' and `InterfaceConstraints'; added
9576 `HasClassConstraint'.
9578 2004-04-07 Martin Baulig <martin@ximian.com>
9581 (Constraints.InterfaceConstraints): New public property.
9582 (Constraints.Types): Make this property public
9583 (TypeParameter): Implement IMemberContainer.
9584 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
9585 instead of a TypeBuilder/MethodBuilder; pass the interface
9586 constraints to TypeManager.AddTypeParameter().
9587 (TypeParameter.DefineType): Just take an EmitContext and no
9588 TypeBuilder/MethodBuilder. Use the new public API.
9590 * typemanager.cs (TypeManager.AddTypeParameter): Added
9591 `TypeExpr[]' argument; add the interfaces to the
9592 `builder_to_ifaces' hash.
9593 (TypeManager.LookupMemberContainer): For
9594 GenericTypeParameterBuilders, get the TypeParameter from the
9595 `builder_to_type_param'.
9596 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
9597 the TypeParameter and call FindMembers on it.
9599 2004-04-07 Martin Baulig <martin@ximian.com>
9602 (MethodCore.GenericMethod): Moved this field here from Method.
9603 (MethodCore.IsDuplicateImplementation): Take the number of type
9604 parameters into account if we're a generic method.
9606 * expression.cs (Invocation.InferTypeArguments): Don't return true
9607 if `arguments' is null; we still need to check whether we actually
9608 don't need to infer anything in this case.
9609 (MemberAccess): Merged the functionality from GenericMemberAccess
9612 * generic.cs (GenericMemberAccess): Removed.
9614 2004-04-05 Martin Baulig <martin@ximian.com>
9616 * decl.cs (MemberCore): For generic classes, interfaces and
9617 structs, `Name' now includes the number of type parameters
9619 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
9620 encode the number of type arguments in the type name.
9622 * expression.cs (Expression.MemberLookup): Removed the
9623 `num_type_args' argument; we now encode the number of type
9624 arguments in the type name.
9626 * ecore.cs (SimpleName): Encode the number of type arguments in
9627 the type name itself.
9629 * generic.cs (ConstructedType): Likewise.
9631 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
9632 `MemberName'; we now include the number of type parameters in the
9635 * typemanager.cs (TypeManager.CheckGeneric): Removed.
9636 (TypeManager.MemberLookup): Removed the
9637 `num_type_args' argument; we now encode the number of type
9638 arguments in the type name.
9640 2004-04-03 Martin Baulig <martin@ximian.com>
9642 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
9643 (MemberCore.MemberName): Moved here from MemberBase.
9644 (DeclSpace.SetParameterInfo): Just take the constraints as an
9645 ArrayList; we already have the type parameters in our
9646 `MemberName'; also do the CS0080 reporting here.
9648 * cs-parser.jay (struct_declaration): Use `member_name' instead of
9649 `IDENTIFIER opt_type_parameter_list'; when constructing our
9650 `MemberName', it'll already include our type parameters.
9651 (class_declaration, interface_declaration): Likewise.
9652 (delegate_declaration): Likewise.
9653 (MakeName): Take a MemberName and return a MemberName.
9654 The following two changes are required to avoid shift/reduce conflicts:
9655 (member_name): Don't include a TypeName anymore; ie. this is now
9656 just 'IDENTIFIER opt_type_parameter_list'.
9657 (property_declaration, event_declaration): Use a
9658 `namespace_or_type_name' instead of a `member_name'.
9660 2004-04-03 Martin Baulig <martin@ximian.com>
9662 * decl.cs (MemberName): Renamed to `TypeName' and created a new
9664 (TypeName): Formerly known as MemberName.
9666 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
9667 instead of a `MemberName'.
9669 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
9670 (member_name): New rule; create a MemberName.
9672 2004-04-02 Martin Baulig <martin@ximian.com>
9674 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
9675 (CS0305 and CS0308).
9677 2004-04-02 Martin Baulig <martin@ximian.com>
9679 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
9680 support for nested types.
9682 2004-04-02 Martin Baulig <martin@ximian.com>
9684 * ecore.cs (IAlias): New public interface.
9685 (TypeExpr, TypeExpression): Implement IAlias.
9686 (TypeAliasExpression): New public class.
9688 * namespace.cs (Namespace): Implement IAlias.
9689 (Namespace.Lookup): Return an IAlias instead on an object.
9690 (Namespace.DefineName): Take an IAlias instead of an object.
9691 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
9693 (NamespaceEntry.UsingAlias): Take a Membername instead of an
9695 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
9697 (NamespaceEntry.Lookup): Likewise.
9699 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
9702 * decl.cs (DeclSpace): Implement IAlias.
9703 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
9705 * generic.cs (ConstructedType): Improved error checking.
9707 2004-04-02 Martin Baulig <martin@ximian.com>
9709 * convert.cs: Added type parameter conversions.
9712 (UnboxCast.Emit): Emit an `unbox.any' for type params.
9713 (ClassCast.Emit): If the source type is a type parameter, box it.
9714 If the target type is a type parameter, emit an `unbox.any'
9715 instead of a `classcast'.1
9717 2004-04-01 Martin Baulig <martin@ximian.com>
9719 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
9721 2004-04-01 Martin Baulig <martin@ximian.com>
9723 * generic.cs (ConstructedType.CheckConstraints): Use
9724 Convert.ImplicitStandardConversionExists(); user-defined implicit
9725 conversions are not allowed according to the spec.
9727 2004-03-30 Martin Baulig <martin@ximian.com>
9729 * expression.cs (New): Added support for type parameters.
9732 (TypeManager.activator_type): New public static field.
9733 (TypeManager.activator_create_instance): Likewise.
9735 2004-03-30 Martin Baulig <martin@ximian.com>
9737 * typemanager.cs (TypeManager.HasConstructorConstraint): New
9740 2004-03-30 Martin Baulig <martin@ximian.com>
9742 * generic.cs (ConstructedType.CheckConstraints): Actually follow
9743 the spec here: the argument type must be convertible to the
9746 2004-03-30 Martin Baulig <martin@ximian.com>
9749 (TypeParameter.Define, TypeParameter.DefineMethod): Call
9750 TypeManager.AddTypeParameter().
9751 (ConstructedType.CheckConstraints): Re-enable this and actually
9752 check whether we have a constructor constraint.
9755 (TypeManager.builder_to_type_param): New static field.
9756 (TypeManager.AddTypeParameter): New static method.
9757 (TypeManager.LookupTypeParameter): New public method.
9759 2004-03-30 Martin Baulig <martin@ximian.com>
9761 * generic.cs (TypeParameter.DefineType): Return a boolean and use
9762 the new API to actually define the constructor constraint.
9765 (TypeManager.new_constraint_attr_type): New static field.
9766 (TypeManager.InitCoreTypes): Initialize it.
9768 2004-03-30 Martin Baulig <martin@ximian.com>
9770 * generic.cs (Constraints): Completed error checking, use correct
9773 2004-03-29 Martin Baulig <martin@ximian.com>
9775 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
9777 * expression.cs (Invocation.InferTypeArguments): Added overloaded
9778 public version which takes a `ParameterData pd' instead of an
9781 2004-03-29 Martin Baulig <martin@ximian.com>
9783 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
9786 2004-03-29 Martin Baulig <martin@ximian.com>
9788 * expression.cs (Argument.ResolveMethodGroup): If we're a
9789 ConstructedType, call GetMemberAccess() on it.
9791 2004-03-29 Martin Baulig <martin@ximian.com>
9793 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
9794 (MethodCore.CheckGenericOverride): When overriding a generic
9795 method, check whether the constraints match.
9797 * support.cs (GenericConstraints): New public interface.
9798 (ParameterData.GenericConstraints): New public method.
9800 * parameter.cs (Parameter.Resolve): Check whether we're a generic
9801 method parameter and compute our constraints if appropriate.
9802 (Parameter.GenericConstraints): New public property.
9804 * generic.cs (Constraints): Implement GenericConstraints.
9806 2004-03-29 Martin Baulig <martin@ximian.com>
9808 * decl.cs (MemberCache.FindMemberToOverride): Use
9809 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
9811 2004-03-29 Martin Baulig <martin@ximian.com>
9813 * generic.cs (GenericMethod.Define): Resolve our type parameters.
9815 2004-03-29 Martin Baulig <martin@ximian.com>
9817 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
9818 not allowed on non-generic declarations").
9820 2004-03-29 Martin Baulig <martin@ximian.com>
9822 * expression.cs (Invocation.InferTypeArguments): Added overloaded
9823 public version of this method.
9825 * class.cs (MethodCore.IsDuplicateImplementation): Use
9826 Invocation.InferTypeArguments() to check this.
9828 2004-03-29 Martin Baulig <martin@ximian.com>
9830 * convert.cs: Use TypeManager.IsDelegateType() instead of
9831 comparing types correctly.
9833 2004-03-29 Martin Baulig <martin@ximian.com>
9835 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
9836 types directly to make it work for generic instances.
9838 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
9840 2004-03-29 Martin Baulig <martin@ximian.com>
9842 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
9845 2004-03-24 Martin Baulig <martin@ximian.com>
9847 * decl.cs (DeclSpace.FindType): Also use
9848 TypeManager.CheckGeneric() for types from the using clauses.
9850 2004-03-23 Martin Baulig <martin@ximian.com>
9852 * expression.cs (Invocation.OverloadResolve): Added `bool
9853 may_fail' argument and use it instead of the Location.IsNull() hack.
9855 2004-03-23 Martin Baulig <martin@ximian.com>
9857 * expression.cs (Invocation.InferType): Use correct type inference
9860 2004-03-23 Martin Baulig <martin@ximian.com>
9862 * ecore.cs (MethodGroupExpr.Name): Use
9863 TypeManager.CSharpSignature() instead of just the name.
9865 * expression.cs (Invocation.OverloadResolve): Provide better error
9867 (Invocation.DoResolve): OverloadResolve() never returns null
9868 without reporting an error, so removed the error -6 reporting here.
9870 2004-03-23 Martin Baulig <martin@ximian.com>
9872 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
9875 * cs-parser.jay (delegate_declaration): Support generic delegates.
9877 * delegate.cs: Support generic delegates.
9879 2004-03-22 Martin Baulig <martin@ximian.com>
9881 * expression.cs (Invocation.InferParamsTypeArguments): New static
9882 method; does type inference for params arguments.
9884 2004-03-21 Martin Baulig <martin@ximian.com>
9886 * typemanager.cs (TypeManager.IsGenericMethod): New public static
9887 method; checks whether a method is a generic method.
9889 * expression.cs (Invocation.InferTypeArguments): New static method;
9890 infer type arguments for generic method invocation.
9892 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
9893 property; we set this to true if we're resolving a generic method
9894 invocation and the user specified type arguments, ie. we're not
9895 doing type inference.
9897 2004-03-20 Martin Baulig <martin@ximian.com>
9899 * class.cs (MethodData.DeclaringType): New public property.
9900 (MethodData.Define): Set DeclaringType here.
9901 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
9902 instead of OperatorMethodBuilder.DeclaringType.
9904 2004-03-20 Martin Baulig <martin@ximian.com>
9906 * cs-tokenizer.cs (xtoken): Return a special
9907 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
9909 * cs-parser.jay (default_value_expression): Switch to the new
9912 2004-03-19 Martin Baulig <martin@ximian.com>
9914 * decl.cs (MemberName): New class. We use this to "construct"
9915 namespace_or_type_name's.
9917 * generics.cs (TypeArguments.GetDeclarations): New public method;
9918 returns the type arguments as a string[] and reports a CS0081 if
9919 one of them is not an identifier.
9921 * class.cs (MemberBase): The .ctor now takes the name as a
9922 MemberName instead of a string.
9923 (MemberBase.ExplicitInterfaceName): Changed type from string to
9925 (MemberBase.DoDefine): If we're an explicit implementation, the
9926 InterfaceType may be a generic instance.
9928 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
9929 (namespace_name): Call MemberName.GetName () to transform the
9930 MemberName into a string and ensure we don't have any type
9932 (type_name): Call MemberName.GetTypeExpression() to transfrom the
9933 MemberName into an expression.
9934 (method_header): Use namespace_or_type_name instead of member_name.
9936 2004-04-07 Miguel de Icaza <miguel@ximian.com>
9938 * rootcontext.cs: Add new types to the boot resolution.
9940 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9941 MulticastDelegate is not allowed.
9943 * typemanager.cs: Add new types to lookup: System.TypedReference
9946 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9947 check for TypedReference or ArgIterator, they are not allowed.
9949 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9950 makes us properly catch 1510 in some conditions (see bug 56016 for
9953 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
9955 * CryptoConvert.cs: update from corlib version
9958 2004-04-05 Miguel de Icaza <miguel@ximian.com>
9960 * class.cs (Indexer.Define): Check indexername declaration
9962 2004-04-05 Marek Safar <marek.safar@seznam.cz>
9964 * attribute.cs (IsClsCompliant): Fixed problem with handling
9965 all three states (compliant, not-compliant, undetected).
9967 2004-03-30 Marek Safar <marek.safar@seznam.cz>
9969 * attribute.cs (Attribute): Location is now public.
9970 (Resolve): Store resolved arguments (pos_values) in attribute class.
9971 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9972 (GetClsCompliantAttributeValue): New method that gets
9973 CLSCompliantAttribute value.
9974 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9975 if exists else null.
9976 (AttributeTester): New class for CLS-Compliant verification routines.
9978 * class.cs (Emit): Add CLS-Compliant verification.
9979 (Method.GetSignatureForError): Implemented.
9980 (Constructor.GetSignatureForError): Implemented
9981 (Constructor.HasCompliantArgs): Returns if constructor has
9982 CLS-Compliant arguments.
9983 (Constructor.Emit): Override.
9984 (Construcor.IsIdentifierClsCompliant): New method; For constructors
9985 is needed to test only parameters.
9986 (FieldBase.GetSignatureForError): Implemented.
9987 (TypeContainer): New member for storing base interfaces.
9988 (TypeContainer.FindMembers): Search in base interfaces too.
9990 * codegen.cs (GetClsComplianceAttribute): New method that gets
9991 assembly or module CLSCompliantAttribute value.
9992 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9994 (ModuleClass.Emit): Add error 3012 test.
9996 * const.cs (Emit): Override and call base for CLS-Compliant tests.
9998 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9999 state for all decl types.
10000 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10001 if CLS-Compliant tests are required.
10002 (IsClsCompliaceRequired): New method. Analyze whether code
10003 must be CLS-Compliant.
10004 (IsExposedFromAssembly): New method. Returns true when MemberCore
10005 is exposed from assembly.
10006 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10007 value or gets cached value.
10008 (HasClsCompliantAttribute): New method. Returns true if MemberCore
10009 is explicitly marked with CLSCompliantAttribute.
10010 (IsIdentifierClsCompliant): New abstract method. This method is
10011 used to testing error 3005.
10012 (IsIdentifierAndParamClsCompliant): New method. Common helper method
10013 for identifier and parameters CLS-Compliant testing.
10014 (VerifyClsCompliance): New method. The main virtual method for
10015 CLS-Compliant verifications.
10016 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10017 null. I don't know why is null (too many public members !).
10018 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10019 and get value of first CLSCompliantAttribute that found.
10021 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10022 (VerifyClsCompliance): Override and add extra tests.
10024 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10025 clscheck- disable CLS-Compliant verification event if assembly is has
10026 CLSCompliantAttribute(true).
10028 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10029 ApllyAttribute is now called in emit section as in the other cases.
10030 Possible future Emit integration.
10031 (IsIdentifierClsCompliant): New override.
10032 (VerifyClsCompliance): New override.
10033 (GetEnumeratorName): Returns full enum name.
10035 * parameter.cs (GetSignatureForError): Implemented.
10037 * report.cs (WarningData): New struct for Warning message information.
10038 (LocationOfPreviousError): New method.
10039 (Warning): New method. Reports warning based on the warning table.
10040 (Error_T): New method. Reports error based on the error table.
10042 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10043 verifications are done here.
10045 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10047 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10048 CLSCompliantAttribute.
10049 (all_imported_types): New member holds all imported types from other
10051 (LoadAllImportedTypes): New method fills static table with exported types
10052 from all referenced assemblies.
10053 (Modules): New property returns all assembly modules.
10055 2004-03-30 Miguel de Icaza <miguel@ximian.com>
10057 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10058 throwing a parser error.
10060 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10061 which removes the hardcoded get_/set_ prefixes for properties, as
10062 IL allows for the properties to be named something else.
10066 * expression.cs: Do not override operand before we know if it is
10067 non-null. Fix 56207
10069 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10071 * typemanager.cs: support for pinned variables.
10073 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10075 * decl.cs, typemanager.cs: Avoid using an arraylist
10076 as a buffer if there is only one result set.
10078 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10080 * expression.cs: Make sure you cant call a static method
10081 with an instance expression, bug #56174.
10083 2004-03-29 Miguel de Icaza <miguel@ximian.com>
10085 * class.cs (IsDuplicateImplementation): Improve error reporting to
10086 flag 663 (method only differs in parameter modifier).
10088 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10089 in preprocessor directives.
10091 * location.cs (LookupFile): Allow for the empty path.
10093 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
10094 better approach for some of that patch, but its failing with the
10095 CharSet enumeration. For now try/catch will do.
10097 * typemanager.cs: Do not crash if a struct does not have fields.
10100 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10102 * expression.cs: cs0213, cant fix a fixed expression.
10105 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10107 * cs-parser.jay: detect invalid embeded statements gracefully.
10110 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10112 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10115 the invocation type may not be a subclass of the tye of the item/
10116 The type of the item must be a subclass of the invocation item.
10121 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
10123 * attribute.cs: Added methods to get a string and a bool from an
10124 attribute. Required to information from AssemblyKeyFileAttribute,
10125 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10126 * codegen.cs: Modified AssemblyName creation to include support for
10127 strongnames. Catch additional exceptions to report them as CS1548.
10128 * compiler.csproj: Updated include CryptoConvert.cs.
10129 * compiler.csproj.user: Removed file - user specific configuration.
10130 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
10131 Mono.Security assembly. The original class is maintained and tested in
10132 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10133 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10134 like CSC 8.0 (C# v2) supports.
10135 * Makefile: Added CryptoConvert.cs to mcs sources.
10136 * rootcontext.cs: Added new options for strongnames.
10138 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
10140 * driver.cs: For --expect-error, report error code `2'
10141 if the program compiled with no errors, error code `1' if
10142 it compiled with an error other than the one expected.
10144 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
10146 * compiler.csproj: Updated for Visual Studio .NET 2003.
10147 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10148 * compiler.sln: Updated for Visual Studio .NET 2003.
10150 2004-03-24 Ravi Pratap M <ravi@ximian.com>
10152 * expression.cs: Fix bug #47234. We basically need to apply the
10153 rule that we prefer the conversion of null to a reference type
10154 when faced with a conversion to 'object' (csc behaviour).
10156 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10158 * statement.cs: Shorter form for foreach, eliminates
10159 a local variable. r=Martin.
10161 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10163 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10164 checks if we can use brtrue/brfalse to test for 0.
10165 * expression.cs: use the above in the test for using brtrue/brfalse.
10166 cleanup code a bit.
10168 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10170 * expression.cs: Rewrite string concat stuff. Benefits:
10172 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10173 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10174 rather than a concat chain.
10176 * typemanager.cs: Add lookups for more concat overloads.
10178 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10180 * expression.cs: Emit shorter il code for array init.
10197 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
10199 * statement.cs: Before, two switch blocks would be merged if the
10200 total size of the blocks (end_item - begin_item + 1) was less than
10201 two times the combined sizes of the blocks.
10203 Now, it will only merge if after the merge at least half of the
10208 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
10210 * class.cs : csc build fix for GetMethods(). See bug #52503.
10212 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
10214 * expression.cs: Make sure fp comparisons work with NaN.
10215 This fixes bug #54303. Mig approved this patch a long
10216 time ago, but we were not able to test b/c the runtime
10219 2004-03-19 Miguel de Icaza <miguel@ximian.com>
10221 * ecore.cs (TypExpr.GetHashCode): implement this overload.
10223 2004-03-19 Martin Baulig <martin@ximian.com>
10225 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10226 two overloads may unify for some type parameter substitutions and
10227 report a CS0408 if appropriate.
10229 2004-03-19 Martin Baulig <martin@ximian.com>
10231 * class.cs (MemberCore.IsDuplicateImplementation): Report the
10232 error here and not in our caller.
10234 2004-03-19 Martin Baulig <martin@ximian.com>
10236 * interface.cs: Completely killed this file.
10237 (Interface): We're now a TypeContainer and live in class.cs.
10239 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10240 argument; we're now also called for interfaces.
10241 (TypeContainer.DefineMembers): Allow this method being called
10243 (TypeContainer.GetMethods): New public method; formerly known as
10244 Interface.GetMethod(). This is used by PendingImplementation.
10245 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10246 it's now private and non-static.
10247 (Interface): Moved this here; it's now implemented similar to
10249 (Method, Property, Event, Indexer): Added `bool is_interface'
10250 argument to their .ctor's.
10251 (MemberBase.IsInterface): New public field.
10253 * cs-parser.jay: Create normal Method, Property, Event, Indexer
10254 instances instead of InterfaceMethod, InterfaceProperty, etc.
10255 (opt_interface_base): Removed; we now use `opt_class_base' instead.
10256 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10258 2004-03-19 Martin Baulig <martin@ximian.com>
10260 * class.cs (MethodCore.IsDuplicateImplementation): New private
10261 method which does the CS0111 checking.
10262 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10263 Use IsDuplicateImplementation().
10265 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
10267 * decl.cs (FindMemberToOverride): New method to find the correct
10268 method or property to override in the base class.
10270 - Make Method/Property use the above method to find the
10271 version in the base class.
10272 - Remove the InheritableMemberSignatureCompare as it is now
10275 This patch makes large code bases much faster to compile, as it is
10276 O(n) rather than O(n^2) to do this validation.
10278 Also, it fixes bug 52458 which is that nested classes are not
10279 taken into account when finding the base class member.
10281 Reviewed/Approved by Martin.
10283 2004-03-17 Martin Baulig <martin@ximian.com>
10285 * expression.cs (MemberAccess.DoResolve): Take the parent's number
10286 of type arguments into account; use the `real_num_type_args'
10287 approach like in DoResolveAsTypeStep().
10289 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10292 2004-03-17 Marek Safar <marek.safar@seznam.cz>
10294 * interface.cs: In all interface classes removed redundant
10295 member initialization.
10297 2004-03-16 Martin Baulig <martin@ximian.com>
10299 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10301 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10303 * decl.cs (DefineTypeAndParents): New helper method to define a
10304 type's containers before the type itself is defined; This is a
10305 bug exposed by the recent changes to Windows.Forms when an
10306 implemented interface was defined inside a class that had not been
10309 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10311 (Check): Loop correctly to report errors modifiers
10312 (UNSAFE was not in the loop, since it was the same as TOP).
10314 * interface.cs: Every interface member now takes a ModFlags,
10315 instead of a "is_new" bool, which we set on the base MemberCore.
10317 Every place where we called "UnsafeOk" in the interface, now we
10318 call the proper member (InterfaceMethod.UnsafeOK) instead to get
10319 the unsafe settings from the member declaration instead of the
10320 container interface.
10322 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
10324 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10325 `set_indexer_name' to the pending bits (one per type).
10327 We fixed a bug today that was picking the wrong method to
10328 override, since for properties the existing InterfaceMethod code
10329 basically ignored the method name. Now we make sure that the
10330 method name is one of the valid indexer names.
10332 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
10334 * support.cs (SeekableStreamReader): Keep track of stream byte
10335 positions and don't mix them with character offsets to the buffer.
10337 Patch from Gustavo Giráldez
10339 2004-03-15 Marek Safar <marek.safar@seznam.cz>
10341 * interface.cs (InterfaceSetGetBase): Removed double member
10342 initialization, base class does it as well.
10344 2004-03-13 Martin Baulig <martin@ximian.com>
10346 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10347 when compiling corlib.
10349 2004-03-13 Miguel de Icaza <miguel@ximian.com>
10351 * convert.cs (ExplicitConversion): We were reporting an error on
10352 certain conversions (object_type source to a value type, when the
10353 expression was `null') before we had a chance to pass it through
10354 the user defined conversions.
10356 * driver.cs: Replace / and \ in resource specifications to dots.
10359 * class.cs: Add check for duplicate operators. Fixes 52477
10361 2004-03-11 Miguel de Icaza <miguel@ximian.com>
10363 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10364 that are in the middle of the statements, not only at the end.
10367 * class.cs (TypeContainer.AddField): No longer set the
10368 `HaveStaticConstructor' flag, now we call it
10369 `UserDefineStaticConstructor' to diferentiate the slightly
10370 semantic difference.
10372 The situation is that we were not adding BeforeFieldInit (from
10373 Modifiers.TypeAttr) to classes that could have it.
10374 BeforeFieldInit should be set to classes that have no static
10379 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10381 And most importantly Zoltan's comment:
10383 http://bugzilla.ximian.com/show_bug.cgi?id=44229
10385 "I think beforefieldinit means 'it's ok to initialize the type sometime
10386 before its static fields are used', i.e. initialization does not need
10387 to be triggered by the first access to the type. Setting this flag
10388 helps the JIT to compile better code, since it can run the static
10389 constructor at JIT time, and does not need to generate code to call it
10390 (possibly lots of times) at runtime. Unfortunately, mcs does not set
10391 this flag for lots of classes like String.
10393 csc sets this flag if the type does not have an explicit static
10394 constructor. The reasoning seems to be that if there are only static
10395 initalizers for a type, and no static constructor, then the programmer
10396 does not care when this initialization happens, so beforefieldinit
10399 This bug prevents the AOT compiler from being usable, since it
10400 generates so many calls to mono_runtime_class_init that the AOT code
10401 is much slower than the JITted code. The JITted code is faster,
10402 because it does not generate these calls if the vtable is type is
10403 already initialized, which is true in the majority of cases. But the
10404 AOT compiler can't do this."
10406 2004-03-10 Miguel de Icaza <miguel@ximian.com>
10408 * class.cs (MethodData.Emit): Refactor the code so symbolic
10409 information is generated for destructors; For some reasons we
10410 were taking a code path that did not generate symbolic information
10413 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
10415 * class.cs: Create a Constructor.CheckBase method that
10416 takes care of all validation type code. The method
10417 contains some code that was moved from Define.
10419 It also includes new code that checks for duplicate ctors.
10420 This fixes bug #55148.
10422 2004-03-09 Joshua Tauberer <tauberer@for.net>
10424 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10425 a { ... }-style array creation invokes EmitStaticInitializers
10426 which is not good for reference-type arrays. String, decimal
10427 and now null constants (NullCast) are not counted toward
10428 static initializers.
10430 2004-03-05 Martin Baulig <martin@ximian.com>
10432 * location.cs (SourceFile.HasLineDirective): New public field;
10433 specifies whether the file contains or is referenced by a "#line"
10435 (Location.DefineSymbolDocuments): Ignore source files which
10436 either contain or are referenced by a "#line" directive.
10438 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
10440 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10441 direct access to our parent, so check the method inline there.
10443 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
10445 * expression.cs (Invocation.EmitCall): Miguel's last commit
10446 caused a regression. If you had:
10451 In Foo the implict this would be null.
10453 2004-02-27 Miguel de Icaza <miguel@ximian.com>
10455 * expression.cs (Invocation.EmitCall): If the method is not
10456 virtual, do not emit a CallVirt to it, use Call.
10458 * typemanager.cs (GetFullNameSignature): Improve the method to
10459 cope with ".ctor" and replace it with the type name.
10461 * class.cs (ConstructorInitializer.Resolve): Now the method takes
10462 as an argument the ConstructorBuilder where it is being defined,
10463 to catch the recursive constructor invocations.
10465 2004-03-16 Martin Baulig <martin@ximian.com>
10467 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
10468 ConstructedType, call ResolveType() on it to get the type rather
10469 than just using `expr.Type'.
10471 2004-03-16 Martin Baulig <martin@ximian.com>
10473 * generics.cs (ConstructedType.GetMemberAccess): Take the
10474 EmitContext instead on the TypeExpr and use
10475 ec.TypeContainer.CurrentType/ec.ContainerType.
10477 2004-03-16 Martin Baulig <martin@ximian.com>
10479 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
10480 parameters before aliases.
10482 2004-03-16 Martin Baulig <martin@ximian.com>
10484 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
10485 New oublic function; checks whether two generic instances may become
10486 equal under some instantiations (26.3.1).
10488 * class.cs (TypeContainer.Define): Call
10489 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
10492 2004-03-16 Martin Baulig <martin@ximian.com>
10494 * class.cs (TypeContainer.GetClassBases): Moved
10495 Error_TypeParameterAsBase() here and also check whether the base
10496 class is not an attribute.
10498 2004-03-16 Martin Baulig <martin@ximian.com>
10500 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10502 2004-03-16 Martin Baulig <martin@ximian.com>
10504 * class.cs (Error_TypeParameterAsBase): Use correct error number
10507 2004-03-16 Martin Baulig <martin@ximian.com>
10509 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
10512 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
10515 2004-03-15 Martin Baulig <martin@ximian.com>
10517 * typemanager.cs (TypeManager.GetFullName): New public method.
10518 (TypeManager.MemberLookup): Added `int_num_type_arguments'
10519 argument; only return members with the correct number of type
10521 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
10522 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
10523 whether the number of type arguments matches.
10525 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
10526 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
10528 * expression.cs (MemberAccess): Added public `NumTypeArguments'
10529 field; it's set by the protected .ctor when we're actually a
10530 GenericMemberAccess.
10531 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
10532 arguments and pass it to MemberLookupFinal ().
10534 * ecore.cs (Expression.MemberLookup): Added `int
10535 num_type_arguments' argument; only return members with the correct
10536 number of type arguments.
10537 (Expression.MemberLookupFailed): Check whether the MemberLookup
10538 failed because we did not have the correct number of type
10539 arguments; report CS0305 in this case.
10541 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
10542 `e.ResolveAsTypeTerminal()' already did so.
10544 2004-03-15 Martin Baulig <martin@ximian.com>
10546 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
10547 we're a ConstructedType; in this case, the caller must report an
10548 error (for instance CS0131).
10550 * generic.cs (TypeArguments): Added Location argument to the .ctor.
10551 (TypeArguments.Resolve): Actually report errors here.
10553 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10555 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10556 `set_indexer_name' to the pending bits (one per type).
10558 We fixed a bug today that was picking the wrong method to
10559 override, since for properties the existing InterfaceMethod code
10560 basically ignored the method name. Now we make sure that the
10561 method name is one of the valid indexer names.
10563 2004-03-15 Martin Baulig <martin@ximian.com>
10565 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
10566 for generic instances.
10568 2004-03-13 Martin Baulig <martin@ximian.com>
10570 * class.cs (TypeContainer.DefineType): Call
10571 TypeManager.AddUserType() immediately after creating the
10572 TypeBuilder; pass all type parameters when creating the
10575 * decl.cs (DeclSpace.FindNestedType): New public method.
10576 (DeclSpace.FindType): Added `int num_type_args' argument; only
10577 return types with the correct number of type parameters.
10578 (DeclSpace.CountTypeParams): New public property.
10580 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
10581 the number of type parameters; defaults to zero.
10583 * generic.cs (TypeArguments.Count): New public property.
10584 (ConstructedType.DoResolveAsTypeStep): First call
10585 ds.FindNestedType() to find out whether we're nested in the
10586 current generic type; in this case, we inherit all type parameters
10587 from the current class.
10589 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
10590 num_type_args' argument.
10591 (RootContext.LookupType): Added overloaded version which takes the
10592 number of type arguments; only return types with the correct
10593 number of type arguments.
10595 * typemanager.cs (TypeManager.CheckGeneric): New public function;
10596 checks whether `Type t' has `int num_type_args'.
10598 2004-03-13 Martin Baulig <martin@ximian.com>
10600 * generic.cs (GenericMethod.DefineType): New method; calls
10601 DefineType() on all the type parameters.
10603 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
10604 (MethodData.Define): If we're a generic method, call
10605 GenericMethod.DefineType() to define the type parameters.
10607 2004-03-10 Martin Baulig <martin@ximian.com>
10609 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
10610 instead of IsAssignableFrom.
10612 2004-03-10 Martin Baulig <martin@ximian.com>
10614 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
10616 * support.cs (ParameterData.HasArrayParameter): New property.
10617 (ReflectionParameters.ctor): Take a MethodBase instead of a
10618 ParameterInfo[]. If we have any type parameters, get the generic
10619 method definition and ask it whether we have variable arguments.
10621 2004-02-26 Miguel de Icaza <miguel@ximian.com>
10623 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10624 routines to check if a type is an enumerable/enumerator allow
10625 classes that implement the IEnumerable or IEnumerator interfaces.
10627 * class.cs (Property, Operator): Implement IIteratorContainer, and
10628 implement SetYields.
10630 (Property.Define): Do the block swapping for get_methods in the
10631 context of iterators. We need to check if Properties also
10632 include indexers or not.
10634 (Operator): Assign the Block before invoking the
10635 OperatorMethod.Define, so we can trigger the Iterator code
10638 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
10639 Property and Operator classes are not created when we parse the
10640 declarator but until we have the block completed, so we use a
10641 singleton SimpleIteratorContainer.Simple to flag whether the
10642 SetYields has been invoked.
10644 We propagate this setting then to the Property or the Operator to
10645 allow the `yield' to function.
10647 2004-02-25 Marek Safar <marek.safar@seznam.cz>
10649 * codegen.cs: Implemented attribute support for modules.
10650 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10651 Assembly/Module functionality.
10653 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10654 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10655 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10657 2004-02-16 Marek Safar <marek.safar@seznam.cz>
10659 * interface.cs (FindMembers): The operation is performed on all base
10660 interfaces and not only on the first. It is required for future CLS Compliance patch.
10662 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
10664 * statement.cs, codegen.cs:
10665 This patch deals with patterns such as:
10667 public class List : IEnumerable {
10669 public MyEnumerator GetEnumerator () {
10670 return new MyEnumerator(this);
10673 IEnumerator IEnumerable.GetEnumerator () {
10677 public struct MyEnumerator : IEnumerator {
10682 Before, there were a few things we did wrong:
10683 1) we would emit callvirt on a struct, which is illegal
10684 2) we emited ldarg when we needed to emit ldarga
10685 3) we would mistakenly call the interface methods on an enumerator
10686 type that derived from IEnumerator and was in another assembly. For example:
10688 public class MyEnumerator : IEnumerator
10690 Would have the interface methods called, even if there were public impls of the
10691 method. In a struct, this lead to invalid IL code.
10693 2004-02-11 Marek Safar <marek.safar@seznam.cz>
10695 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10698 * delegate.cs (Define): Fixed crash when delegate type is undefined.
10700 2004-02-11 Miguel de Icaza <miguel@ximian.com>
10702 * cs-parser.jay: Fix small regression: we were not testing V2
10703 compiler features correctly.
10705 * interface.cs: If the emit context is null, then create one
10707 2004-02-09 Marek Safar <marek.safar@seznam.cz>
10709 * decl.cs (GetSignatureForError): New virtual method to get full name
10710 for error messages.
10712 * attribute.cs (IAttributeSupport): New interface for attribute setting.
10713 Now it is possible to rewrite ApplyAttributes method to be less if/else.
10715 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10716 Duplicated members and code in these classes has been removed.
10717 Better encapsulation in these classes.
10719 2004-02-07 Miguel de Icaza <miguel@ximian.com>
10721 * assign.cs (Assign.DoResolve): When dealing with compound
10722 assignments, there is a new rule in ECMA C# 2.4 (might have been
10723 there before, but it is documented here) that states that in:
10727 If b is of type int, and the `op' is a shift-operator, then the
10728 above is evaluated as:
10732 * expression.cs (Binary.ResolveOperator): Instead of testing for
10733 int/uint/long/ulong, try to implicitly convert to any of those
10734 types and use that in pointer arithmetic.
10736 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10737 method to print information for from the type, not from the
10738 null-method we were given.
10740 2004-02-01 Duncan Mak <duncan@ximian.com>
10742 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10743 parsing for cmd, fixes bug #53694.
10745 2004-02-04 Marek Safar <marek.safar@seznam.cz>
10747 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10748 in the member name duplication tests. Property and operator name duplication
10749 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10751 2004-02-03 Marek Safar <marek.safar@seznam.cz>
10753 * interface.cs (PopulateMethod): Fixed crash when interface method
10754 returns not existing type (error test cs0246-3.cs).
10756 2004-02-02 Ravi Pratap M <ravi@ximian.com>
10758 * cs-parser.jay (interface_accessors): Re-write actions to also
10759 store attributes attached to get and set methods. Fix spelling
10762 (inteface_property_declaration): Modify accordingly.
10764 (InterfaceAccessorInfo): New helper class to store information to pass
10765 around between rules that use interface_accessors.
10767 * interface.cs (Emit): Apply attributes on the get and set
10768 accessors of properties and indexers too.
10770 * attribute.cs (ApplyAttributes): Modify accordingly to use the
10771 right MethodBuilder when applying attributes to the get and set accessors.
10773 2004-01-31 Miguel de Icaza <miguel@ximian.com>
10775 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10777 2004-01-26 Miguel de Icaza <miguel@ximian.com>
10779 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10781 2004-01-25 Miguel de Icaza <miguel@ximian.com>
10783 * cs-parser.jay: Remove YIELD token, instead use the new grammar
10784 changes that treat `yield' specially when present before `break'
10785 or `return' tokens.
10787 * cs-tokenizer.cs: yield is no longer a keyword.
10789 2004-01-23 Marek Safar <marek.safar@seznam.cz>
10791 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10792 setting for default constructors.
10793 For default constructors are almost every time set wrong Modifier. The
10794 generated IL code has been alright. But inside mcs this values was
10795 wrong and this was reason why several of my CLS Compliance tests
10798 2004-02-27 Martin Baulig <martin@ximian.com>
10800 * generics.cs (ConstructedType.ResolveType): Make the nested type
10801 stuff actually work.
10803 2004-02-25 Martin Baulig <martin@ximian.com>
10805 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
10806 property; returns the type parameters just from the current type,
10807 ie. with the ones from outer classes.
10808 (DeclSpace.LookupGeneric): First search in the current class, then
10810 (DeclSpace.initialize_type_params): When hiding a type parameter
10811 from an outer class, put it into the `type_param_list' anyways.
10813 * expression.cs (MemberAccess.expr): Made this field protected.
10815 * class.cs (TypeContainer.Define): The `CurrentType' just contains
10816 the type parameters from the current class.
10818 * generic.cs (ConstructedType.ResolveType): Support nested generic
10819 types by taking the type parameters which we inherit from outer
10820 classes into account.
10821 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
10822 support for nested generic types.
10824 2004-02-23 Martin Baulig <martin@ximian.com>
10826 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
10827 field and check whether we're nested inside a generic type.
10828 (DeclSpace.ResolveType): If we're resolving to a generic type
10829 definition, create a ConstructedType and return its resolved type.
10830 (DeclSpace.initialize_type_params): New private method;
10831 initializes the `type_param_list' field from the type parameters
10832 from this and all enclosing classes.
10833 (DeclSpace.TypeParameters): Call initialize_type_params() unless
10834 we're already initialized.
10836 2004-02-23 Martin Baulig <martin@ximian.com>
10838 * class.cs (Method.Define): Create the generic method before
10839 calling DoDefine().
10840 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
10841 the TypeContainer one); we use this for generic methods.
10843 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
10844 parent's TypeBuilder.
10846 2004-02-18 Martin Baulig <martin@ximian.com>
10848 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
10849 to check for equality.
10851 2004-02-05 Martin Baulig <martin@ximian.com>
10853 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
10854 `ec.TypeContainer.CurrentType', use it instead of
10855 `ec.ContainerType' to check whether we're in the type's ctor.
10857 2004-01-29 Martin Baulig <martin@ximian.com>
10859 * expression.cs (Invocation.DoResolve): If we're a
10860 `ConstructedType', then we're actually a generic method, so
10861 rewrite the expr as a GenericMemberAccess.
10863 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
10864 here; manually parse it into a string.
10866 2004-01-28 Martin Baulig <martin@ximian.com>
10868 * typemanager.cs (TypeManager.IsEqual): New static method.
10869 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
10870 check for equality instead of using `=='.
10872 2004-01-26 Martin Baulig <martin@ximian.com>
10874 * decl.cs (DeclSpace.CurrentType): New public field.
10876 * expression.cs (This.ResolveBase): If we have an
10877 `ec.TypeContainer.CurrentType', use it instead of
10878 `ec.ContainerType'.
10880 * class.cs (TypeContainer.DefineType): If we're a generic type,
10881 create the `CurrentType' (unresolved).
10882 (TypeContainer.GenericType): New private field.
10883 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
10884 it and store it in `GenericType' before creating the MemberCache.
10885 (TypeContainer.GetMembers): If we have a `GenericType', call
10886 TypeManager.FindMembers() on it.
10888 * interface.cs (Interface.GenericType): New private field.
10889 (Interface.DefineType): If we're a generic type, create the
10890 `CurrentType' (unresolved).
10891 (Interface.DefineMembers): If we have a `CurrentType', resolve it
10892 and store it in `GenericType' before creating the MemberCache.
10893 (Interface.GetMembers): If we have a `GenericType', call
10894 TypeManager.FindMembers() on it.
10896 2004-01-22 Martin Baulig <martin@ximian.com>
10898 * cs-parser.jay (namespace_or_type_name): Return an Expression,
10899 not a QualifiedIdentifier. This is what `type_name_expression'
10900 was previously doing.
10901 (type_name_expression): Removed; the code is now in
10902 `namespace_or_type_name'.
10903 (qualified_identifier): Removed, use `namespace_or_type_name'
10905 (QualifiedIdentifier): Removed this class.
10907 2004-01-22 Martin Baulig <martin@ximian.com>
10909 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10910 not a string as alias name.
10912 2004-01-21 Miguel de Icaza <miguel@ximian.com>
10914 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10915 #52730 bug, and instead compute correctly the need to use a
10916 temporary variable when requesting an address based on the
10917 static/instace modified of the field and the constructor.
10919 2004-01-21 Martin Baulig <martin@ximian.com>
10921 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10922 class and namespace before looking up aliases. Fixes #52517.
10924 2004-01-21 Martin Baulig <martin@ximian.com>
10926 * flowanalysis.cs (UsageVector.Merge): Allow variables being
10927 assinged in a 'try'; fixes exception4.cs.
10929 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10930 * class.cs : Implemented parameter-less constructor for TypeContainer
10932 * decl.cs: Attributes are now stored here. New property OptAttributes
10934 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10936 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10938 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10940 * typemanager.cs (CSharpSignature): Now reports also inner class name.
10941 (CSharpSignature): New method for indexer and property signature.
10943 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10945 * pending.cs (IsVirtualFilter): Faster implementation.
10947 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10949 * typemanager.cs: Avoid inclusion of same assembly more than once.
10951 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10953 * cs-parser.jay: Fixed problem where the last assembly attribute
10954 has been applied also to following declaration (class, struct, etc.)
10956 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10958 * class.cs: Added error CS0538, CS0539 reporting.
10959 Fixed crash on Microsoft runtime when field type is void.
10961 * cs-parser.jay: Added error CS0537 reporting.
10963 * pending.cs: Added error CS0535 reporting.
10964 Improved error report for errors CS0536, CS0534.
10966 2004-01-20 Miguel de Icaza <miguel@ximian.com>
10968 Merge a few bits from the Anonymous Method MCS tree.
10970 * statement.cs (ToplevelBlock): New class for toplevel methods,
10971 will hold anonymous methods, lifted variables.
10973 * cs-parser.jay: Create toplevel blocks for delegates and for
10974 regular blocks of code.
10976 2004-01-20 Martin Baulig <martin@ximian.com>
10978 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10979 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10980 and `NeedExplicitReturn'; added `IsLastStatement'.
10981 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10982 have a `ReturnLabel' or we're not unreachable.
10984 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10985 child's reachability; don't just override ours with it. Fixes
10986 #58058 (lluis's example).
10987 (FlowBranching): Added public InTryOrCatch(), InCatch(),
10988 InFinally(), InLoop(), InSwitch() and
10989 BreakCrossesTryCatchBoundary() methods.
10991 * statement.cs (Return): Do all error checking in Resolve().
10992 Unless we are the last statement in a top-level block, always
10993 create a return label and jump to it.
10994 (Break, Continue): Do all error checking in Resolve(); also make
10995 sure we aren't leaving a `finally'.
10996 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10997 statement in a top-level block.
10998 (Block.Flags): Added `IsDestructor'.
10999 (Block.IsDestructor): New public property.
11001 2004-01-20 Martin Baulig <martin@ximian.com>
11003 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11005 2004-01-20 Martin Baulig <martin@ximian.com>
11007 * statement.cs (Statement.ResolveUnreachable): New public method.
11008 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11009 (Block.Resolve): Resolve unreachable statements.
11011 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11013 * expression.cs: We need to fix the case where we do
11014 not have a temp variable here.
11016 * assign.cs: Only expression compound assignments need
11017 temporary variables.
11019 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11021 * flowanalysis.cs: Reduce memory allocation in a few ways:
11022 - A block with no variables should not allocate a bit
11024 - A method with no out parameters does not need any tracking
11025 for assignment of the parameters, so we need not allocate
11028 public readonly Type[] VariableTypes;
11029 public readonly string[] VariableNames;
11030 Are redundant. The data is already stored in the variable
11031 map, so we need not allocate another array for it.
11032 - We need to add alot of checks for if (params | locals) == null
11033 due to the first two changes.
11035 2004-01-18 Miguel de Icaza <miguel@ximian.com>
11037 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11038 implement IMemoryLocation, we store a copy on a local variable and
11039 take the address of it. Patch from Benjamin Jemlich
11041 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11042 to use a special "type_name_expression" rule which reduces the
11043 number of "QualifiedIdentifier" classes created, and instead
11044 directly creates MemberAccess expressions.
11046 2004-01-17 Miguel de Icaza <miguel@ximian.com>
11048 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11049 that fixes #52853. Null literal assignment to ValueType
11051 * class.cs (MethodData.Emit): Instead of checking the name of the
11052 method to determine if its a destructor, create a new derived
11053 class from Method called Destructor, and test for that.
11055 * cs-parser.jay: Create a Destructor object instead of a Method.
11057 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11061 2004-01-16 Miguel de Icaza <miguel@ximian.com>
11063 * expression.cs (Binary.ResolveOperator): Perform an implicit
11064 conversion from MethodGroups to their delegate types on the
11065 Addition operation.
11067 * delegate.cs: Introduce a new class DelegateCreation that is the
11068 base class for `NewDelegate' and `ImplicitDelegateCreation',
11069 factor some code in here.
11071 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11072 conversion from MethodGroups to compatible delegate types.
11074 * ecore.cs (Expression.Resolve): Do not flag error 654
11075 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11076 we allow conversions from MethodGroups to delegate types now.
11078 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11079 assignments in v2 either.
11081 2004-01-10 Miguel de Icaza <miguel@ximian.com>
11083 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11084 static read-only fields in ctors.
11086 Applied patch from Benjamin Jemlich
11088 * expression.cs (UnaryMutator): Avoid leaking local variables.
11090 2004-01-09 Miguel de Icaza <miguel@ximian.com>
11092 * cs-tokenizer.cs (IsCastToken): Allow the various native types
11093 here to return true, as they can be used like this:
11095 (XXX) int.MEMBER ()
11097 Fixed 49836 and all the other dups
11099 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
11101 * driver.cs: Implement /win32res and /win32icon.
11103 2004-01-08 Miguel de Icaza <miguel@ximian.com>
11105 * cs-parser.jay: Add a rule to improve error handling for the
11106 common mistake of placing modifiers after the type.
11108 2004-01-07 Miguel de Icaza <miguel@ximian.com>
11110 * cs-parser.jay (interface_event_declaration): Catch
11111 initialization of events on interfaces, and report cs0068
11113 * cs-parser.jay (interface_event_declaration): Catch
11114 initialization of events.
11116 * ecore.cs: Better report missing constructors.
11118 * expression.cs (Binary.ResolveOperator): My previous bug fix had
11119 the error reporting done in the wrong place. Fix.
11121 * expression.cs (Binary.ResolveOperator): Catch the
11122 operator + (E x, E y) error earlier, and later allow for implicit
11123 conversions in operator +/- (E e, U x) from U to the underlying
11126 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11127 52596, if the container class is abstract, the default constructor
11128 is protected otherwise its public (before, we were always public).
11130 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11133 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11134 Jemlich that fixes bug #52597, MCS was generating invalid code for
11135 idisposable structs. Thanks to Ben for following up with this
11138 2004-01-06 Miguel de Icaza <miguel@ximian.com>
11140 * driver.cs: Allow assemblies without code to be generated, fixes
11143 2004-01-07 Nick Drochak <ndrochak@gol.com>
11145 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11147 2004-01-05 Miguel de Icaza <miguel@ximian.com>
11149 * cs-parser.jay: Add rules to improve error reporting if fields or
11150 methods are declared at the namespace level (error 116)
11152 * Add rules to catch event add/remove
11154 2004-01-04 David Sheldon <dave-mono@earth.li>
11156 * expression.cs: Added matching ")" to error message for
11159 2004-01-03 Todd Berman <tberman@gentoo.org>
11161 * ecore.cs, attribute.cs:
11162 Applying fix from #52429.
11164 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11166 * ecore.cs, expression.cs, statement.cs:
11167 Total rewrite of how we handle branching. We
11168 now handle complex boolean expressions with fewer
11169 jumps. As well if (x == 0) no longer emits a ceq.
11171 if (x is Foo) is much faster now, because we generate
11174 Overall, we get a pretty big improvement on our benchmark
11175 tests. The code we generate is smaller and more readable.
11177 I did a full two-stage bootstrap. The patch was reviewed
11178 by Martin and Miguel.
11180 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11182 * cs-parser.jay: Make primary_expression not take a QI.
11183 we dont need this because the member_access rule covers
11184 us here. So we replace the rule with just IDENTIFIER.
11186 This has two good effects. First, we remove a s/r conflict.
11187 Second, we allocate many fewer QualifiedIdentifier objects.
11189 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11191 * attribute.cs: Handle MarshalAs attributes as pseudo, and
11192 set the correct information via SRE. This prevents
11193 hanging on the MS runtime. Fixes #29374.
11195 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11197 * convert.cs: correctly handle conversions to value types
11198 from Enum and ValueType as unboxing conversions.
11200 Fixes bug #52569. Patch by Benjamin Jemlich.
11202 2004-01-02 Ravi Pratap <ravi@ximian.com>
11204 * expression.cs (BetterConversion): Prefer int -> uint
11205 over int -> ulong (csc's behaviour). This fixed bug #52046.
11207 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
11209 * decl.cs (MemberCache.FindMembers): now returns a
11212 * typemanager.cs: In general, go with with ^^.
11213 (CopyNewMethods): take an IList.
11214 (RealMemberLookup): Only allocate an arraylist
11215 if we copy from two sets of methods.
11217 This change basically does two things:
11218 1) Fewer array lists allocated due to CopyNewMethods.
11219 2) the explicit cast in MemberList costed ALOT.
11221 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
11223 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11224 a hashtable to avoid needless string allocations when an identifier is
11225 used more than once (the common case).
11227 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11229 * pending.cs: MS's TypeBuilder.GetInterfaces ()
11230 is broken, it will not return anything. So, we
11231 have to use the information we have in mcs to
11234 * typemanager.cs: Add a cache for GetInterfaces,
11235 since this will now be used more often (due to ^^)
11237 (GetExplicitInterfaces) New method that gets the
11238 declared, not effective, interfaces on a type
11239 builder (eg, if you have interface IFoo, interface
11240 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11243 This patch makes MCS able to bootstrap itself on
11246 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11248 * expression.cs: Remove the Nop's that Miguel put
11251 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11253 * report.cs, codegen.cs: Give the real stack trace to
11254 the error when an exception is thrown.
11256 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11258 * decl.cs: only allocate hashtables for ifaces if
11261 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11263 * expression.cs: fix the error from cs0121-2.cs
11264 (a parent interface has two child interfaces that
11265 have a function with the same name and 0 params
11266 and the function is called through the parent).
11268 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
11270 * class.cs, rootcontext.cs, typmanager.cs: do not
11273 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
11275 * codegen.cs: remove stack for the ec flow branching.
11276 It is already a linked list, so no need.
11278 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
11280 * Makefile: Allow custom profiler here.
11282 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11284 * typemanager.cs (LookupType):
11285 - Use a static char [], because split takes
11286 a param array for args, so it was allocating
11288 - Do not store true in a hashtable, it boxes.
11290 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11292 * flowanalysis.cs: bytify common enums.
11294 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11296 * modifiers.cs: Add a new set of flags for the
11297 flags allowed on explicit interface impls.
11298 * cs-parser.jay: catch the use of modifiers in
11299 interfaces correctly.
11300 * class.cs: catch private void IFoo.Blah ().
11302 All related to bug #50572.
11304 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11306 * decl.cs: Rewrite the consistant accessability checking.
11307 Accessability is not linear, it must be implemented in
11308 a tableish way. Fixes #49704.
11310 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11312 * expression.cs: Handle negation in a checked context.
11313 We must use subtraction from zero. Fixes #38674.
11315 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11317 * class.cs: Ignore static void main in DLLs.
11318 * rootcontext.cs: Handle the target type here,
11319 since we are have to access it from class.cs
11320 * driver.cs: account for the above.
11322 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11324 * report.cs: Give line numbers and files if available.
11326 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
11328 * driver.cs: Implement /addmodule.
11330 * typemanager.cs: Change 'modules' field so it now contains Modules not
11333 2003-12-20 Martin Baulig <martin@ximian.com>
11335 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11336 (FieldBase.IsAssigned): Removed this field.
11337 (FieldBase.SetAssigned): New public method.
11338 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11340 2003-12-20 Martin Baulig <martin@ximian.com>
11342 * expression.cs (LocalVariableReference.DoResolve): Don't set
11343 `vi.Used' if we're called from DoResolveLValue().
11345 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11346 returns the usage vector it just merged into the current one -
11347 pass this one to UsageWarning().
11348 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11349 of the `EmitContext', don't call this recursively on our children.
11351 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
11353 * driver.cs: Implement /target:module.
11355 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
11357 * support.cs (CharArrayHashtable): New helper class.
11359 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
11360 char arrays, not strings, so we can avoid creating a string in
11361 consume_identifier if the identifier is a keyword.
11363 2003-12-16 Martin Baulig <martin@ximian.com>
11365 * statement.cs (LocalInfo.Assigned): Removed this property.
11366 (LocalInfo.Flags): Removed `Assigned'.
11367 (LocalInfo.IsAssigned): New public method; takes the EmitContext
11368 and uses flow analysis.
11369 (Block.UsageWarning): Made this method private.
11370 (Block.Resolve): Call UsageWarning() if appropriate.
11372 * expression.cs (LocalVariableReference.DoResolve): Always set
11373 LocalInfo.Used here.
11375 2003-12-13 Martin Baulig <martin@ximian.com>
11377 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11378 any value here; we're now using flow analysis to figure out
11379 whether a statement/block returns a value.
11381 2003-12-13 Martin Baulig <martin@ximian.com>
11383 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11385 (FlowBranching.MergeFinally): Don't call
11386 `branching.CheckOutParameters()' here, this is called in
11388 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11389 when adding the `finally' vector.
11391 2003-12-13 Martin Baulig <martin@ximian.com>
11394 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11395 actually work and also fix #48962.
11397 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
11399 * decl.cs: Do not check System.Object for nested types,
11400 since we know it does not have any. Big bang for buck:
11403 Run 1: 8.35 seconds
11404 Run 2: 8.32 seconds
11405 corlib: 17.99 seconds
11407 Run 1: 8.17 seconds
11408 Run 2: 8.17 seconds
11409 corlib: 17.39 seconds
11411 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
11413 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11414 time we are returning 0 members, so we save alot here.
11416 2003-12-11 Martin Baulig <martin@ximian.com>
11418 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11419 `MergeChild()', also just take the `FlowBranching' as argument;
11420 call Merge() on it and return the result.
11421 (FlowBranching.Merge): We don't need to do anything if we just
11424 2003-12-11 Martin Baulig <martin@ximian.com>
11426 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11427 them in an `ArrayList' to reduce memory usage. Thanks to Ben
11428 Maurer for this idea.
11430 2003-12-11 Martin Baulig <martin@ximian.com>
11432 * flowanalysis.cs (MergeResult): This class is now gone; we now
11433 use the `UsageVector' for this. The reason for this is that if a
11434 branching just has one sibling, we don't need to "merge" them at
11435 all - that's the next step to do.
11436 (FlowBranching.Merge): We now return a `UsageVector' instead of a
11439 2003-12-11 Martin Baulig <martin@ximian.com>
11441 Reworked flow analyis and made it more precise and bug-free. The
11442 most important change is that we're now using a special `Reachability'
11443 class instead of having "magic" meanings of `FlowReturns'. I'll
11444 do some more cleanups and optimizations and also add some more
11445 documentation this week.
11447 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11448 largely reworked this class.
11449 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11450 the new `Reachability' class instead of having "magic" values here.
11451 (FlowBranching): We're now using an instance of `Reachability'
11452 instead of having separate `Returns', `Breaks' etc. fields.
11454 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11455 based on flow analysis; ignore the return value of block.Emit ().
11457 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
11459 * driver.cs typemanager.cs: Find the mono extensions to corlib even
11460 if they are private.
11462 2003-12-09 Martin Baulig <martin@ximian.com>
11464 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11465 call them directly on the UsageVector.
11467 2003-12-09 Martin Baulig <martin@ximian.com>
11469 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11470 Changed return type from `FlowReturns' to `Reachability'.
11472 2003-12-09 Martin Baulig <martin@ximian.com>
11474 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11475 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11476 `Reachable' fields with a single `Reachability' one.
11478 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11480 * class.cs (FindMembers): Remove foreach's.
11485 Run 1: 8.74 seconds
11486 Run 2: 8.71 seconds
11489 Run 1: 8.64 seconds
11490 Run 2: 8.58 seconds
11493 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11498 This patch does a few things:
11499 1. EmptyStatement is now a singleton, so it is never reallocated.
11500 2. All blah is EmptyStatement constructs have been changed to
11501 blah == EmptyStatement.Value, which is much faster and valid
11502 now that EmptyStatement is a singleton.
11503 3. When resolving a block, rather than allocating a new array for
11504 the non-empty statements, empty statements are replaced with
11505 EmptyStatement.Value
11506 4. Some recursive functions have been made non-recursive.
11507 Mainly the performance impact is from (3), however (1) and (2) are needed for
11508 this to work. (4) does not make a big difference in normal situations, however
11509 it makes the profile look saner.
11514 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11515 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11516 Total memory allocated: 56397 KB
11519 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11520 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11521 Total memory allocated: 55666 KB
11523 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11525 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11526 than the hashtable in a hashtable version
11528 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11529 we always end up concating a string. This results in a huge perf
11530 loss, because many strings have to be tracked by the GC. In this
11531 patch, we first use a hashtable that works with two keys, so that
11532 the strings do not need to be concat'ed.
11536 Run 1: 8.74 seconds
11537 Run 2: 8.71 seconds
11540 Run 1: 8.65 seconds
11541 Run 2: 8.56 seconds
11543 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11545 * Makefile: Add a new target `do-time' that does a quick and simple
11546 profile, leaving easy to parse output.
11548 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
11550 * codegen.cs (Init): Create the dynamic assembly with
11551 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11553 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
11555 * support.cs: Make the PtrHashtable use only one
11556 instance of its comparer.
11558 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
11560 * typemanager.cs: Fix lookup of GetNamespaces.
11562 2003-11-29 Miguel de Icaza <miguel@ximian.com>
11564 * expression.cs: Removed redundant line.
11566 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11567 ArrayLists, use for loops with bounds.
11569 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11572 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11573 arraylists, use for loop with bounds.
11575 The above three changes give us a 0.071 second performance
11576 improvement out of 3.294 seconds down to 3.223. On my machine
11577 the above changes reduced the memory usage by 1,387 KB during
11578 compiler bootstrap.
11580 * cs-parser.jay (QualifiedIdentifier): New class used to represent
11581 QualifiedIdentifiers. Before we created a new string through
11582 concatenation, and mostly later on, the result would be
11583 manipulated by DecomposeQI through string manipulation.
11585 This reduced the compiler memory usage for bootstrapping from
11586 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11587 compile times in 0.05 seconds.
11589 2003-11-28 Dick Porter <dick@ximian.com>
11591 * support.cs: Do string compares with the Invariant culture.
11599 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11600 the comparison is done with the Invariant culture.
11602 2003-11-27 Miguel de Icaza <miguel@ximian.com>
11604 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11605 GetEnumerator method.
11607 (ProbeCollectionType): Iterate starting at the most specific type
11608 upwards looking for a GetEnumerator
11610 * expression.cs: Shift count can be up to 31 for int/uint and 63
11613 2003-11-26 Miguel de Icaza <miguel@ximian.com>
11615 * statement.cs (Block.LookupLabel): Also look for the label on the
11616 children blocks. Use a hash table to keep track of visited
11619 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11620 we actually did transform the other operand, otherwise fall back
11621 to the common codepath that casts to long.
11623 * cs-tokenizer.cs: Use the same code pattern as the int case.
11624 Maybe I should do the parsing myself, and avoid depending on the
11625 Parse routines to get this done.
11627 2003-11-25 Miguel de Icaza <miguel@ximian.com>
11629 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11630 which fixes bug 51347. This time test it.
11632 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11633 attributes for example can not tell the difference between these.
11634 The difference was only a syntax feature of the language.
11636 * attribute.cs: Apply attributes to delegates.
11638 * delegate.cs: Call the apply attributes method.
11640 2003-11-24 Miguel de Icaza <miguel@ximian.com>
11642 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11643 comparing 0 vs Byte.MinValue, not the value
11645 (ImplicitConversionRequired): When reporting a conversion error,
11646 use error 31 to print out the constant error instead of the
11649 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11650 which fixes bug 51347.
11652 2003-11-22 Miguel de Icaza <miguel@ximian.com>
11654 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
11655 which fixes the -warnaserror command line option.
11657 2003-11-21 Miguel de Icaza <miguel@ximian.com>
11659 * cfold.cs (DoNumericPromotions): During constant folding of
11660 additions on UIntConstant, special case intconstants with
11661 IntConstants like we do on the expression binary operator.
11663 2003-11-12 Miguel de Icaza <miguel@ximian.com>
11665 * convert.cs (ImplicitReferenceConversion): We were missing a case
11666 (System.Enum are not value types or class types, so we need to
11667 classify them separatedly).
11669 * driver.cs: We do not support error 2007.
11671 2003-11-12 Jackson Harper <jackson@ximian.com>
11673 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11674 system directory. Also use the full file name so users can
11675 libraries names mscorlib-o-tron.dll in a non system dir.
11677 2004-01-04 David Sheldon <dave-mono@earth.li>
11679 * expression.cs: Added matching ")" to error message for CS0077.
11681 2003-12-19 Martin Baulig <martin@ximian.com>
11683 * typemanager.cs (TypeManager.IsEqualGenericType): New public
11684 static method; see documentation in the method.
11685 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
11687 * convert.cs (Convert.ImplicitReferenceConversion,
11688 Convert.ImplicitReferenceConversionExists): Add support for
11689 generic type declarations; see gen-36.cs.
11691 2003-12-19 Martin Baulig <martin@ximian.com>
11693 * pending.cs (Pending.InterfaceMethod): Use
11694 `Type.IsAssignableFrom()' instead of `=='.
11696 2003-12-18 Martin Baulig <martin@ximian.com>
11698 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
11701 * convert.cs (Convert.ImplicitStandardConversionExists): Use
11702 `expr_type.Equals (target_type)' instead of `=='.
11704 2003-12-08 Martin Baulig <martin@ximian.com>
11706 * generics.cs (Constraints.Types): Removed.
11707 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
11709 (Constraints.ResolveTypes): New public method; resolves the
11710 TypeExpr's to Type's.
11711 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
11712 longer takes the constraints.
11713 (TypeParameter.DefineMethod): Likewise.
11714 (TypeParameter.DefineType): New public method. Calls
11715 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
11718 2003-12-08 Martin Baulig <martin@ximian.com>
11720 * convert.cs (Convert.ImplicitConversionStandard): Use
11721 `expr_type.Equals (target_type)' instead of `=='.
11723 2003-12-08 Martin Baulig <martin@ximian.com>
11725 * typemanager.cs (TypeManager.GetReferenceType): Call
11726 `Type.MakeByRefType ()'.
11728 2003-12-08 Martin Baulig <martin@ximian.com>
11730 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
11731 just has some special meaning in some situations. For instance,
11732 it is allowed to use `where' as the name of a variable etc.
11734 2003-12-04 Martin Baulig <martin@ximian.com>
11736 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
11737 `Type.MakeArrayType()' for array types.
11739 2003-11-18 Miguel de Icaza <miguel@ximian.com>
11741 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
11744 (SizeOf.DoResolve): assign the `type_queried' field. This gets
11747 2003-11-16 Martin Baulig <martin@ximian.com>
11749 * codegen.cs (EmitContext.IsGeneric): Removed.
11751 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
11752 ResolveGeneric() on the DeclSpace.
11754 2003-11-16 Martin Baulig <martin@ximian.com>
11756 * generic.cs (TypeArguments.Resolve):
11757 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
11758 `ResolveType()' on it to get the Type.
11760 2003-11-15 Martin Baulig <martin@ximian.com>
11762 * generic.cs (ConstructedType.GetInterfaces): Override this.
11764 2003-11-14 Martin Baulig <martin@ximian.com>
11766 * interface.cs (Interface.DefineType): Define all type parameters
11767 before adding the interfaces we inherit.
11769 2003-11-11 Martin Baulig <martin@ximian.com>
11771 * generic.cs (ConstructedType.ResolveType): Always call
11772 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
11774 2003-11-10 Martin Baulig <martin@ximian.com>
11776 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11777 (TypeManager.InitCoreTypes): Initialize them here, but instead of
11778 calling `ResolveType()' on them, directly assign their `Type'.
11780 2003-11-08 Martin Baulig <martin@ximian.com>
11782 * generic.cs (ConstructedType): Override `IsClass' etc.
11784 2003-11-08 Martin Baulig <martin@ximian.com>
11786 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11787 return value and the `out parent' parameter.
11788 (TypeContainer.DefineType): Moved the CS0644 check into
11789 GetClassBases(). Don't pass the interface types to the
11790 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11791 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11793 * ecore.cs (TypeExpr.IsAttribute): New property.
11794 (TypeExpr.GetInterfaces): New method.
11796 * interface.cs (Interface.GetInterfaceTypeByName): Return a
11797 TypeExpr instead of a Type.
11798 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11799 (Interface.DefineType): Don't pass the interface types to the
11800 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11801 them later and then call `TypeBulider.AddInterfaceImplementation()'.
11803 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11804 instead of a `Type[]'.
11805 (TypeManager.RegisterBuilder): Likewise.
11806 (TypeManager.AddUserInterface): Likewise.
11807 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11808 `Type[]' and also return a `TypeExpr[]'.
11809 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11811 2003-11-08 Martin Baulig <martin@ximian.com>
11813 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11816 2003-11-08 Martin Baulig <martin@ximian.com>
11818 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11819 TypeManager.ResolveExpressionTypes().
11821 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11822 instead of an Expression.
11823 (TypeExpr): This is now an abstract base class for `TypeExpression'.
11824 (TypeExpression): New public class; formerly known as `TypeExpr'.
11826 * expression.cs (ComposedCast): Derive from TypeExpr.
11828 * typemanager.cs (TypeManager.system_*_expr): These are now
11829 TypExpr's instead of Expression's.
11830 (TypeManager.ResolveExpressionTypes): New public static function;
11831 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11834 2003-11-06 Miguel de Icaza <miguel@ximian.com>
11836 * expression.cs (New.DoResolve): Do not dereference value that
11837 might be a null return.
11839 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11840 sure that the constant value has the right type. Fixes an
11841 unreported bug, similar to 50425.
11843 * const.cs (Const.LookupConstantValue): Call
11844 ImplicitStandardConversionExists before doing a conversion to
11845 avoid havng the TypeManager.ChangeType do conversions.
11847 Reduced the number of casts used
11849 (Const.ChangeType): New routine to enable reuse of the constant
11850 type changing code from statement.
11852 * typemanager.cs (ChangeType): Move common initialization to
11853 static global variables.
11857 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11858 every value type to go through, even if it was void. Fix that.
11860 * cs-tokenizer.cs: Use is_identifier_start_character on the start
11861 character of the define, and the is_identifier_part_character for
11862 the rest of the string.
11864 2003-11-05 Miguel de Icaza <miguel@ximian.com>
11866 * expression.cs (UnaryMutator.EmitCode): When I updated
11867 LocalVariableReference.DoResolve, I overdid it, and dropped an
11868 optimization done on local variable references.
11870 2003-11-04 Miguel de Icaza <miguel@ximian.com>
11872 * ecore.cs: Convert the return from Ldlen into an int.
11874 2003-10-20 Miguel de Icaza <miguel@ximian.com>
11876 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11877 the accessibility, this is a special case for toplevel non-public
11878 classes (internal for instance).
11880 2003-10-20 Nick Drochak <ndrochak@gol.com>
11882 * ecore.cs: Fix typo and build. Needed another right paren.
11884 2003-10-19 Miguel de Icaza <miguel@ximian.com>
11886 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
11887 `internal' case regular and protected, but not allowing protected
11888 to be evaluated later. Bug 49840
11890 2003-10-15 Miguel de Icaza <miguel@ximian.com>
11892 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11893 to kb.Nlast, and not the kb.nFirst to isolate the switch
11896 Extract the underlying type, so enumerations of long/ulong are
11897 treated like long/ulong.
11899 2003-10-14 Miguel de Icaza <miguel@ximian.com>
11901 * expression.cs (New): Overload the meaning of RequestedType to
11902 track the possible creation of the NewDelegate type, since
11903 DoResolve is invoked more than once for new constructors on field
11906 See bugs: #48800 and #37014
11908 * cs-parser.jay (declare_local_constants): Take an arraylist
11909 instead of a single constant.
11911 (local_constant_declaration): It should take a
11912 constant_declarators, not a constant_declarator. Fixes 49487
11914 * convert.cs: Fix error report.
11916 2003-10-13 Jackson Harper <jackson@ximian.com>
11918 * typemanager.cs (TypeToCoreType): Add float and double this fixes
11921 2003-11-03 Martin Baulig <martin@ximian.com>
11923 * expression.cs (ArrayAccess.GetStoreOpcode): Added
11924 `out bool has_type_arg'; if set, we need to pass the type to
11926 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
11927 Stelem_Any/Ldelem_Any for generic parameters.
11929 2003-11-02 Martin Baulig <martin@ximian.com>
11931 * expression.cs (Invocation.EmitCall): Use
11932 `TypeManager.IsValueType()' to check whether it's a value type.
11933 Don't set `struct_call' when calling a method on a type parameter.
11935 2003-11-02 Martin Baulig <martin@ximian.com>
11937 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
11938 and removed the TypeBuilder argument.
11940 * typemanager.cs (TypeManager.IsValueType): Return
11941 `t.IsGenericParameter || t.IsValueType'.
11943 2003-10-25 Martin Baulig <martin@ximian.com>
11945 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
11946 call ConstructedType.Resolve() on it.
11948 * generic.cs (ConstructedType.Resolve): Set `type' on success.
11950 2003-10-25 Martin Baulig <martin@ximian.com>
11952 * class.cs (TypeContainer.GetClassBases): Changed
11953 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
11954 CS8214 reporting here.
11955 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
11956 instead of a `Type' for our parent. In case of a recursive
11957 declaration (see tests/gen-23.cs for an example), our parent is a
11958 ConstructedType and it doesn't have its type set. So, first
11959 create our own TypeBuilder, then call constructed.Resolve() to get
11960 the parent's type and finally TypeBuilder.SetParent() it.
11962 * ecore.cs (TypeExpr.Name): New public virtual property.
11965 (ConstructedType): We're now a TypeExpr and not just an Expression.
11966 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
11967 arguments here; this is done later.
11968 (ConstructedType.Resolve): New public method to resolve the type
11969 arguments and bind them.
11971 2003-10-21 Martin Baulig <martin@ximian.com>
11973 * convert.cs: Use `TypeManager.IsValueType' instead of
11974 'type.IsValueType' everywhere.
11976 * typemanager.cs (TypeManager.IsValueType): Return true for type
11977 parameters. The reason for this is that we need to box a type
11978 parameter when converting it to a reference type.
11980 * cs-parser.jay: Added support for default value expressions.
11982 * generics.cs (DefaultValueExpression): New public class.
11984 2003-10-17 Martin Baulig <martin@ximian.com>
11986 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
11987 TypeContainer so we can also use this for Interfaces.
11988 (TypeParameter.Resolve): Likewise.
11990 * interface.cs (Interface.DefineType): Added support for generic
11993 * cs-parser.jay: Added support for generic structs and interfaces.
11995 2003-10-17 Martin Baulig <martin@ximian.com>
11997 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
11998 call generic methods :-)
12000 2003-10-16 Martin Baulig <martin@ximian.com>
12002 * cs-parser.jay (namespace_or_type_name): Only create a
12003 GenericMemberAccess if we actually have type arguments.
12005 2003-10-13 Martin Baulig <martin@ximian.com>
12007 * class.cs (Method.Define): If we're a generic method, call
12008 TypeBuilder.DefineGenericMethod () before resolving
12010 (MethodData): Added .ctor which takes an additional MethodBuilder
12011 argument; this is used for generic methods.
12012 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12013 we already have a MethodBuilder.
12015 2003-10-10 Martin Baulig <martin@ximian.com>
12017 * class.cs (Method): Added .ctor which takes a `GenericMethod'
12018 instead of a `DeclSpace'. This is used for generic methods.
12020 * cs-parser.jay (method_header): Added support for generic
12021 methods; create a `GenericMethod' instance and pass it to the
12022 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12023 parameters and locals.
12025 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12026 since we already have the location. Check whether we're a generic
12027 type declaration or a generic method and create the correct type
12030 * generic.cs (TypeParameter.DefineMethod): New public method.
12031 (GenericMethod): New public class; derives from DeclSpace and is
12032 used for generic methods.
12034 2003-10-09 Martin Baulig <martin@ximian.com>
12036 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12038 (MethodCore.DoDefineParameters): Removed the TypeContainer
12039 argument; use the DeclSpace which was passed to the .ctor instead.
12040 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12041 TypeContainer; we only need a DeclSpace here.
12043 2003-10-09 Martin Baulig <martin@ximian.com>
12045 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12047 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12048 EmitContext's .ctor.
12050 2003-10-09 Martin Baulig <martin@ximian.com>
12052 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12053 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12054 AsAccessible(), moved them as well.
12056 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12058 2003-10-07 Miguel de Icaza <miguel@ximian.com>
12060 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12061 generation for >=, as spotted by Paolo, bug 48679.
12062 Patch from David Waite.
12064 * cs-tokenizer.cs: Add handling for #pragma.
12066 * cs-parser.jay: Allow for both yield and yield return in the
12067 syntax. The anti-cobolization of C# fight will go on!
12069 * class.cs (TypeBuilder.DefineType): Catch error condition here
12070 (Parent.DefineType erroring out and returning null).
12072 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12073 coping with enumerations variables, we were mistakenly processing
12074 them as a regular value type instead of built-in types. Fixes the
12077 * typemanager.cs (IsBuiltinOrEnum): New method.
12079 2003-09-30 Miguel de Icaza <miguel@ximian.com>
12081 * cs-parser.jay: Upgrade: yield now needs the return clause.
12083 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12085 * cs-parser.jay : Renamed yyName to yyNames related to jay.
12087 2003-09-29 Martin Baulig <martin@ximian.com>
12089 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12090 inflated generic methods.
12092 * generics.cs (ConstructedType): Distinguish between open and
12093 closed constructed types; correctly resolve the arguments.
12095 2003-09-22 Martin Baulig <martin@ximian.com>
12097 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12098 all type arguments meet their constraints.
12100 2003-09-19 Martin Baulig <martin@ximian.com>
12102 * decl.cs (MemberCache.SetupCacheForInterface): Take a
12103 `MemberCache parent' argument. Normally, an interface doesn't
12104 have a parent type except System.Object, but we use this in gmcs
12105 for generic type parameters.
12107 2003-09-18 Martin Baulig <martin@ximian.com>
12109 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12110 on `type.IsInterface'; don't check whether the type has a parent
12111 to determine whether it's an interface.
12113 2003-09-17 Martin Baulig <martin@ximian.com>
12115 * generic.cs (ConstructedType.ToString): Always use `name' as the
12118 2003-09-15 Martin Baulig <martin@ximian.com>
12120 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12122 * generic.cs (Constraints.Resolve): New public method; this is
12123 called to resolve the constraint types and to check whether all
12124 the constraints are correct.
12125 (Constraints.Types): New public property.
12126 (TypeParameter.Resolve): New public method; resolves all the
12127 type's constraints.
12129 * class.cs (TypeContainer.DefineType): Call
12130 TypeParameter.Resolve() before actually defining the type.
12132 2003-09-15 Martin Baulig <martin@ximian.com>
12134 * class.cs (TypeContainer.DefineType): Added an error flag to
12135 avoid reporting duplicate CS0146's ("class definition is
12138 * driver.cs (Driver.MainDriver): Abort if
12139 RootContext.ResolveTree() reported any errors.
12141 2003-09-07 Martin Baulig <martin@ximian.com>
12143 * report.cs (Error, Warning): Added overloaded versions which take
12144 a `params object[] args' and call String.Format().
12146 2003-09-07 Martin Baulig <martin@ximian.com>
12148 * decl.cs (DeclSpace..ctor): Don't call
12149 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12150 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
12151 (DeclSpace.RecordDecl): New method.
12153 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12155 2003-09-02 Ravi Pratap <ravi@ximian.com>
12157 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12158 value attributes to be applied to ParameterBuilders.
12160 * class.cs (MethodCore.LabelParameters): Make static and more
12161 generic so that it can be used from other places - like interface
12162 methods, for instance.
12164 * interface.cs (Interface.Emit): Call LabelParameters before
12165 emitting attributes on the InterfaceMethod.
12167 2003-09-07 Martin Baulig <martin@ximian.com>
12169 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12170 if the number of type parameters doesn't match.
12172 2003-09-04 Martin Baulig <martin@ximian.com>
12174 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12175 for arrays of generic type params (ie. `!0[]').
12177 2003-09-04 Martin Baulig <martin@ximian.com>
12179 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12182 2003-09-04 Martin Baulig <martin@ximian.com>
12184 * decl.cs (DeclSpace.LookupGeneric): New method.
12185 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12188 * generic.cs (TypeParameterExpr): Take a TypeParameter as
12189 argument, not just a string.
12190 (TypeParameter.Define): New public method; this is called to
12191 actually define the generic parameter; after this, you can use the
12192 new `Type' property to get the type.
12194 2003-09-04 Martin Baulig <martin@ximian.com>
12196 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12197 is now an ArrayList; initialize the result of the `TypeParameters'
12199 (DeclSpace.GetGenericData): Removed.
12200 (DeclSpace.LookupGeneric): Temporarily removed; we need to
12201 implement this in a different way.
12202 (DeclSpace.GetTypeParameters): Removed; there's now a
12203 `TypeParameters' property.
12204 (DeclSpace.TypeParameters): New public property.
12206 * generic.cs (Constraints): Make this class public.
12207 (TypeParameter): New public class.
12209 2003-09-04 Martin Baulig <martin@ximian.com>
12211 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12212 generic parameters.
12214 * class.cs (TypeContainer.DefineType): Call
12215 TypeBuilder.DefineGenericParameter () on all generic parameters if
12216 this is a generic type.
12218 2003-08-28 Martin Baulig <martin@ximian.com>
12220 * sample-stack.il: Compile this with ilasm: "ilasm /dll
12223 * sample-hello.cs: Compile this with gmcs: "gmcs
12224 /r:sample-stack.dll sample-hello.cs".
12226 2003-08-28 Martin Baulig <martin@ximian.com>
12228 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12229 the parameters to the generic type.
12231 2003-08-28 Martin Baulig <martin@ximian.com>
12233 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12235 2003-08-28 Martin Baulig <martin@ximian.com>
12237 * cs-parser.jay (opt_type_argument_list): Use
12238 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12239 (primary_expression): Replace `qualified_identifier' with `type_name'.
12240 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12242 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12243 parser to check whether it is syntactically a type parameter list;
12244 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12247 2003-08-26 Martin Baulig <martin@ximian.com>
12249 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12250 resolving aliases; fixes #47927.
12252 2003-08-26 Martin Baulig <martin@ximian.com>
12254 * statement.cs (Using.DoResolve): This is internally emitting a
12255 try/finally clause, so we need to set ec.NeedExplicitReturn if we
12256 do not always return. Fixes #47681.
12258 2003-08-26 Martin Baulig <martin@ximian.com>
12260 * decl.cs (MemberCore): Moved WarningNotHiding(),
12261 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12263 (AdditionResult): Make this nested in DeclSpace.
12264 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12265 argument; call NamespaceEntry.Define() unless we're nested in a
12268 * namespace.cs (Namespace.DefineName): New public function. This
12269 is called from DeclSpace's .ctor to add
12270 (Namespace.Lookup): Include DeclSpaces in the lookup.
12272 * class.cs (Operator): Derive from MemberBase, not MemberCore.
12274 * const.cs (Const): Derive from MemberBase, not MemberCore.
12276 2003-08-25 Martin Baulig <martin@ximian.com>
12278 * convert.cs (Convert.ExplicitReferenceConversion): When
12279 converting from an interface type to a class, unbox if the target
12280 type is a struct type. Fixes #47822.
12282 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12284 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12287 2003-08-22 Martin Baulig <martin@ximian.com>
12289 * class.cs (TypeManager.DefineType): When defining a nested type,
12290 call DefineType() on our parent; fixes #47801.
12292 2003-08-22 Martin Baulig <martin@ximian.com>
12294 * class.cs (MethodData.Define): While checking if a method is an
12295 interface implementation, improve the test a bit more to fix #47654.
12297 2003-08-22 Martin Baulig <martin@ximian.com>
12299 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12300 correctly; fixes #47722.
12302 2003-08-22 Martin Baulig <martin@ximian.com>
12304 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12305 LocalVariableReference, ensure it's not read-only. Fixes #47536.
12307 * statement.cs (Fixed.DoResolve): Make all variables read-only.
12309 2003-08-22 Martin Baulig <martin@ximian.com>
12311 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12312 can only be assigned in static constructors. Fixes #47161.
12314 2003-08-22 Martin Baulig <martin@ximian.com>
12316 Rewrote and improved the flow analysis code.
12318 * flowbranching.cs (FlowBranching): Make this class abstract.
12319 (FlowBranching.CreateBranching): New static function to create a
12320 new flow branching.
12321 (FlowBranchingBlock, FlowBranchingException): New classes.
12322 (FlowBranching.UsageVector.Type): New public readonly field.
12323 (FlowBranching.UsageVector.Breaks): Removed the setter.
12324 (FlowBranching.UsageVector.Returns): Removed the setter.
12325 (FlowBranching.UsageVector): Added Break(), Return(),
12326 NeverReachable() and Throw() methods to modify the reachability.
12327 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12328 done by FlowBranching.Merge().
12329 (FlowBranching.UsageVector.MergeChild): New method; merges the
12330 merge result into the current vector.
12331 (FlowBranching.Merge): New abstract method to merge a branching.
12333 2003-08-12 Martin Baulig <martin@ximian.com>
12335 * expression.cs (Indirection.CacheTemporaries): Create the
12336 LocalTemporary with the pointer type, not its element type.
12338 2003-08-10 Miguel de Icaza <miguel@ximian.com>
12340 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12341 token was a keyword or not.
12343 Add `error' options where an IDENTIFIER was expected; Provide
12344 CheckToken and CheckIdentifierToken convenience error reporting
12347 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12349 * decl.cs: Rename `NamespaceEntry Namespace' public field into
12350 NameSpaceEntry NameSpaceEntry.
12352 (LookupInterfaceOrClass): Avoid creating a full qualified name
12353 from namespace and name: avoid doing lookups when we know the
12354 namespace is non-existant. Use new Tree.LookupByNamespace which
12355 looks up DeclSpaces based on their namespace, name pair.
12357 * driver.cs: Provide a new `parser verbose' to display the
12358 exception thrown during parsing. This is turned off by default
12359 now, so the output of a failure from mcs is more graceful.
12361 * namespace.cs: Track all the namespaces defined in a hashtable
12364 (IsNamespace): New method
12366 2003-08-09 Miguel de Icaza <miguel@ximian.com>
12368 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
12369 we know that we need to concatenate (full typename can never be
12374 * statement.cs: Use a bitfield; Do not initialize to null things
12375 which are done by the constructor by default.
12377 * cs-parser.jay: bug fix, parameter was 4, not 3.
12379 * expression.cs: Just use the property;
12381 * statement.cs: No need for GetVariableInfo method.
12383 2003-08-08 Martin Baulig <martin@ximian.com>
12385 * flowanalysis.cs (FlowReturns): This is now nested in the
12386 `FlowBranching' class.
12387 (MyBitVector): Moved this here from statement.cs.
12388 (FlowBranching.SiblingType): New enum type.
12389 (FlowBranching.CreateSibling): Added `SiblingType' argument.
12391 2003-08-07 Martin Baulig <martin@ximian.com>
12393 * flowanalysis.cs (FlowBranchingType): This is now nested in the
12394 `FlowBranching' class and called `BranchingType'.
12396 2003-08-07 Martin Baulig <martin@ximian.com>
12398 * flowanalysis.cs: Moved all the control flow analysis code into
12401 2003-08-07 Martin Baulig <martin@ximian.com>
12403 * assign.cs (Assign.DoResolve): `target' must either be an
12404 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
12407 2003-08-07 Miguel de Icaza <miguel@ximian.com>
12409 * expression.cs (BinaryMethod): This kind of expression is created by the
12410 Binary class if it determines that the operator has to be handled
12413 (BinaryDelegate): This kind of expression is created if we are
12414 dealing with a + or - operator on delegates.
12416 (Binary): remove method, argumetns, and DelegateOperator: when
12417 dealing with methods,
12419 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12421 * statement.cs (Block): use bitfields for the three extra booleans
12422 we had in use. Remove unused topblock parameter.
12424 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12426 * assign.cs: Drop extra unneeded tests.
12428 2003-08-06 Miguel de Icaza <miguel@ximian.com>
12430 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12432 * statement.cs (Foreach): Use VariableStorage instead of
12435 * codegen.cs (VariableStorage): New class used by clients that
12436 require a variable stored: locals or fields for variables that
12437 need to live across yield.
12439 Maybe provide a convenience api for EmitThis+EmitLoad?
12441 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12444 2003-08-05 Miguel de Icaza <miguel@ximian.com>
12446 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12447 RemapParameterLValue): New methods that are used to turn a
12448 precomputed FieldInfo into an expression like this:
12452 The idea is to use this instead of making LocalVariableReference
12453 have more than one meaning.
12455 * cs-parser.jay: Add error production to BASE.
12457 * ecore.cs: Deal with TypeManager.GetField returning null, which
12458 is now a valid return value.
12460 (FieldExprNoAddress): New expression for Fields whose address can
12463 * expression.cs (LocalVariableReference): During the resolve
12464 phases, create new expressions if we are in a remapping context.
12465 Remove code that dealt with remapping here.
12467 (ParameterReference): same.
12469 (ProxyInstance): New expression, like the `This' expression, but
12470 it is born fully resolved. We know what we are doing, so remove
12471 the errors that are targeted to user-provided uses of `this'.
12473 * statement.cs (Foreach): our variable is now stored as an
12474 Expression; During resolution, follow the protocol, dont just
12475 assume it will return this.
12477 2003-08-06 Martin Baulig <martin@ximian.com>
12479 * support.cs (SeekableStreamReader.cs): New public class.
12481 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12482 SeekableStreamReader instead of the normal StreamReader.
12484 2003-08-04 Martin Baulig <martin@ximian.com>
12486 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12487 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12488 deambiguate casts and delegate invocations.
12489 (parenthesized_expression): Use the new tokens to ensure this is
12490 not a cast of method invocation.
12492 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12493 when reading a `)' and Deambiguate_CloseParens () was previously
12496 * expression.cs (ParenthesizedExpression): New class. This is
12497 just used for the CS0075 test.
12498 (Binary.DoResolve): Check for CS0075.
12500 2003-07-29 Ravi Pratap <ravi@ximian.com>
12502 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12503 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12504 reference comparison.
12506 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12507 examine the ReturnType for equality - this is necessary in the
12508 cases of implicit and explicit operators whose signature also
12509 includes the return type.
12511 2003-07-26 Miguel de Icaza <miguel@ximian.com>
12513 * namespace.cs: Cache the result of the namespace computation,
12514 instead of computing it every time.
12516 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12518 * decl.cs: Use a global arraylist that we reuse over invocations
12519 to avoid excesive memory consumption. Reduces memory usage on an
12520 mcs compile by one meg (45 average).
12522 * typemanager.cs (LookupTypeReflection): In .NET pointers are
12523 private, work around that.
12525 2003-07-23 Miguel de Icaza <miguel@ximian.com>
12527 * literal.cs (IntLiteral): Define Zero and One static literals.
12529 * cs-parser.jay (integer_literal): use static literals to reduce
12530 memory usage for the most used literals (0, 1 and -1). 211kb
12531 reduced in memory usage.
12533 Replace all calls to `new ArrayList' with `new
12534 ArrayList(4)' which is a good average number for most allocations,
12535 and also requires only 16 bytes of memory for its buffer by
12538 This reduced MCS memory usage in seven megabytes for the RSS after
12541 2003-07-28 Ravi Pratap <ravi@ximian.com>
12543 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12544 handle params methods the correct way by forming only one
12545 applicable set with params and normal methods in them. Earlier we
12546 were looking at params methods only if we found no normal methods
12547 which was not the correct thing to do.
12549 (Invocation.BetterFunction): Take separate arguments indicating
12550 when candidate and the best method are params methods in their
12553 This fixes bugs #43367 and #46199.
12555 * attribute.cs: Documentation updates.
12557 (CheckAttribute): Rename to CheckAttributeTarget.
12558 (GetValidPlaces): Rename to GetValidTargets.
12560 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12561 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12565 2003-07-28 Miguel de Icaza <miguel@ximian.com>
12567 * codegen.cs: Compute IsGeneric correctly.
12569 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
12572 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
12573 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
12574 regressions, and I was chasing more bugs than I required.
12576 * interface.cs: Use expressions for base type names (like classes
12577 and structs have been doing for a while now), and resolve that.
12578 This patch should probably go into head as well.
12580 This makes it one less user of FindType.
12582 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12584 This compiler can not self host currently. Need to fix that.
12586 * Makefile: compile to `gmcs.exe'
12588 * driver.cs: Turn on v2 by default on gmcs.
12590 * generic.cs (ConstructedType): Does no longer take a container
12591 type argument; That will be taken care of later.
12593 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
12594 Use SimpleName to resolve for now, so we can continue the work on
12595 the parser, until we get Type.GetType that understands generics.
12597 (ConstructedType.ToString): Implement
12599 (TypeArguments.Resolve): Resolve the child expressions as types.
12601 * cs-parser.jay: Rename interface_constraints to
12602 type_parameter_constraints
12604 (namespace_or_type_name): Only use constructed types for the basic
12605 construction, we will deal with identifier<...> later.
12607 (type/type_name): No longer call DecomposeQI, as
12608 namespace_or_type_name is always decoded now.
12610 2003-07-22 Ravi Pratap <ravi@ximian.com>
12612 * expression.cs (Invocation.OverloadResolve): Follow the spec more
12613 closely: we eliminate methods in base types when we have an
12614 applicable method in a top-level type.
12616 Please see section 14.5.5.1 for an exact description of what goes
12619 This fixes bug #45127 and a host of other related to corlib compilation.
12621 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12622 array is the method corresponding to the top-level type (this is
12623 because of the changes made to icall.c) so we change this
12626 (MethodGroupExpr.Name): This too.
12628 * typemanager.cs (GetElementType): New method which does the right
12629 thing when compiling corlib.
12631 * everywhere: Make use of the above in the relevant places.
12633 2003-07-22 Martin Baulig <martin@ximian.com>
12635 * cs-parser.jay (invocation_expression): Moved
12636 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12637 `cast_expression', but create a InvocationOrCast which later
12638 resolves to either an Invocation or a Cast.
12640 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12641 method; call this before EmitStatement() to make sure that this
12642 expression can be used as a statement.
12644 * expression.cs (InvocationOrCast): New class; resolves to either
12645 an Invocation or a Cast.
12647 * statement.cs (StatementExpression): Call ResolveStatement() on
12648 the ExpressionStatement before emitting it.
12650 2003-07-21 Martin Baulig <martin@ximian.com>
12652 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12653 `ref' and `out' attributes match; fixes #46220.
12654 (MemberAccess.ResolveMemberAccess): You can't reference a type
12655 through an expression; fixes #33180.
12656 (Indexers.GetIndexersForType): Don't return the indexers from
12657 interfaces the class implements; fixes #46502.
12659 2003-07-21 Martin Baulig <martin@ximian.com>
12661 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12662 CS0661 checks; fixes bug #30442.
12664 2003-07-21 Martin Baulig <martin@ximian.com>
12666 * decl.cs (AdditionResult): Added `Error'.
12668 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12670 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
12671 cs0031.cs actually work.
12673 2003-07-20 Miguel de Icaza <miguel@ximian.com>
12675 * cs-parser.jay (namespace_name): do not use
12676 namespace_or_type_name, use qualified_identifier, because
12677 namespace_or_type_name will soon return a composed expression
12678 instead of a string.
12680 (namespace_or_type_name): Instead of returning a string, now this
12681 production returns an expression.
12683 * codegen.cs (EmitContext): Setup IsGeneric property based on
12684 whether our DeclSpace is generic, our the method is generic.
12686 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
12687 the method is generic.
12689 * cs-parser.jay (type_arguments, opt_type_argument_list,
12690 type_parameters, type_parameter_list, opt_type_parameter_list,
12691 type_parameter,, opt_type_parameter_constraints_clauses,
12692 type_parameter_constraints_clauses,
12693 type_parameter_constraint_clause, type_parameter_constraint,
12694 interface_constraints): Add new production
12696 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
12697 DeclSpace is generic or not.
12699 (DeclSpace.SetParameterInfo): New routine, used to set the
12700 parameter info for a type.
12702 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
12703 returns a GenericTypeExpr
12705 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
12706 generic, lookup the generic argument.
12708 * attribute.cs: Do not allow TypeParameterExpressions in
12711 * class.cs: Do not allow the Main method to be defined in a
12714 * expression.cs (SizeOf): Do not allow generic types to be used as
12715 arguments to sizeof.
12717 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
12718 it: whether a type is generic or not. Only works for types we are
12719 currently building for now.
12721 2003-07-20 Martin Baulig <martin@ximian.com>
12723 * namespace.cs: Fixed that bug which caused a crash when compiling
12724 the debugger's GUI.
12726 2003-07-20 Miguel de Icaza <miguel@ximian.com>
12728 * typemanager.cs (LookupTypeReflection): Never expose types which
12729 are NotPublic, NestedPrivate, NestedAssembly, or
12730 NestedFamANDAssem. We used to return these, and later do a check
12731 that would report a meaningful error, but the problem is that we
12732 would not get the real match, if there was a name override.
12734 2003-07-18 Miguel de Icaza <miguel@ximian.com>
12736 * namespace.cs (Namespace, Name): Do not compute the namespace
12737 name dynamically, compute it in the constructor. This reduced
12738 memory usage by 1697 KB.
12740 * driver.cs: Use --pause to pause at the end.
12742 2003-07-17 Peter Williams <peter@newton.cx>
12744 * Makefile: Change the name of the test target so that it doesn't
12745 conflict with the recursive test target.
12747 2003-07-17 Miguel de Icaza <miguel@ximian.com>
12749 * expression.cs (LocalVariableReference.Emit, EmitAssign,
12750 AddressOf): Do not use EmitThis, that was wrong, use the actual
12753 2003-07-15 Miguel de Icaza <miguel@ximian.com>
12755 * class.cs (MethodData.Define): While checking if a method is an
12756 interface implementation, improve the test: If we are not public
12757 (use new test here: use the computed MethodAttributes directly,
12758 instead of the parsed modifier flags) check if the `implementing'
12759 method comes from an interface or not.
12761 * pending.cs (VerifyPendingMethods): Slightly better error
12764 * makefile: add test target that does the mcs bootstrap.
12766 2003-07-16 Ravi Pratap <ravi@ximian.com>
12768 * interface.cs (Define): Do nothing here since there are no
12769 members to populate etc. Move the attribute emission out of here
12770 since this was just totally the wrong place to put it. Attribute
12771 application happens during the 'Emit' phase, not in the 'Define'
12774 (Emit): Add this method and move the attribute emission here
12776 * rootcontext.cs (EmitCode): Call the Emit method on interface
12779 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12781 * expression.cs (OverloadResolve): Report error only if Location
12782 is not 'Null' which means that there was a probe going on.
12784 2003-07-14 Martin Baulig <martin@ximian.com>
12786 * expression.cs (ConditionalLogicalOperator): New public class to
12787 implement user defined conditional logical operators.
12788 This is section 14.11.2 in the spec and bug #40505.
12790 2003-07-14 Martin Baulig <martin@ximian.com>
12792 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12794 2003-07-14 Martin Baulig <martin@ximian.com>
12796 * codegen.cs (EmitContext.InFixedInitializer): New public field.
12798 * ecore.cs (IVariable.VerifyFixed): New interface method.
12800 * expression.cs (Unary.ResolveOperator): When resolving the `&'
12801 operator, check whether the variable is actually fixed. Fixes bug
12802 #36055. Set a variable definitely assigned when taking its
12803 address as required by the spec.
12805 * statement.cs (LocalInfo.IsFixed): New field.
12806 (LocalInfo.MakePinned): Set `IsFixed' to true.
12808 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12810 * attribute.cs (Attribute.Resolve): While doing a Member lookup
12811 for .ctors, ensure that we only ask for members declared in the
12812 attribute type (BindingFlags.DeclaredOnly).
12816 * expression.cs (Error_WrongNumArguments): Report error 1501
12817 correctly the way CSC does.
12819 2003-07-13 Martin Baulig <martin@ximian.com>
12821 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12822 lookup on the fully qualified name, to make things like "X.X" work
12823 where "X.X" is a fully qualified type name, but we also have a
12824 namespace "X" in the using list. Fixes #41975.
12826 2003-07-13 Martin Baulig <martin@ximian.com>
12828 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12829 function. If we're a CompoundAssign, we need to create an embedded
12830 CompoundAssign, not an embedded Assign.
12831 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12834 2003-07-13 Martin Baulig <martin@ximian.com>
12836 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12837 work to fix bug #46088.
12839 2003-07-13 Ravi Pratap <ravi@ximian.com>
12841 * class.cs (Operator.Emit): Do not emit attributes here - it is
12842 taken care of by the Method class that we delegate too. This takes
12843 care of bug #45876.
12845 2003-07-10 Martin Baulig <martin@ximian.com>
12847 * expression.cs (TypeOfVoid): New class.
12848 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
12850 2003-07-10 Martin Baulig <martin@ximian.com>
12852 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12855 2003-07-10 Martin Baulig <martin@ximian.com>
12857 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12858 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12860 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12862 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12864 2003-07-10 Martin Baulig <martin@ximian.com>
12866 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12867 of decimal. Fixes #42850.
12869 NOTE: I also fixed the created byte blob, but this doesn't work on
12870 the MS runtime and csc never produces any byte blobs for decimal
12873 2003-07-10 Martin Baulig <martin@ximian.com>
12875 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12876 structs; fixes #32068.
12877 (Block.AddChildVariableNames): Fixed #44302.
12879 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12881 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12883 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12885 * attribute.cs: And this test is onger needed.
12887 2003-07-08 Martin Baulig <martin@ximian.com>
12889 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12890 inaccessible types. Fixes #36313.
12892 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12894 * namespace.cs (NamespaceEntry): Create implicit entries for all
12895 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12896 implicit entries for N1.N2 and N1.
12898 2003-07-08 Martin Baulig <martin@ximian.com>
12900 Rewrote the handling of namespaces to fix a lot of the issues
12901 wrt. `using' aliases etc.
12903 * namespace.cs (Namespace): Splitted this class into a
12904 per-assembly `Namespace' and a per-file `NamespaceEntry'.
12906 * typemanager.cs (TypeManager.IsNamespace): Removed.
12907 (TypeManager.ComputeNamespaces): Only compute namespaces from
12908 loaded assemblies here, not the namespaces from the assembly we're
12909 currently compiling.
12911 2003-07-08 Martin Baulig <martin@ximian.com>
12913 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12915 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12917 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12920 I thought about the memory savings here, but LookupTypeReflection
12921 is used under already very constrained scenarios. Compiling
12922 corlib or mcs only exposes one hit, so it would not really reduce
12923 any memory consumption.
12925 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12927 * typemanager.cs: fixes bug #45889 by only adding public types from
12928 other assemblies to the list of known types.
12930 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12932 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12933 on the type we resolved.
12935 2003-07-05 Martin Baulig <martin@ximian.com>
12937 * pending.cs (PendingImplementation.ParentImplements): Don't
12938 create the proxy if the parent is abstract.
12940 * class.cs (TypeContainer.DefineIndexers): Process explicit
12941 interface implementations first. Fixes #37714.
12943 2003-07-04 Miguel de Icaza <miguel@ximian.com>
12945 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12946 defined recursively; but since we modify the input parameters
12947 (left is set to `this' temporarily), we reset this value if the
12948 left_is_explicit is false, which gives the original semantics to
12951 * literal.cs (NullPointer): new class used to represent a null
12952 literal in a pointer context.
12954 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12955 type is a pointer, use a NullPointer object instead of a
12956 NullLiteral. Closes 43687
12958 (ExplicitConversion): Convert pointer values using
12959 the conv opcode to the proper type.
12961 * ecore.cs (New): change ValueTypeVariable property into a method,
12962 that returns whether the valuetype is suitable for being used.
12964 * expression.cs (Binary.DoNumericPromotions): Only return if we
12965 the int constant was a valid uint, and we can return both left and
12966 right as uints. If not, we continue processing, to trigger the
12967 type conversion. This fixes 39018.
12969 * statement.cs (Block.EmitMeta): During constant resolution, set
12970 the CurrentBlock property on the emitcontext, so that we resolve
12971 constants propertly.
12973 2003-07-02 Martin Baulig <martin@ximian.com>
12975 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12976 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12978 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12979 than emitting it here.
12981 * statement.cs: Fixed some more flow analysis bugs.
12983 2003-07-02 Martin Baulig <martin@ximian.com>
12985 * class.cs (MethodData.Define): When implementing interface
12986 methods, set Final unless we're Virtual.
12988 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12989 check work for interface methods.
12991 2003-07-01 Martin Baulig <martin@ximian.com>
12993 * ecore.cs (EmitContext.This): Replaced this property with a
12994 GetThis() method which takes a Location argument. This ensures
12995 that we get the correct error location for a CS0188.
12997 2003-07-01 Miguel de Icaza <miguel@ximian.com>
12999 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13000 ImplicitStandardConversion.
13002 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13004 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
13006 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13009 2003-06-30 Miguel de Icaza <miguel@ximian.com>
13011 * class.cs (Constructor.Define): Turn off initlocals for unsafe
13014 (MethodData.Define): Turn off initlocals for unsafe methods.
13016 2003-06-29 Miguel de Icaza <miguel@ximian.com>
13018 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13019 complete; Fixes #37521.
13021 * delegate.cs: Use Modifiers.TypeAttr to compute the
13022 TypeAttributes, instead of rolling our own. This makes the flags
13023 correct for the delegates.
13025 2003-06-28 Miguel de Icaza <miguel@ximian.com>
13027 * class.cs (Constructor.Define): Set the private flag for static
13028 constructors as well.
13030 * cs-parser.jay (statement_expression): Set the return value to
13031 null, to avoid a crash when we catch an error.
13033 2003-06-24 Miguel de Icaza <miguel@ximian.com>
13035 * cs-parser.jay: Applied patch from Jackson that adds support for
13036 extern and unsafe modifiers to destructor declarations.
13038 * expression.cs: Report error 21 if the user is trying to index a
13041 * driver.cs: Add an error message, suggested by the bug report.
13043 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13044 if we do not have a ": this ()" constructor initializer. Fixes 45149
13046 2003-06-14 Miguel de Icaza <miguel@ximian.com>
13048 * namespace.cs: Add some information to reduce FAQs.
13050 2003-06-13 Miguel de Icaza <miguel@ximian.com>
13052 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13053 underlying enumeration types. Fixes #43915.
13055 * expression.cs: Treat ushort/short as legal values to be used in
13056 bitwise operations.
13058 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13060 * delegate.cs: transfer custom attributes for paramenters from
13061 the delegate declaration to Invoke and BeginInvoke.
13063 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13065 * attribute.cs: handle custom marshalers and emit marshal info
13068 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
13070 * makefile.gnu: Added anonymous.cs to the compiler sources.
13072 2003-05-28 Miguel de Icaza <miguel@ximian.com>
13074 * iterators.cs: Change the name of the proxy class to include two
13077 * cs-parser.jay: Update grammar to include anonymous methods.
13079 * anonymous.cs: new file.
13081 2003-05-27 Miguel de Icaza <miguel@ximian.com>
13083 * class.cs (Field.Define): Add missing test for pointers and
13086 2003-05-27 Ravi Pratap <ravi@ximian.com>
13088 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13089 we use the stobj opcode.
13091 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13092 since it wasn't the correct fix.
13094 It still is puzzling that we are required to use stobj for IntPtr
13095 which seems to be a ValueType.
13097 2003-05-26 Miguel de Icaza <miguel@ximian.com>
13099 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13100 during regular simple name resolution. Now, the trick is that
13101 instead of returning for processing the simplename, we do a
13102 TypeManager.LookupType (ie, a rooted lookup as opposed to a
13103 contextual lookup type). If a match is found, return that, if
13104 not, return for further composition.
13106 This fixes long-standing 30485.
13108 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13109 using the address to initialize an object, do an Stobj instead of
13110 using the regular Stelem.
13112 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13113 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13114 Because if we are a BaseIndexerAccess that value will be true.
13117 * statement.cs (GotoCase.Resolve): Return after reporting an
13118 error, do not attempt to continue.
13120 * expression.cs (PointerArithmetic.Emit): If our operand is a
13121 long, convert our constants to match the operand before
13122 multiplying. Convert to I type before adding. Fixes 43670.
13124 2003-05-14 Ravi Pratap <ravi@ximian.com>
13126 * enum.cs (ImplicitConversionExists) : Rename to
13127 ImplicitEnumConversionExists to remove ambiguity.
13129 * ecore.cs (NullCast): New type of cast expression class which
13130 basically is very similar to EmptyCast with the difference being
13131 it still is a constant since it is used only to cast a null to
13133 (eg. (string) null)
13135 * convert.cs (ImplicitReferenceConversion): When casting a null
13136 literal, we return a NullCast.
13138 * literal.cs (NullLiteralTyped): Remove - I don't see why this
13139 should be around anymore.
13141 The renaming (reported was slightly wrong). Corrections:
13143 ConvertImplicitStandard -> ImplicitConversionStandard
13144 ConvertExplicitStandard -> ExplicitConversionStandard
13146 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13147 before passing them in !
13149 * convert.cs (ImplicitConversionStandard): When comparing for
13150 equal expr and target types, ensure that expr is not a
13153 In general, we must not be checking (expr_type ==
13154 target_type) in the top level conversion methods
13155 (ImplicitConversion, ExplicitConversion etc). This checking is
13156 done in the methods that they delegate to.
13158 2003-05-20 Miguel de Icaza <miguel@ximian.com>
13160 * convert.cs: Move Error_CannotConvertType,
13161 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13162 ImplicitNumericConversion, ImplicitConversionExists,
13163 ImplicitUserConversionExists, StandardConversionExists,
13164 FindMostEncompassedType, FindMostSpecificSource,
13165 FindMostSpecificTarget, ImplicitUserConversion,
13166 ExplicitUserConversion, GetConversionOperators,
13167 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13168 TryImplicitIntConversion, Error_CannotConvertImplicit,
13169 ConvertImplicitRequired, ConvertNumericExplicit,
13170 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13171 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13174 Perform the following renames:
13176 StandardConversionExists -> ImplicitStandardConversionExists
13177 ConvertImplicit -> ImplicitConversion
13178 ConvertImplicitStandard -> ImplicitStandardConversion
13179 TryImplicitIntConversion -> ImplicitIntConversion
13180 ConvertImplicitRequired -> ImplicitConversionRequired
13181 ConvertNumericExplicit -> ExplicitNumericConversion
13182 ConvertReferenceExplicit -> ExplicitReferenceConversion
13183 ConvertExplicit -> ExplicitConversion
13184 ConvertExplicitStandard -> ExplicitStandardConversion
13186 2003-05-19 Martin Baulig <martin@ximian.com>
13188 * statement.cs (TypeInfo.StructInfo): Made this type protected.
13189 (TypeInfo): Added support for structs having structs as fields.
13191 * ecore.cs (FieldExpr): Implement IVariable.
13192 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13193 VariableInfo for the field.
13195 2003-05-18 Martin Baulig <martin@ximian.com>
13197 * expression.cs (This.DoResolve): Report a CS0027 if we're
13198 emitting a field initializer.
13200 2003-05-18 Martin Baulig <martin@ximian.com>
13202 * expression.cs (This.ResolveBase): New public function.
13203 (This.DoResolve): Check for CS0188.
13205 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13208 * ecore.cs (MethodGroupExpr.DoResolve): Set the
13209 `instance_expression' to null if we don't have any non-static
13212 2003-05-18 Martin Baulig <martin@ximian.com>
13214 Reworked the way how local variables and parameters are handled by
13215 the flow analysis code.
13217 * statement.cs (TypeInfo, VariableMap): New public classes.
13218 (VariableInfo): New public class. This is now responsible for
13219 checking whether a variable has been assigned. It is used for
13220 parameters and local variables.
13221 (Block.EmitMeta): Take the InternalParameters as argument; compute
13222 the layout of the flow vectors here.
13223 (Block.LocalMap, Block.ParameterMap): New public properties.
13224 (FlowBranching): The .ctor doesn't get the InternalParameters
13225 anymore since Block.EmitMeta() now computes the layout of the flow
13227 (MyStructInfo): This class is now known as `StructInfo' and nested
13228 in `TypeInfo'; we don't access this directly anymore.
13230 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13231 property and removed IsAssigned(), IsFieldAssigned(),
13232 SetAssigned() and SetFieldAssigned(); we now call them on the
13233 VariableInfo so we don't need to duplicate this code everywhere.
13235 * expression.cs (ParameterReference): Added `Block block' argument
13237 (LocalVariableReference, ParameterReference, This): The new
13238 VariableInfo class is now responsible for all the definite
13241 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13242 IsParameterAssigned, SetParameterAssigned): Removed.
13244 2003-05-18 Martin Baulig <martin@ximian.com>
13246 * typemanager.cs (InitCoreTypes): Try calling
13247 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13248 the 3-args-version. Corlib now also needs our `void_type'.
13249 (GetMethod): Added overloaded version which takes an optional
13250 `bool report_errors' to allow lookups of optional methods.
13252 2003-05-12 Martin Baulig <martin@ximian.com>
13254 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13255 only used for locals and not for parameters.
13257 2003-05-12 Miguel de Icaza <miguel@ximian.com>
13259 * support.cs (InternalParameters.ParameterType): Return the
13260 ExternalType of the parameter.
13262 * parameter.cs (Parameter.ExternalType): drop the two arguments,
13265 2003-05-11 Miguel de Icaza <miguel@ximian.com>
13267 * class.cs (MethodData.Define): Do not set the `newslot' on
13268 interface members, if they are also flagged as "override".
13270 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13271 better code for ++i and i++. This only works for static fields
13272 and local variables.
13274 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13275 want to pull the DeclSpace out of the builder_to_declspace instead
13276 of the TypeBuilder (like in TypeContainer.FindMembers).
13278 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13279 instead of LookupTypeContainer. Fixes the crash on .NET for
13280 looking up interface members.
13282 * const.cs: Create our own emit context during the Definition
13283 stage, so that constants are evaluated in the proper context, when
13284 a recursive definition happens.
13286 2003-05-11 Martin Baulig <martin@ximian.com>
13288 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
13289 new block for a switch section.
13290 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13291 the adding/lookup in the switch block. Fixes #39828.
13293 2003-05-09 Miguel de Icaza <miguel@ximian.com>
13295 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13296 functionality: I needed to convert the data after I had performed
13297 the add/sub operation into the operands type size.
13299 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13300 pass the type for the box operation, otherwise the resulting
13301 object would have been of type object.
13303 (BoxedCast): Add constructor to specify the type to box as.
13305 2003-05-07 Miguel de Icaza <miguel@ximian.com>
13307 * iterators.cs: I was reusing the `count' variable inadvertently,
13308 take steps to not allow this to happen.
13310 2003-05-06 Miguel de Icaza <miguel@ximian.com>
13312 * attribute.cs (Attribute.Resolve): Params attributes are encoded
13313 by creating an array at the point where the params starts and
13314 putting all those arguments there, then adjusting the size of the
13317 2003-05-05 Miguel de Icaza <miguel@ximian.com>
13319 * expression.cs (New.AddressOf): Implement interface
13320 IMemoryLocation. This is used when the `new' operator is used in
13321 the context of an invocation to a method on a value type.
13323 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13326 * namespace.cs: Also check the using aliases here.
13328 * driver.cs: Move the test for using validity after the types have
13329 been entered, so we do a single pass that also includes the using
13332 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13333 in the regular case. CreateSiblingForFinally is doing extra
13336 * attribute.cs (GetAttributeArgumentExpression): Store the result
13337 on an out value, and use the return value to indicate failure
13338 instead of using null (which is a valid return for Constant.GetValue).
13340 * statement.cs: Perform the analysis flow for the increment
13341 portion after the statement, because this will be the real flow of
13342 execution. Fixes #42385
13344 * codegen.cs (EmitContext.EmitArgument,
13345 EmitContext.EmitStoreArgument): New helper functions when the
13346 RemapToProxy flag is set.
13348 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13351 Add support for remapping parameters.
13353 * iterators.cs: Propagate parameter values; Store parameter
13354 values in the proxy classes.
13356 2003-05-04 Miguel de Icaza <miguel@ximian.com>
13358 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
13359 need a proxy reference; I do not know what I was thinking
13361 * cs-parser.jay (constructor_initializer): catch another error,
13362 and display nice message.
13364 (field_declaration): catch void field declaration
13365 to flag a better error.
13367 * class.cs (MemberBase.CheckBase): Report an error instead of a
13368 warning if a new protected member is declared in a struct.
13369 (Field.Define): catch the error of readonly/volatile.
13371 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13373 (FieldExpr.AddressOf): ditto. Catch error where the address of a
13374 volatile variable is taken
13376 2003-05-02 Miguel de Icaza <miguel@ximian.com>
13378 * statement.cs (Fixed.Resolve): Report an error if we are not in
13381 2003-05-01 Miguel de Icaza <miguel@ximian.com>
13383 * typemanager.cs: reuse the code that handles type clashes for
13384 delegates and enumerations.
13386 * class.cs (Report28): Always report.
13388 * expression.cs (EncodeAsAttribute): Allow nulls here.
13390 2003-04-28 Miguel de Icaza <miguel@ximian.com>
13392 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13393 the functionality for testing whether an expression is valid for
13394 an attribute here. Also handle the case of arrays of elements
13397 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13398 encoding a linear array into an array of objects that are suitable
13399 to be passed to an CustomAttributeBuilder.
13401 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13403 * ecore.cs: (FieldExpr): Handle field remapping here.
13405 * iteratators.cs: Pass the instance variable (if the method is an
13406 instance method) to the constructors, so we can access the field
13407 variables on the class.
13409 TODO: Test this with structs. I think the THIS variable on
13410 structs might have to be a pointer, and not a refenrece
13412 2003-04-27 Miguel de Icaza <miguel@ximian.com>
13414 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13415 local variables to fields in a proxy class.
13417 * iterators.cs (PopulateProxy): Rename our internal fields to
13419 Create a <THIS> field if we are an instance method, so we can
13420 reference our parent container variables.
13421 (MapVariable): Called back from the EmitContext code to enter a
13422 new variable to field mapping into the proxy class (we just create
13426 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13427 for using the remapped locals to fields.
13429 I placed the code here, because that gives the same semantics to
13430 local variables, and only changes the Emit code.
13432 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13433 statements inside iterators.
13434 (VariableInfo): Add a FieldBuilder for the cases when we are
13435 remapping local variables to fields in a proxy class
13437 * ecore.cs (SimpleNameResolve): Avoid testing two times for
13438 current_block != null.
13440 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13441 not cope with strings, as it has been moved to the
13442 TableSwitchEmit. Fixed bug in switch generation.
13444 * expression.cs (New.DoResolve): Provide more context for the user
13445 when reporting an error.
13447 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13450 * expression.cs (MemberAccess.DoResolve): When we get a type back,
13451 check the permissions for it. Note than in a type-resolution
13452 context the check was already present in DeclSpace.ResolveType,
13453 but was missing from the MemberAccess.
13455 (ArrayCreation.CheckIndices): warn if the user has
13456 more nested levels of expressions, but there are no more
13457 dimensions specified. Avoids crash on bug 41906.
13459 2003-04-26 Miguel de Icaza <miguel@ximian.com>
13461 * statement.cs (Block): replace Implicit bool, for a generic
13463 New flag: `Unchecked'. This is used during the EmitMeta phase
13464 (which is out-of-line with the regular Resolve/Emit process for a
13465 statement, as this is done ahead of time, but still gets a chance
13466 to call constant resolve).
13468 (Block.Flags): new enum for adding a new flag.
13470 (Block.EmitMeta): track the state of unchecked.
13472 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13473 to enable constant resolution to work there as well.
13475 2003-04-22 Miguel de Icaza <miguel@ximian.com>
13477 * typemanager.cs (ienumerable_type): Also look up
13478 System.Collections.IEnumerable.
13480 2003-04-21 Miguel de Icaza <miguel@ximian.com>
13482 TODO: Test more than one conditional per method.
13484 * class.cs (Indexer.Define): Report the location where the user is
13485 referencing the unsupported feature.
13487 (MethodData): Overload the use of `conditionals' to
13488 minimize the creation of needless ArrayLists. This saves roughly
13489 212kb on my machine.
13491 (Method): Implement the new IIteratorContainer interface.
13492 (Method.SetYields): Implement the method by setting the ModFlags
13493 to contain METHOD_YIELDS.
13495 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13496 which just got set to null.
13498 * iterators.cs: New file.
13500 (Yield, YieldBreak): New statements.
13502 * statement.cs (Return.Resolve): Flag an error if we are used in
13503 an iterator method.
13505 * codegen.cs (InIterator): New flag set if the code is being
13506 compiled in an iterator method.
13508 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
13509 internal modifier, and we just use it to avoid adding extra
13510 fields, as this is seldom used.
13512 * cs-parser.jay: Add yield_statement (yield and yield break).
13514 * driver.cs: New flag -v2 to turn on version 2 features.
13516 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13517 hashtable when v2 is enabled.
13519 2003-04-20 Miguel de Icaza <miguel@ximian.com>
13521 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13522 there is already a namespace defined with this name.
13524 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13525 people upgraded their corlibs.
13527 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13528 always use fully qualified types, no need to use the compiler
13531 (TypeManager.IsNamespace): Use binarysearch.
13533 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13534 AddDelegate): I did not quite use the new IsValid API properly: I
13535 have to pass the short-name and the fullname. I was passing only
13536 the basename instead of the fullname sometimes.
13538 (TypeContainer.DefineType): call NamespaceClash.
13540 * interface.cs (Interface.DefineType): use NamespaceClash before
13543 * delegate.cs (Delegate.DefineType): use NamespaceClash before
13546 * enum.cs: (Enum.DefineType): use NamespaceClash before
13549 * typemanager.cs (: 3-line patch that gives us some tasty 11%
13550 speed increase. First, use the negative_hits cache when we get a
13551 negative. Second, add the type with its full original name
13552 instead of the new . and + encoded name (reflection uses + to
13553 separate type from a nested type). Use LookupTypeReflection
13554 directly which bypasses the type->name hashtable (that we already
13555 know does not contain the type.
13557 * decl.cs (DeclSpace.ResolveTypeExpr): track the
13558 location/container type.
13560 * driver.cs: When passing utf8, use directly the UTF8Encoding.
13562 2003-04-19 Miguel de Icaza <miguel@ximian.com>
13564 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13566 * delegate.cs (NewDelegate.Resolve): Test whether an instance
13567 method is being referenced in the method group from a static
13568 context, and report error 120 if so.
13570 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13573 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13574 is created, we create the A namespace).
13576 * cs-parser.jay: A namespace also introduces a DeclarationFound.
13579 2003-04-18 Miguel de Icaza <miguel@ximian.com>
13581 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13582 invocation to ModuleBuilder.GetType with the same values will
13583 return a new type instance, so we need to cache its return
13586 * expression.cs (Binary.ResolveOperator): Only allow the compare
13587 operators on enums if they are of the same type.
13589 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13590 types of ValueType on their own case. Before we were giving them
13591 the same treatment as objects.
13593 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13594 fullname. Short name is used to compare against container name.
13595 Fullname is used to check against defined namespace names.
13597 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13598 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13600 (Method.CheckBase): Call parent.
13601 (MemberBase.CheckBase): Check for protected members on sealed
13603 (PropertyBase.CheckBase): Call parent.
13604 (Field.Define): Call parent.
13606 * report.cs: Negative error codes are now mapped to 8000 - code,
13607 so that the display is render more nicely.
13609 * typemanager.cs: Do not use try/catch, instead report a regular
13612 (GetPointerType, GetReferenceType): These methods provide
13613 mechanisms to obtain the T* and T& from a T. We had the code
13614 previously scattered around the code base, and it also used
13615 TypeManager.LookupType that would go through plenty of caches.
13616 This one goes directly to the type source.
13618 In some places we did the Type.GetType followed by
13619 ModuleBuilder.GetType, but not in others, so this unifies the
13620 processing as well.
13622 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13623 statements now that we have namespace information.
13625 * typemanager.cs (IsNamespace): New method, returns whether the
13626 string presented is a namespace or not.
13628 (ComputeNamespaces): New public entry point, computes the list of
13629 available namespaces, using the GetNamespaces API call in Mono, or
13630 the slower version in MS.NET.
13632 Now before we start the semantic analysis phase, we have a
13633 complete list of namespaces including everything that the user has
13636 Deleted old code to cache namespaces in .nsc files.
13638 2003-04-17 Miguel de Icaza <miguel@ximian.com>
13640 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13641 class/struct location definition Location for the implicit
13642 constructor location.
13644 (Operator.Define): Use the location of the operator for the
13645 implicit Method definition.
13647 (Constructor.Emit): use the constructor location for the implicit
13648 base initializer constructor.
13650 * ecore.cs: Remove ITypeExpression. This interface is now gone,
13651 and the Expression class now contains two new methods:
13653 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
13654 isolate type lookup from the rest of the resolution process.
13656 Since we use Expressions to hold type definitions due to the way
13657 we parse the input we have historically overloaded Resolve to
13658 perform the Type lookups if a special flag is passed. Now this is
13659 eliminated and two methods take their place.
13661 The differences in the two methods between xStep and xTerminal is
13662 that xStep is involved in our current lookup system that uses
13663 SimpleNames to compose a name, while xTerminal is used just to
13664 catch the case where the simplename lookup failed.
13666 2003-04-16 Miguel de Icaza <miguel@ximian.com>
13668 * expression.cs (ResolveMemberAccess): Remove redundant code.
13669 TypeExpr expressions are always born fully resolved.
13671 * interface.cs (PopulateMethod): Do not lookup the types twice.
13672 We were doing it once during SemanticAnalysis and once during
13675 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13676 in local variable type definitions, were being returned as a
13677 SimpleName (we decomposed everything into a string), that is
13678 because primary_expression was being used instead of a type in the
13679 grammar (reduce/reduce conflicts).
13681 The part that was wrong is that we converted the expression into a
13682 string (an oversimplification in one hand, compounded with primary
13683 expressions doing string concatenation).
13689 Would return "A.B.C[]" as a SimpleName. This stopped things like
13690 using clauses from working on this particular context. And a type
13691 was being matched directly against "A.B.C[]".
13693 We now use the correct approach, and allow for ComposedCast to be
13694 part of the unary expression. So the "A.B.C []" become a composed
13695 cast of "A.B.C" (as a nested group of MemberAccess with a
13696 SimpleName at the end) plus the rank composition "[]".
13700 2003-04-10 Miguel de Icaza <miguel@ximian.com>
13702 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13703 for the access level checking.
13705 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
13706 `TypeContainer container', because I kept getting confused when I
13707 was debugging this code.
13709 * expression.cs (Indexers): Instead of tracking getters/setters,
13710 we now track them in parallel. We create one arraylist less, but
13711 most importantly it is possible now for the LValue code to find a
13712 matching get for a set.
13714 (IndexerAccess.DoResolveLValue): Update the code.
13715 GetIndexersForType has been modified already to extract all the
13716 indexers from a type. The code assumed it did not.
13718 Also make the code set the correct return type for the indexer.
13719 This was fixed a long time ago for properties, but was missing for
13720 indexers. It used to be void_type.
13722 (Binary.Emit): Test first for doubles instead of
13723 floats, as they are more common.
13725 (Binary.EmitBranchable): Use the .un version of the branch opcodes
13726 when dealing with floats and the <=, >= operators. This fixes bug
13729 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13730 to load the array value by emitting a load on the foreach variable
13731 type. This was incorrect.
13733 We now emit the code to load an element using the the array
13734 variable type, and then we emit the conversion operator.
13738 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
13740 * attribute.cs: Avoid allocation of ArrayLists in the common case.
13742 2003-04-09 Miguel de Icaza <miguel@ximian.com>
13744 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13745 test for protection before we test for signatures.
13747 (MethodSignature.ToString): implement.
13749 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13750 to the case where we reduced into a LongConstant.
13752 * decl.cs (CheckAccessLevel): If the type is an array, we can not
13753 depend on whether the information is acurrate, because the
13754 Microsoft runtime will always claim that the array type is public,
13755 regardless of the real state.
13757 If the type is a pointer, another problem happens: the type is
13758 reported as non-public in Microsoft.
13760 In both cases we have to call CheckAccessLevel recursively with
13761 the underlying type as the argument to be tested.
13763 2003-04-08 Miguel de Icaza <miguel@ximian.com>
13765 * assign.cs (Assign.Emit): If we are dealing with a compound
13766 assignment expression, we should use the code path that stores the
13767 intermediate result in a temporary value. This fixes #40903.
13769 *expression.cs (Indirection.ToString): Provide ToString method for
13772 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
13774 * class.cs: Null out fields holding references to Block objects so
13775 they can be garbage collected.
13777 * expression.cs (OverloadResolve): Remove unused local.
13779 2003-04-07 Martin Baulig <martin@ximian.com>
13781 * codegen.cs (EmitContext.CurrentFile): New public field.
13782 (EmitContext.Mark): Use the CurrentFile to check whether the
13783 location is in the correct file.
13784 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13786 2003-04-07 Martin Baulig <martin@ximian.com>
13788 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13790 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13791 location. [FIXME: The location argument which gets passed to this
13792 method is sometimes wrong!]
13794 2003-04-07 Nick Drochak <ndrochak@gol.com>
13796 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13798 2003-04-07 Miguel de Icaza <miguel@ximian.com>
13800 * expression.cs (Indirection.EmitAssign): We were using the
13801 temporary, but returning immediately instead of continuing the
13804 2003-04-06 Martin Baulig <martin@ximian.com>
13806 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13807 if it's a nested child, but also deriving from the outer class.
13810 * typemanager.cs (IsNestedChildOf): Make this work if it's a
13811 nested child, but also deriving from the outer class. See
13813 (FilterWithClosure): We may access private members of the outer
13814 class if we're a nested child and deriving from the outer class.
13815 (RealMemberLookup): Only set `closure_private_ok' if the
13816 `original_bf' contained BindingFlags.NonPublic.
13818 2003-04-05 Martin Baulig <martin@ximian.com>
13820 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
13821 probe if its a type parameter, and if so, flag an error.
13823 * decl.cs: Move here the SetParameterInfo code from class.cs.
13824 Handle IsGeneric here.
13826 Handle a variety of errors in the parameter info definition.
13828 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
13829 type parameters here.
13831 * cs-parser.jay (class_declaration): report errors for parameters
13834 2003-01-21 Miguel de Icaza <miguel@ximian.com>
13836 * generic.cs: New file, contains support code for generics.
13838 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
13839 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
13841 Update parser for the above removals.
13843 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
13844 now taken care of in the parser.
13846 2003-04-02 Miguel de Icaza <miguel@ximian.com>
13848 * class.cs (Event.Define): Do not allow abstract events to have
13851 2003-04-01 Miguel de Icaza <miguel@ximian.com>
13853 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13854 block in event declarations.
13856 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13857 value type, get its address.
13859 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13860 leaving a class on the stack instead of a boolean value (int
13861 0/1). Change the code so we compare against null, and then the
13862 result against zero.
13864 * class.cs (TypeContainer.GetClassBases): We were checking for the
13865 parent class being sealed too late.
13867 * expression.cs (Binary.Emit): For <= and >= when dealing with
13868 floating point values, use cgt.un and clt.un instead of cgt and
13871 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
13873 * statement.cs: Apply the same optimization as MS: skip the
13874 GetEnumerator returning an IEnumerator, and use the one returning a
13875 CharEnumerator instead. This allows us to avoid the try-finally block
13878 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
13880 * cs-parser.jay: Attributes cannot be applied to
13881 namespaces. Fixes #40473
13883 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13886 (Add*): check if the name is valid using the full name for constants,
13887 fields, properties and events.
13889 2003-03-28 Miguel de Icaza <miguel@ximian.com>
13891 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13892 char constants to be part of the enumeration.
13894 * expression.cs (Conditional.DoResolve): Add support for operator
13895 true. Implements the missing functionality from 14.12
13897 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13898 operator true/false as required by the spec.
13900 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13901 implicit conversion to boolean.
13903 * statement.cs (Statement.ResolveBoolean): A boolean expression is
13904 also one where the type implements `operator true'.
13906 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13907 get an expression that will invoke operator true based on an
13910 (GetConversionOperators): Removed the hack that called op_True
13913 (Expression.ResolveBoolean): Move this from Statement.
13915 2003-03-17 Miguel de Icaza <miguel@ximian.com>
13917 * ecore.cs (FieldExpr): do not allow initialization of initonly
13918 fields on derived classes
13920 2003-03-13 Martin Baulig <martin@ximian.com>
13922 * statement.cs (Block.Emit): Call ig.BeginScope() and
13923 ig.EndScope() when compiling with debugging info; call
13924 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13926 2003-03-08 Miguel de Icaza <miguel@ximian.com>
13928 * expression.cs (Indexers): Do not construct immediately, allow
13929 for new members to be appended as we go. Fixes 38143
13931 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13933 * expression.cs: save/restore context when resolving an unchecked
13936 2003-03-05 Miguel de Icaza <miguel@ximian.com>
13938 * cfold.cs: Catch division by zero in modulus operator during
13941 2003-03-03 Miguel de Icaza <miguel@ximian.com>
13943 * interface.cs (Interface.DefineMembers): Avoid defining members
13946 2003-02-27 Miguel de Icaza <miguel@ximian.com>
13948 * driver.cs: handle the +/- options for -noconfig
13950 * statement.cs (Unckeched.Resolve): Also track the state of
13951 unchecked in the Resolve phase.
13953 2003-02-27 Martin Baulig <martin@ximian.com>
13955 * ecore.cs (Expression.MemberLookup): Don't create a
13956 MethodGroupExpr for something which is not a method. Fixes #38291.
13958 2003-02-25 Miguel de Icaza <miguel@ximian.com>
13960 * class.cs (MemberBase.CheckParameters): Also check that the type
13961 is unmanaged if it is a pointer.
13963 * expression.cs (SizeOf.Resolve): Add location information.
13965 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13966 a managed type is declared.
13968 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13969 parameter modifiers as well. Fixes bug 38606
13971 * class.cs: Very sad. Am backing out the speed up changes
13972 introduced by the ArrayList -> Array in the TypeContainer, as they
13973 were not actually that much faster, and introduced a bug (no error
13974 reports on duplicated methods).
13976 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13977 source first, this will guarantee that we have a valid expression
13978 before calling in lower levels functions that will require a
13979 resolved object. Then use this original_source in the
13980 target.ResolveLValue instead of the original source that was
13983 Another change. Use target.Resolve instead of LValueResolve.
13984 Although we are resolving for LValues, we will let the Assign code
13985 take care of that (it will be called again from Resolve). This
13986 basically allows code like this:
13988 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13989 class Y { void A (X x) { x [0] += o; }
13991 The problem was that the indexer was trying to resolve for
13992 set_Item (idx, object o) and never finding one. The real set_Item
13993 was set_Item (idx, X). By delaying the process we get the right
13998 2003-02-23 Martin Baulig <martin@ximian.com>
14000 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14001 while calling DoEmit ().
14003 * codegen.cs (EmitContext.Mark): Don't mark locations in other
14004 source files; if you use the #line directive inside a method, the
14005 compiler stops emitting line numbers for the debugger until it
14006 reaches the end of the method or another #line directive which
14007 restores the original file.
14009 2003-02-23 Martin Baulig <martin@ximian.com>
14011 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14013 2003-02-23 Martin Baulig <martin@ximian.com>
14015 * statement.cs (Block.AddChildVariableNames): We need to call this
14016 recursively, not just for our immediate children.
14018 2003-02-23 Martin Baulig <martin@ximian.com>
14020 * class.cs (Event.Define): Always make the field private, like csc does.
14022 * typemanager.cs (TypeManager.RealMemberLookup): Make events
14023 actually work, fixes bug #37521.
14025 2003-02-23 Miguel de Icaza <miguel@ximian.com>
14027 * delegate.cs: When creating the various temporary "Parameters"
14028 classes, make sure that we call the ComputeAndDefineParameterTypes
14029 on those new parameters (just like we do with the formal ones), to
14030 allow them to be resolved in the context of the DeclSpace.
14032 This fixes the bug that Dick observed in Bugzilla #38530.
14034 2003-02-22 Miguel de Icaza <miguel@ximian.com>
14036 * expression.cs (ResolveMemberAccess): When resolving a constant,
14037 do not attempt to pull a constant if the value was not able to
14038 generate a valid constant.
14040 * const.cs (LookupConstantValue): Do not report more errors than required.
14042 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14044 * expression.cs: fixes bug #38328.
14046 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14048 * class.cs: Changed all the various members that can be part of a
14049 class from being an ArrayList to be an Array of the right type.
14050 During the DefineType type_list, interface_list, delegate_list and
14051 enum_list are turned into types, interfaces, delegates and enums
14054 And during the member population, indexer_list, event_list,
14055 constant_list, field_list, instance_constructor_list, method_list,
14056 operator_list and property_list are turned into their real arrays.
14058 Although we could probably perform this operation earlier, for
14059 good error reporting we need to keep the lists and remove the
14060 lists for longer than required.
14062 This optimization was triggered by Paolo profiling the compiler
14063 speed on the output of `gen-sample-program.pl' perl script.
14065 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14066 not crash in methods like MemberLookupFailed that use this field.
14068 This problem arises when the compiler fails to resolve a type
14069 during interface type definition for example.
14071 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14073 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14074 inherit from System.Object, so we have to stop at null, not only
14075 when reaching System.Object.
14077 2003-02-17 Miguel de Icaza <miguel@ximian.com>
14079 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14080 DeclaredOnly because the parent indexer might have had a different
14081 name, but did not loop until the top of the hierarchy was reached.
14083 The problem this one fixes is 35492: when a class implemented an
14084 indexer from an interface, we were getting the interface method
14085 (which was abstract) and we were flagging an error (can not invoke
14088 This also keeps bug 33089 functioning, and test-148 functioning.
14090 * typemanager.cs (IsSpecialMethod): The correct way of figuring
14091 out if a method is special is to see if it is declared in a
14092 property or event, or whether it is one of the predefined operator
14093 names. This should fix correctly #36804.
14095 2003-02-15 Miguel de Icaza <miguel@ximian.com>
14097 The goal here is to remove the dependency on EmptyCast.Peel ().
14098 Killing it completely.
14100 The problem is that currently in a number of places where
14101 constants are expected, we have to "probe" for an EmptyCast, and
14102 Peel, which is not the correct thing to do, as this will be
14103 repetitive and will likely lead to errors.
14105 The idea is to remove any EmptyCasts that are used in casts that
14106 can be reduced to constants, so we only have to cope with
14109 This bug hunt was triggered by Bug 37363 and the desire to remove
14110 the duplicate pattern where we were "peeling" emptycasts to check
14111 whether they were constants. Now constants will always be
14114 * ecore.cs: Use an enumconstant here instead of wrapping with
14117 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14118 throwing me off. By handling this we can get rid of a few hacks.
14120 * statement.cs (Switch): Removed Peel() code.
14122 2003-02-14 Miguel de Icaza <miguel@ximian.com>
14124 * class.cs: Location information for error 508
14126 * expression.cs (New.DoResolve): Add a guard against double
14127 resolution of an expression.
14129 The New DoResolve might be called twice when initializing field
14130 expressions (see EmitFieldInitializers, the call to
14131 GetInitializerExpression will perform a resolve on the expression,
14132 and later the assign will trigger another resolution
14134 This leads to bugs (#37014)
14136 * delegate.cs: The signature for EndInvoke should contain any ref
14137 or out parameters as well. We were not doing this in the past.
14139 * class.cs (Field.Define): Do not overwrite the type definition
14140 inside the `volatile' group. Turns out that volatile enumerations
14141 were changing the type here to perform a validity test, which
14144 2003-02-12 Miguel de Icaza <miguel@ximian.com>
14146 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14147 and structs, we do not want to load the instance variable
14149 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14150 enum_type has to be handled like an object reference (implicit
14151 conversions exists from this to object), but the regular IsClass
14152 and IsValueType tests will never return true for this one.
14154 Also we use TypeManager.IsValueType instead of type.IsValueType,
14155 just for consistency with the rest of the code (this is only
14156 needed if we ever use the construct exposed by test-180.cs inside
14157 corlib, which we dont today).
14159 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
14161 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14164 2003-02-09 Martin Baulig <martin@ximian.com>
14166 * namespace.cs (Namespace..ctor): Added SourceFile argument.
14167 (Namespace.DefineNamespaces): New static public method; this is
14168 called when we're compiling with debugging to add all namespaces
14169 to the symbol file.
14171 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14172 pass it to the Namespace's .ctor.
14174 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14175 and MethodBase arguments; pass the namespace ID to the symwriter;
14176 pass the MethodBase instead of the token to the symwriter.
14177 (SymbolWriter.DefineNamespace): New method to add a namespace to
14180 2003-02-09 Martin Baulig <martin@ximian.com>
14182 * symbolwriter.cs: New file. This is a wrapper around
14183 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
14184 methods here in near future.
14186 2003-02-09 Martin Baulig <martin@ximian.com>
14188 * codegen.cs (EmitContext.Mark): Just pass the arguments to
14189 ILGenerator.MarkSequencePoint() which are actually used by the
14192 2003-02-09 Martin Baulig <martin@ximian.com>
14194 * location.cs (SourceFile): New public sealed class. This
14195 contains the name and an index which is used in the location's token.
14196 (Location): Reserve an appropriate number of bits in the token for
14197 the source file instead of walking over that list, this gives us a
14198 really huge performance improvement when compiling with debugging.
14200 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14201 `SourceFile' argument instead of a string.
14202 (Driver.ProcessFile): Add all the files via Location.AddFile(),
14203 but don't parse/tokenize here, we need to generate the list of all
14204 source files before we do that.
14205 (Driver.ProcessFiles): New static function. Parses/tokenizes all
14208 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14209 instead of a string.
14211 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14214 2003-02-09 Martin Baulig <martin@ximian.com>
14216 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14217 filename on `#line default'.
14219 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14221 * statement.cs: don't clear the pinned var when the fixed statement
14222 returns from the method (fixes bug#37752).
14224 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14226 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
14229 2003-02-07 Martin Baulig <martin@ximian.com>
14231 * driver.cs: Removed the `--debug-args' command line argument.
14233 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14234 automatically by the AsssemblyBuilder.
14235 (CodeGen.InitializeSymbolWriter): We don't need to call any
14236 initialization function on the symbol writer anymore. This method
14237 doesn't take any arguments.
14239 2003-02-03 Miguel de Icaza <miguel@ximian.com>
14241 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14242 from referenced assemblies as well.
14244 2003-02-02 Martin Baulig <martin@ximian.com>
14246 * class.cs (MethodData.Emit): Generate debugging info for external methods.
14248 2003-02-02 Martin Baulig <martin@ximian.com>
14250 * class.cs (Constructor.Emit): Open the symbol writer before
14251 emitting the constructor initializer.
14252 (ConstructorInitializer.Emit): Call ec.Mark() to allow
14253 single-stepping through constructor initializers.
14255 2003-01-30 Miguel de Icaza <miguel@ximian.com>
14257 * class.cs: Handle error 549: do not allow virtual methods in
14260 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14262 * decl.cs: Check access levels when resolving types
14264 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14266 * statement.cs: Add parameters and locals set in catch blocks that might
14267 return to set vector
14269 2003-01-29 Miguel de Icaza <miguel@ximian.com>
14271 * class.cs (Operator): Set the SpecialName flags for operators.
14273 * expression.cs (Invocation.DoResolve): Only block calls to
14274 accessors and operators on SpecialName methods.
14276 (Cast.TryReduce): Handle conversions from char constants.
14279 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14281 * statement.cs: small memory and time optimization in FlowBranching.
14283 2003-01-28 Pedro Mart <yoros@wanadoo.es>
14285 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14286 problem that the last fix but in the other sid (Set).
14288 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14289 access when there is no indexer in the hierarchy.
14291 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14293 * class.cs: Combine some if statements.
14295 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14297 * driver.cs: fixed bug #37187.
14299 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
14301 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14302 any indexer, it's needed to build a list with all the indexers in the
14303 hierarchy (AllGetters), else we have problems. Fixes #35653.
14305 2003-01-23 Miguel de Icaza <miguel@ximian.com>
14307 * class.cs (MethodData.Define): It is wrong for an interface
14308 implementation to be static in both cases: explicit and implicit.
14309 We were only handling this in one case.
14311 Improve the if situation there to not have negations.
14313 * class.cs (Field.Define): Turns out that we do not need to check
14314 the unsafe bit on field definition, only on usage. Remove the test.
14316 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14318 * driver.cs: use assembly.Location instead of Codebase (the latest
14319 patch made mcs fail when using MS assemblies).
14321 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
14323 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14324 get the path to *corlib.dll.
14326 2003-01-21 Nick Drochak <ndrochak@gol.com>
14330 * typemanager.cs: Remove compiler warnings
14332 2003-01-20 Duncan Mak <duncan@ximian.com>
14334 * AssemblyInfo.cs: Bump the version number to 0.19.
14336 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14338 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14340 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
14342 * class.cs (Constructor::Emit): Emit debugging info for constructors.
14344 2003-01-17 Miguel de Icaza <miguel@ximian.com>
14346 * cs-parser.jay: Small fix: we were not comparing the constructor
14347 name correctly. Thanks to Zoltan for the initial pointer.
14349 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14351 * cs-tokenizer.cs: Set file name when specified with #line
14353 2003-01-15 Miguel de Icaza <miguel@ximian.com>
14355 * cs-parser.jay: Only perform the constructor checks here if we
14356 are named like the class; This will help provider a better
14357 error. The constructor path is taken when a type definition is
14358 not found, but most likely the user forgot to add the type, so
14359 report that rather than the constructor error.
14361 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14363 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14366 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14368 * cs-parser.jay: Add cleanup call.
14370 2003-01-13 Duncan Mak <duncan@ximian.com>
14372 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14373 consistent with other methods.
14375 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14377 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14379 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14381 * attribute.cs: only set GuidAttr to true when we have a
14384 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14388 * typemanager.cs: fixes to allow mcs compile corlib with the new
14389 Type.IsSubclassOf fix.
14391 2003-01-08 Miguel de Icaza <miguel@ximian.com>
14393 * expression.cs (LocalVariableReference.DoResolve): Classify a
14394 constant as a value, not as a variable. Also, set the type for
14397 * cs-parser.jay (fixed_statement): take a type instead of a
14398 pointer_type, so we can produce a better error message later.
14400 * statement.cs (Fixed.Resolve): Flag types that are not pointers
14403 (For.DoEmit): Make inifinite loops have a
14404 non-conditional branch back.
14406 (Fixed.DoEmit): First populate the pinned variables, then emit the
14407 statement, then clear the variables. Before I was emitting the
14408 code once for each fixed piece.
14411 2003-01-08 Martin Baulig <martin@ximian.com>
14413 * statement.cs (FlowBranching.MergeChild): A break in a
14414 SWITCH_SECTION does not leave a loop. Fixes #36155.
14416 2003-01-08 Martin Baulig <martin@ximian.com>
14418 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14419 lives in the same number space than `param_map'. Fixes #36154.
14421 2003-01-07 Miguel de Icaza <miguel@ximian.com>
14423 * cs-parser.jay (constructor_declaration): Set the
14424 Constructor.ModFlags before probing for it. This makes the
14425 compiler report 514, 515 and 132 (the code was there, but got
14428 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14429 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14430 (GotoCase.Resolve): Set `Returns' to ALWAYS.
14432 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14434 * enum.cs: create the enum static fields using the enum type.
14436 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14438 * class.cs: don't try to create the ParamBuilder for the return
14439 type if it's not needed (and handle it breaking for the ms runtime
14442 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14444 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14446 2002-12-29 Miguel de Icaza <miguel@ximian.com>
14448 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14449 the command. This showed up while compiling the JANET source
14450 code, which used \r as its only newline separator.
14452 2002-12-28 Miguel de Icaza <miguel@ximian.com>
14454 * class.cs (Method.Define): If we are an operator (because it
14455 reuses our code), then set the SpecialName and HideBySig. #36128
14457 2002-12-22 Miguel de Icaza <miguel@ximian.com>
14459 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14460 exception, report error 120 `object reference required'.
14462 * driver.cs: Add --pause option, used during to measure the size
14463 of the process as it goes with --timestamp.
14465 * expression.cs (Invocation.DoResolve): Do not allow methods with
14466 SpecialName to be invoked.
14468 2002-12-21 Miguel de Icaza <miguel@ximian.com>
14470 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14471 number before adding it.
14473 2002-12-21 Ravi Pratap <ravi@ximian.com>
14475 * ecore.cs (StandardImplicitConversion): When in an unsafe
14476 context, we allow conversion between void * to any other pointer
14477 type. This fixes bug #35973.
14479 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14481 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14482 is not thrown when extensionless outputs are used
14484 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14486 * rootcontext.cs: fixed compilation of corlib.
14488 2002-12-19 Miguel de Icaza <miguel@ximian.com>
14490 * attribute.cs (Attributes.Contains): Add new method.
14492 * class.cs (MethodCore.LabelParameters): if the parameter is an
14493 `out' parameter, check that no attribute `[In]' has been passed.
14495 * enum.cs: Handle the `value__' name in an enumeration.
14497 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
14499 * decl.cs: Added special case to allow overrides on "protected
14502 2002-12-18 Ravi Pratap <ravi@ximian.com>
14504 * attribute.cs (Attributes.AddAttributeSection): Rename to this
14505 since it makes much more sense.
14507 (Attributes.ctor): Don't require a Location parameter.
14509 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14511 * attribute.cs (ApplyAttributes): Remove extra Location parameters
14512 since we already have that information per attribute.
14514 * everywhere : make appropriate changes.
14516 * class.cs (LabelParameters): Write the code which actually
14517 applies attributes to the return type. We can't do this on the MS
14518 .NET runtime so we flag a warning in the case an exception is
14521 2002-12-18 Miguel de Icaza <miguel@ximian.com>
14523 * const.cs: Handle implicit null conversions here too.
14525 2002-12-17 Ravi Pratap <ravi@ximian.com>
14527 * class.cs (MethodCore.LabelParameters): Remove the extra
14528 Type [] parameter since it is completely unnecessary. Instead
14529 pass in the method's attributes so that we can extract
14530 the "return" attribute.
14532 2002-12-17 Miguel de Icaza <miguel@ximian.com>
14534 * cs-parser.jay (parse): Use Report.Error to flag errors instead
14535 of ignoring it and letting the compile continue.
14537 * typemanager.cs (ChangeType): use an extra argument to return an
14538 error condition instead of throwing an exception.
14540 2002-12-15 Miguel de Icaza <miguel@ximian.com>
14542 * expression.cs (Unary.TryReduce): mimic the code for the regular
14543 code path. Perform an implicit cast in the cases where we can
14544 implicitly convert to one of the integral types, and then reduce
14545 based on that constant. This fixes bug #35483.
14547 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14549 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14551 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14553 * namespace.cs: fixed bug #35489.
14555 2002-12-12 Miguel de Icaza <miguel@ximian.com>
14557 * class.cs: Remove some dead code.
14559 * cs-parser.jay: Estimate the number of methods needed
14560 (RootContext.MethodCount);
14562 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14563 numbers instead of StringBuilders.
14565 * support.cs (PtrHashtable): Add constructor with initial size;
14566 We can now reduce reallocations of the method table.
14568 2002-12-10 Ravi Pratap <ravi@ximian.com>
14570 * attribute.cs (ApplyAttributes): Keep track of the emitted
14571 attributes on a per-target basis. This fixes bug #35413.
14573 2002-12-10 Miguel de Icaza <miguel@ximian.com>
14575 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14576 default to the Windows 1252 encoding.
14578 (UnixParseOption): Support version, thanks to Alp for the missing
14581 * AssemblyInfo.cs: Add nice assembly information.
14583 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14586 * cs-parser.jay: Allow a trailing comma before the close bracked
14587 in the attribute_section production.
14589 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14590 address of the instance was being taken, I will take this out,
14591 because we take the address of the object immediately here.
14593 2002-12-09 Ravi Pratap <ravi@ximian.com>
14595 * typemanager.cs (AreMultipleAllowed): Take care of the most
14596 obvious case where attribute type is not in the current assembly -
14599 2002-12-08 Miguel de Icaza <miguel@ximian.com>
14601 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14602 definitions, instead of doing that afterwards.
14604 Also we use a nice little hack, depending on the constructor, we
14605 know if we are a "composed" name or a simple name. Hence, we
14606 avoid the IndexOf test, and we avoid
14608 * codegen.cs: Add code to assist in a bug reporter to track down
14609 the source of a compiler crash.
14611 2002-12-07 Ravi Pratap <ravi@ximian.com>
14613 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14614 types have been emitted for a given element and flag an error
14615 if something which does not have AllowMultiple set is used more
14618 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14619 attribute types and their corresponding AllowMultiple properties
14621 (AreMultipleAllowed): Check the property for a given type.
14623 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14624 property in the case we have a TypeContainer.
14626 (Attributes.AddAttribute): Detect duplicates and just skip on
14627 adding them. This trivial fix catches a pretty gross error in our
14628 attribute emission - global attributes were being emitted twice!
14630 Bugzilla bug #33187 is now fixed.
14632 2002-12-06 Miguel de Icaza <miguel@ximian.com>
14634 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14635 instead of pp_and).
14637 * expression.cs (Binary.ResolveOperator): I can only use the
14638 Concat (string, string, string) and Concat (string, string,
14639 string, string) if the child is actually a concatenation of
14642 2002-12-04 Miguel de Icaza <miguel@ximian.com>
14644 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14645 context where we need a 2-character lookahead.
14647 * pending.cs (PendingImplementation): Rework so we can keep track
14648 of interface types all the time, and flag those which were
14649 implemented by parents as optional.
14651 2002-12-03 Miguel de Icaza <miguel@ximian.com>
14653 * expression.cs (Binary.ResolveOperator): Use
14654 String.Concat(string,string,string) or
14655 String.Concat(string,string,string,string) when possible.
14657 * typemanager: More helper methods.
14660 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14662 * pending.cs: remove the bogus return from GetMissingInterfaces()
14663 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14665 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14667 * namespace.cs: avoid duplicated 'using xxx' being added to
14668 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14669 when we get more than one 'using' statement for the same namespace.
14670 Report a CS0105 warning for it.
14672 2002-11-30 Miguel de Icaza <miguel@ximian.com>
14674 * cs-tokenizer.cs (consume_identifier): use read directly, instead
14675 of calling getChar/putback, uses internal knowledge of it.
14677 (xtoken): Reorder tokenizer so most common patterns are checked
14678 first. This reduces the compilation time in another 5% (from 8.11s
14679 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14681 The parsing time is 22% of the compilation in mcs, and from that
14682 64% is spent on the tokenization process.
14684 I tried using a binary search for keywords, but this is slower
14685 than the hashtable. Another option would be to do a couple of
14688 * Not use a StringBuilder, instead use an array of chars,
14689 with a set value. Notice that this way we could catch
14690 the 645 error without having to do it *afterwards*.
14692 * We could write a hand-parser to avoid the hashtable
14693 compares altogether.
14695 The identifier consumption process takes 37% of the tokenization
14696 time. Another 15% is spent on is_number. 56% of the time spent
14697 on is_number is spent on Int64.Parse:
14699 * We could probably choose based on the string length to
14700 use Int32.Parse or Int64.Parse and avoid all the 64-bit
14703 Another 3% is spend on wrapping `xtoken' in the `token' function.
14705 Handle 0xa0 as whitespace (#34752)
14707 2002-11-26 Miguel de Icaza <miguel@ximian.com>
14709 * typemanager.cs (IsCLRType): New routine to tell whether a type
14710 is one of the builtin types.
14712 Maybe it needs to use TypeCodes to be faster. Maybe we could use
14713 typecode in more places instead of doing pointer comparissions.
14714 We could leverage some knowledge about the way the typecodes are
14717 New code to cache namespaces in assemblies, it is currently not
14718 invoked, to be used soon.
14720 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14722 * expression.cs (Binary.ResolveOperator): specially handle
14723 strings, and do not perform user-defined operator overloading for
14726 2002-11-24 Miguel de Icaza <miguel@ximian.com>
14728 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14729 internalcall as it is a pretty simple operation; Avoid whenever
14730 possible to call Char.IsLetter.
14732 (consume_identifier): Cut by half the number of
14733 hashtable calls by merging the is_keyword and GetKeyword behavior.
14735 Do not short-circuit, because if we do, we
14736 report errors (ie, #if false && true would produce an invalid
14740 2002-11-24 Martin Baulig <martin@ximian.com>
14742 * expression.cs (Cast.TryReduce): If we're in checked syntax,
14743 check constant ranges and report a CS0221. Fixes #33186.
14745 2002-11-24 Martin Baulig <martin@ximian.com>
14747 * cs-parser.jay: Make this work for uninitialized variable
14748 declarations in the `for' initializer. Fixes #32416.
14750 2002-11-24 Martin Baulig <martin@ximian.com>
14752 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14753 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
14755 2002-11-24 Martin Baulig <martin@ximian.com>
14757 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14758 argument; if true, we also check for user-defined conversions.
14759 This is only needed if both arguments are of a user-defined type.
14760 Fixes #30443, added test-175.cs.
14761 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14763 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14765 2002-11-24 Martin Baulig <martin@ximian.com>
14767 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14768 function to get the store opcode.
14769 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14770 only emit the Ldelema if the store opcode is Stobj. You must run
14771 both test-34 and test-167 to test this. Fixes #34529.
14773 2002-11-23 Martin Baulig <martin@ximian.com>
14775 * ecore.cs (Expression.MemberLookup): Added additional
14776 `qualifier_type' argument which is used when we're being called
14777 from MemberAccess.DoResolve() and null if we're called from a
14779 (Expression.MemberLookupFailed): New method to report errors; this
14780 does the CS1540 check and reports the correct error message.
14782 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14783 argument for the CS1540 check and redone the way how we're dealing
14784 with private members. See the comment in the source code for details.
14785 (FilterWithClosure): Reverted this back to revision 1.197; renamed
14786 `closure_start_type' to `closure_qualifier_type' and check whether
14787 it's not null. It was not this filter being broken, it was just
14788 being called with the wrong arguments.
14790 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14791 and pass it the correct `qualifier_type'; this also does the error
14794 2002-11-22 Miguel de Icaza <miguel@ximian.com>
14796 * expression.cs (Invocation.EmitParams): If the we are dealing
14797 with a non-built-in value type, load its address as well.
14799 (ArrayCreation): Use a a pretty constant instead
14800 of the hardcoded value 2. Use 6 instead of 2 for the number of
14801 static initializers.
14803 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14804 because they are not really value types, just glorified integers.
14806 * driver.cs: Do not append .exe, the CSC compiler does not do it.
14808 * ecore.cs: Remove redundant code for enumerations, make them use
14809 the same code path as everything else, fixes the casting issue
14810 with enumerations in Windows.Forms.
14812 * attribute.cs: Do only cast to string if it is a string, the
14813 validation happens later.
14815 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14816 people upgrade their corlibs.
14818 * ecore.cs: Oops, enumerations were not following the entire code path
14820 2002-11-21 Miguel de Icaza <miguel@ximian.com>
14822 * typemanager.cs (FilterWithClosure): Commented out the test for
14823 1540 in typemanager.cs, as it has problems when accessing
14824 protected methods from a parent class (see test-174.cs).
14826 * attribute.cs (Attribute.ValidateGuid): new method.
14827 (Attribute.Resolve): Use above.
14829 2002-11-19 Miguel de Icaza <miguel@ximian.com>
14831 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14833 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14834 handling for enumerations, as we only needed the TypeContainer
14835 functionality to begin with (this is required for the fix below to
14836 work for enums that reference constants in a container class for
14839 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14841 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14842 a valid TypeBuilder to perform lookups on.o
14844 * class.cs (InheritableMemberSignatureCompare): Use true in the
14845 call to GetGetMethod and GetSetMethod, because we are comparing
14846 the signature, and we need to get the methods *even* if they are
14849 (PropertyBase.CheckBase): ditto.
14851 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14852 GotoCase.Resolve): Use Peel on EmpytCasts.
14854 * ecore.cs (EmptyCast): drop child, add Peel method.
14856 2002-11-17 Martin Baulig <martin@ximian.com>
14858 * ecore.cs (EmptyCast.Child): New public property.
14860 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14861 label resolved to an EmptyCast. Fixes #34162.
14862 (GotoCase.Resolve): Likewise.
14863 (Block.EmitMeta): Likewise.
14865 2002-11-17 Martin Baulig <martin@ximian.com>
14867 * expression.cs (Invocation.BetterConversion): Prefer int over
14868 uint; short over ushort; long over ulong for integer literals.
14869 Use ImplicitConversionExists instead of StandardConversionExists
14870 since we also need to check for user-defined implicit conversions.
14871 Fixes #34165. Added test-173.cs.
14873 2002-11-16 Martin Baulig <martin@ximian.com>
14875 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14876 with the `true' and `false' literals. Fixes #33151.
14878 2002-11-16 Martin Baulig <martin@ximian.com>
14880 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14881 October 22nd; don't do the cs1540 check for static members.
14883 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14884 now using our own filter here and doing the cs1540 check again.
14886 2002-11-16 Martin Baulig <martin@ximian.com>
14888 * support.cs (InternalParameters): Don't crash if we don't have
14889 any fixed parameters. Fixes #33532.
14891 2002-11-16 Martin Baulig <martin@ximian.com>
14893 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14894 when looking up static methods to make this work on Windows.
14897 2002-11-16 Martin Baulig <martin@ximian.com>
14899 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14900 a setter rather than using PropertyInfo.CanWrite.
14902 2002-11-15 Nick Drochak <ndrochak@gol.com>
14904 * class.cs: Allow acces to block member by subclasses. Fixes build
14907 2002-11-14 Martin Baulig <martin@ximian.com>
14909 * class.cs (Constructor.Emit): Added the extern/block check.
14912 2002-11-14 Martin Baulig <martin@ximian.com>
14914 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14915 iteration while looking for indexers, this is needed because the
14916 indexer may have a different name in our base classes. Fixed the
14917 error reporting (no indexers at all, not get accessor, no
14918 overloaded match). Fixes bug #33089.
14919 (IndexerAccess.DoResolveLValue): Likewise.
14921 2002-11-14 Martin Baulig <martin@ximian.com>
14923 * class.cs (PropertyBase.CheckBase): Make this work for multiple
14924 indexers. Fixes the first part of bug #33089.
14925 (MethodSignature.InheritableMemberSignatureCompare): Added support
14928 2002-11-13 Ravi Pratap <ravi@ximian.com>
14930 * attribute.cs (Attribute.Resolve): Catch the
14931 NullReferenceException and report it since it isn't supposed to
14934 2002-11-12 Miguel de Icaza <miguel@ximian.com>
14936 * expression.cs (Binary.EmitBranchable): Also handle the cases for
14937 LogicalOr and LogicalAnd that can benefit from recursively
14938 handling EmitBranchable. The code now should be nice for Paolo.
14940 2002-11-08 Miguel de Icaza <miguel@ximian.com>
14942 * typemanager.cs (LookupType): Added a negative-hit hashtable for
14943 the Type lookups, as we perform quite a number of lookups on
14944 non-Types. This can be removed once we can deterministically tell
14945 whether we have a type or a namespace in advance.
14947 But this might require special hacks from our corlib.
14951 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14952 and double which avoids a conversion from an integer to a double.
14954 * expression.cs: tiny optimization, avoid calling IsConstant,
14955 because it effectively performs the lookup twice.
14957 2002-11-06 Miguel de Icaza <miguel@ximian.com>
14959 But a bogus return here to keep the semantics of the old code
14960 until the Mono runtime is fixed.
14962 * pending.cs (GetMissingInterfaces): New method used to remove all
14963 the interfaces that are already implemented by our parent
14964 classes from the list of pending methods.
14966 * interface.cs: Add checks for calls after ResolveTypeExpr.
14968 2002-11-05 Miguel de Icaza <miguel@ximian.com>
14970 * class.cs (Class.Emit): Report warning 67: event not used if the
14971 warning level is beyond 3.
14973 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14974 being a NullLiteral.
14976 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14979 * class.cs (TypeContainer.GetClassBases): Cover a missing code
14980 path that might fail if a type can not be resolved.
14982 * expression.cs (Binary.Emit): Emit unsigned versions of the
14985 * driver.cs: use error 5.
14987 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14989 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14991 2002-11-01 Miguel de Icaza <miguel@ximian.com>
14993 * cs-parser.jay (switch_section): A beautiful patch from Martin
14994 Baulig that fixed 33094.
14996 2002-10-31 Miguel de Icaza <miguel@ximian.com>
14998 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14999 Check whether the base is abstract and report an error if so.
15001 * expression.cs (IndexerAccess.DoResolveLValue,
15002 IndexerAccess.DoResolve): ditto.
15004 (Invocation.DoResolve): ditto.
15006 (Invocation.FullMethodDesc): Improve the report string.
15008 * statement.cs (Block): Eliminate IsVariableDefined as it is
15009 basically just a wrapper for GetVariableInfo.
15011 * ecore.cs (SimpleName): Use new
15013 * support.cs (ReflectionParamter.ParameterType): We unwrap the
15014 type, as we return the actual parameter ref/unref state on a
15017 2002-10-30 Miguel de Icaza <miguel@ximian.com>
15019 * support.cs: Return proper flags REF/OUT fixing the previous
15022 * expression.cs: Reverted last patch, that was wrong. Is_ref is
15023 not used to mean `ref' but `ref or out' in ParameterReference
15025 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15026 full type signature instead of calling TypeManger.CSharpName
15029 * support.cs (InternalParameters.ParameterDesc): Do not compare
15030 directly to the modflags, because REF/OUT will actually be bitsets
15033 * delegate.cs (VerifyMethod): Check also the modifiers.
15035 * cs-tokenizer.cs: Fix bug where floating point values with an
15036 exponent where a sign was missing was ignored.
15038 * driver.cs: Allow multiple assemblies to be specified in a single
15041 2002-10-28 Miguel de Icaza <miguel@ximian.com>
15043 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
15044 because identifiers after a parenthesis would end up in this kind
15045 of production, and we needed to desamiguate it for having casts
15048 (UserDefinedType *) xxx
15050 2002-10-24 Miguel de Icaza <miguel@ximian.com>
15052 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15053 we should set on the Bindingflags.NonPublic, but not turn on
15054 private_ok. private_ok controls whether a Private member is
15055 returned (this is chekced on the filter routine), while the
15056 BindingFlags.NonPublic just controls whether private/protected
15057 will be allowed. This fixes the problem part of the problem of
15058 private properties being allowed to be used in derived classes.
15060 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15061 so we can call the children DoResolveLValue method (this will
15062 properly signal errors on lvalue assignments to base properties)
15064 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15065 getter are null, and we have a property info, we know that this
15066 happened because the lookup failed, so we report an error 122 for
15067 protection level violation.
15069 We also silently return if setter and getter are null in the
15070 resolve functions, this condition only happens if we have flagged
15071 the error before. This is the other half of the problem.
15073 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15074 not have accessibility information, that is why we were returning
15075 true in the filter function in typemanager.cs.
15077 To properly report 122 (property is inaccessible because of its
15078 protection level) correctly, we report this error in ResolveAccess
15079 by failing if both the setter and the getter are lacking (ie, the
15082 DoResolve and DoLResolve have been modified to check for both
15083 setter/getter being null and returning silently, the reason being
15084 that I did not want to put the knowledge about this error in upper
15087 int old = Report.Errors;
15088 x = new PropertyExpr (...);
15089 if (old != Report.Errors)
15094 So the property expr is returned, but it is invalid, so the error
15095 will be flagged during the resolve process.
15097 * class.cs: Remove InheritablePropertySignatureCompare from the
15098 class, as we no longer depend on the property signature to compute
15099 whether it is possible to implement a method or not.
15101 The reason is that calling PropertyInfo.GetGetMethod will return
15102 null (in .NET, in Mono it works, and we should change this), in
15103 cases where the Get Method does not exist in that particular
15108 class X { public virtual int A { get { return 1; } } }
15110 class Z : Y { public override int A { get { return 2; } } }
15112 Would fail in Z because the parent (Y) would not have the property
15113 defined. So we avoid this completely now (because the alternative
15114 fix was ugly and slow), and we now depend exclusively on the
15117 (PropertyBase.CheckBase): Use a method-base mechanism to find our
15118 reference method, instead of using the property.
15120 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15121 routines are gone now.
15123 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15124 names, they were incorrectly named.
15126 * cs-tokenizer.cs: Return are more gentle token on failure.
15128 * pending.cs (PendingImplementation.InterfaceMethod): This routine
15129 had an out-of-sync index variable, which caused it to remove from
15130 the list of pending methods the wrong method sometimes.
15132 2002-10-22 Miguel de Icaza <miguel@ximian.com>
15134 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15135 CanWrite, because those refer to this particular instance of the
15136 property, and do not take into account the fact that we can
15137 override single members of a property.
15139 Constructor requires an EmitContext. The resolution process does
15140 not happen here, but we need to compute the accessors before,
15141 because the resolution does not always happen for properties.
15143 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15144 subclass, before we did not update this flag, but we did update
15147 (GetAccessors): Drop this routine, as it did not work in the
15148 presence of partially overwritten set/get methods.
15150 Notice that this broke the cs1540 detection, but that will require
15153 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15157 * driver.cs: issue a warning instead of an error if we don't support
15158 debugging for the platform. Also ignore a couple of errors that may
15159 arise when trying to write the symbols. Undo my previous patch.
15161 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15163 * driver.cs: ignore /debug switch except for Unix platforms.
15165 2002-10-23 Nick Drochak <ndrochak@gol.com>
15167 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15169 2002-10-21 Miguel de Icaza <miguel@ximian.com>
15171 * driver.cs: Do not make mcs-debug conditional, so we do not break
15172 builds that use it.
15174 * statement.cs (UsageVector.MergeChildren): I would like Martin to
15175 review this patch. But basically after all the children variables
15176 have been merged, the value of "Breaks" was not being set to
15177 new_breaks for Switch blocks. I think that it should be set after
15178 it has executed. Currently I set this to the value of new_breaks,
15179 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15180 conservative, but I do not understand this code very well.
15182 I did not break anything in the build, so that is good ;-)
15184 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15186 2002-10-20 Mark Crichton <crichton@gimp.org>
15188 * cfold.cs: Fixed compile blocker. Really fixed it this time.
15190 2002-10-20 Nick Drochak <ndrochak@gol.com>
15192 * cfold.cs: Fixed compile blocker.
15194 2002-10-20 Miguel de Icaza <miguel@ximian.com>
15196 * driver.cs: I was chekcing the key, not the file.
15198 2002-10-19 Ravi Pratap <ravi@ximian.com>
15200 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15201 message that we were generating - we just need to silently return
15204 2002-10-19 Miguel de Icaza <miguel@ximian.com>
15206 * class.cs (Event.Define): Change my previous commit, as this
15207 breaks the debugger. This is a temporary hack, as it seems like
15208 the compiler is generating events incorrectly to begin with.
15210 * expression.cs (Binary.ResolveOperator): Added support for
15211 "U operator - (E x, E y)"
15213 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15216 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15217 init-only variables, but this path did not take into account that
15218 there might be also instance readonly variables. Correct this
15221 This fixes bug 32253
15223 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15226 * driver.cs: Change the extension for modules to `netmodule'
15228 * cs-parser.jay: Improved slightly the location tracking for
15229 the debugger symbols.
15231 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15232 modifiers that were specified instead of the hardcoded value
15233 (FamAndAssem). This was basically ignoring the static modifier,
15234 and others. Fixes 32429.
15236 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15237 fixed a bug in the process (32476)
15239 * expression.cs (ArrayAccess.EmitAssign): Patch from
15240 hwang_rob@yahoo.ca that fixes bug 31834.3
15242 2002-10-18 Miguel de Icaza <miguel@ximian.com>
15244 * driver.cs: Make the module extension .netmodule.
15246 2002-10-16 Miguel de Icaza <miguel@ximian.com>
15248 * driver.cs: Report an error if the resource file is not found
15249 instead of crashing.
15251 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15252 false, like Emit does.
15254 2002-10-16 Nick Drochak <ndrochak@gol.com>
15256 * typemanager.cs: Remove unused private member. Also reported mcs
15257 bug to report this as a warning like csc.
15259 2002-10-15 Martin Baulig <martin@gnome.org>
15261 * statement.cs (Statement.Emit): Made this a virtual method; emits
15262 the line number info and calls DoEmit().
15263 (Statement.DoEmit): New protected abstract method, formerly knows
15264 as Statement.Emit().
15266 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15268 2002-10-11 Miguel de Icaza <miguel@ximian.com>
15270 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15271 have fixed a remaining problem: not every AddXXXX was adding a
15272 fully qualified name.
15274 Now everyone registers a fully qualified name in the DeclSpace as
15275 being defined instead of the partial name.
15277 Downsides: we are slower than we need to be due to the excess
15278 copies and the names being registered this way.
15280 The reason for this is that we currently depend (on the corlib
15281 bootstrap for instance) that types are fully qualified, because
15282 we dump all the types in the namespace, and we should really have
15283 types inserted into the proper namespace, so we can only store the
15284 basenames in the defined_names array.
15286 2002-10-10 Martin Baulig <martin@gnome.org>
15288 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15289 from bug #31834, see the bug report for a testcase which is
15292 2002-10-10 Martin Baulig <martin@gnome.org>
15294 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15295 flow analysis code for this.
15297 * statement.cs (Do, While, For): Tell the flow analysis code about
15299 (FlowBranching.UsageVector): Added support for infinite loops.
15300 (Block.Resolve): Moved the dead code elimination here and use flow
15303 2002-10-09 Miguel de Icaza <miguel@ximian.com>
15305 * class.cs (Field.Define): Catch cycles on struct type
15308 * typemanager.cs (IsUnmanagedtype): Do not recursively check
15309 fields if the fields are static. We only need to check instance
15312 * expression.cs (As.DoResolve): Test for reference type.
15314 * statement.cs (Using.ResolveExpression): Use
15315 ConvertImplicitRequired, not ConvertImplicit which reports an
15317 (Using.ResolveLocalVariableDecls): ditto.
15319 * expression.cs (Binary.ResolveOperator): Report errors in a few
15320 places where we had to.
15322 * typemanager.cs (IsUnmanagedtype): Finish implementation.
15324 2002-10-08 Miguel de Icaza <miguel@ximian.com>
15326 * expression.cs: Use StoreFromPtr instead of extracting the type
15327 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
15329 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15330 an enumeration value to a System.Enum, but System.Enum is not a
15331 value type, but an class type, so we need to box.
15333 (Expression.ConvertExplicit): One codepath could return
15334 errors but not flag them. Fix this. Fixes #31853
15336 * parameter.cs (Resolve): Do not allow void as a parameter type.
15338 2002-10-06 Martin Baulig <martin@gnome.org>
15340 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15341 if it's a class type and not a struct. Fixes #31815.
15343 2002-10-06 Martin Baulig <martin@gnome.org>
15345 * statement.cs: Reworked the flow analysis code a bit to make it
15346 usable for dead code elimination.
15348 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15350 * cs-parser.jay: allow empty source files. Fixes bug #31781.
15352 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15354 * expression.cs (ComposedCast.DoResolveType): A quick workaround
15355 to fix the test 165, will investigate deeper.
15357 2002-10-04 Martin Baulig <martin@gnome.org>
15359 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15360 finally blocks actually work.
15361 (Try.Resolve): We don't need to create a sibling for `finally' if
15362 there is no finally block.
15364 2002-10-04 Martin Baulig <martin@gnome.org>
15366 * class.cs (Constructor.Define): The default accessibility for a
15367 non-default constructor is private, not public.
15369 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15371 * class.cs (Constructor): Make AllowedModifiers public, add
15374 * cs-parser.jay: Perform the modifiers test here, as the
15375 constructor for the Constructor class usually receives a zero
15376 because of the way we create it (first we create, later we
15377 customize, and we were never checking the modifiers).
15379 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15380 is a version of LookupTypeReflection that includes the type-name
15381 cache. This can be used as a fast path for functions that know
15382 the fully qualified name and are only calling into *.GetType() to
15383 obtain a composed type.
15385 This is also used by TypeManager.LookupType during its type
15388 (LookupType): We now also track the real type name, as sometimes
15389 we can get a quey for the real type name from things like
15390 ComposedCast. This fixes bug 31422.
15392 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15393 complete type fullname, it does not have to go through the type
15394 resolution system to obtain the composed version of the type (for
15395 obtaining arrays or pointers).
15397 (Conditional.Emit): Use the EmitBoolExpression to
15398 generate nicer code, as requested by Paolo.
15400 (ArrayCreation.CheckIndices): Use the patch from
15401 hwang_rob@yahoo.ca to validate the array initializers.
15403 2002-10-03 Miguel de Icaza <miguel@ximian.com>
15405 * class.cs (ConstructorInitializer.Emit): simplify code by using
15406 Invocation.EmitCall, and at the same time, fix the bugs in calling
15407 parent constructors that took variable arguments.
15409 * ecore.cs (Expression.ConvertNumericExplicit,
15410 Expression.ImplicitNumericConversion): Remove the code that
15411 manually wrapped decimal (InternalTypeConstructor call is now gone
15414 * expression.cs (Cast.TryReduce): Also handle decimal types when
15415 trying to perform a constant fold on the type.
15417 * typemanager.cs (IsUnmanagedtype): Partially implemented.
15419 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15420 that only turned off an error report, and did nothing else.
15422 2002-10-02 Miguel de Icaza <miguel@ximian.com>
15424 * driver.cs: Handle and ignore /fullpaths
15426 2002-10-01 Miguel de Icaza <miguel@ximian.com>
15428 * expression.cs (Binary.ResolveOperator): Catch the case where
15429 DoNumericPromotions returns true,
15431 (Binary.DoNumericPromotions): Simplify the code, and the tests.
15433 2002-09-27 Miguel de Icaza <miguel@ximian.com>
15435 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15438 2002-09-26 Miguel de Icaza <miguel@ximian.com>
15440 * ecore.cs (ConvertNumericExplicit): It is not enough that the
15441 conversion exists, but it is also required that the conversion be
15442 performed. This manifested in "(Type64Enum) 2".
15444 * class.cs (TypeManager.AddMethod): The fix is not to change
15445 AddEnum, because that one was using a fully qualified name (every
15446 DeclSpace derivative does), but to change the AddMethod routine
15447 that was using an un-namespaced name. This now correctly reports
15448 the duplicated name.
15450 Revert patch until I can properly fix it. The issue
15451 is that we have a shared Type space across all namespaces
15452 currently, which is wrong.
15454 Options include making the Namespace a DeclSpace, and merge
15455 current_namespace/current_container in the parser.
15457 2002-09-25 Miguel de Icaza <miguel@ximian.com>
15459 * cs-parser.jay: Improve error reporting when we get a different
15460 kind of expression in local_variable_type and
15461 local_variable_pointer_type.
15463 Propagate this to avoid missleading errors being reported.
15465 * ecore.cs (ImplicitReferenceConversion): treat
15466 TypeManager.value_type as a target just like object_type. As
15471 Is valid, and needs to result in the int 1 being boxed before it
15472 is assigned to the value type v.
15474 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15475 to validate the enumeration name.
15477 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15478 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
15479 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15481 * ecore.cs (TryImplicitIntConversion): When doing an
15482 implicit-enumeration-conversion, check if the type is 64-bits and
15483 perform a conversion before passing to EnumConstant.
15485 2002-09-23 Miguel de Icaza <miguel@ximian.com>
15487 * decl.cs (Error_AmbiguousTypeReference); New routine used to
15488 report ambiguous type references. Unlike the MS version, we
15489 report what the ambiguity is. Innovation at work ;-)
15491 (DeclSpace.FindType): Require a location argument to
15492 display when we display an ambiguous error.
15494 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15496 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15498 * expression.cs (EmitDynamicInitializers): Apply patch from
15499 hwang_rob@yahoo.ca that fixes the order in which we emit our
15502 2002-09-21 Martin Baulig <martin@gnome.org>
15504 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15505 delegate takes no arguments.
15507 2002-09-20 Miguel de Icaza <miguel@ximian.com>
15509 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15512 * expression.cs: Extract the underlying type.
15514 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15516 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15518 2002-09-19 Miguel de Icaza <miguel@ximian.com>
15520 * class.cs (TypeContainer.DefineType): We can not use the nice
15521 PackingSize with the size set to 1 DefineType method, because it
15522 will not allow us to define the interfaces that the struct
15525 This completes the fixing of bug 27287
15527 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15528 means also structs. This fixes part of the problem.
15529 (Expresion.ImplicitReferenceConversionExists): ditto.
15531 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15532 error if there were no errors reported during the type lookup
15533 process, to avoid duplicates or redundant errors. Without this
15534 you would get an ambiguous errors plus a type not found. We have
15535 beaten the user enough with the first error.
15537 (DeclSparce.FindType): Emit a warning if we have an ambiguous
15540 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15541 during the resolution process, stop the lookup, this avoids
15542 repeated error reports (same error twice).
15544 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15546 * typemanager.cs (LookupType): Redo the type lookup code to match
15547 the needs of System.Reflection.
15549 The issue is that System.Reflection requires references to nested
15550 types to begin with a "+" sign instead of a dot. So toplevel
15551 types look like: "NameSpace.TopLevelClass", and nested ones look
15552 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15555 2002-09-19 Martin Baulig <martin@gnome.org>
15557 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15558 says that a method always returns or always throws an exception,
15559 don't report the CS0161.
15561 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15562 set `Returns = new_returns'.
15564 2002-09-19 Martin Baulig <martin@gnome.org>
15566 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15567 to an enum constant, check for a CS0176.
15569 2002-09-18 Miguel de Icaza <miguel@ximian.com>
15571 * class.cs (TypeContainer.CheckPairedOperators): Now we check
15572 for operators that must be in pairs and report errors.
15574 * ecore.cs (SimpleName.DoResolveType): During the initial type
15575 resolution process, when we define types recursively, we must
15576 check first for types in our current scope before we perform
15577 lookups in the enclosing scopes.
15579 * expression.cs (MakeByteBlob): Handle Decimal blobs.
15581 (Invocation.VerifyArgumentsCompat): Call
15582 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15583 I thought we were supposed to always call this, but there are a
15584 few places in the code where we dont do it.
15586 2002-09-17 Miguel de Icaza <miguel@ximian.com>
15588 * driver.cs: Add support in -linkres and -resource to specify the
15589 name of the identifier.
15591 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15593 * ecore.cs (StandardConversionExists): Sync with the conversion
15594 code: allow anything-* to void* conversions.
15596 (FindMostSpecificSource): Use an Expression argument
15597 instead of a Type, because we might be handed over a Literal which
15598 gets a few more implicit conversions that plain types do not. So
15599 this information was being lost.
15601 Also, we drop the temporary type-holder expression when not
15604 2002-09-17 Martin Baulig <martin@gnome.org>
15606 * class.cs (PropertyBase.CheckBase): Don't check the base class if
15607 this is an explicit interface implementation.
15609 2002-09-17 Martin Baulig <martin@gnome.org>
15611 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15612 different `IndexerName' attributes.
15614 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15615 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15616 virtual CommonResolve().
15618 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15620 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15621 and convert that to the UnderlyingType.
15623 * statement.cs (Foreach.Resolve): Indexers are just like variables
15624 or PropertyAccesses.
15626 * cs-tokenizer.cs (consume_string): Track line numbers and columns
15627 inside quoted strings, we were not doing this before.
15629 2002-09-16 Martin Baulig <martin@gnome.org>
15631 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15632 resolve it. This is needed for the definite assignment check of the
15633 instance expression, fixes bug #29846.
15634 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15636 2002-09-16 Nick Drochak <ndrochak@gol.com>
15638 * parameter.cs: Fix compile error. Cannot reference static member
15639 from an instance object. Is this an mcs bug?
15641 2002-09-14 Martin Baulig <martin@gnome.org>
15643 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15644 multiple times. Fixes bug #30295, added test-166.cs.
15646 2002-09-14 Martin Baulig <martin@gnome.org>
15648 * statement.cs (Block.Emit): Don't emit unreachable code.
15649 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15650 `break' statements.
15651 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15653 2002-09-14 Martin Baulig <martin@gnome.org>
15655 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15658 2002-09-14 Martin Baulig <martin@gnome.org>
15660 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15661 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15662 be false on the ms runtime.
15664 2002-09-13 Martin Baulig <martin@gnome.org>
15666 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15667 the CS0038 error message.
15669 2002-09-12 Miguel de Icaza <miguel@ximian.com>
15671 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15672 constant inside, return it.
15674 2002-09-12 Martin Baulig <martin@gnome.org>
15676 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15677 implicit conversion can be done between enum types.
15679 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15680 check whether an implicit conversion to the current enum's UnderlyingType
15681 exists and report an error if not.
15683 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15684 without debugging support.
15686 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15687 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
15689 2002-09-12 Martin Baulig <martin@gnome.org>
15691 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15693 * ecore.cs (IMemberExpr.DeclaringType): New property.
15694 (SimpleName.SimpleNameResolve): Check whether we're accessing a
15695 nonstatic member of an outer type (CS0038).
15697 2002-09-11 Miguel de Icaza <miguel@ximian.com>
15699 * driver.cs: Activate the using-error detector at warning level
15700 4 (at least for MS-compatible APIs).
15702 * namespace.cs (VerifyUsing): Small buglett fix.
15704 * pending.cs (PendingImplementation): pass the container pointer.
15706 * interface.cs (GetMethods): Allow for recursive definition. Long
15707 term, I would like to move every type to support recursive
15708 definitions, not the current ordering mechanism that we have right
15711 The situation is this: Attributes are handled before interfaces,
15712 so we can apply attributes to interfaces. But some attributes
15713 implement interfaces, we will now handle the simple cases
15714 (recursive definitions will just get an error).
15716 * parameter.cs: Only invalidate types at the end if we fail to
15719 2002-09-09 Martin Baulig <martin@gnome.org>
15721 * ecore.cs (PropertyExpr.Emit): Also check for
15722 TypeManager.system_int_array_get_length so this'll also work when
15723 compiling corlib. Fixes #30003.
15725 2002-09-09 Martin Baulig <martin@gnome.org>
15727 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15728 and throw an exception if we can't get the type's size. Fixed #30040,
15731 2002-09-09 Martin Baulig <martin@gnome.org>
15733 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15735 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15736 context. Fixes bug #30027.
15738 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15739 virtual functions. Fixes bug #30043, added test-164.cs.
15741 2002-09-08 Ravi Pratap <ravi@ximian.com>
15743 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15745 2002-09-08 Nick Drochak <ndrochak@gol.com>
15747 * driver.cs: Use an object to get the windows codepage since it's not a
15750 2002-09-08 Miguel de Icaza <miguel@ximian.com>
15752 * statement.cs (For.Emit): for infinite loops (test == null)
15753 return whether there is a break inside, not always "true".
15755 * namespace.cs (UsingEntry): New struct to hold the name of the
15756 using definition, the location where it is defined, and whether it
15757 has been used in a successful type lookup.
15759 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15764 2002-09-06 Ravi Pratap <ravi@ximian.com>
15766 * attribute.cs : Fix incorrect code which relied on catching
15767 a NullReferenceException to detect a null being passed in
15768 where an object was expected.
15770 2002-09-06 Miguel de Icaza <miguel@ximian.com>
15772 * statement.cs (Try): flag the catch variable as assigned
15774 * expression.cs (Cast): Simplified by using ResolveType instead of
15775 manually resolving.
15777 * statement.cs (Catch): Fix bug by using ResolveType.
15779 2002-09-06 Ravi Pratap <ravi@ximian.com>
15781 * expression.cs (BetterConversion): Special case for when we have
15782 a NullLiteral as the argument and we have to choose between string
15783 and object types - we choose string the way csc does.
15785 * attribute.cs (Attribute.Resolve): Catch the
15786 NullReferenceException and report error #182 since the Mono
15787 runtime no more has the bug and having this exception raised means
15788 we tried to select a constructor which takes an object and is
15791 2002-09-05 Ravi Pratap <ravi@ximian.com>
15793 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15794 message (1502, 1503) when we can't locate a method after overload
15795 resolution. This is much more informative and closes the bug
15798 * interface.cs (PopulateMethod): Return if there are no argument
15799 types. Fixes a NullReferenceException bug.
15801 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15802 expressions too. Previously we were checking only in one place for
15803 positional arguments leaving out named arguments.
15805 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15806 type to the enum type is not allowed. Remove code corresponding to
15809 (ConvertNumericExplicit): Allow explicit conversions from
15810 the underlying type to enum type. This precisely follows the spec
15811 and closes a bug filed by Gonzalo.
15813 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15816 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15818 2002-09-03 Miguel de Icaza <miguel@ximian.com>
15820 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15821 it was important that we stored the right value after the
15822 reduction in `converted'.
15824 2002-09-04 Martin Baulig <martin@gnome.org>
15826 * location.cs (Location.SymbolDocument): Use full pathnames for the
15829 2002-08-30 Miguel de Icaza <miguel@ximian.com>
15831 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15832 of the expression resolve mechanism, because that will catch the
15833 SimpleName error failures.
15835 (Conditional): If we can not resolve the
15836 expression, return, do not crash.
15838 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15841 (location): display token name instead of its number.
15843 2002-08-28 Martin Baulig <martin@gnome.org>
15845 * expression.cs (Binary.ResolveOperator): Don't silently return
15846 but return an error if an operator cannot be applied between two
15849 2002-08-28 Martin Baulig <martin@gnome.org>
15851 * class.cs (Constructor.Define): Set the permission attributes
15852 correctly instead of making all constructors public.
15854 2002-08-28 Martin Baulig <martin@gnome.org>
15856 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15857 for private members before reporting a CS0103; if we find anything,
15860 2002-08-28 Martin Baulig <martin@gnome.org>
15862 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15863 to check whether `closure_start_type == closure_invocation_type',
15864 we also need to check whether `m.DeclaringType == closure_invocation_type'
15865 before bypassing the permission checks. We might be accessing
15866 protected/private members from the base class.
15867 (TypeManager.RealMemberLookup): Only set private_ok if private
15868 members were requested via BindingFlags.NonPublic.
15870 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15872 * expression.cs (MemberAccess.ResolveMemberAccess): Set
15873 MethodGroupExpr.IsExplicitImpl if appropriate.
15874 (Invocation.DoResolve): Don't report the CS0120 for explicit
15875 interface implementations.
15877 2002-08-27 Martin Baulig <martin@gnome.org>
15879 * expression.cs (Invocation.DoResolve): If this is a static
15880 method and we don't have an InstanceExpression, we must report
15883 2002-08-25 Martin Baulig <martin@gnome.org>
15885 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15886 `==' between a valuetype and an object.
15888 2002-08-25 Miguel de Icaza <miguel@ximian.com>
15890 * ecore.cs (TypeExpr): Provide a ToString method.
15892 2002-08-24 Martin Baulig <martin@gnome.org>
15894 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15895 now called proggie.dbg and it's a binary file.
15897 2002-08-23 Martin Baulig <martin@gnome.org>
15899 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15901 2002-08-23 Martin Baulig <martin@gnome.org>
15903 * struct.cs (MyStructInfo.ctor): Make this work with empty
15904 structs; it's not allowed to use foreach() on null.
15906 2002-08-23 Martin Baulig <martin@gnome.org>
15908 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15909 writer the full pathname of the generated assembly.
15911 2002-08-23 Martin Baulig <martin@gnome.org>
15913 * statements.cs (FlowBranching.UsageVector.MergeChildren):
15914 A `finally' block never returns or breaks; improved handling of
15917 2002-08-23 Martin Baulig <martin@gnome.org>
15919 * statement.cs (Throw.Resolve): Allow `throw null'.
15921 2002-08-23 Martin Baulig <martin@gnome.org>
15923 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15924 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15925 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
15926 MemberLookup would return a wrong event if this is an explicit
15927 interface implementation and the class has an event with the same
15930 2002-08-23 Martin Baulig <martin@gnome.org>
15932 * statement.cs (Block.AddChildVariableNames): New public method.
15933 (Block.AddChildVariableName): Likewise.
15934 (Block.IsVariableNameUsedInChildBlock): Likewise.
15935 (Block.AddVariable): Check whether a variable name has already
15936 been used in a child block.
15938 * cs-parser.jay (declare_local_variables): Mark all variable names
15939 from the current block as being used in a child block in the
15942 2002-08-23 Martin Baulig <martin@gnome.org>
15944 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15945 find the symbol writer.
15947 * driver.cs: csc also allows the arguments to /define being
15948 separated by commas, not only by semicolons.
15950 2002-08-23 Martin Baulig <martin@gnome.org>
15952 * interface.cs (Interface.GetMembers): Added static check for events.
15954 2002-08-15 Martin Baulig <martin@gnome.org>
15956 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15957 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15959 * ecore.cs (Expression.MemberLookup): Added documentation and explained
15960 why the MethodData.EmitDestructor() change was necessary.
15962 2002-08-20 Martin Baulig <martin@gnome.org>
15964 * class.cs (TypeContainer.FindMembers): Added static check for events.
15966 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15968 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15969 use Type.GetEvents(), not Type.FindMembers().
15971 2002-08-20 Martin Baulig <martin@gnome.org>
15973 * decl.cs (MemberCache): Added a special method cache which will
15974 be used for method-only searched. This ensures that a method
15975 search will return a MethodInfo with the correct ReflectedType for
15978 2002-08-20 Martin Baulig <martin@gnome.org>
15980 * decl.cs (DeclSpace.FindMembers): Made this public.
15982 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15984 * delegate.cs: fixed build on windows.
15985 [FIXME: Filed as bug #29150: MCS must report these errors.]
15987 2002-08-19 Ravi Pratap <ravi@ximian.com>
15989 * ecore.cs (StandardConversionExists): Return a false
15990 if we are trying to convert the void type to anything else
15991 since that is not allowed.
15993 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15994 we flag error 70 in the event an event is trying to be accessed
15995 directly from outside the declaring type.
15997 2002-08-20 Martin Baulig <martin@gnome.org>
15999 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16000 MemberCache from typemanager.cs to decl.cs.
16002 2002-08-19 Martin Baulig <martin@gnome.org>
16004 * class.cs (TypeContainer): Implement IMemberContainer.
16005 (TypeContainer.DefineMembers): Create the MemberCache.
16006 (TypeContainer.FindMembers): Do better BindingFlags checking; only
16007 return public members if BindingFlags.Public was given, check
16008 whether members are static.
16010 2002-08-16 Martin Baulig <martin@gnome.org>
16012 * decl.cs (DeclSpace.Define): Splitted this in Define and
16013 DefineMembers. DefineMembers is called first and initializes the
16016 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
16017 DefineMembers() on all our DeclSpaces.
16019 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16020 but call DefineMembers() on all nested interfaces. We call their
16021 Define() in our new Define() function.
16023 * interface.cs (Interface): Implement IMemberContainer.
16024 (Interface.Define): Moved all code except the attribute stuf to
16026 (Interface.DefineMembers): Initialize the member cache.
16028 * typemanager.cs (IMemberFinder): Removed this interface, we don't
16029 need this anymore since we can use MemberCache.FindMembers directly.
16031 2002-08-19 Martin Baulig <martin@gnome.org>
16033 * typemanager.cs (MemberCache): When creating the cache for an
16034 interface type, add all inherited members.
16035 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16036 to `out bool used_cache' and documented it.
16037 (TypeManager.MemberLookup): If we already used the cache in the first
16038 iteration, we don't need to do the interfaces check.
16040 2002-08-19 Martin Baulig <martin@gnome.org>
16042 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
16043 here from IMemberFinder and don't implement this interface anymore.
16044 (DeclSpace.MemberCache): Moved here from IMemberFinder.
16046 * typemanager.cs (IMemberFinder): This interface is now only used by
16047 classes which actually support the member cache.
16048 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16049 since we only put DeclSpaces into this Hashtable.
16050 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16051 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16053 2002-08-16 Martin Baulig <martin@gnome.org>
16055 * typemanager.cs (ICachingMemberFinder): Removed.
16056 (IMemberFinder.MemberCache): New property.
16057 (TypeManager.FindMembers): Merged this with RealFindMembers().
16058 This function will never be called from TypeManager.MemberLookup()
16059 so we can't use the cache here, just the IMemberFinder.
16060 (TypeManager.MemberLookup_FindMembers): Check whether the
16061 IMemberFinder has a MemberCache and call the cache's FindMembers
16063 (MemberCache): Rewrote larger parts of this yet another time and
16064 cleaned it up a bit.
16066 2002-08-15 Miguel de Icaza <miguel@ximian.com>
16068 * driver.cs (LoadArgs): Support quoting.
16070 (Usage): Show the CSC-like command line arguments.
16072 Improved a few error messages.
16074 2002-08-15 Martin Baulig <martin@gnome.org>
16076 * typemanager.cs (IMemberContainer.Type): New property.
16077 (IMemberContainer.IsInterface): New property.
16079 The following changes are conditional to BROKEN_RUNTIME, which is
16080 defined at the top of the file.
16082 * typemanager.cs (MemberCache.MemberCache): Don't add the base
16083 class'es members, but add all members from TypeHandle.ObjectType
16084 if we're an interface.
16085 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16086 is the current type.
16087 (MemberCache.CacheEntry.Container): Removed this field.
16088 (TypeHandle.GetMembers): Include inherited members.
16090 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16092 * typemanager.cs: fixed compilation and added a comment on a field that
16095 2002-08-15 Martin Baulig <martin@gnome.org>
16097 * class.cs (ConstructorInitializer.Resolve): In the
16098 Expression.MemberLookup call, use the queried_type as
16101 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16102 declared' attribute, it's always true.
16103 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16104 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16105 temporary wrapper for FindMembers which tells MemberLookup whether
16106 members from the base classes are included in the return value.
16107 This will go away soon.
16108 (TypeManager.MemberLookup): Use this temporary hack here; once the
16109 new MemberCache is completed, we don't need to do the DeclaredOnly
16110 looping here anymore since the MemberCache will take care of this.
16111 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16112 (MemberCache): When creating the MemberCache for a class, get
16113 members from the current class and all its base classes.
16114 (MemberCache.CacheEntry.Container): New field. This is a
16115 temporary hack until the Mono runtime is fixed to distinguish
16116 between ReflectedType and DeclaringType. It allows us to use MCS
16117 with both the MS runtime and the unfixed Mono runtime without
16118 problems and without accecting performance.
16119 (MemberCache.SearchMembers): The DeclaredOnly looping from
16120 TypeManager.MemberLookup is now done here.
16122 2002-08-14 Martin Baulig <martin@gnome.org>
16124 * statement.cs (MyStructInfo.MyStructInfo): Don't call
16125 Type.GetFields on dynamic types but get the fields from the
16126 corresponding TypeContainer.
16127 (MyStructInfo.GetStructInfo): Added check for enum types.
16129 * typemanager.cs (MemberList.IsSynchronized): Implemented.
16130 (MemberList.SyncRoot): Implemented.
16131 (TypeManager.FilterWithClosure): No need to check permissions if
16132 closure_start_type == closure_invocation_type, don't crash if
16133 closure_invocation_type is null.
16135 2002-08-13 Martin Baulig <martin@gnome.org>
16137 Rewrote TypeContainer.FindMembers to use a member cache. This
16138 gives us a speed increase of about 35% for the self-hosting MCS
16139 build and of about 15-20% for the class libs (both on GNU/Linux).
16141 * report.cs (Timer): New class to get enhanced profiling. This
16142 whole class is "TIMER" conditional since it remarkably slows down
16145 * class.cs (MemberList): New class. This is an IList wrapper
16146 which we're now using instead of passing MemberInfo[]'s around to
16147 avoid copying this array unnecessarily.
16148 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16149 (ICachingMemberFinder, IMemberContainer): New interface.
16150 (TypeManager.FilterWithClosure): If `criteria' is null, the name
16151 has already been checked, otherwise use it for the name comparision.
16152 (TypeManager.FindMembers): Renamed to RealMemberFinder and
16153 provided wrapper which tries to use ICachingMemberFinder.FindMembers
16154 if possible. Returns a MemberList, not a MemberInfo [].
16155 (TypeHandle): New class, implements IMemberContainer. We create
16156 one instance of this class per type, it contains a MemberCache
16157 which is used to do the member lookups.
16158 (MemberCache): New class. Each instance of this class contains
16159 all members of a type and a name-based hash table.
16160 (MemberCache.FindMembers): This is our new member lookup
16161 function. First, it looks up all members of the requested name in
16162 the hash table. Then, it walks this list and sorts out all
16163 applicable members and returns them.
16165 2002-08-13 Martin Baulig <martin@gnome.org>
16167 In addition to a nice code cleanup, this gives us a performance
16168 increase of about 1.4% on GNU/Linux - not much, but it's already
16169 half a second for the self-hosting MCS compilation.
16171 * typemanager.cs (IMemberFinder): New interface. It is used by
16172 TypeManager.FindMembers to call FindMembers on a TypeContainer,
16173 Enum, Delegate or Interface.
16174 (TypeManager.finder_to_member_finder): New PtrHashtable.
16175 (TypeManager.finder_to_container): Removed.
16176 (TypeManager.finder_to_delegate): Removed.
16177 (TypeManager.finder_to_interface): Removed.
16178 (TypeManager.finder_to_enum): Removed.
16180 * interface.cs (Interface): Implement IMemberFinder.
16182 * delegate.cs (Delegate): Implement IMemberFinder.
16184 * enum.cs (Enum): Implement IMemberFinder.
16186 * class.cs (TypeContainer): Implement IMemberFinder.
16188 2002-08-12 Martin Baulig <martin@gnome.org>
16190 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16192 2002-08-12 Martin Baulig <martin@gnome.org>
16194 * ecore.cs (ITypeExpression): New interface for expressions which
16196 (TypeExpression): Renamed to TypeLookupExpression.
16197 (Expression.DoResolve): If we're doing a types-only lookup, the
16198 expression must implement the ITypeExpression interface and we
16199 call DoResolveType() on it.
16200 (SimpleName): Implement the new ITypeExpression interface.
16201 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16202 hack, the situation that we're only looking up types can't happen
16203 anymore when this method is called. Moved the type lookup code to
16204 DoResolveType() and call it.
16205 (SimpleName.DoResolveType): This ITypeExpression interface method
16206 is now doing the types-only lookup.
16207 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16208 (ResolveFlags): Added MaskExprClass.
16210 * expression.cs (MemberAccess): Implement the ITypeExpression
16212 (MemberAccess.DoResolve): Added support for a types-only lookup
16213 when we're called via ITypeExpression.DoResolveType().
16214 (ComposedCast): Implement the ITypeExpression interface.
16216 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
16217 Expression.Resolve() with ResolveFlags.Type instead.
16219 2002-08-12 Martin Baulig <martin@gnome.org>
16221 * interface.cs (Interface.Define): Apply attributes.
16223 * attribute.cs (Attribute.ApplyAttributes): Added support for
16224 interface attributes.
16226 2002-08-11 Martin Baulig <martin@gnome.org>
16228 * statement.cs (Block.Emit): Only check the "this" variable if we
16229 do not always throw an exception.
16231 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16232 whether the property has a set accessor.
16234 2002-08-11 Martin Baulig <martin@gnome.org>
16236 Added control flow analysis support for structs.
16238 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16239 with control flow analysis turned off.
16240 (IVariable): New interface.
16241 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16242 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16243 (FieldExpr.DoResolve): Resolve the instance expression with flow
16244 analysis turned off and do the definite assignment check after the
16245 resolving when we know what the expression will resolve to.
16247 * expression.cs (LocalVariableReference, ParameterReference):
16248 Implement the new IVariable interface, only call the flow analysis
16249 code if ec.DoFlowAnalysis is true.
16250 (This): Added constructor which takes a Block argument. Implement
16251 the new IVariable interface.
16252 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16253 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16254 This does the definite assignment checks for struct members.
16256 * class.cs (Constructor.Emit): If this is a non-static `struct'
16257 constructor which doesn't have any initializer, call
16258 Block.AddThisVariable() to tell the flow analysis code that all
16259 struct elements must be initialized before control returns from
16262 * statement.cs (MyStructInfo): New public class.
16263 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16264 argument to this indexer. If non-zero, check an individual struct
16265 member, not the whole struct.
16266 (FlowBranching.CheckOutParameters): Check struct members.
16267 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16268 overloaded versions of these methods which take an additional
16269 `int field_idx' argument to check struct members.
16270 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16271 overloaded versions of these methods which take an additional
16272 `string field_name' argument to check struct member.s
16273 (VariableInfo): Implement the IVariable interface.
16274 (VariableInfo.StructInfo): New public property. Returns the
16275 MyStructInfo instance of the variable if it's a struct or null.
16276 (Block.AddThisVariable): New public method. This is called from
16277 Constructor.Emit() for non-static `struct' constructor which do
16278 not have any initializer. It creates a special variable for the
16279 "this" instance variable which will be checked by the flow
16280 analysis code to ensure that all of the struct's fields are
16281 initialized before control returns from the constructor.
16282 (UsageVector): Added support for struct members. If a
16283 variable/parameter is a struct with N members, we reserve a slot
16284 in the usage vector for each member. A struct is considered fully
16285 initialized if either the struct itself (slot 0) or all its
16286 members are initialized.
16288 2002-08-08 Martin Baulig <martin@gnome.org>
16290 * driver.cs (Driver.MainDriver): Only report an error CS5001
16291 if there were no compilation errors.
16293 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16294 `UnsafeContext' property to determine whether the parent is in
16295 unsafe context rather than checking the parent's ModFlags:
16296 classes nested in an unsafe class are unsafe as well.
16298 2002-08-08 Martin Baulig <martin@gnome.org>
16300 * statement.cs (UsageVector.MergeChildren): Distinguish between
16301 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16302 we return. Added test17() and test18() to test-154.cs.
16304 2002-08-08 Martin Baulig <martin@gnome.org>
16306 * typemanager.cs (TypeManager.FilterWithClosure): If we have
16307 Family access, make sure the invoking type isn't a subclass of the
16308 queried type (that'd be a CS1540).
16310 * ecore.cs (Expression.MemberLookup): Added overloaded version of
16311 this method which takes an additional `Type invocation_type'.
16313 * expression.cs (BaseAccess.DoResolve): Use the base type as
16314 invocation and query type.
16315 (MemberAccess.DoResolve): If the lookup failed and we're about to
16316 report a CS0122, try a lookup with the ec.ContainerType - if this
16317 succeeds, we must report a CS1540.
16319 2002-08-08 Martin Baulig <martin@gnome.org>
16321 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16322 (MethodGroupExpr): Implement the IMemberExpr interface.
16324 * expression (MemberAccess.ResolveMemberAccess): No need to have
16325 any special code for MethodGroupExprs anymore, they're now
16328 2002-08-08 Martin Baulig <martin@gnome.org>
16330 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16331 Family, FamANDAssem and FamORAssem permissions.
16332 (TypeManager.IsSubclassOrNestedChildOf): New public method.
16334 2002-08-08 Martin Baulig <martin@gnome.org>
16336 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16337 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16340 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16342 * driver.cs: implemented /resource option to embed managed resources.
16344 2002-08-07 Martin Baulig <martin@gnome.org>
16346 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16347 (FieldBase.HasFieldInitializer): New public property.
16348 (FieldBase.GetInitializerExpression): New public method. Resolves and
16349 returns the field initializer and makes sure it is only resolved once.
16350 (TypeContainer.EmitFieldInitializers): Call
16351 FieldBase.GetInitializerExpression to get the initializer, this ensures
16352 that it isn't resolved multiple times.
16354 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
16355 the resolving process (SimpleName/MemberLookup) that we're currently
16356 emitting a field initializer (which must not access any instance members,
16357 this is an error CS0236).
16359 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16360 argument, if the `IsFieldInitializer' flag is set, we must report and
16361 error CS0236 and not an error CS0120.
16363 2002-08-07 Martin Baulig <martin@gnome.org>
16365 * ecore.cs (IMemberExpr): New public interface.
16366 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16367 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16368 if the expression is an IMemberExpr.
16370 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16371 to be null, implicitly default to `this' if we're non-static in
16372 this case. Simplified the code a lot by using the new IMemberExpr
16373 interface. Also fixed bug #28176 here.
16375 2002-08-06 Martin Baulig <martin@gnome.org>
16377 * cs-parser.jay (SimpleLookup): Removed. We need to create
16378 ParameterReferences during semantic analysis so that we can do a
16379 type-only search when resolving Cast, TypeOf and SizeOf.
16380 (block): Pass the `current_local_parameters' to the Block's
16383 * class.cs (ConstructorInitializer): Added `Parameters parameters'
16384 argument to the constructor.
16385 (ConstructorInitializer.Resolve): Create a temporary implicit
16386 block with the parameters.
16388 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16389 references here if we aren't doing a type-only search.
16391 * statement.cs (Block): Added constructor which takes a
16392 `Parameters parameters' argument.
16393 (Block.Parameters): New public property.
16395 * support.cs (InternalParameters.Parameters): Renamed `parameters'
16396 to `Parameters' and made it public readonly.
16398 2002-08-06 Martin Baulig <martin@gnome.org>
16400 * ecore.cs (Expression.Warning): Made this public as well.
16402 * report.cs (Report.Debug): Print the contents of collections.
16404 2002-08-06 Martin Baulig <martin@gnome.org>
16406 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
16407 used to tell Resolve() which kinds of expressions it may return.
16408 (Expression.Resolve): Added overloaded version of this method which
16409 takes a `ResolveFlags flags' argument. This can be used to tell
16410 Resolve() which kinds of expressions it may return. Reports a
16412 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16413 ResolveFlags.SimpleName.
16414 (Expression.Error118): Added overloaded version of this method which
16415 takes a `ResolveFlags flags' argument. It uses the flags to determine
16416 which kinds of expressions are allowed.
16418 * expression.cs (Argument.ResolveMethodGroup): New public method.
16419 Resolves an argument, but allows a MethodGroup to be returned.
16420 This is used when invoking a delegate.
16422 * TODO: Updated a bit.
16424 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16426 Fixed compilation with csc.
16428 * ecore.cs: Expression.Error made public. Is this correct? Should
16429 Warning be made public too?
16431 * expression.cs: use ea.Location instead of ea.loc.
16432 [FIXME: Filed as bug #28607: MCS must report these errors.]
16434 2002-08-06 Martin Baulig <martin@gnome.org>
16436 * ecore.cs (Expression.loc): Moved the location here instead of
16437 duplicating it in all derived classes.
16438 (Expression.Location): New public property.
16439 (Expression.Error, Expression.Warning): Made them non-static and
16440 removed the location argument.
16441 (Expression.Warning): Added overloaded version which takes an
16442 `int level' argument.
16443 (Expression.Error118): Make this non-static and removed the
16444 expression and location arguments.
16445 (TypeExpr): Added location argument to the constructor.
16447 * expression.cs (StaticCallExpr): Added location argument to
16449 (Indirection, PointerArithmetic): Likewise.
16450 (CheckedExpr, UnCheckedExpr): Likewise.
16451 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16452 (StringPtr): Likewise.
16455 2002-08-05 Martin Baulig <martin@gnome.org>
16457 * expression.cs (BaseAccess.DoResolve): Actually report errors.
16459 * assign.cs (Assign.DoResolve): Check whether the source
16460 expression is a value or variable.
16462 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16463 while resolving the corresponding blocks.
16465 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16466 an error, don't silently return null.
16468 * statement.cs (Block.AddVariable): Do the error reporting here
16469 and distinguish between CS0128 and CS0136.
16470 (Block.DoResolve): Report all unused labels (warning CS0164).
16471 (LabeledStatement): Pass the location to the constructor.
16472 (LabeledStatement.HasBeenReferenced): New property.
16473 (LabeledStatement.Resolve): Set it to true here.
16475 * statement.cs (Return.Emit): Return success even after reporting
16476 a type mismatch error (CS0126 or CS0127), this is what csc does and
16477 it avoids confusing the users with any consecutive errors.
16479 2002-08-05 Martin Baulig <martin@gnome.org>
16481 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16483 * const.cs (Const.LookupConstantValue): Catch circular definitions.
16485 * expression.cs (MemberAccess.DoResolve): Silently return if an
16486 error has already been reported.
16488 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16489 error has already been reported.
16491 2002-08-05 Martin Baulig <martin@gnome.org>
16493 * statement.cs (UsageVector): Only initialize the `parameters'
16494 vector if we actually have any "out" parameters.
16496 2002-08-05 Martin Baulig <martin@gnome.org>
16498 * expression.cs (Binary.ResolveOperator): When combining delegates,
16499 they must have the same type.
16501 2002-08-05 Martin Baulig <martin@gnome.org>
16503 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16504 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16505 work with the ms runtime and we also don't need it: if we're a
16506 PropertyBuilder and not in the `indexer_arguments' hash, then we
16507 are a property and not an indexer.
16509 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16510 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16511 since the latter one doesn't work with the ms runtime.
16513 2002-08-03 Martin Baulig <martin@gnome.org>
16515 Fixed bugs #27998 and #22735.
16517 * class.cs (Method.IsOperator): New public field.
16518 (Method.CheckBase): Report CS0111 if there's already a method
16519 with the same parameters in the current class. Report CS0508 when
16520 attempting to change the return type of an inherited method.
16521 (MethodData.Emit): Report CS0179 if a method doesn't have a body
16522 and it's not marked abstract or extern.
16523 (PropertyBase): New abstract base class for Property and Indexer.
16524 (PropertyBase.CheckBase): Moved here from Property and made it work
16526 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16527 the same so we can reuse it there.
16528 (Property, Indexer): Derive from PropertyBase.
16529 (MethodSignature.inheritable_property_signature_filter): New delegate
16530 to find properties and indexers.
16532 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16533 argument and improved error reporting.
16535 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16536 EmptyReadOnlyParameters and made it a property.
16538 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16539 version of this method which takes a `PropertyInfo indexer'.
16540 (TypeManager.RegisterIndexer): New method.
16542 * class.cs: Added myself as author of this file :-)
16544 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16546 * class.cs: fixed compilation on windoze.
16548 2002-08-03 Martin Baulig <martin@gnome.org>
16550 * interface.cs (Interface.GetInterfaceBases): Check whether all
16551 base interfaces are at least as accessible than the current one.
16553 * class.cs (TypeContainer.GetClassBases): Check whether base types
16554 are at least as accessible than the current type.
16555 (TypeContainer.AsAccessible): Implemented and made non-static.
16556 (MemberBase.CheckParameters): Report errors if the accessibility
16559 * delegate.cs (Delegate.Delegate): The default visibility is
16560 internal for top-level types and private for nested types.
16561 (Delegate.Define): Report errors if the accessibility checks fail.
16563 * enum.cs (Enum.Enum): The default visibility is internal for
16564 top-level types and private for nested types.
16565 (Enum.DefineType): Compute the correct visibility.
16567 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16568 function which takes a `bool is_toplevel' instead of a TypeContainer.
16570 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16573 2002-08-02 Martin Baulig <martin@gnome.org>
16575 * expression.cs (LocalVariableReferenc): Added constructor which
16576 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16577 (LocalVariableReference.IsReadOnly): New property.
16578 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16579 variable is readonly, use our own readonly flag to do this; you can
16580 use the new constructor to get a writable reference to a read-only
16583 * cs-parser.jay (foreach_statement, using_statement): Get a writable
16584 reference to the local variable.
16586 2002-08-01 Miguel de Icaza <miguel@ximian.com>
16588 * rootcontext.cs (ResolveCore): Also include System.Exception
16590 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16591 we reach an EmptyStatement.
16593 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16596 * expression.cs (Binary.ResolveOperator): Check error result in
16599 use brtrue/brfalse directly and avoid compares to null.
16601 2002-08-02 Martin Baulig <martin@gnome.org>
16603 * class.cs (TypeContainer.Define): Define all nested interfaces here.
16604 Fixes bug #28407, added test-155.cs.
16606 2002-08-01 Martin Baulig <martin@gnome.org>
16608 * class.cs (Event.EmitDefaultMethod): Make this work with static
16609 events. Fixes #28311, added verify-3.cs.
16611 2002-08-01 Martin Baulig <martin@gnome.org>
16613 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16614 `is_disposable' fields.
16615 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16616 `hm.is_disposable' if we're using the collection pattern.
16617 (Foreach.EmitCollectionForeach): Use the correct type for the
16618 enumerator's local variable, only emit the try/finally block if
16619 necessary (fixes #27713).
16621 2002-08-01 Martin Baulig <martin@gnome.org>
16623 * ecore.cs (Expression.report118): Renamed to Error118 and made
16626 * statement.cs (Throw.Resolve): Check whether the expression is of
16627 the correct type (CS0118) and whether the type derives from
16628 System.Exception (CS0155).
16629 (Catch.Resolve): New method. Do the type lookup here and check
16630 whether it derives from System.Exception (CS0155).
16631 (Catch.CatchType, Catch.IsGeneral): New public properties.
16633 * typemanager.cs (TypeManager.exception_type): Added.
16635 2002-07-31 Miguel de Icaza <miguel@ximian.com>
16637 * driver.cs: Updated About function.
16639 2002-07-31 Martin Baulig <martin@gnome.org>
16641 Implemented Control Flow Analysis.
16643 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16644 (EmitContext.CurrentBranching): Added.
16645 (EmitContext.StartFlowBranching): Added.
16646 (EmitContext.EndFlowBranching): Added.
16647 (EmitContext.KillFlowBranching): Added.
16648 (EmitContext.IsVariableAssigned): Added.
16649 (EmitContext.SetVariableAssigned): Added.
16650 (EmitContext.IsParameterAssigned): Added.
16651 (EmitContext.SetParameterAssigned): Added.
16652 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16653 Added control flow analysis stuff here.
16655 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16656 resolve the expression as lvalue.
16657 (LocalVariableReference.DoResolve): Check whether the variable has
16658 already been assigned.
16659 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16660 the parameter as assigned here.
16661 (ParameterReference.DoResolve): Check whether the parameter has already
16663 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16664 expression as lvalue.
16666 * statement.cs (FlowBranching): New class for the flow analysis code.
16667 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16668 (LabeledStatement.IsDefined): New public property.
16669 (LabeledStatement.AddUsageVector): New public method to tell flow
16670 analyis that the label may be reached via a forward jump.
16671 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16673 (VariableInfo.Number): New public field. This is used by flow analysis
16674 to number all locals of a block.
16675 (Block.CountVariables): New public property. This is the number of
16676 local variables in this block (including the locals from all parent
16678 (Block.EmitMeta): Number all the variables.
16680 * statement.cs: Added flow analysis support to all classes.
16682 2002-07-31 Martin Baulig <martin@gnome.org>
16684 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16685 To get debugging messages, compile mcs with /define:MCS_DEBUG and
16686 then use this argument.
16688 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16690 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16691 use this to specify /define options.
16693 2002-07-29 Martin Baulig <martin@gnome.org>
16695 * statement.cs (Fixed): Moved all code that does variable lookups
16696 and resolvings from Emit to Resolve.
16698 * statement.cs (For): Moved all code that does variable lookups
16699 and resolvings from Emit to Resolve.
16701 * statement.cs (Using): Moved all code that does variable lookups
16702 and resolvings from Emit to Resolve.
16704 2002-07-29 Martin Baulig <martin@gnome.org>
16706 * attribute.cs (Attribute.Resolve): Explicitly catch a
16707 System.NullReferenceException when creating the
16708 CustromAttributeBuilder and report a different warning message.
16710 2002-07-29 Martin Baulig <martin@gnome.org>
16712 * support.cs (ParameterData.ParameterName): Added method to
16713 get the name of a parameter.
16715 * typemanager.cs (TypeManager.IsValueType): New public method.
16717 2002-07-29 Martin Baulig <martin@gnome.org>
16719 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
16720 is a flag which specifies that it's either ref or out.
16721 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16722 the out parameter to `out Parameter.Modifier mod', also set the
16723 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16725 * support.cs (InternalParameters.ParameterModifier): Distinguish
16726 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16727 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16729 * expression.cs (Argument.GetParameterModifier): Distinguish
16730 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16731 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16733 2002-07-29 Martin Baulig <martin@gnome.org>
16735 * expression.cs (ParameterReference.ParameterReference): Added
16736 `Location loc' argument to the constructor.
16738 * cs-parser.jay: Pass location to ParameterReference.
16740 2002-07-28 Miguel de Icaza <miguel@ximian.com>
16742 * statement.cs (Try): Initialize the location.
16744 * cs-parser.jay: pass location to Try.
16746 * expression.cs (Unary.Reduce): Change the prototype to return
16747 whether a constant fold could be performed or not. The result is
16748 returned in an out parameters. In the case of Indirection and
16749 AddressOf, we want to perform the full tests.
16751 2002-07-26 Miguel de Icaza <miguel@ximian.com>
16753 * statement.cs (Statement.Emit): Flag dead code.
16755 2002-07-27 Andrew Birkett <andy@nobugs.org>
16757 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16759 2002-07-27 Martin Baulig <martin@gnome.org>
16761 * class.cs (MethodData.Define): Put back call to
16762 TypeManager.AddMethod(), accidentally commented this out.
16764 * report.cs (Debug): New public method to print debugging information,
16765 this is `[Conditional ("DEBUG")]'.
16767 2002-07-26 Martin Baulig <martin@gnome.org>
16769 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16770 (switch_statement): Push the current_block to the switch_stack and
16771 pop it again when we're done with the switch.
16772 (switch_section): The new block is a child of the current_block.
16773 Fixes bug #24007, added test-152.cs.
16775 2002-07-27 Martin Baulig <martin@gnome.org>
16777 * expression.cs (Invocation.EmitArguments): When calling a varargs
16778 function with only its fixed arguments, we need to pass an empty
16781 2002-07-27 Martin Baulig <martin@gnome.org>
16783 Mono 0.13 has been released.
16785 2002-07-25 Miguel de Icaza <miguel@ximian.com>
16787 * driver.cs: Rename --resource to --linkres, because that is what
16788 we do currently, we dont support --resource yet.
16790 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16792 2002-07-25 Martin Baulig <martin@gnome.org>
16794 * class.cs (MethodData): New public class. This is a `method builder'
16795 class for a method or one accessor of a Property/Indexer/Event.
16796 (MethodData.GetMethodFlags): Moved here from MemberBase.
16797 (MethodData.ApplyAttributes): Likewise.
16798 (MethodData.ApplyObsoleteAttribute): Likewise.
16799 (MethodData.ApplyConditionalAttribute): Likewise.
16800 (MethodData.ApplyDllImportAttribute): Likewise.
16801 (MethodData.CheckAbstractAndExternal): Likewise.
16802 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16803 (MethodData.Emit): Formerly known as Method.Emit().
16804 (MemberBase): Moved everything which was specific to a single
16805 accessor/method to MethodData.
16806 (Method): Create a new MethodData and call Define() and Emit() on it.
16807 (Property, Indexer, Event): Create a new MethodData objects for each
16808 accessor and call Define() and Emit() on them.
16810 2002-07-25 Martin Baulig <martin@gnome.org>
16812 Made MethodCore derive from MemberBase to reuse the code from there.
16813 MemberBase now also checks for attributes.
16815 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16816 (MemberBase.GetMethodFlags): Moved here from class Method and marked
16818 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16819 `CallingConventions cc' and `Attributes opt_attrs' arguments.
16820 (MemberBase.ApplyAttributes): New virtual method; applies the
16821 attributes to a method or accessor.
16822 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16823 (MemberBase.ApplyConditionalAttribute): Likewise.
16824 (MemberBase.ApplyDllImportAttribute): Likewise.
16825 (MemberBase.CheckAbstractAndExternal): Likewise.
16826 (MethodCore.ParameterTypes): This is now a property instead of a
16827 method, it's initialized from DoDefineParameters().
16828 (MethodCore.ParameterInfo): Removed the set accessor.
16829 (MethodCore.DoDefineParameters): New protected virtual method to
16830 initialize ParameterTypes and ParameterInfo.
16831 (Method.GetReturnType): We can now simply return the MemberType.
16832 (Method.GetMethodFlags): Override the MemberBase version and add
16833 the conditional flags.
16834 (Method.CheckBase): Moved some code from Define() here, call
16835 DoDefineParameters() here.
16836 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16837 here to avoid some larger code duplication.
16838 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16839 ensure that abstract and external accessors don't declare a body.
16841 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16842 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16843 lookup in the attribute's parent classes, so we need to abort as soon
16844 as we found the first match.
16845 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16846 the attribute has no arguments.
16848 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16851 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16853 * cs-parser.jay: reverted previous patch.
16855 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16857 * cs-parser.jay: fixed bug #22119.
16859 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16861 * attribute.cs: fixed compilation. The error was:
16862 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
16863 be assigned to before control leaves the current method."
16864 [FIXME: Filed as bug #28186: MCS must report this error.]
16866 2002-07-25 Martin Baulig <martin@gnome.org>
16868 * attribute.cs (Attribute.Conditional_GetConditionName): New static
16869 method to pull the condition name ouf of a Conditional attribute.
16870 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16871 the obsolete message and error flag out of an Obsolete attribute.
16873 * class.cs (Method.GetMethodFlags): New public method to get the
16874 TypeManager.MethodFlags for this method.
16875 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16877 (Method.Define): Get and apply the Obsolete and Conditional attributes;
16878 if we're overriding a virtual function, set the new private variable
16879 `parent_method'; call the new TypeManager.AddMethod().
16881 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
16882 the MethodBuilder and the Method in a PtrHashtable.
16883 (TypeManager.builder_to_method): Added for this purpose.
16884 (TypeManager.MethodFlags): Added IsObsoleteError.
16885 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
16886 Obsolete and Conditional arguments in MethodBuilders. If we discover
16887 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16888 the message from the attribute.
16890 2002-07-24 Martin Baulig <martin@gnome.org>
16892 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16893 preprocessor directives, ensure that the argument to #define/#undef is
16894 exactly one identifier and that it's actually an identifier.
16896 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16899 2002-07-24 Martin Baulig <martin@gnome.org>
16901 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16902 initialize it to TypeManager.object_type in the constructor.
16903 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16904 of the `hm.get_current' method if we're using the collection pattern.
16905 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16906 for the explicit conversion to make it work when we're using the collection
16907 pattern and the `Current' property has a different return type than `object'.
16910 2002-07-24 Martin Baulig <martin@gnome.org>
16912 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16913 does not match, but don't report any errors. This method is called in
16914 order for all methods in a MethodGroupExpr until a matching method is
16915 found, so we don't want to bail out if the first method doesn't match.
16916 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16917 matches, report the 123. Fixes #28070.
16919 2002-07-24 Martin Baulig <martin@gnome.org>
16921 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16922 TypeManager.TypeToCoreType() to the top of the method so the
16923 following equality checks will work. Fixes #28107.
16925 2002-07-24 Martin Baulig <martin@gnome.org>
16927 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16928 operand is of type uint, and the other operand is of type sbyte,
16929 short or int, the operands are converted to type long." -
16930 Actually do what this comment already told us. Fixes bug #28106,
16933 2002-07-24 Martin Baulig <martin@gnome.org>
16935 * class.cs (MethodBase): New abstract class. This is now a base
16936 class for Property, Indexer and Event to avoid some code duplication
16937 in their Define() and DefineMethods() methods.
16938 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16939 generic methods for Define() and DefineMethods().
16940 (FieldBase): Derive from MemberBase, not MemberCore.
16941 (Property): Derive from MemberBase, not MemberCore.
16942 (Property.DefineMethod): Moved all the code from this method to the
16943 new MethodBase.DefineAccessor(), just call it with appropriate
16945 (Property.Define): Call the new Property.DoDefine(), this does some
16946 sanity checks and we don't need to duplicate the code everywhere.
16947 (Event): Derive from MemberBase, not MemberCore.
16948 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16949 accessors, this will also make them work with interface events.
16950 (Indexer): Derive from MemberBase, not MemberCore.
16951 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16952 (Indexer.Define): Use the new MethodBase functions.
16954 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16955 argument to the constructor.
16956 (Interface.FindMembers): Added support for interface events.
16957 (Interface.PopluateEvent): Implemented.
16959 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
16961 2002-07-22 Miguel de Icaza <miguel@ximian.com>
16963 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16964 but this is required to check for a method name being the same as
16965 the containing class.
16969 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16971 * interface.cs: initialize variable.
16973 2002-07-23 Martin Baulig <martin@gnome.org>
16975 Implemented the IndexerName attribute in interfaces.
16977 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16978 name if this is an explicit interface implementation.
16979 (Indexer.InterfaceIndexerName): New public variable. If we're
16980 implementing an interface indexer, this is the IndexerName in that
16981 interface. Otherwise, it's the IndexerName.
16982 (Indexer.DefineMethod): If we're implementing interface indexer,
16983 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
16984 and Pending.ImplementIndexer methods.
16985 (Indexer.Define): Also define the PropertyBuilder if we're
16986 implementing an interface indexer and this is neither an explicit
16987 interface implementation nor do the IndexerName match the one in
16990 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16991 If a method is defined here, then we always need to create a proxy
16992 for it. This is used when implementing interface indexers.
16993 (Pending.IsInterfaceIndexer): New public method.
16994 (Pending.ImplementIndexer): New public method.
16995 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16996 This is used when implementing interface indexers to define a proxy
16998 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16999 define a proxy if necessary.
17001 * interface.cs (Interface.IndexerName): New public variable.
17002 (Interface.PopulateIndexer): Set the IndexerName.
17003 (Interface.DefineIndexers): New private method. Populate all the
17004 indexers and make sure their IndexerNames match.
17006 * typemanager.cs (IndexerPropertyName): Added support for interface
17009 2002-07-22 Martin Baulig <martin@gnome.org>
17011 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17012 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17013 ret if HasReturnLabel.
17014 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17017 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17018 and set the ec.LoopBeginTryCatchLevel.
17019 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17020 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17021 the current ec.TryCatchLevel, the branch goes out of an exception
17022 block. In this case, we need to use Leave and not Br.
17024 2002-07-22 Martin Baulig <martin@gnome.org>
17026 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17027 block unless the block does not always return or it is contained in
17028 another try { ... } catch { ... } block. Fixes bug #26506.
17029 Added verify-1.cs to the test suite.
17031 2002-07-22 Martin Baulig <martin@gnome.org>
17033 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17034 then we do not always return. Fixes bug #24985.
17036 2002-07-22 Martin Baulig <martin@gnome.org>
17038 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17039 lookup on a per-class level; ie. walk up the class hierarchy until we
17040 found at least one applicable method, then choose the best among them.
17041 Fixes bug #24463 and test-29.cs.
17043 2002-07-22 Martin Baulig <martin@gnome.org>
17045 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17046 return types of the methods. The return type is not part of the
17047 signature and we must not check it to make the `new' modifier work.
17048 Fixes bug #27999, also added test-147.cs.
17049 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17051 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17052 on the method's return type.
17054 2002-07-21 Martin Baulig <martin@gnome.org>
17056 * assign.cs: Make this work if the rightmost source is a constant and
17057 we need to do an implicit type conversion. Also adding a few more tests
17058 to test-38.cs which should have caught this.
17060 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17061 target in the makefile for this. The makefile.gnu is primarily intended
17062 for end-users who don't want to debug the compiler.
17064 2002-07-21 Martin Baulig <martin@gnome.org>
17066 * assign.cs: Improved the Assign class so it can now handle embedded
17067 assignments (X = Y = Z = something). As a side-effect this'll now also
17068 consume less local variables. test-38.cs now passes with MCS, added
17069 a few new test cases to that test.
17071 2002-07-20 Martin Baulig <martin@gnome.org>
17073 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17074 instructions. Fixes bug #27977, also added test-146.cs.
17076 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17078 * cs-tokenizer.cs: fixed getHex ().
17080 2002-07-19 Martin Baulig <martin@gnome.org>
17082 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17083 not Type.GetType() to lookup the array type. This is needed when
17084 we're constructing an array of a user-defined type.
17085 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17086 single-dimensional arrays, but also for single-dimensial arrays of
17089 2002-07-19 Martin Baulig <martin@gnome.org>
17091 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17092 this function is called, it's not allowed to share LocalBuilders
17093 among ILGenerators.
17095 2002-07-19 Martin Baulig <martin@gnome.org>
17097 * expression.cs (Argument.Resolve): Report an error 118 when trying
17098 to pass a type as argument.
17100 2002-07-18 Martin Baulig <martin@gnome.org>
17102 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17103 Conv_R_Un for the signed `long' type.
17105 2002-07-15 Miguel de Icaza <miguel@ximian.com>
17107 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17108 `expr' for the temporary result, as that will fail if we do
17109 multiple resolves on the same expression.
17111 2002-07-05 Miguel de Icaza <miguel@ximian.com>
17113 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17114 ec.TypeContainer for looking up aliases.
17116 * class.cs (TypeContainer): Remove LookupAlias from here.
17118 * decl.cs (DeclSpace); Move here.
17120 2002-07-01 Miguel de Icaza <miguel@ximian.com>
17122 * class.cs (FindMembers): Only call filter if the constructor
17123 bulider is not null.
17125 Also handle delegates in `NestedTypes' now. Now we will perform
17126 type lookups using the standard resolution process. This also
17129 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17130 This uses Expressions (the limited kind that can be parsed by the
17131 tree) instead of strings.
17133 * expression.cs (ComposedCast.ToString): Implement, used to flag
17134 errors since now we have to render expressions.
17136 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
17139 * ecore.cs (SimpleName.ToString): ditto.
17141 * cs-parser.jay: Instead of using strings to assemble types, use
17142 Expressions to assemble the type (using SimpleName, ComposedCast,
17143 MemberAccess). This should fix the type lookups in declarations,
17144 because we were using a different code path for this.
17146 * statement.cs (Block.Resolve): Continue processing statements
17147 even when there is an error.
17149 2002-07-17 Miguel de Icaza <miguel@ximian.com>
17151 * class.cs (Event.Define): Also remove the `remove' method from
17152 the list of pending items.
17154 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17155 generate more compact code.
17157 2002-07-17 Martin Baulig <martin@gnome.org>
17159 * const.cs (Const.LookupConstantValue): Add support for constant
17160 `unchecked' and `checked' expressions.
17161 Also adding test case test-140.cs for this.
17163 2002-07-17 Martin Baulig <martin@gnome.org>
17165 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17166 check whether mi.ReturnType implements the IEnumerator interface; the
17167 `==' and the IsAssignableFrom() will fail in this situation.
17169 2002-07-16 Ravi Pratap <ravi@ximian.com>
17171 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
17174 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17176 * expression.cs: fixed bug #27811.
17178 2002-07-14 Miguel de Icaza <miguel@ximian.com>
17180 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17181 Molaro: when we are a ref, the value already contains a pointer
17182 value, do not take the address of it.
17184 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17185 * removed mb-parser.jay and mb-tokenizer.cs
17187 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17189 * expression.cs: check against the building corlib void type.
17191 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17193 * ecore.cs: fix for valuetype static readonly fields: when
17194 initializing them, we need their address, not the address of a copy.
17196 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17198 * typemanager.cs: register also enum_type in corlib.
17200 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17202 * class.cs: allow calling this (but not base) initializers in structs.
17204 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17206 * ecore.cs: make sure we compare against the building base types
17209 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17211 * typemanager.cs: fix TypeToCoreType() to handle void and object
17212 (corlib gets no more typerefs after this change).
17214 2002-07-12 Miguel de Icaza <miguel@ximian.com>
17216 * expression.cs (ArrayCreation.EmitArrayArguments): use
17217 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17219 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17220 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
17221 array indexes, the runtime actually forbids them.
17223 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17224 for array arguments here.
17226 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17227 instead of the default for ValueTypes.
17229 (New.DoEmit): Use IsValueType instead of
17230 IsSubclassOf (value_type)
17231 (New.DoResolve): ditto.
17232 (Invocation.EmitCall): ditto.
17234 * assign.cs (Assign): ditto.
17236 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17237 Statements *are* currently doing part of their resolution during
17240 Expressions do always resolve during resolve, but statements are
17241 only required to propagate resolution to their children.
17243 2002-07-11 Miguel de Icaza <miguel@ximian.com>
17245 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17247 (LoadAssembly): Do not add the dll if it is already specified
17249 (MainDriver): Add the System directory to the link path at the end,
17250 after all the other -L arguments.
17252 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17253 wrong opcode for loading bytes and bools (ldelem.i1 instead of
17254 ldelem.u1) and using the opposite for sbytes.
17256 This fixes Digger, and we can finally run it.
17258 * driver.cs (UnixParseOption): Move the option parsing here.
17259 (CSCParseOption): Implement CSC-like parsing of options.
17261 We now support both modes of operation, the old Unix way, and the
17262 new CSC-like way. This should help those who wanted to make cross
17263 platform makefiles.
17265 The only thing broken is that /r:, /reference: and /lib: are not
17266 implemented, because I want to make those have the same semantics
17267 as the CSC compiler has, and kill once and for all the confussion
17268 around this. Will be doing this tomorrow.
17270 * statement.cs (Unsafe.Resolve): The state is checked during
17271 resolve, not emit, so we have to set the flags for IsUnsfe here.
17273 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17275 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17276 not catch the Error_ObjectRefRequired in SimpleName (as it is
17277 possible to have a class/instance variable name that later gets
17278 deambiguated), we have to check this here.
17280 2002-07-10 Ravi Pratap <ravi@ximian.com>
17282 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17283 make static and put into Expression.
17285 (Event.Define): Register the private field of the event with the
17286 TypeManager so that GetFieldFromEvent can get at it.
17288 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17289 keep track of the private field associated with an event which
17292 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17295 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17297 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17299 * expression.cs (Binary.EmitBranchable): this routine emits the
17300 Binary expression in a branchable context. This basically means:
17301 we need to branch somewhere, not just get the value on the stack.
17303 This works together with Statement.EmitBoolExpression.
17305 * statement.cs (Statement.EmitBoolExpression): Use
17308 2002-07-09 Miguel de Icaza <miguel@ximian.com>
17310 * statement.cs (For): Reduce the number of jumps in loops.
17312 (For): Implement loop inversion for the For statement.
17314 (Break): We can be breaking out of a Try/Catch controlled section
17315 (foreach might have an implicit try/catch clause), so we need to
17316 use Leave instead of Br.
17318 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17319 now). If the instace expression supports IMemoryLocation, we use
17320 the AddressOf method from the IMemoryLocation to extract the
17321 address instead of emitting the instance.
17323 This showed up with `This', as we were emitting the instance
17324 always (Emit) instead of the Address of This. Particularly
17325 interesting when This is a value type, as we dont want the Emit
17326 effect (which was to load the object).
17328 2002-07-08 Miguel de Icaza <miguel@ximian.com>
17330 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17332 * statement.cs (Checked): Set the CheckedState during the resolve
17333 process too, as the ConvCast operations track the checked state on
17334 the resolve process, and not emit.
17336 * cs-parser.jay (namespace_member_declaration): Flag that we have
17337 found a declaration when we do. This is used to flag error 1529
17339 * driver.cs: Report ok when we display the help only.
17341 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
17343 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17345 2002-07-04 Miguel de Icaza <miguel@ximian.com>
17347 * cs-tokenizer.cs (define): We also have to track locally the
17348 defines. AllDefines is just used for the Conditional Attribute,
17349 but we also need the local defines for the current source code.
17351 2002-07-03 Miguel de Icaza <miguel@ximian.com>
17353 * statement.cs (While, For, Do): These loops can exit through a
17354 Break statement, use this information to tell whether the
17355 statement is the last piece of code.
17357 (Break): Flag that we break.
17359 * codegen.cs (EmitContexts): New `Breaks' state variable.
17361 2002-07-03 Martin Baulig <martin@gnome.org>
17363 * class.cs (TypeContainer.MethodModifiersValid): Allow override
17364 modifiers in method declarations in structs. Otherwise, you won't
17365 be able to override things like Object.Equals().
17367 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17369 * class.cs (Method, Property, Indexer): Do not allow the public
17370 modifier to be used in explicit interface implementations.
17372 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17373 override modifiers in method declarations in structs
17375 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
17377 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17378 integer or real overflow, report an error
17380 2002-07-02 Martin Baulig <martin@gnome.org>
17382 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17383 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17384 to tell the runtime about our newly created System.Object and
17385 System.ValueType types.
17387 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17389 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17390 struct instead of Ldarg/Starg.
17392 2002-07-02 Martin Baulig <martin@gnome.org>
17394 * expression.cs (Indirection.Indirection): Call
17395 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17397 2002-07-02 Martin Baulig <martin@gnome.org>
17399 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17400 ValueType, call TypeManager.TypeToCoreType() on it.
17401 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17402 the OpCodes.Newarr argument.
17404 2002-07-02 Martin Baulig <martin@gnome.org>
17406 * expression.cs (Invocation.EmitCall): When compiling corlib,
17407 replace all calls to the system's System.Array type to calls to
17408 the newly created one.
17410 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17411 System.Array methods.
17412 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17413 from the system's System.Array type which must be replaced.
17415 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17417 * typemanager.cs: load unverifiable_code_ctor so we can build
17418 corlib using the correct type. Avoid using GetTypeCode() with
17420 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17421 TypeManager.object_type to allow building corlib.
17423 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17425 * ecore.cs: handle System.Enum separately in LoadFromPtr().
17427 2002-07-01 Martin Baulig <martin@gnome.org>
17429 * class.cs: Make the last change actually work, we need to check
17430 whether `ifaces != null' to avoid a crash.
17432 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17434 * class.cs: when we build structs without fields that implement
17435 interfaces, we need to add the interfaces separately, since there is
17436 no API to both set the size and add the interfaces at type creation
17439 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17441 * expression.cs: the dimension arguments to the array constructors
17442 need to be converted if they are a long.
17444 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17446 * class.cs: don't emit ldarg.0 if there is no parent constructor
17447 (fixes showstopper for corlib).
17449 2002-06-29 Martin Baulig <martin@gnome.org>
17451 MCS now compiles corlib on GNU/Linux :-)
17453 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17454 ie. check for MethodImplOptions.InternalCall.
17456 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17457 and TypeManager.attribute_type are null, so we must explicitly check
17458 whether parent is not null to find out whether it's an attribute type.
17459 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17460 and SetBuilder, not only if the property is neither abstract nor external.
17461 This is necessary to set the MethodImplOptions on the accessor methods.
17462 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17463 SetBuilder, see Property.Emit().
17465 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17466 populate "System.Object", "System.ValueType" and "System.Attribute" since
17467 they've already been populated from BootCorlib_PopulateCoreTypes().
17469 2002-06-29 Martin Baulig <martin@gnome.org>
17471 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17472 is the NullLiteral, we also need to make sure that target_type is not
17475 2002-06-29 Martin Baulig <martin@gnome.org>
17477 * rootcontext.cs (RootContext.ResolveCore): We must initialize
17478 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17479 before calling BootstrapCorlib_ResolveDelegate ().
17481 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17483 * statement.cs: fixed build-breaker. All tests passed ok.
17485 2002-06-27 Martin Baulig <martin@gnome.org>
17487 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17488 for System.Decimal when compiling corlib.
17490 2002-06-27 Martin Baulig <martin@gnome.org>
17492 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17493 switch blocks which contain nothing but a default clause.
17495 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
17497 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17499 2002-06-27 Martin Baulig <martin@gnome.org>
17501 * ecore.cs (PropertyExpr.PropertyExpr): Call
17502 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17504 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17505 is already a TypeBuilder.
17507 2002-06-27 Martin Baulig <martin@gnome.org>
17509 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17510 `target_type == TypeManager.array_type', not IsAssignableFrom() in
17511 the "from an array-type to System.Array" case. This makes it work
17512 when compiling corlib.
17514 2002-06-27 Martin Baulig <martin@gnome.org>
17516 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17517 non-static PropertyExpr, set its InstanceExpression. This makes
17518 the `ICollection.Count' property work in System/Array.cs.
17520 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
17522 * driver.cs: Made error handling more consistent. Errors now
17523 tracked by Report class, so many methods which used to return int
17524 now return void. Main() now prints success/failure and
17525 errors/warnings message.
17527 Renamed '--probe' compiler argument to '--expect-error'. Removed
17528 the magic number return values (123 and 124). Now, if the
17529 expected error occurs, the compiler exits with success (exit value
17530 0). If the compilation completes without seeing that particular
17531 error, the compiler exits with failure (exit value 1). The
17532 makefile in mcs/errors has been changed to handle the new behaviour.
17534 * report.cs: Made 'expected error' number a property and renamed
17535 it from 'Probe' to 'ExpectedError'.
17537 * genericparser.cs: Removed error handling support, since it is
17538 now all done by Report class.
17540 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17541 class, so parse() no longer returns an int.
17543 * namespace.cs: Use Report.Error instead of GenericParser.error
17545 2002-06-22 Miguel de Icaza <miguel@ximian.com>
17547 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17548 TypeContainer.AddOperator): At the front of the list put the
17549 explicit implementations, so they get resolved/defined first.
17551 2002-06-21 Miguel de Icaza <miguel@ximian.com>
17553 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17554 interface type is implemented by this TypeContainer. Used during
17555 explicit interface implementation.
17557 (Property.Define, Indexer.Define, Method.Define): Validate that
17558 the given interface in the explicit implementation is one of the
17559 base classes for the containing type.
17561 Also if we are explicitly implementing an interface, but there is
17562 no match in the pending implementation table, report an error.
17564 (Property.Define): Only define the property if we are
17565 not explicitly implementing a property from an interface. Use the
17566 correct name also for those properties (the same CSC uses,
17567 although that is really not needed).
17569 (Property.Emit): Do not emit attributes for explicitly implemented
17570 properties, as there is no TypeBuilder.
17572 (Indexer.Emit): ditto.
17574 Hiding then means that we do not really *implement* a pending
17575 implementation, which makes code fail.
17577 2002-06-22 Martin Baulig <martin@gnome.org>
17579 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17580 the return value of Object.GetType(). [FIXME: we need to do this whenever
17581 we get a type back from the reflection library].
17583 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17585 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17587 2002-06-20 Miguel de Icaza <miguel@ximian.com>
17589 * attribute.cs: Return null if we can not look up the type.
17591 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17592 the interface types found.
17594 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17595 interface types found.
17597 * typemanager.cs (GetInterfaces): Make this routine returns alll
17598 the interfaces and work around the lame differences between
17599 System.Type and System.Reflection.Emit.TypeBuilder in the results
17600 result for GetInterfaces.
17602 (ExpandInterfaces): Given an array of interface types, expand and
17603 eliminate repeated ocurrences of an interface. This expands in
17604 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17607 2002-06-21 Martin Baulig <martin@gnome.org>
17609 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17612 2002-06-21 Martin Baulig <martin@gnome.org>
17614 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
17615 and called with one of the core types, return the corresponding typebuilder for
17618 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17621 2002-06-21 Martin Baulig <martin@gnome.org>
17623 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17624 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17625 (Expression.ConvertReferenceExplicit): Likewise.
17627 * expression.cs (ElementAccess.DoResolve): Likewise.
17628 (ElementAccess.DoResolveLValue): Likewise.
17630 2002-06-10 Martin Baulig <martin@gnome.org>
17632 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17633 add the "value" parameter to the parameter list.
17635 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17638 2002-06-19 Miguel de Icaza <miguel@ximian.com>
17640 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17641 the argument to an int, uint, long or ulong, per the spec. Also
17642 catch negative constants in array creation.
17644 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17646 * class.cs: do not allow the same interface to appear twice in
17647 the definition list.
17649 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17651 * ecore.cs: don't use ldlen with System.Array.
17653 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17655 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17657 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17659 * modifiers.cs: produce correct field attributes for protected
17660 internal. Easy fix so miguel can work on ther harder stuff:-)
17662 2002-06-18 Miguel de Icaza <miguel@ximian.com>
17664 * pending.cs: New file. Move the code from class.cs here.
17665 Support clearning the pending flag for all methods (when not doing
17666 explicit interface implementation).
17668 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17670 * rootcontext.cs: added a couple more types needed to bootstrap.
17672 2002-06-17 Miguel de Icaza <miguel@ximian.com>
17674 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17675 constructor in the type, instead of any constructor in the type
17676 hierarchy. Thanks to Paolo for finding this bug (it showed up as
17677 a bug in the Mono runtime when applying the params attribute).
17679 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17680 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17682 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
17684 * expression.cs (Unary.ResolveOperator): Use TypeManager
17685 to resolve the type.
17687 2002-06-13 Ravi Pratap <ravi@ximian.com>
17689 * cs-parser.jay (enum_member_declaration): Pass in the attributes
17692 * enum.cs (AddEnumMember): Add support to store the attributes associated
17693 with each member too.
17695 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17696 field builders too - this takes care of the enum member case.
17698 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
17700 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17701 address-of operator on both value types and pointers.
17703 2002-06-10 Martin Baulig <martin@gnome.org>
17705 * interface.cs (Interface.PopulateIndexer): Add the indexer's
17706 PropertyBuilder to the `property_builders' list.
17708 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17709 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17710 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
17711 find any indexers which are inherited from an interface.
17713 2002-06-09 Martin Baulig <martin@gnome.org>
17715 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17716 the same type as the constant if necessary. There's also a test-130.cs
17719 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17721 * typemanager.cs (TypeManager.ChangeType): Previously known as
17722 Enum.ChangeEnumType().
17724 2002-06-09 Martin Baulig <martin@gnome.org>
17726 * expression.cs (Cast.TryReduce): Added support for consts.
17728 2002-06-08 Ravi Pratap <ravi@ximian.com>
17730 * class.cs (Accessor): Hold attributes information so we can pass
17733 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17734 Modify to pass in attributes attached to the methods.
17736 (add_accessor_declaration, remove_accessor_declaration): Ditto.
17738 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17739 to handle the Accessor kind :-)
17741 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17743 2002-06-08 Martin Baulig <martin@gnome.org>
17745 * expression.cs (Unary.TryReduceNegative): Added support for
17748 2002-06-08 Martin Baulig <martin@gnome.org>
17750 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17751 name can't be found in the `defined_names' - the caller will do a
17752 MemberLookup in this case and thus find methods in System.Enum
17753 such as Enum.IsDefined().
17755 2002-06-08 Martin Baulig <martin@gnome.org>
17757 * enum.cs (Enum.ChangeEnumType): This is a custom version of
17758 Convert.ChangeType() which works with TypeBuilder created types.
17759 (Enum.LookupEnumValue, Enum.Define): Use it here.
17761 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17762 `TypeBuilder.BaseType != null' check.
17763 (TypeContainer.FindMembers): Only lookup parent members if we
17764 actually have a parent.
17765 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17766 (ConstructorInitializer.Resolve): Likewise.
17768 * interface.cs (Interface.FindMembers): Added
17769 `TypeBuilder.BaseType != null' check.
17771 * rootcontext.cs (RootContext.ResolveCore): Added
17772 "System.Runtime.CompilerServices.IndexerNameAttribute" to
17773 classes_second_stage.
17775 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17776 debug_type and trace_type when compiling with --nostdlib.
17778 2002-06-07 Martin Baulig <martin@gnome.org>
17780 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17781 (AddField): Set it to true when adding a non-static field.
17782 (DefineType): Use `have_nonstatic_fields' to find out whether we
17783 have non-static fields, not `Fields != null'.
17785 2002-06-02 Miguel de Icaza <miguel@ximian.com>
17787 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17788 dereferencing a null on the static-field code path)
17790 2002-05-30 Martin Baulig <martin@gnome.org>
17792 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17793 to take command line arguments. Use reflection to call the new
17794 custom `Initialize' function on the symbol writer and pass it the
17795 command line arguments.
17797 * driver.cs (--debug-args): New command line argument to pass command
17798 line arguments to the symbol writer.
17800 2002-05-28 Miguel de Icaza <miguel@ximian.com>
17802 * assign.cs (DoResolve): Forgot to do the implicit conversion to
17803 the target type for indexers and properties. Thanks to Joe for
17806 2002-05-27 Miguel de Icaza <miguel@ximian.com>
17808 * typemanager.cs (MethodFlags): returns the method flags
17809 (Obsolete/ShouldIgnore) that control warning emission and whether
17810 the invocation should be made, or ignored.
17812 * expression.cs (Invocation.Emit): Remove previous hack, we should
17813 not do this on matching a base type, we should do this based on an attribute
17815 Only emit calls to System.Diagnostics.Debug and
17816 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17817 on the command line.
17819 * rootcontext.cs: Global settings for tracing and debugging.
17821 * cs-tokenizer.cs (define): New utility function to track
17822 defines. Set the global settings for TRACE and DEBUG if found.
17824 2002-05-25 Ravi Pratap <ravi@ximian.com>
17826 * interface.cs (Populate*): Pass in the TypeContainer as well as
17827 the DeclSpace as parameters so that we can create EmitContexts and
17828 then use that to apply attributes etc.
17830 (PopulateMethod, PopulateEvent, PopulateProperty)
17831 (PopulateIndexer): Apply attributes everywhere.
17833 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17836 (ApplyAttributes): Update accordingly.
17838 We now apply interface attributes for all members too.
17840 2002-05-26 Miguel de Icaza <miguel@ximian.com>
17842 * class.cs (Indexer.Define); Correctly check if we are explicit
17843 implementation (instead of checking the Name for a ".", we
17844 directly look up if the InterfaceType was specified).
17846 Delay the creation of the PropertyBuilder.
17848 Only create the PropertyBuilder if we are not an explicit
17849 interface implementation. This means that explicit interface
17850 implementation members do not participate in regular function
17851 lookups, and hence fixes another major ambiguity problem in
17852 overload resolution (that was the visible effect).
17854 (DefineMethod): Return whether we are doing an interface
17857 * typemanager.cs: Temporary hack until we get attributes in
17858 interfaces (Ravi is working on that) and we get IndexerName
17859 support in interfaces.
17861 * interface.cs: Register the indexers as properties.
17863 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17864 warning, I have verified that this is a bug in the .NET runtime
17865 (JavaScript suffers of the same problem).
17867 * typemanager.cs (MemberLookup): When looking up members for
17868 interfaces, the parent of an interface is the implicit
17869 System.Object (so we succeed in searches of Object methods in an
17870 interface method invocation. Example: IEnumerable x; x.ToString
17873 2002-05-25 Miguel de Icaza <miguel@ximian.com>
17875 * class.cs (Event): Events should also register if they do
17876 implement the methods that an interface requires.
17878 * typemanager.cs (MemberLookup); use the new GetInterfaces
17881 (GetInterfaces): The code used to lookup interfaces for a type is
17882 used in more than one place, factor it here.
17884 * driver.cs: Track the errors at the bottom of the file, we kept
17887 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17888 instance if the method we are calling is static!
17890 2002-05-24 Miguel de Icaza <miguel@ximian.com>
17892 * attribute.cs (ApplyAttributes): Make this function filter out
17893 the IndexerName attribute (as that attribute in reality is never
17894 applied) and return the string constant for the IndexerName
17897 * class.cs (TypeContainer.Emit): Validate that all the indexers
17898 have the same IndexerName attribute, and if so, set the
17899 DefaultName attribute on the class.
17901 * typemanager.cs: The return value might contain other stuff (not
17902 only methods). For instance, consider a method with an "Item"
17903 property and an Item method.
17905 * class.cs: If there is a problem with the parameter types,
17908 2002-05-24 Ravi Pratap <ravi@ximian.com>
17910 * ecore.cs (ImplicitConversionExists): Wrapper function which also
17911 looks at user defined conversion after making a call to
17912 StandardConversionExists - we need this for overload resolution.
17914 * expression.cs : Update accordingly the various method calls.
17916 This fixes 2 bugs filed against implicit user defined conversions
17918 2002-05-22 Miguel de Icaza <miguel@ximian.com>
17920 * statement.cs: Track the result of the assignment.
17922 2002-05-21 Miguel de Icaza <miguel@ximian.com>
17924 * expression.cs (MemberAccess): Improved error reporting for
17925 inaccessible members.
17927 2002-05-22 Martin Baulig <martin@gnome.org>
17929 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
17930 itself with debugging support.
17932 2002-05-22 Martin Baulig <martin@gnome.org>
17934 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17935 Removed, this isn't needed anymore.
17937 2002-05-20 Martin Baulig <martin@gnome.org>
17939 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17940 be underlying type for an enum.
17942 2002-05-20 Miguel de Icaza <miguel@ximian.com>
17944 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17945 that splits out the loading of just the core types.
17947 * rootcontext.cs (ResolveCore): Split the struct resolution in
17948 two, so we can load the enumeration underlying types before any
17951 * expression.cs (Is): Bandaid until we fix properly Switch (see
17952 bug #24985 for details).
17954 * typemanager.cs (ImplementsInterface): The hashtable will contain
17955 a null if there are no interfaces implemented.
17957 2002-05-18 Miguel de Icaza <miguel@ximian.com>
17959 * cs-parser.jay (indexer_declarator): It is fine to have array
17962 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17964 * typemanager.cs: (RegisterBuilder): New function used to register
17965 TypeBuilders that implement interfaces. Since
17966 TypeBuilder.GetInterfaces (as usual) does not work with lame
17968 (AddUserType): register interfaces.
17970 (ImplementsInterface): Use the builder_to_ifaces hash if we are
17971 dealing with TypeBuilder. Also, arrays are showing up as
17972 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17973 methods can not be invoked on them!
17975 * ecore.cs (ExplicitReferenceConversionExists): Made public.
17976 (ImplicitReferenceConversionExists): Split out from
17977 StandardConversionExists.
17979 * expression.cs (As): We were only implementing one of the three
17980 cases for the as operator. We now implement them all.
17981 (Is): Implement the various other cases for Is as well.
17983 * typemanager.cs (CACHE): New define used to control if we want or
17984 not the FindMembers cache. Seems to have a negative impact on
17985 performance currently
17987 (MemberLookup): Nested types have full acess to
17988 enclosing type members
17990 Remove code that coped with instance/static returns for events, we
17991 now catch this in RealFindMembers.
17993 (RealFindMembers): only perform static lookup if the instance
17994 lookup did not return a type or an event.
17996 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17998 * assign.cs (CompoundAssign): We pass more semantic information
17999 now to Compound Assignments than we did before: now we have all
18000 the information at hand, and now we resolve the target *before* we
18001 do the expression expansion, which allows the "CacheValue" method
18002 to have the effect we intended (before, a [x] += 1 would generate
18003 two differen ArrayAccess expressions from the ElementAccess,
18004 during the resolution process).
18006 (CompoundAssign.DoResolve): Resolve target and original_source here.
18008 2002-05-16 Miguel de Icaza <miguel@ximian.com>
18010 * expression.cs (ArrayAccess): dropped debugging information.
18012 * typemanager.cs: Small bug fix: I was always returning i_members,
18013 instead of one of i_members or s_members (depending on which had
18016 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
18017 method is invoked before any code generation takes place, and it
18018 is a mechanism to inform that the expression will be invoked more
18019 than once, and that the method should use temporary values to
18020 avoid having side effects
18022 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18024 * ecore.cs (Expression.CacheTemporaries): Provide empty default
18027 * expression.cs (Indirection, ArrayAccess): Add support for
18028 CacheTemporaries in these two bad boys.
18030 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18031 ldobj or ldind_ref.
18032 (StoreFromPtr): Handle stobj as well.
18034 * expression.cs (UnaryMutator): Share more code.
18036 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18037 down: I was not tracking the Filter function as well, which
18038 was affecting the results of the cache.
18040 2002-05-15 Miguel de Icaza <miguel@ximian.com>
18042 * attribute.cs: Remove the hack to handle the CharSet property on
18045 2002-05-14 Miguel de Icaza <miguel@ximian.com>
18047 * attribute.cs (DoResolve): More uglyness, we now only try to
18048 resolve the attribute partially, to extract the CharSet
18049 information (only if we are a StructLayout attribute). Otherwise
18051 (GetExtraTypeInfo): Add some code to conditionally kill in the
18052 future this. I am more and more convinced that the .NET
18053 framework has special code to handle the attribute setting on
18056 * expression.cs (IsParamsMethodApplicable): Revert my previous
18057 foreach change here, it was wrong.
18059 2002-05-13 Miguel de Icaza <miguel@ximian.com>
18061 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18062 (pp_expr): do not abort on unknown input, just return.
18063 (eval): abort if there are pending chars.
18065 * attribute.cs (Attribute.Resolve): Positional parameters are
18066 optional. Deal with that case.
18068 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18069 the Ansi/Unicode/Auto information for the type.
18071 (TypeContainer.DefineType): instantiate the EmitContext here, as
18072 we will be using it during the type definition (to resolve
18073 attributes) and during the emit phase.
18075 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18076 to pull type information out of the attributes
18078 (Attribute.Resolve): track the constructor builder, and allow for
18079 multiple invocations (structs and classes will use this).
18081 * ecore.cs (MemberLookupFinal): new version with all the
18082 parameters customizable.
18084 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18085 constructors. Return if the result value is null (as the error
18086 would have been flagged already by MemberLookupFinal)
18088 Do not allow instances of abstract classes or interfaces to be
18091 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18092 We have to compare the assembly property here when dealing with
18093 FamANDAssem and Assembly access modifiers, because we might be
18094 creating an assembly from *modules* (that means that we are not
18095 getting TypeBuilders for types defined in other modules that are
18096 part of this assembly).
18098 (Method.Emit): If the method is marked abstract and has a body,
18101 (TypeContainer.DefineMembers): If both the defined member and the
18102 parent name match are methods, then do not emit any warnings: let
18103 the Method.Define routine take care of flagging warnings. But if
18104 there is a mismatch (method overrides something else, or method is
18105 overriwritten by something, then emit warning).
18107 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18108 set to null, this means `do not check for the return type on the
18111 (Method.Define): set the return type for the method signature to
18112 null, so that we get methods with the same name and parameters and
18113 different return types. This is used to flag warning 114 (you are
18114 hiding a method, and you probably want to use the new/override
18117 * typemanager.cs (MemberLookup): Implemented proper access
18118 control, closing a long standing set of bug reports. The problem
18119 was that the Framework only has two bits: Public and NonPublic,
18120 and NonPublic includes private and protected methods, but we need
18121 to enforce the FamANDAssem, FamOrAssem and Family.
18123 2002-05-11 Miguel de Icaza <miguel@ximian.com>
18125 * statement.cs (GotoCase): Return true: Ammounts to giving up
18126 knowledge on whether we return or not, and letting the other case
18127 be responsible for it.
18129 2002-05-10 Miguel de Icaza <miguel@ximian.com>
18131 * driver.cs: Do not load directories for each file processed, only
18132 do it if there is a pattern.
18134 * ecore.cs: Report readonly assigns here as well, as we might have
18135 been resolved only by MemberAccess.
18137 (SimpleName.SimpleNameResolve): Also be useful for LValue
18138 resolution. We need this to propagate assign to local readonly variables
18140 * typemanager.cs: Use a ptrhashtable for the criteria, because we
18141 do not want to reuse potential criteria memory.
18143 * class.cs (MyEventBuilder): Set reflected_type;
18145 * ecore.cs (Constantify): Added support for constifying bools.
18147 (RootContext.LookupType): Added a cache for values looked up in
18148 the declaration space.
18150 * typemanager.cs (FindMembers): Now is a front-end to
18151 RealFindMembers, and provides a two-level hashtable-based cache to
18154 15% performance improvement: from 22.5 to 19.2 seconds.
18156 * expression.cs (IsParamsMethodApplicable): use foreach.
18157 (Invocation.DoResolve): ditto.
18158 (New.DoResolve): ditto.
18159 (ArrayCreation.DoResolve): ditto.
18161 * ecore.cs (FindMostEncompassingType): use foreach.
18163 * delegate.cs (NewDelegate.DoResolve): Use foreach
18165 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18166 (RemoveMethods): use foreach.
18168 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18169 nested foreach statements instead of for, and also break out of
18170 the inner loop once a match is found.
18172 (Invocation.OverloadResolve): Use foreach, simplify the code.
18174 2002-05-08 Miguel de Icaza <miguel@ximian.com>
18176 * cfold.cs (BinaryFold): During an enumeration evaluation context,
18177 we actually unwrap the expression to allow for extra information
18180 * expression.cs: Use Shr_Un on unsigned operations.
18182 2002-05-08 Ravi Pratap <ravi@ximian.com>
18184 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
18185 applicable operators was not being considered correctly. This closes
18186 the bug Miguel reported.
18188 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18190 * attribute.cs: check that the type derives from System.Attribute
18191 and report the correct error in that case (moved the duplicate code to
18192 its own method, too).
18194 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18196 * attribute.cs: lookup attribute type name as the spec says: first the
18197 bare attribute name and then name + "Attribute" (nant compiles with
18198 mcs after this fix).
18200 2002-05-07 Miguel de Icaza <miguel@ximian.com>
18202 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
18203 Because of the way we parse things, we should try to see if a
18204 UIntConstant can fit in an integer.
18206 2002-05-07 Ravi Pratap <ravi@ximian.com>
18208 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18209 when we are in an explicit context.
18211 (ConvertReferenceExplicit): When converting from Iface type S to Class
18212 T make sure the rules are implemented as an OR.
18214 * parameter.cs (ParameterType): Make it a property for now although the
18215 purpose really isn't anything immediate.
18217 * expression.cs (Is*Applicable): Do better checking on the parameter type
18218 of a ref/out parameter. The ones from the system assemblies are already
18219 marked with the correct type so we don't need to do any correction.
18221 * ecore.cs (StandardConversionExists): Conversion from Interface types to
18222 the object type is standard too so include that.
18224 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18226 * ecore.cs (StandardConversionExists): Augment with missing code:
18227 deal with IntConstant, LongConstants and Enumerations.
18229 * assign.cs: Report the error, instead of failing silently
18231 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18232 typecontainer that they are declared, because the
18233 typecontainer/namespace will have the list of using clauses that
18234 need to be applied.
18236 Assembly Attributes were escaping the normal registration
18239 (EmitCode): Apply attributes within an EmitContext that represents
18240 the container they were declared on.
18242 * cs-parser.jay: Track bases for structs. How did I get this wrong?
18244 2002-05-06 Ravi Pratap <ravi@ximian.com>
18246 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18247 Revamp completely - make much cleaner as we now operate only
18250 (FindMostSpecificSource, FindMostSpecificTarget): New methods
18251 to implement the logic detailed in the spec more correctly.
18253 (UserDefinedConversion): Update accordingly.
18255 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18257 * statement.cs: Return flow analysis information up.
18259 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18262 (token): Do not consume an extra character before calling
18265 2002-05-06 Piers Haken <piersh@friskit.com>
18267 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18269 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18271 * class.cs (Constructor.Emit): Set the IsStatic flag in the
18272 EmitContext during the instance constructor initializer
18273 resolution, to stop access to instance variables.
18275 This is mandated by the spec, last paragraph of the `constructor
18276 initializers' section.
18278 2002-05-05 Miguel de Icaza <miguel@ximian.com>
18280 * cs-parser.jay, class.cs (Accessor): new class used to represent
18281 an accessor (get or set). In the past we used `null' to represent
18282 a missing accessor. But this is ambiguous because there was no
18283 way to tell in abstract indexers/properties if one of them was
18286 Now there is a way of addressing that.
18288 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18289 instead of FindMembers.
18291 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18292 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18294 * attribute.cs: Treat indexers and properties as the same in terms
18295 of applying attributes
18297 * ecore.cs (FindMostEncompassedType): Use statically initialized
18298 EmptyExpressions()s like we do elsewhere to avoid creating useless
18299 objects (and we take this out of the tight loop).
18301 (GetConversionOperators): Move the code to extract the actual
18302 operators to a separate routine to clean things up.
18304 2002-05-04 Miguel de Icaza <miguel@ximian.com>
18306 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18307 events are always registered FieldBuilders.
18309 * class.cs (FieldBase): New class shared by Fields
18311 * delegate.cs: If we are a toplevel delegate, use our full name.
18312 If we are a nested delegate, then only use our tail name.
18314 2002-05-02 Ravi Pratap <ravi@ximian.com>
18316 * expression.cs (IsApplicable): Ensure that we add the "&" to
18317 ref/out types before comparing it with the type of the argument.
18319 (IsParamsMethodApplicable): Ditto.
18321 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
18324 * delegate.cs : Handle the case when we have more than one applicable
18325 method. Flag an error only when we finish checking all.
18327 2002-05-02 Miguel de Icaza <miguel@ximian.com>
18329 * expression.cs: Add support for boolean static initializers.
18331 2002-05-01 Miguel de Icaza <miguel@ximian.com>
18333 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18335 * parameter.cs (ComputeParameterTypes,
18336 ComputeAndDefineParameterTypes): Better error handling: now we
18337 clear the `types' cache if we fail during any of the type lookups.
18338 We also return the status code correctly to our caller
18340 * delegate.cs: If we fail to define a delegate, abort the extra
18343 * expression.cs (Binary.ResolveOperator): for
18344 operator==(object,object) and operator !=(object, object) we also
18345 have to verify that there is an implicit conversion from one to
18348 (ArrayAccess.DoResolve): Array Access can operate on
18351 2002-04-30 Miguel de Icaza <miguel@ximian.com>
18353 * assign.cs (CompoundAssign): A new class used as a "flag" that
18354 the assignment actually is happening as part of a compound
18355 assignment operator.
18357 During compound assignment, a few new rules exist to enable things
18364 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18365 to the type of x) if y is implicitly convertible to the type of x,
18366 and the operator is a builtin operator and the return type of the
18367 operator is explicitly convertible to the type of x.
18369 * rootcontext.cs: Reset warning level to 2. 4 catches various
18370 "interesting" features in mcs, we must clean this up at some
18371 point, but currently am trying to kill other bugs ;-)
18373 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18374 in container classes as well.
18376 * expression.cs (Binary.ResolveOperator): Handle string case
18377 before anything else (as operator overloading does emit an error
18378 before doing anything else).
18380 This code could go away when we move to a table driven model, but
18381 i could not come up with a good plan last night.
18383 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
18385 * typemanager.cs (CSharpName): reimplementation using regex.
18386 * class.cs: added null check for fields in Emit
18387 * rootcontext.cs: set warninglevel to 4
18389 2002-04-29 Miguel de Icaza <miguel@ximian.com>
18391 * typemanager.cs (CSharpName): reimplemented with Lupus
18394 2002-04-28 Miguel de Icaza <miguel@ximian.com>
18396 * statement.cs (If): correclty implement Resolve, because we were
18397 not catching sem errors in there. The same process is needed
18399 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18402 (Statement.Warning_DeadCodeFound): Factorize code.
18403 (While): Report dead code here too.
18405 (Statement): Added Resolve virtual method to allow
18406 for resolution split from the emit code.
18408 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18410 * statement.cs (EmitBoolExpression): No longer try to resolve the
18412 (MakeBoolean): New utility function that resolve, implicitly
18413 converts to boolean and tags the expression.
18416 (If, Do): Implement dead code elimination.
18417 (While): Implement loop inversion
18419 (Do, While, For, If): Resolve the expression prior to calling our
18422 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
18425 - added method Report28 (warning: program has more than one entry point)
18426 - added method IsEntryPoint, implements paragraph 10.1 of the spec
18427 - modified method Method.Define, the part at the end of the method
18429 * rootcontext.cs: added static public Location EntryPointLocation;
18431 * ../errors/cs0028.cs : Add test case for the above warning.
18434 - modified method CSharpName to allow arrays of primitive type to
18435 be printed nicely (e.g. instead of System.Int32[][] it now prints
18437 - added method CSharpSignature: returns the signature of a method
18438 in string format to be used in reporting errors, warnings, etc.
18440 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18443 2002-04-26 Ravi Pratap <ravi@ximian.com>
18445 * delegate.cs (Define): Fix extremely silly bug where I was
18446 setting the type of the 'object' parameter of the BeginInvoke
18447 method to System.IAsyncResult instead of System.Object ;-)
18449 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18451 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18454 (Constructor.Emit): return if we fail to initialize the
18455 constructor. Another door closed!
18457 * expression.cs (New.DoResolve): Improve error message (from -6 to
18458 1501). Use DeclaredOnly lookup to find the exact constructor.
18460 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18461 loop. This is useful.
18463 * cs-parser.jay: Adjust the default parameters so that destructors
18464 have the proper signature.
18466 2002-04-26 Martin Baulig <martin@gnome.org>
18468 * driver.cs (LoadAssembly): If `assembly' contains any characters
18469 which are only valid in path names and not in assembly names
18470 (currently slash, backslash and point), use Assembly.LoadFrom ()
18471 instead of Assembly.Load () on the `assembly' (before iteration
18472 over the link_paths).
18474 2002-04-26 Martin Baulig <martin@gnome.org>
18476 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18478 2002-04-25 Miguel de Icaza <miguel@ximian.com>
18480 * class.cs (Property): use the new typemanager.MemberLookup
18482 (TypeContainer.MemberLookup): Implement using the
18483 TypeManager.MemberLookup now.
18485 * typemanager.cs: Make MemberLookup a function of the TypeManager,
18486 and return MemberInfos, so that these can be used without an
18487 EmitContext (what we had before).
18489 2002-04-24 Miguel de Icaza <miguel@ximian.com>
18491 * expression.cs: Fix the case where the argument to params if the
18492 type of the params. I omitted handling this before. Fixed
18494 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18496 * driver.cs: Call BootCorlib_PopulateCoreType
18498 * class.cs (Property.CheckBase): Check for properties only, not
18501 * interface.cs: Temporary hack: try/catch around the
18502 CustomAttributeBuilder, because I am getting an exception that I
18505 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18506 types whose definitions are required to be there (attributes are
18507 defined before standard types).
18509 Compute definitions as we boot the various types, as they are used
18510 immediately (value_type class will need object_type, but if we do
18511 not initialize object_type, we will pass a null, which will let
18512 the runtime pick the System.Object from the existing corlib, which
18513 is not what we want).
18515 2002-04-22 Patrik Torstensson <totte@labs2.com>
18517 * cs-tokenizer.cs: fixed a number of trim() issues.
18519 2002-04-22 Ravi Pratap <ravi@ximian.com>
18521 * expression.cs (Argument.Type): Ensure that we return the correct
18522 type when we have out or ref parameters [in which case we
18525 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18527 * class.cs (Property, Indexer): Allow extern modifier in there.
18529 * typemanager.cs (InitBaseTypes): Initializes object_type and
18530 value_type, since those will be used early on during the bootstrap
18531 process to compile corlib.
18533 (InitCoreTypes): Move code from here to InitBaseTypes.
18535 2002-04-21 Miguel de Icaza <miguel@ximian.com>
18537 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18538 single-dimension arrays as using the ldlen opcode.
18540 Daniel Lewis discovered this optimization.
18542 * typemanager.cs: Add signature for System.Array::get_Length
18544 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18546 * statement.cs: report the error when the foreach does not apply to an
18547 array nor a collection.
18549 2002-04-19 Miguel de Icaza <miguel@ximian.com>
18551 * expression.cs: Add implicit conversions to the operator ~.
18553 * constant.cs (DecimalConstant.Emit): Emit decimal value.
18555 * typemanager.cs: Locate the decimal constructor.
18557 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18559 * attribute.cs: use the new property of TypeOf.
18560 * expression.cs: added 'get' property around typearg.
18562 These changes fix a build breaker reported by NickD. Is this the
18563 correct way to fix? If not, please, revert my changes and make it
18566 2002-04-17 Miguel de Icaza <miguel@ximian.com>
18568 * attribute.cs: Add support for typeof in attribute invocations.
18569 I am not sure that this is right though.
18571 2002-04-14 Duncan Mak <duncan@ximian.com>
18573 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18574 Binary.Operator.Division case.
18576 2002-04-13 Ravi Pratap <ravi@ximian.com>
18578 * class.cs (DefineType): Ensure that we do a proper check on
18579 attribute types and also register it with the TypeManager.
18581 (TypeContainer.Targets): The default for attribute types is
18582 AttributeTargets.All.
18584 * attribute.cs (ApplyAttributes): Registering the attribute type
18585 is done elsewhere, not when we discover we have a Usage attribute.
18587 2002-04-12 Ravi Pratap <ravi@ximian.com>
18589 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18590 and get rid of is_delegate parameter.
18592 * everywhere : update.
18594 2002-04-12 Ravi Pratap <ravi@ximian.com>
18596 * cs-parser.jay (compilation_unit): Revamp completely to use
18597 some new ideas that I got from Rhys' grammar to solve the problems
18598 with assembly level attributes.
18600 (outer_declaration): New grammar production.
18602 (attribute_sections): Add.
18604 (opt_attributes): Base on attribute_sections
18606 (namespace_declaration): Allow opt_attributes to tackle the case
18607 when we have assembly level attributes - we are clever in this
18610 * attribute.cs (ApplyAttributes): Do not worry about assembly
18611 attributes in the non-global context.
18613 * rootcontext.cs (AddGlobalAttributes): Go back to using this
18614 instead of SetGlobalAttributes.
18616 * class.cs, rootcontext.cs : Ensure we define and generate
18617 attribute types before anything else.
18619 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18620 and flag the new error -20 for the case when the attribute type
18621 does not have valid targets specified. csc does not catch this.
18623 * ../errors/errors.txt : update for error # -20
18625 2002-04-11 Ravi Pratap <ravi@ximian.com>
18627 * support.cs (InternalParameters.ParameterModifier): Do some null
18628 checking and return sane values.
18630 * class.cs (Method.Define): If we are a PInvoke method, ensure
18631 that we are static and extern. Report error # 601
18633 * ../errors/cs0601.cs : Add test case for the above error.
18635 2002-04-07 Ravi Pratap <ravi@ximian.com>
18637 * rootcontext.cs (attribute_types): We need to keep type of
18638 all attribute types separately and emit code for them first.
18640 (RegisterAttribute) : Implement.
18642 * class.cs (DefineType): Check if the current Type is a custom
18643 attribute type and register it accordingly.
18645 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18646 adding the first attribute twice and rename to
18648 (SetGlobalAttributes): this.
18650 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18653 * attribute.cs (ApplyAttributes): Take an additional argument telling us
18654 if we are processing global arguments. Hmm, I am unsure of this.
18656 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18658 * expression.cs: added static array of strings to avoid calling
18659 Enum.ToString () for Operator in Binary. Significant recover of
18662 2002-04-10 Miguel de Icaza <miguel@ximian.com>
18664 * class.cs (FindMembers): Allow the Builders of the various
18665 members to be null. If they are skip them. This only happens
18666 during the PInvoke declaration.
18668 2002-04-09 Miguel de Icaza <miguel@ximian.com>
18670 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18671 failure, so we do not keep going afterwards.
18673 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18674 wanted to pass `false' as the `is_delegate' argument. If this is
18675 the case, why not use delegate_type == null to mean `is_delegate =
18676 false' and anything else as is_delegate = true.
18678 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
18680 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18681 code for the section, not the beginning of the tests.
18683 2002-04-08 Miguel de Icaza <miguel@ximian.com>
18685 * cfold.cs: Handle operator + (Enum x, Underlying x)
18687 * expression.cs (Binary): same. Warn about errors where we have
18688 Enum/Enum in operator + as well.
18690 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
18693 - added support for switch(bool)
18694 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18695 - add TableSwitchEmit() to handle table-based switch statements
18697 2002-04-05 Ravi Pratap <ravi@ximian.com>
18699 * expression.cs (Invocation.OverloadResolve): Factor out code which
18700 does parameter compatibility checking with arguments so that we can
18701 re-use the code even from Delegate.VerifyApplicability
18703 (VerifyArgumentsCompat): Move above code here.
18705 * delegate.cs (VerifyApplicability): Get rid of duplicate code
18706 and instead make a call to the above method.
18708 2002-03-31 Ravi Pratap <ravi@ximian.com>
18710 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18711 We use it to keep track of classes which are attribute types.
18713 2002-04-02 Miguel de Icaza <miguel@ximian.com>
18715 * delegate.cs (Delegate.Define): Correctly define the types in the
18716 presence of fixed and array parameters.
18718 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18721 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18722 include NonPublic after the first iteration.
18724 * class.cs (Indexer.CheckBase): Only check if both parents are
18727 * cs-parser.jay (accessor_body): If empty, set to null.
18729 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18730 same code path here to resolve constants names that we did have in
18731 MemberAccess.DoResolve. There is too much code duplicated here.
18733 2002-04-01 Miguel de Icaza <miguel@ximian.com>
18735 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18737 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18740 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18741 tokens, numbers and strings.
18743 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18746 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18747 asyncronous parameters and the regular parameters.
18749 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18750 specify the target directory.
18752 * expression.cs: (This.DoResolve): Simplify
18753 (As.Emit): Optimize, do not generate IsInst if the expression is
18754 always of the given type.
18756 (Is.DoResolve): Bug fix, we were reporting both always/never for
18759 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18760 creating too many unnecessary arrays.
18762 2002-03-31 Miguel de Icaza <miguel@ximian.com>
18764 * class.cs (EmitFieldInitializer): Use Assign expression to assign
18765 fields instead of rolling our own initializer. Takes care of all
18766 implicit conversions, and drops unnecessary static checks/argument.
18768 2002-03-31 Dick Porter <dick@ximian.com>
18770 * driver.cs: use the GetDirectories() return values properly, and
18771 use "/" as path separator.
18773 2002-03-30 Miguel de Icaza <miguel@ximian.com>
18775 * expression.cs (Unary): Optimize - - expr into expr.
18776 (Binary): Optimize a + (-b) into a -b.
18778 * codegen.cs (CodeGen): Made all methods static.
18780 2002-03-29 Miguel de Icaza <miguel@ximian.com>
18784 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18785 TypeBuilder property.
18787 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18790 * tree.cs: Removed the various RecordXXXX, and replaced with a
18791 single RecordDecl. Removed all the accessor methods, and just
18792 left a single access point Type
18794 * enum.cs: Rename DefineEnum to DefineType.
18796 * decl.cs: New abstract method `DefineType' used to unify the
18797 Defines for Enumerations, Interfaces, TypeContainers and
18800 (FindType): Moved LookupInterfaceOrClass here. Moved the
18801 LookupBaseClasses method that used to live in class.cs and
18802 interface.cs here, and renamed to FindType.
18804 * delegate.cs: Implement DefineType. Take advantage of the
18805 refactored pattern for locating the parent builder without taking
18806 the parent_builder argument (which we know does not work if we are
18807 nested, and triggering a toplevel definition).
18809 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18811 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18812 accessibility of a member has changed during override and report
18815 * class.cs (Method.Define, Property.Define): Only complain on
18816 overrides if the method is private, any other accessibility is
18817 fine (and since we just checked the permission is the same, we are
18820 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18821 and elif are processed always. The other pre-processing
18822 directives are only processed if we are "taking" the path
18824 2002-03-29 Martin Baulig <martin@gnome.org>
18826 * class.cs (Method.Emit): Only emit symbolic debugging info if the
18827 current location is not Null.
18829 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18830 a separate method so we can profile it.
18832 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18833 `span.Seconds' are just seconds, but no minutes or hours.
18834 (MainDriver): Profile the CodeGen.SaveSymbols calls.
18836 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18838 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18839 Remove the gratuitous set of Final:
18841 // If an interface implementation, then we can set Final.
18842 if (((flags & MethodAttributes.Abstract) == 0) &&
18843 implementing.DeclaringType.IsInterface)
18844 flags |= MethodAttributes.Final;
18846 I do not know what I was smoking when I used that.
18849 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18850 step into fixing the name resolution issues for delegates and
18851 unifying the toplevel name resolution.
18853 2002-03-28 Martin Baulig <martin@gnome.org>
18855 * class.cs (Method.Emit): If we have a symbol writer, call its
18856 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18857 tell it about the current method.
18859 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18860 writer that we're going to emit the first byte of IL code for a new
18861 statement (a new source line).
18862 (EmitContext.EmitTopBlock): If we have a symbol writer, call
18863 EmitContext.Mark() before emitting any code.
18865 * location.cs (SymbolDocument): Return null when we're Null.
18867 * statement.cs (Statement): Moved the `Location loc' variable here.
18868 (Statement.EmitBoolExpression): If we have a symbol writer, call
18869 ec.Mark() before emitting any code to tell it that we're at the
18870 beginning of a new statement.
18871 (StatementExpression): Added `Location' argument to the constructor.
18872 (Block): Added public readonly variable `StartLocation' and public
18873 variable `EndLocation'. The latter is to be set using SetEndLocation().
18874 (Block): Added constructor which takes a start and end location.
18875 (Block.SetEndLocation): New method. This sets the end location.
18876 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18877 local variables we create.
18878 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18879 each statement and do also mark the begin and end of the block.
18881 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18882 tell it the current lexer.Location, use Location.Null for the end of the
18884 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18885 current block, set its end location using SetEndLocation().
18886 (statement_expression): StatementExpression constructor now takes the
18887 lexer.Location as additional argument.
18888 (for_statement, declare_local_variables): Likewise.
18889 (declare_local_variables): When creating a new implicit block, use the
18890 new Block constructor and pass it the lexer.Location.
18892 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18894 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18895 members also on the parent interfaces recursively.
18897 2002-03-27 Miguel de Icaza <miguel@ximian.com>
18899 * report.cs: Use new formats, since Gonzalo finished the missing
18902 * expression.cs (Binary.ResolveOperator): added missing operator|
18903 operator& and operator^ for bool/bool.
18905 * cs-parser.jay: CheckDef now takes a Location argument that is
18906 used to report errors more precisly (instead of reporting the end
18907 of a definition, we try to track something which is a lot closer
18908 to the source of the problem).
18910 * cs-tokenizer.cs: Track global token use, so we can properly flag
18911 the use of #define/#undef after the first token has been seen.
18913 Also, rename the reportXXXX to Error_DescriptiveName
18915 * decl.cs (DeclSpace.IsTopLevel): Move property here from
18916 TypeContainer, so that Enum and Interface can use this too.
18918 * class.cs (TypeContainer.LookupInterfaceOrClass,
18919 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18920 `builder' argument. Typically this was used to pass the parent
18921 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18924 The problem is that a nested class could trigger the definition of
18925 a toplevel class, and the builder would be obviously wrong in that
18928 So we drop this argument, and we compute dynamically the
18929 TypeBuilder/ModuleBuilder (the correct information was available
18930 to us anyways from DeclSpace.Parent)
18932 * interface.cs (Interface.DefineInterface): Drop builder
18933 parameter cleanup like class.cs
18935 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
18938 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18941 (Try.Emit): Propagate the returns value from the statement.
18943 (Return.Emit): Even if we are leavning
18945 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18947 * modifiers.cs: Fix the computation of MethodAttributes flags.
18949 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18951 * driver.cs: allow compilation of files that start with '/'.
18952 Add a default case when checking the argument of --target.
18954 2002-03-25 Miguel de Icaza <miguel@ximian.com>
18956 * interface.cs: Implement the same search algorithm for types in
18957 the interface code.
18959 * delegate.cs: Do not allow multiple definition.
18961 * Recovered ChangeLog that got accidentally amputated
18963 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18965 * rootcontext.cs: Load manually enum to allow core classes to
18966 contain enumerations.
18968 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18969 Update to new static methods in TypeManager.
18971 * typemanager.cs (GetMethod, GetConstructor): Use our
18972 implementation of FindMembers to find the members, since during
18973 corlib compilation, the types are TypeBuilders and GetMethod and
18974 GetConstructor do not work.
18976 Make all methods in TypeManager static.
18978 (InitCodeHelpers): Split the functionality from
18979 the InitCodeTypes function.
18981 * driver.cs: Call InitCodeHelpers after we have populated the
18984 * cs-parser.jay (delegate_declaration): we did not used to compute
18985 the delegate name correctly for void delegates.
18987 2002-03-24 Miguel de Icaza <miguel@ximian.com>
18989 * rootcontext.cs (RootContext): Init the interface_resolve_order
18990 and type_container_resolve_order always.
18992 (ResolveCore, BootstrapCorlib_ResolveClass,
18993 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18994 compiler when compiling with --nostdlib
18996 * class.cs (TypeContainer.DefineType): Check that our parent is
18997 not null. This test is most important when we are bootstraping
19000 * codegen.cs: Split out the symbol writing code.
19002 2002-03-25 Martin Baulig <martin@gnome.org>
19004 * driver.cs (-g): Made -g an alias for --debug.
19006 2002-03-24 Martin Baulig <martin@gnome.org>
19008 * codegen.cs (SymbolWriter): New public variable. Returns the
19009 current symbol writer.
19010 (CodeGen): Added `bool want_debugging_support' argument to the
19011 constructor. If true, tell the ModuleBuild that we want debugging
19012 support and ask it for the ISymbolWriter.
19013 (Save): If we have a symbol writer, call it's Close() method after
19014 saving the assembly.
19016 * driver.c (--debug): New command line argument to create a
19017 debugger information file.
19019 * location.cs (SymbolDocument): New public property. Returns an
19020 ISymbolDocumentWriter object for the current source file or null
19021 if we don't have a symbol writer.
19023 2002-03-21 Miguel de Icaza <miguel@ximian.com>
19025 * driver.cs (LoadAssembly): Correctly return when all the paths
19026 have been tried and not before.
19028 * statement.cs (Switch.Emit): return the actual coverage for this
19029 statement (returns/not-returns)
19031 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19032 switch of the statement if we are the last switch section. That
19033 kills two problems: try/catch problems (we used to emit an empty
19034 nop at the end) and switch statements where all branches would
19037 2002-03-19 Miguel de Icaza <miguel@ximian.com>
19039 * driver.cs: Add default assemblies (the equivalent to the
19040 Microsoft CSC.RSP file)
19042 * cs-tokenizer.cs: When updating `cols and setting it to zero,
19043 also update tokens_seen and set it to false.
19045 * driver.cs: Implement --recurse for Mike.
19047 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19048 correctly splitting out the paths.
19050 2002-03-18 Miguel de Icaza <miguel@ximian.com>
19052 * interface.cs (Interface.PopulateProperty): Instead of using
19053 `parent' as the declaration space for the set parameters, use
19056 * support.cs (InternalParameters): InternalParameters constructor
19057 takes a DeclSpace instead of a TypeContainer.
19059 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19060 types are being initialized, load the address of it before calling
19063 (New): Provide a mechanism to disable the generation of local
19064 value type temporaries when the caller will be providing us with
19065 an address to store it.
19067 (ArrayCreation.EmitDynamicInitializers): Use it.
19069 2002-03-17 Miguel de Icaza <miguel@ximian.com>
19071 * expression.cs (Invocation.EmitArguments): Only probe for array
19072 property if there is more than one argument. Sorry about that.
19074 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19075 empty param arrays.
19077 * class.cs (Method.LabelParameters): Fix incorrect code path that
19078 prevented the `ParamArrayAttribute' from being applied to the
19081 2002-03-16 Miguel de Icaza <miguel@ximian.com>
19083 * support.cs (ReflectionParameters): Correctly compute whether the
19084 last argument is a params array. Fixes the problem with
19087 * typemanager.cs: Make the assemblies array always be non-null
19088 (empty, but non-null)
19090 * tree.cs (RecordDecl): New function that abstracts the recording
19091 of names. This reports error 101, and provides a pointer to the
19092 previous declaration. Fixes a crash in the compiler.
19094 * cs-parser.jay (constructor_declaration): Update to new grammar,
19095 and provide a constructor_body that can be empty.
19097 2002-03-15 Miguel de Icaza <miguel@ximian.com>
19099 * driver.cs: Add support for --resources.
19101 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19102 Make all types for the various array helper methods be integer.
19104 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19105 CheckState to ConvCast.
19107 (ConvCast): Now it takes a `checked' state argument, to avoid
19108 depending on the emit context for the conversion, and just using
19109 the resolve time setting.
19111 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19112 instead of Invocation.EmitArguments. We do not emit the original
19113 arguments, instead we emit those which have been converted to
19114 unsigned int expressions.
19116 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19118 * codegen.cs: ditto.
19120 * expression.cs (LocalVariableReference): Drop the use of the
19121 Store function that depended on the variable index.
19123 * statement.cs (VariableInfo): Drop the `Idx' property from this
19124 class, as this is not taking into account the indexes for
19125 temporaries tat we generate during the execution, getting the
19128 * class.cs: First emit class initializers, then call the parent
19131 * expression.cs (Binary): Fix opcode emision.
19132 (UnaryMutator.EmitCode): Support checked code generation
19134 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19135 matches for events for both the Static and Instance scans,
19136 pointing to the same element. Fix that.
19138 2002-03-14 Miguel de Icaza <miguel@ximian.com>
19140 * rootcontext.cs (ResolveTree): Always set the
19141 interface_resolve_order, because nested interfaces will be calling
19144 * class.cs (GetInterfaceOrClass): Track the same resolution
19145 process used by TypeManager.LookupType. This fixes the nested
19146 type lookups in class declarations (separate path from
19149 (TypeContainer.DefineType): Also define nested interfaces.
19150 (TypeContainer.RegisterOrder): New public function used to
19151 register the order in which child interfaces need to be closed.
19153 Nested interfaces need to be closed after their parents have been
19156 * interface.cs (InterfaceAttr): Put all the logic for computing
19157 the interface attribute here.
19159 (DefineInterface): Register our interface order with the
19160 RootContext or with the TypeContainer depending on the case.
19162 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19164 * cs-parser.jay: rework foreach statement to work with the new
19165 changes to the policy on SimpleNames.
19167 * report.cs: support Stacktrace on warnings as well.
19169 * makefile: drop --unsafe and /unsafe from the compile.
19171 2002-03-13 Ravi Pratap <ravi@ximian.com>
19173 * ecore.cs (StandardConversionExists): Modify to take an Expression
19174 as the first parameter. Ensure we do null -> reference type conversion
19177 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19178 temporary Expression objects.
19180 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19182 * interface.cs: workaround bug in method overloading resolution
19183 (there is already a bugzilla bug for it).
19185 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19187 We could also solve this problem by having a separate path for
19188 performing type lookups, instead of DoResolve, we could have a
19189 ResolveType entry point, and only participating pieces of the
19190 production (simplename, deref, array) would implement this.
19192 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19193 signal SimpleName to only resolve type names and not attempt to
19194 resolve anything else.
19196 * expression.cs (Cast): Set the flag.
19198 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19200 * class.cs: Only report 108 if there is no `new' modifier.
19202 * cs-parser.jay: rework foreach statement to work with the new
19203 changes to the policy on SimpleNames.
19205 * report.cs: support Stacktrace on warnings as well.
19207 * makefile: drop --unsafe and /unsafe from the compile.
19209 2002-03-11 Miguel de Icaza <miguel@ximian.com>
19211 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19212 lookups here, instead of doing that at parse time. This means
19213 that our grammar will not introduce `LocalVariableReferences' as
19214 expressions at this point. That solves the problem of code like
19218 static void Main ()
19222 This is only half the fix. The full fix requires parameters to
19223 also be handled in this way.
19225 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19226 makes the use more obvious of the DeclSpace. The
19227 ec.TypeContainer.TypeBuilder is now only used to pull the
19228 TypeBuilder for it.
19230 My theory is that I can get rid of the TypeBuilder completely from
19231 the EmitContext, and have typecasts where it is used (from
19232 DeclSpace to where it matters).
19234 The only pending problem is that the code that implements Aliases
19235 is on TypeContainer, and probably should go in DeclSpace.
19237 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19238 lookups here, instead of doing that at parse time. This means
19239 that our grammar will not introduce `LocalVariableReferences' as
19240 expressions at this point. That solves the problem of code like
19244 static void Main ()
19248 This is only half the fix. The full fix requires parameters to
19249 also be handled in this way.
19251 * class.cs (Property.DefineMethod): When implementing an interface
19252 method, set newslot, when implementing an abstract method, do not
19253 set the flag (before we tried never setting it, or always setting
19254 it, which is the difference).
19255 (Indexer.DefineMethod): same.
19256 (Method.DefineMethod): same.
19258 * ecore.cs: Only set the status used flag if we get back a Field.
19260 * attribute.cs: Temporary hack, so Paolo can keep working.
19262 2002-03-08 Ravi Pratap <ravi@ximian.com>
19264 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19265 the unmanaged type in the case we have a MarshalAs attribute.
19267 (Resolve): Handle the case when we are parsing the special MarshalAs
19268 attribute [we need to store the unmanaged type to use later]
19270 * typemanager.cs (marshal_as_attr_type): Built in type for the
19271 MarshalAs Attribute.
19273 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
19274 on parameters and accordingly set the marshalling info.
19276 2002-03-09 Miguel de Icaza <miguel@ximian.com>
19278 * class.cs: Optimizing slightly by removing redundant code after
19279 we switched to the `NoTypes' return value.
19280 (Property.DefineMethod): use NoTypes here too.
19282 This fixes the bug I introduced in my last batch of changes.
19284 2002-03-05 Ravi Pratap <ravi@ximian.com>
19286 * tree.cs (RecordEnum): Add. We now keep track of enums too.
19288 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19289 Enums since those are types too.
19291 * cs-parser.jay (enum_declaration): Record enums as we parse them.
19293 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
19294 thanks to a call during the lookup process.
19296 2002-03-07 Miguel de Icaza <miguel@ximian.com>
19298 * statement.cs (Foreach): Lots of work to accomodate a particular
19299 kind of foreach statement that I had not kept in mind. It is
19300 possible to have foreachs on classes that provide a GetEnumerator
19301 method that return objects that implement the "pattern" for using
19302 a foreach, there is no need to support GetEnumerator
19305 This is needed to compile nant.
19307 * decl.cs: Only report 114 if the member is not `Finalize' and if
19308 the warning level is at least 2.
19310 * class.cs: Moved the compare function from Method to
19313 (MethodSignature.InheritableMemberSignatureCompare): Add new
19314 filter function that is used to extract inheritable methods from a
19317 (Method.Define): Use the new `inheritable_method_signature_filter'
19320 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19323 2002-03-06 Miguel de Icaza <miguel@ximian.com>
19325 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19327 * cs-parser.jay: Add opt_semicolon to the interface declaration.
19329 * expression.cs: Pass location information to
19330 ConvertImplicitStandard.
19332 * class.cs: Added debugging code to track return values from
19335 2002-03-05 Miguel de Icaza <miguel@ximian.com>
19337 * expression.cs (Is.DoResolve): If either side of the `is' is an
19338 interface, do not flag the warning.
19340 * ecore.cs (ImplicitReferenceConversion): We need a separate test
19343 * report.cs: Allow for --fatal to be used with --probe.
19345 * typemanager.cs (NoTypes): Move the definition for the empty Type
19348 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19350 (TypeContainer.DefineProxy): New function used to proxy to parent
19351 implementations when implementing interfaces.
19352 (TypeContainer.ParentImplements): used to lookup if our parent
19353 implements a public function that is required by an interface.
19354 (TypeContainer.VerifyPendingMethods): Hook this up.
19356 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19357 `modules' and `assemblies' arraylists into arrays. We only grow
19358 these are the very early start up of the program, so this improves
19359 the speedof LookupType (nicely measured).
19361 * expression.cs (MakeByteBlob): Replaced unsafe code with
19362 BitConverter, as suggested by Paolo.
19364 * cfold.cs (ConstantFold.Binary): Special case: perform constant
19365 folding of string concatenation, but if either side is a string,
19366 and the other is not, then return null, and let the runtime use
19367 the concatenation on the string plus the object (using
19368 `Object.ToString').
19370 2002-03-04 Miguel de Icaza <miguel@ximian.com>
19372 Constant Folding has been implemented now.
19374 * expression.cs (Unary.Reduce): Do not throw an exception, catch
19375 the error instead on types that are not supported in one's
19378 * constant.cs (Constant and all children): New set of functions to
19379 perform implict and explicit conversions.
19381 * ecore.cs (EnumConstant): Implement the new functions to perform
19382 conversion by proxying to the child expression.
19384 * codegen.cs: (ConstantCheckState): Constant evaluation has its
19385 own separate setting that can not be turned off from the command
19386 line using --unchecked or --checked and is only controlled using
19387 the checked/unchecked statements and expressions. This setting is
19388 used by the constant folder to flag errors.
19390 * expression.cs (CheckedExpr, UncheckedExpr): Set the
19391 ConstantCheckState as well.
19393 During Resolve, they also have to flag the state, because the
19394 constant folder runs completely in the Resolve phase.
19396 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19399 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19401 * cfold.cs: New file, this file contains the constant folder.
19403 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19404 argument to track whether we are using the resulting address to
19405 load or store a value and provide better error messages.
19407 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19408 new AddressOf arguments.
19410 * statement.cs (Foreach.EmitCollectionForeach): Update
19412 * expression.cs (Argument.Emit): Call AddressOf with proper
19413 arguments to track usage.
19415 (New.DoEmit): Call AddressOf with new arguments.
19417 (Unary.Emit): Adjust AddressOf call.
19419 2002-03-01 Ravi Pratap <ravi@ximian.com>
19421 * cs-parser.jay (member_access): Change the case for pre-defined types
19422 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
19425 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19428 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19429 essentially like methods and apply attributes like MethodImplOptions to them too.
19431 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19434 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19435 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19438 * Update code everywhere accordingly.
19440 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19442 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19444 2002-02-28 Ravi Pratap <ravi@ximian.com>
19446 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19447 try performing lookups against those instead of jumping straight into using
19448 the 'using' clauses.
19450 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19452 (LookupType): Perform lookups in implicit parents too.
19454 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19455 sequence as RootContext.LookupType.
19457 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
19458 the various cases of namespace lookups into this method.
19460 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19462 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19463 in positional arguments)
19465 * class.cs (Operator): Update the AllowedModifiers to contain
19468 * cs-parser.jay: Update operator declaration to allow for the
19469 operator body to be empty.
19471 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19474 2002-02-27 Miguel de Icaza <miguel@ximian.com>
19476 * class.cs (Method.Emit): Label parameters.
19478 * driver.cs: Return 1 or 0 as the program exit code.
19480 2002-02-26 Miguel de Icaza <miguel@ximian.com>
19482 * expression.cs: Special case the `null' object when trying to
19483 auto-compute the type, as anything can be explicitly converted to
19486 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19487 spotting this Paolo.
19489 (Expression.ImplicitNumericConversion): Perform comparissions of
19490 the type using the underlying type in the case of an enumeration
19491 rather than using the enumeration type for the compare.
19493 Cope with the underlying == type case, which is not possible to
19496 (Expression.ConvertNumericExplicit): Perform comparissions of
19497 the type using the underlying type in the case of an enumeration
19498 rather than using the enumeration type for the compare.
19500 * driver.cs: If the user does not supply an extension, assume .exe
19502 * cs-parser.jay (if_statement): Rewrote so that we can track the
19503 location for the if statement.
19505 * expression.cs (Binary.ConstantFold): Only concat strings when
19506 the operation is "+", not everything ;-)
19508 * statement.cs (Statement.EmitBoolExpression): Take a location
19510 (If, While, Do): Track location.
19512 * expression.cs (Binary.ResolveOperator): In the object + string
19513 case, I was missing a call to ConvertImplicit
19515 2002-02-25 Ravi Pratap <ravi@ximian.com>
19517 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19518 Location arguments. Ensure we use RootContext.LookupType to do our work
19519 and not try to do a direct Type.GetType and ModuleBuilder.GetType
19521 * interface.cs (PopulateMethod): Handle the type of the parameter being
19524 * expression.cs (Invocation.BetterFunction): Handle the case when we
19525 have a params method with no fixed arguments and a call is made with no
19528 2002-02-25 Miguel de Icaza <miguel@ximian.com>
19530 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19531 the verbatim-string-literal
19533 * support.cs (InternalParameters.ParameterModifier): handle null
19535 (InternalParameters.ParameterType): ditto.
19537 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19538 duplicating the name of the variable parameter.
19539 (GetParameterByName): Fix bug where we were not looking up array
19540 paramters if they were the only present (thanks Paolo!).
19541 (GetParameterInfo): We only have an empty set of types if both
19542 fixed and array are set to null.
19543 (GetParameterInfo-idx): Handle FixedParameter == null
19545 * cs-parser.jay: Handle the case where there is no catch
19546 statements (missing null test).
19548 2002-02-22 Miguel de Icaza <miguel@ximian.com>
19550 * driver.cs (MainDriver): Be conservative on our command line
19553 Catch DirectoryNotFoundException when calling GetFiles.
19555 (SplitPathAndPattern): Used to split the input specification into
19556 a path and a pattern that we can feed to Directory.GetFiles.
19558 2002-02-21 Miguel de Icaza <miguel@ximian.com>
19560 * statement.cs (Fixed): Implement the last case of the Fixed
19561 statement (string handling).
19563 * expression.cs (StringPtr): New class used to return a char * to
19564 a string; Used by the Fixed statement.
19566 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
19568 * expression.cs (Binary.ResolveOperator): Remove redundant
19569 MemberLookup pn parent type.
19570 Optimize union call, we do not need a union if the types are the same.
19571 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19574 Specialize the use of MemberLookup everywhere, instead of using
19575 the default settings.
19577 (StackAlloc): Implement stackalloc keyword.
19579 * cs-parser.jay: Add rule to parse stackalloc.
19581 * driver.cs: Handle /h, /help, /?
19583 * expression.cs (MakeByteBlob): Removed the hacks we had in place
19584 before we supported unsafe code.
19586 * makefile: add --unsafe to the self compilation of mcs.
19588 2002-02-20 Miguel de Icaza <miguel@ximian.com>
19590 * expression.cs (PointerArithmetic): New class that is used to
19591 perform pointer arithmetic.
19592 (Binary.Resolve): Handle pointer arithmetic
19593 Handle pointer comparission.
19594 (ArrayPtr): Utility expression class that is used to take the
19595 address of an array.
19597 (ElementAccess): Implement array access for pointers
19599 * statement.cs (Fixed): Implement fixed statement for arrays, we
19600 are missing one more case before we are done.
19602 * expression.cs (Indirection): Implement EmitAssign and set the
19603 ExprClass to Variable. This allows pointer dereferences to be
19604 treated as variables, and to have values assigned to them.
19606 * ecore.cs (Expression.StoreFromPtr): New utility function to
19607 store values dereferencing.
19609 2002-02-20 Ravi Pratap <ravi@ximian.com>
19611 * expression.cs (Binary.ResolveOperator): Ensure that we are
19612 not trying to operate on a void type - this fixes the reported
19615 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19616 the parent implementation is sealed.
19618 * ../errors/cs0239.cs : Add.
19620 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19622 * typemanager.cs (unverifiable_code_type): Corresponds to
19623 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19624 which have unsafe code in them.
19626 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
19629 2002-02-19 Miguel de Icaza <miguel@ximian.com>
19631 * cs-tokenizer.cs: Add support for @"litreal strings"
19633 Make tokenizer accept pre-processor directives
19634 on any column (remove the old C-like limitation).
19636 * rootcontext.cs (EmitCode): Emit any global attributes.
19637 (AddGlobalAttributes): Used to keep track of assembly attributes.
19639 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19641 * cs-parser.jay: Add support for global attributes.
19643 2002-02-17 Miguel de Icaza <miguel@ximian.com>
19645 * expression.cs (Indirection): New helper class. Unary will
19646 create Indirection classes to be able to implement the
19647 IMemoryLocation interface on it.
19649 2002-02-16 Miguel de Icaza <miguel@ximian.com>
19651 * cs-parser.jay (fixed_statement): reference the right statement.
19653 * statement.cs (Fixed.Emit): Finish implementing the fixed
19654 statement for the &x case.
19656 2002-02-14 Miguel de Icaza <miguel@ximian.com>
19658 * class.cs (Property.Define, Method.Define): Remove newslot when
19661 * modifiers.cs: My use of NewSlot when `Abstract' was set was
19662 wrong. NewSlot should only be used if the `new' keyword is present.
19664 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19665 locating our system dir. Sorry about this.
19667 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19669 * driver.cs (GetSystemDir): Compute correctly the location of our
19670 system assemblies. I was using the compiler directory instead of
19671 the library directory.
19673 2002-02-13 Ravi Pratap <ravi@ximian.com>
19675 * expression.cs (BetterFunction): Put back in what Miguel commented out
19676 since it is the correct fix. The problem is elsewhere ;-)
19678 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19679 parameters of the parms method are themselves compatible or not !
19681 (StandardConversionExists): Fix very dangerous bug where we were forgetting
19682 to check that a class implements an interface before saying that an implicit
19683 conversion was allowed. Use ImplementsInterface to do the checking.
19685 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19687 * class.cs (Method.Define): Track whether we are an explicit
19688 implementation or not. And only call DefineMethodOverride if we
19689 are an explicit implementation.
19691 (Property.DefineMethod): Ditto.
19693 2002-02-11 Ravi Pratap <ravi@ximian.com>
19695 * expression.cs (BetterFunction): Catch hideous bug which was
19696 preventing us from detecting ambiguous calls due to implicit casts i.e
19699 2002-01-29 Miguel de Icaza <miguel@ximian.com>
19701 * support.cs (Pair): Remove un-needed method. I figured why I was
19702 getting the error in cs-parser.jay, the variable in a foreach loop
19703 is readonly, and the compiler does not really treat this as a variable.
19705 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
19706 instead of EQUALS in grammar.
19708 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19710 * expression.cs (Unary.DoResolve): Check whether the argument is
19713 2002-01-28 Miguel de Icaza <miguel@ximian.com>
19715 * support.cs: Api for Pair to set a value. Despite the fact that
19716 the variables are public the MS C# compiler refuses to compile
19717 code that accesses the field if the variable is part of a foreach
19720 * statement.cs (Fixed): Begin implementation of the fixed
19723 (Block.AddVariable): Return the VariableInfo on success and null
19724 on failure instead of true/false.
19726 * cs-parser.jay (foreach): Catch errors on variables already
19727 defined (we were ignoring this value before) and properly unwind
19728 the block hierarchy
19730 (fixed_statement): grammar for the fixed statement.
19732 2002-01-25 Miguel de Icaza <miguel@ximian.com>
19734 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19735 pointer types to be incretemented.
19737 (SizeOf): Implement.
19739 * cs-parser.jay (pointer_member_access): Implement
19740 expr->IDENTIFIER production.
19742 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19743 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19746 (Unary): Implement indirection.
19748 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19749 use in non-unsafe context).
19751 (SimpleName.DoResolve): Check for pointers in field access on safe
19754 (Expression.LoadFromPtr): Factor the load-indirect code in this
19755 function. This was duplicated in UnboxCast and ParameterReference
19757 2002-01-24 Miguel de Icaza <miguel@ximian.com>
19759 * expression.cs (ComposedCast): report an error if a pointer cast
19760 is used in a safe region.
19762 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19763 pointer type casts in unsafe context.
19765 * codegen.cs (EmitContext): Set up IsUnsafe.
19767 * cs-parser.jay (non_expression_type): Add productions for pointer
19770 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19771 code. We should not use force into static mode if the method is
19772 not virtual. Fixes bug in MIS
19774 * statement.cs (Do.Emit, While.Emit, For.Emit,
19775 Statement.EmitBoolExpression): Add support to Do and While to
19776 propagate infinite loop as `I do return' semantics.
19778 Improve the For case to also test for boolean constants.
19780 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19781 to the list of attributes we can add.
19783 Remove `EmitContext' argument.
19785 * class.cs (Method.Define): Apply parameter attributes.
19786 (Constructor.Define): Apply parameter attributes.
19787 (MethodCore.LabelParameters): Move here the core of labeling
19790 * support.cs (ReflectionParameters.ParameterModifier,
19791 InternalParameters.ParameterModifier): Use IsByRef on the type and
19792 only return the OUT bit for these parameters instead of in/out/ref
19795 This is because I miss-understood things. The ParameterInfo.IsIn
19796 and IsOut represent whether the parameter has the [In] and [Out]
19799 2002-01-22 Miguel de Icaza <miguel@ximian.com>
19801 * ecore.cs (FieldExpr.Emit): Release temporaries.
19803 * assign.cs (LocalTemporary.Release): new function.
19805 * codegen.cs (EmitContext.GetTemporaryStorage,
19806 EmitContext.FreeTemporaryStorage): Rework the way we deal with
19807 temporary storage. Now we can "put back" localbuilders when we
19810 2002-01-21 Miguel de Icaza <miguel@ximian.com>
19812 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19813 need to make a copy of the variable to generate verifiable code.
19815 2002-01-19 Miguel de Icaza <miguel@ximian.com>
19817 * driver.cs: Compute dynamically the system directory.
19819 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19820 Slower, but more generally useful. Used by the abstract
19821 registering implementation.
19823 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19824 the rules for the special rule on Type/instances. First check if
19825 we have the same name, and if so, try that special static path
19826 rather than the instance path.
19828 2002-01-18 Miguel de Icaza <miguel@ximian.com>
19830 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19833 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19834 Enum, ValueType, Delegate or Array for non-corlib compiles.
19836 * cs-tokenizer.cs: Catch long identifiers (645)
19838 * typemanager.cs (IndexerPropetyName): Ravi never tested this
19841 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19842 fix, we were returning too early, so we were not registering
19843 pending methods from abstract classes.
19845 Do not register pending methods if the class is abstract.
19847 * expression.cs (Conditional.DoResolve): Report circular implicit
19848 conversions when we neecd to compute it for conditional
19851 (Is.DoResolve): If the expression is always of the provided type,
19852 flag warning 183. If the expression can not ever be of the
19853 provided type flag warning 184.
19855 * class.cs: Catch 169 as well.
19857 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19860 2002-01-18 Nick Drochak <ndrochak@gol.com>
19862 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
19864 2002-01-17 Miguel de Icaza <miguel@ximian.com>
19866 * interface.cs: (PopulateMethod): Check for pointers being defined
19867 only if the unsafe context is active.
19868 (PopulateProperty): ditto.
19869 (PopulateIndexer): ditto.
19871 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19872 specified. If pointers are present, make sure that they are
19873 present in an unsafe context.
19874 (Constructor, Constructor.Define): ditto.
19875 (Field, Field.Define): ditto.
19876 (Property, Property.Define): ditto.
19877 (Event, Event.Define): ditto.
19879 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19880 hashtable if there are classes or structs defined.
19882 * expression.cs (LocalVariableReference.DoResolve): Simplify this
19883 code, as the constant resolution moved.
19885 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19886 the metadata, so we can flag error 133.
19888 * decl.cs (MemberCore.UnsafeOK): New function to test that a
19889 pointer is being declared in an unsafe context.
19891 2002-01-16 Miguel de Icaza <miguel@ximian.com>
19893 * modifiers.cs (Modifiers.Check): Require a Location argument.
19894 Report error 227 for Unsafe use.
19896 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19898 * statement.cs (For.Emit): If the test is null, then report that
19899 we do `return', as we wont reach anything afterwards.
19901 (Switch.SwitchGoverningType): Track the expression that matched
19904 * driver.cs: Allow negative numbers as an error code to flag.
19906 * cs-parser.jay: Handle 1551.
19908 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19910 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19912 * cs-parser.jay: Report 1518 (type declaration can only contain
19913 class, struct, interface, enum or delegate)
19915 (switch_label): Report 1523 (keywords `case' or `default' must
19918 (opt_switch_sections): Report 1522 (empty switch)
19920 * driver.cs: Report 1515 (response file specified multiple times)
19921 Report 1516 (Source file specified multiple times).
19923 * expression.cs (Argument.Resolve): Signal 1510
19925 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19926 access not allowed in static code)
19928 2002-01-11 Ravi Pratap <ravi@ximian.com>
19930 * typemanager.cs (IsPointerType): Utility method which we are going
19933 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19934 the object type, so we take care of that.
19936 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19938 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19939 added to non-params parameters :-)
19941 * typemanager.cs (CSharpName): Include 'void' type too.
19943 (void_ptr_type): Include in the set of core types.
19945 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
19948 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
19951 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
19952 completely forgotten about it.
19954 2002-01-10 Ravi Pratap <ravi@ximian.com>
19956 * cs-parser.jay (pointer_type): Add. This begins our implementation
19957 of parsing rules for unsafe code.
19959 (unsafe_statement): Implement.
19961 (embedded_statement): Modify to include the above.
19963 * statement.cs (Unsafe): Implement new class for unsafe blocks.
19965 * codegen.cs (EmitContext.InUnsafe): Add. This determines
19966 if the current context is an unsafe one.
19968 * cs-parser.jay (local_variable_pointer_type): Since local variable types
19969 are handled differently, we need separate rules for them.
19971 (local_variable_declaration): Update to use local_variable_pointer_type
19972 to allow variable declarations of unmanaged pointer types.
19974 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19975 in unsafe contexts.
19977 * ../errors/cs0214.cs : Add.
19979 2002-01-16 Nick Drochak <ndrochak@gol.com>
19981 * makefile: remove 'response' file when cleaning.
19983 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19985 * cs-parser.jay: Report 1524.
19987 2002-01-14 Miguel de Icaza <miguel@ximian.com>
19989 * typemanager.cs (RegisterMethod): drop checking if we have
19990 registered this from here
19992 2002-01-12 Miguel de Icaza <miguel@ximian.com>
19994 * class.cs (Method.EmitDestructor): Implement calling our base
19997 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19998 value of InFinally.
20000 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20001 this routine and will wrap the call in a try/catch block. Deal
20004 2002-01-11 Miguel de Icaza <miguel@ximian.com>
20006 * ecore.cs (Expression.MemberLookup): instead of taking a
20007 parameter `same_type' that was used to tell whether we could
20008 access private members we compute our containing type from the
20011 (FieldExpr): Added partial support for volatile fields. This does
20012 not work for volatile fields exposed from assemblies, as I can not
20013 figure out how to extract the modreq from it.
20015 Updated all the source files to use this.
20017 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20018 because it is referenced by MemberLookup very often.
20020 2002-01-09 Ravi Pratap <ravi@ximian.com>
20022 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20023 TypeBuilder.GetCustomAttributes to retrieve what we need.
20025 Get rid of redundant default_member_attr_type as this is the same as
20026 default_member_type which already exists.
20028 * interface.cs, attribute.cs : Update accordingly.
20030 2002-01-08 Miguel de Icaza <miguel@ximian.com>
20032 * typemanager.cs: Enable IndexerPropertyName again. It does not
20033 work for TYpeBuilders though. Ravi, can you please fix this?
20035 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20037 * expression.cs (Argument.Emit): Handle the case of ref objects
20038 being passed to ref functions;
20040 (ParameterReference.EmitLoad): Loads the content of the pointer
20041 without dereferencing.
20043 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20045 * cs-tokenizer.cs: Implemented the pre-processing expressions.
20047 2002-01-08 Ravi Pratap <ravi@ximian.com>
20049 * class.cs (Indexer.DefineMethod): Incorporate the interface
20050 type in the name of the method if we are doing explicit interface
20053 * expression.cs (ConversionExists): Remove as it is completely obsolete.
20055 (BetterConversion): Fix extremely trivial bug where we were referring to
20056 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20059 * ../errors/bug16.cs : Add although we have fixed it.
20061 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20063 * expression.cs (BaseIndexer): Begin implementation.
20065 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20067 * cs-parser.jay (indexer_declarator): Use qualified_identifier
20068 production directly to remove a shift/reduce, and implement
20069 explicit interface implementation.
20071 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20072 after a floating point suffix.
20074 * expression.cs (DoNumericPromotions): Improved the conversion for
20075 uint/uint. If we have a constant, we avoid doing a typecast to a
20078 * class.cs (Indexer): Implement explicit interface implementation
20081 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20083 * class.cs: make the default instance constructor public and hidebysig.
20085 2001-01-03 Ravi Pratap <ravi@ximian.com>
20087 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20088 so we can call it from elsewhere.
20090 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20091 we emit it internally if the class has a defined indexer; otherwise the user
20092 emits it by decorating the class definition with the DefaultMemberAttribute.
20094 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20095 attribute is not used on a type which defines an indexer.
20097 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20098 character when we skip whitespace.
20100 * ../errors/cs0646.cs : Add.
20102 2002-01-03 Miguel de Icaza <miguel@ximian.com>
20104 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20107 * makefile: Add practical target `mcs3.exe' which builds the third
20108 generation compiler.
20110 * expression.cs (New): Fix structures constructor calling.
20112 * class.cs (Property, Method, Indexer): Emit Final flag on the
20113 method if we are an interface implementation and we are not
20116 * ecore.cs (PropertyExpr): New public field `IsBase', tells
20117 whether this property is referencing a `base' method.
20119 * expression.cs (Invocation.EmitCall): take an extra argument:
20120 is_base, this is used to determine whether the `call' or
20121 `callvirt' opcode should be used.
20124 * delegate.cs: update EmitCall.
20126 * class.cs (Method.Define): Set NewSlot for the cases where we are
20127 not implementing an interface method.
20129 (Property.Define): ditto.
20131 2002-01-02 Miguel de Icaza <miguel@ximian.com>
20133 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20134 'r'. Allows mcs to parse itself fully.
20136 2002-01-02 Ravi Pratap <ravi@ximian.com>
20138 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20139 of the number of initializers that require the InitializeArray method.
20141 (CheckIndices): Store the Expression in all cases - not the plain value. Also
20142 update the above field where necessary.
20144 (MakeByteBlob): Update accordingly.
20146 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
20149 (EmitDynamicInitializers): Update in accordance with the new optimization.
20151 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20152 same OpCode applies.
20154 * cs-parser.jay : Fix some glaring errors I introduced.
20156 2002-01-01 Ravi Pratap <ravi@ximian.com>
20158 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20159 so that we can check for name clashes there too.
20161 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20162 for interface indexers.
20164 * interfaces.cs (Define): Emit the default member attribute.
20166 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20167 variable was being referred to while setting the value ;-)
20169 2002-01-01 Miguel de Icaza <miguel@ximian.com>
20171 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20172 byte-by-byte information when we know the data is zero.
20174 Make the block always a multiple of 4, because
20175 DefineInitializedData has a bug.
20177 * assign.cs: Fix, we should assign from the temporary, not from
20180 * expression.cs (MakeByteBlob): Fix my incorrect code.
20182 2001-12-31 Miguel de Icaza <miguel@ximian.com>
20184 * typemanager.cs (EnumToUnderlying): This function is used to get
20185 the underlying type from an enumeration, because it does not
20188 * constant.cs: Use the I4_S form for values between -128 and 127.
20190 * statement.cs (Block.LookupLabel): Looks up a label.
20191 (Block): Drop support for labeled blocks.
20193 (LabeledStatement): New kind of statement that represents a label
20196 (Goto): Finally implement this bad boy.
20198 * cs-parser.jay: Update to reflect new mechanism to implement
20201 2001-12-30 Miguel de Icaza <miguel@ximian.com>
20203 * codegen.cs (EmitContext.This): a codegen property that keeps the
20204 a single instance of this instead of creating many different this
20207 * delegate.cs (Delegate.DoResolve): Update to use the property;
20209 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20211 * expression.cs (BaseAccess.DoResolve): Ditto.
20213 2001-12-29 Ravi Pratap <ravi@ximian.com>
20215 * typemanager.cs (methodimpl_attr_type): Add to hold the type
20216 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20218 (InitCoreTypes): Update accordingly.
20220 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20221 so we can quickly store the state.
20223 (ApplyAttributes): Set the correct implementation flags
20224 for InternalCall methods.
20226 2001-12-29 Miguel de Icaza <miguel@ximian.com>
20228 * expression.cs (EmitCall): if a method is not virtual, then do
20229 not use callvirt on it.
20231 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20232 user defined stuff) requires the use of stobj, which takes an
20233 address on the stack instead of an array and an index. So emit
20234 the Ldelema operation for it.
20236 (EmitStoreOpcode): Use stobj for valuetypes.
20238 (UnaryMutator.EmitCode): Use the right 1 value depending on
20239 whether we are dealing with int64/uint64, float or doubles.
20241 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20242 constructors that I implemented last night.
20244 (Constructor.IsDefault): Fix to work properly for static
20247 * cs-parser.jay (CheckDef): report method signature errors.
20248 Update error number 103 to be 132.
20250 * decl.cs: New AdditionResult enumeration value: MethodExists.
20251 Although we do this check for methods later on in the semantic
20252 analysis, catching repeated default constructors is so easy that
20253 we catch these here.
20255 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20258 (ParameterReference.EmitAssign, Emit): handle
20261 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20262 (ArrayAccess.EmitStoreOpcode): ditto.
20264 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20266 * expression.cs (MakeByteBlob): Complete all the missing types
20267 (uint, short, ushort, byte, sbyte)
20269 * class.cs: Only init instance field initializers on instance
20272 Rename `constructors' to instance_constructors.
20274 (TypeContainer.AddConstructor): Only add constructors to the list
20275 if it is not static.
20277 Make sure that we handle default_static_constructor independently
20278 everywhere where we handle instance_constructors
20280 2001-12-28 Miguel de Icaza <miguel@ximian.com>
20282 * class.cs: Do not lookup or create a base initializer for a
20283 static constructor.
20285 (ConstructorInitializer.Resolve): use the proper type to lookup
20288 * cs-parser.jay: Report error 1585 (modifiers between type and name).
20290 * enum.cs, interface.cs: Remove CloseType, this is taken care by
20293 * decl.cs: CloseType is now an virtual method, the default
20294 implementation just closes this type.
20296 2001-12-28 Ravi Pratap <ravi@ximian.com>
20298 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20299 to PreserveSig by default. Also emit HideBySig on such methods.
20301 Basically, set the defaults to standard values.
20303 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20304 argument, if candidate is better, it can't be worse than the best !
20306 (Invocation): Re-write bits to differentiate between methods being
20307 applicable in their expanded form and their normal form - for params
20310 Get rid of use_standard everywhere as only standard conversions are allowed
20311 in overload resolution.
20313 More spec conformance.
20315 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20317 * driver.cs: Add --timestamp, to see where the compiler spends
20320 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20321 `this' in static code.
20323 (SimpleName.DoResolve): Implement in terms of a helper function
20324 that allows static-references to be passed upstream to
20327 (Expression.ResolveWithSimpleName): Resolve specially simple
20328 names when called by MemberAccess to implement the special
20331 (Expression.ImplicitReferenceConversion): Handle conversions from
20332 Null to reference types before others, as Null's type is
20335 * expression.cs (Invocation.EmitCall): Handle the special case of
20336 calling methods declared on a reference type from a ValueType
20337 (Base classes System.Object and System.Enum)
20339 (MemberAccess.Resolve): Only perform lookups on Enumerations if
20340 the left hand side is a TypeExpr, not on every enumeration.
20342 (Binary.Resolve): If types are reference types, then do a cast to
20343 object on operators != and == of both arguments.
20345 * typemanager.cs (FindMembers): Extract instance and static
20346 members if requested.
20348 * interface.cs (PopulateProperty): Use void_type instead of null
20349 as the return type for the setter method.
20351 (PopulateIndexer): ditto.
20353 2001-12-27 Ravi Pratap <ravi@ximian.com>
20355 * support.cs (ReflectionParameters): Fix minor bug where we
20356 were examining the wrong parameter for the ParamArray attribute.
20358 Cope with requests for the type of the parameter at position
20359 greater than the params parameter's. We now return the element
20360 type of the params array as that makes more sense.
20362 * expression.cs (Invocation.IsParamsMethodApplicable): Update
20363 accordingly as we no longer have to extract the element type
20366 (Invocation.OverloadResolve): Update.
20368 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20370 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20371 against IEnumerator, test whether the return value is a descendant
20372 of the IEnumerator interface.
20374 * class.cs (Indexer.Define): Use an auxiliary method to implement
20375 the other bits of the method definition. Begin support for
20376 explicit interface implementation.
20378 (Property.DefineMethod): Use TypeManager.void_type instead of null
20379 for an empty return value.
20381 2001-12-26 Miguel de Icaza <miguel@ximian.com>
20383 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20384 dealing with a FieldExpr which is composed of a FieldBuilder, in
20385 the code path we did extract the constant, but we should have
20386 obtained the underlying value to be able to cast it (otherwise we
20387 end up in an infinite loop, this is what Ravi was running into).
20389 (ArrayCreation.UpdateIndices): Arrays might be empty.
20391 (MemberAccess.ResolveMemberAccess): Add support for section
20392 14.5.4.1 that deals with the special case of E.I when E is a type
20393 and something else, that I can be a reference to a static member.
20395 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20396 handle a particular array type to create byte blobs, it is just
20397 something we dont generate byteblobs for.
20399 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20402 * location.cs (Push): remove the key from the hashtable that we
20403 are about to add. This happens for empty files.
20405 * driver.cs: Dispose files after we have parsed them.
20407 (tokenize): new function that only runs the tokenizer on its
20408 input, for speed testing.
20410 2001-12-26 Ravi Pratap <ravi@ximian.com>
20412 * class.cs (Event.Define): Define the private field only if there
20413 are no accessors defined.
20415 * expression.cs (ResolveMemberAccess): If there is no associated
20416 field with the event, that means we have an event defined with its
20417 own accessors and we should flag error cs0070 since transforming
20418 ourselves into a field is not valid in that case.
20420 * ecore.cs (SimpleName.DoResolve): Same as above.
20422 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20423 and charset to sane values.
20425 2001-12-25 Ravi Pratap <ravi@ximian.com>
20427 * assign.cs (DoResolve): Perform check on events only if they
20428 are being accessed outside the declaring type.
20430 * cs-parser.jay (event_declarations): Update rules to correctly
20431 set the type of the implicit parameter etc.
20433 (add_accessor, remove_accessor): Set current local parameters.
20435 * expression.cs (Binary): For delegate addition and subtraction,
20436 cast the return value from the method into the appropriate delegate
20439 2001-12-24 Ravi Pratap <ravi@ximian.com>
20441 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20442 of these as the workaround is unnecessary.
20444 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20445 delegate data - none of that is needed at all.
20447 Re-write bits to extract the instance expression and the delegate method
20450 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
20453 * attribute.cs (ApplyAttributes): New method to take care of common tasks
20454 of attaching attributes instead of duplicating code everywhere.
20456 * everywhere : Update code to do attribute emission using the above method.
20458 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20460 * expression.cs (IsParamsMethodApplicable): if there are not
20461 parameters, return immediately.
20463 * ecore.cs: The 0 literal can be implicity converted to an enum
20466 (SimpleName.DoResolve): First lookup the type, then lookup the
20469 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20470 want to get its address. If the InstanceExpression is not
20471 addressable, store the result in a temporary variable, then get
20474 * codegen.cs: Only display 219 errors on warning level or above.
20476 * expression.cs (ArrayAccess): Make it implement the
20477 IMemoryLocation interface.
20479 (Binary.DoResolve): handle the operator == (object a, object b)
20480 and operator != (object a, object b) without incurring into a
20481 BoxedCast (because 5 != o should never be performed).
20483 Handle binary enumerator operators.
20485 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20486 value type, otherwise use Ldelem_ref.
20488 Use precomputed names;
20490 (AddressOf): Implement address of
20492 * cs-parser.jay (labeled_statement): Fix recursive block
20493 addition by reworking the production.
20495 * expression.cs (New.DoEmit): New has a special case:
20497 If we are dealing with a ValueType, we have a few
20498 situations to deal with:
20500 * The target of New is a ValueType variable, that is
20501 easy, we just pass this as the variable reference
20503 * The target of New is being passed as an argument,
20504 to a boxing operation or a function that takes a
20507 In this case, we need to create a temporary variable
20508 that is the argument of New.
20511 2001-12-23 Ravi Pratap <ravi@ximian.com>
20513 * rootcontext.cs (LookupType): Check that current_type is not null before
20514 going about looking at nested types.
20516 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20517 not implement the IAssignMethod interface any more.
20519 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20520 where we tranform them into FieldExprs if they are being resolved from within
20521 the declaring type.
20523 * ecore.cs (SimpleName.DoResolve): Do the same here.
20525 * assign.cs (DoResolve, Emit): Clean up code considerably.
20527 * ../errors/bug10.cs : Add.
20529 * ../errors/cs0070.cs : Add.
20531 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20533 * assign.cs : Get rid of EventIsLocal everywhere.
20535 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20537 * ecore.cs (ConvertIntLiteral): finished the implementation.
20539 * statement.cs (SwitchLabel): Convert the value we are using as a
20540 key before looking up the table.
20542 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20544 * codegen.cs (EmitTopBlock): Require a Location argument now.
20546 * cs-parser.jay (constructor_declarator): We need to setup
20547 current_local_parameters before we parse the
20548 opt_constructor_initializer, to allow the variables to be bound
20549 to the constructor arguments.
20551 * rootcontext.cs (LookupType): First lookup nested classes in our
20552 class and our parents before we go looking outside our class.
20554 * expression.cs (ConstantFold): Extract/debox the values at the
20557 * rootcontext.cs (EmitCode): Resolve the constants first before we
20558 resolve the types. This is not really needed, but it helps debugging.
20560 * statement.cs: report location.
20562 * cs-parser.jay: pass location to throw statement.
20564 * driver.cs: Small bug fix.
20566 * report.cs: Updated format to be 4-zero filled digits.
20568 2001-12-22 Ravi Pratap <ravi@ximian.com>
20570 * expression.cs (CheckIndices): Fix minor bug where the wrong
20571 variable was being referred to ;-)
20573 (DoEmit): Do not call EmitStaticInitializers when the
20574 underlying type is System.Object.
20576 2001-12-21 Ravi Pratap <ravi@ximian.com>
20578 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20579 and do the usual workaround for SRE.
20581 * class.cs (MyEventBuilder.EventType): New member to get at the type
20582 of the event, quickly.
20584 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20586 * assign.cs (Assign.DoResolve): Handle the case when the target
20587 is an EventExpr and perform the necessary checks.
20589 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20592 (SimpleName.MemberStaticCheck): Include check for EventExpr.
20594 (EventExpr): Set the type in the constructor itself since we
20595 are meant to be born fully resolved.
20597 (EventExpr.Define): Revert code I wrote earlier.
20599 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20600 instance expression is null. The instance expression is a This in that case
20601 or a null, depending on whether it is a static method or not.
20603 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20604 refers to more than one method.
20606 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20607 and accordingly flag errors.
20609 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20611 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20613 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20615 * location.cs (ToString): Provide useful rutine.
20617 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20619 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20620 objects, return the actual integral boxed.
20622 * statement.cs (SwitchLabel): define an ILLabel for each
20625 (Switch.CheckSwitch): If the value is a Literal, extract
20626 the underlying literal.
20628 Also in the unused hashtable we had, add the SwitchLabel so we can
20629 quickly look this value up.
20631 * constant.cs: Implement a bunch of new constants. Rewrite
20632 Literal based on this. Made changes everywhere to adapt to this.
20634 * expression.cs (Expression.MakeByteBlob): Optimize routine by
20635 dereferencing array only once, and also copes with enumrations.
20637 bytes are two bytes wide, not one.
20639 (Cast): Perform constant conversions.
20641 * ecore.cs (TryImplicitIntConversion): Return literals instead of
20642 wrappers to the literals here.
20644 * expression.cs (DoNumericPromotions): long literals can converted
20645 to ulong implicity (this is taken care of elsewhere, but I was
20646 missing this spot).
20648 * ecore.cs (Expression.Literalize): Make the return type Literal,
20649 to improve type checking.
20651 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20653 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20655 * literal.cs: Revert code from ravi that checked the bounds. The
20656 bounds are sane by the definition of the type itself.
20658 * typemanager.cs: Fix implementation of ImplementsInterface. We
20659 need to actually look up in our parent hierarchy for interfaces
20662 * const.cs: Use the underlying type for enumerations
20664 * delegate.cs: Compute the basename for the delegate creation,
20665 that should fix the delegate test case, and restore the correct
20666 Type Lookup semantics in rootcontext
20668 * rootcontext.cs: Revert Ravi's last patch. The correct way of
20669 referencing a nested type with the Reflection API is using the "+"
20672 * cs-parser.jay: Do not require EOF token at the end.
20674 2001-12-20 Ravi Pratap <ravi@ximian.com>
20676 * rootcontext.cs (LookupType): Concatenate type names with
20677 a '.' instead of a '+' The test suite passes again.
20679 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20680 field of the enumeration.
20682 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20683 the case when the member is an EventExpr.
20685 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20686 static has an associated instance expression.
20688 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20690 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20692 * class.cs (Event.Define): Register event and perform appropriate checks
20695 We define the Add and Remove methods even if the use provides none because
20696 in that case, we provide default implementations ourselves.
20698 Define a private field of the type of the event. This is done by the CSC compiler
20699 and we should be doing it too ;-)
20701 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20702 More methods we use in code we generate.
20704 (multicast_delegate_type, delegate_type): Two separate types since the distinction
20707 (InitCoreTypes): Update accordingly for the above.
20709 * class.cs (Event.Emit): Generate code for default accessors that we provide
20711 (EmitDefaultMethod): Do the job in the above.
20713 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
20716 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20718 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20719 builders even if we were missing one.
20721 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20722 pass the Basename as our class name instead of the Name. The
20723 basename will be correctly composed for us.
20725 * parameter.cs (Paramters): Now takes a Location argument.
20727 * decl.cs (DeclSpace.LookupType): Removed convenience function and
20728 make all the code call directly LookupType in RootContext and take
20729 this chance to pass the Location information everywhere.
20731 * Everywhere: pass Location information.
20733 2001-12-19 Miguel de Icaza <miguel@ximian.com>
20735 * class.cs (Constructor.Define): Updated way of detecting the
20736 length of the parameters.
20738 (TypeContainer.DefineType): Use basename as the type name for
20741 (TypeContainer.Define): Do not recursively define types here, as
20742 definition is taken care in order by the RootContext.
20744 * tree.cs: Keep track of namespaces in a per-file basis.
20746 * parameter.cs (Parameter.ComputeSignature): Update to use
20749 (Parameters.GetSignature): ditto.
20751 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20752 instead of a TypeContainer.
20754 (Interface.SemanticAnalysis): Use `this' instead of our parent to
20755 resolve names. Because we need to be resolve in our context, not
20758 * driver.cs: Implement response files.
20760 * class.cs (TypeContainer.DefineType): If we are defined, do not
20761 redefine ourselves.
20763 (Event.Emit): Emit the code for add/remove handlers.
20764 (Event.Define): Save the MethodBuilders for add/remove.
20766 * typemanager.cs: Use pair here too.
20768 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20769 DictionaryEntry requires the first argument to be non-null.
20771 (enum_declaration): Compute full name for registering the
20774 (delegate_declaration): Instead of using
20775 formal_parameter_list, use opt_formal_parameter_list as the list
20778 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20779 (EventParsing): New property that controls whether `add' and
20780 `remove' are returned as tokens or identifiers (for events);
20782 2001-12-19 Ravi Pratap <ravi@ximian.com>
20784 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20785 use MyEventBuilder only and let it wrap the real builder for us.
20787 (MyEventBuilder): Revamp constructor etc.
20789 Implement all operations that we perform on EventBuilder in precisely the same
20792 (FindMembers): Update to use the EventBuilder member.
20794 (Event.Emit): Update accordingly.
20796 2001-12-18 Ravi Pratap <ravi@ximian.com>
20798 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20799 by calling the appropriate methods.
20801 (GetCustomAttributes): Make stubs as they cannot possibly do anything
20804 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20806 2001-12-17 Ravi Pratap <ravi@ximian.com>
20808 * delegate.cs (Delegate.Populate): Check that the return type
20809 and various parameters types are indeed accessible.
20811 * class.cs (Constructor.Define): Same here.
20813 (Field.Define): Ditto.
20815 (Event.Define): Ditto.
20817 (Operator.Define): Check that the underlying Method defined itself
20818 correctly - so it's MethodBuilder should not be null.
20820 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20821 expression happens to be null.
20823 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20824 members but as of now we don't seem to be able to do anything really useful with it.
20826 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20827 not the EventBuilder.
20829 2001-12-18 Miguel de Icaza <miguel@ximian.com>
20831 * cs-tokenizer.cs: Add support for defines.
20832 Add support for #if, #elif, #else, #endif
20834 (eval_var): evaluates a variable.
20835 (eval): stubbed for evaluating functions.
20837 * cs-parser.jay: Pass the defines information
20839 * driver.cs: Add --define command line option.
20841 * decl.cs: Move MemberCore here.
20843 Make it the base class for DeclSpace. This allows us to catch and
20844 report 108 and 109 for everything now.
20846 * class.cs (TypeContainer.Define): Extract all the members
20847 before populating and emit the warning 108 (new keyword required
20848 to override) instead of having each member implement this.
20850 (MemberCore.Define): New abstract method, we will be using this in
20851 the warning reporting engine in Populate.
20853 (Operator.Define): Adjust to new MemberCore protocol.
20855 * const.cs (Const): This does not derive from Expression, it is a
20856 temporary object we use to create fields, it is a MemberCore.
20858 * class.cs (Method.Define): Allow the entry point to be in a
20861 * driver.cs: Rewrite the argument handler to clean it up a bit.
20863 * rootcontext.cs: Made it just an auxiliary namespace feature by
20864 making everything static.
20866 * driver.cs: Adapt code to use RootContext type name instead of
20869 * delegate.cs: Remove RootContext argument.
20871 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20874 * class.cs (Event.Define): The lookup can fail.
20876 * cs-tokenizer.cs: Begin implementation of pre-procesor.
20878 * expression.cs: Resolve the this instance before invoking the code.
20880 2001-12-17 Miguel de Icaza <miguel@ximian.com>
20882 * cs-parser.jay: Add a production in element_access that allows
20883 the thing to become a "type" reference. This way we can parse
20884 things like "(string [])" as a type.
20886 Note that this still does not handle the more complex rules of
20890 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
20892 * ecore.cs: (CopyNewMethods): new utility function used to
20893 assemble the list of methods from running FindMembers.
20895 (MemberLookup): Rework FindMembers so that
20897 2001-12-16 Miguel de Icaza <miguel@ximian.com>
20899 * class.cs (TypeContainer): Remove Delegates who fail to be
20902 * delegate.cs (Populate): Verify that we dont get null return
20903 values. TODO: Check for AsAccessible.
20905 * cs-parser.jay: Use basename to emit error 574 (destructor should
20906 have the same name as container class), not the full name.
20908 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20909 possible representation.
20911 Also implements integer type suffixes U and L.
20913 2001-12-15 Miguel de Icaza <miguel@ximian.com>
20915 * expression.cs (ArrayCreation.DoResolve): We need to do the
20916 argument resolution *always*.
20918 * decl.cs: Make this hold the namespace. Hold the root context as
20920 (LookupType): Move here.
20922 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20924 * location.cs (Row, Name): Fixed the code, it was always returning
20925 references to the first file.
20927 * interface.cs: Register properties defined through interfaces.
20929 * driver.cs: Add support for globbing on the command line
20931 * class.cs (Field): Make it derive from MemberCore as well.
20934 2001-12-15 Ravi Pratap <ravi@ximian.com>
20936 * class.cs (Event::Define): Check that the type of the event is a delegate
20937 type else flag error #66.
20939 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20942 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20943 values of EntryPoint, CharSet etc etc.
20945 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20947 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20948 be null and we should ignore this. I am not sure if this is really clean. Apparently,
20949 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20950 which needs this to do its work.
20952 * ../errors/cs0066.cs : Add.
20954 2001-12-14 Miguel de Icaza <miguel@ximian.com>
20956 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20959 * class.cs: (MethodSignature.MethodSignature): Removed hack that
20960 clears out the parameters field.
20961 (MemberSignatureCompare): Cleanup
20963 (MemberCore): New base class used to share code between MethodCore
20966 (RegisterRequiredImplementations) BindingFlags.Public requires
20967 either BindingFlags.Instace or Static. Use instance here.
20969 (Property): Refactored code to cope better with the full spec.
20971 * parameter.cs (GetParameterInfo): Return an empty array instead
20974 * class.cs (Property): Abstract or extern properties have no bodies.
20976 * parameter.cs (GetParameterInfo): return a zero-sized array.
20978 * class.cs (TypeContainer.MethodModifiersValid): Move all the
20979 method modifier validation to the typecontainer so we can reuse
20980 this on properties.
20982 (MethodCore.ParameterTypes): return an empty sized array of types.
20984 (Property.Define): Test property modifier validity.
20986 Add tests for sealed/override too.
20988 (Method.Emit): abstract or extern methods have no bodies.
20990 2001-12-14 Ravi Pratap <ravi@ximian.com>
20992 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20995 (Method::Define, ::Emit): Modify accordingly.
20997 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20999 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21001 * makefile: Pass in /unsafe.
21003 2001-12-13 Miguel de Icaza <miguel@ximian.com>
21005 * class.cs (MakeKey): Kill routine.
21007 * class.cs (TypeContainer.Define): Correctly define explicit
21008 method implementations (they require the full interface name plus
21011 * typemanager.cs: Deply the PtrHashtable here and stop using the
21012 lame keys. Things work so much better.
21014 This of course broke everyone who depended on `RegisterMethod' to
21015 do the `test for existance' test. This has to be done elsewhere.
21017 * support.cs (PtrHashtable): A hashtable that avoid comparing with
21018 the object stupid Equals method (because, that like fails all over
21019 the place). We still do not use it.
21021 * class.cs (TypeContainer.SetRequiredInterface,
21022 TypeContainer.RequireMethods): Killed these two routines and moved
21023 all the functionality to RegisterRequiredImplementations.
21025 (TypeContainer.RegisterRequiredImplementations): This routine now
21026 registers all the implementations required in an array for the
21027 interfaces and abstract methods. We use an array of structures
21028 which can be computed ahead of time to reduce memory usage and we
21029 also assume that lookups are cheap as most classes will not
21030 implement too many interfaces.
21032 We also avoid creating too many MethodSignatures.
21034 (TypeContainer.IsInterfaceMethod): Update and optionally does not
21035 clear the "pending" bit if we find that there are problems with
21038 (TypeContainer.VerifyPendingMethods): Update to report errors of
21039 methods that look like implementations but are not.
21041 (TypeContainer.Define): Add support for explicit interface method
21044 2001-12-12 Miguel de Icaza <miguel@ximian.com>
21046 * typemanager.cs: Keep track of the parameters here instead of
21047 being a feature of the TypeContainer.
21049 * class.cs: Drop the registration of parameters here, as
21050 InterfaceMethods are also interface declarations.
21052 * delegate.cs: Register methods with the TypeManager not only with
21053 the TypeContainer. This code was buggy.
21055 * interface.cs: Full registation here.
21057 2001-12-11 Miguel de Icaza <miguel@ximian.com>
21059 * expression.cs: Remove reducer for binary expressions, it can not
21062 * const.cs: Put here the code that used to go into constant.cs
21064 * constant.cs: Put here the code for constants, this is a new base
21065 class for Literals.
21067 * literal.cs: Make Literal derive from Constant.
21069 2001-12-09 Miguel de Icaza <miguel@ximian.com>
21071 * statement.cs (Return.Emit): Report error 157 if the user
21072 attempts to return from a finally block.
21074 (Return.Emit): Instead of emitting a return, jump to the end of
21077 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21078 LocalBuilder to store the result of the function. ReturnLabel is
21079 the target where we jump.
21082 2001-12-09 Radek Doulik <rodo@ximian.com>
21084 * cs-parser.jay: remember alias in current namespace
21086 * ecore.cs (SimpleName::DoResolve): use aliases for types or
21089 * class.cs (LookupAlias): lookup alias in my_namespace
21091 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21093 (LookupAlias): lookup alias in this and if needed in parent
21096 2001-12-08 Miguel de Icaza <miguel@ximian.com>
21100 * rootcontext.cs: (ModuleBuilder) Made static, first step into
21101 making things static. I need this to avoid passing the
21102 TypeContainer when calling ParameterType.
21104 * support.cs (InternalParameters.ParameterType): Remove ugly hack
21105 that did string manipulation to compute the type and then call
21106 GetType. Use Parameter.ParameterType instead.
21108 * cs-tokenizer.cs: Consume the suffix for floating values.
21110 * expression.cs (ParameterReference): figure out whether this is a
21111 reference parameter or not. Kill an extra variable by computing
21112 the arg_idx during emission.
21114 * parameter.cs (Parameters.GetParameterInfo): New overloaded
21115 function that returns whether a parameter is an out/ref value or not.
21117 (Parameter.ParameterType): The type of the parameter (base,
21118 without ref/out applied).
21120 (Parameter.Resolve): Perform resolution here.
21121 (Parameter.ExternalType): The full type (with ref/out applied).
21123 * statement.cs (Using.Emit, Using.EmitExpression): Implement
21124 support for expressions on the using statement.
21126 2001-12-07 Miguel de Icaza <miguel@ximian.com>
21128 * statement.cs (Using.EmitLocalVariableDecls): Split the
21129 localvariable handling of the using statement.
21131 (Block.EmitMeta): Keep track of variable count across blocks. We
21132 were reusing slots on separate branches of blocks.
21134 (Try.Emit): Emit the general code block, we were not emitting it.
21136 Check the type of the declaration to be an IDisposable or
21137 something that can be implicity converted to it.
21139 Emit conversions if required.
21141 * ecore.cs (EmptyExpression): New utility class.
21142 (Expression.ImplicitConversionExists): New utility function.
21144 2001-12-06 Miguel de Icaza <miguel@ximian.com>
21146 * statement.cs (Using): Implement.
21148 * expression.cs (LocalVariableReference): Support read only variables.
21150 * statement.cs: Remove the explicit emit for the Leave opcode.
21151 (VariableInfo): Add a readonly field.
21153 2001-12-05 Miguel de Icaza <miguel@ximian.com>
21155 * ecore.cs (ConvCast): new class used to encapsulate the various
21156 explicit integer conversions that works in both checked and
21157 unchecked contexts.
21159 (Expression.ConvertNumericExplicit): Use new ConvCast class to
21160 properly generate the overflow opcodes.
21162 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21164 * statement.cs: The correct type for the EmptyExpression is the
21165 element_type, not the variable type. Ravi pointed this out.
21167 2001-12-04 Ravi Pratap <ravi@ximian.com>
21169 * class.cs (Method::Define): Handle PInvoke methods specially
21170 by using DefinePInvokeMethod instead of the usual one.
21172 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21173 above to do the task of extracting information and defining the method.
21175 2001-12-04 Ravi Pratap <ravi@ximian.com>
21177 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21178 of the condition for string type.
21180 (Emit): Move that here.
21182 (ArrayCreation::CheckIndices): Keep string literals in their expression
21185 (EmitDynamicInitializers): Handle strings appropriately.
21187 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21189 * codegen.cs (EmitContext): Replace multiple variables with a
21190 single pointer to the current Switch statement.
21192 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21195 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21199 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21202 (Foreach.Emit): Foreach on arrays was not setting
21203 up the loop variables (for break/continue).
21205 (GotoCase): Semi-implented.
21207 2001-12-03 Ravi Pratap <ravi@ximian.com>
21209 * attribute.cs (CheckAttribute): Handle system attributes by using
21210 Attribute.GetAttributes to examine information we need.
21212 (GetValidPlaces): Same here.
21214 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21216 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21218 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21220 (Method::Define): Set appropriate flags if we have a DllImport attribute.
21222 (Method::Emit): Handle the case when we are a PInvoke method.
21224 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21226 * expression.cs: Use ResolveWithSimpleName on compound names.
21228 2001-12-02 Ravi Pratap <ravi@ximian.com>
21230 * constant.cs (EmitConstant): Make sure we resolve the associated expression
21231 before trying to reduce it.
21233 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21235 * constant.cs (LookupConstantValue): Implement.
21237 (EmitConstant): Use the above in emitting the constant.
21239 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21240 that are user-defined by doing a LookupConstantValue on them.
21242 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21245 2001-11-29 Miguel de Icaza <miguel@ximian.com>
21247 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21249 (BaseAccess.DoResolve): Implement.
21251 (MemberAccess.DoResolve): Split this routine into a
21252 ResolveMemberAccess routine that can be used independently
21254 2001-11-28 Miguel de Icaza <miguel@ximian.com>
21256 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21257 As that share bits of the implementation. Is returns a boolean,
21258 while As returns the Type that is being probed.
21260 2001-12-01 Ravi Pratap <ravi@ximian.com>
21262 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21263 instead of a Literal - much easier.
21265 (EnumInTransit): Remove - utterly useless :-)
21267 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21269 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21271 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21272 chain when we have no associated expression.
21274 2001-11-30 Ravi Pratap <ravi@ximian.com>
21276 * constant.cs (Define): Use Location while reporting the errror.
21278 Also emit a warning when 'new' is used and there is no inherited
21281 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
21284 (LookupEnumValue): Implement to lookup an enum member's value and define it
21287 (Populate): Re-write accordingly to use the above routine.
21289 2001-11-27 Miguel de Icaza <miguel@ximian.com>
21291 * expression.cs (This): Fix prototype for DoResolveLValue to
21292 override the base class DoResolveLValue.
21294 * cs-parser.cs: Report errors cs574 and cs575 (destructor
21297 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21298 (we need to load the address of the field here). This fixes
21301 (FieldExpr.DoResolveLValue): Call the DoResolve
21302 function to initialize the Instance expression.
21304 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21305 correctly the GetEnumerator operation on a value type.
21307 * cs-parser.jay: Add more simple parsing error catches.
21309 * statement.cs (Switch): Add support for string switches.
21310 Handle null specially.
21312 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
21314 2001-11-28 Ravi Pratap <ravi@ximian.com>
21316 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21318 (declare_local_constant): New helper function.
21320 * statement.cs (AddConstant): Keep a separate record of constants
21322 (IsConstant): Implement to determine if a variable is a constant.
21324 (GetConstantExpression): Implement.
21326 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21328 * statement.cs (IsVariableDefined): Re-write.
21330 2001-11-27 Ravi Pratap <ravi@ximian.com>
21332 * class.cs (TypeContainer::FindMembers): Look for constants
21333 in the case when we are looking for MemberTypes.Field
21335 * expression.cs (MemberAccess::DoResolve): Check that in the
21336 case we are a FieldExpr and a Literal, we are not being accessed
21337 by an instance reference.
21339 * cs-parser.jay (local_constant_declaration): Implement.
21341 (declaration_statement): Implement for constant declarations.
21343 2001-11-26 Miguel de Icaza <miguel@ximian.com>
21345 * statement.cs (Switch): Catch double defaults.
21347 (Switch): More work on the switch() statement
21348 implementation. It works for integral values now, need to finish
21352 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21354 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21355 integer literals into other integer literals. To be used by
21358 2001-11-24 Ravi Pratap <ravi@ximian.com>
21360 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21363 (EmitDynamicInitializers): Cope with the above since we extract data
21364 directly from ArrayData now.
21366 (ExpectInitializers): Keep track of whether initializers are mandatory
21369 (Bounds): Make it a hashtable to prevent the same dimension being
21370 recorded for every element in that dimension.
21372 (EmitDynamicInitializers): Fix bug which prevented the Set array method
21375 Also fix bug which was causing the indices to be emitted in the reverse
21378 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21380 * expression.cs (ArrayCreation): Implement the bits that Ravi left
21381 unfinished. They do not work, because the underlying code is
21384 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21386 * cs-parser.jay: Remove bogus fixme.
21388 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21389 on Switch statement.
21391 2001-11-23 Ravi Pratap <ravi@ximian.com>
21393 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21396 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21397 parameter. Apparently, any expression is allowed.
21399 (ValidateInitializers): Update accordingly.
21401 (CheckIndices): Fix some tricky bugs thanks to recursion.
21403 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
21404 I was being completely brain-dead.
21406 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21407 and re-write acordingly.
21409 (DelegateInvocation): Re-write accordingly.
21411 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21413 (MakeByteBlob): Handle types more correctly.
21415 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21416 initialization from expressions but it is incomplete because I am a complete
21419 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21421 * statement.cs (If.Emit): Fix a bug that generated incorrect code
21422 on If. Basically, we have to return `true' (ie, we do return to
21423 our caller) only if both branches of the if return.
21425 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21426 short-circuit operators, handle them as short circuit operators.
21428 (Cast.DoResolve): Resolve type.
21429 (Cast.Cast): Take an expression as the target type.
21431 * cs-parser.jay (cast_expression): Remove old hack that only
21432 allowed a limited set of types to be handled. Now we take a
21433 unary_expression and we resolve to a type during semantic
21436 Use the grammar productions from Rhys to handle casts (this is
21437 not complete like Rhys syntax yet, we fail to handle that corner
21438 case that C# has regarding (-x), but we will get there.
21440 2001-11-22 Ravi Pratap <ravi@ximian.com>
21442 * class.cs (EmitFieldInitializer): Take care of the case when we have a
21443 field which is an array type.
21445 * cs-parser.jay (declare_local_variables): Support array initialization too.
21447 * typemanager.cs (MakeKey): Implement.
21449 (everywhere): Use the above appropriately.
21451 * cs-parser.jay (for_statement): Update for array initialization while
21452 declaring variables.
21454 * ecore.cs : The error message was correct, it's the variable's names that
21455 were misleading ;-) Make the code more readable.
21457 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21458 the correct type etc.
21460 (ConvertExplicit): Handle Enum types by examining the underlying type.
21462 2001-11-21 Ravi Pratap <ravi@ximian.com>
21464 * parameter.cs (GetCallingConvention): Always return
21465 CallingConventions.Standard for now.
21467 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21469 * expression.cs (Binary.ResolveOperator): Update the values of `l'
21470 and `r' after calling DoNumericPromotions.
21472 * ecore.cs: Fix error message (the types were in the wrong order).
21474 * statement.cs (Foreach.ProbeCollectionType): Need to pass
21475 BindingFlags.Instance as well
21477 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21478 implicit int literal conversion in an empty cast so that we
21479 propagate the right type upstream.
21481 (UnboxCast): new class used to unbox value types.
21482 (Expression.ConvertExplicit): Add explicit type conversions done
21485 (Expression.ImplicitNumericConversion): Oops, forgot to test for
21486 the target type before applying the implicit LongLiterals to ULong
21489 2001-11-21 Miguel de Icaza <miguel@ximian.com>
21491 * cs-parser.jay (for_statement): Reworked the way For works: now
21492 we declare manually any variables that are introduced in
21493 for_initializer to solve the problem of having out-of-band code
21494 emition (that is what got for broken).
21496 (declaration_statement): Perform the actual variable declaration
21497 that used to be done in local_variable_declaration here.
21499 (local_variable_declaration): Do not declare anything, just pass
21500 the information on a DictionaryEntry
21502 2001-11-20 Ravi Pratap <ravi@ximian.com>
21504 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21505 re-write of the logic to now make it recursive.
21507 (UpdateIndices): Re-write accordingly.
21509 Store element data in a separate ArrayData list in the above methods.
21511 (MakeByteBlob): Implement to dump the array data into a byte array.
21513 2001-11-19 Ravi Pratap <ravi@ximian.com>
21515 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21518 * constant.cs (Define): Implement.
21520 (EmitConstant): Re-write fully.
21522 Pass in location info.
21524 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21527 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21528 DictionaryEntry since we need location info too.
21530 (constant_declaration): Update accordingly.
21532 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21533 code into another method : UpdateIndices.
21535 2001-11-18 Ravi Pratap <ravi@ximian.com>
21537 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21538 some type checking etc.
21540 2001-11-17 Ravi Pratap <ravi@ximian.com>
21542 * expression.cs (ArrayCreation::ValidateInitializers): Implement
21543 bits to provide dimension info if the user skips doing that.
21545 Update second constructor to store the rank correctly.
21547 2001-11-16 Ravi Pratap <ravi@ximian.com>
21549 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21550 and try to implement.
21552 * ../errors/cs0150.cs : Add.
21554 * ../errors/cs0178.cs : Add.
21556 2001-11-16 Miguel de Icaza <miguel@ximian.com>
21558 * statement.cs: Implement foreach on multi-dimensional arrays.
21560 * parameter.cs (Parameters.GetParameterByName): Also lookup the
21561 name of the params argument.
21563 * expression.cs: Use EmitStoreOpcode to get the right opcode while
21564 initializing the array.
21566 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21567 we can use this elsewhere.
21569 * statement.cs: Finish implementation of foreach for single
21572 * cs-parser.jay: Use an out-of-band stack to pass information
21573 around, I wonder why I need this.
21575 foreach_block: Make the new foreach_block the current_block.
21577 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21578 function used to return a static Parameters structure. Used for
21579 empty parameters, as those are created very frequently.
21581 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21583 2001-11-15 Ravi Pratap <ravi@ximian.com>
21585 * interface.cs : Default modifier is private, not public. The
21586 make verify test passes again.
21588 2001-11-15 Ravi Pratap <ravi@ximian.com>
21590 * support.cs (ReflectionParameters): Fix logic to determine
21591 whether the last parameter is a params one. Test 9 passes again.
21593 * delegate.cs (Populate): Register the builders we define with
21594 RegisterParameterForBuilder. Test 19 passes again.
21596 * cs-parser.jay (property_declaration): Reference $6 instead
21597 of $$ to get at the location.
21599 (indexer_declaration): Similar stuff.
21601 (attribute): Ditto.
21603 * class.cs (Property): Register parameters for the Get and Set methods
21604 if they exist. Test 23 passes again.
21606 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21607 call to EmitArguments as we are sure there aren't any params arguments.
21608 Test 32 passes again.
21610 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21611 IndexOutOfRangeException.
21613 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21614 Test 33 now passes again.
21616 2001-11-15 Miguel de Icaza <miguel@ximian.com>
21618 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21619 broke a bunch of things. Will have to come up with a better way
21620 of tracking locations.
21622 * statement.cs: Implemented foreach for single dimension arrays.
21624 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21626 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21627 an error. This removes the lookup from the critical path.
21629 * cs-parser.jay: Removed use of temporary_loc, which is completely
21632 2001-11-14 Miguel de Icaza <miguel@ximian.com>
21634 * support.cs (ReflectionParameters.ParameterModifier): Report
21635 whether the argument is a PARAMS argument or not.
21637 * class.cs: Set the attribute `ParamArrayAttribute' on the
21638 parameter argument.
21640 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21641 and cons_param_array_attribute (ConstructorInfo for
21642 ParamArrayAttribute).,
21644 * codegen.cs: Emit the return using the `Return' statement, that
21645 way we can report the error correctly for missing return values.
21647 * class.cs (Method.Emit): Clean up.
21649 * expression.cs (Argument.Resolve): Take another argument: the
21650 location where this argument is used. Notice that this is not
21651 part of the "Argument" class as to reduce the size of the
21652 structure (we know the approximate location anyways).
21654 Test if the argument is a variable-reference, if not, then
21655 complain with a 206.
21657 (Argument.Emit): Emit addresses of variables.
21659 (Argument.FullDesc): Simplify.
21661 (Invocation.DoResolve): Update for Argument.Resolve.
21663 (ElementAccess.DoResolve): ditto.
21665 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21666 method should be virtual, as this method is always virtual.
21668 (NewDelegate.DoResolve): Update for Argument.Resolve.
21670 * class.cs (ConstructorInitializer.DoResolve): ditto.
21672 * attribute.cs (Attribute.Resolve): ditto.
21674 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21676 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21678 * expression.cs (ParameterReference): Drop IStackStorage and implement
21679 IAssignMethod instead.
21681 (LocalVariableReference): ditto.
21683 * ecore.cs (FieldExpr): Drop IStackStorage and implement
21684 IAssignMethod instead.
21686 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21688 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21689 enumerations that are used in heavily used structures derive from
21690 byte in a laughable and pathetic attempt to reduce memory usage.
21691 This is the kind of pre-optimzations that you should not do at
21692 home without adult supervision.
21694 * expression.cs (UnaryMutator): New class, used to handle ++ and
21695 -- separatedly from the other unary operators. Cleans up the
21696 code, and kills the ExpressionStatement dependency in Unary.
21698 (Unary): Removed `method' and `Arguments' from this class, making
21699 it smaller, and moving it all to SimpleCall, so I can reuse this
21700 code in other locations and avoid creating a lot of transient data
21701 strucutres when not required.
21703 * cs-parser.jay: Adjust for new changes.
21705 2001-11-11 Miguel de Icaza <miguel@ximian.com>
21707 * enum.cs (Enum.Populate): If there is a failure during
21710 * cs-parser.jay (opt_enum_base): we used to catch type errors
21711 here, but this is really incorrect. The type error should be
21712 catched during semantic analysis.
21714 2001-12-11 Ravi Pratap <ravi@ximian.com>
21716 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21717 current_local_parameters as expected since I, in my stupidity, had forgotten
21720 * attribute.cs (GetValidPlaces): Fix stupid bug.
21722 * class.cs (Method::Emit): Perform check on applicability of attributes.
21724 (Constructor::Emit): Ditto.
21726 (Field::Emit): Ditto.
21728 (Field.Location): Store location information.
21730 (Property, Event, Indexer, Operator): Ditto.
21732 * cs-parser.jay (field_declaration): Pass in location for each field.
21734 * ../errors/cs0592.cs : Add.
21736 2001-11-12 Ravi Pratap <ravi@ximian.com>
21738 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21740 (InitCoreTypes): Update accordingly.
21742 (RegisterAttrType, LookupAttr): Implement.
21744 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21745 info about the same.
21747 (Resolve): Update to populate the above as necessary.
21749 (Error592): Helper.
21751 (GetValidPlaces): Helper to the above.
21753 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21755 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21757 2001-11-12 Ravi Pratap <ravi@ximian.com>
21759 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21761 * ../errors/cs0617.cs : Add.
21763 2001-11-11 Ravi Pratap <ravi@ximian.com>
21765 * enum.cs (Emit): Rename to Populate to be more consistent with what
21766 we expect it to do and when exactly it is called.
21768 * class.cs, rootcontext.cs : Update accordingly.
21770 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21771 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21773 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21775 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21776 of a fieldinfo using the above, when dealing with a FieldBuilder.
21778 2001-11-10 Ravi Pratap <ravi@ximian.com>
21780 * ../errors/cs0031.cs : Add.
21782 * ../errors/cs1008.cs : Add.
21784 * ../errrors/cs0543.cs : Add.
21786 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21789 (FindMembers): Implement.
21791 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21792 enums and delegates too.
21794 (enum_types): Rename to builder_to_enum.
21796 (delegate_types): Rename to builder_to_delegate.
21798 * delegate.cs (FindMembers): Implement.
21800 2001-11-09 Ravi Pratap <ravi@ximian.com>
21802 * typemanager.cs (IsEnumType): Implement.
21804 * enum.cs (Emit): Re-write parts to account for the underlying type
21805 better and perform checking etc.
21807 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21808 of the underlying type.
21810 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21813 * enum.cs (error31): Helper to report error #31.
21815 * cs-parser.jay (enum_declaration): Store location of each member too.
21817 * enum.cs (member_to_location): New hashtable.
21819 (AddEnumMember): Update location hashtable.
21821 (Emit): Use the location of each member while reporting errors.
21823 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21825 * cs-parser.jay: A for_initializer if is a
21826 local_variable_declaration really ammount to have an implicit
21827 block with the variable declaration and no initializer for for.
21829 * statement.cs (For.Emit): Cope with null initializers.
21831 This fixes the infinite loop on for initializers.
21833 2001-11-08 Miguel de Icaza <miguel@ximian.com>
21835 * enum.cs: More cleanup.
21837 * ecore.cs: Remove dead code.
21839 * class.cs (Property.Emit): More simplification.
21840 (Event.Emit): ditto.
21842 Reworked to have less levels of indentation.
21844 2001-11-08 Ravi Pratap <ravi@ximian.com>
21846 * class.cs (Property): Emit attributes.
21856 * enum.cs (Emit): Ditto.
21858 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21861 * class.cs (Field, Event, etc.): Move attribute generation into the
21862 Emit method everywhere.
21864 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21865 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21866 as we had no way of defining nested enums !
21868 * rootcontext.cs : Adjust code accordingly.
21870 * typemanager.cs (AddEnumType): To keep track of enum types separately.
21872 2001-11-07 Ravi Pratap <ravi@ximian.com>
21874 * expression.cs (EvalConstantExpression): Move into ecore.cs
21876 * enum.cs (Enum): Rename some members and make them public and readonly
21877 according to our convention.
21879 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21882 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21884 (Enum::Emit): Write a simple version for now which doesn't try to compute
21885 expressions. I shall modify this to be more robust in just a while.
21887 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21889 (TypeContainer::CloseType): Create the Enum types too.
21891 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21893 * expression.cs (EvalConstantExpression): Get rid of completely.
21895 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21896 user-defined values and other cases.
21898 (IsValidEnumLiteral): Helper function.
21900 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
21901 out there in the case we had a literal FieldExpr.
21903 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21905 (Literalize): Revamp a bit to take two arguments.
21907 (EnumLiteral): New class which derives from Literal to wrap enum literals.
21909 2001-11-06 Ravi Pratap <ravi@ximian.com>
21911 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21913 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21915 (Resolve): Use the above to ensure we have proper initializers.
21917 2001-11-05 Ravi Pratap <ravi@ximian.com>
21919 * expression.cs (Expression::EvalConstantExpression): New method to
21920 evaluate constant expressions.
21922 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21924 2001-11-07 Miguel de Icaza <miguel@ximian.com>
21926 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21929 (Binary.ResolveOperator): Handle operator != (object a, object b)
21930 and operator == (object a, object b);
21932 (Binary.DoNumericPromotions): Indicate whether the numeric
21933 promotion was possible.
21935 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21938 Made the ArrayAccess implement interface IAssignMethod instead of
21939 IStackStore as the order in which arguments are passed reflects
21942 * assign.cs: Instead of using expr.ExprClass to select the way of
21943 assinging, probe for the IStackStore/IAssignMethod interfaces.
21945 * typemanager.cs: Load InitializeArray definition.
21947 * rootcontext.cs (RootContext.MakeStaticData): Used to define
21948 static data that can be used to initialize arrays.
21950 2001-11-05 Miguel de Icaza <miguel@ximian.com>
21952 * expression.cs: Handle operator== and operator!= for booleans.
21954 (Conditioal.Reduce): Implement reducer for the ?: operator.
21956 (Conditional.Resolve): Implement dead code elimination.
21958 (Binary.Resolve): Catch string literals and return a new
21959 concatenated string.
21961 (Unary.Reduce): Implement reduction of unary expressions.
21963 * ecore.cs: Split out the expression core handling here.
21965 (Expression.Reduce): New method used to perform constant folding
21966 and CSE. This is needed to support constant-expressions.
21968 * statement.cs (Statement.EmitBoolExpression): Pass true and false
21969 targets, and optimize for !x.
21971 2001-11-04 Ravi Pratap <ravi@ximian.com>
21973 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21974 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21975 set custom atttributes.
21977 * literal.cs (Literal::GetValue): New abstract method to return the actual
21978 value of the literal, cast as an object.
21980 (*Literal): Implement GetValue method.
21982 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21983 expressions to the arraylist but objects of type Argument.
21985 * class.cs (TypeContainer::Emit): Emit our attributes too.
21987 (Method::Emit, Constructor::Emit): Ditto.
21989 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21990 to be ignoring earlier.
21992 2001-11-03 Ravi Pratap <ravi@ximian.com>
21994 * attribute.cs (AttributeSection::Define): Implement to do the business
21995 of constructing a CustomAttributeBuilder.
21997 (Attribute): New trivial class. Increases readability of code.
21999 * cs-parser.jay : Update accordingly.
22001 (positional_argument_list, named_argument_list, named_argument): New rules
22003 (attribute_arguments): Use the above so that we are more correct.
22005 2001-11-02 Ravi Pratap <ravi@ximian.com>
22007 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22008 to perform all checks for a method with a params parameter.
22010 (Invocation::OverloadResolve): Update to use the above method and therefore
22011 cope correctly with params method invocations.
22013 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
22016 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22017 constructors in our parent too because we can't afford to miss out on
22020 * attribute.cs (AttributeSection): New name for the class Attribute
22022 Other trivial changes to improve readability.
22024 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22025 use the new class names.
22027 2001-11-01 Ravi Pratap <ravi@ximian.com>
22029 * class.cs (Method::Define): Complete definition for params types too
22031 (Indexer::Define): Ditto.
22033 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22034 Cope everywhere with a request for info about the array parameter.
22036 2001-11-01 Ravi Pratap <ravi@ximian.com>
22038 * tree.cs (RecordNamespace): Fix up to check for the correct key.
22040 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
22041 local_variable_type to extract the string corresponding to the type.
22043 (local_variable_type): Fixup the action to use the new helper method.
22045 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
22048 * expression.cs : Clean out code which uses the above.
22050 2001-10-31 Ravi Pratap <ravi@ximian.com>
22052 * typemanager.cs (RegisterMethod): Check if we already have an existing key
22053 and bale out if necessary by returning a false.
22055 (RegisterProperty): Ditto.
22057 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22058 and print out appropriate error messages.
22060 * interface.cs (everywhere): Ditto.
22062 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22063 location to constructor.
22065 * class.cs (Property, Event, Indexer): Update accordingly.
22067 * ../errors/cs111.cs : Added.
22069 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22070 of a method, as laid down by the spec.
22072 (Invocation::OverloadResolve): Use the above method.
22074 2001-10-31 Ravi Pratap <ravi@ximian.com>
22076 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22077 now take a TypeContainer and a Parameters object.
22079 (ParameterData): Modify return type of ParameterModifier method to be
22080 Parameter.Modifier and not a string.
22082 (ReflectionParameters, InternalParameters): Update accordingly.
22084 * expression.cs (Argument::GetParameterModifier): Same here.
22086 * support.cs (InternalParameters::ParameterType): Find a better way of determining
22087 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22088 symbol in it at all so maybe this is only for now.
22090 2001-10-30 Ravi Pratap <ravi@ximian.com>
22092 * support.cs (InternalParameters): Constructor now takes an extra argument
22093 which is the actual Parameters class.
22095 (ParameterDesc): Update to provide info on ref/out modifiers.
22097 * class.cs (everywhere): Update call to InternalParameters to pass in
22098 the second argument too.
22100 * support.cs (ParameterData): Add ParameterModifier, which is a method
22101 to return the modifier info [ref/out etc]
22103 (InternalParameters, ReflectionParameters): Implement the above.
22105 * expression.cs (Argument::ParameterModifier): Similar function to return
22106 info about the argument's modifiers.
22108 (Invocation::OverloadResolve): Update to take into account matching modifiers
22111 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22112 a new SetFormalParameters object which we pass to InternalParameters.
22114 2001-10-30 Ravi Pratap <ravi@ximian.com>
22116 * expression.cs (NewArray): Merge into the ArrayCreation class.
22118 2001-10-29 Ravi Pratap <ravi@ximian.com>
22120 * expression.cs (NewArray): Merge classes NewBuiltinArray and
22121 NewUserdefinedArray into one as there wasn't much of a use in having
22124 * expression.cs (Argument): Change field's name to ArgType from Type.
22126 (Type): New readonly property which returns the proper type, taking into
22127 account ref/out modifiers.
22129 (everywhere): Adjust code accordingly for the above.
22131 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22132 whether we are emitting for a ref or out parameter.
22134 * expression.cs (Argument::Emit): Use the above field to set the state.
22136 (LocalVariableReference::Emit): Update to honour the flag and emit the
22139 * parameter.cs (Attributes): Set the correct flags for ref parameters.
22141 * expression.cs (Argument::FullDesc): New function to provide a full desc.
22143 * support.cs (ParameterData): Add method ParameterDesc to the interface.
22145 (ReflectionParameters, InternalParameters): Implement the above method.
22147 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22150 (Invocation::FullMethodDesc): Ditto.
22152 2001-10-29 Miguel de Icaza <miguel@ximian.com>
22154 * cs-parser.jay: Add extra production for the second form of array
22157 * expression.cs (ArrayCreation): Update to reflect the above
22160 * Small changes to prepare for Array initialization.
22162 2001-10-28 Miguel de Icaza <miguel@ximian.com>
22164 * typemanager.cs (ImplementsInterface): interface might be null;
22165 Deal with this problem;
22167 Also, we do store negative hits on the cache (null values), so use
22168 this instead of calling t.GetInterfaces on the type everytime.
22170 2001-10-28 Ravi Pratap <ravi@ximian.com>
22172 * typemanager.cs (IsBuiltinType): New method to help determine the same.
22174 * expression.cs (New::DoResolve): Get rid of array creation code and instead
22175 split functionality out into different classes.
22177 (New::FormArrayType): Move into NewBuiltinArray.
22179 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22182 (NewBuiltinArray): New class to handle creation of built-in arrays.
22184 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22185 account creation of one-dimensional arrays.
22187 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22189 (NewUserdefinedArray::DoResolve): Implement.
22191 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22193 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22194 we maintain inside the TypeManager. This is necessary to perform lookups on the
22197 (LookupType): Update to perform GetType on the module builders too.
22199 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22201 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22203 2001-10-23 Ravi Pratap <ravi@ximian.com>
22205 * expression.cs (New::DoResolve): Implement guts of array creation.
22207 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22209 2001-10-27 Miguel de Icaza <miguel@ximian.com>
22211 * expression.cs: Fix bug I introduced lsat night that broke
22214 (Expression.Resolve): Report a 246 error (can not resolve name)
22215 if we find a SimpleName in the stream.
22217 (Expression.ResolveLValue): Ditto.
22219 (Expression.ResolveWithSimpleName): This function is a variant of
22220 ResolveName, this one allows SimpleNames to be returned without a
22221 warning. The only consumer of SimpleNames is MemberAccess
22223 2001-10-26 Miguel de Icaza <miguel@ximian.com>
22225 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22226 might arrive here. I have my doubts that this is correct.
22228 * statement.cs (Lock): Implement lock statement.
22230 * cs-parser.jay: Small fixes to support `lock' and `using'
22232 * cs-tokenizer.cs: Remove extra space
22234 * driver.cs: New flag --checked, allows to turn on integer math
22237 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22238 Threading.Monitor.Exit
22240 2001-10-23 Miguel de Icaza <miguel@ximian.com>
22242 * expression.cs (IndexerAccess::DoResolveLValue): Set the
22243 Expression Class to be IndexerAccess.
22245 Notice that Indexer::DoResolve sets the eclass to Value.
22247 2001-10-22 Miguel de Icaza <miguel@ximian.com>
22249 * class.cs (TypeContainer::Emit): Emit code for indexers.
22251 * assign.cs (IAssignMethod): New interface implemented by Indexers
22252 and Properties for handling assignment.
22254 (Assign::Emit): Simplify and reuse code.
22256 * expression.cs (IndexerAccess, PropertyExpr): Implement
22257 IAssignMethod, clean up old code.
22259 2001-10-22 Ravi Pratap <ravi@ximian.com>
22261 * typemanager.cs (ImplementsInterface): New method to determine if a type
22262 implements a given interface. Provides a nice cache too.
22264 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22267 (ConvertReferenceExplicit): Ditto.
22269 * delegate.cs (Delegate::Populate): Update to define the parameters on the
22270 various methods, with correct names etc.
22272 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
22273 Operator.UnaryNegation.
22275 * cs-parser.jay (operator_declarator): Be a little clever in the case where
22276 we have a unary plus or minus operator.
22278 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
22281 * everywhere : update accordingly.
22283 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22286 * class.cs (Method::Define): For the case where we are implementing a method
22287 inherited from an interface, we need to set the MethodAttributes.Final flag too.
22288 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22290 2001-10-21 Ravi Pratap <ravi@ximian.com>
22292 * interface.cs (FindMembers): Implement to work around S.R.E
22295 * typemanager.cs (IsInterfaceType): Implement.
22297 (FindMembers): Update to handle interface types too.
22299 * expression.cs (ImplicitReferenceConversion): Re-write bits which
22300 use IsAssignableFrom as that is not correct - it doesn't work.
22302 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22303 and accordingly override EmitStatement.
22305 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22306 using the correct logic :-)
22308 2001-10-19 Ravi Pratap <ravi@ximian.com>
22310 * ../errors/cs-11.cs : Add to demonstrate error -11
22312 2001-10-17 Miguel de Icaza <miguel@ximian.com>
22314 * assign.cs (Assign::Resolve): Resolve right hand side first, and
22315 then pass this as a hint to ResolveLValue.
22317 * expression.cs (FieldExpr): Add Location information
22319 (FieldExpr::LValueResolve): Report assignment to readonly
22322 (Expression::ExprClassFromMemberInfo): Pass location information.
22324 (Expression::ResolveLValue): Add new method that resolves an
22327 (Expression::DoResolveLValue): Default invocation calls
22330 (Indexers): New class used to keep track of indexers in a given
22333 (IStackStore): Renamed from LValue, as it did not really describe
22334 what this did. Also ResolveLValue is gone from this interface and
22335 now is part of Expression.
22337 (ElementAccess): Depending on the element access type
22339 * typemanager.cs: Add `indexer_name_type' as a Core type
22340 (System.Runtime.CompilerServices.IndexerNameAttribute)
22342 * statement.cs (Goto): Take a location.
22344 2001-10-18 Ravi Pratap <ravi@ximian.com>
22346 * delegate.cs (Delegate::VerifyDelegate): New method to verify
22347 if two delegates are compatible.
22349 (NewDelegate::DoResolve): Update to take care of the case when
22350 we instantiate a delegate from another delegate.
22352 * typemanager.cs (FindMembers): Don't even try to look up members
22353 of Delegate types for now.
22355 2001-10-18 Ravi Pratap <ravi@ximian.com>
22357 * delegate.cs (NewDelegate): New class to take care of delegate
22360 * expression.cs (New): Split the delegate related code out into
22361 the NewDelegate class.
22363 * delegate.cs (DelegateInvocation): New class to handle delegate
22366 * expression.cs (Invocation): Split out delegate related code into
22367 the DelegateInvocation class.
22369 2001-10-17 Ravi Pratap <ravi@ximian.com>
22371 * expression.cs (New::DoResolve): Implement delegate creation fully
22372 and according to the spec.
22374 (New::DoEmit): Update to handle delegates differently.
22376 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22377 because of which we were printing out arguments in reverse order !
22379 * delegate.cs (VerifyMethod): Implement to check if the given method
22380 matches the delegate.
22382 (FullDelegateDesc): Implement.
22384 (VerifyApplicability): Implement.
22386 * expression.cs (Invocation::DoResolve): Update to accordingly handle
22387 delegate invocations too.
22389 (Invocation::Emit): Ditto.
22391 * ../errors/cs1593.cs : Added.
22393 * ../errors/cs1594.cs : Added.
22395 * delegate.cs (InstanceExpression, TargetMethod): New properties.
22397 2001-10-16 Ravi Pratap <ravi@ximian.com>
22399 * typemanager.cs (intptr_type): Core type for System.IntPtr
22401 (InitCoreTypes): Update for the same.
22403 (iasyncresult_type, asynccallback_type): Ditto.
22405 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22408 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22411 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22412 the builders for the 4 members of a delegate type :-)
22414 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22417 * expression.cs (New::DoResolve): Implement guts for delegate creation.
22419 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22421 2001-10-15 Miguel de Icaza <miguel@ximian.com>
22423 * statement.cs (Break::Emit): Implement.
22424 (Continue::Emit): Implement.
22426 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
22427 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
22428 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
22429 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
22432 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22433 properties that track the label for the current loop (begin of the
22434 loop and end of the loop).
22436 2001-10-15 Ravi Pratap <ravi@ximian.com>
22438 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22439 use of emitting anything at all.
22441 * class.cs, rootcontext.cs : Get rid of calls to the same.
22443 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22445 (Populate): Define the constructor correctly and set the implementation
22448 * typemanager.cs (delegate_types): New hashtable to hold delegates that
22451 (AddDelegateType): Implement.
22453 (IsDelegateType): Implement helper method.
22455 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22457 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22458 and accordingly handle it.
22460 * delegate.cs (Populate): Take TypeContainer argument.
22461 Implement bits to define the Invoke method. However, I still haven't figured out
22462 how to take care of the native int bit :-(
22464 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
22465 Qualify the name of the delegate, not its return type !
22467 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22470 (StandardConversionExists): Checking for array types turns out to be recursive.
22472 (ConvertReferenceExplicit): Implement array conversion.
22474 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22476 2001-10-12 Ravi Pratap <ravi@ximian.com>
22478 * cs-parser.jay (delegate_declaration): Store the fully qualified
22479 name as it is a type declaration.
22481 * delegate.cs (ReturnType, Name): Rename members to these. Make them
22484 (DefineDelegate): Renamed from Define. Does the same thing essentially,
22485 as TypeContainer::DefineType.
22487 (Populate): Method in which all the definition of the various methods (Invoke)
22490 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22493 (CloseDelegate): Finally creates the delegate.
22495 * class.cs (TypeContainer::DefineType): Update to define delegates.
22496 (Populate, Emit and CloseType): Do the same thing here too.
22498 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22499 delegates in all these operations.
22501 2001-10-14 Miguel de Icaza <miguel@ximian.com>
22503 * expression.cs: LocalTemporary: a new expression used to
22504 reference a temporary that has been created.
22506 * assign.cs: Handle PropertyAccess back here, so that we can
22507 provide the proper semantic access to properties.
22509 * expression.cs (Expression::ConvertReferenceExplicit): Implement
22510 a few more explicit conversions.
22512 * modifiers.cs: `NEW' modifier maps to HideBySig.
22514 * expression.cs (PropertyExpr): Make this into an
22515 ExpressionStatement, and support the EmitStatement code path.
22517 Perform get/set error checking, clean up the interface.
22519 * assign.cs: recognize PropertyExprs as targets, and if so, turn
22520 them into toplevel access objects.
22522 2001-10-12 Miguel de Icaza <miguel@ximian.com>
22524 * expression.cs: PropertyExpr::PropertyExpr: use work around the
22527 * typemanager.cs: Keep track here of our PropertyBuilders again to
22528 work around lameness in SRE.
22530 2001-10-11 Miguel de Icaza <miguel@ximian.com>
22532 * expression.cs (LValue::LValueResolve): New method in the
22533 interface, used to perform a second resolution pass for LValues.
22535 (This::DoResolve): Catch the use of this in static methods.
22537 (This::LValueResolve): Implement.
22539 (This::Store): Remove warning, assigning to `this' in structures
22542 (Invocation::Emit): Deal with invocation of
22543 methods on value types. We need to pass the address to structure
22544 methods rather than the object itself. (The equivalent code to
22545 emit "this" for structures leaves the entire structure on the
22546 stack instead of a pointer to it).
22548 (ParameterReference::DoResolve): Compute the real index for the
22549 argument based on whether the method takes or not a `this' pointer
22550 (ie, the method is static).
22552 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22553 value types returned from functions when we need to invoke a
22554 method on the sturcture.
22557 2001-10-11 Ravi Pratap <ravi@ximian.com>
22559 * class.cs (TypeContainer::DefineType): Method to actually do the business of
22560 defining the type in the Modulebuilder or Typebuilder. This is to take
22561 care of nested types which need to be defined on the TypeBuilder using
22562 DefineNestedMethod.
22564 (TypeContainer::GetClassBases): Implement. Essentially the code from the
22565 methods in RootContext, only ported to be part of TypeContainer.
22567 (TypeContainer::GetInterfaceOrClass): Ditto.
22569 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22571 * interface.cs (Interface::DefineInterface): New method. Does exactly
22572 what RootContext.CreateInterface did earlier, only it takes care of nested types
22575 (Interface::GetInterfaces): Move from RootContext here and port.
22577 (Interface::GetInterfaceByName): Same here.
22579 * rootcontext.cs (ResolveTree): Re-write.
22581 (PopulateTypes): Re-write.
22583 * class.cs (TypeContainer::Populate): Populate nested types too.
22584 (TypeContainer::Emit): Emit nested members too.
22586 * typemanager.cs (AddUserType): Do not make use of the FullName property,
22587 instead just use the name argument passed in as it is already fully
22590 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22591 to TypeContainer mapping to see if a type is user-defined.
22593 * class.cs (TypeContainer::CloseType): Implement.
22595 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22596 the default constructor.
22598 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22601 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22603 * interface.cs (CloseType): Create the type here.
22605 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22608 Remove all the methods which are now in TypeContainer.
22610 2001-10-10 Ravi Pratap <ravi@ximian.com>
22612 * delegate.cs (Define): Re-write bits to define the delegate
22615 2001-10-10 Miguel de Icaza <miguel@ximian.com>
22617 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22619 * expression.cs (ImplicitReferenceConversion): handle null as well
22620 as a source to convert to any reference type.
22622 * statement.cs (Return): Perform any implicit conversions to
22623 expected return type.
22625 Validate use of return statement.
22627 * codegen.cs (EmitContext): Pass the expected return type here.
22629 * class.cs (Method, Constructor, Property): Pass expected return
22630 type to EmitContext.
22632 2001-10-09 Miguel de Icaza <miguel@ximian.com>
22634 * expression.cs: Make DoResolve take an EmitContext instead of a
22637 Replaced `l' and `location' for `loc', for consistency.
22639 (Error, Warning): Remove unneeded Tc argument.
22641 * assign.cs, literal.cs, constant.cs: Update to new calling
22644 * codegen.cs: EmitContext now contains a flag indicating whether
22645 code is being generated in a static method or not.
22647 * cs-parser.jay: DecomposeQI, new function that replaces the old
22648 QualifiedIdentifier. Now we always decompose the assembled
22649 strings from qualified_identifier productions into a group of
22652 2001-10-08 Miguel de Icaza <miguel@ximian.com>
22654 * rootcontext.cs: Deal with field-less struct types correctly now
22655 by passing the size option to Define Type.
22657 * class.cs: Removed hack that created one static field.
22659 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22661 * statement.cs: Moved most of the code generation here.
22663 2001-10-09 Ravi Pratap <ravi@ximian.com>
22665 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22668 (ElementAccess): Remove useless bits for now - keep checks as the spec
22671 2001-10-08 Ravi Pratap <ravi@ximian.com>
22673 * expression.cs (ElementAccess::DoResolve): Remove my crap code
22674 and start performing checks according to the spec.
22676 2001-10-07 Ravi Pratap <ravi@ximian.com>
22678 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22679 rank_specifiers instead.
22681 (rank_specifiers): Change the order in which the rank specifiers are stored
22683 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22685 * expression.cs (ElementAccess): Implement the LValue interface too.
22687 2001-10-06 Ravi Pratap <ravi@ximian.com>
22689 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22690 except that user defined conversions are not included.
22692 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
22693 perform the conversion of the return type, if necessary.
22695 (New::DoResolve): Check whether we are creating an array or an object
22696 and accordingly do the needful.
22698 (New::Emit): Same here.
22700 (New::DoResolve): Implement guts of array creation.
22702 (New::FormLookupType): Helper function.
22704 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22706 * codegen.cs: Removed most of the code generation here, and move the
22707 corresponding code generation bits to the statement classes.
22709 Added support for try/catch/finalize and throw.
22711 * cs-parser.jay: Added support for try/catch/finalize.
22713 * class.cs: Catch static methods having the flags override,
22714 virtual or abstract.
22716 * expression.cs (UserCast): This user cast was not really doing
22717 what it was supposed to do. Which is to be born in fully resolved
22718 state. Parts of the resolution were being performed at Emit time!
22722 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22724 * expression.cs: Implicity convert the result from UserCast.
22726 2001-10-05 Ravi Pratap <ravi@ximian.com>
22728 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22729 prevented it from working correctly.
22731 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22732 merely ConvertImplicit.
22734 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22736 * typemanager.cs: Make the LookupTypeContainer function static,
22737 and not per-instance.
22739 * class.cs: Make static FindMembers (the one that takes a Type
22742 * codegen.cs: Add EmitForeach here.
22744 * cs-parser.jay: Make foreach a toplevel object instead of the
22745 inline expansion, as we need to perform semantic analysis on it.
22747 2001-10-05 Ravi Pratap <ravi@ximian.com>
22749 * expression.cs (Expression::ImplicitUserConversion): Rename to
22750 UserDefinedConversion.
22752 (Expression::UserDefinedConversion): Take an extra argument specifying
22753 whether we look for explicit user conversions too.
22755 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22757 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22759 (ExplicitUserConversion): Make it a call to UserDefinedConversion
22760 with the appropriate arguments.
22762 * cs-parser.jay (cast_expression): Record location too.
22764 * expression.cs (Cast): Record location info.
22766 (Expression::ConvertExplicit): Take location argument.
22768 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22769 to determine if we are doing explicit conversions.
22771 (UserCast::Emit): Update accordingly.
22773 (Expression::ConvertExplicit): Report an error if everything fails.
22775 * ../errors/cs0030.cs : Add.
22777 2001-10-04 Miguel de Icaza <miguel@ximian.com>
22779 * modifiers.cs: If the ABSTRACT keyword is present, also set the
22780 virtual and newslot bits.
22782 * class.cs (TypeContainer::RegisterRequiredImplementations):
22783 Record methods we need.
22785 (TypeContainer::MakeKey): Helper function to make keys for
22786 MethodBases, since the Methodbase key is useless.
22788 (TypeContainer::Populate): Call RegisterRequiredImplementations
22789 before defining the methods.
22791 Create a mapping for method_builders_to_methods ahead of time
22792 instead of inside a tight loop.
22794 (::RequireMethods): Accept an object as the data to set into the
22795 hashtable so we can report interface vs abstract method mismatch.
22797 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22799 * report.cs: Make all of it static.
22801 * rootcontext.cs: Drop object_type and value_type computations, as
22802 we have those in the TypeManager anyways.
22804 Drop report instance variable too, now it is a global.
22806 * driver.cs: Use try/catch on command line handling.
22808 Add --probe option to debug the error reporting system with a test
22811 * report.cs: Add support for exiting program when a probe
22812 condition is reached.
22814 2001-10-03 Ravi Pratap <ravi@ximian.com>
22816 * expression.cs (Binary::DoNumericPromotions): Fix the case when
22817 we do a forcible conversion regardless of type, to check if
22818 ForceConversion returns a null.
22820 (Binary::error19): Use location to report error.
22822 (Unary::error23): Use location here too.
22824 * ../errors/cs0019.cs : Check in.
22826 * ../errors/cs0023.cs : Check in.
22828 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22829 case of a non-null MethodInfo object with a length of 0 !
22831 (Binary::ResolveOperator): Flag error if overload resolution fails to find
22832 an applicable member - according to the spec :-)
22833 Also fix logic to find members in base types.
22835 (Unary::ResolveOperator): Same here.
22837 (Unary::report23): Change name to error23 and make first argument a TypeContainer
22838 as I was getting thoroughly confused between this and error19 :-)
22840 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22841 (::FindMostEncompassedType): Implement.
22842 (::FindMostEncompassingType): Implement.
22843 (::StandardConversionExists): Implement.
22845 (UserImplicitCast): Re-vamp. We now need info about most specific
22846 source and target types so that we can do the necessary conversions.
22848 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22849 mathematical union with no duplicates.
22851 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22853 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22854 in order from base classes to child classes, so that we can in
22855 child classes look up in our parent for method names and
22856 attributes (required for handling abstract, virtual, new, override
22857 constructs: we need to instrospect our base class, and if we dont
22858 populate the classes in order, the introspection might be
22859 incorrect. For example, a method could query its parent before
22860 the parent has any methods and would determine that the parent has
22861 no abstract methods (while it could have had them)).
22863 (RootContext::CreateType): Record the order in which we define the
22866 2001-10-02 Miguel de Icaza <miguel@ximian.com>
22868 * class.cs (TypeContainer::Populate): Also method definitions can
22869 fail now, keep track of this.
22871 (TypeContainer::FindMembers): Implement support for
22872 DeclaredOnly/noDeclaredOnly flag.
22874 (Constructor::Emit) Return the ConstructorBuilder.
22876 (Method::Emit) Return the MethodBuilder.
22877 Check for abstract or virtual methods to be public.
22879 * rootcontext.cs (RootContext::CreateType): Register all the
22880 abstract methods required for the class to be complete and the
22881 interface methods that must be implemented.
22883 * cs-parser.jay: Report error 501 (method requires body if it is
22884 not marked abstract or extern).
22886 * expression.cs (TypeOf::Emit): Implement.
22888 * typemanager.cs: runtime_handle_type, new global type.
22890 * class.cs (Property::Emit): Generate code for properties.
22892 2001-10-02 Ravi Pratap <ravi@ximian.com>
22894 * expression.cs (Unary::ResolveOperator): Find operators on base type
22895 too - we now conform exactly to the spec.
22897 (Binary::ResolveOperator): Same here.
22899 * class.cs (Operator::Define): Fix minor quirk in the tests.
22901 * ../errors/cs0215.cs : Added.
22903 * ../errors/cs0556.cs : Added.
22905 * ../errors/cs0555.cs : Added.
22907 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22909 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22910 single integer which is really efficient
22912 2001-10-01 Ravi Pratap <ravi@ximian.com>
22914 * expression.cs (Expression::ImplicitUserConversion): Use location
22915 even in the case when we are examining True operators.
22917 * class.cs (Operator::Define): Perform extensive checks to conform
22918 with the rules for operator overloading in the spec.
22920 * expression.cs (Expression::ImplicitReferenceConversion): Implement
22921 some of the other conversions mentioned in the spec.
22923 * typemanager.cs (array_type): New static member for the System.Array built-in
22926 (cloneable_interface): For System.ICloneable interface.
22928 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22929 we start resolving the tree and populating types.
22931 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22933 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22935 * expression.cs (Expression::ExprClassFromMemberInfo,
22936 Expression::Literalize): Create literal expressions from
22937 FieldInfos which are literals.
22939 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22940 type casts, because they were wrong. The test suite in tests
22943 (ImplicitNumericConversion): ushort to ulong requires a widening
22946 Int32 constant to long requires widening cast as well.
22948 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22949 for integers because the type on the stack is not i4.
22951 2001-09-30 Miguel de Icaza <miguel@ximian.com>
22953 * expression.cs (report118): require location argument.
22955 * parameter.cs: Do not dereference potential null value.
22957 * class.cs: Catch methods that lack the `new' keyword when
22958 overriding a name. Report warnings when `new' is used without
22959 anything being there to override.
22961 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22963 * class.cs: Only add constructor to hashtable if it is non-null
22964 (as now constructors can fail on define).
22966 (TypeManager, Class, Struct): Take location arguments.
22968 Catch field instance initialization in structs as errors.
22970 accepting_filter: a new filter for FindMembers that is static so
22971 that we dont create an instance per invocation.
22973 (Constructor::Define): Catch errors where a struct constructor is
22976 * cs-parser.jay: Pass location information for various new
22979 * delegate.cs (Delegate): take a location argument.
22981 * driver.cs: Do not call EmitCode if there were problesm in the
22982 Definition of the types, as many Builders wont be there.
22984 * decl.cs (Decl::Decl): Require a location argument.
22986 * cs-tokenizer.cs: Handle properly hex constants that can not fit
22987 into integers, and find the most appropiate integer for it.
22989 * literal.cs: Implement ULongLiteral.
22991 * rootcontext.cs: Provide better information about the location of
22992 failure when CreateType fails.
22994 2001-09-29 Miguel de Icaza <miguel@ximian.com>
22996 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22999 * expression.cs (Binary::CheckShiftArguments): Add missing type
23001 (Binary::ResolveOperator): Add type to the logical and and logical
23002 or, Bitwise And/Or and Exclusive Or code paths, it was missing
23005 (Binary::DoNumericPromotions): In the case where either argument
23006 is ulong (and most signed types combined with ulong cause an
23007 error) perform implicit integer constant conversions as well.
23009 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23011 * expression.cs (UserImplicitCast): Method should always be
23013 (Invocation::BetterConversion): Simplified test for IntLiteral.
23015 (Expression::ImplicitNumericConversion): Split this routine out.
23016 Put the code that performs implicit constant integer conversions
23019 (Expression::Resolve): Become a wrapper around DoResolve so we can
23020 check eclass and type being set after resolve.
23022 (Invocation::Badness): Remove this dead function
23024 (Binary::ResolveOperator): Do not compute the expensive argumnets
23025 unless we have a union for it.
23027 (Probe::Emit): Is needs to do an isinst and then
23028 compare against null.
23030 (::CanConvert): Added Location argument. If the Location argument
23031 is null (Location.Null), then we do not report errors. This is
23032 used by the `probe' mechanism of the Explicit conversion. We do
23033 not want to generate an error for something that the user
23034 explicitly requested to be casted. But the pipeline for an
23035 explicit cast first tests for potential implicit casts.
23037 So for now, if the Location is null, it means `Probe only' to
23038 avoid adding another argument. Might have to revise this
23041 (ClassCast): New class used to type cast objects into arbitrary
23042 classes (used in Explicit Reference Conversions).
23044 Implement `as' as well.
23046 Reverted all the patches from Ravi below: they were broken:
23048 * The use of `level' as a mechanism to stop recursive
23049 invocations is wrong. That was there just to catch the
23050 bug with a strack trace but not as a way of addressing
23053 To fix the problem we have to *understand* what is going
23054 on and the interactions and come up with a plan, not
23055 just get things going.
23057 * The use of the type conversion cache that I proposed
23058 last night had an open topic: How does this work across
23059 protection domains. A user defined conversion might not
23060 be public in the location where we are applying the
23061 conversion, a different conversion might be selected
23062 (ie, private A->B (better) but public B->A (worse),
23063 inside A, A->B applies, but outside it, B->A will
23066 * On top of that (ie, even if the above is solved),
23067 conversions in a cache need to be abstract. Ie, `To
23068 convert from an Int to a Short use an OpcodeCast', not
23069 `To convert from an Int to a Short use the OpcodeCast on
23070 the variable 5' (which is what this patch was doing).
23072 2001-09-28 Ravi Pratap <ravi@ximian.com>
23074 * expression.cs (Invocation::ConversionExists): Re-write to use
23075 the conversion cache
23077 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23078 cache all conversions done, not just user-defined ones.
23080 (Invocation::BetterConversion): The real culprit. Use ConversionExists
23081 to determine if a conversion exists instead of acutually trying to
23082 perform the conversion. It's faster too.
23084 (Expression::ConvertExplicit): Modify to use ConversionExists to check
23085 and only then attempt the implicit conversion.
23087 2001-09-28 Ravi Pratap <ravi@ximian.com>
23089 * expression.cs (ConvertImplicit): Use a cache for conversions
23090 already found. Check level of recursion and bail out if necessary.
23092 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23094 * typemanager.cs (string_concat_string_string, string_concat_object_object):
23095 Export standard methods that we expect for string operations.
23097 * statement.cs (Block::UsageWarning): Track usage of variables and
23098 report the errors for not used variables.
23100 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23103 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23105 * codegen.cs: remove unnneded code
23107 * expression.cs: Removed BuiltinTypeAccess class
23109 Fix the order in which implicit conversions are
23112 The previous fixed dropped support for boxed conversions (adding a
23113 test to the test suite now)
23115 (UserImplicitCast::CanConvert): Remove test for source being null,
23116 that code is broken. We should not feed a null to begin with, if
23117 we do, then we should track the bug where the problem originates
23118 and not try to cover it up here.
23120 Return a resolved expression of type UserImplicitCast on success
23121 rather than true/false. Ravi: this is what I was talking about,
23122 the pattern is to use a static method as a "constructor" for
23125 Also, do not create arguments until the very last minute,
23126 otherwise we always create the arguments even for lookups that
23127 will never be performed.
23129 (UserImplicitCast::Resolve): Eliminate, objects of type
23130 UserImplicitCast are born in a fully resolved state.
23132 * typemanager.cs (InitCoreTypes): Init also value_type
23133 (System.ValueType).
23135 * expression.cs (Cast::Resolve): First resolve the child expression.
23137 (LValue): Add new method AddressOf to be used by
23140 Change the argument of Store to take an EmitContext instead of an
23141 ILGenerator, because things like FieldExpr need to be able to call
23142 their children expression to generate the instance code.
23144 (Expression::Error, Expression::Warning): Sugar functions for
23147 (Expression::MemberLookup): Accept a TypeContainer instead of a
23148 Report as the first argument.
23150 (Expression::ResolvePrimary): Killed. I still want to improve
23151 this as currently the code is just not right.
23153 (Expression::ResolveMemberAccess): Simplify, but it is still
23156 (Unary::Resolve): Catch errors in AddressOf operators.
23158 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23159 index to a byte for the short-version, or the compiler will choose
23160 the wrong Emit call, which generates the wrong data.
23162 (ParameterReference::Emit, ::Store): same.
23164 (FieldExpr::AddressOf): Implement.
23166 * typemanager.cs: TypeManager: made public variable instead of
23169 * driver.cs: document --fatal.
23171 * report.cs (ErrorMessage, WarningMessage): new names for the old
23172 Error and Warning classes.
23174 * cs-parser.jay (member_access): Turn built-in access to types
23175 into a normal simplename
23177 2001-09-27 Ravi Pratap <ravi@ximian.com>
23179 * expression.cs (Invocation::BetterConversion): Fix to cope
23180 with q being null, since this was introducing a bug.
23182 * expression.cs (ConvertImplicit): Do built-in conversions first.
23184 2001-09-27 Ravi Pratap <ravi@ximian.com>
23186 * expression.cs (UserImplicitCast::Resolve): Fix bug.
23188 2001-09-27 Ravi Pratap <ravi@ximian.com>
23190 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23191 I had introduced long ago (what's new ?).
23193 * expression.cs (UserImplicitCast::CanConvert): Static method to do
23194 the work of all the checking.
23195 (ConvertImplicit): Call CanConvert and only then create object if necessary.
23196 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23198 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23199 that is the right way.
23201 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
23202 overloading resolution. Use everywhere instead of cutting and pasting code.
23204 (Binary::ResolveOperator): Use MakeUnionSet.
23206 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
23207 we have to convert to bool types. Not complete yet.
23209 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23211 * typemanager.cs (TypeManager::CSharpName): support ushort.
23213 * expression.cs (Expression::TryImplicitIntConversion): Attempts
23214 to provide an expression that performsn an implicit constant int
23215 conversion (section 6.1.6).
23216 (Expression::ConvertImplicitRequired): Reworked to include
23217 implicit constant expression conversions.
23219 (Expression::ConvertNumericExplicit): Finished.
23221 (Invocation::Emit): If InstanceExpression is null, then it means
23222 that we perform a call on this.
23224 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23226 * expression.cs (Unary::Emit): Remove some dead code.
23227 (Probe): Implement Resolve and Emit for `is'.
23228 (Expression::ConvertImplicitRequired): Attempt to do constant
23229 expression conversions here. Maybe should be moved to
23230 ConvertImplicit, but I am not sure.
23231 (Expression::ImplicitLongConstantConversionPossible,
23232 Expression::ImplicitIntConstantConversionPossible): New functions
23233 that tell whether is it possible to apply an implicit constant
23234 expression conversion.
23236 (ConvertNumericExplicit): Started work on explicit numeric
23239 * cs-parser.jay: Update operator constants.
23241 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23242 (Parameters::GetSignature): Hook up VerifyArgs here.
23243 (Parameters::VerifyArgs): Verifies that no two arguments have the
23246 * class.cs (Operator): Update the operator names to reflect the
23247 ones that the spec expects (as we are just stringizing the
23250 * expression.cs (Unary::ResolveOperator): Fix bug: Use
23251 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23252 previous usage did only work for our methods.
23253 (Expression::ConvertImplicit): Handle decimal implicit numeric
23254 conversions as well.
23255 (Expression::InternalTypeConstructor): Used to invoke constructors
23256 on internal types for default promotions.
23258 (Unary::Emit): Implement special handling for the pre/post
23259 increment/decrement for overloaded operators, as they need to have
23260 the same semantics as the other operators.
23262 (Binary::ResolveOperator): ditto.
23263 (Invocation::ConversionExists): ditto.
23264 (UserImplicitCast::Resolve): ditto.
23266 2001-09-26 Ravi Pratap <ravi@ximian.com>
23268 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23269 operator, return after emitting body. Regression tests pass again !
23271 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23272 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23273 (Invocation::OverloadResolve): Ditto.
23274 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23276 * everywhere : update calls to the above methods accordingly.
23278 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23280 * assign.cs (Assign): Make it inherit from ExpressionStatement.
23282 * expression.cs (ExpressionStatement): New base class used for
23283 expressions that can appear in statements, so that we can provide
23284 an alternate path to generate expression that do not leave a value
23287 (Expression::Emit, and all the derivatives): We no longer return
23288 whether a value is left on the stack or not. Every expression
23289 after being emitted leaves a single value on the stack.
23291 * codegen.cs (EmitContext::EmitStatementExpression): Use the
23292 facilties of ExpressionStatement if possible.
23294 * cs-parser.jay: Update statement_expression.
23296 2001-09-25 Miguel de Icaza <miguel@ximian.com>
23298 * driver.cs: Change the wording of message
23300 2001-09-25 Ravi Pratap <ravi@ximian.com>
23302 * expression.cs (Binary::ResolveOperator): Had forgottten to set
23303 the type of the expression to the return type of the method if
23304 we have an overloaded operator match ! The regression tests pass again !
23305 (Unary::ResolveOperator): Ditto.
23307 * expression.cs (Invocation::ConversionExists): Correct the member lookup
23308 to find "op_Implicit", not "implicit" ;-)
23309 (UserImplicitCast): New class to take care of user-defined implicit conversions.
23310 (ConvertImplicit, ForceConversion): Take TypeContainer argument
23312 * everywhere : Correct calls to the above accordingly.
23314 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23315 (ConvertImplicit): Do user-defined conversion if it exists.
23317 2001-09-24 Miguel de Icaza <miguel@ximian.com>
23319 * assign.cs: track location.
23320 (Resolve): Use implicit conversions on assignment.
23322 * literal.cs: Oops. Not good, Emit of short access values should
23323 pass (Bytes) or the wrong argument will be selected.
23325 * expression.cs (Unary::Emit): Emit code for -expr.
23327 (Unary::ResolveOperator): Handle `Substract' for non-constants
23328 (substract from zero from the non-constants).
23329 Deal with Doubles as well.
23331 (Expression::ConvertImplicitRequired): New routine that reports an
23332 error if no implicit conversion exists.
23334 (Invocation::OverloadResolve): Store the converted implicit
23335 expressions if we make them
23337 2001-09-24 Ravi Pratap <ravi@ximian.com>
23339 * class.cs (ConstructorInitializer): Take a Location argument.
23340 (ConstructorBaseInitializer): Same here.
23341 (ConstructorThisInitializer): Same here.
23343 * cs-parser.jay : Update all calls accordingly.
23345 * expression.cs (Unary, Binary, New): Take location argument.
23346 Update accordingly everywhere.
23348 * cs-parser.jay : Update all calls to the above to take a location
23351 * class.cs : Ditto.
23353 2001-09-24 Ravi Pratap <ravi@ximian.com>
23355 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23356 (Invocation::BetterConversion): Same here
23357 (Invocation::ConversionExists): Ditto.
23359 (Invocation::ConversionExists): Implement.
23361 2001-09-22 Ravi Pratap <ravi@ximian.com>
23363 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23364 Also take an additional TypeContainer argument.
23366 * All over : Pass in TypeContainer as argument to OverloadResolve.
23368 * typemanager.cs (CSharpName): Update to check for the string type and return
23371 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23374 2001-09-21 Ravi Pratap <ravi@ximian.com>
23376 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23377 (Invocation::BetterFunction): Implement.
23378 (Invocation::BetterConversion): Implement.
23379 (Invocation::ConversionExists): Skeleton, no implementation yet.
23381 Okay, things work fine !
23383 2001-09-21 Miguel de Icaza <miguel@ximian.com>
23385 * typemanager.cs: declare and load enum_type, delegate_type and
23388 * expression.cs (Expression::Emit): Now emit returns a value that
23389 tells whether a value is left on the stack or not. This strategy
23390 might be reveted tomorrow with a mechanism that would address
23391 multiple assignments.
23392 (Expression::report118): Utility routine to report mismatches on
23395 (Unary::Report23): Report impossible type/operator combination
23398 (Unary::IsIncrementableNumber): Whether the type can be
23399 incremented or decremented with add.
23400 (Unary::ResolveOperator): Also allow enumerations to be bitwise
23402 (Unary::ResolveOperator): Implement ++, !, ~,
23404 (Invocation::Emit): Deal with new Emit convetion.
23406 * All Expression derivatives: Updated their Emit method to return
23407 whether they leave values on the stack or not.
23409 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23410 stack for expressions that are statements.
23412 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23414 * expression.cs (LValue): New interface. Must be implemented by
23416 (LocalVariableReference, ParameterReference, FieldExpr): Implement
23419 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23420 interface for generating code, simplifies the code.
23422 2001-09-20 Ravi Pratap <ravi@ximian.com>
23424 * expression.cs (everywhere): Comment out return statements in ::Resolve
23425 methods to avoid the warnings.
23427 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23429 * driver.cs (parse): Report error 2001 if we can not open the
23432 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23435 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23438 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23439 otherwise nested blocks end up with the same index.
23441 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23443 * expression.cs: Instead of having FIXMEs in the Resolve
23444 functions, throw exceptions so it is obvious that we are facing a
23447 * cs-parser.jay (invocation_expression): Pass Location information.
23449 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23450 Use a basename for those routines because .NET does not like paths
23453 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23456 2001-09-19 Miguel de Icaza <miguel@ximian.com>
23458 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23459 are loading the correct data types (throws an exception if not).
23460 (TypeManager::InitCoreTypes): Use CoreLookupType
23462 * expression.cs (Unary::ResolveOperator): return the child
23463 expression for expressions which are just +expr.
23464 (Unary::ResolveOperator): Return negative literals for -LITERAL
23465 expressions (otherwise they are Unary {Literal}).
23466 (Invocation::Badness): Take into account `Implicit constant
23467 expression conversions'.
23469 * literal.cs (LongLiteral): Implement long literal class.
23470 (IntLiteral): export the `Value' of the intliteral.
23472 2001-09-19 Ravi Pratap <ravi@ximian.com>
23474 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23476 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
23477 instead of 'Operator'
23479 * expression.cs (Binary::ResolveOperator): Update accordingly.
23480 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23483 * cs-parser.jay (unary_expression): Update to use the new names.
23485 * gen-treedump.cs (GetUnary): Same here.
23487 * expression.cs (Unary::Resolve): Implement.
23488 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
23489 operators are found instead of making noise ;-)
23490 (Unary::ResolveOperator): New method to do precisely the same thing which
23491 Binary::ResolveOperator does for Binary expressions.
23492 (Unary.method, .Arguments): Add.
23493 (Unary::OperName): Implement.
23494 (Unary::ForceConversion): Copy and Paste !
23496 * class.cs (Operator::Define): Fix a small bug for the case when we have
23499 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23500 for the inbuilt operators. Only overloading works for now ;-)
23502 2001-09-18 Miguel de Icaza <miguel@ximian.com>
23504 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23505 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23507 * expression.cs (This::Emit): Implement.
23508 (This::Resolve): Implement.
23509 (TypeOf:Resolve): Implement.
23510 (Expression::ResolveSimpleName): Add an implicit this to instance
23512 (MemberAccess::Resolve): Deal with Parameters and Fields.
23513 Bind instance variable to Field expressions.
23514 (FieldExpr::Instance): New field used to track the expression that
23515 represents the object instance.
23516 (FieldExpr::Resolve): Track potential errors from MemberLookup not
23518 (FieldExpr::Emit): Implement.
23520 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23521 the last instruction contains a return opcode to avoid generating
23522 the last `ret' instruction (this generates correct code, and it is
23523 nice to pass the peverify output).
23525 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23526 initializer for static and instance variables.
23527 (Constructor::Emit): Allow initializer to be null in the case of
23528 static constructors. Only emit initializer for instance
23531 (TypeContainer::FindMembers): Return a null array if there are no
23534 Also fix the code for the MemberTypes.Method branch, as it was not
23535 scanning that for operators (or tried to access null variables before).
23537 * assign.cs (Assign::Emit): Handle instance and static fields.
23541 * driver.cs: Stop compilation if there are parse errors.
23543 * cs-parser.jay (constructor_declaration): Provide default base
23544 initializer for non-static constructors.
23545 (constructor_declarator): Do not provide a default base
23546 initializers if none was specified.
23547 Catch the fact that constructors should not have parameters.
23549 * class.cs: Do not emit parent class initializers for static
23550 constructors, that should be flagged as an error.
23552 2001-09-18 Ravi Pratap <ravi@ximian.com>
23554 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23555 Move back code into TypeContainer::Populate.
23557 2001-09-18 Ravi Pratap <ravi@ximian.com>
23559 * class.cs (TypeContainer::AddConstructor): Fix the check to
23560 compare against Name, not Basename.
23561 (Operator::OpType): Change Plus and Minus to Add and Subtract.
23563 * cs-parser.jay : Update accordingly.
23565 * class.cs (TypeContainer::FindMembers): For the case where we are searching
23566 for methods, don't forget to look into the operators too.
23567 (RegisterMethodBuilder): Helper method to take care of this for
23568 methods, constructors and operators.
23569 (Operator::Define): Completely revamp.
23570 (Operator.OperatorMethod, MethodName): New fields.
23571 (TypeContainer::Populate): Move the registering of builders into
23572 RegisterMethodBuilder.
23573 (Operator::Emit): Re-write.
23575 * expression.cs (Binary::Emit): Comment out code path to emit method
23576 invocation stuff for the case when we have a user defined operator. I am
23577 just not able to get it right !
23579 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23581 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23584 (Expression::MemberLookup): Provide a version that allows to
23585 specify the MemberTypes and BindingFlags.
23587 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23588 so it was not fetching variable information from outer blocks.
23590 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23591 Beforefieldinit as it was buggy.
23593 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23594 that Ravi put here.
23596 * class.cs (Constructor::Emit): Only emit if block is not null.
23597 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23598 deal with this by semantically definining it as if the user had
23601 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23602 constructors as we now "emit" them at a higher level.
23604 (TypeContainer::DefineDefaultConstructor): Used to define the
23605 default constructors if none was provided.
23607 (ConstructorInitializer): Add methods Resolve and Emit.
23609 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23611 2001-09-17 Ravi Pratap <ravi@ximian.com>
23613 * class.cs (TypeContainer::EmitDefaultConstructor): Register
23614 the default constructor builder with our hashtable for methodbuilders
23617 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23618 and argument_count is 0 in which case we have a match.
23619 (Binary::ResolveOperator): More null checking and miscellaneous coding
23622 2001-09-17 Ravi Pratap <ravi@ximian.com>
23624 * rootcontext.cs (IsNameSpace): Compare against null.
23626 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23628 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23629 and Unary::Operator.
23631 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23634 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23635 we have overloaded operators.
23636 (Binary::ResolveOperator): Implement the part which does the operator overload
23639 * class.cs (Operator::Emit): Implement.
23640 (TypeContainer::Emit): Emit the operators we have too.
23642 * expression.cs (Binary::Emit): Update to emit the appropriate code for
23643 the case when we have a user-defined operator.
23645 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23647 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23649 2001-09-16 Ravi Pratap <ravi@ximian.com>
23651 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23652 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23653 (Constructor::Emit): Implement.
23654 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23655 if we have no work to do.
23656 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
23659 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23660 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23662 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23665 2001-09-15 Ravi Pratap <ravi@ximian.com>
23667 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23669 (Tree::RecordNamespace): Method to do what the name says ;-)
23670 (Tree::Namespaces): Property to get at the namespaces hashtable.
23672 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
23675 * rootcontext.cs (IsNamespace): Fixed it :-)
23677 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23679 * class.cs (TypeContainer::FindMembers): Add support for
23681 (MethodCore): New class that encapsulates both the shared aspects
23682 of a Constructor and a Method.
23683 (Method, Constructor): Factored pieces into MethodCore.
23685 * driver.cs: Added --fatal which makes errors throw exceptions.
23686 Load System assembly as well as part of the standard library.
23688 * report.cs: Allow throwing exceptions on errors for debugging.
23690 * modifiers.cs: Do not use `parent', instead use the real type
23691 container to evaluate permission settings.
23693 * class.cs: Put Ravi's patch back in. He is right, and we will
23694 have to cope with the
23696 2001-09-14 Ravi Pratap <ravi@ximian.com>
23698 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23699 FamORAssem, not FamANDAssem.
23701 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23703 * driver.cs: Added --parse option that only parses its input files
23706 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
23707 incorrect. IsTopLevel is not used to tell whether an object is
23708 root_types or not (that can be achieved by testing this ==
23709 root_types). But to see if this is a top-level *class* (not
23710 necessarly our "toplevel" container).
23712 2001-09-14 Ravi Pratap <ravi@ximian.com>
23714 * enum.cs (Enum::Define): Modify to call the Lookup method on the
23715 parent instead of a direct call to GetType.
23717 2001-09-14 Ravi Pratap <ravi@ximian.com>
23719 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23720 Modifiers.TypeAttr. This should just be a call to that method.
23722 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23723 object so that we can determine if we are top-level or not.
23725 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
23728 * enum.cs (Enum::Define): Ditto.
23730 * modifiers.cs (FieldAttr): Re-write.
23732 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23733 (TypeContainer::HaveStaticConstructor): New property to provide access
23734 to precisely that info.
23736 * modifiers.cs (MethodAttr): Re-write.
23737 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23739 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23740 of top-level types as claimed.
23742 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23744 * expression.cs (MemberLookup): Fruitless attempt to lookup
23745 constructors. Maybe I need to emit default constructors? That
23746 might be it (currently .NET emits this for me automatically).
23747 (Invocation::OverloadResolve): Cope with Arguments == null.
23748 (Invocation::EmitArguments): new function, shared by the new
23749 constructor and us.
23750 (Invocation::Emit): Handle static and instance methods. Emit
23751 proper call instruction for virtual or non-virtual invocations.
23752 (New::Emit): Implement.
23753 (New::Resolve): Implement.
23754 (MemberAccess:Resolve): Implement.
23755 (MethodGroupExpr::InstanceExpression): used conforming to the spec
23756 to track instances.
23757 (FieldExpr::Resolve): Set type.
23759 * support.cs: Handle empty arguments.
23761 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23762 SimpleLookup): Auxiliary routines to help parse a qualifier
23765 Update qualifier_identifier rule.
23767 * codegen.cs: Removed debugging messages.
23769 * class.cs: Make this a global thing, this acts just as a "key" to
23770 objects that we might have around.
23772 (Populate): Only initialize method_builders_to_methods once.
23774 * expression.cs (PropertyExpr): Initialize type from the
23777 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23778 Resolve pattern. Attempt to implicitly convert value to boolean.
23781 * expression.cs: Set the type for the int32/int32 argument case.
23782 (Binary::ResolveOperator): Set the return type to boolean for
23783 comparission operators
23785 * typemanager.cs: Remove debugging print code.
23787 (Invocation::Resolve): resolve type.
23789 * class.cs: Allocate a MemberInfo of the correct size, as the code
23790 elsewhere depends on the test to reflect the correct contents.
23792 (Method::) Keep track of parameters, due to System.Reflection holes
23794 (TypeContainer::Populate): Keep track of MethodBuilders to Method
23797 (TypeContainer::FindMembers): Use ArrayList and then copy an array
23798 of the exact size and return that.
23800 (Class::LookupMethodByBuilder): New function that maps
23801 MethodBuilders to its methods. Required to locate the information
23802 on methods because System.Reflection bit us again.
23804 * support.cs: New file, contains an interface ParameterData and
23805 two implementations: ReflectionParameters and InternalParameters
23806 used to access Parameter information. We will need to grow this
23809 * expression.cs (Invocation::GetParameterData): implement a cache
23810 and a wrapper around the ParameterData creation for methods.
23811 (Invocation::OverloadResolve): Use new code.
23813 2001-09-13 Ravi Pratap <ravi@ximian.com>
23815 * class.cs (TypeContainer::EmitField): Remove and move into
23816 (Field::Define): here and modify accordingly.
23817 (Field.FieldBuilder): New member.
23818 (TypeContainer::Populate): Update accordingly.
23819 (TypeContainer::FindMembers): Implement.
23821 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23823 * statement.cs: (VariableInfo::VariableType): New field to be
23824 initialized with the full type once it is resolved.
23826 2001-09-12 Miguel de Icaza <miguel@ximian.com>
23828 * parameter.cs (GetParameterInfo): Use a type cache to compute
23829 things only once, and to reuse this information
23831 * expression.cs (LocalVariableReference::Emit): Implement.
23832 (OpcodeCast::Emit): fix.
23834 (ParameterReference::Resolve): Implement.
23835 (ParameterReference::Emit): Implement.
23837 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23838 that are expressions need to stay as Expressions.
23840 * typemanager.cs (CSharpName): Returns the C# name of a type if
23843 * expression.cs (Expression::ConvertImplicit): New function that
23844 implements implicit type conversions.
23846 (Expression::ImplicitReferenceConversion): Implements implicit
23847 reference conversions.
23849 (EmptyCast): New type for transparent casts.
23851 (OpcodeCast): New type for casts of types that are performed with
23852 a sequence of bytecodes.
23854 (BoxedCast): New type used for casting value types into reference
23855 types. Emits a box opcode.
23857 (Binary::DoNumericPromotions): Implements numeric promotions of
23858 and computation of the Binary::Type.
23860 (Binary::EmitBranchable): Optimization.
23862 (Binary::Emit): Implement code emission for expressions.
23864 * typemanager.cs (TypeManager): Added two new core types: sbyte
23867 2001-09-12 Ravi Pratap <ravi@ximian.com>
23869 * class.cs (TypeContainer::FindMembers): Method which does exactly
23870 what Type.FindMembers does, only we don't have to use reflection. No
23871 implementation yet.
23873 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23874 typecontainer objects as we need to get at them.
23875 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23877 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23878 typecontainer object.
23880 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23881 of just a Report object.
23883 2001-09-11 Ravi Pratap <ravi@ximian.com>
23885 * class.cs (Event::Define): Go back to using the prefixes "add_" and
23887 (TypeContainer::Populate): Now define the delegates of the type too.
23888 (TypeContainer.Delegates): Property to access the list of delegates defined
23891 * delegates.cs (Delegate::Define): Implement partially.
23893 * modifiers.cs (TypeAttr): Handle more flags.
23895 2001-09-11 Ravi Pratap <ravi@ximian.com>
23897 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23899 (Operator::Define): Re-write logic to get types by using the LookupType method
23900 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23901 (Indexer::Define): Ditto.
23902 (Event::Define): Ditto.
23903 (Property::Define): Ditto.
23905 2001-09-10 Ravi Pratap <ravi@ximian.com>
23907 * class.cs (TypeContainer::Populate): Now define operators too.
23908 (TypeContainer.Operators): New property to access the list of operators
23910 (Operator.OperatorMethodBuilder): New member to hold the method builder
23911 for the operator we are defining.
23912 (Operator::Define): Implement.
23914 2001-09-10 Ravi Pratap <ravi@ximian.com>
23916 * class.cs (Event::Define): Make the prefixes of the accessor methods
23917 addOn_ and removeOn_
23919 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23920 of the location being passed in too. Ideally, this should go later since all
23921 error reporting should be done through the Report object.
23923 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23924 (Populate): Iterate thru the indexers we have and define them too.
23925 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23926 for the get and set accessors.
23927 (Indexer::Define): Implement.
23929 2001-09-09 Miguel de Icaza <miguel@ximian.com>
23931 * expression.cs (Binary::Resolve): Beginning of it. I scratched
23932 my previous implementation, did not work.
23934 * typemanager.cs: Add a couple of missing types (the longs).
23936 * literal.cs: Use TypeManager.bool_type instead of getting it.
23938 * expression.cs (EventExpr): New kind of expressions.
23939 (Expressio::ExprClassFromMemberInfo): finish
23941 2001-09-08 Miguel de Icaza <miguel@ximian.com>
23943 * assign.cs: Emit stores to static fields differently.
23945 2001-09-08 Ravi Pratap <ravi@ximian.com>
23947 * Merge in changes and adjust code to tackle conflicts. Backed out my
23948 code in Assign::Resolve ;-)
23950 2001-09-08 Ravi Pratap <ravi@ximian.com>
23952 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23953 instead Report.Error and also pass in the location.
23954 (CSharpParser::Lexer): New readonly property to return the reference
23955 to the Tokenizer object.
23956 (declare_local_variables): Use Report.Error with location instead of plain
23960 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23961 (Operator.CheckBinaryOperator): Ditto.
23963 * cs-parser.jay (operator_declarator): Update accordingly.
23965 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23966 (CheckBinaryOperator): Same here.
23968 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23969 on the name without any prefixes of namespace names etc. This is because we
23970 already might have something already fully qualified like
23971 'System.Console.WriteLine'
23973 * assign.cs (Resolve): Begin implementation. Stuck ;-)
23975 2001-09-07 Ravi Pratap <ravi@ximian.com>
23977 * cs-tokenizer.cs (location): Return a string which also contains
23980 * expression.cs (ElementAccess): New class for expressions of the
23981 type 'element access.'
23982 (BaseAccess): New class for expressions of the type 'base access.'
23983 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23986 * cs-parser.jay (element_access): Implement action.
23987 (base_access): Implement actions.
23988 (checked_expression, unchecked_expression): Implement.
23990 * cs-parser.jay (local_variable_type): Correct and implement.
23991 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23993 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23995 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23996 name and the specifiers.
23998 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24000 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
24001 making them all public ;-)
24003 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24006 2001-09-07 Miguel de Icaza <miguel@ximian.com>
24008 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24010 (FieldExpr, PropertyExprs): New resolved expressions.
24011 (SimpleName::MemberStaticCheck): Perform static checks for access
24012 to non-static fields on static methods. Maybe this should be
24013 generalized for MemberAccesses.
24014 (SimpleName::ResolveSimpleName): More work on simple name
24017 * cs-parser.jay (primary_expression/qualified_identifier): track
24018 the parameter index.
24020 * codegen.cs (CodeGen::Save): Catch save exception, report error.
24021 (EmitContext::EmitBoolExpression): Chain to expression generation
24022 instead of temporary hack.
24023 (::EmitStatementExpression): Put generic expression code generation.
24025 * assign.cs (Assign::Emit): Implement variable assignments to
24026 local variables, parameters and fields.
24028 2001-09-06 Miguel de Icaza <miguel@ximian.com>
24030 * statement.cs (Block::GetVariableInfo): New method, returns the
24031 VariableInfo for a variable name in a block.
24032 (Block::GetVariableType): Implement in terms of GetVariableInfo
24034 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24035 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24037 2001-09-06 Ravi Pratap <ravi@ximian.com>
24039 * cs-parser.jay (operator_declaration): Continue on my quest : update
24040 to take attributes argument.
24041 (event_declaration): Ditto.
24042 (enum_declaration): Ditto.
24043 (indexer_declaration): Ditto.
24045 * class.cs (Operator::Operator): Update constructor accordingly.
24046 (Event::Event): Ditto.
24048 * delegate.cs (Delegate::Delegate): Same here.
24050 * enum.cs (Enum::Enum): Same here.
24052 2001-09-05 Ravi Pratap <ravi@ximian.com>
24054 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24056 * ../tests/cs0658.cs : New file to demonstrate error 0658.
24058 * attribute.cs (Attributes): New class to encapsulate all attributes which were
24059 being passed around as an arraylist.
24060 (Attributes::AddAttribute): Method to add attribute sections.
24062 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24063 (struct_declaration): Update accordingly.
24064 (constant_declaration): Update.
24065 (field_declaration): Update.
24066 (method_header): Update.
24067 (fixed_parameter): Update.
24068 (parameter_array): Ditto.
24069 (property_declaration): Ditto.
24070 (destructor_declaration): Ditto.
24072 * class.cs (Struct::Struct): Update constructors accordingly.
24073 (Class::Class): Ditto.
24074 (Field::Field): Ditto.
24075 (Method::Method): Ditto.
24076 (Property::Property): Ditto.
24077 (TypeContainer::OptAttribute): update property's return type.
24079 * interface.cs (Interface.opt_attributes): New member.
24080 (Interface::Interface): Update to take the extra Attributes argument.
24082 * parameter.cs (Parameter::Parameter): Ditto.
24084 * constant.cs (Constant::Constant): Ditto.
24086 * interface.cs (InterfaceMemberBase): New OptAttributes field.
24087 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
24088 the attributes as a parameter.
24089 (InterfaceProperty): Update constructor call.
24090 (InterfaceEvent): Ditto.
24091 (InterfaceMethod): Ditto.
24092 (InterfaceIndexer): Ditto.
24094 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
24095 pass the attributes too.
24096 (interface_event_declaration): Ditto.
24097 (interface_property_declaration): Ditto.
24098 (interface_method_declaration): Ditto.
24099 (interface_declaration): Ditto.
24101 2001-09-05 Miguel de Icaza <miguel@ximian.com>
24103 * class.cs (Method::Define): Track the "static Main" definition to
24104 create an entry point.
24106 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24107 EntryPoint if we find it.
24109 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24110 (EmitContext::ig): Make this variable public.
24112 * driver.cs: Make the default output file be the first file name
24113 with the .exe extension.
24115 Detect empty compilations
24117 Handle various kinds of output targets. Handle --target and
24118 rename -t to --dumper.
24120 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24121 methods inherited from Expression return now an Expression. This
24122 will is used during the tree rewriting as we resolve them during
24125 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24126 the spec. Missing entirely is the information about
24127 accessability of elements of it.
24129 (Expression::ExprClassFromMemberInfo): New constructor for
24130 Expressions that creates a fully initialized Expression based on
24131 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24134 (Invocation::Resolve): Begin implementing resolution of invocations.
24136 * literal.cs (StringLiteral): Implement Emit.
24138 2001-09-05 Ravi Pratap <ravi@ximian.com>
24140 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24143 2001-09-04 Ravi Pratap <ravi@ximian.com>
24145 * cs-parser.jay (attribute_arguments): Implement actions.
24146 (attribute): Fix bug in production. Implement action.
24147 (attribute_list): Implement.
24148 (attribute_target): Implement.
24149 (attribute_target_specifier, opt_target_specifier): Implement
24150 (CheckAttributeTarget): New method to check if the attribute target
24152 (attribute_section): Implement.
24153 (opt_attributes): Implement.
24155 * attribute.cs : New file to handle attributes.
24156 (Attribute): Class to hold attribute info.
24158 * cs-parser.jay (opt_attribute_target_specifier): Remove production
24159 (attribute_section): Modify production to use 2 different rules to
24160 achieve the same thing. 1 s/r conflict down !
24161 Clean out commented, useless, non-reducing dimension_separator rules.
24163 * class.cs (TypeContainer.attributes): New member to hold list
24164 of attributes for a type.
24165 (Struct::Struct): Modify to take one more argument, the attribute list.
24166 (Class::Class): Ditto.
24167 (Field::Field): Ditto.
24168 (Method::Method): Ditto.
24169 (Property::Property): Ditto.
24171 * cs-parser.jay (struct_declaration): Update constructor call to
24172 pass in the attributes too.
24173 (class_declaration): Ditto.
24174 (constant_declaration): Ditto.
24175 (field_declaration): Ditto.
24176 (method_header): Ditto.
24177 (fixed_parameter): Ditto.
24178 (parameter_array): Ditto.
24179 (property_declaration): Ditto.
24181 * constant.cs (Constant::Constant): Update constructor similarly.
24182 Use System.Collections.
24184 * parameter.cs (Parameter::Parameter): Update as above.
24186 2001-09-02 Ravi Pratap <ravi@ximian.com>
24188 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24189 (TypeContainer.delegates): New member to hold list of delegates.
24191 * cs-parser.jay (delegate_declaration): Implement the action correctly
24192 this time as I seem to be on crack ;-)
24194 2001-09-02 Miguel de Icaza <miguel@ximian.com>
24196 * rootcontext.cs (RootContext::IsNamespace): new function, used to
24197 tell whether an identifier represents a namespace.
24199 * expression.cs (NamespaceExpr): A namespace expression, used only
24200 temporarly during expression resolution.
24201 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24202 utility functions to resolve names on expressions.
24204 2001-09-01 Miguel de Icaza <miguel@ximian.com>
24206 * codegen.cs: Add hook for StatementExpressions.
24208 * class.cs: Fix inverted test for static flag in methods.
24210 2001-09-02 Ravi Pratap <ravi@ximian.com>
24212 * class.cs (Operator::CheckUnaryOperator): Correct error number used
24213 to make it coincide with MS' number.
24214 (Operator::CheckBinaryOperator): Ditto.
24216 * ../errors/errors.txt : Remove error numbers added earlier.
24218 * ../errors/cs1019.cs : Test case for error # 1019
24220 * ../errros/cs1020.cs : Test case for error # 1020
24222 * cs-parser.jay : Clean out commented cruft.
24223 (dimension_separators, dimension_separator): Comment out. Ostensibly not
24224 used anywhere - non-reducing rule.
24225 (namespace_declarations): Non-reducing rule - comment out.
24227 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24228 with TypeContainer::AddEnum.
24230 * delegate.cs : New file for delegate handling classes.
24231 (Delegate): Class for declaring delegates.
24233 * makefile : Update.
24235 * cs-parser.jay (delegate_declaration): Implement.
24237 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
24239 * class.cs (Event::Define): Implement.
24240 (Event.EventBuilder): New member.
24242 * class.cs (TypeContainer::Populate): Update to define all enums and events
24244 (Events): New property for the events arraylist we hold. Shouldn't we move to using
24245 readonly fields for all these cases ?
24247 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24249 * class.cs (Property): Revamp to use the convention of making fields readonly.
24250 Accordingly modify code elsewhere.
24252 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24253 the Define method of the Property class.
24255 * class.cs : Clean up applied patch and update references to variables etc. Fix
24257 (TypeContainer::Populate): Update to define all the properties we have. Also
24258 define all enumerations.
24260 * enum.cs (Define): Implement.
24262 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24264 * cs-parser.jay (overloadable_operator): The semantic value is an
24265 enum of the Operator class.
24266 (operator_declarator): Implement actions.
24267 (operator_declaration): Implement.
24269 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24270 validity of definitions.
24271 (Operator::CheckBinaryOperator): Static method to check for binary operators
24272 (TypeContainer::AddOperator): New method to add an operator to a type.
24274 * cs-parser.jay (indexer_declaration): Added line to actually call the
24275 AddIndexer method so it gets added ;-)
24277 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
24278 already taken care of by the MS compiler ?
24280 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24282 * class.cs (Operator): New class for operator declarations.
24283 (Operator::OpType): Enum for the various operators.
24285 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24287 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24288 ostensibly handle this in semantic analysis.
24290 * cs-parser.jay (general_catch_clause): Comment out
24291 (specific_catch_clauses, specific_catch_clause): Ditto.
24292 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24293 (catch_args, opt_catch_args): New productions.
24294 (catch_clause): Rewrite to use the new productions above
24295 (catch_clauses): Modify accordingly.
24296 (opt_catch_clauses): New production to use in try_statement
24297 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24298 and re-write the code in the actions to extract the specific and
24299 general catch clauses by being a little smart ;-)
24301 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24302 Hooray, try and catch statements parse fine !
24304 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24306 * statement.cs (Block::GetVariableType): Fix logic to extract the type
24307 string from the hashtable of variables.
24309 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24310 I end up making that mistake ;-)
24311 (catch_clauses): Fixed gross error which made Key and Value of the
24312 DictionaryEntry the same : $1 !!
24314 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24316 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24318 * cs-parser.jay (event_declaration): Correct to remove the semicolon
24319 when the add and remove accessors are specified.
24321 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24323 * cs-parser.jay (IndexerDeclaration): New helper class to hold
24324 information about indexer_declarator.
24325 (indexer_declarator): Implement actions.
24326 (parsing_indexer): New local boolean used to keep track of whether
24327 we are parsing indexers or properties. This is necessary because
24328 implicit_parameters come into picture even for the get accessor in the
24329 case of an indexer.
24330 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24332 * class.cs (Indexer): New class for indexer declarations.
24333 (TypeContainer::AddIndexer): New method to add an indexer to a type.
24334 (TypeContainer::indexers): New member to hold list of indexers for the
24337 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24339 * cs-parser.jay (add_accessor_declaration): Implement action.
24340 (remove_accessor_declaration): Implement action.
24341 (event_accessors_declaration): Implement
24342 (variable_declarators): swap statements for first rule - trivial.
24344 * class.cs (Event): New class to hold information about event
24346 (TypeContainer::AddEvent): New method to add an event to a type
24347 (TypeContainer::events): New member to hold list of events.
24349 * cs-parser.jay (event_declaration): Implement actions.
24351 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24353 * cs-parser.jay (dim_separators): Implement. Make it a string
24354 concatenating all the commas together, just as they appear.
24355 (opt_dim_separators): Modify accordingly
24356 (rank_specifiers): Update accordingly. Basically do the same
24357 thing - instead, collect the brackets here.
24358 (opt_rank_sepcifiers): Modify accordingly.
24359 (array_type): Modify to actually return the complete type string
24360 instead of ignoring the rank_specifiers.
24361 (expression_list): Implement to collect the expressions
24362 (variable_initializer): Implement. We make it a list of expressions
24363 essentially so that we can handle the array_initializer case neatly too.
24364 (variable_initializer_list): Implement.
24365 (array_initializer): Make it a list of variable_initializers
24366 (opt_array_initializer): Modify accordingly.
24368 * expression.cs (New::NType): Add enumeration to help us
24369 keep track of whether we have an object/delegate creation
24370 or an array creation.
24371 (New:NewType, New::Rank, New::Indices, New::Initializers): New
24372 members to hold data about array creation.
24373 (New:New): Modify to update NewType
24374 (New:New): New Overloaded contructor for the array creation
24377 * cs-parser.jay (array_creation_expression): Implement to call
24378 the overloaded New constructor.
24380 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
24382 * class.cs (TypeContainer::Constructors): Return member
24383 constructors instead of returning null.
24385 2001-08-26 Miguel de Icaza <miguel@ximian.com>
24387 * typemanager.cs (InitCoreTypes): Initialize the various core
24388 types after we have populated the type manager with the user
24389 defined types (this distinction will be important later while
24390 compiling corlib.dll)
24392 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24393 on Expression Classification. Now all expressions have a method
24394 `Resolve' and a method `Emit'.
24396 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24397 generation from working. Also add some temporary debugging
24400 2001-08-24 Miguel de Icaza <miguel@ximian.com>
24402 * codegen.cs: Lots of code generation pieces. This is only the
24403 beginning, will continue tomorrow with more touches of polish. We
24404 handle the fundamentals of if, while, do, for, return. Others are
24405 trickier and I need to start working on invocations soon.
24407 * gen-treedump.cs: Bug fix, use s.Increment here instead of
24410 * codegen.cs (EmitContext): New struct, used during code
24411 emission to keep a context. Most of the code generation will be
24414 * cs-parser.jay: Add embedded blocks to the list of statements of
24415 this block. So code generation proceeds in a top down fashion.
24417 2001-08-23 Miguel de Icaza <miguel@ximian.com>
24419 * statement.cs: Add support for multiple child blocks.
24421 2001-08-22 Miguel de Icaza <miguel@ximian.com>
24423 * codegen.cs (EmitCode): New function, will emit the code for a
24424 Block of code given a TypeContainer and its ILGenerator.
24426 * statement.cs (Block): Standard public readonly optimization.
24427 (Block::Block constructors): Link children.
24428 (Block::Child): Child Linker.
24429 (Block::EmitVariables): Emits IL variable declarations.
24431 * class.cs: Drop support for MethodGroups here, delay until
24433 (Method::): Applied the same simplification that I did before, and
24434 move from Properties to public readonly fields.
24435 (Method::ParameterTypes): Returns the parameter types for the
24436 function, and implements a cache that will be useful later when I
24437 do error checking and the semantic analysis on the methods is
24439 (Constructor::GetCallingConvention): Renamed from CallingConvetion
24440 and made a method, optional argument tells whether this is a class
24441 or a structure to apply the `has-this' bit.
24442 (Method::GetCallingConvention): Implement, returns the calling
24444 (Method::Define): Defines the type, a second pass is performed
24445 later to populate the methods.
24447 (Constructor::ParameterTypes): implement a cache similar to the
24448 one on Method::ParameterTypes, useful later when we do semantic
24451 (TypeContainer::EmitMethod): New method. Emits methods.
24453 * expression.cs: Removed MethodGroup class from here.
24455 * parameter.cs (Parameters::GetCallingConvention): new method.
24457 2001-08-21 Miguel de Icaza <miguel@ximian.com>
24459 * class.cs (TypeContainer::Populate): Drop RootContext from the
24462 (Constructor::CallingConvention): Returns the calling convention.
24463 (Constructor::ParameterTypes): Returns the constructor parameter
24466 (TypeContainer::AddConstructor): Keep track of default constructor
24467 and the default static constructor.
24469 (Constructor::) Another class that starts using `public readonly'
24470 instead of properties.
24472 (Constructor::IsDefault): Whether this is a default constructor.
24474 (Field::) use readonly public fields instead of properties also.
24476 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24477 track of static constructors; If none is used, turn on
24478 BeforeFieldInit in the TypeAttributes.
24480 * cs-parser.jay (opt_argument_list): now the return can be null
24481 for the cases where there are no arguments.
24483 (constructor_declarator): If there is no implicit `base' or
24484 `this', then invoke the default parent constructor.
24486 * modifiers.cs (MethodAttr): New static function maps a set of
24487 modifiers flags into a MethodAttributes enum
24488 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
24489 MethodAttr, TypeAttr to represent the various mappings where the
24490 modifiers are used.
24491 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
24493 2001-08-19 Miguel de Icaza <miguel@ximian.com>
24495 * parameter.cs (GetParameterInfo): Fix bug where there would be no
24498 * interface.cs (PopulateIndexer): Implemented the code generator
24499 for interface indexers.
24501 2001-08-17 Miguel de Icaza <miguel@ximian.com>
24503 * interface.cs (InterfaceMemberBase): Now we track the new status
24506 (PopulateProperty): Implement property population. Woohoo! Got
24507 Methods and Properties going today.
24509 Removed all the properties for interfaces, and replaced them with
24510 `public readonly' fields.
24512 2001-08-16 Miguel de Icaza <miguel@ximian.com>
24514 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24515 initialize their hashtables/arraylists only when they are needed
24516 instead of doing this always.
24518 * parameter.cs: Handle refs and out parameters.
24520 * cs-parser.jay: Use an ArrayList to construct the arguments
24521 instead of the ParameterCollection, and then cast that to a
24524 * parameter.cs: Drop the use of ParameterCollection and use
24525 instead arrays of Parameters.
24527 (GetParameterInfo): Use the Type, not the Name when resolving
24530 2001-08-13 Miguel de Icaza <miguel@ximian.com>
24532 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24533 and instead use public readonly fields.
24535 * class.cs: Put back walking code for type containers.
24537 2001-08-11 Miguel de Icaza <miguel@ximian.com>
24539 * class.cs (MakeConstant): Code to define constants.
24541 * rootcontext.cs (LookupType): New function. Used to locate types
24544 2001-08-08 Miguel de Icaza <miguel@ximian.com>
24546 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
24547 this System.Reflection code is. Kudos to Microsoft
24549 * typemanager.cs: Implement a type cache and avoid loading all
24550 types at boot time. Wrap in LookupType the internals. This made
24551 the compiler so much faster. Wow. I rule!
24553 * driver.cs: Make sure we always load mscorlib first (for
24554 debugging purposes, nothing really important).
24556 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
24557 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
24559 * rootcontext.cs: Lookup types on their namespace; Lookup types
24560 on namespaces that have been imported using the `using' keyword.
24562 * class.cs (TypeContainer::TypeAttr): Virtualize.
24563 (Class::TypeAttr): Return attributes suitable for this bad boy.
24564 (Struct::TypeAttr): ditto.
24565 Handle nested classes.
24566 (TypeContainer::) Remove all the type visiting code, it is now
24567 replaced with the rootcontext.cs code
24569 * rootcontext.cs (GetClassBases): Added support for structs.
24571 2001-08-06 Miguel de Icaza <miguel@ximian.com>
24573 * interface.cs, statement.cs, class.cs, parameter.cs,
24574 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24575 Drop use of TypeRefs, and use strings instead.
24577 2001-08-04 Miguel de Icaza <miguel@ximian.com>
24581 * class.cs (Struct::Struct): set the SEALED flags after
24582 checking the modifiers.
24583 (TypeContainer::TypeAttr): new property, returns the
24584 TypeAttributes for a class.
24586 * cs-parser.jay (type_list): Oops, list production was creating a
24587 new list of base types.
24589 * rootcontext.cs (StdLib): New property.
24590 (GetInterfaceTypeByName): returns an interface by type name, and
24591 encapsulates error handling here.
24592 (GetInterfaces): simplified.
24593 (ResolveTree): Encapsulated all the tree resolution here.
24594 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24597 * driver.cs: Add support for --nostdlib, to avoid loading the
24598 default assemblies.
24599 (Main): Do not put tree resolution here.
24601 * rootcontext.cs: Beginning of the class resolution.
24603 2001-08-03 Miguel de Icaza <miguel@ximian.com>
24605 * rootcontext.cs: Provide better error reporting.
24607 * cs-parser.jay (interface_base): set our $$ to be interfaces.
24609 * rootcontext.cs (CreateInterface): Handle the case where there
24610 are no parent interfaces.
24612 (CloseTypes): Routine to flush types at the end.
24613 (CreateInterface): Track types.
24614 (GetInterfaces): Returns an array of Types from the list of
24615 defined interfaces.
24617 * typemanager.c (AddUserType): Mechanism to track user types (puts
24618 the type on the global type hash, and allows us to close it at the
24621 2001-08-02 Miguel de Icaza <miguel@ximian.com>
24623 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24624 RecordInterface instead.
24626 * cs-parser.jay: Updated to reflect changes above.
24628 * decl.cs (Definition): Keep track of the TypeBuilder type that
24629 represents this type here. Not sure we will use it in the long
24630 run, but wont hurt for now.
24632 * driver.cs: Smaller changes to accomodate the new code.
24634 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24637 * rootcontext.cs (CreateInterface): New method, used to create
24638 the System.TypeBuilder type for interfaces.
24639 (ResolveInterfaces): new entry point to resolve the interface
24641 (CodeGen): Property, used to keep track of the code generator.
24643 2001-07-26 Miguel de Icaza <miguel@ximian.com>
24645 * cs-parser.jay: Add a second production for delegate_declaration
24648 (enum_body): Put an opt_comma here instead of putting it on
24649 enum_body or enum_member_declarations so we can handle trailing
24650 commas on enumeration members. Gets rid of a shift/reduce.
24652 (type_list): Need a COMMA in the middle.
24654 (indexer_declaration): Tell tokenizer to recognize get/set
24656 * Remove old targets.
24658 * Re-add the parser target.
24660 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24662 * cs-parser.jay: Add precendence rules for a number of operators
24663 ot reduce the number of shift/reduce conflicts in the grammar.
24665 2001-07-17 Miguel de Icaza <miguel@ximian.com>
24667 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24670 Get rid of old crufty code.
24672 * rootcontext.cs: Use this to keep track of the parsed
24673 representation and the defined types available to the program.
24675 * gen-treedump.cs: adjust for new convention.
24677 * type.cs: Split out the type manager, and the assembly builder
24680 * typemanager.cs: the type manager will live here now.
24682 * cil-codegen.cs: And the code generator here.
24684 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
24686 * makefile: Fixed up for easy making.
24688 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24690 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24693 (unary_expression): Expand pre_increment_expression and
24694 post_decrement_expression to reduce a shift/reduce.
24696 2001-07-11 Simon Cozens
24698 * cs-tokenizer.cs: Hex numbers should begin with a 0.
24700 Improve allow_keyword_as_indent name.
24702 2001-06-19 Miguel de Icaza <miguel@ximian.com>
24704 * Adjustments for Beta2.
24706 2001-06-13 Miguel de Icaza <miguel@ximian.com>
24708 * decl.cs: Added `Define' abstract method.
24709 (InTransit): new property, used to catch recursive definitions.
24711 * interface.cs: Implement `Define'.
24713 * modifiers.cs: Map Modifiers.constants to
24714 System.Reflection.TypeAttribute flags.
24716 * class.cs: Keep track of types and user-defined types.
24717 (BuilderInit): New method for creating an assembly
24718 (ResolveType): New function to launch the resolution process, only
24719 used by interfaces for now.
24721 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24722 that are inserted into the name space.
24724 2001-06-08 Miguel de Icaza <miguel@ximian.com>
24726 * ARGH. I have screwed up my tree so many times due to the use of
24727 rsync rather than using CVS. Going to fix this at once.
24729 * driver.cs: Objetify driver. Load assemblies, use assemblies to
24732 2001-06-07 Miguel de Icaza <miguel@ximian.com>
24734 * Experiment successful: Use System.Type rather that our own
24737 2001-05-25 Miguel de Icaza <miguel@ximian.com>
24739 * cs-parser.jay: Removed nsAliases from here.
24741 Use new namespaces, handle `using XXX;'
24743 * namespace.cs: Reimplemented namespace handling, use a recursive
24744 definition of the class. Now we can keep track of using clauses
24745 and catch invalid using clauses.
24747 2001-05-24 Miguel de Icaza <miguel@ximian.com>
24749 * gen-treedump.cs: Adapted for all the renaming.
24751 * expression.cs (Expression): this class now has a Type property
24752 which returns an expression Type.
24754 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24755 `Type', as this has a different meaning now in the base
24757 2001-05-22 Miguel de Icaza <miguel@ximian.com>
24759 * interface.cs, class.cs: Removed from all the sources the
24760 references to signature computation, as we can not do method
24761 signature computation during the parsing time, as we are not
24762 trying to solve at that point distinguishing:
24766 void a (NS.Blah x) {}
24769 Which depending on the context might be valid or not, as we do not
24770 know if Blah is the same thing as NS.Blah at that point.
24772 * Redid everything so the code uses TypeRefs now instead of
24773 Types. TypeRefs are just temporary type placeholders, that need
24774 to be resolved. They initially have a pointer to a string and the
24775 current scope in which they are used. This is used later by the
24776 compiler to resolve the reference to an actual Type.
24778 * DeclSpace is no longer a CIR.Type, and neither are
24779 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
24780 are all DeclSpaces, but no Types.
24782 * type.cs (TypeRefManager): This implements the TypeRef manager,
24783 which keeps track of all the types that need to be resolved after
24784 the parsing has finished.
24786 2001-05-13 Miguel de Icaza <miguel@ximian.com>
24788 * ARGH. We are going to have to store `foreach' as a class rather
24789 than resolving it, as we need to verify error 1579 after name
24790 resolution. *OR* we could keep a flag that says `This request to
24791 IEnumerator comes from a foreach statement' which we can then use
24792 to generate the error.
24794 2001-05-10 Miguel de Icaza <miguel@ximian.com>
24796 * class.cs (TypeContainer.AddMethod): we now add methods to the
24797 MethodGroup instead of the method hashtable.
24799 * expression.cs: Add MethodGroup abstraction, which gets us one
24800 step closer to the specification in the way we handle method
24803 * cs-parser.jay (primary_expression): qualified_identifier now
24804 tried to match up an identifier to a local variable reference or
24805 to a parameter reference.
24807 current_local_parameters is now a parser global variable that
24808 points to the current parameters for the block, used during name
24811 (property_declaration): Now creates an implicit `value' argument to
24814 2001-05-09 Miguel de Icaza <miguel@ximian.com>
24816 * parameter.cs: Do not use `param' arguments as part of the
24817 signature, per the spec.
24819 2001-05-08 Miguel de Icaza <miguel@ximian.com>
24821 * decl.cs: Base class for classes, structs and interfaces. This
24822 is the "Declaration Space"
24824 * cs-parser.jay: Use CheckDef for checking declaration errors
24825 instead of having one on each function.
24827 * class.cs: Factor out some code for handling error handling in
24828 accordance to the "Declarations" section in the "Basic Concepts"
24829 chapter in the ECMA C# spec.
24831 * interface.cs: Make all interface member classes derive from
24832 InterfaceMemberBase.
24834 2001-05-07 Miguel de Icaza <miguel@ximian.com>
24836 * Many things: all interfaces are parsed and generated in
24837 gen-treedump. Support for member variables, constructors,
24838 destructors, properties, constants is there.
24840 Beginning of the IL backend, but very little done, just there for
24843 2001-04-29 Miguel de Icaza <miguel@ximian.com>
24845 * cs-parser.jay: Fix labeled statement.
24847 * cs-tokenizer.cs (escape): Escape " and ' always.
24848 ref_line, ref_name: keep track of the line/filename as instructed
24849 by #line by the compiler.
24852 2001-04-27 Miguel de Icaza <miguel@ximian.com>
24854 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24855 to match the values in System.CodeDOM.
24857 Divid renamed to Divide.
24859 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24861 (Statements.set): remove.
24863 * System.CodeDOM/CodeCatchClause.cs: always have a valid
24866 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24867 falseStatements always have valid values.
24869 * cs-parser.jay: Use System.CodeDOM now.